# Heisenberg Algebras#

AUTHORS:

• Travis Scrimshaw (2013-08-13): Initial version

class sage.algebras.lie_algebras.heisenberg.HeisenbergAlgebra(R, n)[source]#

A Heisenberg algebra defined using structure coefficients.

The $$n$$-th Heisenberg algebra (where $$n$$ is a nonnegative integer or infinity) is the Lie algebra with basis $$\{p_i\}_{1 \leq i \leq n} \cup \{q_i\}_{1 \leq i \leq n} \cup \{z\}$$ with the following relations:

$[p_i, q_j] = \delta_{ij} z, \quad [p_i, z] = [q_i, z] = [p_i, p_j] = [q_i, q_j] = 0.$

This Lie algebra is also known as the Heisenberg algebra of rank $$n$$.

Note

The relations $$[p_i, q_j] = \delta_{ij} z$$, $$[p_i, z] = 0$$, and $$[q_i, z] = 0$$ are known as canonical commutation relations. See Wikipedia article Canonical_commutation_relations.

Warning

The $$n$$ in the above definition is called the “rank” of the Heisenberg algebra; it is not, however, a rank in any of the usual meanings that this word has in the theory of Lie algebras.

INPUT:

• R – the base ring

• n – the rank of the Heisenberg algebra

REFERENCES:

EXAMPLES:

sage: L = lie_algebras.Heisenberg(QQ, 2)

>>> from sage.all import *
>>> L = lie_algebras.Heisenberg(QQ, Integer(2))

class sage.algebras.lie_algebras.heisenberg.HeisenbergAlgebra_abstract(I)[source]#

The common methods for the (non-matrix) Heisenberg algebras.

class Element[source]#
bracket_on_basis(x, y)[source]#

Return the bracket of basis elements indexed by x and y where x < y.

The basis of a Heisenberg algebra is ordered in such a way that the $$p_i$$ come first, the $$q_i$$ come next, and the $$z$$ comes last.

EXAMPLES:

sage: H = lie_algebras.Heisenberg(QQ, 3)
sage: p1 = ('p', 1)
sage: q1 = ('q', 1)
sage: H.bracket_on_basis(p1, q1)
z

>>> from sage.all import *
>>> H = lie_algebras.Heisenberg(QQ, Integer(3))
>>> p1 = ('p', Integer(1))
>>> q1 = ('q', Integer(1))
>>> H.bracket_on_basis(p1, q1)
z

p(i)[source]#

The generator $$p_i$$ of the Heisenberg algebra.

EXAMPLES:

sage: L = lie_algebras.Heisenberg(QQ, oo)
sage: L.p(2)
p2

>>> from sage.all import *
>>> L = lie_algebras.Heisenberg(QQ, oo)
>>> L.p(Integer(2))
p2

q(i)[source]#

The generator $$q_i$$ of the Heisenberg algebra.

EXAMPLES:

sage: L = lie_algebras.Heisenberg(QQ, oo)
sage: L.q(2)
q2

>>> from sage.all import *
>>> L = lie_algebras.Heisenberg(QQ, oo)
>>> L.q(Integer(2))
q2

step()[source]#

Return the nilpotency step of self.

EXAMPLES:

sage: h = lie_algebras.Heisenberg(ZZ, 10)
sage: h.step()
2

sage: h = lie_algebras.Heisenberg(ZZ, oo)
sage: h.step()
2

>>> from sage.all import *
>>> h = lie_algebras.Heisenberg(ZZ, Integer(10))
>>> h.step()
2

>>> h = lie_algebras.Heisenberg(ZZ, oo)
>>> h.step()
2

z()[source]#

Return the basis element $$z$$ of the Heisenberg algebra.

The element $$z$$ spans the center of the Heisenberg algebra.

EXAMPLES:

sage: L = lie_algebras.Heisenberg(QQ, oo)
sage: L.z()
z

>>> from sage.all import *
>>> L = lie_algebras.Heisenberg(QQ, oo)
>>> L.z()
z

class sage.algebras.lie_algebras.heisenberg.HeisenbergAlgebra_fd(n)[source]#

Bases: object

Common methods for finite-dimensional Heisenberg algebras.

basis()[source]#

Return the basis of self.

EXAMPLES:

