本文整理汇总了Python中sage.matrix.constructor.Matrix.list方法的典型用法代码示例。如果您正苦于以下问题:Python Matrix.list方法的具体用法?Python Matrix.list怎么用?Python Matrix.list使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sage.matrix.constructor.Matrix
的用法示例。
在下文中一共展示了Matrix.list方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: HalfPeriodsInTermsOfLambdas
# 需要导入模块: from sage.matrix.constructor import Matrix [as 别名]
# 或者: from sage.matrix.constructor.Matrix import list [as 别名]
def HalfPeriodsInTermsOfLambdas(L1, L2, L3, lvec_and_Mlist = None, HP0 = None, prec = None, max_iters = 20):
K = L1.parent()
L0 = Matrix(K, 3, 1, [L1, L2, L3])
if lvec_and_Mlist is None:
assert prec is not None
lvec, Mlist = load_lvec_and_Mlist(prec)
else:
lvec, Mlist = lvec_and_Mlist
# Evaluates a matrix M with entries in Z[[x,y,z]] at points x0,y0,z0
def ev(x0,y0,z0):
return [lvec[0](x0,y0,z0), lvec[1](x0,y0,z0), ((1-z0)/(1+z0))**2 * lvec[2](x0,y0,z0)]
if HP0 is None:
HP0 = [K(0),K(0),K(0)]
Pn = Matrix(K,3,1,HP0) # 0th approximation
n_iters = 0
while n_iters < 20:
n_iters += 1
Jinv = evaluate_twisted_jacobian_matrix(*Pn.list(),Mlist = Mlist).inverse()
FPn = matrix(3,1, ev(*Pn.list()))
Pnn = Pn - Jinv * (FPn - L0)
print('(%s)'%n_iters, [(u-v).valuation() for u,v in zip(Pn.list(), Pnn.list())])
if all([u == v for u,v in zip(Pn.list(), Pnn.list())]):
return Pn
Pn = Pnn
raise RuntimeError,"Does not converge"