Quicker way to code multiple TLS

34 views
Skip to first unread message

Aravindh Shankar

unread,
Apr 23, 2024, 3:01:42 PMApr 23
to QuTiP: Quantum Toolbox in Python
Hi all,

I'm writing code to simulate the depolarization (relaxation) dynamics of a central two-level system (TLS) coupled to multiple 'reservoir'/'bath' TLS. As an example, for the case of 1 central coupled to 3 bath TLS, my code is as follows:
Delta_sys = 1
Delta_env = 1
g = 0.1
gamma_i = 0.1
gamma_f = 0.5
g_sys = tensor(fock_dm(2,0),qeye(2),qeye(2),qeye(2))
e_sys = tensor(fock_dm(2,1),qeye(2),qeye(2),qeye(2))
g_env1 = tensor(qeye(2),fock_dm(2,0),qeye(2),qeye(2))
e_env1 = tensor(qeye(2),fock_dm(2,1),qeye(2),qeye(2))
g_env2 = tensor(qeye(2),qeye(2),fock_dm(2,0),qeye(2))
e_env2 = tensor(qeye(2),qeye(2),fock_dm(2,1),qeye(2))
g_env3 = tensor(qeye(2),qeye(2),qeye(2),fock_dm(2,0))
e_env3 = tensor(qeye(2),qeye(2),qeye(2),fock_dm(2,1))
c_sys = tensor(destroy(2),qeye(2),qeye(2),qeye(2))
c_env1 = tensor(qeye(2),destroy(2),qeye(2),qeye(2))
c_env2 = tensor(qeye(2),qeye(2),destroy(2),qeye(2))
c_env3 = tensor(qeye(2),qeye(2),qeye(2),destroy(2))
H_coup = tensor(sigmax(),sigmax(),qeye(2),qeye(2)) + tensor(sigmax(),qeye(2),sigmax(),qeye(2)) + tensor(sigmax(),qeye(2),qeye(2),sigmax())
psi0 = tensor(basis(2,1), basis(2,1), basis(2,1), basis(2,1))
H = 0.5*Delta_sys*(e_sys*e_sys.dag() - g_sys*g_sys.dag()) + 0.5*Delta_env*(e_env1*e_env1.dag() - g_env1*g_env1.dag() + e_env2*e_env2.dag() - \
g_env2*g_env2.dag() + e_env3*e_env3.dag() - g_env3*g_env3.dag()) + g*H_coup
times = np.linspace(0.0, 50.0, 500)
result = mesolve(H, psi0, times, c_ops = [np.sqrt(gamma_i)*c_sys, np.sqrt(gamma_f)*c_env1,np.sqrt(gamma_f)*c_env2,np.sqrt(gamma_f)*c_env3], \
e_ops = [e_sys*e_sys.dag()])

I wonder if there is a framework within QuTiP for extending this to, say, 12 TLS without having to write out the code in detail like this. In other words, is there a way within QuTiP that I specify the energy gap and decay rate for one TLS, and the system duplicates this TLS N times and adds coupling between them and I run mesolve after less lengthy code?

Éric Giguère

unread,
Apr 23, 2024, 3:19:26 PMApr 23
to QuTiP: Quantum Toolbox in Python
You could take a look at `qutip_qip.operations.expand_operator`.

Aravindh Shankar

unread,
Apr 24, 2024, 11:23:11 PMApr 24
to QuTiP: Quantum Toolbox in Python
Hi Eric,

Thanks for your response. I looked at the qutip-qip package and while it seemed promising, I am facing one issue: The Hamiltonian I have specified above features interaction between one central spin (of interest) and numerous auxiliary spins, which each interact only with the central spin. The Hamiltonians in qutip-qip seem to feature only nearest-neighbour coupling so I don't immediately see how to use that to solve my problem.

Regards,
Aravindh

Éric Giguère

unread,
Apr 25, 2024, 3:08:17 PMApr 25
to QuTiP: Quantum Toolbox in Python
tensor can also take a list of qobj:

H_coup = 0
for i in range(1, N):
    H_coup += tensor([sigmax()] + [qeye(2)] * (i-1) + [sigmax()] + [qeye(2)] * (N-i-1))
Reply all
Reply to author
Forward
0 new messages