sage: H = lie_algebras.Heisenberg(QQ, 1)
sage: H.basis()
Finite family {'p1': p1, 'q1': q1, 'z': z}

>>> from sage.all import *
>>> H = lie_algebras.Heisenberg(QQ, Integer(1))
>>> H.basis()
Finite family {'p1': p1, 'q1': q1, 'z': z}

gen(i)[source]#

Return the i-th generator of self.

EXAMPLES:

sage: H = lie_algebras.Heisenberg(QQ, 2)
sage: H.gen(0)
p1
sage: H.gen(3)
q2

>>> from sage.all import *
>>> H = lie_algebras.Heisenberg(QQ, Integer(2))
>>> H.gen(Integer(0))
p1
>>> H.gen(Integer(3))
q2

gens()[source]#

Return the Lie algebra generators of self.

EXAMPLES:

sage: H = lie_algebras.Heisenberg(QQ, 2)
sage: H.gens()
(p1, p2, q1, q2)
sage: H = lie_algebras.Heisenberg(QQ, 0)
sage: H.gens()
(z,)

>>> from sage.all import *
>>> H = lie_algebras.Heisenberg(QQ, Integer(2))
>>> H.gens()
(p1, p2, q1, q2)
>>> H = lie_algebras.Heisenberg(QQ, Integer(0))
>>> H.gens()
(z,)

lie_algebra_generators()[source]#

Return the Lie algebra generators of self.

EXAMPLES:

sage: H = lie_algebras.Heisenberg(QQ, 1)
sage: H.lie_algebra_generators()
Finite family {'p1': p1, 'q1': q1}
sage: H = lie_algebras.Heisenberg(QQ, 0)
sage: H.lie_algebra_generators()
Finite family {'z': z}

>>> from sage.all import *
>>> H = lie_algebras.Heisenberg(QQ, Integer(1))
>>> H.lie_algebra_generators()
Finite family {'p1': p1, 'q1': q1}
>>> H = lie_algebras.Heisenberg(QQ, Integer(0))
>>> H.lie_algebra_generators()
Finite family {'z': z}

n()[source]#

Return the rank of the Heisenberg algebra self.

This is the n such that self is the $$n$$-th Heisenberg algebra. The dimension of this Heisenberg algebra is then $$2n + 1$$.

EXAMPLES:

sage: H = lie_algebras.Heisenberg(QQ, 3)
sage: H.n()
3
sage: H = lie_algebras.Heisenberg(QQ, 3, representation="matrix")
sage: H.n()
3

>>> from sage.all import *
>>> H = lie_algebras.Heisenberg(QQ, Integer(3))
>>> H.n()
3
>>> H = lie_algebras.Heisenberg(QQ, Integer(3), representation="matrix")
>>> H.n()
3

class sage.algebras.lie_algebras.heisenberg.HeisenbergAlgebra_matrix(R, n)[source]#

A Heisenberg algebra represented using matrices.

The $$n$$-th Heisenberg algebra over $$R$$ is a Lie algebra which is defined as the Lie algebra of the $$(n+2) \times (n+2)$$-matrices:

$\begin{split}\begin{bmatrix} 0 & p^T & k \\ 0 & 0_n & q \\ 0 & 0 & 0 \end{bmatrix}\end{split}$

where $$p, q \in R^n$$ and $$0_n$$ in the $$n \times n$$ zero matrix. It has a basis consisting of

\begin{split}\begin{aligned} p_i & = \begin{bmatrix} 0 & e_i^T & 0 \\ 0 & 0_n & 0 \\ 0 & 0 & 0 \end{bmatrix} \qquad \text{for } 1 \leq i \leq n , \\ q_i & = \begin{bmatrix} 0 & 0 & 0 \\ 0 & 0_n & e_i \\ 0 & 0 & 0 \end{bmatrix} \qquad \text{for } 1 \leq i \leq n , \\ z & = \begin{bmatrix} 0 & 0 & 1 \\ 0 & 0_n & 0 \\ 0 & 0 & 0 \end{bmatrix}, \end{aligned}\end{split}

where $$\{e_i\}$$ is the standard basis of $$R^n$$. In other words, it has the basis $$(p_1, p_2, \ldots, p_n, q_1, q_2, \ldots, q_n, z)$$, where $$p_i = E_{1, i+1}$$, $$q_i = E_{i+1, n+2}$$ and $$z = E_{1, n+2}$$ are elementary matrices.

