Skip to content
This repository was archived by the owner on Feb 23, 2025. It is now read-only.

Commit 328908b

Browse files
authored
Add vacuum Rabi oscillation (qutip#14)
2 parents 48ee272 + 9dac536 commit 328908b

File tree

1 file changed

+230
-0
lines changed
  • QuantumToolbox.jl/time_evolution

1 file changed

+230
-0
lines changed
Lines changed: 230 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,230 @@
1+
---
2+
title: "Vacuum Rabi oscillation"
3+
author: Li-Xun Cai
4+
date: 2025-01-17 # last update (keep this comment as a reminder)
5+
6+
engine: julia
7+
---
8+
9+
Inspirations taken from [this QuTiP tutorial](https://nbviewer.org/urls/qutip.org/qutip-tutorials/tutorials-v5/time-evolution/004_rabi-oscillations.ipynb) by J.R. Johansson, P.D. Nation, and C. Staufenbiel
10+
11+
In this notebook, the usage of `QuantumToolbox.sesolve` and `QuantumToolbox.mesolve` will be demonstrated with Jaynes-Cummings model (JC model) to observe Rabi oscillations in the isolated case and the dissipative case. In the dissipative case, a bosonic interacts with the cavity and the two-level atom in the JC model.
12+
13+
## Introduction to Jaynes-Cumming model
14+
The JC model is a simplest quantum mechanical model for light-matter interaction, describing an atom interacting with an external electromagnetic field. To simplify the interaction, the JC model considers a two-level atom interacting with a single bosonic mode, which can also be thought of as a single-mode cavity.
15+
16+
The Hamiltonian of JC model is given by
17+
18+
$$
19+
\hat{H}_\text{tot} = \hat{H}_{\text{a}} + \hat{H}_{\text{c}} + \hat{H}_{\text{int}}
20+
$$
21+
22+
where
23+
24+
- $\hat{H}_{\text{a}} = \frac{\omega_\text{a}}{2} \hat{\sigma}_z$: Hamiltonian for atom alone
25+
- $\hat{H}_{\text{c}} = \omega_\text{c} \hat{a}^\dagger \hat{a}$: Hamiltonian for cavity alone
26+
- $\hat{H}_{\text{int}} = \Omega \left( \hat{\sigma}^\dagger + \hat{\sigma} \right) \cdot \left( \hat{a}^\dagger + \hat{a} \right)$: Interaction Hamiltonian for coherent interaction
27+
28+
with
29+
30+
- $\omega_\text{a}$: Frequency of the two-level atom
31+
- $\omega_\text{c}$: Frequency of the cavity's electromagnetic mode
32+
- $\Omega$ : Coupling strength between the atom and the cavity
33+
- $\hat{\sigma}_z$ : Pauli-$Z$ matrix. Equivalent to $|e\rangle\langle e| - |g\rangle\langle g|$
34+
- $\hat{a}$ : Annihilation operator of single-mode cavity <!-- $N$-truncated -->
35+
- $\hat{\sigma}$ : Lowering operator of atom. Equivalent to $|g\rangle\langle e|$
36+
37+
By applying the [rotating wave approximation (RWA)](https://en.wikipedia.org/wiki/Rotating-wave_approximation), the counter rotating terms ($\hat{\sigma} \cdot \hat{a}$ and its Hermitian conjugate) are ignored, yielding
38+
39+
$$
40+
\hat{H}_\text{tot} \approx \hat{H}_{\text{a}} + \hat{H}_{\text{c}} + \Omega \left( \hat{\sigma} \cdot \hat{a}^\dagger + \hat{\sigma}^\dagger \cdot \hat{a} \right)
41+
$$
42+
43+
### Usage of `QuantumToolbox` for JC model in general
44+
45+
##### import:
46+
```{julia}
47+
import QuantumToolbox: sigmaz, sigmam, destroy, qeye, basis, fock,
48+
⊗, n_thermal, sesolve, mesolve
49+
import CairoMakie: Figure, Axis, lines!, axislegend, xlims!, display, @L_str
50+
```
51+
52+
```{julia}
53+
N = 2 # Fock space truncated dimension
54+
55+
ωa = 1
56+
ωc = 1 * ωa # considering cavity and atom are in resonance
57+
σz = sigmaz() ⊗ qeye(N) # order of tensor product should be consistent throughout
58+
a = qeye(2) ⊗ destroy(N)
59+
Ω = 0.05
60+
σ = sigmam() ⊗ qeye(N)
61+
62+
Ha = ωa / 2 * σz
63+
Hc = ωc * a' * a # the symbol `'` after a `QuantumObject` act as adjoint
64+
Hint = Ω * (σ * a' + σ' * a)
65+
66+
Htot = Ha + Hc + Hint
67+
68+
print(Htot)
69+
```
70+
71+
## Isolated case
72+
For the case of the JC model being isolated, i.e., with no interaction with the surrounding environment, the time evolution is governed solely by the Schrödinger equation, $\hat{H}|\psi(t)\rangle = \partial_t|\psi(t)\rangle$. The `QuantumToolbox.sesolve` function is ideal for simulating such pure state evolution.
73+
74+
For the context of [Rabi problem](https://en.wikipedia.org/wiki/Rabi_problem), we set the initial state as $\psi_0 = |e\rangle \otimes |0\rangle$, where $|e\rangle$ is the excited state of the atom and $|0\rangle$ is the vacuum state of the cavity.
75+
76+
```{julia}
77+
e_ket = basis(2,0)
78+
ψ0 = e_ket ⊗ fock(N, 0)
79+
80+
tlist = 0:2.5:1000 # a list of time points of interest
81+
82+
# define a list of operators whose expectation value dynamics exhibit Rabi oscillation
83+
eop_ls = [
84+
a' * a, # number operator of cavity
85+
(e_ket * e_ket') ⊗ qeye(N), # excited state population in atom
86+
]
87+
88+
sol = sesolve(Htot , ψ0, tlist; e_ops = eop_ls)
89+
print(sol)
90+
```
91+
92+
Compare the dynamics of $| e \rangle\langle e|$ alongside $a^\dagger a$
93+
```{julia}
94+
n = real.(sol.expect[1, :])
95+
e = real.(sol.expect[2, :])
96+
fig_se = Figure(size = (600, 350))
97+
ax_se = Axis(
98+
fig_se[1, 1],
99+
xlabel = L"time $[1/\omega_a]$",
100+
ylabel = "expectation value",
101+
xlabelsize = 15,
102+
ylabelsize = 15,
103+
width = 400,
104+
height = 220
105+
)
106+
xlims!(ax_se, 0, 400)
107+
lines!(ax_se, tlist, n, label = L"$\langle a^\dagger a \rangle$")
108+
lines!(ax_se, tlist, e, label = L"$P_e$")
109+
axislegend(ax_se; position = :rt, labelsize = 15)
110+
display(fig_se);
111+
```
112+
113+
In the above plot, the behaviour of the energy exchange between the atom and the cavity is clearly visible, addressing the Rabi problem.
114+
115+
## Dissipative case
116+
117+
In contrast to isolated evolution, a realistic system interacts with its surrounding environment, leading to energy or particle exchange. Here, we focus on observing the Rabi oscillations of the JC model with the inclusion of interactions with an external environment at some finite temperature.
118+
119+
We start by reviewing the interaction Hamiltonians between the thermal field and atom/cavity
120+
121+
- Atom: $$
122+
\hat{H}_{\text{a}}^\text{int} = \sum_l \alpha_l \left( \hat{b}_l + \hat{b}_l^\dagger \right) \left( \hat{\sigma} + \hat{\sigma}^\dagger \right)
123+
$$
124+
- Cavity: $$
125+
\hat{H}_{\text{c}}^\text{int} = \sum_l \beta_l \left( \hat{b}_l + \hat{b}_l^\dagger \right) \left( \hat{a} + \hat{a}^\dagger \right)
126+
$$
127+
128+
where for the $l$-th mode
129+
130+
- $\alpha_l$ is the coupling strength with the atom
131+
- $\beta_l$ is the coupling strength with the cavity
132+
- $\hat{b}_l$ is the annihilation operator
133+
134+
By applying the aforementioned RWA and following the standard procedure of the [Born-Markovian approximation](https://en.wikiversity.org/wiki/Open_Quantum_Systems/The_Quantum_Optical_Master_Equation), we obtain $\kappa$, the cavity dissipation rate, and $\gamma$, the atom dissipation rate. Consequently, the time evolution of the dissipative JC model is described by the [Lindblad master equation](https://en.wikipedia.org/wiki/Lindbladian).
135+
136+
$$
137+
\dot{\hat{\rho}} = -\frac{i}{\hbar} [\hat{H}, \hat{\rho}] + \sum_{i = 1}^4 \mathcal{D}[\sqrt{\Gamma_i} \hat{S}_i]\left(\hat{\rho}\right)
138+
$$
139+
140+
where $\sqrt{\Gamma_i} \hat{S}_i$ are the collapse operators, given by
141+
142+
|$i$| $\Gamma_i$ | $\hat{S}_i$ |
143+
|---| :--------: | :---------: |
144+
|1|$\kappa \cdot n(\omega_c, T)$|$\hat{a}^\dagger$|
145+
|2|$\kappa \cdot [1 + n(\omega_c, T)]$|$\hat{a}$|
146+
|3|$\gamma \cdot n(\omega_a, T)$|$\hat{\sigma}^\dagger$|
147+
|4|$\gamma \cdot [1 + n(\omega_a, T)]$|$\hat{\sigma}$|
148+
149+
with $n(\omega, T)$ being the Bose-Einstein distribution of the thermal field and
150+
$$
151+
\mathcal{D}[\hat{\mathcal{O}}]\left(\cdot\right) = \hat{\mathcal{O}} \left(\cdot\right) \hat{\mathcal{O}}^\dagger - \frac{1}{2} \{ \hat{\mathcal{O}}^\dagger \hat{\mathcal{O}}, \cdot \}
152+
$$
153+
being the Lindblad dissipator.
154+
155+
### Solve for evolutions in dissipative case
156+
157+
We can now define variables in `julia` and solve the evolution of dissipative JC model
158+
```{julia}
159+
# Collapse operators for interaction with the environment with variable dissipation rates
160+
# and thermal energy of the environment. `n_thermal()` gives Bose-Einstein distribution
161+
cop_ls(_γ, _κ, _KT) = (
162+
√(_κ * n_thermal(ωc, _KT)) * a',
163+
√(_κ * (1 + n_thermal(ωc, _KT))) * a,
164+
√(_γ * n_thermal(ωa, _KT)) * σ',
165+
√(_γ * (1 + n_thermal(ωa, _KT))) * σ,
166+
)
167+
```
168+
169+
```{julia}
170+
# use the same ψ0, tlist, and eop_ls from isolated case
171+
γ = 4e-3
172+
κ = 7e-3
173+
KT = 0 # thermal field at zero temperature
174+
175+
# `mesolve()` only has one additional keyword argument `c_ops` from `sesolve()`
176+
sol_me = mesolve(Htot, ψ0, tlist, cop_ls(γ, κ, KT), e_ops = eop_ls)
177+
178+
print(sol_me)
179+
```
180+
181+
```{julia}
182+
n_me = real.(sol_me.expect[1, :])
183+
e_me = real.(sol_me.expect[2, :])
184+
185+
fig_me = Figure(size = (600, 350))
186+
ax_me = Axis(
187+
fig_me[1, 1],
188+
xlabel = L"time $[1/\omega_a]$",
189+
ylabel = "expectation value",
190+
xlabelsize = 15,
191+
ylabelsize = 15,
192+
width = 400,
193+
height = 220
194+
)
195+
lines!(ax_me, tlist, n_me, label = L"\langle a^\dagger a \rangle")
196+
lines!(ax_me, tlist, e_me, label = L"$P_e$")
197+
axislegend(ax_me; position = :rt, labelsize = 15)
198+
display(fig_me);
199+
```
200+
201+
From the above example, one can see that the dissipative system is losing energy over time and asymptoting to zero. We can further consider the thermal field with finite temperature.
202+
203+
```{julia}
204+
sol_me_ = mesolve(Htot, ψ0, tlist, cop_ls(γ, κ, 0.3 * ωa), e_ops = eop_ls) # replace KT with finite temperature
205+
206+
n_me_ = real.(sol_me_.expect[1, :])
207+
e_me_ = real.(sol_me_.expect[2, :])
208+
fig_me_ = Figure(size = (600, 350))
209+
ax_me_ = Axis(
210+
fig_me_[1, 1],
211+
xlabel = L"time $[1/\omega_a]$",
212+
ylabel = "expectation value",
213+
xlabelsize = 15,
214+
ylabelsize = 15,
215+
width = 400,
216+
height = 220
217+
)
218+
lines!(ax_me_, tlist, n_me_, label = L"\langle a^\dagger a \rangle")
219+
lines!(ax_me_, tlist, e_me_, label = L"$P_e$")
220+
axislegend(ax_me_; position = :rt, labelsize = 15)
221+
display(fig_me_);
222+
```
223+
Despite the persistence of the asymptotic behaviour, the system no longer approaches zero but instead reaches a steady-state above zero. This indicates that the system has been thermalized by the environment.
224+
225+
## Version Information
226+
```{julia}
227+
import QuantumToolbox
228+
QuantumToolbox.versioninfo()
229+
```
230+

0 commit comments

Comments
 (0)