ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Mon, 23 Nov 2020 23:19:48 +0100latex of elements of multivariate polynomial quotient ringhttps://ask.sagemath.org/question/54375/latex-of-elements-of-multivariate-polynomial-quotient-ring/Here is a block of code:
R = PolynomialRing(QQ, 'a, b, c')
a, b, c = R.gens()
I = R.ideal(a**2 + a + 1)
S = R.quotient(I, names=R.variable_names()).fraction_field()
a, b, c = S.gens()
show(a**2/b**3) # this looks wrong
latex(a) # = \text{\texttt{a}}, should just be `a`RoadMon, 23 Nov 2020 23:19:48 +0100https://ask.sagemath.org/question/54375/How to base change from a PolynomialRing to that Ring with one variable evaluated, i.e., from Q[x,y] to Q[x,y]/(x=0) = Q[y]?https://ask.sagemath.org/question/50978/how-to-base-change-from-a-polynomialring-to-that-ring-with-one-variable-evaluated-ie-from-qxy-to-qxyx0-qy/I am trying to base change a Laurent series ring element from its base ring, Q[u1, u2, u3], to a quotient of its base ring, Q[u2, u3], but I am quite confused in forming this quotient. My setting is this:
S.<u1,u2,u3> = QQ[]
L.<z> = LaurentSeriesRing(S);
f = -4*z - 4/5*u1*z^5 + (-4/9*u1^2 - 8/9*u2)*z^9 + (-4/13*u1^3 - 24/13*u1*u2 - 12/13*u3)*z^13 + (-4/17*u1^4 - 48/17*u1^2*u2 - 24/17*u2^2 - 48/17*u1*u3 + 16/17*u1 + 16/17*u2 + 16/17*u3 + 16/17)*z^17 + O(z^20)
In other words, I wish to set u1 = 0, and look at f over that ring. I tried the following two things, which spit out f unchanged.
f.change_ring(S.quo(u1))
R = S.quotient(u1)
f.change_ring(R)
I also tried the following which gives an attribute error:
f.reduce(u1)
I am completely stuck and would deeply appreciate any help. I would also like to eventually set u2 = 0 and look at f over that ring, which I mention at the off chance that this changes the answer at all.masseygirlFri, 24 Apr 2020 03:00:38 +0200https://ask.sagemath.org/question/50978/Iterate over multivariate polynomials over finite fieldshttps://ask.sagemath.org/question/50136/iterate-over-multivariate-polynomials-over-finite-fields/Say we have a finite field, e.g. $F_4$, and consider the $n$-ary polynomials $R=F_4[x_1,\dots,x_n]$ over this field.
I want to iterate over all these polynomials in $R$. Since the polynomials are over a finite field there are only finitely many different polynomials (considered as functions $F_4^n \to F_4$). How can I do this?
For $n=1$ I could do
R.<x> = PolynomialRing(GF(4))
S.<a> = R.quo(sage.rings.ideal.FieldIdeal(R))
S.is_finite()
Then I could iterate over $S$ and simply lift all the elements from $S$ back to $R$, i.e. s.lift(). The same thing however does not work for several polynomials:
R.<x,y> = PolynomialRing(GF(4))
S.<a,b> = R.quo(sage.rings.ideal.FieldIdeal(R))
S.is_finite()
yields the error
> AttributeError: 'super' object has no attribute 'is_finite'
As an alternative I could manually generate all multivariate polynomials with exponents less than the order of the field. However, this seems quite tedious and like a very "un-sage"/not algebraic way.philipp7Mon, 02 Mar 2020 15:27:09 +0100https://ask.sagemath.org/question/50136/Tensor Product of Quotient Ringshttps://ask.sagemath.org/question/49835/tensor-product-of-quotient-rings/ I would like to know how to do a tensor product of two quotient rings in Sage. I have the following toy example that I am using to try and understand the concept
R = PolynomialRing(QQ,2,'x')
R.inject_variables()
IR = ideal(x0^2-x1^3)
QR = QuotientRing(R,IR)
S = PolynomialRing(QQ,3,'x')
S.inject_variables()
IS = ideal(x0*x1-x2^2)
QS = QuotientRing(R,IS)
Both rings are in the variables labeled by x, but I would like to treat each set of variables as if they are different. Any help would be appreciated!BarkFri, 07 Feb 2020 07:05:04 +0100https://ask.sagemath.org/question/49835/Defining AES MixColumns in Sagehttps://ask.sagemath.org/question/40189/defining-aes-mixcolumns-in-sage/AES is a famous cipher. It has an operation called MixColumns (See Wikipedia entry Rijndael MixColumns) where operations take place over finite fields.
Actually, there's a specific polynomial $a(x) = a_3x^{3}+a_2x^{2}+a_1x+a_0$ whose coefficients belong to $GF(2^8)$. MixColumns is defined between $a(x)$ and any polynomial $b(x) = b_{3}x^{3}+b_{2}x^{2}+b_{1}x+b_{0}$ (whose coefficients belong to $GF(2^8)$ as well): It first multiplies $a(x)$ by $b(x)$ (where the algebraic rules between coefficients are governed by $GF(2^8)$), and then computes the remainder modulo $x^4 + 1$.
I tried to mimic the operations in Sage as follows:
R.<x> = PolynomialRing(GF(2), 'x')
S.<y> = QuotientRing(R, R.ideal(x^8+x^4+x^3+x+1))
T.<z> = QuotientRing(S, S.ideal(y^4+1))
But Sage displays an error on the last line. The error seems to be originating from the introduction of `z`. If I replace the last line with, say, `T = QuotientRing(S, S.ideal(y^4+1))`, the error goes away. Yet this is not what I intended.
Furthermore, the command `S.ideal(y^4+1)` outputs:
> Principal ideal (1) of Univariate Quotient Polynomial Ring in y over Finite Field of size 2 with modulus x^8 + x^4 + x^3 + x + 1
I don't understand why its is the principal ideal (1) rather than the principal ideal (y^4+1).msdoustiSat, 16 Dec 2017 21:27:52 +0100https://ask.sagemath.org/question/40189/