This Lie algebra is isomorphic to the $$n$$-th Heisenberg algebra constructed in HeisenbergAlgebra; the bases correspond to each other.

INPUT:

• R – the base ring

• n – the nonnegative integer $$n$$

EXAMPLES:

sage: L = lie_algebras.Heisenberg(QQ, 1, representation="matrix")
sage: p = L.p(1)
sage: q = L.q(1)
sage: z = L.bracket(p, q); z
[0 0 1]
[0 0 0]
[0 0 0]
sage: z == L.z()
True
sage: L.dimension()
3

sage: L = lie_algebras.Heisenberg(QQ, 2, representation="matrix")
sage: sorted(dict(L.basis()).items())
[(
[0 1 0 0]
[0 0 0 0]
[0 0 0 0]
'p1', [0 0 0 0]
),
(
[0 0 1 0]
[0 0 0 0]
[0 0 0 0]
'p2', [0 0 0 0]
),
(
[0 0 0 0]
[0 0 0 1]
[0 0 0 0]
'q1', [0 0 0 0]
),
(
[0 0 0 0]
[0 0 0 0]
[0 0 0 1]
'q2', [0 0 0 0]
),
(
[0 0 0 1]
[0 0 0 0]
[0 0 0 0]
'z', [0 0 0 0]
)]

sage: L = lie_algebras.Heisenberg(QQ, 0, representation="matrix")
sage: sorted(dict(L.basis()).items())
[(
[0 1]
'z', [0 0]
)]
sage: L.gens()
(
[0 1]
[0 0]
)
sage: L.lie_algebra_generators()
Finite family {'z': [0 1]
[0 0]}

>>> from sage.all import *
>>> L = lie_algebras.Heisenberg(QQ, Integer(1), representation="matrix")
>>> p = L.p(Integer(1))
>>> q = L.q(Integer(1))
>>> z = L.bracket(p, q); z
[0 0 1]
[0 0 0]
[0 0 0]
>>> z == L.z()
True
>>> L.dimension()
3

>>> L = lie_algebras.Heisenberg(QQ, Integer(2), representation="matrix")
>>> sorted(dict(L.basis()).items())
[(
[0 1 0 0]
[0 0 0 0]
[0 0 0 0]
'p1', [0 0 0 0]
),
(
[0 0 1 0]
[0 0 0 0]
[0 0 0 0]
'p2', [0 0 0 0]
),
(
[0 0 0 0]
[0 0 0 1]
[0 0 0 0]
'q1', [0 0 0 0]
),
(
[0 0 0 0]
[0 0 0 0]
[0 0 0 1]
'q2', [0 0 0 0]
),
(
[0 0 0 1]
[0 0 0 0]
[0 0 0 0]
'z', [0 0 0 0]
)]

>>> L = lie_algebras.Heisenberg(QQ, Integer(0), representation="matrix")
>>> sorted(dict(L.basis()).items())
[(
[0 1]
'z', [0 0]
)]
>>> L.gens()
(
[0 1]
[0 0]
)
>>> L.lie_algebra_generators()
Finite family {'z': [0 1]
[0 0]}

class Element[source]#
monomial_coefficients(copy=True)[source]#

Return a dictionary whose keys are indices of basis elements in the support of self and whose values are the corresponding coefficients.

INPUT:

• copy – ignored

EXAMPLES:

sage: L = lie_algebras.Heisenberg(QQ, 3, representation="matrix")
sage: elt = L(Matrix(QQ, [[0, 1, 3, 0, 3], [0, 0, 0, 0, 0], [0, 0, 0, 0, -3],
....:                     [0, 0, 0, 0, 7], [0, 0, 0, 0, 0]]))
sage: elt
[ 0  1  3  0  3]
[ 0  0  0  0  0]
[ 0  0  0  0 -3]
[ 0  0  0  0  7]
[ 0  0  0  0  0]
sage: sorted(elt.monomial_coefficients().items())
[('p1', 1), ('p2', 3), ('q2', -3), ('q3', 7), ('z', 3)]

