关于高等数学的更多话题

代数几何

在Sage中,你可以定义任意的代数变量,但是有时一些非凡的功能在$Q$或有限域上受到限制。例如,我们计算两条仿射平面曲线的并,再将两条曲线作为并的不可约分图(irreducible components)恢复出来。

  1. sage: x, y = AffineSpace(2, QQ, 'xy').gens()
  2. sage: C2 = Curve(x^2 + y^2 - 1)
  3. sage: C3 = Curve(x^3 + y^3 - 1)
  4. sage: D = C2 + C3
  5. sage: D
  6. Affine Curve over Rational Field defined by
  7. x^5 + x^3*y^2 + x^2*y^3 + y^5 - x^3 - y^3 - x^2 - y^2 + 1
  8. sage: D.irreducible_components()
  9. [
  10. Closed subscheme of Affine Space of dimension 2 over Rational Field defined by:
  11. x^2 + y^2 - 1,
  12. Closed subscheme of Affine Space of dimension 2 over Rational Field defined by:
  13. x^3 + y^3 - 1
  14. ]

我们也可以通过计算两条曲线的交的不可约分图来找出它们所有的交点。

  1. sage: V = C2.intersection(C3)
  2. sage: V.irreducible_components()
  3. [
  4. Closed subscheme of Affine Space of dimension 2 over Rational Field defined by:
  5. y - 1
  6. x,
  7. Closed subscheme of Affine Space of dimension 2 over Rational Field defined by:
  8. y
  9. x - 1,
  10. Closed subscheme of Affine Space of dimension 2 over Rational Field defined by:
  11. x + y + 2
  12. 2*y^2 + 4*y + 3
  13. ]

这样$(1,0)$和$(0,1)$都在每一条曲线上(显然地), 这些点的$y$坐标满足$2y^2+4y+3=0$.

Sage可以计算投影3空间中扭曲三次曲线的理想环面。

  1. sage: R.<a,b,c,d> = PolynomialRing(QQ, 4)
  2. sage: I = ideal(b^2-a*c, c^2-b*d, a*d-b*c)
  3. sage: F = I.groebner_fan(); F
  4. Groebner fan of the ideal:
  5. Ideal (b^2 - a*c, c^2 - b*d, -b*c + a*d) of Multivariate Polynomial Ring
  6. in a, b, c, d over Rational Field
  7. sage: F.reduced_groebner_bases ()
  8. [[-c^2 + b*d, -b*c + a*d, -b^2 + a*c],
  9. [c^2 - b*d, -b*c + a*d, -b^2 + a*c],
  10. [c^2 - b*d, b*c - a*d, -b^2 + a*c, -b^3 + a^2*d],
  11. [c^2 - b*d, b*c - a*d, b^3 - a^2*d, -b^2 + a*c],
  12. [c^2 - b*d, b*c - a*d, b^2 - a*c],
  13. [-c^2 + b*d, b^2 - a*c, -b*c + a*d],
  14. [-c^2 + b*d, b*c - a*d, b^2 - a*c, -c^3 + a*d^2],
  15. [c^3 - a*d^2, -c^2 + b*d, b*c - a*d, b^2 - a*c]]
  16. sage: F.polyhedralfan()
  17. Polyhedral fan in 4 dimensions of dimension 4

椭圆曲线

椭圆曲线功能包括PARI中的很多椭圆曲线功能:访问Cremona的在线数据(这需要额外的数据库包);mwrank功能,也就是用二次递降计算完整的Mordell-Weil群;SEA算法;所有同种、类的计算;很多用于$Q$上的曲线的新代码;以及Denis Simon的一些代数递降软件。

使用EllipticCurve可用多种形式建立椭圆曲线:

  • 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$都来自$Z$, 它们将被转换到$Q$上。
  • EllipticCurve($[a_4,a_6]$):同上,但$a_1=a_2=a_3=0$。
  • EllipticCurve(label): 根据给定的Cremona标签从Cremona数据库返回Q上的椭圆曲线。标签是一个字符串,例如11a或者37b2。字母必须是小写(以和旧标签区别开)。
  • EllipticCurve(j): 返回带有$j$-不变量j的椭圆曲线。.
  • EllipticCurve($R$, $[a_1,a_2,a_3,a_4,a_6]$): 创建环$R$上具有如上给定$a_i$的椭圆曲线。

