Quantum-valued polynomial rings

This provides a \(q\)-analogue of the IntegerValuedPolynomialRing.

AUTHORS:

  • Frédéric Chapoton (2024-03): Initial version

class sage.rings.polynomial.q_integer_valued_polynomials.QuantumValuedPolynomialRing(R, q)[source]

Bases: UniqueRepresentation, Parent

The quantum-valued polynomial ring over a base ring.

Quantum-valued polynomial rings are commutative and associative algebras, with a basis indexed by nonnegative integers.

The elements are polynomials in one variable \(x\) with coefficients in the field of rational functions in \(q\), such that the value at every nonegative \(q\)-integer is a polynomial in \(q\).

This algebra is endowed with two bases, named B or Binomial and S or Shifted.

INPUT:

  • R – commutative ring

  • q – optional variable

There are two possible input formats:

  • If the argument q is not given, then the ring R is taken as a base ring and the ring of Laurent polynomials in \(q\) over R is built and used.

  • If the argument q is given, then it should belong to the ring R and be invertible in this ring.

EXAMPLES:

sage: F = QuantumValuedPolynomialRing(QQ).S(); F
Quantum-Valued Polynomial Ring over Rational Field
in the shifted basis

sage: F.gen()
S[1]

sage: S = QuantumValuedPolynomialRing(ZZ); S
Quantum-Valued Polynomial Ring over Integer Ring
sage: S.base_ring()
Univariate Laurent Polynomial Ring in q over Integer Ring
>>> from sage.all import *
>>> F = QuantumValuedPolynomialRing(QQ).S(); F
Quantum-Valued Polynomial Ring over Rational Field
in the shifted basis

>>> F.gen()
S[1]

>>> S = QuantumValuedPolynomialRing(ZZ); S
Quantum-Valued Polynomial Ring over Integer Ring
>>> S.base_ring()
Univariate Laurent Polynomial Ring in q over Integer Ring
F = QuantumValuedPolynomialRing(QQ).S(); F
F.gen()
S = QuantumValuedPolynomialRing(ZZ); S
S.base_ring()

Quantum-valued polynomial rings commute with their base ring:

sage: K = QuantumValuedPolynomialRing(QQ).S()
sage: a = K.gen()
sage: c = K.monomial(2)
>>> from sage.all import *
>>> K = QuantumValuedPolynomialRing(QQ).S()
>>> a = K.gen()
>>> c = K.monomial(Integer(2))
K = QuantumValuedPolynomialRing(QQ).S()
a = K.gen()
c = K.monomial(2)

Quantum-valued polynomial rings are commutative:

sage: c^3 * a == c * a * c * c
True
>>> from sage.all import *
>>> c**Integer(3) * a == c * a * c * c
True
c^3 * a == c * a * c * c

We can also manipulate elements in the basis and coerce elements from our base field:

sage: F = QuantumValuedPolynomialRing(QQ).S()
sage: B = F.basis()
sage: B[2] * B[3]
(q^-5+q^-4+q^-3)*S[3] - (q^-6+2*q^-5+3*q^-4+3*q^-3+2*q^-2+q^-1)*S[4]
+ (q^-6+q^-5+2*q^-4+2*q^-3+2*q^-2+q^-1+1)*S[5]
sage: 1 - B[2] * B[2] / 2
S[0] - (1/2*q^-3)*S[2] + (1/2*q^-4+q^-3+q^-2+1/2*q^-1)*S[3]
- (1/2*q^-4+1/2*q^-3+q^-2+1/2*q^-1+1/2)*S[4]
>>> from sage.all import *
>>> F = QuantumValuedPolynomialRing(QQ).S()
>>> B = F.basis()
>>> B[Integer(2)] * B[Integer(3)]
(q^-5+q^-4+q^-3)*S[3] - (q^-6+2*q^-5+3*q^-4+3*q^-3+2*q^-2+q^-1)*S[4]
+ (q^-6+q^-5+2*q^-4+2*q^-3+2*q^-2+q^-1+1)*S[5]
>>> Integer(1) - B[Integer(2)] * B[Integer(2)] / Integer(2)
S[0] - (1/2*q^-3)*S[2] + (1/2*q^-4+q^-3+q^-2+1/2*q^-1)*S[3]
- (1/2*q^-4+1/2*q^-3+q^-2+1/2*q^-1+1/2)*S[4]
F = QuantumValuedPolynomialRing(QQ).S()
B = F.basis()
B[2] * B[3]
1 - B[2] * B[2] / 2
B[source]

