矩阵环

在Sage中如何在有限环上构造矩阵环?这个 MatrixSpace 构造函数接受任何环作为基环。下面是一个语法示例:

sage: R = IntegerModRing(51)
sage: M = MatrixSpace(R,3,3)
sage: M(0)
[0 0 0]
[0 0 0]
[0 0 0]
sage: M(1)
[1 0 0]
[0 1 0]
[0 0 1]
sage: 5*M(1)
[5 0 0]
[0 5 0]
[0 0 5]

多项式环

在Sage中如何构造有限域上的多项式环?下面是一个例子:

sage: R = PolynomialRing(GF(97),'x')
sage: x = R.gen()
sage: f = x^2+7
sage: f in R
True

下面是一个使用单数接口的示例:

sage: R = singular.ring(97, '(a,b,c,d)', 'lp')
sage: I = singular.ideal(['a+b+c+d', 'ab+ad+bc+cd', 'abc+abd+acd+bcd', 'abcd-1'])
sage: R
polynomial ring, over a field, global ordering
//   coefficients: ZZ/97
//   number of vars : 4
//        block   1 : ordering lp
//                  : names    a b c d
//        block   2 : ordering C
sage: I
a+b+c+d,
a*b+a*d+b*c+c*d,
a*b*c+a*b*d+a*c*d+b*c*d,
a*b*c*d-1

下面是使用GAP的另一种方法:

sage: R = gap.new("PolynomialRing(GF(97), 4)"); R
PolynomialRing( GF(97), ["x_1", "x_2", "x_3", "x_4"] )
sage: I = R.IndeterminatesOfPolynomialRing(); I
[ x_1, x_2, x_3, x_4 ]
sage: vars = (I.name(), I.name(), I.name(), I.name())
sage: _ = gap.eval(
....:     "x_0 := %s[1];; x_1 := %s[2];; x_2 := %s[3];;x_3 := %s[4];;"
....:     % vars)
sage: f = gap.new("x_1*x_2+x_3"); f
x_2*x_3+x_4
sage: f.Value(I,[1,1,1,1])
Z(97)^34

\(p\) -adic编号

你是怎么构造的 \(p\) -萨奇语中的adics?在这方面已经取得了很大的进展(见大卫·哈维和大卫·罗的Sage会谈)。这里只给出几个最简单的例子。

求环的特征和剩余类域 Zp 的整数 Qp ,使用以下示例所示的语法。

sage: K = Qp(3)
sage: K.residue_class_field()
Finite Field of size 3
sage: K.residue_characteristic()
3
sage: a = K(1); a
1 + O(3^20)
sage: 82*a
1 + 3^4 + O(3^20)
sage: 12*a
3 + 3^2 + O(3^21)
sage: a in K
True
sage: b = 82*a
sage: b^4
1 + 3^4 + 3^5 + 2*3^9 + 3^12 + 3^13 + 3^16 + O(3^20)

多项式的商环

在Sage中如何构造商环?

我们创建商环 \(GF(97)[x]/(x^3+7)\) ,并用它演示了许多基本功能。

sage: R = PolynomialRing(GF(97),'x')
sage: x = R.gen()
sage: S = R.quotient(x^3 + 7, 'a')
sage: a = S.gen()
sage: S
Univariate Quotient Polynomial Ring in a over Finite Field of size 97 with
modulus x^3 + 7
sage: S.is_field()
True
sage: a in S
True
sage: x in S
True
sage: S.polynomial_ring()
Univariate Polynomial Ring in x over Finite Field of size 97
sage: S.modulus()
x^3 + 7
sage: S.degree()
3

在萨奇, in 这意味着“被强迫进入”。所以整数 \(x\)\(a\) 两者都在 \(S\) 虽然,虽然 \(x\) 真的需要强迫。

您还可以在商环中计算,而无需实际计算,然后使用命令 quo_rem 如下所述。

sage: R = PolynomialRing(GF(97),'x')
sage: x = R.gen()
sage: f = x^7+1
sage: (f^3).quo_rem(x^7-1)
(x^14 + 4*x^7 + 7, 8)