本文整理匯總了Python中sage.combinat.sf.sf.SymmetricFunctions.zero方法的典型用法代碼示例。如果您正苦於以下問題:Python SymmetricFunctions.zero方法的具體用法?Python SymmetricFunctions.zero怎麽用?Python SymmetricFunctions.zero使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類sage.combinat.sf.sf.SymmetricFunctions
的用法示例。
在下文中一共展示了SymmetricFunctions.zero方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: _DualGrothendieck
# 需要導入模塊: from sage.combinat.sf.sf import SymmetricFunctions [as 別名]
# 或者: from sage.combinat.sf.sf.SymmetricFunctions import zero [as 別名]
def _DualGrothendieck(self,la):
r"""
Returns the expansion of the K-`k`-Schur function in the homogeneous basis. This
method is here for caching purposes.
INPUT:
- ``la`` -- A `k`-bounded partition.
OUTPUT:
- A symmetric function in the homogeneous basis.
EXAMPLES::
sage: g = SymmetricFunctions(QQ).kBoundedSubspace(3,1).K_kschur()
sage: g._DualGrothendieck(Partition([2,1]))
h[2] + h[2, 1] - h[3]
sage: g._DualGrothendieck(Partition([]))
h[]
sage: g._DualGrothendieck(Partition([4,1]))
0
"""
m = la.size()
h = SymmetricFunctions(self.base_ring()).h()
M = self._DualGrothMatrix(m)
vec = []
for i in range(m+1):
for x in Partitions(m-i, max_part=self.k):
if x == la:
vec.append(1)
else:
vec.append(0)
from sage.modules.free_module_element import vector
vec = vector(vec)
sol = M.solve_right(vec)
new_function = h.zero()
count = 0
for i in range(m+1):
for x in Partitions(m-i, max_part=self.k):
new_function+= h(x) * sol[count]
count += 1
return new_function
示例2: _cl_term
# 需要導入模塊: from sage.combinat.sf.sf import SymmetricFunctions [as 別名]
# 或者: from sage.combinat.sf.sf.SymmetricFunctions import zero [as 別名]
def _cl_term(n, R = RationalField()):
r"""
Compute the order-n term of the cycle index series of the virtual species `\Omega`,
the compositional inverse of the species `E^{+}` of nonempty sets.
EXAMPLES::
sage: from sage.combinat.species.generating_series import _cl_term
sage: [_cl_term(i) for i in range(4)]
[0, p[1], -1/2*p[1, 1] - 1/2*p[2], 1/3*p[1, 1, 1] - 1/3*p[3]]
"""
n = Integer(n) # check that n is an integer
p = SymmetricFunctions(R).power()
res = p.zero()
if n == 1:
res = p([1])
elif n > 1:
res = 1/n * ((-1)**(n-1) * p([1])**n - sum(d * p([n // d]).plethysm(_cl_term(d, R)) for d in divisors(n)[:-1]))
return res
示例3: GL_irreducible_character
# 需要導入模塊: from sage.combinat.sf.sf import SymmetricFunctions [as 別名]
# 或者: from sage.combinat.sf.sf.SymmetricFunctions import zero [as 別名]
def GL_irreducible_character(n, mu, KK):
r"""
Return the character of the irreducible module indexed by ``mu``
of `GL(n)` over the field ``KK``.
INPUT:
- ``n`` -- a positive integer
- ``mu`` -- a partition of at most ``n`` parts
- ``KK`` -- a field
OUTPUT:
a symmetric function which should be interpreted in ``n``
variables to be meaningful as a character
EXAMPLES:
Over `\QQ`, the irreducible character for `\mu` is the Schur
function associated to `\mu`, plus garbage terms (Schur
functions associated to partitions with more than `n` parts)::
sage: from sage.algebras.schur_algebra import GL_irreducible_character
sage: sbasis = SymmetricFunctions(QQ).s()
sage: z = GL_irreducible_character(2, [2], QQ)
sage: sbasis(z)
s[2]
sage: z = GL_irreducible_character(4, [3, 2], QQ)
sage: sbasis(z)
-5*s[1, 1, 1, 1, 1] + s[3, 2]
Over a Galois field, the irreducible character for `\mu` will
in general be smaller.
In characteristic `p`, for a one-part partition `(r)`, where
`r = a_0 + p a_1 + p^2 a_2 + \dots`, the result is (see [GreenPoly]_,
after 5.5d) the product of `h[a_0], h[a_1]( pbasis[p]), h[a_2]
( pbasis[p^2]), \dots,` which is consistent with the following ::
sage: from sage.algebras.schur_algebra import GL_irreducible_character
sage: GL_irreducible_character(2, [7], GF(3))
m[4, 3] + m[6, 1] + m[7]
"""
mbasis = SymmetricFunctions(QQ).m()
r = sum(mu)
M = SchurTensorModule(KK, n, r)
A = M._schur
SGA = M._sga
# make ST the superstandard tableau of shape mu
from sage.combinat.tableau import from_shape_and_word
ST = from_shape_and_word(mu, range(1, r + 1), convention="English")
# make ell the reading word of the highest weight tableau of shape mu
ell = [i + 1 for i, l in enumerate(mu) for dummy in range(l)]
e = M.basis()[tuple(ell)] # the element e_l
# This is the notation `\{X\}` from just before (5.3a) of [GreenPoly]_.
S = SGA._indices
BracC = SGA._from_dict({S(x.tuple()): x.sign() for x in ST.column_stabilizer()}, remove_zeros=False)
f = e * BracC # M.action_by_symmetric_group_algebra(e, BracC)
# [Green, Theorem 5.3b] says that a basis of the Carter-Lusztig
# module V_\mu is given by taking this f, and multiplying by all
# xi_{i,ell} with ell as above and i semistandard.
carter_lusztig = []
for T in SemistandardTableaux(mu, max_entry=n):
i = tuple(flatten(T))
schur_rep = schur_representative_from_index(i, tuple(ell))
y = A.basis()[schur_rep] * e # M.action_by_Schur_alg(A.basis()[schur_rep], e)
carter_lusztig.append(y.to_vector())
# Therefore, we now have carter_lusztig as a list giving the basis
# of `V_\mu`
# We want to think of expressing this character as a sum of monomial
# symmetric functions.
# We will determine a basis element for each m_\lambda in the
# character, and we want to keep track of them by \lambda.
# That means that we only want to pick out the basis elements above for
# those semistandard words whose content is a partition.
contents = Partitions(r, max_length=n).list()
# all partitions of r, length at most n
# JJ will consist of a list for each element of `contents`,
# recording the list
# of semistandard tableaux words with that content
# graded_basis will consist of the a corresponding basis element
graded_basis = []
JJ = []
for i in range(len(contents)):
graded_basis.append([])
#.........這裏部分代碼省略.........