Coverage for local/lib/python2.7/site-packages/sage/algebras/lie_algebras/heisenberg.py : 98%
 
         
         
    Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
| """ Heisenberg Algebras 
 AUTHORS: 
 - Travis Scrimshaw (2013-08-13): Initial version """ 
 #***************************************************************************** # Copyright (C) 2013-2017 Travis Scrimshaw <tcscrims at gmail.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 2 of the License, or # (at your option) any later version. # http://www.gnu.org/licenses/ #***************************************************************************** 
 
 LieAlgebraWithGenerators) LieAlgebraMatrixWrapper) 
 """ The common methods for the (non-matrix) Heisenberg algebras. """ """ Initialize ``self``. 
 EXAMPLES:: 
 sage: L = lie_algebras.Heisenberg(QQ, oo) # indirect doctest """ latex_bracket=False, string_quotes=False) 
 """ The generator `p_i` of the Heisenberg algebra. 
 EXAMPLES:: 
 sage: L = lie_algebras.Heisenberg(QQ, oo) sage: L.p(2) p2 """ 
 """ The generator `q_i` of the Heisenberg algebra. 
 EXAMPLES:: 
 sage: L = lie_algebras.Heisenberg(QQ, oo) sage: L.q(2) q2 """ 
 """ 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 """ 
 """ 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 """ 
 r""" Return a string representation of the term indexed by ``m``. 
 EXAMPLES:: 
 sage: H = lie_algebras.Heisenberg(QQ, 3) sage: H._repr_term('p1') 'p1' sage: H._repr_term('z') 'z' """ 
 r""" Return a string representation of the term indexed by ``m``. 
 EXAMPLES:: 
 sage: H = lie_algebras.Heisenberg(QQ, 10) sage: H._latex_term('p1') 'p_{1}' sage: H._latex_term('z') 'z' sage: latex(H.p(10)) p_{10} """ 
 
 """ Common methods for finite-dimensional Heisenberg algebras. """ """ Initialize ``self``. 
 INPUT: 
 - ``n`` -- the rank 
 TESTS:: 
 sage: H = lie_algebras.Heisenberg(QQ, 3) # indirect doctest """ 
 """ 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 """ 
 def gens(self): """ 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,) """ 
 """ 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 """ 
 def lie_algebra_generators(self): """ Return the Lie algebra generators of ``self``. 
 EXAMPLES:: 
 sage: H = lie_algebras.Heisenberg(QQ, 1) sage: H.lie_algebra_generators() Finite family {'q1': q1, 'p1': p1} sage: H = lie_algebras.Heisenberg(QQ, 0) sage: H.lie_algebra_generators() Finite family {'z': z} """ 
 def basis(self): """ Return the basis of ``self``. 
 EXAMPLES:: 
 sage: H = lie_algebras.Heisenberg(QQ, 1) sage: H.basis() Finite family {'q1': q1, 'p1': p1, 'z': z} """ 
 """ Return the coercion map from ``H`` to ``self`` if one exists, otherwise return ``None``. 
 EXAMPLES:: 
 sage: HB = lie_algebras.Heisenberg(QQ, 3) sage: HM = lie_algebras.Heisenberg(QQ, 3, representation="matrix") sage: HB.has_coerce_map_from(HM) True sage: HM.has_coerce_map_from(HB) True sage: HB(HM.p(2)) p2 sage: HM(-HB.q(3)) == -HM.q(3) True sage: HB(HM.z()) z sage: HM(HB.z()) == HM.z() True sage: HQ = lie_algebras.Heisenberg(QQ, 2) sage: HB.has_coerce_map_from(HQ) True sage: HB(HQ.p(2)) p2 sage: HZ = lie_algebras.Heisenberg(ZZ, 2) sage: HB.has_coerce_map_from(HZ) True sage: HB(HZ.p(2)) p2 sage: HZ = lie_algebras.Heisenberg(ZZ, 2, representation="matrix") sage: HB.has_coerce_map_from(HZ) True sage: HB(HZ.p(2)) p2 """ return None # Otherwise no coercion 
 LieAlgebraWithGenerators): """ 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: 
 .. MATH:: 
 [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:`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: 
 - :wikipedia:`Heisenberg_algebra` 
 EXAMPLES:: 
 sage: L = lie_algebras.Heisenberg(QQ, 2) """ """ Initialize ``self``. 
 EXAMPLES:: 
 sage: L = lie_algebras.Heisenberg(QQ, 2) sage: TestSuite(L).run() sage: L = lie_algebras.Heisenberg(QQ, 0) # not tested -- :trac:`18224` sage: TestSuite(L).run() """ + ['q%s'%i for i in range(1,n+1)] + ['z']) category=LieAlgebras(R).FiniteDimensional().WithBasis()) 
 """ Return a string representation of ``self``. 
 EXAMPLES:: 
 sage: lie_algebras.Heisenberg(QQ, 3) Heisenberg algebra of rank 3 over Rational Field """ 
 r""" 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 :class:`HeisenbergAlgebra` for more information. """ """ Initialize ``self``. 
 EXAMPLES:: 
 sage: L = lie_algebras.Heisenberg(QQ, oo) sage: TestSuite(L).run() sage: L.p(1).bracket(L.q(1)) == L.z() True sage: L.q(1).bracket(L.p(1)) == -L.z() True """ 
 """ Return a string representation of ``self``. 
 EXAMPLES:: 
 sage: lie_algebras.Heisenberg(QQ, oo) Infinite Heisenberg algebra over Rational Field """ 
 """ Return an element of ``self``. 
 EXAMPLES:: 
 sage: L = lie_algebras.Heisenberg(QQ, oo) sage: L._an_element_() p2 + q2 - 1/2*q3 + z """ 
 """ 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'})} 
 """ name='generator map') 
 """ 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 """ 
 """ Return the monomial in ``self`` corresponding to the basis element indexed by ``i``, where ``i`` is a basis index for a *finite-dimensional* Heisenberg algebra. 
 This is used for coercion. 
 EXAMPLES:: 
 sage: H = lie_algebras.Heisenberg(QQ, oo) sage: H._from_fd_on_basis('p2') p2 sage: H._from_fd_on_basis('q3') q3 sage: H._from_fd_on_basis('z') z """ 
 """ Return the coercion map from ``H`` to ``self`` if one exists, otherwise return ``None``. 
 EXAMPLES:: 
 sage: H = lie_algebras.Heisenberg(QQ, oo) sage: HZ = lie_algebras.Heisenberg(ZZ, oo) sage: phi = H.coerce_map_from(HZ) sage: phi(HZ.p(3)) == H.p(3) True sage: phi(HZ.p(3)).leading_coefficient().parent() Rational Field sage: HF = lie_algebras.Heisenberg(QQ, 3, representation="matrix") sage: H.has_coerce_map_from(HF) True sage: H(HF.p(2)) p2 sage: H(HF.z()) z sage: HF = lie_algebras.Heisenberg(QQ, 3) sage: H.has_coerce_map_from(HF) True sage: H(HF.p(2)) p2 sage: H(HF.z()) z """ return None # Otherwise no coercion return None # Otherwise no coercion 
 ####################################################### ## Finite rank Heisenberg algebra using matrices 
 r""" 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: 
 .. MATH:: 
 \begin{bmatrix} 0 & p^T & k \\ 0 & 0_n & q \\ 0 & 0 & 0 \end{bmatrix} 
 where `p, q \in R^n` and `0_n` in the `n \times n` zero matrix. It has a basis consisting of 
 .. MATH:: 
 \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} 
 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 :class:`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]} """ """ Initialize ``self``. 
 EXAMPLES:: 
 sage: L = lie_algebras.Heisenberg(QQ, 2, representation="matrix") sage: TestSuite(L).run() """ index_set=names, category=cat) 
 """ Return a string representation of ``self``. 
 EXAMPLES:: 
 sage: lie_algebras.Heisenberg(QQ, 3, representation="matrix") Heisenberg algebra of rank 3 over Rational Field """ 
 r""" 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] """ 
 r""" 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] """ 
 """ 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] """ 
 """ 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)] """ else: 
 |