{{{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)
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 "