我们来演示这些构造函数:

  1. sage: EllipticCurve([0,0,1,-1,0])
  2. Elliptic Curve defined by y^2 + y = x^3 - x over Rational Field
  3. sage: EllipticCurve([GF(5)(0),0,1,-1,0])
  4. Elliptic Curve defined by y^2 + y = x^3 + 4*x over Finite Field of size 5
  5. sage: EllipticCurve([1,2])
  6. Elliptic Curve defined by y^2 = x^3 + x + 2 over Rational Field
  7. sage: EllipticCurve('37a')
  8. Elliptic Curve defined by y^2 + y = x^3 - x over Rational Field
  9. sage: EllipticCurve_from_j(1)
  10. Elliptic Curve defined by y^2 + x*y = x^3 + 36*x + 3455 over Rational Field
  11. sage: EllipticCurve(GF(5),[0,0,1,-1,0])
  12. 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$上的一点. 输入E([0,0])来声明这个点.也可以在这样的椭圆曲线上添加点(椭圆曲线支持一个加法群结构,其无穷远处的点是零元素并且曲线上三个共线的点加和起来为零):

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

复数上的椭圆曲线被$j$-不变量参数化。Sage计算$j$-不变量如下:

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

如果我们用和$E$相同的$j$-不变量作一条曲线,它不一定和$E$同构。在下面的例子中,曲线是不同构的,因为它们的前导子不同。

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

然而,由2得到的F的扭曲将得到一个同构曲线。

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

我们可以计算$L$-级数或曲线上的模形式$\sum_{n=0}^\infty a_nq^n$的系数$a_n$。这个算法使用了 PARI C库:

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

计算$n\leq 10^5$的所有$a_n$只需要1秒钟:

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

椭圆曲线可以用它们的Cremona标签构造。这会预载入椭圆曲线和关于它的秩、玉河数, 基准等信息.

  1. sage: E = EllipticCurve("37b2")
  2. sage: E
  3. Elliptic Curve defined by y^2 + y = x^3 + x^2 - 1873*x - 31833 over Rational
  4. Field
  5. sage: E = EllipticCurve("389a")
  6. sage: E
  7. Elliptic Curve defined by y^2 + y = x^3 + x^2 - 2*x over Rational Field
  8. sage: E.rank()
  9. 2
  10. sage: E = EllipticCurve("5077a")
  11. sage: E.rank()
  12. 3

也可以直接使用Cremona数据库。

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

从数据库中返回的对象并不是EllipticCurve对象,而是数据库中的元素。Sage发行版中默认携带一个小型的Cremona数据库版本,包含前导子≤10000的椭圆曲线的有限信息。还有一个大型的可选版本,包含了前导子到120000(截止2005年十月)的所有曲线的大量信息。Sage还有一个巨大(2GB)的可选数据库包,包含了Stein-Watkins数据库中亿万个椭圆曲线。

狄利克雷特征

狄利克雷特征是同态$(Z/NZ)^∗\to R^∗$的扩张,对于某个环R,扩张到把符合$\gcd(N,x)>1$的整数x设为0所得到的映射$Z\to R$。

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

创建了群之后,我们接下来创建一个元素并用它来计算。

  1. sage: G = DirichletGroup(21)
  2. sage: chi = G.1; chi
  3. Dirichlet character modulo 21 of conductor 7 mapping 8 |--> 1, 10 |--> zeta6
  4. sage: chi.values()
  5. [0, 1, zeta6 - 1, 0, -zeta6, -zeta6 + 1, 0, 0, 1, 0, zeta6, -zeta6, 0, -1,
  6. 0, 0, zeta6 - 1, zeta6, 0, -zeta6 + 1, -1]
  7. sage: chi.conductor()
  8. 7
  9. sage: chi.modulus()
  10. 21
  11. sage: chi.order()
  12. 6
  13. sage: chi(19)
  14. -zeta6 + 1
  15. sage: chi(40)
  16. -zeta6 + 1

还可以在这些特征上计算伽罗瓦群$\text{Gal}(Q(\zeta_N)/Q)$,还有与模的因式分解对应的直积分解。

  1. sage: chi.galois_orbit()
  2. [Dirichlet character modulo 21 of conductor 7 mapping 8 |--> 1, 10 |--> -zeta6 + 1,
  3. Dirichlet character modulo 21 of conductor 7 mapping 8 |--> 1, 10 |--> zeta6]
  4. sage: go = G.galois_orbits()
  5. sage:[len(orbit) for orbit in go]
  6. [1, 2, 2, 1, 1, 2, 2, 1]
  7. sage: G.decomposition()
  8. [
  9. Group of Dirichlet characters modulo 3 with values in Cyclotomic Field of order 6 and degree 2,
  10. Group of Dirichlet characters modulo 7 with values in Cyclotomic Field of order 6 and degree 2
  11. ]

