Weyl Algebras

AUTHORS:

  • Travis Scrimshaw (2013-09-06): Initial version
class sage.algebras.weyl_algebra.DifferentialWeylAlgebra(R, names=None)

Bases: sage.rings.ring.Algebra, sage.structure.unique_representation.UniqueRepresentation

The differential Weyl algebra of a polynomial ring.

Let \(R\) be a commutative ring. The (differential) Weyl algebra \(W\) is the algebra generated by \(x_1, x_2, \ldots x_n, \partial_{x_1}, \partial_{x_2}, \ldots, \partial_{x_n}\) subject to the relations: \([x_i, x_j] = 0\), \([\partial_{x_i}, \partial_{x_j}] = 0\), and \(\partial_{x_i} x_j = x_j \partial_{x_i} + \delta_{ij}\). Therefore \(\partial_{x_i}\) is acting as the partial differential operator on \(x_i\).

The Weyl algebra can also be constructed as an iterated Ore extension of the polynomial ring \(R[x_1, x_2, \ldots, x_n]\) by adding \(x_i\) at each step. It can also be seen as a quantization of the symmetric algebra \(Sym(V)\), where \(V\) is a finite dimensional vector space over a field of characteristic zero, by using a modified Groenewold-Moyal product in the symmetric algebra.

The Weyl algebra (even for \(n = 1\)) over a field of characteristic 0 has many interesting properties.

  • It’s a non-commutative domain.
  • It’s a simple ring (but not in positive characteristic) that is not a matrix ring over a division ring.
  • It has no finite-dimensional representations.
  • It’s a quotient of the universal enveloping algebra of the Heisenberg algebra \(\mathfrak{h}_n\).

REFERENCES:

INPUT:

  • R – a (polynomial) ring
  • names – (default: None) if None and R is a polynomial ring, then the variable names correspond to those of R; otherwise if names is specified, then R is the base ring

EXAMPLES:

There are two ways to create a Weyl algebra, the first is from a polynomial ring:

sage: R.<x,y,z> = QQ[]
sage: W = DifferentialWeylAlgebra(R); W
Differential Weyl algebra of polynomials in x, y, z over Rational Field

We can call W.inject_variables() to give the polynomial ring variables, now as elements of W, and the differentials:

sage: W.inject_variables()
Defining x, y, z, dx, dy, dz
sage: (dx * dy * dz) * (x^2 * y * z + x * z * dy + 1)
x*z*dx*dy^2*dz + z*dy^2*dz + x^2*y*z*dx*dy*dz + dx*dy*dz
 + x*dx*dy^2 + 2*x*y*z*dy*dz + dy^2 + x^2*z*dx*dz + x^2*y*dx*dy
 + 2*x*z*dz + 2*x*y*dy + x^2*dx + 2*x

Or directly by specifying a base ring and variable names:

sage: W.<a,b> = DifferentialWeylAlgebra(QQ); W
Differential Weyl algebra of polynomials in a, b over Rational Field

Todo

Implement the graded_algebra() as a polynomial ring once they are considered to be graded rings (algebras).

Element

alias of DifferentialWeylAlgebraElement

algebra_generators()

Return the algebra generators of self.

EXAMPLES:

sage: R.<x,y,z> = QQ[]
sage: W = DifferentialWeylAlgebra(R)
sage: W.algebra_generators()
Finite family {'dz': dz, 'dx': dx, 'dy': dy, 'y': y, 'x': x, 'z': z}
basis()

Return a basis of self.

EXAMPLES:

sage: W.<x,y> = DifferentialWeylAlgebra(QQ)
sage: B = W.basis()
sage: it = iter(B)
sage: [next(it) for i in range(20)]
[1, x, y, dx, dy, x^2, x*y, x*dx, x*dy, y^2, y*dx, y*dy,
 dx^2, dx*dy, dy^2, x^3, x^2*y, x^2*dx, x^2*dy, x*y^2]
sage: dx, dy = W.differentials()
sage: (dx*x).monomials()
[1, x*dx]
sage: B[(x*y).support()[0]]
x*y
sage: sorted((dx*x).monomial_coefficients().items())
[(((0, 0), (0, 0)), 1), (((1, 0), (1, 0)), 1)]
degree_on_basis(i)

Return the degree of the basis element indexed by i.

EXAMPLES:

sage: W.<a,b> = DifferentialWeylAlgebra(QQ)
sage: W.degree_on_basis( ((1, 3, 2), (0, 1, 3)) )
10

sage: W.<x,y,z> = DifferentialWeylAlgebra(QQ)
sage: dx,dy,dz = W.differentials()
sage: elt = y*dy - (3*x - z)*dx
sage: elt.degree()
2
differentials()

Return the differentials of self.

EXAMPLES:

sage: W.<x,y,z> = DifferentialWeylAlgebra(QQ)
sage: W.differentials()
Finite family {'dz': dz, 'dx': dx, 'dy': dy}
gen(i)

Return the i-th generator of self.

EXAMPLES:

sage: R.<x,y,z> = QQ[]
sage: W = DifferentialWeylAlgebra(R)
sage: [W.gen(i) for i in range(6)]
[x, y, z, dx, dy, dz]
ngens()

Return the number of generators of self.

EXAMPLES:

sage: R.<x,y,z> = QQ[]
sage: W = DifferentialWeylAlgebra(R)
sage: W.ngens()
6
one()

Return the multiplicative identity element \(1\).

EXAMPLES:

sage: R.<x,y,z> = QQ[]
sage: W = DifferentialWeylAlgebra(R)
sage: W.one()
1
polynomial_ring()

