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

Quantum-valued polynomial rings commute with their base ring:

sage: K = QuantumValuedPolynomialRing(QQ).S()
sage: a = K.gen()
sage: c = K.monomial(2)

Quantum-valued polynomial rings are commutative:

sage: c^3 * a == c * a * c * c
True

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]
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
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]
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
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],)
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_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]
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]
gens()[source]

alias of 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
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]
q()[source]

Return the variable q.

EXAMPLES:

sage: A = QuantumValuedPolynomialRing(QQ).S()
sage: A.q()
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]
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]=[xi]q for iN.

Assuming n1n2, the product of two monomials B[n1]B[n2] is given by the sum

k=0n1q(kn1)(kn2)[n1k]q[n1+n2kn1]qB[n1+n2k].
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 x1+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]
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]
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]=[i+xi]q for iN.

Assuming n1n2, the product of two monomials S[n1]S[n2] is given by the sum

k=0n1(1)kq(k2)n1n2[n1k]q[n1+n2kn1]qS[n1+n2k].
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
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
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
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)
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)
variable_shift(k=1)[source]

Return the image by the shift on variables.

The shift is the substitution operator

xqx+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_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]
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]
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
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
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