display_dict(dictionary)
The display_dict
is used to display a dictionary of expressions as LaTeX formatted expressions in an IPython environment. Each key-value pair from the dictionary is displayed as a LaTeX-rendered expression.
Parameters
- dictionary (
dict
):
A dictionary where each key and value represents an expression to be displayed. If a key is an instance ofExpression
, it will be simplified before rendering.
Returns
This function does not return any value. It directly outputs the LaTeX formatted expressions using IPython's display
and Math
functions.
Example Usage
Below is an example demonstrating how to use the group_by_operators
function:
from sympy import symbols
from sympt import group_by_operators, BosonOp
omega = symbols("omega", real=True)
omega_z = symbols("omega_z", real=True)
a = BosonOp("a")
ad = Dagger(a)
spin = RDBasis("sigma", 2)
s0, sx, sy, sz = spin.basis
H = omega * ad * a + omega * sz + omega_z * sz
# Group the expression by its quantum operator terms
grouped_terms = group_by_operators(H)
display_dict(grouped_terms)
\(\sigma_{z} : \omega + \omega_z\)
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.