一些更高级的数学

代数几何

您可以在Sage中定义任意的代数变体,但有时重要的功能仅限于环 \(\QQ\) 或有限域。例如,我们计算两条仿射平面曲线的并集,然后将这些曲线恢复为并集的不可约分量。

sage: x, y = AffineSpace(2, QQ, 'xy').gens()
sage: C2 = Curve(x^2 + y^2 - 1)
sage: C3 = Curve(x^3 + y^3 - 1)
sage: D = C2 + C3
sage: D
Affine Plane Curve over Rational Field defined by
   x^5 + x^3*y^2 + x^2*y^3 + y^5 - x^3 - y^3 - x^2 - y^2 + 1
sage: D.irreducible_components()
[
Closed subscheme of Affine Space of dimension 2 over Rational Field defined by:
  x^2 + y^2 - 1,
Closed subscheme of Affine Space of dimension 2 over Rational Field defined by:
  x^3 + y^3 - 1
]

通过求两条曲线的交集并计算不可约分量,我们也可以找到这两条曲线的所有交点。

sage: V = C2.intersection(C3)
sage: V.irreducible_components()
[
Closed subscheme of Affine Space of dimension 2 over Rational Field defined by:
  y,
  x - 1,
Closed subscheme of Affine Space of dimension 2 over Rational Field defined by:
  y - 1,
  x,
Closed subscheme of Affine Space of dimension 2 over Rational Field defined by:
  x + y + 2,
  2*y^2 + 4*y + 3
]

因此,例如。, \((1,0)\)\((0,1)\) 在两条曲线上(明显清晰),某些(二次)点 \(y\) 坐标满足 \(2y^2 + 4y + 3=0\) .

Sage可以计算出射影3空间中扭曲立方的复曲面理想:

sage: R.<a,b,c,d> = PolynomialRing(QQ, 4)
sage: I = ideal(b^2-a*c, c^2-b*d, a*d-b*c)
sage: F = I.groebner_fan(); F
Groebner fan of the ideal:
Ideal (b^2 - a*c, c^2 - b*d, -b*c + a*d) of Multivariate Polynomial Ring
in a, b, c, d over Rational Field
sage: F.reduced_groebner_bases ()
[[-c^2 + b*d, -b*c + a*d, -b^2 + a*c],
 [-b*c + a*d, -c^2 + b*d, b^2 - a*c],
 [-c^3 + a*d^2, -c^2 + b*d, b*c - a*d, b^2 - a*c],
 [-c^2 + b*d, b^2 - a*c, b*c - a*d, c^3 - a*d^2],
 [-b*c + a*d, -b^2 + a*c, c^2 - b*d],
 [-b^3 + a^2*d, -b^2 + a*c, c^2 - b*d, b*c - a*d],
 [-b^2 + a*c, c^2 - b*d, b*c - a*d, b^3 - a^2*d],
 [c^2 - b*d, b*c - a*d, b^2 - a*c]]
sage: F.polyhedralfan()
Polyhedral fan in 4 dimensions of dimension 4

椭圆曲线算法

椭圆曲线功能包括PARI的大部分椭圆曲线功能、访问Cremona在线表中的数据(这需要一个可选的数据库包)、mwrank的功能,即2个描述完整Mordell Weil群的计算、SEA算法、所有等值线的计算、许多新的曲线代码结束 \(\QQ\) ,以及丹尼斯·西蒙的一些代数下降软件。

