圣人中的阿贝尔群商

Abelian group quotient in sage

d1d2是整数Z上的矩阵。如何在 Sage 中计算群商 ker d1 / im d2

到目前为止,我已经能够如下计算内核和图像的基础:

M24 = MatrixSpace(IntegerRing(),2,4)
d1 = M24([-1,1, 1,-1, -1,1, 1,-1])
kerd1 = d1.right_kernel().basis()

M43 = MatrixSpace(IntegerRing(),4,3)
d2 = M43([1,1,-1, 1,-1,-1, 1,-1,1, 1,1,1])
imd2 = d2.column_space().basis()

给出输出:

kerd1 = [
  (1, 0, 0, -1),
  (0, 1, 0, 1),
  (0, 0, 1, 1)
]

imd2 = [
  (1, 1, 1, 1),
  (0, 2, 0, -2),
  (0, 0, 2, 2)
]

我试过这样计算商:

Z4.<a,b,c,d> = AbelianGroup(4, [0,0,0,0])
G = Z4.subgroup([a/d, b*d, c*d])
H = Z4.subgroup([a*b*c*d, b^2/d^2, c^2*d^2])
G.quotient(H)

但是我得到了一个NotImplementedError

我找到了两种方法:

d1 = matrix(ZZ,4,2, [-1,1, 1,-1, -1,1, 1,-1]).transpose()
d2 = matrix(ZZ,4,3, [1,1,-1, 1,-1,-1, 1,-1,1, 1,1,1])
(d1.right_kernel() / (d2.column_space())).invariants()
# OUTPUT: (2, 2)

ChainComplex([d2, d1]).homology()[1]
# OUTPUT: C2 x C2