Hi, thanks for Rydiqule package.
For the bug context, I am trying to calculate laser polarization light dependent parameters in a Rb atom. I notice that when I apply the couplings between intermediate and Rydberg levels the resulting Hamiltonian are not the same. With some shuffling happening for the off diagonal links between Rydberg and intermediate manifolds.
My understanding that Hamiltonian level numbering is happening at the time of Cell creation, so it should not happen.
Below a minimal example to reproduce the bug, order of lines after comment starting with ATTENTION changes the outcome.
import matplotlib.pyplot as plt
import numpy as np
import rydiqule as rq
from rydiqule import A_QState
import networkx as nx
g = rq.A_QState(5, 0, 0.5, f=3, m_f='all')
i = rq.A_QState(5, 1, 1.5, f=4, m_f='all')
r = rq.A_QState(44, 2, 2.5, m_j='all')
c = rq.Cell('Rb85', [g,i,r])
dwp = 0 # probe detunings
dwb = 0 # blue detunings
c.add_coupling((g,i), rabi_frequency = 10.5, detuning=dwp, q=0, label='probe_pi')
c.add_coupling((g,i), rabi_frequency = 5.5, detuning=dwp, q=-1, label='probe_l')
c.add_coupling((g,i), rabi_frequency = 2.3, detuning=dwp, q=1, label='probe_r')
# upper link beam
c.add_coupling((i,r), rabi_frequency = 10, detuning=dwb, q=0, label='blue_pi')
# ATTENTION: changing order of the next 2 lines changes Hamiltonian
c.add_coupling((i,r), rabi_frequency = 30, detuning=dwb, q=-1, label='blue_l')
c.add_coupling((i,r), rabi_frequency = 40, detuning=dwb, q=1, label='blue_r')
plt.figure(1)
plt.clf()
plt.imshow(np.abs(c.get_hamiltonian()))
plt.title("|Hamiltonian|")
plt.savefig('hamiltonian.png')
plt.close()
Also a more involved calculation which for example tracks total population of the intermediate level also would produce different results
based on the coupling order.
Hi, thanks for Rydiqule package.
For the bug context, I am trying to calculate laser polarization light dependent parameters in a Rb atom. I notice that when I apply the couplings between intermediate and Rydberg levels the resulting Hamiltonian are not the same. With some shuffling happening for the off diagonal links between Rydberg and intermediate manifolds.
My understanding that Hamiltonian level numbering is happening at the time of Cell creation, so it should not happen.
Below a minimal example to reproduce the bug, order of lines after comment starting with
ATTENTIONchanges the outcome.Also a more involved calculation which for example tracks total population of the intermediate level also would produce different results
based on the coupling order.