Ask Your Question

AttributeError: 'dict' object has no attribute 'solve'

asked 2019-05-30 23:56:09 +0200

Maori gravatar image

updated 2019-05-30 23:56:35 +0200

How I can fix this error '''AttributeError: 'dict' object has no attribute 'solve' It appears after I tried to solve(P):

G = I.groebner_basis()
P = {}
ind = 0
for i in range (n):
    if (G[i].degree() < num):
        ind = ind+1
        P[ind] = G[i]
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2019-05-31 00:24:48 +0200

nbruin gravatar image

I don't think solve does what you hope it does. It seems from your code that you want to select elements from a groebner basis of bounded degree (I guess n is the length of G?) and want to find the solutions to those equations.

If the equations you select still define a 0-dimensional variety and you're interested in solutions that take values in the ground field, you might be able to do something like

J=ideal([f for f in I.groebner_basis() if lt num])

Putting your selected polynomials in a dictionary is probably not a good idea. You'd be better off putting them in a list, i.e.

edit flag offensive delete link more


Thank you. Firstly, I make P=[] then (in my code P based on Groebner Basis of ideal, that is why it works)

J=ideal([f for f in P])

And it helps

Maori gravatar imageMaori ( 2019-05-31 15:28:23 +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


Asked: 2019-05-30 23:56:09 +0200

Seen: 1,367 times

Last updated: May 31 '19