System found in Pymablock: an algorithm and a package for quasi-degenerate perturbation theory: arXiv:2404.03728v1
Setup
# ---------------- Defining the symbols ------------------
# Order 0
omega_t = RDSymbol('omega_t', order=0, positive=True, real=True)
omega_r = RDSymbol('omega_r', order=0, positive=True, real=True)
alpha = RDSymbol('alpha', order=0, positive=True, real=True)
# Order 1
g = RDSymbol('g', order=1, positive=True, real=True)
# ----------------- Defining the basis -------------------
# Boson basis transmon: Infinite bosonic Hilbert space
a_t = BosonOp('a_t')
ad_t = Dagger(a_t)
# Boson basis resonator: Infinite bosonic Hilbert space
a_r = BosonOp('a_r')
ad_r = Dagger(a_r)
# -------------- Defining the Hamiltonian ----------------
# Unperturbed Hamiltonian H0
H0 = omega_t * ad_t * a_t + omega_r * ad_r * a_r + sp.Rational(1,2) * alpha * ad_t * ad_t * a_t * a_t
display(H0)
# Interaction Hamiltonian V
V = -g * (ad_t - a_t) * (ad_r - a_r)
display(V)
\(\displaystyle \frac{\alpha {a_t^\dagger}^{2} a_t^{2}}{2} + \omega_{r} {a_r^\dagger} a_r + \omega_{t} {a_t^\dagger} a_t\)
\(\displaystyle - g \left({a_t^\dagger} - a_t\right) \left({a_r^\dagger} - a_r\right)\)
[32mThe EffectiveFrame object has been initialized successfully.[0m
Standard Schrieffer-Wolff Transformation
# Calculate the effective model using the Schrieffer-Wolff transformation up to the second order
Eff_frame.solve(max_order=2, method="SW")
# Obtaining the result in the dict_operator form
H_eff_SWT = Eff_frame.get_H(return_form='operator')
Computing the effective Hamiltonian: 100%|████████| 2/2 [00:01<00:00, 1.25it/s]
[32mThe Hamiltonian has been solved successfully. Please use the get_H method to get the result in the desired form.[0m
Converting to operator form: 100%|████████████████| 2/2 [00:00<00:00, 14.70it/s]
Computing the effective Hamiltonian: 100%|██████████| 2/2 [00:00<00:00, 5.14it/s]
[32mThe Hamiltonian has been solved successfully. Please use the get_H method to get the result in the desired form.[0m
Converting to operator form: 100%|██████████| 2/2 [00:00<00:00, 52.81it/s]
# substitution dictionary for transmon ground state
subs_nt0 = {
a_t : 0,
ad_t : 0
}
# Corrections to the Hamiltonian for each order
H0, H2 = [H_correction for H_correction in Eff_frame.corrections.values()]
\(\displaystyle {a_t^\dagger} a_t : - \frac{\alpha}{2} + \omega_{t}\)
\(\displaystyle \left({a_t^\dagger} a_t\right)^{2} : \frac{\alpha}{2}\)
\(\displaystyle {a_r^\dagger} a_r : \omega_{r}\)
# displaying second order correction
grouped_H2 = group_by_operators(H2.subs(subs_nt0).expand())
display_dict({k : v.simplify() for k,v in grouped_H2.items()})
\(\displaystyle {a_r^\dagger}^{2} : - \frac{g^{2} \omega_{t}}{\left(\omega_{r} - \omega_{t}\right) \left(\omega_{r} + \omega_{t}\right)}\)
\(\displaystyle a_r^{2} : - \frac{g^{2} \omega_{t}}{\left(\omega_{r} - \omega_{t}\right) \left(\omega_{r} + \omega_{t}\right)}\)
\(\displaystyle 1 : - \frac{g^{2}}{\omega_{r} + \omega_{t}}\)
\(\displaystyle {a_r^\dagger} a_r : \frac{2 g^{2} \omega_{t}}{\left(\omega_{r} - \omega_{t}\right) \left(\omega_{r} + \omega_{t}\right)}\)
ACE
# Deffining the mask
mask = Block(inf=a_r*a_t) + Block(inf=ad_r*a_t) + Block(inf=a_r**2) + Block(inf=a_t**2*a_r**2) + Block(inf=ad_t*ad_r) + Block(inf=ad_t**2*a_r**2)
# Calculate the effective model using the Mask routine up to the second order
Eff_frame.solve(max_order=2, method="ACE", mask=mask)
H_eff_Mask = Eff_frame.get_H(return_form='operator')
[32mThe perturbative interaction will be added to the full Hamiltonian[0m
Computing the effective Hamiltonian: 100%|████████| 2/2 [00:03<00:00, 1.82s/it]
[32mThe Hamiltonian has been solved successfully. Please use the get_H method to get the result in the desired form.[0m
Converting to operator form: 100%|████████████████| 2/2 [00:00<00:00, 26.67it/s]
# Corrections to the Hamiltonian for each order
H0, H2 = [H_correction for H_correction in Eff_frame.corrections.values()]
\(\displaystyle {a_t^\dagger} a_t : - \frac{\alpha}{2} + \omega_{t}\)
\(\displaystyle \left({a_t^\dagger} a_t\right)^{2} : \frac{\alpha}{2}\)
\(\displaystyle {a_r^\dagger} a_r : \omega_{r}\)
# displaying second order corrections
nt = RDSymbol("N_t")
grouped_H2 = group_by_operators(H2.expand())
simplifier = lambda x: sp.Add(*[t.factor() for t in x.subs({ad_t*a_t : nt}).as_ordered_terms()]).collect([1/((nt*alpha-alpha + omega_r + omega_t)**2)
, 1/((nt*alpha-alpha - omega_r + omega_t)**2),
1/((nt*alpha - omega_r + omega_t)**2),
1/((nt*alpha + omega_r + omega_t)**2),
1/(nt*alpha-alpha+omega_r+omega_t),])
display_dict({k : simplifier(v) for k,v in grouped_H2.items()})
\(\displaystyle {a_r^\dagger} a_r : - \frac{g^{2}}{N_{t} \alpha + \omega_{r} + \omega_{t}} - \frac{g^{2}}{N_{t} \alpha - \omega_{r} + \omega_{t}}\)
\(\displaystyle 1 : - \frac{g^{2}}{N_{t} \alpha + \omega_{r} + \omega_{t}}\)
\(\displaystyle {a_t^\dagger} a_t : \frac{g^{2}}{N_{t} \alpha - \alpha - \omega_{r} + \omega_{t}} - \frac{g^{2}}{N_{t} \alpha + \omega_{r} + \omega_{t}}\)
\(\displaystyle a_t^{2} : - \frac{g^{2}}{2 \left(N_{t} \alpha + \alpha - \omega_{r} + \omega_{t}\right)} + \frac{g^{2}}{2 \left(N_{t} \alpha + \omega_{r} + \omega_{t}\right)}\)
\(\displaystyle {a_t^\dagger}^{2} : - \frac{g^{2}}{2 \left(N_{t} \alpha - \alpha - \omega_{r} + \omega_{t}\right)} + \frac{g^{2}}{2 \left(N_{t} \alpha - 2 \alpha + \omega_{r} + \omega_{t}\right)}\)
Full-diagonalization
# Calculate the effective model using the Full Diagonalization routine up to the second order
Eff_frame.solve(max_order=2, method="FD")
H_eff_FD = Eff_frame.get_H(return_form='dict_operator')
[32mThe perturbative interaction will be added to the full Hamiltonian[0m
Computing the effective Hamiltonian: 100%|████████| 2/2 [00:02<00:00, 1.45s/it]
[32mThe Hamiltonian has been solved successfully. Please use the get_H method to get the result in the desired form.[0m
Converting to dictionary of operator form: 100%|█| 2/2 [00:00<00:00, 3988.88it/s
\(\displaystyle 1 : - \frac{g^{2}}{N_{t} \alpha + \omega_{r} + \omega_{t}}\)
\(\displaystyle {a_r^\dagger} a_r : - \frac{g^{2}}{N_{t} \alpha + \omega_{r} + \omega_{t}} + \frac{g^{2}}{- N_{t} \alpha + \omega_{r} - \omega_{t}}\)
\(\displaystyle {a_t^\dagger} a_t : \frac{g^{2}}{N_{t} \alpha - \alpha - \omega_{r} + \omega_{t}} - \frac{g^{2}}{N_{t} \alpha + \omega_{r} + \omega_{t}}\)
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.