Ask Your Question
0

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

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

Maori gravatar image

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

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]
solve(P)
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

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

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 f.degree() lt num])
J.variety()

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.

P=[]
...
    P.append(G[i])
    ...
edit flag offensive delete link more

Comments

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])
J.variety()

And it helps

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

Seen: 1,455 times

Last updated: May 31 '19