alias of Binomial

class Bases(parent_with_realization)[source]

Bases: Category_realization_of_parent

class ElementMethods[source]

Bases: object

polynomial()[source]

Convert to a polynomial in \(x\).

EXAMPLES:

sage: F = QuantumValuedPolynomialRing(ZZ).S()
sage: S = F.gen()
sage: (S+1).polynomial()
q*x + 2

sage: F = QuantumValuedPolynomialRing(ZZ).B()
sage: B = F.gen()
sage: (B+1).polynomial()
x + 1
>>> from sage.all import *
>>> F = QuantumValuedPolynomialRing(ZZ).S()
>>> S = F.gen()
>>> (S+Integer(1)).polynomial()
q*x + 2

>>> F = QuantumValuedPolynomialRing(ZZ).B()
>>> B = F.gen()
>>> (B+Integer(1)).polynomial()
x + 1
F = QuantumValuedPolynomialRing(ZZ).S()
S = F.gen()
(S+1).polynomial()
F = QuantumValuedPolynomialRing(ZZ).B()
B = F.gen()
(B+1).polynomial()
shift(j=1)[source]

Shift all indices by \(j\).

INPUT:

  • \(j\) – integer (default 1)

In the binomial basis, the shift by 1 corresponds to a summation operator from \(0\) to \(x\).

EXAMPLES:

sage: F = QuantumValuedPolynomialRing(ZZ).S()
sage: B = F.gen()
sage: (B+1).shift()
S[1] + S[2]
>>> from sage.all import *
>>> F = QuantumValuedPolynomialRing(ZZ).S()
>>> B = F.gen()
>>> (B+Integer(1)).shift()
S[1] + S[2]
F = QuantumValuedPolynomialRing(ZZ).S()
B = F.gen()
(B+1).shift()
sum_of_coefficients()[source]

Return the sum of coefficients.

In the shifted basis, this is the evaluation at \(x=0\).

EXAMPLES:

sage: F = QuantumValuedPolynomialRing(ZZ).S()
sage: B = F.basis()
sage: (B[2]*B[4]).sum_of_coefficients()
1
>>> from sage.all import *
>>> F = QuantumValuedPolynomialRing(ZZ).S()
>>> B = F.basis()
>>> (B[Integer(2)]*B[Integer(4)]).sum_of_coefficients()
1
F = QuantumValuedPolynomialRing(ZZ).S()
B = F.basis()
(B[2]*B[4]).sum_of_coefficients()
class ParentMethods[source]

Bases: object

algebra_generators()[source]

Return the generators of this algebra.

EXAMPLES:

sage: A = QuantumValuedPolynomialRing(ZZ).S(); A
Quantum-Valued Polynomial Ring over Integer Ring
in the shifted basis
sage: A.algebra_generators()
Family (S[1],)
>>> from sage.all import *
>>> A = QuantumValuedPolynomialRing(ZZ).S(); A
Quantum-Valued Polynomial Ring over Integer Ring
in the shifted basis
>>> A.algebra_generators()
Family (S[1],)
A = QuantumValuedPolynomialRing(ZZ).S(); A
A.algebra_generators()
degree_on_basis(m)[source]

Return the degree of the basis element indexed by m.

EXAMPLES:

sage: A = QuantumValuedPolynomialRing(QQ).S()
sage: A.degree_on_basis(4)
4
>>> from sage.all import *
>>> A = QuantumValuedPolynomialRing(QQ).S()
>>> A.degree_on_basis(Integer(4))
4
A = QuantumValuedPolynomialRing(QQ).S()
A.degree_on_basis(4)
from_polynomial(p)[source]

Convert a polynomial into the ring of quantum-valued polynomials.

This raises a ValueError if this is not possible.

