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


Python SymmetricFunctions.elementary方法代碼示例

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


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

示例1: charpoly

# 需要導入模塊: from sage.combinat.sf.sf import SymmetricFunctions [as 別名]
# 或者: from sage.combinat.sf.sf.SymmetricFunctions import elementary [as 別名]
 def charpoly(self, g, var='x'):
     r"""
     Determines the characteristic polynomial `\det(I-gT)`
     """
     if self.degree() == 0:
         return QQ.one()
     from sage.combinat.sf.sf import SymmetricFunctions
     S = SymmetricFunctions(QQ)
     p = S.powersum()
     e = S.elementary()
     deg = self.degree()
     traces = [self(g ** n) for n in range(1, deg+1)]
     x = PolynomialRing(QQ, var).gen()
     cp = x ** deg
     for n in range(deg):
         mc = p(e[n+1]).monomial_coefficients()
         cp += (-1) ** (n+1) * x ** (deg-1-n) * sum(mc[k] * prod(traces[j-1] for j in k) for k in mc.keys())
     return cp
開發者ID:rharron,項目名稱:ArtinGalois,代碼行數:20,代碼來源:artin_representation.py

示例2: charpoly_reverse

# 需要導入模塊: from sage.combinat.sf.sf import SymmetricFunctions [as 別名]
# 或者: from sage.combinat.sf.sf.SymmetricFunctions import elementary [as 別名]
 def charpoly_reverse(self, g, var='x'):
     r"""
     Determines the characteristic polynomial `\det(I-gT)`
     
     sage: from sage.rings.number_field.galois_group import GaloisGroup_v3
     sage: from sage.rings.number_field.artin_representation import ArtinRepresentation
     sage: K = NumberField(x^3 - 2, 'a')
     sage: G = GaloisGroup_v3(K, names='b2')
     sage: chi = ArtinRepresentation(G, [2, 0, -1])
     sage: L = G.splitting_field()
     sage: for p in prime_range(5, 50):
     ...    print p, chi.charpoly_reverse(G.artin_symbol(L.primes_above(p)[0]))
     5 -x^2 + 1
     7 x^2 + x + 1
     11 -x^2 + 1
     13 x^2 + x + 1
     17 -x^2 + 1
     19 x^2 + x + 1
     23 -x^2 + 1
     29 -x^2 + 1
     31 x^2 - 2*x + 1
     37 x^2 + x + 1
     41 -x^2 + 1
     43 x^2 - 2*x + 1
     47 -x^2 + 1
     """
     if self.degree() == 0:
         return QQ.one()
     from sage.combinat.sf.sf import SymmetricFunctions
     S = SymmetricFunctions(QQ)
     p = S.powersum()
     e = S.elementary()
     deg = self.degree()
     traces = [self(g ** n) for n in range(1, deg+1)]
     x = PolynomialRing(QQ, var).gen()
     cp = QQ.one()
     for n in range(deg):
         mc = p(e[n+1]).monomial_coefficients()
         cp += (-1) ** (n+1) * x ** (n+1) * sum(mc[k] * prod(traces[j-1] for j in k) for k in mc.keys())
     return cp
開發者ID:rharron,項目名稱:ArtinGalois,代碼行數:42,代碼來源:artin_representation.py


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