本文整理汇总了Python中sage.matrix.constructor.Matrix.augment方法的典型用法代码示例。如果您正苦于以下问题:Python Matrix.augment方法的具体用法?Python Matrix.augment怎么用?Python Matrix.augment使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sage.matrix.constructor.Matrix
的用法示例。
在下文中一共展示了Matrix.augment方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: space
# 需要导入模块: from sage.matrix.constructor import Matrix [as 别名]
# 或者: from sage.matrix.constructor.Matrix import augment [as 别名]
def space(self):
r'''
Calculates the space of cocyles modulo coboundaries, as a Z-module.
TESTS:
sage: from darmonpoints.sarithgroup import *
sage: from darmonpoints.cohomology_abstract import *
sage: from darmonpoints.ocmodule import *
sage: GS = BigArithGroup(5, 6,1,use_shapiro=False,outfile='/tmp/darmonpoints.tmp') # optional - magma
sage: G = GS.large_group() # optional - magma
sage: V = OCVn(5,1) # optional - magma
sage: Coh = CohomologyGroup(G,V,trivial_action = False) # optional - magma
'''
verb = get_verbose()
set_verbose(0)
V = self.coefficient_module()
R = V.base_ring()
Vdim = V.dimension()
G = self.group()
gens = G.gens()
ambient = R**(Vdim * len(gens))
# Now find the subspace of cocycles
A = Matrix(R, Vdim * len(gens), 0)
for r in G.get_relation_words():
Alist = self.fox_gradient(r)
newA = block_matrix(Alist, nrows = 1)
A = A.augment(newA.transpose())
A = A.transpose()
cocycles = ambient.submodule([ambient(o) for o in A.right_kernel_matrix().rows()])
gmat = block_matrix([self._gen_pows[i][1] - 1 for i in range(len(G.gens()))], nrows = len(G.gens()))
coboundaries = cocycles.submodule([ambient(o) for o in gmat.columns()])
ans = cocycles.quotient(coboundaries)
set_verbose(verb)
return ans
示例2: acting_matrix
# 需要导入模块: from sage.matrix.constructor import Matrix [as 别名]
# 或者: from sage.matrix.constructor.Matrix import augment [as 别名]
def acting_matrix(self, g, prec = None):
dim = len(self.basis())
ans = Matrix(self._V.base_ring(),dim, 0)
for v in self.basis():
gv = g * v
gvlist = []
for w in gv._val:
try:
wlist = list(w)
except TypeError:
wlist = list(w._moments)
if prec is None:
gvlist.extend(wlist)
else:
gvlist.extend(wlist[:prec])
ans = ans.augment(Matrix(self._V.base_ring(),dim,1,gvlist))
return ans