接下来,我们构造模为20的狄利克雷特征的群,不过值在$Q(i)$中:

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

接下来计算一些G的不变量:

  1. sage: G.gens()
  2. (Dirichlet character modulo 20 of conductor 4 mapping 11 |--> -1, 17 |--> 1,
  3. Dirichlet character modulo 20 of conductor 5 mapping 11 |--> 1, 17 |--> i)
  4. sage: G.unit_gens()
  5. (11, 17)
  6. sage: G.zeta()
  7. i
  8. sage: G.zeta_order()
  9. 4

在这个例子中,我们创建了一个狄利克雷特征,它的值在一个数域中。我们通过下面DirichletGroup的第三个参数显式指明单位根的选择。

  1. sage: x = polygen(QQ, 'x')
  2. sage: K = NumberField(x^4 + 1, 'a'); a = K.0
  3. sage: b = K.gen(); a == b
  4. True
  5. sage: K
  6. Number Field in a with defining polynomial x^4 + 1
  7. sage: G = DirichletGroup(5, K, a); G
  8. Group of Dirichlet characters of modulus 5 over Number Field in a with defining polynomial x^4 + 1
  9. sage:[(chi^i)(2) for i in range(4)]
  10. [[1],[a^2],[-1],[-a^2]]

这里的NumberField(x^4 + 1, 'a')告诉Sage要使用符号”a”来表示K是什么(以a表示的具有定义多项式$x^4+1$的数域)。此时”a”还没有声明。一旦计算了a = K.0(或等价的a = K.gen()),符号”a”将能够表示生成多项式$x^4+1$的一个根。

模形式

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

有多个函数可用来计算模形式的空间维数。例如,

  1. sage: dimension_cusp_forms(Gamma0(11),2)
  2. 1
  3. sage: dimension_cusp_forms(Gamma0(1),12)
  4. 1
  5. sage: dimension_cusp_forms(Gamma1(389),2)
  6. 6112

接下来,我们说明在权等于12、1级的模符号空间上赫克算子的计算。

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

也可以为$\Gamma_0(N)$和$\Gamma_1(N)$创建空间。

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

计算一些多项式和$q$-展开式。

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

我们甚至可以计算有特征的模符号空间。

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

这里是另一个用Sage在模形式空间上计算赫克算子的例子。

  1. sage: T = ModularForms(Gamma0(11),2)
  2. sage: T
  3. Modular Forms space of dimension 2 for Congruence Subgroup Gamma0(11) of weight 2 over Rational Field
  4. sage: T.degree()
  5. 2
  6. sage: T.level()
  7. 11
  8. sage: T.group()
  9. Congruence Subgroup Gamma0(11)
  10. sage: T.dimension()
  11. 2
  12. sage: T.cuspidal_subspace()
  13. Cuspidal subspace of dimension 1 of Modular Forms space of dimension 2 for Congruence Subgroup Gamma0(11) of weight 2 over Rational Field
  14. sage: T.eisenstein_subspace()
  15. Eisenstein subspace of dimension 1 of Modular Forms space of dimension 2 for Congruence Subgroup Gamma0(11) of weight 2 over Rational Field
  16. sage: M = ModularSymbols(11); M
  17. Modular Symbols space of dimension 3 for Gamma_0(11) of weight 2 with sign 0 over Rational Field
  18. sage: M.weight()
  19. 2
  20. sage: M.basis()
  21. ((1,0), (1,8), (1,9))
  22. sage: M.sign()
  23. 0

令$T_p$表示通常的赫克算子(p素数)。赫克算子$T_2$,$T_3$,$T_5$如何作用在模符号空间上?

  1. sage: M.T(2).matrix()
  2. [ 3 0 -1]
  3. [ 0 -2 0]
  4. [ 0 0 -2]
  5. sage: M.T(3).matrix()
  6. [ 4 0 -1]
  7. [ 0 -1 0]
  8. [ 0 0 -1]
  9. sage: M.T(5).matrix()
  10. [ 6 0 -1]
  11. [ 0 1 0]
  12. [ 0 0 1]