當前位置: 首頁>>代碼示例>>Python>>正文


Python VectorSpace.zero方法代碼示例

本文整理匯總了Python中sage.modules.free_module.VectorSpace.zero方法的典型用法代碼示例。如果您正苦於以下問題:Python VectorSpace.zero方法的具體用法?Python VectorSpace.zero怎麽用?Python VectorSpace.zero使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在sage.modules.free_module.VectorSpace的用法示例。


在下文中一共展示了VectorSpace.zero方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: test_satisfy_inter

# 需要導入模塊: from sage.modules.free_module import VectorSpace [as 別名]
# 或者: from sage.modules.free_module.VectorSpace import zero [as 別名]
 def test_satisfy_inter(self):
   v_space = VectorSpace(QQ,4)
   sub = v_space.subspace([[1,-1,1,1],[2,-3,4,5]])
   comp = orth_complement(v_space,sub)
   zero = v_space.subspace([v_space.zero()])
   inter = sub.intersection(comp)
   self.assertEqual(zero,inter)
開發者ID:robertgoss,項目名稱:Logarithmic-differential-forms,代碼行數:9,代碼來源:logarithmic_forms_test.py

示例2: homology

# 需要導入模塊: from sage.modules.free_module import VectorSpace [as 別名]
# 或者: from sage.modules.free_module.VectorSpace import zero [as 別名]
 def homology(self,varient="complement",*args):
   hom = {}
   cc = self.chain_complex(varient,(-1,self.poly_ring.ngens()+1),*args)
   #Some need wider return range
   for i in range(self.poly_ring.ngens()+1):
     vs_am = VectorSpace(QQ,len(cc[i]))
     if len(cc[i])==0:
       hom[i] = []
       continue
     if len(cc[i-1])!=0:
       d_im = []
       for b in cc[i-1]:
         d_b = self.differential(b,varient,*args)
         d_im.append(lift_to_basis(d_b,cc[i]))
       img = vs_am.subspace(d_im)
     else:
       img = vs_am.subspace([vs_am.zero()])
     if len(cc[i+1])!=0:
       d_ker = []
       for b in cc[i]:
         d_b = self.differential(b,varient,*args)
         d_ker.append(lift_to_basis(d_b,cc[i+1]))
       ker = (matrix(QQ,d_ker)).left_kernel()
     else:
       ker = vs_am
     quo = ker.quotient(img)
     hom[i] = []
     for b in quo.basis():
       vec = quo.lift(b)
       part_sum = LogarithmicDifferentialForm.make_zero(i,self)
       for c,f in zip(vec,cc[i]):
         part_sum = part_sum + c*f
       hom[i].append(part_sum)
   return hom
開發者ID:robertgoss,項目名稱:Logarithmic-differential-forms,代碼行數:36,代碼來源:logarithmic_forms.py

示例3: test_full

# 需要導入模塊: from sage.modules.free_module import VectorSpace [as 別名]
# 或者: from sage.modules.free_module.VectorSpace import zero [as 別名]
 def test_full(self):
   v_space = VectorSpace(QQ,4)
   zero = v_space.subspace([v_space.zero()])
   comp = orth_complement(v_space,v_space)
   self.assertEqual(zero,comp)
開發者ID:robertgoss,項目名稱:Logarithmic-differential-forms,代碼行數:7,代碼來源:logarithmic_forms_test.py


注:本文中的sage.modules.free_module.VectorSpace.zero方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。