Ask Your Question

sagemathuser's profile - activity

2022-11-20 17:34:10 +0200 received badge  Notable Question (source)
2022-11-20 17:34:10 +0200 received badge  Popular Question (source)
2022-06-12 12:41:54 +0200 received badge  Notable Question (source)
2020-12-14 18:35:44 +0200 received badge  Popular Question (source)
2018-06-14 19:14:30 +0200 received badge  Good Question (source)
2018-06-14 19:06:34 +0200 commented answer How to compute common zeros of system of polynomial equations with dimension 2?

Thank you for your answer. Seems like calling variety() is much faster! Nice solution. Thanks again!

2018-06-14 19:05:26 +0200 received badge  Nice Question (source)
2018-06-14 18:30:35 +0200 commented question How to compute common zeros of system of polynomial equations with dimension 2?

@tmonteil:

R.<x0,x1,x2,x3> = PolynomialRing(GF(2**7,name="a"),order="lex") 
F7 = [(4*f).polynomial(GF(2**7,name="a")) for f in homInvar(6)]
J = R.ideal(F7)
2018-06-14 17:20:25 +0200 commented question How to compute common zeros of system of polynomial equations with dimension 2?

@tmonteil: I have added some code. Currently I am experimenting with the zeros of the variety.

2018-06-14 17:19:22 +0200 received badge  Editor (source)
2018-06-14 12:49:21 +0200 asked a question How to compute common zeros of system of polynomial equations with dimension 2?

I have some ideal of homogenous polynomials defined over some finite field: J is the ideal of interest. However I can't call J.variety() since it is not zero dimensional. The system of equations might contain 6 or 231 polynomials in four variables:

  sage: [I.gens() for I in J.minimal_associated_primes()]
  [[x1 + x2, x0 + x3], [x2 + x3, x0 + x1], [x1 + x3, x0 + x2]]
  sage: J.dimension()
  2

Any ideas?

On request. The program computes the invariant under the group $2_{+}^{1+2\cdot2}$ homogenous polynomials of given degree. To construct the polynomials and get a list of them call: homInvar(6):

F = ZZ; 
a = matrix(F, [[0,0,0,-1],[0,0,1,0],[0,-1,0,0],[1,0,0,0]])
b = matrix(F, [[1,0,0,0],[0,1,0,0],[0,0,-1,0],[0,0,0,-1]])
c = matrix(F, [[0,1,0,0],[-1,0,0,0],[0,0,0,1],[0,0,-1,0]])
d = matrix(F, [[0,1,0,0],[1,0,0,0],[0,0,0,-1],[0,0,-1,0]])

def getPart(deg):
    part = []
    for k in range(deg+1):
        for l in range(deg+1):
            for m in range(deg+1):
                for n in range(deg+1):
                    if k+l+m+n == deg:
                        part.append((k,l,n,m))
    return part

def p(x,part):
    x = x.list()
    pol = 0
    for p in [part]:
        mon = 1
        for i in range(len(p)):
            k = p[i]
            mon = mon * x[i]**k
        pol = pol + mon
    return pol

def getGroup():
    G = []
    for k in range(4):
        for l in range(4):
            for m in range(4):
                for n in range(4):
                    g = a**k*b**l*c**m*d**n
                    if G.count(g)==0:
                        G.append(g)
    return G

def reynolds(Gr,part):
    reyn = 0
    n = len(part)
    X = list(var('x%d' % i) for i in range(n))
    x = matrix([X]).transpose()
    for g in Gr:
        reyn +=  p(g*x,part=part)
        #print reyn
    return 1/len(Gr)* reyn

def homInvar(deg,Gr=getGroup(),getPart=getPart):
    parts = getPart(deg)
    inv = set([])
    for part in parts:
        r = reynolds(Gr,part)
        #print r
        if r != 0:
            inv.add(r)
    return inv
2018-06-13 19:34:54 +0200 received badge  Scholar (source)
2018-06-13 19:34:52 +0200 received badge  Supporter (source)
2018-06-13 17:29:49 +0200 received badge  Student (source)
2018-06-13 17:27:16 +0200 asked a question How to iterate over finite fields

In my current code I have to iterate over $GF(2^7)$ four times:

en1 = enumerate(gf)
en2 = enumerate(gf)
en3 = enumerate(gf)
en4 = enumerate(gf)

for i,x0 in en1:
    for j,x1 in en2:
        for k,x2 in en3:
            for m,x3 in en4:

In the loop I evaluate some multivariate polynomial. But this is very memory hungry. Is there any better way to do this?