Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download

Compare leading terms Type B and Type A

Project: combo
Views: 67
n = ; k = 1; def TypeBSymIdeal(n,k): # returns ideal I_{n,k} of type B if not(n >=k & k >0): raise Error('The ideal I_{n,k} must have n >= k, and n, k are positive integers') R = PolynomialRing(QQ,n,'x', order='lex') # note that lex order is on e = SymmetricFunctions(QQ).e() # L1 is the list of elementary symmetric polys e_i in n variables x_i^2 from i = n to i = n - k + 1 L = [e([n-j]).expand(n) for j in range(0,k)] # load the ones in x_i first L1 = [sum([L[j2].monomials()[j1]^2 for j1 in range(0,len(L[j2].monomials()))]) for j2 in range(0,len(L))] # now make it in terms of x_i^2 # L2 is the list of the indeterminates to the kth power if n == 1: L2 = [x] # when n = 1, there is only one indeterminate, automatically named "x" else: L2 = [var('x%d' %(j))^(2*k+1) for j in range(0,n)] return R*(L1 + L2) def SymIdeal(n,k): # returns ideal I_{n,k} assert n >= k & k > 0 R = PolynomialRing(QQ,n,'x', order='lex') e = SymmetricFunctions(QQ).e() # L1 is the list of elementary symmetric polys e_i in n variables from i = n to i = n - k + 1 L1 = [e([n-j]).expand(n) for j in range(0,k)] # L2 is the list of the indeterminates to the kth power if n == 1: L2 = [x] # when n = 1, there is only one indeterminate, automatically named "x" else: L2 = [var('x%d' %(j))^k for j in range(0,n)] return R*(L1 + L2) def LeadingTerms(L): # returns list of leading terms of each polynomial in a list return [L[j].lt() for j in range(0,len(L))] I = TypeBSymIdeal(n,k); L = I.groebner_basis(); T = LeadingTerms(L); show(T) # For Type B
[x03\displaystyle x_{0}^{3}, x02x12x22\displaystyle x_{0}^{2} x_{1}^{2} x_{2}^{2}, x13\displaystyle x_{1}^{3}, x23\displaystyle x_{2}^{3}]
I2 = SymIdeal(n,k); L2 = I2.groebner_basis(); T2 = LeadingTerms(L2); show(T2) # For Type A
[x0\displaystyle x_{0}, x1\displaystyle x_{1}, x2\displaystyle x_{2}]