{{{id=1| QSym = QuasiSymmetricFunctions(QQ) /// }}} {{{id=2| QSym /// Quasisymmetric functions over the Rational Field }}} {{{id=3| QSym.inject_shorthands() /// Injecting M as shorthand for Quasisymmetric functions over the Rational Field in the Monomial basis Injecting F as shorthand for Quasisymmetric functions over the Rational Field in the Fundamental basis Injecting dI as shorthand for Quasisymmetric functions over the Rational Field in the dualImmaculate basis }}} {{{id=4| x = M[2,1] /// }}} {{{id=6| dict(x) /// {[2, 1]: 1} }}} {{{id=7| x.__dict__ /// {'_monomial_coefficients': {[2, 1]: 1}} }}} {{{id=8| y = F(x) y /// -F[1, 1, 1] + F[2, 1] }}} {{{id=9| y.__dict__ /// {'_monomial_coefficients': {[1, 1, 1]: -1, [2, 1]: 1}} }}} {{{id=10| F(y) /// -F[1, 1, 1] + F[2, 1] }}} {{{id=11| y * 2 /// -2*F[1, 1, 1] + 2*F[2, 1] }}} {{{id=12| y.parent?? ///

File: /home/saliola/Applications/sage-5.6/devel/sage/sage/structure/element.pyx

Source Code (starting at line 550):

def parent(self, x=None):
    """
    Returns parent of this element; or, if the optional argument x is
    supplied, the result of coercing x into the parent of this element.
    """
    if x is None:
        return self._parent
    else:
        return self._parent(x)
}}} {{{id=13| SymmetricFunctions(QQ).inject_shorthands() /// /home/saliola/Applications/sage-5.6/local/lib/python2.7/site-packages/sage/combinat/sf/sf.py:1075: RuntimeWarning: redefining global value `e` inject_variable(shorthand, getattr(self, shorthand)()) }}} {{{id=14| m[2,1] /// m[2, 1] }}} {{{id=15| M(m[2,1]) /// M[1, 2] + M[2, 1] }}} {{{id=16| M(s[2,1]) /// 2*M[1, 1, 1] + M[1, 2] + M[2, 1] }}} {{{id=17| m(M[1,2] + M[2,1]) /// m[2, 1] }}} {{{id=18| m(M[1,2]) /// Traceback (most recent call last): File "", line 1, in File "_sage_input_41.py", line 10, in exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8 -*-\\n" + _support_.preparse_worksheet_cell(base64.b64decode("bShNWzEsMl0p"),globals())+"\\n"); execfile(os.path.abspath("___code___.py"))' + '\n', '', 'single') File "", line 1, in File "/tmp/tmp4wUrv8/___code___.py", line 3, in exec compile(u'm(M[_sage_const_1 ,_sage_const_2 ])' + '\n', '', 'single') File "", line 1, in File "parent.pyx", line 804, in sage.structure.parent.Parent.__call__ (sage/structure/parent.c:7305) File "morphism.pyx", line 278, in sage.categories.morphism.SetMorphism._call_ (sage/categories/morphism.c:4568) File "/home/saliola/Applications/sage-5.6/local/lib/python2.7/site-packages/sage/categories/modules_with_basis.py", line 1748, in preimage raise ValueError, "%s is not in the image of %s"%(f, self) ValueError: M[1, 2] is not in the image of Generic morphism: From: Symmetric Functions over Rational Field in the monomial basis To: Quasisymmetric functions over the Rational Field in the Monomial basis }}} {{{id=19| B = {0:[M.one()], 1:[M[1]]} /// }}} {{{id=20| B /// {0: [M[]], 1: [M[1]]} }}} {{{id=21| for b in B.values(): for bb in B.values(): p = b * bb B[p.degree()] = p /// }}} {{{id=22| B /// {1: M[1], 2: 2*M[1, 1] + M[2]} }}} {{{id=24| /// }}} {{{id=23| /// }}}

Constructing 1 in QSym

{{{id=25| M[[]] /// M[] }}} {{{id=26| M.one() /// M[] }}} {{{id=27| M(1) /// M[] }}} {{{id=29| /// }}} {{{id=28| /// }}} {{{id=30| x = M[1,2] /// }}} {{{id=31| x /// M[1, 2] }}} {{{id=32| show(x) /// }}} {{{id=33| view(x) /// }}} {{{id=34| view(x^3, viewer='pdf') /// }}} {{{id=35| for c in Compositions(4): F.monomial(c) /// F[1, 1, 1, 1] F[1, 1, 2] F[1, 2, 1] F[1, 3] F[2, 1, 1] F[2, 2] F[3, 1] F[4] }}}

Convenient shorthand : 

{{{id=36| for c in Compositions(4): F[c] /// F[1, 1, 1, 1] F[1, 1, 2] F[1, 2, 1] F[1, 3] F[2, 1, 1] F[2, 2] F[3, 1] F[4] }}} {{{id=40| /// }}} {{{id=37| /// }}} {{{id=42| /// }}} {{{id=41| M.dual() /// Non-Commutative Symmetric Functions over the Rational Field in the Complete basis }}} {{{id=43| /// }}} {{{id=44| NCSF = NonCommutativeSymmetricFunctions(QQ) /// }}} {{{id=45| NCSF.inject_shorthands() /// Injecting S as shorthand for Non-Commutative Symmetric Functions over the Rational Field in the Complete basis Injecting R as shorthand for Non-Commutative Symmetric Functions over the Rational Field in the Ribbon basis /home/saliola/Applications/sage-5.6/local/lib/python2.7/site-packages/sage/categories/sets_cat.py:1225: RuntimeWarning: redefining global value `R` inject_variable(shorthand, realization) Injecting L as shorthand for Non-Commutative Symmetric Functions over the Rational Field in the Elementary basis Injecting Phi as shorthand for Non-Commutative Symmetric Functions over the Rational Field in the Phi basis Injecting Psi as shorthand for Non-Commutative Symmetric Functions over the Rational Field in the Psi basis Injecting nM as shorthand for Non-Commutative Symmetric Functions over the Rational Field in the Monomial basis Injecting I as shorthand for Non-Commutative Symmetric Functions over the Rational Field in the Immaculate basis /home/saliola/Applications/sage-5.6/local/lib/python2.7/site-packages/sage/categories/sets_cat.py:1225: RuntimeWarning: redefining global value `I` inject_variable(shorthand, realization) }}} {{{id=46| S /// Non-Commutative Symmetric Functions over the Rational Field in the Complete basis }}} {{{id=47| NCSF.complete() /// Non-Commutative Symmetric Functions over the Rational Field in the Complete basis }}} {{{id=48| NCSF.Complete() /// Non-Commutative Symmetric Functions over the Rational Field in the Complete basis }}} {{{id=49| NCSF.S() /// Non-Commutative Symmetric Functions over the Rational Field in the Complete basis }}} {{{id=51| /// }}} {{{id=50| /// }}} {{{id=52| x = M[1,2] /// }}} {{{id=53| x.expand(4) /// x0*x1^2 + x0*x2^2 + x1*x2^2 + x0*x3^2 + x1*x3^2 + x2*x3^2 }}} {{{id=54| show(_) /// }}} {{{id=59| /// }}} {{{id=55| LazyPowerSeriesRing(QQ) /// Lazy Power Series Ring over Rational Field }}} {{{id=56| PowerSeriesRing(QQ, 'x') /// Power Series Ring in x over Rational Field }}} {{{id=57| /// }}} {{{id=58| var('x') /// x }}} {{{id=60| f = 1/(1-x) /// }}} {{{id=61| f.taylor(x, 0, 10) /// x^10 + x^9 + x^8 + x^7 + x^6 + x^5 + x^4 + x^3 + x^2 + x + 1 }}} {{{id=63| /// }}} {{{id=62| /// }}} {{{id=64| LPR = LazyPowerSeriesRing(QQ) /// }}} {{{id=65| PSR = PowerSeriesRing(QQ, 'x', default_prec=10) /// }}} {{{id=66| f = PSR(1)/PSR(1-x) /// }}} {{{id=67| f /// 1 + x + x^2 + x^3 + x^4 + x^5 + x^6 + x^7 + x^8 + x^9 + O(x^10) }}} {{{id=68| /// }}} {{{id=69| /// }}} {{{id=70| M.pl /// Traceback (most recent call last): File "", line 1, in File "_sage_input_171.py", line 10, in exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8 -*-\\n" + _support_.preparse_worksheet_cell(base64.b64decode("TS5wbA=="),globals())+"\\n"); execfile(os.path.abspath("___code___.py"))' + '\n', '', 'single') File "", line 1, in File "/tmp/tmpoqPmGT/___code___.py", line 2, in exec compile(u'M.pl' + '\n', '', 'single') File "", line 1, in File "parent.pyx", line 620, in sage.structure.parent.Parent.__getattr__ (sage/structure/parent.c:6027) File "misc.pyx", line 200, in sage.structure.misc.getattr_from_other_class (sage/structure/misc.c:1406) AttributeError: 'QuasiSymmetricFunctions.Monomial_with_category' object has no attribute 'pl' }}} {{{id=71| f = h[2] /// }}} {{{id=72| f.plethysm(h[2]) /// h[2, 2] - h[3, 1] + h[4] }}} {{{id=73| x = M[2,1] /// }}} {{{id=74| x.plethysm? /// No object 'x.plethysm' currently defined. }}} {{{id=75| f.plethysm(x) /// Traceback (most recent call last): File "", line 1, in File "_sage_input_187.py", line 10, in exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8 -*-\\n" + _support_.preparse_worksheet_cell(base64.b64decode("Zi5wbGV0aHlzbSh4KQ=="),globals())+"\\n"); execfile(os.path.abspath("___code___.py"))' + '\n', '', 'single') File "", line 1, in File "/tmp/tmpXY8Ocn/___code___.py", line 2, in exec compile(u'f.plethysm(x)' + '\n', '', 'single') File "", line 1, in File "/home/saliola/Applications/sage-5.6/local/lib/python2.7/site-packages/sage/combinat/sf/sfa.py", line 1852, in plethysm raise TypeError, "only know how to compute plethysms between symmetric functions" TypeError: only know how to compute plethysms between symmetric functions }}} {{{id=76| /// }}} {{{id=77| /// }}} {{{id=78| s /// Symmetric Functions over Rational Field in the Schur basis }}} {{{id=80| Sym = SymmetricFunctions(QQ) Sym.hall_littlewood() /// Traceback (most recent call last): File "", line 1, in File "_sage_input_208.py", line 10, in exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8 -*-\\n" + _support_.preparse_worksheet_cell(base64.b64decode("U3ltLmhhbGxfbGl0dGxld29vZCgp"),globals())+"\\n"); execfile(os.path.abspath("___code___.py"))' + '\n', '', 'single') File "", line 1, in File "/tmp/tmpQDyZo2/___code___.py", line 2, in exec compile(u'Sym.hall_littlewood()' + '\n', '', 'single') File "", line 1, in File "/home/saliola/Applications/sage-5.6/local/lib/python2.7/site-packages/sage/combinat/sf/sf.py", line 915, in hall_littlewood return hall_littlewood.HallLittlewood(self, t=t) File "classcall_metaclass.pyx", line 279, in sage.misc.classcall_metaclass.ClasscallMetaclass.__call__ (sage/misc/classcall_metaclass.c:932) File "cachefunc.pyx", line 569, in sage.misc.cachefunc.CachedFunction.__call__ (sage/misc/cachefunc.c:2868) File "/home/saliola/Applications/sage-5.6/local/lib/python2.7/site-packages/sage/structure/unique_representation.py", line 463, in __classcall__ instance = typecall(cls, *args, **options) File "classcall_metaclass.pyx", line 467, in sage.misc.classcall_metaclass.typecall (sage/misc/classcall_metaclass.c:1294) File "/home/saliola/Applications/sage-5.6/local/lib/python2.7/site-packages/sage/combinat/sf/hall_littlewood.py", line 92, in __init__ raise ValueError, "parameter t must be in the base ring" ValueError: parameter t must be in the base ring }}} {{{id=81| Sym = SymmetricFunctions(QQ['t']) H = Sym.hall_littlewood() /// }}} {{{id=82| HP = H.P() /// }}} {{{id=83| x = HP.an_element() /// }}} {{{id=84| x /// HLP[] + 2*HLP[1] + 3*HLP[2] }}} {{{id=85| s(x) /// Traceback (most recent call last): File "", line 1, in File "_sage_input_224.py", line 10, in exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8 -*-\\n" + _support_.preparse_worksheet_cell(base64.b64decode("cyh4KQ=="),globals())+"\\n"); execfile(os.path.abspath("___code___.py"))' + '\n', '', 'single') File "", line 1, in File "/tmp/tmpBQURNz/___code___.py", line 2, in exec compile(u's(x)' + '\n', '', 'single') File "", line 1, in File "parent.pyx", line 804, in sage.structure.parent.Parent.__call__ (sage/structure/parent.c:7305) File "coerce_maps.pyx", line 82, in sage.structure.coerce_maps.DefaultConvertMap_unique._call_ (sage/structure/coerce_maps.c:3583) File "coerce_maps.pyx", line 77, in sage.structure.coerce_maps.DefaultConvertMap_unique._call_ (sage/structure/coerce_maps.c:3485) File "/home/saliola/Applications/sage-5.6/local/lib/python2.7/site-packages/sage/combinat/sf/classical.py", line 206, in _element_constructor_ return self(sx) File "parent.pyx", line 804, in sage.structure.parent.Parent.__call__ (sage/structure/parent.c:7305) File "coerce_maps.pyx", line 82, in sage.structure.coerce_maps.DefaultConvertMap_unique._call_ (sage/structure/coerce_maps.c:3583) File "coerce_maps.pyx", line 77, in sage.structure.coerce_maps.DefaultConvertMap_unique._call_ (sage/structure/coerce_maps.c:3485) File "/home/saliola/Applications/sage-5.6/local/lib/python2.7/site-packages/sage/combinat/sf/classical.py", line 161, in _element_constructor_ return eclass(self, dict([ (e1,R(e2)) for e1,e2 in x._monomial_coefficients.items()])) File "parent.pyx", line 804, in sage.structure.parent.Parent.__call__ (sage/structure/parent.c:7305) File "polynomial_element.pyx", line 6554, in sage.rings.polynomial.polynomial_element.ConstantPolynomialSection._call_ (sage/rings/polynomial/polynomial_element.c:47620) TypeError: not a constant polynomial }}} {{{id=86| s = Sym.schur() /// }}} {{{id=87| s /// Symmetric Functions over Univariate Polynomial Ring in t over Rational Field in the Schur basis }}} {{{id=88| s(x) /// s[] + 2*s[1] - 3*t*s[1, 1] + 3*s[2] }}} {{{id=89| /// }}} {{{id=90| /// }}} {{{id=91| Semigroups() /// Category of semigroups }}} {{{id=92| Semigroups().example() /// An example of a semigroup: the left zero semigroup }}} {{{id=93| QSym.category() /// Join of Category of graded hopf algebras over Rational Field and Category of monoids with realizations and Category of coalgebras over Rational Field with realizations }}} {{{id=94| for c in QSym.__class__.mro(): print c /// }}} {{{id=95| for c in QuasiSymmetricFunctions(ZZ).__class__.mro(): print c /// }}} {{{id=96| for c in QSym.an_element().__class__.mro(): print c /// }}} {{{id=97| /// }}}