Return the associated polynomial ring of self.

EXAMPLES:

sage: W.<a,b> = DifferentialWeylAlgebra(QQ)
sage: W.polynomial_ring()
Multivariate Polynomial Ring in a, b over Rational Field
sage: R.<x,y,z> = QQ[]
sage: W = DifferentialWeylAlgebra(R)
sage: W.polynomial_ring() == R
True
variables()

Return the variables of self.

EXAMPLES:

sage: W.<x,y,z> = DifferentialWeylAlgebra(QQ)
sage: W.variables()
Finite family {'y': y, 'x': x, 'z': z}
zero()

Return the additive identity element \(0\).

EXAMPLES:

sage: R.<x,y,z> = QQ[]
sage: W = DifferentialWeylAlgebra(R)
sage: W.zero()
0
class sage.algebras.weyl_algebra.DifferentialWeylAlgebraElement(parent, monomials)

Bases: sage.structure.element.AlgebraElement

An element in a differential Weyl algebra.

list()

Return self as a list.

This list consists of pairs \((m, c)\), where \(m\) is a pair of tuples indexing a basis element of self, and \(c\) is the coordinate of self corresponding to this basis element. (Only nonzero coordinates are shown.)

EXAMPLES:

sage: W.<x,y,z> = DifferentialWeylAlgebra(QQ)
sage: dx,dy,dz = W.differentials()
sage: elt = dy - (3*x - z)*dx
sage: elt.list()
[(((0, 0, 0), (0, 1, 0)), 1),
 (((0, 0, 1), (1, 0, 0)), 1),
 (((1, 0, 0), (1, 0, 0)), -3)]
monomial_coefficients(copy=True)

Return a dictionary which has the basis keys in the support of self as keys and their corresponding coefficients as values.

INPUT:

  • copy – (default: True) if self is internally represented by a dictionary d, then make a copy of d; if False, then this can cause undesired behavior by mutating d

EXAMPLES:

sage: W.<x,y,z> = DifferentialWeylAlgebra(QQ)
sage: dx,dy,dz = W.differentials()
sage: elt = (dy - (3*x - z)*dx)
sage: sorted(elt.monomial_coefficients().items())
[(((0, 0, 0), (0, 1, 0)), 1),
 (((0, 0, 1), (1, 0, 0)), 1),
 (((1, 0, 0), (1, 0, 0)), -3)]
support()

Return the support of self.

EXAMPLES:

sage: W.<x,y,z> = DifferentialWeylAlgebra(QQ)
sage: dx,dy,dz = W.differentials()
sage: elt = dy - (3*x - z)*dx + 1
sage: elt.support()
[((0, 0, 0), (0, 1, 0)),
 ((1, 0, 0), (1, 0, 0)),
 ((0, 0, 0), (0, 0, 0)),
 ((0, 0, 1), (1, 0, 0))]
sage.algebras.weyl_algebra.repr_from_monomials(monomials, term_repr, use_latex=False)

Return a string representation of an element of a free module from the dictionary monomials.

INPUT:

  • monomials – a list of pairs [m, c] where m is the index and c is the coefficient
  • term_repr – a function which returns a string given an index (can be repr or latex, for example)
  • use_latex – (default: False) if True then the output is in latex format

EXAMPLES:

sage: from sage.algebras.weyl_algebra import repr_from_monomials
sage: R.<x,y,z> = QQ[]
sage: d = [(z, 4/7), (y, sqrt(2)), (x, -5)]
sage: repr_from_monomials(d, lambda m: repr(m))
'4/7*z + sqrt(2)*y - 5*x'
sage: a = repr_from_monomials(d, lambda m: latex(m), True); a
\frac{4}{7} z + \sqrt{2} y - 5 x
sage: type(a)
<class 'sage.misc.latex.LatexExpr'>

The zero element:

sage: repr_from_monomials([], lambda m: repr(m))
'0'
sage: a = repr_from_monomials([], lambda m: latex(m), True); a
0
sage: type(a)
<class 'sage.misc.latex.LatexExpr'>

A “unity” element:

sage: repr_from_monomials([(1, 1)], lambda m: repr(m))
'1'
sage: a = repr_from_monomials([(1, 1)], lambda m: latex(m), True); a
1
sage: type(a)
<class 'sage.misc.latex.LatexExpr'>
sage: repr_from_monomials([(1, -1)], lambda m: repr(m))
'-1'
sage: a = repr_from_monomials([(1, -1)], lambda m: latex(m), True); a
-1
sage: type(a)
<class 'sage.misc.latex.LatexExpr'>

Leading minus signs are dealt with appropriately:

sage: d = [(z, -4/7), (y, -sqrt(2)), (x, -5)]
sage: repr_from_monomials(d, lambda m: repr(m))
'-4/7*z - sqrt(2)*y - 5*x'
sage: a = repr_from_monomials(d, lambda m: latex(m), True); a
-\frac{4}{7} z - \sqrt{2} y - 5 x
sage: type(a)
<class 'sage.misc.latex.LatexExpr'>

Indirect doctests using a class that uses this function:

sage: R.<x,y> = QQ[]
sage: A = CliffordAlgebra(QuadraticForm(R, 3, [x,0,-1,3,-4,5]))
sage: a,b,c = A.gens()
sage: a*b*c
e0*e1*e2
sage: b*c
e1*e2
sage: (a*a + 2)
x + 2
sage: c*(a*a + 2)*b
(-x - 2)*e1*e2 - 4*x - 8
sage: latex(c*(a*a + 2)*b)
\left( - x - 2 \right)  e_{1} e_{2} - 4 x - 8