Weyl Algebras¶
AUTHORS:
- Travis Scrimshaw (2013-09-06): Initial version
-
sage.algebras.weyl_algebra.
DifferentialWeylAlgebra
¶ 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) ringnames
– (default:None
) ifNone
andR
is a polynomial ring, then the variable names correspond to those ofR
; otherwise ifnames
is specified, thenR
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 ofW
, 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).
-
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 ofself
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
) ifself
is internally represented by a dictionaryd
, then make a copy ofd
; ifFalse
, then this can cause undesired behavior by mutatingd
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: sorted(elt.support()) [((0, 0, 0), (0, 0, 0)), ((0, 0, 0), (0, 1, 0)), ((0, 0, 1), (1, 0, 0)), ((1, 0, 0), (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]
wherem
is the index andc
is the coefficientterm_repr
– a function which returns a string given an index (can berepr
orlatex
, for example)use_latex
– (default:False
) ifTrue
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