Skip to content

Release 1.2.0: Additional Return Formats

Pre-release
Pre-release
Compare
Choose a tag to compare
@LeanderReascos LeanderReascos released this 12 Feb 13:55
· 4 commits to main since this release
4984d9a

Release Notes

Version 1.2.0

This release introduces new features for handling the results of the frame transformations. The major changes include enhanced conversion functionality, new return types, improved caching, and additional helper imports.


New Features

  • Bugs in get_H method were fixed.

  • New Return Formats:
    Methods get_U, and get_S were implemented to allow the user to access the unitary transformation $U$ and its generator $S$. These methods support the following return formats: 'operator', 'matrix', 'dict', 'dict_operator', and 'dict_matrix'.

Working Example

Rabi Model

# sympt imports
from sympt import *
# Import sympy
import sympy as sp

# ---------------- Defining the symbols ------------------
# Order 0
omega = RDSymbol('omega', order=0, positive=True, real=True)
Omega_z = RDSymbol('Omega_z', order=0, positive=True, real=True)
# Order 1
g = RDSymbol('g', order=1, positive=True, real=True)
  
# ----------------- Defining the basis -------------------
# Spin basis: Finite 2x2 Hilbert space
Spin = RDBasis('sigma', dim=2)
s0, sx, sy, sz = Spin.basis # Pauli Operators
# Boson basis: Infinite bosonic Hilbert space
a = BosonOp('a')
ad = Dagger(a)

# -------------- Defining the Hamiltonian ----------------
# Unperturbed Hamiltonian H0
H0 = omega * ad * a + sp.Rational(1,2) * Omega_z * sz

# Interaction Hamiltonian V
V = g * (ad + a) * sx

Eff_frame = EffectiveFrame(H0, V, subspaces=[Spin], verbose = False)
# 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 operator form
H_eff_SWT = Eff_frame.get_H(return_form='matrix')

U = Eff_frame.get_U(return_form='operator')
U_corrections = Eff_frame.U_corrections
S = Eff_frame.get_S(return_form='operator')
S_corrections = Eff_frame.S_corrections