Reynolds Operator

1974 days ago by russellt0568

## So, the algorithm isn't completely 'self-sustaining'; anywhere with a #-EDIT-# requires some fiddling for the algo to work. ## Enter the field and the number of variables wanted. Creates the polynomial ring, and defines a vector used in the code below. FF = QQ #-EDIT-# n = 2 #-EDIT-# R = PolynomialRing(FF,n,"z_", order='lex') print(R) V = vector(var('z_%d' % i) for i in range(n)) ## Choose Generators A = Matrix(FF, [[0,1],[-1,0]]) #-EDIT-# B = Matrix(FF, [[-1,0],[0,1]]) ## Generates the group. G = MatrixGroup([A,B]) print G 
       
Multivariate Polynomial Ring in z_0, z_1 over Rational Field
Matrix group over Rational Field with 2 generators: 
 [[[0, 1], [-1, 0]], [[-1, 0], [0, 1]]]
Multivariate Polynomial Ring in z_0, z_1 over Rational Field
Matrix group over Rational Field with 2 generators: 
 [[[0, 1], [-1, 0]], [[-1, 0], [0, 1]]]
## This is the Reynolds operator itself. GG = G.order()+1 for i in range(1,GG): ##So this sets the loop structure for the degree, essentially. degs = WeightedIntegerVectors(i, [1,1]) #-EDIT-# Z = [z_0^d[0] * z_1^d[1] for d in degs] #-EDIT-## What this does is creates all the monomials of degree i for z in Z: F = 0 ## reset F to 0 f(z_0,z_1) = z #-EDIT-## so now we pick one of the monomials of degree i. for g in G: ## for the given monomial, we cycle through the group and evaluate f, v = g*V ## while iteratively redefining F F = F + f(*v) F = F/G.order() print f(*V) ## Here, we divide by the group order. print "------------->",F ## And start printing off the results; ## it prints off both the monomial and the corresponding "Reynolds" polynomial 
       
z_1
-------------> 0
z_0
-------------> 0
z_1^2
-------------> 1/2*z_0^2 + 1/2*z_1^2
z_0*z_1
-------------> 0
z_0^2
-------------> 1/2*z_0^2 + 1/2*z_1^2
z_1^3
-------------> 0
z_0*z_1^2
-------------> 0
z_0^2*z_1
-------------> 0
z_0^3
-------------> 0
z_1^4
-------------> 1/2*z_0^4 + 1/2*z_1^4
z_0*z_1^3
-------------> 0
z_0^2*z_1^2
-------------> z_0^2*z_1^2
z_0^3*z_1
-------------> 0
z_0^4
-------------> 1/2*z_0^4 + 1/2*z_1^4
z_1^5
-------------> 0
z_0*z_1^4
-------------> 0
z_0^2*z_1^3
-------------> 0
z_0^3*z_1^2
-------------> 0
z_0^4*z_1
-------------> 0
z_0^5
-------------> 0
z_1^6
-------------> 1/2*z_0^6 + 1/2*z_1^6
z_0*z_1^5
-------------> 0
z_0^2*z_1^4
-------------> 1/2*z_0^4*z_1^2 + 1/2*z_0^2*z_1^4
z_0^3*z_1^3
-------------> 0
z_0^4*z_1^2
-------------> 1/2*z_0^4*z_1^2 + 1/2*z_0^2*z_1^4
z_0^5*z_1
-------------> 0
z_0^6
-------------> 1/2*z_0^6 + 1/2*z_1^6
z_1^7
-------------> 0
z_0*z_1^6
-------------> 0
z_0^2*z_1^5
-------------> 0
z_0^3*z_1^4
-------------> 0
z_0^4*z_1^3
-------------> 0
z_0^5*z_1^2
-------------> 0
z_0^6*z_1
-------------> 0
z_0^7
-------------> 0
z_1^8
-------------> 1/2*z_0^8 + 1/2*z_1^8
z_0*z_1^7
-------------> 0
z_0^2*z_1^6
-------------> 1/2*z_0^6*z_1^2 + 1/2*z_0^2*z_1^6
z_0^3*z_1^5
-------------> 0
z_0^4*z_1^4
-------------> z_0^4*z_1^4
z_0^5*z_1^3
-------------> 0
z_0^6*z_1^2
-------------> 1/2*z_0^6*z_1^2 + 1/2*z_0^2*z_1^6
z_0^7*z_1
-------------> 0
z_0^8
-------------> 1/2*z_0^8 + 1/2*z_1^8
z_1
-------------> 0
z_0
-------------> 0
z_1^2
-------------> 1/2*z_0^2 + 1/2*z_1^2
z_0*z_1
-------------> 0
z_0^2
-------------> 1/2*z_0^2 + 1/2*z_1^2
z_1^3
-------------> 0
z_0*z_1^2
-------------> 0
z_0^2*z_1
-------------> 0
z_0^3
-------------> 0
z_1^4
-------------> 1/2*z_0^4 + 1/2*z_1^4
z_0*z_1^3
-------------> 0
z_0^2*z_1^2
-------------> z_0^2*z_1^2
z_0^3*z_1
-------------> 0
z_0^4
-------------> 1/2*z_0^4 + 1/2*z_1^4
z_1^5
-------------> 0
z_0*z_1^4
-------------> 0
z_0^2*z_1^3
-------------> 0
z_0^3*z_1^2
-------------> 0
z_0^4*z_1
-------------> 0
z_0^5
-------------> 0
z_1^6
-------------> 1/2*z_0^6 + 1/2*z_1^6
z_0*z_1^5
-------------> 0
z_0^2*z_1^4
-------------> 1/2*z_0^4*z_1^2 + 1/2*z_0^2*z_1^4
z_0^3*z_1^3
-------------> 0
z_0^4*z_1^2
-------------> 1/2*z_0^4*z_1^2 + 1/2*z_0^2*z_1^4
z_0^5*z_1
-------------> 0
z_0^6
-------------> 1/2*z_0^6 + 1/2*z_1^6
z_1^7
-------------> 0
z_0*z_1^6
-------------> 0
z_0^2*z_1^5
-------------> 0
z_0^3*z_1^4
-------------> 0
z_0^4*z_1^3
-------------> 0
z_0^5*z_1^2
-------------> 0
z_0^6*z_1
-------------> 0
z_0^7
-------------> 0
z_1^8
-------------> 1/2*z_0^8 + 1/2*z_1^8
z_0*z_1^7
-------------> 0
z_0^2*z_1^6
-------------> 1/2*z_0^6*z_1^2 + 1/2*z_0^2*z_1^6
z_0^3*z_1^5
-------------> 0
z_0^4*z_1^4
-------------> z_0^4*z_1^4
z_0^5*z_1^3
-------------> 0
z_0^6*z_1^2
-------------> 1/2*z_0^6*z_1^2 + 1/2*z_0^2*z_1^6
z_0^7*z_1
-------------> 0
z_0^8
-------------> 1/2*z_0^8 + 1/2*z_1^8