INPUT:

  • p – a polynomial in x with coefficients in QQ(q)

EXAMPLES:

sage: A = QuantumValuedPolynomialRing(ZZ).S()
sage: S = A.basis()
sage: A.from_polynomial((S[1]).polynomial())
S[1]
sage: A.from_polynomial((S[2]+2*S[3]).polynomial())
S[2] + 2*S[3]

sage: A = QuantumValuedPolynomialRing(ZZ).B()
sage: B = A.basis()
sage: A.from_polynomial((B[1]).polynomial())
B[1]
sage: A.from_polynomial((B[2]+2*B[3]).polynomial())
B[2] + 2*B[3]
>>> from sage.all import *
>>> A = QuantumValuedPolynomialRing(ZZ).S()
>>> S = A.basis()
>>> A.from_polynomial((S[Integer(1)]).polynomial())
S[1]
>>> A.from_polynomial((S[Integer(2)]+Integer(2)*S[Integer(3)]).polynomial())
S[2] + 2*S[3]

>>> A = QuantumValuedPolynomialRing(ZZ).B()
>>> B = A.basis()
>>> A.from_polynomial((B[Integer(1)]).polynomial())
B[1]
>>> A.from_polynomial((B[Integer(2)]+Integer(2)*B[Integer(3)]).polynomial())
B[2] + 2*B[3]
A = QuantumValuedPolynomialRing(ZZ).S()
S = A.basis()
A.from_polynomial((S[1]).polynomial())
A.from_polynomial((S[2]+2*S[3]).polynomial())
A = QuantumValuedPolynomialRing(ZZ).B()
B = A.basis()
A.from_polynomial((B[1]).polynomial())
A.from_polynomial((B[2]+2*B[3]).polynomial())
gen(i=0)[source]

Return the generator of the algebra.

The optional argument is ignored.

EXAMPLES:

sage: F = QuantumValuedPolynomialRing(ZZ).S()
sage: F.gen()
S[1]
>>> from sage.all import *
>>> F = QuantumValuedPolynomialRing(ZZ).S()
>>> F.gen()
S[1]
F = QuantumValuedPolynomialRing(ZZ).S()
F.gen()
gens()[source]

Return the generators of this algebra.

EXAMPLES:

sage: A = QuantumValuedPolynomialRing(ZZ).S(); A
Quantum-Valued Polynomial Ring over Integer Ring
in the shifted basis
sage: A.algebra_generators()
Family (S[1],)
>>> from sage.all import *
>>> A = QuantumValuedPolynomialRing(ZZ).S(); A
Quantum-Valued Polynomial Ring over Integer Ring
in the shifted basis
>>> A.algebra_generators()
Family (S[1],)
A = QuantumValuedPolynomialRing(ZZ).S(); A
A.algebra_generators()
ground_ring()[source]

Return the ring of coefficients.

This ring is not supposed to contain the variable \(q\).

EXAMPLES:

sage: A = QuantumValuedPolynomialRing(QQ).S()
sage: A.ground_ring()
Rational Field
>>> from sage.all import *
>>> A = QuantumValuedPolynomialRing(QQ).S()
>>> A.ground_ring()
Rational Field
A = QuantumValuedPolynomialRing(QQ).S()
A.ground_ring()
one_basis()[source]

Return the number 0, which index the unit of this algebra.

EXAMPLES:

sage: A = QuantumValuedPolynomialRing(QQ).S()
sage: A.one_basis()
0
sage: A.one()
S[0]
>>> from sage.all import *
>>> A = QuantumValuedPolynomialRing(QQ).S()
>>> A.one_basis()
0
>>> A.one()
S[0]
A = QuantumValuedPolynomialRing(QQ).S()
A.one_basis()
A.one()
q()[source]

Return the variable \(q\).

EXAMPLES:

sage: A = QuantumValuedPolynomialRing(QQ).S()
sage: A.q()
q
>>> from sage.all import *
>>> A = QuantumValuedPolynomialRing(QQ).S()
>>> A.q()
q
A = QuantumValuedPolynomialRing(QQ).S()
A.q()
super_categories()[source]

