┌────────────────────────────────────────────────────────────────────┐ │ SageMath version 7.4, Release Date: 2016-10-18 │ │ Type "notebook()" for the browser-based notebook interface. │ │ Type "help()" for help. │ └────────────────────────────────────────────────────────────────────┘ sage: IntegerModRing(2) Ring of integers modulo 2 sage: R1 = IntegerModRing(2) sage: R1['x'] Univariate Polynomial Ring in x over Ring of integers modulo 2 (using NTL) sage: R1['x,y,z'] Multivariate Polynomial Ring in x, y, z over Ring of integers modulo 2 sage: R2 = R1['x'] sage: R2.gens() (x,) sage: R2.gen() x sage: x = R2.gen() sage: R2.ideal(1+x+x^2) Principal ideal (x^2 + x + 1) of Univariate Polynomial Ring in x over Ring of integers modulo 2 (using NTL) sage: I1 = R2.ideal(1+x+x^2) sage: R2.quotient(I1) Univariate Quotient Polynomial Ring in xbar over Ring of integers modulo 2 with modulus x^2 + x + 1 sage: R3 = R2.quotient(I1) sage: R3.gens() (xbar,) sage: one = R3.one() sage: one 1 sage: 1 1 sage: one == 1 True sage: 1.parent() Integer Ring sage: one.parent() Univariate Quotient Polynomial Ring in xbar over Ring of integers modulo 2 with modulus x^2 + x + 1 sage: R3.gens() (xbar,) sage: xbar = R3.gen() sage: [[y*z for y in [0,one,xbar,one+xbar]] for z in [0,one,xbar, ....: one+xbar]] [[0, 0, 0, 0], [0, 1, xbar, xbar + 1], [0, xbar, xbar + 1, 1], [0, xbar + 1, 1, xbar]] sage: [[y+z for y in [0,one,xbar,one+xbar]] for z in [0,one,xbar, ....: one+xbar]] [[0, 1, xbar, xbar + 1], [1, 0, xbar + 1, xbar], [xbar, xbar + 1, 0, 1], [xbar + 1, xbar, 1, 0]] sage: I1.is_maximal() True sage: R3.is_field() True sage: R4 = RR['x'] sage: R4 Univariate Polynomial Ring in x over Real Field with 53 bits of precision sage: R4 = QQ['x'] sage: R4 Univariate Polynomial Ring in x over Rational Field sage: R4 = RR['x'] sage: CC Complex Field with 53 bits of precision sage: R4 Univariate Polynomial Ring in x over Real Field with 53 bits of precision sage: x = R4.gen() sage: R4.quotient(R4.ideal(1+x^2)) Univariate Quotient Polynomial Ring in xbar over Real Field with 53 bits of precision with modulus x^2 + 1.00000000000000 sage: R5 = R4.quotient(R4.ideal(1+x^2)) sage: R5.is_field() True sage: xbar = R5.gen() sage: (3+2*xbar)*(3/13-2/13*xbar) 1.00000000000000 sage: _.parent() Univariate Quotient Polynomial Ring in xbar over Real Field with 53 bits of precision with modulus x^2 + 1.00000000000000 sage: (3+2*xbar)*(3/13-2/13*xbar)==R5.one() True