# Revision history [back]

While there is a bug in Singular preventing from using the built-in .variety() method, I've done my own quick-n-dirty alternative implementation of this method. In your example just run myvariety( Eq[0,0].coefficients() + Eq[1,0].coefficients() + [q^4+q for q in K.gens()] )to get its variety with 128 solutions in a minute or so.

def myvariety(sys,vars=None):
R = sys.parent()
F = sys.lc().parent()   # base ring

J = R.ideal( sys )

if vars==None:
vars = R.gens()
if len(vars)==0:
return([dict()])

T = list()

v = vars
nvars = vars[1:]

if len(nvars)>0:
B = J.elimination_ideal(nvars).basis
else:
B = J.groebner_basis()

assert len(B) == 1
assert B != 0

pol = F[v](B)       # converting to univariate polynomial

for q,_ in pol.roots():
S = myvariety( [r.subs({v:q}) for r in sys], nvars )
for s in S:
s.update({v:q})
T += S
return T


While there is a bug in Singular Singular preventing from using the built-in .variety() method, I've done my own quick-n-dirty alternative implementation of this method. In your example just run myvariety( Eq[0,0].coefficients() + Eq[1,0].coefficients() + [q^4+q for q in K.gens()] )to get its variety with 128 solutions in a minute or so.

def myvariety(sys,vars=None):
R = sys.parent()
F = sys.lc().parent()   # base ring

J = R.ideal( sys )

if vars==None:
vars = R.gens()
if len(vars)==0:
return([dict()])

T = list()

v = vars
nvars = vars[1:]

if len(nvars)>0:
B = J.elimination_ideal(nvars).basis
else:
B = J.groebner_basis()

assert len(B) == 1
assert B != 0

pol = F[v](B)       # converting to univariate polynomial

for q,_ in pol.roots():
S = myvariety( [r.subs({v:q}) for r in sys], nvars )
for s in S:
s.update({v:q})
T += S
return T


While there is a bug in Singular preventing from using the built-in .variety() method, I've done my own quick-n-dirty alternative implementation of this method. In your example just run myvariety( Eq[0,0].coefficients() + Eq[1,0].coefficients() + [q^4+q for q in K.gens()] )to get its the corresponding variety with 128 solutions points in a minute or so.

def myvariety(sys,vars=None):
R = sys.parent()
F = sys.lc().parent()   # base ring

J = R.ideal( sys )

if vars==None:
vars = R.gens()
if len(vars)==0:
return([dict()])

T = list()

v = vars
nvars = vars[1:]

if len(nvars)>0:
B = J.elimination_ideal(nvars).basis
else:
B = J.groebner_basis()

assert len(B) == 1
assert B != 0

pol = F[v](B)       # converting to univariate polynomial

for q,_ in pol.roots():
S = myvariety( [r.subs({v:q}) for r in sys], nvars )
for s in S:
s.update({v:q})
T += S
return T


While there is a bug in Singular preventing from using the built-in .variety() method, I've done my own quick-n-dirty alternative implementation of this method. In your example just run myvariety( Eq[0,0].coefficients() + Eq[1,0].coefficients() + [q^4+q for q in K.gens()] )to get the corresponding variety with 128 points in a minute or so.

def myvariety(sys,vars=None):
R = sys.parent()
F = sys.lc().parent()   # base ring