Return the super-categories of self.

EXAMPLES:

sage: A = QuantumValuedPolynomialRing(QQ); A
Quantum-Valued Polynomial Ring over Rational Field
sage: C = A.Bases(); C
Category of bases of Quantum-Valued Polynomial Ring
over Rational Field
sage: C.super_categories()
[Category of realizations of Quantum-Valued Polynomial Ring
 over Rational Field,
 Join of Category of algebras with basis
 over Univariate Laurent Polynomial Ring in q over Rational Field and
 Category of filtered algebras
 over Univariate Laurent Polynomial Ring in q over Rational Field and
 Category of commutative algebras
 over Univariate Laurent Polynomial Ring in q over Rational Field and
 Category of realizations of unital magmas]
>>> from sage.all import *
>>> A = QuantumValuedPolynomialRing(QQ); A
Quantum-Valued Polynomial Ring over Rational Field
>>> C = A.Bases(); C
Category of bases of Quantum-Valued Polynomial Ring
over Rational Field
>>> C.super_categories()
[Category of realizations of Quantum-Valued Polynomial Ring
 over Rational Field,
 Join of Category of algebras with basis
 over Univariate Laurent Polynomial Ring in q over Rational Field and
 Category of filtered algebras
 over Univariate Laurent Polynomial Ring in q over Rational Field and
 Category of commutative algebras
 over Univariate Laurent Polynomial Ring in q over Rational Field and
 Category of realizations of unital magmas]
A = QuantumValuedPolynomialRing(QQ); A
C = A.Bases(); C
C.super_categories()
class Binomial(A)[source]

Bases: CombinatorialFreeModule, BindableClass

The quantum-valued polynomial ring in the binomial basis.

The basis used here is given by \(B[i] = \genfrac{[}{]}{0pt}{}{x}{i}_q\) for \(i \in \NN\).

Assuming \(n_1 \leq n_2\), the product of two monomials \(B[n_1] \cdot B[n_2]\) is given by the sum

\[\sum_{k=0}^{n_1} q^{(k-n_1)(k-n_2)} \genfrac{[}{]}{0pt}{}{n_1}{k}_q \genfrac{[}{]}{0pt}{}{n_1+n_2-k}{n_1}_q B[n_1 + n_2 - k].\]
class Element[source]

Bases: IndexedFreeModuleElement

variable_shift(k=1)[source]

Return the image by the shift of variables.

On polynomials, the action for \(k=1\) is the shift on variables \(x \mapsto 1 + qx\).

This implementation follows formula (5.5) in [HaHo2017].

INPUT:

  • \(k\) – nonnegative integer (default: 1)

EXAMPLES:

sage: A = QuantumValuedPolynomialRing(ZZ).B()
sage: B = A.basis()
sage: B[5].variable_shift()
B[4] + q^5*B[5]
>>> from sage.all import *
>>> A = QuantumValuedPolynomialRing(ZZ).B()
>>> B = A.basis()
>>> B[Integer(5)].variable_shift()
B[4] + q^5*B[5]
A = QuantumValuedPolynomialRing(ZZ).B()
B = A.basis()
B[5].variable_shift()
product_on_basis(n1, n2)[source]

Return the product of basis elements n1 and n2.

INPUT:

  • n1, n2 – integers

The formula is taken from Theorem 3.4 in [HaHo2017].

EXAMPLES:

sage: A = QuantumValuedPolynomialRing(QQ).B()
sage: A.product_on_basis(0, 1)
B[1]
>>> from sage.all import *
>>> A = QuantumValuedPolynomialRing(QQ).B()
>>> A.product_on_basis(Integer(0), Integer(1))
B[1]
A = QuantumValuedPolynomialRing(QQ).B()
A.product_on_basis(0, 1)
S[source]

alias of Shifted

class Shifted(A)[source]

Bases: CombinatorialFreeModule, BindableClass

The quantum-valued polynomial ring in the shifted basis.

The basis used here is given by \(S[i] = \genfrac{[}{]}{0pt}{}{i+x}{i}_q\) for \(i \in \NN\).

