Skip to content

Commit 4ded5e9

Browse files
committed
contextaul revisions of rabi.qmd
1 parent 51534f3 commit 4ded5e9

File tree

1 file changed

+74
-109
lines changed
  • QuantumToolbox.jl/time_evolution

1 file changed

+74
-109
lines changed

QuantumToolbox.jl/time_evolution/rabi.qmd

Lines changed: 74 additions & 109 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ engine: julia
88

99
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
1010

11-
In this notebook, the usage of `QuantumToolbox.sesolve()` and `QuantumToolbox.mesolve()` will be demonstrated with Jaynes-Cummings model to observe Rabi Oscillation in the isolated case and the dissipative case. In dissipative case, a bosonic environment would interact with JC model's cavity and two-level atom.
11+
In this notebook, the usage of `QuantumToolbox.sesolve` and `QuantumToolbox.mesolve` will be demonstrated with Jaynes-Cummings model to observe Rabi oscillations in the isolated case and the dissipative case. In dissipative case, a bosonic environment would interact with the cavity and two-level atom in JC model.
1212

1313
## Introduction to Jaynes-Cumming model
14-
Jaynes-Cummings (JC) model, a simplest quantum mechanical model for light-matter interaction, describes an atom interacting with an external electromagnetic field. To simplify the interaction at the time of the model proposal, JC model considered a two-level atom interacting with a single bosonic mode (or you can consider it a single-mode cavity), i.e., a two-dimensional Hilbert space interacting with a Fock space. <!-- (with finite truncation $N$) -->
14+
Jaynes-Cummings (JC) model, a simplest quantum mechanical model for light-matter interaction, describes an atom interacting with an external electromagnetic field. To simplify the interaction, JC model considered a two-level atom interacting with a single bosonic mode (or you can consider it a single-mode cavity).
1515

1616
The Hamiltonian of JC model is given by
1717

@@ -27,116 +27,91 @@ where
2727

2828
with
2929

30-
- $\omega_\text{a}$: Frequency gap of the two-level atom
30+
- $\omega_\text{a}$: Frequency of the two-level atom
3131
- $\omega_\text{c}$: Frequency of the cavity's EM mode (This is not specified whether to be in resonance with the atom or not.)
3232
- $\Omega$ : Coupling strength between the atom and the cavity
33-
- $\hat{\sigma}_z$ : Pauli's $z$ matrix. Equivalent to $|e\rangle\langle e| - |g\rangle\langle g|$
34-
- $\hat{a}$ : Annihilation operator in Fock space <!-- $N$-truncated -->
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 -->
3535
- $\hat{\sigma}$ : Lowering operator of atom. Equivalent to $|g\rangle\langle e|$
3636

37-
By applying rotating wave approximation (RWA), the counter rotating terms ($\hat{\sigma} \cdot \hat{a}$ and its hermition conjugate), which rotate considerably faster than the others in the interaction picture, are ignored, yielding
37+
By applying [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), which rotate considerably faster than the others in the interaction picture, are ignored, yielding
3838

3939
$$
4040
\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)
4141
$$
4242

4343
### Usage of `QuantumToolbox` for JC model in general
4444

45+
##### import:
4546
```{julia}
4647
using QuantumToolbox
47-
using CairoMakie # For high-quality plotting
48+
import QuantumToolbox: ⊗, sigmaz, sigmam, destroy, qeye, basis, fock, n_thermal, mesolve, sesolve, versioninfo
49+
using CairoMakie
50+
import CairoMakie: Figure, Axis, lines!, axislegend, xlims!, display
4851
```
4952

