本文整理汇总了Python中sage.matrix.constructor.Matrix.solve_left方法的典型用法代码示例。如果您正苦于以下问题:Python Matrix.solve_left方法的具体用法?Python Matrix.solve_left怎么用?Python Matrix.solve_left使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sage.matrix.constructor.Matrix
的用法示例。
在下文中一共展示了Matrix.solve_left方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from sage.matrix.constructor import Matrix [as 别名]
# 或者: from sage.matrix.constructor.Matrix import solve_left [as 别名]
#.........这里部分代码省略.........
EXAMPLES::
First we set up AssociatedFactors building a tower of extensions::
sage: from sage.rings.polynomial.padics.factor.factoring import OM_tree
sage: k = ZpFM(2,20,'terse'); kx.<x> = k[]
sage: t = OM_tree(x^4+20*x^3+44*x^2+80*x+1040)
sage: t[0].prev
AssociatedFactor of rho z^2 + z + 1
sage: t[0].polygon[0].factors[0]
AssociatedFactor of rho z0^2 + a0*z0 + 1
Then we take elements in the different finite fields and represent
them as vectors over their base residue field::
sage: K.<a0> = t[0].prev.FF;K
Finite Field in a0 of size 2^2
sage: t[0].prev.FF_elt_to_FFbase_vector(a0+1)
[1, 1]
sage: L.<a1> = t[0].polygon[0].factors[0].FF;L
Finite Field in a1 of size 2^4
sage: t[0].polygon[0].factors[0].FF_elt_to_FFbase_vector(a1)
[1, a0 + 1]
"""
if self.segment.frame.is_first() and self.Fplus == 1:
return a
elif self.Fplus == 1:
return self.segment.frame.prev.FF_elt_to_FFbase_vector(a)
else:
basedeg = self.FFbase.degree()
avec = self.FF(a)._vector_()
svector = self.basis_trans_mat.solve_left(Matrix(self.FF.prime_subfield(),avec))
s_list = svector.list()
s_split = [ s_list[i*basedeg:(i+1)*basedeg] for i in range(0,self.Fplus)]
s = [sum([ss[i]*self.FFbase.gen()**i for i in range(0,len(ss))]) for ss in s_split]
return s
def FFbase_elt_to_FF(self,b):
"""
Lifts an element up from the previous residue field to the current
extended residue field.
INPUT:
- ``b`` -- Element in the previous residue field.
OUTPUT:
- An element in the current extended residue field.
EXAMPLES::
First we set up AssociatedFactors building a tower of extensions::
sage: from sage.rings.polynomial.padics.factor.factoring import OM_tree
sage: k = ZpFM(2,20,'terse'); kx.<x> = k[]
sage: t = OM_tree(x^4+20*x^3+44*x^2+80*x+1040)
Then we take elements in the different finite fields and lift them
to the next residue field upward in the extension tower::
sage: K.<a0> = t[0].prev.FF;K
Finite Field in a0 of size 2^2
sage: L.<a1> = t[0].polygon[0].factors[0].FF;L