Assuming \(n_1 \leq n_2\), the product of two monomials \(S[n_1] \cdot S[n_2]\) is given by the sum

\[\sum_{k=0}^{n_1} (-1)^k q^{\binom{k}{2} - n_1 * n_2} \genfrac{[}{]}{0pt}{}{n_1}{k}_q \genfrac{[}{]}{0pt}{}{n_1+n_2-k}{n_1}_q S[n_1 + n_2 - k].\]
class Element[source]

Bases: IndexedFreeModuleElement

derivative_at_minus_one()[source]

Return the ‘derivative’ at -1.

See also

umbra()

EXAMPLES:

sage: F = QuantumValuedPolynomialRing(ZZ).S()
sage: B = F.gen()
sage: (B+1).derivative_at_minus_one()
1
>>> from sage.all import *
>>> F = QuantumValuedPolynomialRing(ZZ).S()
>>> B = F.gen()
>>> (B+Integer(1)).derivative_at_minus_one()
1
F = QuantumValuedPolynomialRing(ZZ).S()
B = F.gen()
(B+1).derivative_at_minus_one()
fraction()[source]

Return the generating series of values as a fraction.

EXAMPLES:

sage: A = QuantumValuedPolynomialRing(QQ).S()
sage: ex = A.basis()[4]
sage: ex.fraction().factor()
(-1) * (t - 1)^-1 * (q*t - 1)^-1 * (q^2*t - 1)^-1 * (q^3*t - 1)^-1 * (q^4*t - 1)^-1

sage: q = polygen(QQ,'q')
sage: x = polygen(q.parent(), 'x')
sage: ex = A.from_polynomial((1+q*x)**3)
sage: ex.fraction().factor()
(t - 1)^-1 * (q*t - 1)^-1 * (q^2*t - 1)^-1 * (q^3*t - 1)^-1 * (q^3*t^2 + 2*q^2*t + 2*q*t + 1)
sage: ex.fraction().numerator()
q^3*t^2 + 2*q^2*t + 2*q*t + 1
>>> from sage.all import *
>>> A = QuantumValuedPolynomialRing(QQ).S()
>>> ex = A.basis()[Integer(4)]
>>> ex.fraction().factor()
(-1) * (t - 1)^-1 * (q*t - 1)^-1 * (q^2*t - 1)^-1 * (q^3*t - 1)^-1 * (q^4*t - 1)^-1

>>> q = polygen(QQ,'q')
>>> x = polygen(q.parent(), 'x')
>>> ex = A.from_polynomial((Integer(1)+q*x)**Integer(3))
>>> ex.fraction().factor()
(t - 1)^-1 * (q*t - 1)^-1 * (q^2*t - 1)^-1 * (q^3*t - 1)^-1 * (q^3*t^2 + 2*q^2*t + 2*q*t + 1)
>>> ex.fraction().numerator()
q^3*t^2 + 2*q^2*t + 2*q*t + 1
A = QuantumValuedPolynomialRing(QQ).S()
ex = A.basis()[4]
ex.fraction().factor()
q = polygen(QQ,'q')
x = polygen(q.parent(), 'x')
ex = A.from_polynomial((1+q*x)**3)
ex.fraction().factor()
ex.fraction().numerator()
h_polynomial()[source]

Return the \(h\)-vector as a polynomial.

EXAMPLES:

sage: A = QuantumValuedPolynomialRing(ZZ).S()
sage: q = polygen(ZZ,'q')
sage: x = polygen(q.parent(),'x')
sage: ex = A.from_polynomial((1+q*x)**3)
sage: ex.h_polynomial()
z^3 + (2*q + 2*q^2)*z^2 + q^3*z
>>> from sage.all import *
>>> A = QuantumValuedPolynomialRing(ZZ).S()
>>> q = polygen(ZZ,'q')
>>> x = polygen(q.parent(),'x')
>>> ex = A.from_polynomial((Integer(1)+q*x)**Integer(3))
>>> ex.h_polynomial()
z^3 + (2*q + 2*q^2)*z^2 + q^3*z
A = QuantumValuedPolynomialRing(ZZ).S()
q = polygen(ZZ,'q')
x = polygen(q.parent(),'x')
ex = A.from_polynomial((1+q*x)**3)
ex.h_polynomial()
h_vector()[source]