命令 EllipticCurve 创建椭圆曲线有多种形式:

  • 椭圆曲线( [\(a_1\), \(a_2\), \(a_3\), \(a_4\), \(a_6\)] ):返回椭圆曲线

    \[y^2+a_1xy+a_3y=x^3+a_2x^2+a_4x+a_6,\]

    何处 \(a_i\) 的被强制加入 \(a_1\) . 如果所有的 \(a_i\) 有父母吗 \(\ZZ\) ,他们被迫 \(\QQ\) .

  • 椭圆曲线( [\(a_4\), \(a_6\)] ):同上,但 \(a_1=a_2=a_3=0\) .

  • EllipticCurve(label):使用给定的(new!)从Cremona数据库返回椭圆曲线克雷莫纳标签。标签是一个字符串,例如 "11a""37b2" . 字母必须小写(以区别于旧标签)。

  • EllipticCurve(j):返回带有 \(j\) -不变量 \(j\) .

  • 椭圆曲线(R, [\(a_1\), \(a_2\), \(a_3\), \(a_4\), \(a_6\)] ):在环上创建椭圆曲线 \(R\) 给予 \(a_i\) 如前所述。

我们对这些构造函数进行了说明:

sage: EllipticCurve([0,0,1,-1,0])
Elliptic Curve defined by y^2 + y = x^3 - x over Rational Field

sage: EllipticCurve([GF(5)(0),0,1,-1,0])
Elliptic Curve defined by y^2 + y = x^3 + 4*x over Finite Field of size 5

sage: EllipticCurve([1,2])
Elliptic Curve defined by y^2  = x^3 + x + 2 over Rational Field

sage: EllipticCurve('37a')
Elliptic Curve defined by y^2 + y = x^3 - x over Rational Field

sage: EllipticCurve_from_j(1)
Elliptic Curve defined by y^2 + x*y = x^3 + 36*x + 3455 over Rational Field

sage: EllipticCurve(GF(5), [0,0,1,-1,0])
Elliptic Curve defined by y^2 + y = x^3 + 4*x over Finite Field of size 5

一对 \((0,0)\) 是椭圆曲线上的一点 \(E\) 由定义 \(y^2 + y = x^3 - x\) . 以Sage类型创建此点 E([0,0]) . Sage可以在这样的椭圆曲线上添加点(回想一下椭圆曲线支持一种加性群结构,其中无穷远点是零元素,曲线上的三个共线点相加为零):

sage: E = EllipticCurve([0,0,1,-1,0])
sage: E
Elliptic Curve defined by y^2 + y = x^3 - x over Rational Field
sage: P = E([0,0])
sage: P + P
(1 : 0 : 1)
sage: 10*P
(161/16 : -2065/64 : 1)
sage: 20*P
(683916417/264517696 : -18784454671297/4302115807744 : 1)
sage: E.conductor()
37

复数上的椭圆曲线由 \(j\) -不变性。Sage计算 \(j\) -不变量如下:

sage: E = EllipticCurve([0,0,0,-4,2]); E
Elliptic Curve defined by y^2 = x^3 - 4*x + 2 over Rational Field
sage: E.conductor()
2368
sage: E.j_invariant()
110592/37

如果我们用同样的曲线 \(j\) -不变的 \(E\) ,它不必同构于 \(E\) . 在下面的示例中,曲线不是同构的,因为它们的导体不同。

sage: F = EllipticCurve_from_j(110592/37)
sage: F.conductor()
37

但是 \(F\) 乘2给出一条同构曲线。

sage: G = F.quadratic_twist(2); G
Elliptic Curve defined by y^2 = x^3 - 4*x + 2 over Rational Field
sage: G.conductor()
2368
sage: G.j_invariant()
110592/37

我们可以计算系数 \(a_n\)\(L\) -系列或模块形式 \(\sum_{{n=0}}^\infty a_nq^n\) 附在椭圆曲线上。此计算使用PARI C库:

sage: E = EllipticCurve([0,0,1,-1,0])
sage: E.anlist(30)
[0, 1, -2, -3, 2, -2, 6, -1, 0, 6, 4, -5, -6, -2, 2, 6, -4, 0, -12, 0, -4,
 3, 10, 2, 0, -1, 4, -9, -2, 6, -12]
sage: v = E.anlist(10000)

只需一秒钟就可以计算出所有 \(a_n\) 对于 \(n\leq 10^5\)

