Ask Your Question
1

unable to convert ... to a symbolic expression

asked 2023-06-05 18:48:50 +0200

rrogers gravatar image

Why does this error out?

abc,ABC=var('abc ABC')
aa=[abc^2,ABC];print(aa)
SR(aa[0:1])

After a lot of reporting

TypeError: unable to convert [abc^2, ABC] to a symbolic expression

The original problem was trying to access the ideal .. groebner_basis()
The Groebner part worked but I want to manipulate the output, and I got this error. So far, this code fails on 9.7, 9.8, 10.0 A pointed reference would be fine sorry

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2023-06-05 19:11:15 +0200

Max Alekseyev gravatar image

aa[0:1] is a list composed of just one element. Conversion of a list into SR in not defined. Do you mean SR(aa[0]) by any chance?

As for groebner_basis(), it's unclear why do you need symbolic expressions as ideals and Groebner bases are defined over polynomial rings, and typically do not require any conversion to symbolic ring.

edit flag offensive delete link more

Comments

Your right and I finally extracted that from the incoming :)
Your question is relevant.
construct an aa=ideal(...).groebner_basis()
Then try
solve(aa, for_this_or that)
It will fail; whereas print(aa) and copy/paste on screen and it works. If that is not clear, I will shrink my problem and post an example. Obviously, I want to automate that:)

rrogers gravatar imagerrogers ( 2023-06-05 23:49:47 +0200 )edit

Typically one won't need to use solve() function while working with polynomial ideals. Use .variety() method instead.

Max Alekseyev gravatar imageMax Alekseyev ( 2023-06-06 05:58:20 +0200 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2023-06-05 18:48:50 +0200

Seen: 160 times

Last updated: Jun 05 '23