Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

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[0].parent()
    F = sys[0].lc().parent()   # base ring

    J = R.ideal( sys )

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

    T = list()

    v = vars[0]
    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] != 0

    pol = F[v](B[0])       # 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[0].parent()
    F = sys[0].lc().parent()   # base ring

    J = R.ideal( sys )

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

    T = list()

    v = vars[0]
    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] != 0

    pol = F[v](B[0])       # 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[0].parent()
    F = sys[0].lc().parent()   # base ring

    J = R.ideal( sys )

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

    T = list()

    v = vars[0]
    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] != 0

    pol = F[v](B[0])       # 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[0].parent()
    F = sys[0].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[0]
    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] != 0

    pol = F[v](B[0])       # 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[0].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[0]
    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] != 0

    pol = F[v](B[0])       # 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[0]
    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] != 0

    pol = F[v](B[0])       # 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[0]
    nvars = vars[1:]

    B = J.elimination_ideal(nvars).basis

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

    pol = F[v](B[0])       # 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[0]
    nvars = vars[1:]

    B = J.elimination_ideal(nvars).basis

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

    pol = F[v](B[0])       # 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[0]
    nvars = vars[1:]

    B = J.elimination_ideal(nvars).basis

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

    pol = F[v](B[0])       # 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[0]
    nvars = vars[1:]

    B = J.elimination_ideal(nvars).basis

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

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

    for q,_ in pol.roots():
B[0].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

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 myroots(p):
    return p.roots(multiplicities=False)

def myvariety(sys,vars=None):
    J = ideal( sys )
    R = J.ring()

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

    T = list()

    v = vars[0]
    nvars = vars[1:]

    B = J.elimination_ideal(nvars).basis

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

    for q,_ in B[0].univariate_polynomial().roots():
myroots(B[0].univariate_polynomial()):
        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 myroots(p):
    return p.roots(multiplicities=False)

def myvariety(sys,vars=None):
    J = ideal( sys )
    R = J.ring()

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

    T = list()

    v = vars[0]
    nvars = vars[1:]

    B = J.elimination_ideal(nvars).basis

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

    for q,_ q in myroots(B[0].univariate_polynomial()):
        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 myroots(p):
    return p.roots(multiplicities=False)

def myvariety(sys,vars=None):
    J = ideal( sys )
    R = J.ring()

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

    T = list()

    v = vars[0]
    nvars = vars[1:]

    B = J.elimination_ideal(nvars).basis

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

    for q in myroots(B[0].univariate_polynomial()):
        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 myroots(p):
    return p.roots(multiplicities=False)

def myvariety(sys,vars=None):
    J = ideal( sys )
    R = J.ring()

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

    T = list()

    v = vars[0]
    nvars = vars[1:]

    B = J.elimination_ideal(nvars).basis

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

    for q in myroots(B[0].univariate_polynomial()):
        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 myroots(p):
    return p.roots(multiplicities=False)

def myvariety(sys,vars=None):
    J = ideal( sys )
    R = J.ring()

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

    T = list()

    v = vars[0]
    nvars = vars[1:]

    B = J.elimination_ideal(nvars).basis

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

    for q in myroots(B[0].univariate_polynomial()):
        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 myroots(p):
    return p.roots(multiplicities=False)

def myvariety(sys,vars=None):
    J = ideal( sys )
    R = J.ring()

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

    T = list()

    v = vars[0]
    nvars = vars[1:]

    B = J.elimination_ideal(nvars).basis

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

    for q in myroots(B[0].univariate_polynomial()):
        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