sage: %time v = E.anlist(100000)
CPU times: user 0.98 s, sys: 0.06 s, total: 1.04 s
Wall time: 1.06

椭圆曲线可以用它们的Cremona标签来构造。这将预先加载椭圆曲线的秩、Tamagawa数、调节器等信息。

sage: E = EllipticCurve("37b2")
sage: E
Elliptic Curve defined by y^2 + y = x^3 + x^2 - 1873*x - 31833 over Rational
Field
sage: E = EllipticCurve("389a")
sage: E
Elliptic Curve defined by y^2 + y = x^3 + x^2 - 2*x  over Rational Field
sage: E.rank()
2
sage: E = EllipticCurve("5077a")
sage: E.rank()
3

我们也可以直接访问Cremona数据库。

sage: db = sage.databases.cremona.CremonaDatabase()
sage: db.curves(37)
{'a1': [[0, 0, 1, -1, 0], 1, 1], 'b1': [[0, 1, 1, -23, -50], 0, 3]}
sage: db.allcurves(37)
{'a1': [[0, 0, 1, -1, 0], 1, 1],
 'b1': [[0, 1, 1, -23, -50], 0, 3],
 'b2': [[0, 1, 1, -1873, -31833], 0, 1],
 'b3': [[0, 1, 1, -3, 1], 0, 3]}

从数据库返回的对象不是类型 EllipticCurve . 它们是数据库的元素,有几个字段,仅此而已。Cremona的数据库有一个小版本,默认与Sage一起分发,包含关于导体椭圆曲线的有限信息 \(\leq 10000\) . 还有一个大的可选版本,它包含了关于所有导线曲线的广泛数据,直到 \(120000\) (截至2005年10月)。Sage还有一个巨大的(2GB)可选数据库包,其中包含Stein Watkins数据库中的数亿条椭圆曲线。

狄利克雷特字符

A 狄利克雷特字符 是同态的扩张 \((\ZZ/N\ZZ)^* \to R^*\) ,为了一些环 \(R\) ,到地图上 \(\ZZ \to R\) 通过发送这些整数得到 \(x\) 具有 \(\gcd(N,x)>1\) 到0。

sage: G = DirichletGroup(12)
sage: G.list()
[Dirichlet character modulo 12 of conductor 1 mapping 7 |--> 1, 5 |--> 1,
Dirichlet character modulo 12 of conductor 4 mapping 7 |--> -1, 5 |--> 1,
Dirichlet character modulo 12 of conductor 3 mapping 7 |--> 1, 5 |--> -1,
Dirichlet character modulo 12 of conductor 12 mapping 7 |--> -1, 5 |--> -1]
sage: G.gens()
(Dirichlet character modulo 12 of conductor 4 mapping 7 |--> -1, 5 |--> 1,
Dirichlet character modulo 12 of conductor 3 mapping 7 |--> 1, 5 |--> -1)
sage: len(G)
4

创建组之后,我们接下来创建一个元素并使用它进行计算。

sage: G = DirichletGroup(21)
sage: chi = G.1; chi
Dirichlet character modulo 21 of conductor 7 mapping 8 |--> 1, 10 |--> zeta6
sage: chi.values()
[0, 1, zeta6 - 1, 0, -zeta6, -zeta6 + 1, 0, 0, 1, 0, zeta6, -zeta6, 0, -1,
 0, 0, zeta6 - 1, zeta6, 0, -zeta6 + 1, -1]
sage: chi.conductor()
7
sage: chi.modulus()
21
sage: chi.order()
6
sage: chi(19)
-zeta6 + 1
sage: chi(40)
-zeta6 + 1

也可以计算伽罗瓦群的作用 \(\text{{Gal}}(\QQ(\zeta_N)/\QQ)\) 对这些特征,以及对应于模的因式分解的直接积分解。