J = R.ideal( ideal( sys )
R = J.ring()

if vars==None:
vars = R.gens()
if len(vars)==0:
return([dict()])

T = list()

v = vars
nvars = vars[1:]

if len(nvars)>0:
B = J.elimination_ideal(nvars).basis
else:
B = J.groebner_basis()

assert len(B) == 1
assert B != 0

pol = F[v](B)       # converting to univariate polynomial

for q,_ in pol.roots():
S = myvariety( [r.subs({v:q}) for r in sys], nvars )
for s in S:
s.update({v:q})
T += S
return T


While there is a bug in Singular preventing from using the built-in .variety() method, I've done my own quick-n-dirty alternative implementation of this method. In your example just run myvariety( Eq[0,0].coefficients() + Eq[1,0].coefficients() + [q^4+q for q in K.gens()] )to get the corresponding variety with 128 points in a minute or so.

def myvariety(sys,vars=None):
J = ideal( sys )
R = J.ring()
F = sys.lc().parent() R.base_ring()           # base ring

J = ideal( sys )
R = J.ring()

if vars==None:
vars = R.gens()
if len(vars)==0:
return([dict()])

T = list()

v = vars
nvars = vars[1:]

if len(nvars)>0:
B = J.elimination_ideal(nvars).basis
else:
B = J.groebner_basis()

assert len(B) == 1
assert B != 0

pol = F[v](B)       # converting to univariate polynomial

for q,_ in pol.roots():
S = myvariety( [r.subs({v:q}) for r in sys], nvars )
for s in S:
s.update({v:q})
T += S
return T


While there is a bug in Singular preventing from using the built-in .variety() method, I've done my own quick-n-dirty alternative implementation of this method. In your example just run myvariety( Eq[0,0].coefficients() + Eq[1,0].coefficients() + [q^4+q for q in K.gens()] )to get the corresponding variety with 128 points in a minute or so.

def myvariety(sys,vars=None):
J = ideal( sys )
R = J.ring()
F = R.base_ring()           # base ring

if vars==None:
vars = R.gens()
if len(vars)==0:
return([dict()])

T = list()

v = vars
nvars = vars[1:]

if len(nvars)>0:
B = J.elimination_ideal(nvars).basis
else:
B = J.groebner_basis()

assert len(B) == 1
assert B != 0

pol = F[v](B)       # converting to univariate polynomial

for q,_ in pol.roots():
S = myvariety( [r.subs({v:q}) for r in sys], nvars )
for s in S:
s.update({v:q})
T += S
return T


While there is a bug in Singular preventing from using the built-in .variety() method, I've done my own quick-n-dirty alternative implementation of this method. In your example just run myvariety( Eq[0,0].coefficients() + Eq[1,0].coefficients() + [q^4+q for q in K.gens()] )to get the corresponding variety with 128 points in a minute or so.

def myvariety(sys,vars=None):
J = ideal( sys )
R = J.ring()
F = R.base_ring()           # base ring

if vars==None:
vars = R.gens()
if len(vars)==0:
return([dict()])

T = list()

v = vars
nvars = vars[1:]

B = J.elimination_ideal(nvars).basis

assert len(B) == 1
assert B != 0

pol = F[v](B)       # converting to univariate polynomial

for q,_ in pol.roots():
S = myvariety( [r.subs({v:q}) for r in sys], J.interreduced_basis()], nvars )
for s in S:
s.update({v:q})
T += S
return T


While there is a bug in Singular preventing from using the built-in .variety() method, I've done my own quick-n-dirty alternative implementation of this method.

In your example just run myvariety( Eq[0,0].coefficients() + Eq[1,0].coefficients() + [q^4+q for q in K.gens()] )to get the corresponding variety with 128 points in a minute or so.so. In fact, the variety here represents a vector space over $\mathrm{GF}(2)$ spanned by 7 vectors (and $128 = 2^7$).

def myvariety(sys,vars=None):
J = ideal( sys )
R = J.ring()
F = R.base_ring()           # base ring

if vars==None:
vars = R.gens()
if len(vars)==0:
return([dict()])

T = list()

v = vars
nvars = vars[1:]

B = J.elimination_ideal(nvars).basis

assert len(B) == 1
assert B != 0

pol = F[v](B)       # converting to univariate polynomial

for q,_ in pol.roots():
S = myvariety( [r.subs({v:q}) for r in J.interreduced_basis()], nvars )
for s in S:
s.update({v:q})
T += S
return T


While there is a bug in Singular preventing from using the built-in .variety() method, I've done my own quick-n-dirty alternative implementation of this method.

In your example just run myvariety( Eq[0,0].coefficients() + Eq[1,0].coefficients() + [q^4+q for q in K.gens()] )to get the corresponding variety with 128 points of size $128$ in a minute or so. In fact, the variety here represents a vector space over $\mathrm{GF}(2)$ spanned by 7 vectors (and $128 = 2^7$).

def myvariety(sys,vars=None):
J = ideal( sys )
R = J.ring()
F = R.base_ring()           # base ring

if vars==None:
vars = R.gens()
if len(vars)==0:
return([dict()])

T = list()

v = vars
nvars = vars[1:]

B = J.elimination_ideal(nvars).basis

assert len(B) == 1
assert B != 0

pol = F[v](B)       # converting to univariate polynomial

for q,_ in pol.roots():
S = myvariety( [r.subs({v:q}) for r in J.interreduced_basis()], nvars )
for s in S:
s.update({v:q})
T += S
return T


While there is a bug in Singular preventing from using the built-in .variety() method, I've done my own quick-n-dirty alternative implementation of this method.

In your example just run myvariety( Eq[0,0].coefficients() + Eq[1,0].coefficients() + [q^4+q for q in K.gens()] )to get the corresponding variety of size $128$ in a minute or so. In fact, the variety here represents a vector space over $\mathrm{GF}(2)$ spanned by 7 vectors (and $128 = 2^7$).

def myvariety(sys,vars=None):
J = ideal( sys )
R = J.ring()
F = R.base_ring()           # base ring

if vars==None:
vars = R.gens()
if len(vars)==0:
return([dict()])

T = list()

v = vars
nvars = vars[1:]

B = J.elimination_ideal(nvars).basis

assert len(B) == 1
assert B != 0

pol = F[v](B)       # converting to univariate polynomial

for q,_ in pol.roots():
B.univariate_polynomial().roots():
S = myvariety( [r.subs({v:q}) for r in J.interreduced_basis()], nvars )
for s in S:
s.update({v:q})
T += S
return T