>>> from sage.all import *
>>> L = lie_algebras.Heisenberg(QQ, Integer(3), representation="matrix")
>>> elt = L(Matrix(QQ, [[Integer(0), Integer(1), Integer(3), Integer(0), Integer(3)], [Integer(0), Integer(0), Integer(0), Integer(0), Integer(0)], [Integer(0), Integer(0), Integer(0), Integer(0), -Integer(3)],
...                     [Integer(0), Integer(0), Integer(0), Integer(0), Integer(7)], [Integer(0), Integer(0), Integer(0), Integer(0), Integer(0)]]))
>>> elt
[ 0  1  3  0  3]
[ 0  0  0  0  0]
[ 0  0  0  0 -3]
[ 0  0  0  0  7]
[ 0  0  0  0  0]
>>> sorted(elt.monomial_coefficients().items())
[('p1', 1), ('p2', 3), ('q2', -3), ('q3', 7), ('z', 3)]

p(i)[source]#

Return the generator $$p_i$$ of the Heisenberg algebra.

EXAMPLES:

sage: L = lie_algebras.Heisenberg(QQ, 1, representation="matrix")
sage: L.p(1)
[0 1 0]
[0 0 0]
[0 0 0]

>>> from sage.all import *
>>> L = lie_algebras.Heisenberg(QQ, Integer(1), representation="matrix")
>>> L.p(Integer(1))
[0 1 0]
[0 0 0]
[0 0 0]

q(i)[source]#

Return the generator $$q_i$$ of the Heisenberg algebra.

EXAMPLES:

sage: L = lie_algebras.Heisenberg(QQ, 1, representation="matrix")
sage: L.q(1)
[0 0 0]
[0 0 1]
[0 0 0]

>>> from sage.all import *
>>> L = lie_algebras.Heisenberg(QQ, Integer(1), representation="matrix")
>>> L.q(Integer(1))
[0 0 0]
[0 0 1]
[0 0 0]

step()[source]#

Return the nilpotency step of self.

EXAMPLES:

sage: h = lie_algebras.Heisenberg(ZZ, 2, representation="matrix")
sage: h.step()
2

>>> from sage.all import *
>>> h = lie_algebras.Heisenberg(ZZ, Integer(2), representation="matrix")
>>> h.step()
2

z()[source]#

Return the basis element $$z$$ of the Heisenberg algebra.

The element $$z$$ spans the center of the Heisenberg algebra.

EXAMPLES:

sage: L = lie_algebras.Heisenberg(QQ, 1, representation="matrix")
sage: L.z()
[0 0 1]
[0 0 0]
[0 0 0]

>>> from sage.all import *
>>> L = lie_algebras.Heisenberg(QQ, Integer(1), representation="matrix")
>>> L.z()
[0 0 1]
[0 0 0]
[0 0 0]

class sage.algebras.lie_algebras.heisenberg.InfiniteHeisenbergAlgebra(R)[source]#

The infinite Heisenberg algebra.

This is the Heisenberg algebra on an infinite number of generators. In other words, this is the Heisenberg algebra of rank $$\infty$$. See HeisenbergAlgebra for more information.

basis()[source]#

Return the basis of self.

EXAMPLES:

sage: L = lie_algebras.Heisenberg(QQ, oo)
sage: L.basis()
Lazy family (basis map(i))_{i in Disjoint union of Family ({'z'},
The Cartesian product of (Positive integers, {'p', 'q'}))}
sage: L.basis()['z']
z
sage: L.basis()[(12, 'p')]
p12

>>> from sage.all import *
>>> L = lie_algebras.Heisenberg(QQ, oo)
>>> L.basis()
Lazy family (basis map(i))_{i in Disjoint union of Family ({'z'},
The Cartesian product of (Positive integers, {'p', 'q'}))}
>>> L.basis()['z']
z
>>> L.basis()[(Integer(12), 'p')]
p12

lie_algebra_generators()[source]#

Return the generators of self as a Lie algebra.

EXAMPLES:

sage: L = lie_algebras.Heisenberg(QQ, oo)
sage: L.lie_algebra_generators()
Lazy family (generator map(i))_{i in The Cartesian product of
(Positive integers, {'p', 'q'})}

>>> from sage.all import *
>>> L = lie_algebras.Heisenberg(QQ, oo)
>>> L.lie_algebra_generators()
Lazy family (generator map(i))_{i in The Cartesian product of
(Positive integers, {'p', 'q'})}