5053
```{julia}
51-
N = 15 # Fock space truncated dimension
54+
N = 2 # Fock space truncated dimension
5255
5356
ωa = 1
54-
ωc = 1 * ωa # this frequency considers cavity and atom are IN resonance
55-
ωc_ = 0.8 * ωa # this frequency considers cavity and atom are OFF resonance
57+
ωc = 1 * ωa # considering cavity and atom are in resonance
5658
σz = sigmaz() ⊗ qeye(N) # order of tensor product should be consistent throughout
5759
a = qeye(2) ⊗ destroy(N)
5860
Ω = 0.05
5961
σ = sigmam() ⊗ qeye(N)
6062
6163
Ha = ωa / 2 * σz
6264
Hc = ωc * a' * a # the symbol `'` after a `QuantumObject` act as adjoint
63-
Hc_ = ωc_ * a' * a
6465
Hint = Ω * (σ * a' + σ' * a)
6566
66-
Htot = Ha + Hc + Hint
67-
Htot_ = Ha + Hc_ + Hint
67+
Htot = Ha + Hc + Hint
6868
6969
print(Htot)
70-
println("\n####################\n")
71-
print(Htot_)
7270
```
7371

7472
## Isolated case
75-
For the case of JC system being isolated, i.e., with no interaction with the surrounding environment, the system's time-evolution is governed solely by Schrödinger equation $\hat{H}|\psi\rangle = \partial_t|\psi(t)\rangle$. Using `QuantumToolbox.sesolve()` is ideal for pure state evolution.
73+
For the case of JC model being isolated, i.e., no interaction with the surrounding environment, the time-evolution is governed solely by Schrödinger equation $\hat{H}|\psi(t)\rangle = \partial_t|\psi(t)\rangle$. Using `QuantumToolbox.sesolve` is ideal for pure state evolution.
7674

75+
For the context of [Rabi problem](https://en.wikipedia.org/wiki/Rabi_problem), we set the initial state $\psi_0 = |e\rangle \otimes |0\rangle$ where $|e\rangle$ is the excited state of atom and $|0\rangle$ is the vacuum state of cavity.
7776

7877
```{julia}
79-
# define initial state ψ0
80-
ψ0 = basis(2,0) ⊗ fock(N, 1)
81-
ψ0 = ψ0 / norm(ψ0)
78+
e_ket = basis(2,0)
79+
ψ0 = e_ket ⊗ fock(N, 0)
8280
83-
tlist = 0:2:200 # a list of time points of interest
81+
tlist = 0:2.5:1000 # a list of time points of interest
8482
8583
# define a list of operators whose expectation value dynamics exhibit Rabi oscillation
8684
eop_ls = [
87-
a' * a, # number operator of cavity Fock space
88-
σ' * σ # excited state population in atom
85+
a' * a, # number operator of cavity
86+
(e_ket * e_ket') ⊗ qeye(N), # excited state population in atom
8987
]
9088
91-
sol = sesolve(Htot , ψ0, tlist; e_ops = eop_ls)
92-
sol_ = sesolve(Htot_, ψ0, tlist; e_ops = eop_ls)
89+
sol = sesolve(Htot , ψ0, tlist; e_ops = eop_ls)
9390
print(sol)
94-
println("\n####################\n")
95-
print(sol_)
9691
```
9792

98-
Create the first figure for expectation value of photon number
93+
Compare the dynamics of $| e \rangle\langle e|$ alongside $a^\dagger a$
9994
```{julia}
100-
n = real.(sol.expect[1, :])
101-
n_ = real.(sol_.expect[1, :])
102-
fign = Figure(size = (600, 350))
103-
axn = Axis(
104-
fign[1, 1],
105-
title = L"$\langle n\rangle$",
95+
n = real.(sol.expect[1, :])
96+
e = real.(sol.expect[2, :])
97+
fig_se = Figure(size = (600, 350))
98+
ax_se = Axis(
99+
fig_se[1, 1],
106100
xlabel = L"time $[1/\omega_a]$",
107101
ylabel = "expectation value",
108102
xlabelsize = 15,
109103
ylabelsize = 15,
110104
width = 400,
111105
height = 220
112106
)
113-
lines!(axn, tlist, n, label = "resonant")
114-
lines!(axn, tlist, n_, label = "off resonant")
115-
axislegend(axn; position = :rt, labelsize = 12)
116-
display(fign);
107+
xlims!(ax_se, 0, 400)
108+
lines!(ax_se, tlist, n, label = L"$\langle a^\dagger a \rangle$")
109+
lines!(ax_se, tlist, e, label = L"$P_e$")
110+
axislegend(ax_se; position = :rt, labelsize = 15)
111+
display(fig_se);
117112
```
118113

119-
Create the second figure for excited state population
120-
```{julia}
121-
e = real.(sol.expect[2, :])
122-
e_ = real.(sol_.expect[2, :])
123-
fige = Figure(size = (600, 350))
124-
axe = Axis(
125-
fige[1, 1],
126-
title = L"$\langle e \rangle$",
127-
xlabel = L"time $[1/\omega_a]$",
128-
ylabel = "probability",
129-
xlabelsize = 15,
130-
ylabelsize = 15,
131-
width = 400,
132-
height = 220
133-
)
134-
ylims!(axe, 0, 1)
135-
lines!(axe, tlist, e, label = "resonant")
136-
lines!(axe, tlist, e_, label = "off resonant")
137-
axislegend(axe; position = :rb, labelsize = 12)
138-
display(fige);
139-
```
114+
In the above plot, the behaviour of the energy exchange between the atom and the cavity is clearly visible, addressing the Rabi problem.
140115

141116
## Dissipative case
142117

@@ -157,16 +132,13 @@ where for the $l$-th mode
157132
- $\beta_l$ is the coupling strength with the cavity
158133
- $\hat{b}_l$ is the annihilation operator
159134

160-
161-
Following the RWA approach previously mentioned and the standard procedure of Born-Markovian master equation, we obtain $\kappa$, the cavity dissipation rate, and $\gamma$, the atom dissipation rate.
162-
163-
Therefore, the time evolution of the dissipative JC model can be described by the master equation
135+
Following the RWA approach previously mentioned and the standard procedure of [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. Therefore, the time evolution of the dissipative JC model can be described by the [Lindblad master equation](https://en.wikipedia.org/wiki/Lindbladian)
164136

165137
$$
166138
\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)
167139
$$
168140

169-
where the $(\Gamma_i, \hat{S}_i)$ pairs are
141+
where $\sqrt{\Gamma_i} \hat{S}_i$ are the collapse operators, given by
170142

171143
|$i$| $\Gamma_i$ | $\hat{S}_i$ |
172144
|---| :--------: | :---------: |
@@ -175,18 +147,21 @@ where the $(\Gamma_i, \hat{S}_i)$ pairs are
175147
|3|$\gamma \cdot n(\omega_a, T)$|$\hat{\sigma}^\dagger$|
176148
|4|$\gamma \cdot [1 + n(\omega_a, T)]$|$\hat{\sigma}$|
177149

178-
with $n(\omega, T)$ being the Bose-Einstein distribution for the EM environment and $\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 \}$ being the Lindblad dissipator.
150+
with $n(\omega, T)$ being the Bose-Einstein distribution for the EM environment and
151+
$$
152+
\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 \}
153+
$$
154+
being the Lindblad dissipator.
179155

180156
### Solve for evolutions in dissipative case
181157

182158
We can now define variables in `julia` and solve the evolution of dissipative JC model
183159
```{julia}
184-
# Collapse operators for interaction with the environment with variable
185-
# dissipation rates, cavity frequency, and thermal energy of the environment
186-
# `n_thermal()` gives Bose-Einstein distribution
187-
cop_ls(_γ, _κ, _ωc, _KT) = (
188-
√(_κ * n_thermal(_ωc, _KT)) * a',
189-
√(_κ * (1 + n_thermal(_ωc, _KT))) * a,
160+
# Collapse operators for interaction with the environment with variable dissipation rates
161+
# and thermal energy of the environment. `n_thermal()` gives Bose-Einstein distribution
162+
cop_ls(_γ, _κ, _KT) = (
163+
√(_κ * n_thermal(ωc, _KT)) * a',
164+
√(_κ * (1 + n_thermal(ωc, _KT))) * a,
190165
√(_γ * n_thermal(ωa, _KT)) * σ',
191166
√(_γ * (1 + n_thermal(ωa, _KT))) * σ,
192167
)
@@ -195,68 +170,58 @@ cop_ls(_γ, _κ, _ωc, _KT) = (
195170
```{julia}
196171
# use the same ψ0, tlist, and eop_ls from isolated case
197172
γ = 4e-3
198-
κ = 0.005
173+
κ = 7e-3
199174
KT = 0 # for theoretical vacuum EM field
200175
201176
# `mesolve()` only has one additional keyword argument `c_ops` from `sesolve()`
202-
sol_me = mesolve(Htot, ψ0, tlist, cop_ls(γ, κ, ωc, KT), e_ops = eop_ls)
203-
sol_me_ = mesolve(Htot_, ψ0, tlist, cop_ls(γ, κ, ωc_, KT), e_ops = eop_ls)
177+
sol_me = mesolve(Htot, ψ0, tlist, cop_ls(γ, κ, KT), e_ops = eop_ls)
204178
205179
print(sol_me)
206-
println("\n####################\n")
207-
print(sol_me_)
208180
```
209181

210-
Create the first figure for the expectation value of photon number
211182
```{julia}
212-
n_me = real.(sol_me.expect[1, :])
213-
n_me_ = real.(sol_me_.expect[1, :])
214-
fign_me = Figure(size = (600, 350))
215-
axn_me = Axis(
216-
fign_me[1, 1],
217-
title = L"$\langle n\rangle$",
183+
n_me = real.(sol_me.expect[1, :])
184+
e_me = real.(sol_me.expect[2, :])
185+
186+
fig_me = Figure(size = (600, 350))
187+
ax_me = Axis(
188+
fig_me[1, 1],
218189
xlabel = L"time $[1/\omega_a]$",
219190
ylabel = "expectation value",
220191
xlabelsize = 15,
221192
ylabelsize = 15,
222193
width = 400,
223194
height = 220
224-
)
225-
lines!(axn_me, tlist, n_me, label = "resonant")
226-
lines!(axn_me, tlist, n_me_, label = "off resonant")
227-
axislegend(axn_me; position = :rt, labelsize = 12)
228-
display(fign_me);
195+
)
196+
lines!(ax_me, tlist, n_me, label = L"\langle a^\dagger a \rangle")
197+
lines!(ax_me, tlist, e_me, label = L"$P_e$")
198+
axislegend(ax_me; position = :rt, labelsize = 15)
199+
display(fig_me);
229200
```
230201

231-
Create the second figure for atom excited state population
202+
From the above example, one can see that the dissipative system is losing energy over time and asymptoting to zero. We can further consdider the near-vacuum environment with finite temperature.
203+
232204
```{julia}
233-
e_me = real.(sol_me.expect[2, :])
234-
e_me_ = real.(sol_me_.expect[2, :])
235-
fige_me = Figure(size = (600, 350))
236-
axe_me = Axis(
237-
fige_me[1, 1],
238-
title = L"$\langle e \rangle$",
205+
sol_me_ = mesolve(Htot, ψ0, tlist, cop_ls(γ, κ, 0.3 * ωa), e_ops = eop_ls) # replace KT with finite temperature
206+
207+
n_me_ = real.(sol_me_.expect[1, :])
208+
e_me_ = real.(sol_me_.expect[2, :])
209+
fig_me_ = Figure(size = (600, 350))
210+
ax_me_ = Axis(
211+
fig_me_[1, 1],
239212
xlabel = L"time $[1/\omega_a]$",
240-
ylabel = "probability",
213+
ylabel = "expectation value",
241214
xlabelsize = 15,
242215
ylabelsize = 15,
243216
width = 400,
244217
height = 220
245-
)
246-
ylims!(axe_me, 0, 1)
247-
lines!(axe_me, tlist, e_me, label = "resonant")
248-
lines!(axe_me, tlist, e_me_, label = "off resonant")
249-
axislegend(axe_me; position = :rt, labelsize = 12)
250-
display(fige_me);
218+
)
219+
lines!(ax_me_, tlist, n_me_, label = L"\langle a^\dagger a \rangle")
220+
lines!(ax_me_, tlist, e_me_, label = L"$P_e$")
221+
axislegend(ax_me_; position = :rt, labelsize = 15)
222+
display(fig_me_);
251223
```
252-
253-
<!--
254-
### Note for RWA
255-
256-
Without applying RWA, things are more interesting in the \emph{Ultrastrong Coupling} (USC) regime, where $\Omega \sim \omega_c$. In that regime, the \emph{localized} master equation (the one we used for this tutorial) fails. As that phenomenon is worth itself as an independent tutorial, we will pass that on to [this tutorial for `liouvillian_generalized()`]().
257-
-->
258-
259-
224+
Despite the asymptotic behaviour persisting, one can see that they no longer approach zero and instead find a steady condition above zero. That is, the system eventually becomes thermalized by the environment.
260225

261226
## Version Information
262227
```{julia}

0 commit comments

Comments
 (0)