Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
cdef extern from 'symmetrica/def.h': INT outerproduct_schur(OP parta, OP partb, OP result) INT dimension_schur(OP a, OP result) INT part_part_skewschur(OP big, OP small, OP result) INT newtrans(OP perm, OP schur) INT compute_schur_with_alphabet(OP part, OP length, OP poly) INT compute_homsym_with_alphabet(OP number, OP length, OP poly) INT compute_elmsym_with_alphabet(OP number, OP length, OP poly) INT compute_monomial_with_alphabet(OP partition, OP length, OP poly) INT compute_powsym_with_alphabet(OP number, OP length, OP poly) INT compute_schur_with_alphabet_det(OP part, OP length, OP poly)
INT part_part_skewschur(OP a, OP b, OP c)
INT t_SCHUR_MONOMIAL(OP schur, OP result) INT t_SCHUR_HOMSYM(OP a, OP b) INT t_SCHUR_ELMSYM(OP a, OP b)
INT t_MONOMIAL_SCHUR(OP a, OP b) INT t_MONOMIAL_HOMSYM(OP a, OP b) INT t_MONOMIAL_ELMSYM(OP a, OP b)
INT t_ELMSYM_SCHUR(OP a, OP b) INT t_ELMSYM_MONOMIAL(OP a, OP b) INT t_ELMSYM_HOMSYM(OP a, OP b)
INT t_HOMSYM_SCHUR(OP a, OP b) INT t_HOMSYM_MONOMIAL(OP a, OP b) INT t_HOMSYM_ELMSYM(OP a, OP b)
INT t_POWSYM_SCHUR(OP a, OP b) INT t_SCHUR_POWSYM(OP a, OP b) INT t_POWSYM_HOMSYM(OP a, OP b) INT t_HOMSYM_POWSYM(OP a, OP b) INT t_POWSYM_ELMSYM(OP a, OP b) INT t_ELMSYM_POWSYM(OP a, OP b) INT t_POWSYM_MONOMIAL(OP a, OP b) INT t_MONOMIAL_POWSYM(OP a, OP b)
INT hall_littlewood(OP part, OP res)
INT mult_schur_schur(OP s1, OP s2, OP res) INT mult_monomial_monomial(OP m1, OP m2, OP res)
INT t_POLYNOM_POWER(OP a, OP b) INT t_POLYNOM_SCHUR(OP a, OP b) INT t_POLYNOM_ELMSYM(OP a, OP b) INT t_POLYNOM_MONOMIAL(OP a, OP b)
INT symmetricp(OP a)
INT scalarproduct_schur(OP a, OP b, OP c)
def outerproduct_schur_symmetrica(parta, partb): """ you enter two PARTITION objects, and the result is a SCHUR object, which is the expansion of the product of the two schurfunctions, labbeled by the two PARTITION objects parta and partb. Of course this can also be interpreted as the decomposition of the outer tensor product of two irreducibe representations of the symmetric group.
EXAMPLES: sage: symmetrica.outerproduct_schur([2],[2]) s[2, 2] + s[3, 1] + s[4] """ cdef OP cparta, cpartb, cresult
def dimension_schur_symmetrica(s): """ you enter a SCHUR object a, and the result is the dimension of the corresponding representation of the symmetric group sn. """ cdef OP ca, cresult
cresult = callocobject() ca = callocobject()
_op_schur(s, ca) sig_on() dimension_schur(ca, cresult) sig_off() res = _py(cresult)
freeall(ca) freeall(cresult)
return res
def newtrans_symmetrica(perm): """ computes the decomposition of a schubertpolynomial labeled by the permutation perm, as a sum of Schurfunction. FIXME! """ cdef OP cperm = callocobject(), cresult = callocobject()
_op_permutation(perm, cperm)
sig_on() newtrans(cperm, cresult) sig_off()
res = _py(cresult)
freeall(cresult) freeall(cperm)
return res
def compute_schur_with_alphabet_symmetrica(part, length, alphabet='x'): """ Computes the expansion of a schurfunction labeled by a partition PART as a POLYNOM erg. The INTEGER length specifies the length of the alphabet.
EXAMPLES: sage: symmetrica.compute_schur_with_alphabet(2,2) x0^2 + x0*x1 + x1^2 sage: symmetrica.compute_schur_with_alphabet([2],2) x0^2 + x0*x1 + x1^2 sage: symmetrica.compute_schur_with_alphabet(Partition([2]),2) x0^2 + x0*x1 + x1^2 sage: symmetrica.compute_schur_with_alphabet(Partition([2]),2,'y') y0^2 + y0*y1 + y1^2 sage: symmetrica.compute_schur_with_alphabet(Partition([2]),2,'a,b') a^2 + a*b + b^2 sage: symmetrica.compute_schur_with_alphabet([2,1],1,'x') 0 """
else: raise NotImplementedError("n must be an integer or partition")
def compute_homsym_with_alphabet_symmetrica(n, length, alphabet='x'): """ computes the expansion of a homogenous(=complete) symmetric function labeled by a INTEGER number as a POLYNOM erg. The object number may also be a PARTITION or a HOM_SYM object. The INTEGER laenge specifies the length of the alphabet. Both routines are the same.
EXAMPLES: sage: symmetrica.compute_homsym_with_alphabet(3,1,'x') x^3 sage: symmetrica.compute_homsym_with_alphabet([2,1],1,'x') x^3 sage: symmetrica.compute_homsym_with_alphabet([2,1],2,'x') x0^3 + 2*x0^2*x1 + 2*x0*x1^2 + x1^3 sage: symmetrica.compute_homsym_with_alphabet([2,1],2,'a,b') a^3 + 2*a^2*b + 2*a*b^2 + b^3 sage: symmetrica.compute_homsym_with_alphabet([2,1],2,'x').parent() Multivariate Polynomial Ring in x0, x1 over Integer Ring
"""
else: raise NotImplementedError("n must be an integer or a partition")
def compute_elmsym_with_alphabet_symmetrica(n, length, alphabet='x'): """ computes the expansion of a elementary symmetric function labeled by a INTEGER number as a POLYNOM erg. The object number may also be a PARTITION or a ELM_SYM object. The INTEGER length specifies the length of the alphabet. Both routines are the same.
EXAMPLES: sage: a = symmetrica.compute_elmsym_with_alphabet(2,2); a x0*x1 sage: a.parent() Multivariate Polynomial Ring in x0, x1 over Integer Ring sage: a = symmetrica.compute_elmsym_with_alphabet([2],2); a x0*x1 sage: symmetrica.compute_elmsym_with_alphabet(3,2) 0 sage: symmetrica.compute_elmsym_with_alphabet([3,2,1],2) 0
"""
else: raise NotImplementedError("n must be an integer or a partition")
def compute_monomial_with_alphabet_symmetrica(n, length, alphabet='x'): """ computes the expansion of a monomial symmetric function labeled by a PARTITION number as a POLYNOM erg. The INTEGER laenge specifies the length of the alphabet.
EXAMPLES: sage: symmetrica.compute_monomial_with_alphabet([2,1],2,'x') x0^2*x1 + x0*x1^2 sage: symmetrica.compute_monomial_with_alphabet([1,1,1],2,'x') 0 sage: symmetrica.compute_monomial_with_alphabet(2,2,'x') x0^2 + x1^2 sage: symmetrica.compute_monomial_with_alphabet(2,2,'a,b') a^2 + b^2 sage: symmetrica.compute_monomial_with_alphabet(2,2,'x').parent() Multivariate Polynomial Ring in x0, x1 over Integer Ring
""" else: raise NotImplementedError("n must be an integer or a partition")
def compute_powsym_with_alphabet_symmetrica(n, length, alphabet='x'): """ computes the expansion of a power symmetric function labeled by a INTEGER label or by a PARTITION label or a POW_SYM label as a POLYNOM erg. The INTEGER laenge specifies the length of the alphabet.
EXAMPLES: sage: symmetrica.compute_powsym_with_alphabet(2,2,'x') x0^2 + x1^2 sage: symmetrica.compute_powsym_with_alphabet(2,2,'x').parent() Multivariate Polynomial Ring in x0, x1 over Integer Ring sage: symmetrica.compute_powsym_with_alphabet([2],2,'x') x0^2 + x1^2 sage: symmetrica.compute_powsym_with_alphabet([2],2,'a,b') a^2 + b^2 sage: symmetrica.compute_powsym_with_alphabet([2,1],2,'a,b') a^3 + a^2*b + a*b^2 + b^3
"""
else: raise NotImplementedError("need to write code for POW_SYM")
def compute_schur_with_alphabet_det_symmetrica(part, length, alphabet='x'): """ EXAMPLES: sage: symmetrica.compute_schur_with_alphabet_det(2,2) x0^2 + x0*x1 + x1^2 sage: symmetrica.compute_schur_with_alphabet_det([2],2) x0^2 + x0*x1 + x1^2 sage: symmetrica.compute_schur_with_alphabet_det(Partition([2]),2) x0^2 + x0*x1 + x1^2 sage: symmetrica.compute_schur_with_alphabet_det(Partition([2]),2,'y') y0^2 + y0*y1 + y1^2 sage: symmetrica.compute_schur_with_alphabet_det(Partition([2]),2,'a,b') a^2 + a*b + b^2 """
else: raise NotImplementedError("n must be an integer or partition")
def part_part_skewschur_symmetrica(outer, inner): """ Return the skew Schur function s_{outer/inner}.
EXAMPLES::
sage: symmetrica.part_part_skewschur([3,2,1],[2,1]) s[1, 1, 1] + 2*s[2, 1] + s[3] """
def hall_littlewood_symmetrica(part): """ computes the so called Hall Littlewood Polynomials, i.e. a SCHUR object, whose coefficient are polynomials in one variable. The method, which is used for the computation is described in the paper: A.O. Morris The Characters of the group GL(n,q) Math Zeitschr 81, 112-123 (1963) """
cdef OP pointer
raise TypeError("part must be a partition of a positive integer")
def t_SCHUR_MONOMIAL_symmetrica(schur): """ """
def t_SCHUR_HOMSYM_symmetrica(schur): """ """
def t_SCHUR_ELMSYM_symmetrica(schur): """ """
def t_SCHUR_POWSYM_symmetrica(schur): """
"""
def t_POLYNOM_SCHUR_symmetrica(p): """ Converts a symmetric polynomial with base ring QQ or ZZ into a symmetric function in the Schur basis. """ cdef OP polynom = callocobject(), cresult = callocobject()
_op_polynom(p, polynom)
if not symmetricp(polynom): raise ValueError("the polynomial must be symmetric")
sig_on() t_POLYNOM_SCHUR(polynom, cresult) sig_off()
res = _py(cresult)
freeall(cresult) freeall(polynom)
return res
def t_MONOMIAL_HOMSYM_symmetrica(monomial): """
"""
def t_MONOMIAL_ELMSYM_symmetrica(monomial): """
"""
def t_MONOMIAL_SCHUR_symmetrica(monomial): """
"""
def t_MONOMIAL_POWSYM_symmetrica(monomial): """
"""
def t_POLYNOM_MONOMIAL_symmetrica(p): """ Converts a symmetric polynomial with base ring QQ or ZZ into a symmetric function in the monomial basis. """ cdef OP polynom = callocobject(), cresult = callocobject()
_op_polynom(p, polynom)
if not symmetricp(polynom): raise ValueError("the polynomial must be symmetric")
sig_on() t_POLYNOM_MONOMIAL(polynom, cresult) sig_off()
res = _py(cresult)
freeall(cresult) freeall(polynom)
return res
def t_ELMSYM_SCHUR_symmetrica(elmsym): """
"""
def t_ELMSYM_POWSYM_symmetrica(elmsym): """
"""
def t_ELMSYM_MONOMIAL_symmetrica(elmsym): """
"""
def t_ELMSYM_HOMSYM_symmetrica(elmsym): """
"""
def t_POLYNOM_ELMSYM_symmetrica(p): """ Converts a symmetric polynomial with base ring QQ or ZZ into a symmetric function in the elementary basis. """ cdef OP polynom = callocobject(), cresult = callocobject()
_op_polynom(p, polynom)
if not symmetricp(polynom): raise ValueError("the polynomial must be symmetric")
sig_on() t_POLYNOM_ELMSYM(polynom, cresult) sig_off()
res = _py(cresult)
freeall(cresult) freeall(polynom)
return res
def t_HOMSYM_SCHUR_symmetrica(homsym): """
"""
def t_HOMSYM_POWSYM_symmetrica(homsym): """
"""
def t_HOMSYM_MONOMIAL_symmetrica(homsym): """
"""
def t_HOMSYM_ELMSYM_symmetrica(homsym): """
"""
def t_POWSYM_MONOMIAL_symmetrica(powsym): """
"""
def t_POWSYM_SCHUR_symmetrica(powsym): """
"""
def t_POWSYM_ELMSYM_symmetrica(powsym): """
"""
def t_POWSYM_HOMSYM_symmetrica(powsym): """
"""
def t_POLYNOM_POWER_symmetrica(p): """ Converts a symmetric polynomial with base ring QQ or ZZ into a symmetric function in the power sum basis. """ cdef OP polynom = callocobject(), cresult = callocobject()
_op_polynom(p, polynom)
if not symmetricp(polynom): raise ValueError("the polynomial must be symmetric")
sig_on() t_POLYNOM_POWER(polynom, cresult) sig_off()
res = _py(cresult)
freeall(cresult) freeall(polynom)
return res
def mult_schur_schur_symmetrica(s1, s2): """ """ cdef OP cs1 = callocobject(), cs2 = callocobject(), cresult = callocobject()
_op_schur(s1, cs1) _op_schur(s2, cs2)
sig_on() mult_schur_schur(cs1, cs2, cresult) sig_off()
res = _py(cresult)
freeall(cs1) freeall(cs2) freeall(cresult)
return res
def mult_monomial_monomial_symmetrica(m1, m2): """ """
def scalarproduct_schur_symmetrica(s1, s2): cdef OP cs1 = callocobject(), cs2 = callocobject(), cresult = callocobject()
_op_schur(s1, cs1) _op_schur(s2, cs2)
sig_on() scalarproduct_schur(cs1, cs2, cresult) sig_off()
res = _py(cresult)
freeall(cs1) freeall(cs2) freeall(cresult)
return res |