当前位置: 首页>>代码示例>>Python>>正文


Python Matrix.augment方法代码示例

本文整理汇总了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
开发者ID:mmasdeu,项目名称:darmonpoints,代码行数:37,代码来源:cohomology_abstract.py

示例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
开发者ID:mmasdeu,项目名称:darmonpoints,代码行数:19,代码来源:representations.py


注:本文中的sage.matrix.constructor.Matrix.augment方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。