sage: chi.galois_orbit()
[Dirichlet character modulo 21 of conductor 7 mapping 8 |--> 1, 10 |--> -zeta6 + 1,
 Dirichlet character modulo 21 of conductor 7 mapping 8 |--> 1, 10 |--> zeta6]

sage: go = G.galois_orbits()
sage: [len(orbit) for orbit in go]
[1, 2, 2, 1, 1, 2, 2, 1]

sage: G.decomposition()
[
Group of Dirichlet characters modulo 3 with values in Cyclotomic Field of order 6 and degree 2,
Group of Dirichlet characters modulo 7 with values in Cyclotomic Field of order 6 and degree 2
]

接下来,我们构造一组Dirichlet字符mod 20,但是值在 \(\QQ(i)\)

sage: K.<i> = NumberField(x^2+1)
sage: G = DirichletGroup(20,K)
sage: G
Group of Dirichlet characters modulo 20 with values in Number Field in i with defining polynomial x^2 + 1

接下来我们计算 G

sage: G.gens()
(Dirichlet character modulo 20 of conductor 4 mapping 11 |--> -1, 17 |--> 1,
Dirichlet character modulo 20 of conductor 5 mapping 11 |--> 1, 17 |--> i)

sage: G.unit_gens()
(11, 17)
sage: G.zeta()
i
sage: G.zeta_order()
4

在这个例子中,我们创建了一个Dirichlet字符,其中的值在一个数字字段中。我们通过第三个参数显式地指定了统一根的选择 DirichletGroup 下面。

sage: x = polygen(QQ, 'x')
sage: K = NumberField(x^4 + 1, 'a'); a = K.0
sage: b = K.gen(); a == b
True
sage: K
Number Field in a with defining polynomial x^4 + 1
sage: G = DirichletGroup(5, K, a); G
Group of Dirichlet characters modulo 5 with values in the group of order 8 generated by a in Number Field in a with defining polynomial x^4 + 1
sage: chi = G.0; chi
Dirichlet character modulo 5 of conductor 5 mapping 2 |--> a^2
sage: [(chi^i)(2) for i in range(4)]
[1, a^2, -1, -a^2]

在这里 NumberField(x^4 + 1, 'a') 告诉Sage在打印什么时使用符号“a” K 是一个定义多项式的数域 \(x^4 + 1\) ). 在这一点上,“a”这个名字是未声明的。一次 a = K.0 (或相当于 a = K.gen() )则符号“a”表示生成多项式的根 \(x^4+1\) .

模块化形式

Sage可以进行一些与模形式有关的计算,包括维数、模符号的计算空间、Hecke算子和分解。

函数的模空间有几种形式。例如,

sage: dimension_cusp_forms(Gamma0(11),2)
1
sage: dimension_cusp_forms(Gamma0(1),12)
1
sage: dimension_cusp_forms(Gamma1(389),2)
6112

接下来我们将说明Hecke算子在模符号空间上的计算 \(1\) 还有重量 \(12\) .

sage: M = ModularSymbols(1,12)
sage: M.basis()
([X^8*Y^2,(0,0)], [X^9*Y,(0,0)], [X^10,(0,0)])
sage: t2 = M.T(2)
sage: t2
Hecke operator T_2 on Modular Symbols space of dimension 3 for Gamma_0(1)
of weight 12 with sign 0 over Rational Field
sage: t2.matrix()
[ -24    0    0]
[   0  -24    0]
[4860    0 2049]
sage: f = t2.charpoly('x'); f
x^3 - 2001*x^2 - 97776*x - 1180224
sage: factor(f)
(x - 2049) * (x + 24)^2
sage: M.T(11).charpoly('x').factor()
(x - 285311670612) * (x - 534612)^2

我们也可以为 \(\Gamma_0(N)\)\(\Gamma_1(N)\) .

sage: ModularSymbols(11,2)
Modular Symbols space of dimension 3 for Gamma_0(11) of weight 2 with sign
 0 over Rational Field
