AUTHORS:
Bases: sage.rings.ring.Algebra, sage.structure.unique_representation.UniqueRepresentation
The differential Weyl algebra of a polynomial ring.
Let be a commutative ring. The (differential) Weyl algebra
is
the algebra generated by
subject to the relations:
,
, and
. Therefore
is acting as the partial differential operator on
.
The Weyl algebra can also be constructed as an iterated Ore extension
of the polynomial ring by adding
at
each step. It can also be seen as a quantization of the symmetric algebra
, where
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 ) over a field of characteristic 0
has many interesting properties.
REFERENCES:
INPUT:
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
alias of DifferentialWeylAlgebraElement
Return the algebra generators of self.
See also
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}
Return a basis of self.
EXAMPLES:
sage: W.<x,y> = DifferentialWeylAlgebra(QQ)
sage: B = W.basis()
sage: it = iter(B)
sage: [it.next() 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]
Return the differentials of self.
See also
EXAMPLES:
sage: W.<x,y,z> = DifferentialWeylAlgebra(QQ)
sage: W.differentials()
Finite family {'dz': dz, 'dx': dx, 'dy': dy}
Return the i-th generator of self.
See also
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]
Return the number of generators of self.
EXAMPLES:
sage: R.<x,y,z> = QQ[]
sage: W = DifferentialWeylAlgebra(R)
sage: W.ngens()
6
Return the multiplicative identity element .
EXAMPLES:
sage: R.<x,y,z> = QQ[]
sage: W = DifferentialWeylAlgebra(R)
sage: W.one()
1
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
Return the variables of self.
See also
EXAMPLES:
sage: W.<x,y,z> = DifferentialWeylAlgebra(QQ)
sage: W.variables()
Finite family {'y': y, 'x': x, 'z': z}
Return the additive identity element .
EXAMPLES:
sage: R.<x,y,z> = QQ[]
sage: W = DifferentialWeylAlgebra(R)
sage: W.zero()
0
Bases: sage.structure.element.AlgebraElement
An element in a differential Weyl algebra.
Return self as a list.
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)]
Return a string representation of an element of a free module from the dictionary monomials.
INPUT:
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