Welcome to SymPT Documentation
Introduction
Welcome to SymPT: a Symbolic Perturbation Theory toolbox. This Python package is designed to perform symbolic perturbative transformations on quantum systems. SymPT leverages the Schrieffer-Wolff Transformation (SWT) and other related techniques to compute effective Hamiltonians in a systematic and efficient manner.
SymPT provides an intuitive and flexible framework for researchers working on quantum mechanics and quantum information science, allowing them to compute effective Hamiltonians and manipulate quantum operators symbolically. With support for both time-independent and time-dependent systems, SymPT is a powerful tool for studying perturbative interactions in quantum systems.
Related Papers
- SymPT: a comprehensive tool for automating effective Hamiltonian derivations
- Universal solution to the Schrieffer-Wolff Transformation Generator
Key Features
- Multiple Transformation Methods: Includes routines for Schrieffer-Wolff Transformation (SWT), Full-Diagonalization (FD), and Arbitrary Coupling Elimination (ACE).
- Symbolic Computation: Built on
sympy
, allowing exact symbolic results for quantum systems. - Customizable Input: Define Hamiltonians and operators using symbolic expressions with ease.
- Flexible Output: Retrieve results in operator, matrix, or dictionary formats.
- Efficient Algorithms: Uses caching and optimized partitioning for nested commutator calculations.
Installation
SymPT is available via PyPI and can be installed using pip
. We recommend setting up a new virtual environment before installation.
Install from PyPI
Install from Source
conda create -n sympt python
conda activate sympt
git clone https://github.com/qcode-uni-a/sympt.git
cd sympt
conda activate sympt
pip install .
Getting Started
Basic Workflow
- Define Symbols and Basis: Use
RDSymbol
andRDBasis
to construct system components. - Set Up EffectiveFrame: Initialize the transformation frame with the Hamiltonian.
- Solve the Transformation: Specify the perturbation order and method (
SW
,FD
, orACE
). - Extract Results: Retrieve the effective Hamiltonian or rotate operators into the new frame.
Example: Schrieffer-Wolff Transformation (SWT)
In this example we showcase how to perform a SWT aimed at perturbatively separate the spin degrees of freedom within the quantum Rabi model. To begin, we set up the symbols and operators to construct the initial Hamiltonian.
from sympt import RDSymbol, RDBasis, EffectiveFrame, BosonOp, Dagger
# Define symbols
omega = RDSymbol('omega', real=True, positive=True)
omega_z = RDSymbol('omega_z', real=True, positive=True)
g = RDSymbol('g', order=1, real=True)
# Define basis and Hamiltonian
spin = RDBasis(name='sigma', dim=2)
s0, sx, sy, sz = spin.basis
a = BosonOp('a')
ad = Dagger(a)
H = omega * ad * a + omega_z * sz
V = g * sx * (ad + a)
display(H + V)
We then procede solving the transformation up to a desired order.
# Setup EffectiveFrame
eff_frame = EffectiveFrame(H, V, subspaces=[spin])
eff_frame.solve(max_order=2, method="SW")
H_eff = eff_frame.get_H(return_form="operator")
display(H_eff)
The EffectiveFrame object has been initialized successfully.
Computing the effective Hamiltonian: 100%|██████████| 2/2 [00:00<00:00, 11.95it/s]
The Hamiltonian has been solved successfully. Please use the get_H method to get the result in the desired form.
Converting to operator form: 100%|██████████| 2/2 [00:00<00:00, 36.71it/s]
Core Components
RDSymbol
Represents scalar quantities with perturbative orders.
RDBasis
Encodes finite-dimensional subspaces and generates basis operators spanning them.
EffectiveFrame
Central class for perturbative transformations.
.solve()
: Perform the transformation..get_H()
: Retrieve the effective Hamiltonian..get_U()
: Retrieve the unitary transformation..get_S()
: Retrieve the generator of the transformation..rotate()
: Rotate operators into the new frame.
Block
Used in ACE transformations to specify couplings to eliminate.
Algorithms
- Schrieffer-Wolff Transformation (SWT): Block-diagonalizes the Hamiltonian.
- Full-Diagonalization (FD): Eliminates all off-diagonal elements.
- Arbitrary Coupling Elimination (ACE): Selectively removes specific off-diagonal couplings.
Contributing
We welcome contributions! Follow these steps: 1. Fork the repository. 2. Create a feature branch. 3. Submit a pull request with a detailed description.
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.