Return the numerator of the generating series of values.

If self is an Ehrhart polynomial, this is the h-vector.

EXAMPLES:

sage: A = QuantumValuedPolynomialRing(ZZ).S()
sage: ex = A.basis()[4]
sage: ex.h_vector()
(0, 0, 0, 0, 1)

sage: q = polygen(QQ,'q')
sage: x = polygen(q.parent(),'x')
sage: ex = A.from_polynomial((1+q*x)**3)
sage: ex.h_vector()
(0, q^3, 2*q + 2*q^2, 1)
>>> from sage.all import *
>>> A = QuantumValuedPolynomialRing(ZZ).S()
>>> ex = A.basis()[Integer(4)]
>>> ex.h_vector()
(0, 0, 0, 0, 1)

>>> q = polygen(QQ,'q')
>>> x = polygen(q.parent(),'x')
>>> ex = A.from_polynomial((Integer(1)+q*x)**Integer(3))
>>> ex.h_vector()
(0, q^3, 2*q + 2*q^2, 1)
A = QuantumValuedPolynomialRing(ZZ).S()
ex = A.basis()[4]
ex.h_vector()
q = polygen(QQ,'q')
x = polygen(q.parent(),'x')
ex = A.from_polynomial((1+q*x)**3)
ex.h_vector()
umbra()[source]

Return the Bernoulli umbra.

This is the derivative at \(-1\) of the shift by one.

This is related to Carlitz’s \(q\)-Bernoulli numbers.

EXAMPLES:

sage: F = QuantumValuedPolynomialRing(ZZ).S()
sage: B = F.gen()
sage: (B+1).umbra()
(q + 2)/(q + 1)
>>> from sage.all import *
>>> F = QuantumValuedPolynomialRing(ZZ).S()
>>> B = F.gen()
>>> (B+Integer(1)).umbra()
(q + 2)/(q + 1)
F = QuantumValuedPolynomialRing(ZZ).S()
B = F.gen()
(B+1).umbra()
variable_shift(k=1)[source]

Return the image by the shift on variables.

The shift is the substitution operator

\[x \mapsto q x + 1.\]

INPUT:

  • \(k\) – integer (default: 1)

EXAMPLES:

sage: A = QuantumValuedPolynomialRing(ZZ).S()
sage: S = A.basis()
sage: S[5].variable_shift()
S[0] + q*S[1] + q^2*S[2] + q^3*S[3] + q^4*S[4] + q^5*S[5]

sage: S[5].variable_shift(-1)
-(q^-5)*S[4] + (q^-5)*S[5]
>>> from sage.all import *
>>> A = QuantumValuedPolynomialRing(ZZ).S()
>>> S = A.basis()
>>> S[Integer(5)].variable_shift()
S[0] + q*S[1] + q^2*S[2] + q^3*S[3] + q^4*S[4] + q^5*S[5]

>>> S[Integer(5)].variable_shift(-Integer(1))
-(q^-5)*S[4] + (q^-5)*S[5]
A = QuantumValuedPolynomialRing(ZZ).S()
S = A.basis()
S[5].variable_shift()
S[5].variable_shift(-1)
from_h_vector(hv)[source]

Convert from some \(h\)-vector.

EXAMPLES:

sage: A = QuantumValuedPolynomialRing(ZZ).S()
sage: B = A.basis()
sage: ex = B[2] + B[3]
sage: A.from_h_vector(ex.h_vector())
S[2] + S[3]

sage: q = A.base_ring().gen()
sage: ex = B[2] + q*B[3]
sage: A.from_h_vector(ex.h_vector())
S[2] + q*S[3]
>>> from sage.all import *
>>> A = QuantumValuedPolynomialRing(ZZ).S()
>>> B = A.basis()
>>> ex = B[Integer(2)] + B[Integer(3)]
>>> A.from_h_vector(ex.h_vector())
S[2] + S[3]