sage: ModularSymbols(Gamma1(11),2)
Modular Symbols space of dimension 11 for Gamma_1(11) of weight 2 with
sign 0 and over Rational Field

我们来计算一些特征多项式 \(q\) -扩张。

sage: M = ModularSymbols(Gamma1(11),2)
sage: M.T(2).charpoly('x')
x^11 - 8*x^10 + 20*x^9 + 10*x^8 - 145*x^7 + 229*x^6 + 58*x^5 - 360*x^4
     + 70*x^3 - 515*x^2 + 1804*x - 1452
sage: M.T(2).charpoly('x').factor()
(x - 3) * (x + 2)^2 * (x^4 - 7*x^3 + 19*x^2 - 23*x + 11)
        * (x^4 - 2*x^3 + 4*x^2 + 2*x + 11)
sage: S = M.cuspidal_submodule()
sage: S.T(2).matrix()
[-2  0]
[ 0 -2]
sage: S.q_expansion_basis(10)
[
    q - 2*q^2 - q^3 + 2*q^4 + q^5 + 2*q^6 - 2*q^7 - 2*q^9 + O(q^10)
]

我们甚至可以用字符计算模符号的空间。

sage: G = DirichletGroup(13)
sage: e = G.0^2
sage: M = ModularSymbols(e,2); M
Modular Symbols space of dimension 4 and level 13, weight 2, character
[zeta6], sign 0, over Cyclotomic Field of order 6 and degree 2
sage: M.T(2).charpoly('x').factor()
(x - zeta6 - 2) * (x - 2*zeta6 - 1) * (x + zeta6 + 1)^2
sage: S = M.cuspidal_submodule(); S
Modular Symbols subspace of dimension 2 of Modular Symbols space of
dimension 4 and level 13, weight 2, character [zeta6], sign 0, over
Cyclotomic Field of order 6 and degree 2
sage: S.T(2).charpoly('x').factor()
(x + zeta6 + 1)^2
sage: S.q_expansion_basis(10)
[
q + (-zeta6 - 1)*q^2 + (2*zeta6 - 2)*q^3 + zeta6*q^4 + (-2*zeta6 + 1)*q^5
  + (-2*zeta6 + 4)*q^6 + (2*zeta6 - 1)*q^8 - zeta6*q^9 + O(q^10)
]

这是Sage如何计算Hecke算子在模空间上的作用的另一个例子。

sage: T = ModularForms(Gamma0(11),2)
sage: T
Modular Forms space of dimension 2 for Congruence Subgroup Gamma0(11) of
weight 2 over Rational Field
sage: T.degree()
2
sage: T.level()
11
sage: T.group()
Congruence Subgroup Gamma0(11)
sage: T.dimension()
2
sage: T.cuspidal_subspace()
Cuspidal subspace of dimension 1 of Modular Forms space of dimension 2 for
Congruence Subgroup Gamma0(11) of weight 2 over Rational Field
sage: T.eisenstein_subspace()
Eisenstein subspace of dimension 1 of Modular Forms space of dimension 2
for Congruence Subgroup Gamma0(11) of weight 2 over Rational Field
sage: M = ModularSymbols(11); M
Modular Symbols space of dimension 3 for Gamma_0(11) of weight 2 with sign
0 over Rational Field
sage: M.weight()
2
sage: M.basis()
((1,0), (1,8), (1,9))
sage: M.sign()
0

\(T_p\) 表示通常的Hecke运算符 (\(p\) 主)。Hecke操作员怎么办 \(T_2\)\(T_3\)\(T_5\) 作用于模块符号的空间?

sage: M.T(2).matrix()
[ 3  0 -1]
[ 0 -2  0]
[ 0  0 -2]
sage: M.T(3).matrix()
[ 4  0 -1]
[ 0 -1  0]
[ 0  0 -1]
sage: M.T(5).matrix()
[ 6  0 -1]
[ 0  1  0]
[ 0  0  1]