Skip to content

RDBasis

The RDBasis class is used to encode the information regarding a finite Hilbert space of any given Hamiltonian. Although not strictly necessary,this class is pivotal within the framework of SymPT, as it provides a systematic way to represent operators in any chosen finite subspace and allows for the projection of arbitrary matrices onto this symbolic basis.

By leveraging the properties of Gell-Mann matrices, the RDBasis class creates a complete operator basis for a Hilbert space of given dimension. Alternatively, by using projector matrices, you can represent the basis in projector form. This flexibility is essential when dealing with different quantum systems and when specific representations are desired.

Parameters

  • name (str):
    The identifier for the basis. This name is used as a prefix for naming individual basis elements. The name parameter can accept LaTeX style strings for mathematical symbols.

  • dim (int):
    Specifies the dimension of the basis. The number of basis elements is derived as dim**2.

  • projector_form (bool, optional):
    Determines whether the basis should be generated from projector matrices instead of the standard Gell-Mann matrices. Defaults to False.

Attributes

  • name (str):
    The name assigned to the basis. The name parameter can accept LaTeX style strings for mathematical symbols.

  • dim (int):
    The dimension of the basis. It indicates the size of the matrices and the number of elements in the basis (which is dim**2).

  • basis (ndarray):
    An array of RDOperator objects, each representing an operator in the basis.

  • basis_matrices (ndarray):
    An array containing the matrix representations corresponding to the basis elements.

  • basis_ling_alg_norm (int or float):
    A normalization factor computed from the algebraic properties (specifically, the trace of the product of each basis matrix with its conjugate transpose). For a single element basis, this is set equal to dim.


Methods

get_projector_matrices(self)

Generates an array of projector matrices for the basis.

  • Returns:
    • ndarray
      An array containing projector matrices of shape (dim, dim) for each element in the basis.

get_gell_mann(self)

Generates the standard set of Gell-Mann matrices.

  • Returns:
    • list[Matrix]
      A list of matrices including:
      • The identity matrix.
      • Symmetric off-diagonal matrices.
      • Anti-symmetric off-diagonal matrices.
      • Diagonal matrices scaled by an appropriate normalization factor.

project(self, to_be_projected: Matrix)

Projects an arbitrary matrix onto the constructed basis.

  • Parameters:

    • to_be_projected (Matrix):
      The matrix to project onto the basis.
  • Returns:

    • Expr
      A symbolic expression of RDOperator objects, representing the operator form of the to_be_projected Matrix.
  • Raises:

    • ValueError
      If the input matrix has incorrect dimensions.

Usage Examples

Creating a Basis with Gell-Mann Matrices

Upon initialization of an RDBasis object, a set of Gell-Mann operators (default) spanning the given space will be automatically generated. In the following example we show how to initialize an RDBasis instance and retrieve the identity operator generated by this.

from sympt import RDBasis

# Initialize a basis using Gell-Mann (Pauli) matrices a two-dimensional Hilbert space.
spin = RDBasis(name='sigma', dim=2)
print("Basis name:", spin.name)
print("Dimension:", spin.dim)
display(spin.basis[0])
Basis name: sigma
Dimension: 2
\(\sigma_0\)

Creating a Basis with Projector Matrices

Depending on the user's necessities, it may be more convinient to have finite subspaces being spanned by projector operators rather than Gell-Mann operators. This can be achieved upon initializationof an RDBasis object, by enforcing projector_form = True.

from sympt import RDBasis

# Initialize a basis using projector matrices.
projector_basis = RDBasis(name='Pi', dim=2, projector_form=True)
print("Basis matrices:\n", projector_basis.basis_matrices)
Basis matrices:
 [[[1 0]
  [0 0]]

 [[0 1]
  [0 0]]

 [[0 0]
  [1 0]]

 [[0 0]
  [0 1]]]

Projecting a Matrix onto the Basis

In the scenario in which a user may need to work with operators not represented by neither Gell-Mann nor projector operators, SymPT provides the possibility of expressing any other operator as superposition of the basis contained within an initialized RDBasis object. This is achieved by providing a Matrix to the .project() method.

from sympt import RDBasis
from sympy import Matrix

basis = RDBasis(name='sigma', dim=2)
matrix_to_project = Matrix([[1, 0], [0, -1]])

# Project the matrix onto the basis.
projection = basis.project(matrix_to_project)
print("Projection result:\n")
display(projection.simplify())
Projection result:
\(\sigma_3\)

License

SymPT is licensed under the MIT License. See the LICENSE file for details.


Citation

If you use SymPT in your research, please cite the following paper:

BibTeX Entry:

@misc{diotallevi2024symptcomprehensivetoolautomating,
      title={SymPT: a comprehensive tool for automating effective Hamiltonian derivations}, 
      author={Giovanni Francesco Diotallevi and Leander Reascos and Mónica Benito},
      year={2024},
      eprint={2412.10240},
      archivePrefix={arXiv},
      primaryClass={quant-ph},
      url={https://arxiv.org/abs/2412.10240}, 
}

APA Citation:

Diotallevi, G. F., Reascos, L., & Benito, M. (2024). SymPT: a comprehensive tool for automating effective Hamiltonian derivations. arXiv preprint arXiv:2412.10240.

IEEE Citation:

G. F. Diotallevi, L. Reascos, and M. Benito, "SymPT: a comprehensive tool for automating effective Hamiltonian derivations," arXiv preprint arXiv:2412.10240, 2024.


References