>>> q = A.base_ring().gen()
>>> ex = B[Integer(2)] + q*B[Integer(3)]
>>> A.from_h_vector(ex.h_vector())
S[2] + q*S[3]
A = QuantumValuedPolynomialRing(ZZ).S()
B = A.basis()
ex = B[2] + B[3]
A.from_h_vector(ex.h_vector())
q = A.base_ring().gen()
ex = B[2] + q*B[3]
A.from_h_vector(ex.h_vector())
product_on_basis(n1, n2)[source]

Return the product of basis elements n1 and n2.

INPUT:

  • n1, n2 – integers

EXAMPLES:

sage: A = QuantumValuedPolynomialRing(QQ).S()
sage: A.product_on_basis(0, 1)
S[1]
>>> from sage.all import *
>>> A = QuantumValuedPolynomialRing(QQ).S()
>>> A.product_on_basis(Integer(0), Integer(1))
S[1]
A = QuantumValuedPolynomialRing(QQ).S()
A.product_on_basis(0, 1)
a_realization()[source]

Return a default realization.

The Shifted realization is chosen.

EXAMPLES:

sage: QuantumValuedPolynomialRing(QQ).a_realization()
Quantum-Valued Polynomial Ring over Rational Field
in the shifted basis
>>> from sage.all import *
>>> QuantumValuedPolynomialRing(QQ).a_realization()
Quantum-Valued Polynomial Ring over Rational Field
in the shifted basis
QuantumValuedPolynomialRing(QQ).a_realization()
sage.rings.polynomial.q_integer_valued_polynomials.q_binomial_x(m, n, q=None)[source]

Return a \(q\)-analogue of binomial(m + x, n).

When evaluated at the \(q\)-integer \([k]_q\), this gives the usual \(q\)-binomial coefficient \([m + k, n]_q\).

INPUT:

  • m and n – positive integers

  • q – optional variable

EXAMPLES:

sage: from sage.combinat.q_analogues import q_int
sage: from sage.rings.polynomial.q_integer_valued_polynomials import q_binomial_x, q_int_x
sage: q_binomial_x(4,2)(0) == q_binomial(4,2)
True
sage: q_binomial_x(3,2)(1) == q_binomial(4,2)
True
sage: q_binomial_x(3,1) == q_int_x(4)
True
sage: q_binomial_x(2,0).parent()
Univariate Polynomial Ring in x over Fraction Field of
Univariate Polynomial Ring in q over Integer Ring
>>> from sage.all import *
>>> from sage.combinat.q_analogues import q_int
>>> from sage.rings.polynomial.q_integer_valued_polynomials import q_binomial_x, q_int_x
>>> q_binomial_x(Integer(4),Integer(2))(Integer(0)) == q_binomial(Integer(4),Integer(2))
True
>>> q_binomial_x(Integer(3),Integer(2))(Integer(1)) == q_binomial(Integer(4),Integer(2))
True
>>> q_binomial_x(Integer(3),Integer(1)) == q_int_x(Integer(4))
True
>>> q_binomial_x(Integer(2),Integer(0)).parent()
Univariate Polynomial Ring in x over Fraction Field of
Univariate Polynomial Ring in q over Integer Ring
from sage.combinat.q_analogues import q_int
from sage.rings.polynomial.q_integer_valued_polynomials import q_binomial_x, q_int_x
q_binomial_x(4,2)(0) == q_binomial(4,2)
q_binomial_x(3,2)(1) == q_binomial(4,2)
q_binomial_x(3,1) == q_int_x(4)
q_binomial_x(2,0).parent()
sage.rings.polynomial.q_integer_valued_polynomials.q_int_x(n, q=None)[source]

Return the interpolating polynomial of \(q\)-integers.

INPUT:

  • n – a positive integer

  • q – optional variable

EXAMPLES:

sage: from sage.rings.polynomial.q_integer_valued_polynomials import q_int_x
sage: q_int_x(3)
q^2*x + q + 1
>>> from sage.all import *
>>> from sage.rings.polynomial.q_integer_valued_polynomials import q_int_x
>>> q_int_x(Integer(3))
q^2*x + q + 1
from sage.rings.polynomial.q_integer_valued_polynomials import q_int_x
q_int_x(3)