Skip to content

Commit 023ce3a

Browse files
authored
Merge pull request #138 from NiallCarbery/main
Typo fixes and warning removals in Johansson lecture series
2 parents ad896bb + 910f0a0 commit 023ce3a

File tree

38 files changed

+244
-181
lines changed

38 files changed

+244
-181
lines changed

tutorials-v4/lectures/Lecture-0-Introduction-to-QuTiP.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jupyter:
1616

1717
Author: J. R. Johansson (robert@riken.jp), https://jrjohansson.github.io/
1818

19-
This lecture series was developed by J.R. Johannson. The original lecture notebooks are available [here](https://github.com/jrjohansson/qutip-lectures).
19+
This lecture series was developed by J.R. Johansson. The original lecture notebooks are available [here](https://github.com/jrjohansson/qutip-lectures).
2020

2121
This is a slightly modified version of the lectures, to work with the current release of QuTiP. You can find these lectures as a part of the [qutip-tutorials repository](https://github.com/qutip/qutip-tutorials). This lecture and other tutorial notebooks are indexed at the [QuTiP Tutorial webpage](https://qutip.org/tutorials.html).
2222

tutorials-v4/lectures/Lecture-1-Jaynes-Cumming-model.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jupyter:
1717

1818
Author: J. R. Johansson (robert@riken.jp), https://jrjohansson.github.io/
1919

20-
This lecture series was developed by J.R. Johannson. The original lecture notebooks are available [here](https://github.com/jrjohansson/qutip-lectures).
20+
This lecture series was developed by J.R. Johansson. The original lecture notebooks are available [here](https://github.com/jrjohansson/qutip-lectures).
2121

2222
This is a slightly modified version of the lectures, to work with the current release of QuTiP. You can find these lectures as a part of the [qutip-tutorials repository](https://github.com/qutip/qutip-tutorials). This lecture and other tutorial notebooks are indexed at the [QuTiP Tutorial webpage](https://qutip.org/tutorials.html).
2323

@@ -65,7 +65,7 @@ tlist = np.linspace(0, 25, 101)
6565
### Setup the operators, the Hamiltonian and initial state
6666

6767
```python
68-
# intial state
68+
# initial state
6969
psi0 = tensor(basis(N, 0), basis(2, 1)) # start with an excited atom
7070

7171
# operators
@@ -132,7 +132,7 @@ axes.set_title("Vacuum Rabi oscillations");
132132

133133
In addition to the cavity's and atom's excitation probabilities, we may also be interested in for example the wigner function as a function of time. The Wigner function can give some valuable insight in the nature of the state of the resonators.
134134

135-
To calculate the Wigner function in QuTiP, we first recalculte the evolution without specifying any expectation value operators, which will result in that the solver return a list of density matrices for the system for the given time coordinates.
135+
To calculate the Wigner function in QuTiP, we first recalculate the evolution without specifying any expectation value operators, which will result in that the solver returns a list of density matrices for the system for the given time coordinates.
136136

137137
```python
138138
output = mesolve(H, psi0, tlist, c_ops, [])
@@ -163,7 +163,7 @@ For each of these points in time we need to:
163163

164164
1. Find the system density matrix for the points in time that we are interested in.
165165
2. Trace out the atom and obtain the reduced density matrix for the cavity.
166-
3. Calculate and visualize the Wigner function fo the reduced cavity density matrix.
166+
3. Calculate and visualize the Wigner function for the reduced cavity density matrix.
167167

168168
```python
169169
# find the indices of the density matrices for the times we are interested in
@@ -206,7 +206,7 @@ for idx, rho in enumerate(rho_list):
206206
axes[idx].set_title(r"$t = %.1f$" % tlist[t_idx][idx], fontsize=16)
207207
```
208208

209-
At $t =0$, the cavity is in it's ground state. At $t = 5, 15, 25$ it reaches it's maxium occupation in this Rabi-vacuum oscillation process. We can note that for $t=5$ and $t=15$ the Wigner function has negative values, indicating a truely quantum mechanical state. At $t=25$, however, the wigner function no longer has negative values and can therefore be considered a classical state.
209+
At $t =0$, the cavity is in its ground state. At $t = 5, 15, 25$ it reaches its maximum occupation in this Rabi-vacuum oscillation process. We can note that for $t=5$ and $t=15$ the Wigner function has negative values, indicating a truly quantum mechanical state. At $t=25$, however, the Wigner function no longer has negative values and can therefore be considered a classical state.
210210

211211

212212
### Alternative view of the same thing

tutorials-v4/lectures/Lecture-10-cQED-dispersive-regime.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jupyter:
1616

1717
Author: J. R. Johansson (robert@riken.jp), https://jrjohansson.github.io/
1818

19-
This lecture series was developed by J.R. Johannson. The original lecture notebooks are available [here](https://github.com/jrjohansson/qutip-lectures).
19+
This lecture series was developed by J.R. Johansson. The original lecture notebooks are available [here](https://github.com/jrjohansson/qutip-lectures).
2020

2121
This is a slightly modified version of the lectures, to work with the current release of QuTiP. You can find these lectures as a part of the [qutip-tutorials repository](https://github.com/qutip/qutip-tutorials). This lecture and other tutorial notebooks are indexed at the [QuTiP Tutorial webpage](https://qutip.org/tutorials.html).
2222

tutorials-v4/lectures/Lecture-11-Charge-Qubits.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jupyter:
1616

1717
Author: J. R. Johansson (robert@riken.jp), https://jrjohansson.github.io/
1818

19-
This lecture series was developed by J.R. Johannson. The original lecture notebooks are available [here](https://github.com/jrjohansson/qutip-lectures).
19+
This lecture series was developed by J.R. Johansson. The original lecture notebooks are available [here](https://github.com/jrjohansson/qutip-lectures).
2020

2121
This is a slightly modified version of the lectures, to work with the current release of QuTiP. You can find these lectures as a part of the [qutip-tutorials repository](https://github.com/qutip/qutip-tutorials). This lecture and other tutorial notebooks are indexed at the [QuTiP Tutorial webpage](https://qutip.org/tutorials.html).
2222

@@ -39,7 +39,7 @@ where $E_C$ is the charge energy, $E_J$ is the Josephson energy, and $\left| n\r
3939

4040
#### References
4141

42-
* [J. Koch et al, Phys. Rec. A 76, 042319 (2007)](https://journals.aps.org/pra/abstract/10.1103/PhysRevA.76.042319)
42+
* [J. Koch et al, Phys. Rev. A 76, 042319 (2007)](https://journals.aps.org/pra/abstract/10.1103/PhysRevA.76.042319)
4343
* [Y.A. Pashkin et al, Quantum Inf Process 8, 55 (2009)](http://dx.doi.org/10.1007/s11128-009-0101-5)
4444

4545

@@ -176,7 +176,7 @@ energies = np.array([hamiltonian(Ec, Ej, N, ng).eigenenergies()
176176
plot_energies(ng_vec, energies, ymax=(50, 3));
177177
```
178178

179-
Note that the energy-level splitting is essentially independent of the gate bias $n_g$, at least for the lowest few states. This device insensitive to charge noise. But at the same time the two lowest energy states are no longer well separated from higher states (it has become more like an harmonic oscillator). But some anharmonicity still remains, and it can still be used as a qubit if the leakage of occupation probability of the higher states can be kept under control.
179+
Note that the energy-level splitting is essentially independent of the gate bias $n_g$, at least for the lowest few states. This device is insensitive to charge noise. But at the same time the two lowest energy states are no longer well separated from higher states (it has become more like a harmonic oscillator). But some anharmonicity still remains, and it can still be used as a qubit if the leakage of occupation probability to the higher states can be kept under control.
180180

181181

182182
## Focus on the two lowest energy states

tutorials-v4/lectures/Lecture-12-Decay-into-a-squeezed-vacuum-field.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jupyter:
1717

1818
Author: J. R. Johansson (robert@riken.jp), https://jrjohansson.github.io/
1919

20-
This lecture series was developed by J.R. Johannson. The original lecture notebooks are available [here](https://github.com/jrjohansson/qutip-lectures).
20+
This lecture series was developed by J.R. Johansson. The original lecture notebooks are available [here](https://github.com/jrjohansson/qutip-lectures).
2121

2222
This is a slightly modified version of the lectures, to work with the current release of QuTiP. You can find these lectures as a part of the [qutip-tutorials repository](https://github.com/qutip/qutip-tutorials). This lecture and other tutorial notebooks are indexed at the [QuTiP Tutorial webpage](https://qutip.org/tutorials.html).
2323

@@ -70,7 +70,7 @@ w_th = 0.0 * 2 * np.pi
7070

7171
```python
7272
# the number of average excitations in the
73-
# environment mode w0 at temperture w_th
73+
# environment mode w0 at temperature w_th
7474
Nth = n_thermal(w0, w_th)
7575

7676
Nth
@@ -126,7 +126,7 @@ L0 = liouvillian(H, c_ops)
126126
L0
127127
```
128128

129-
Next we manually construct the Liouvillian for the effect of the squeeing in the environment, which is not on standard form we can therefore not use the `liouvillian` function in QuTiP
129+
Next we manually construct the Liouvillian for the effect of the squeezing in the environment, which is not in standard form so we can therefore not use the `liouvillian` function in QuTiP
130130

131131
```python
132132
Lsq = -gamma0 * M * spre(sp) * spost(sp) - gamma0 * \

tutorials-v4/lectures/Lecture-13-Resonance-flourescence.md

Lines changed: 45 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ jupyter:
1212
name: python3
1313
---
1414

15-
# Lecture 13 - Resonance flourescence
15+
# Lecture 13 - Resonance fluorescence
1616

1717

1818
Author: J. R. Johansson (robert@riken.jp), https://jrjohansson.github.io/
1919

20-
This lecture series was developed by J.R. Johannson. The original lecture notebooks are available [here](https://github.com/jrjohansson/qutip-lectures).
20+
This lecture series was developed by J.R. Johansson. The original lecture notebooks are available [here](https://github.com/jrjohansson/qutip-lectures).
2121

2222
This is a slightly modified version of the lectures, to work with the current release of QuTiP. You can find these lectures as a part of the [qutip-tutorials repository](https://github.com/qutip/qutip-tutorials). This lecture and other tutorial notebooks are indexed at the [QuTiP Tutorial webpage](https://qutip.org/tutorials.html).
2323

@@ -34,6 +34,10 @@ from qutip import (about, basis, correlation_2op_1t, mesolve, n_thermal, num,
3434
<!-- #region -->
3535
## Introduction
3636

37+
Resonance fluorescence, is the interaction between a two-level quantum system and a coherent driving field.
38+
39+
The Hamiltonian for a two-level system under resonant driving, is given by:
40+
3741
$\displaystyle H_L = -\frac{\Omega}{2}(\sigma_+ + \sigma_-)$
3842

3943

@@ -44,12 +48,18 @@ $\displaystyle \frac{d}{dt}\rho = -i[H_L, \rho] + \gamma_0(N+1)\left(\sigma_-\rh
4448
### Problem definition in QuTiP
4549

4650
```python
51+
# Rabi frequency (strength of the driving field)
4752
Omega = 1.0 * 2 * np.pi
4853
```
4954

5055
```python
56+
# decay rate of the two-level system
5157
gamma0 = 0.05
58+
59+
# thermal frequency of the bath
5260
w_th = 0.0
61+
62+
# thermal occupation number for the bath
5363
N = n_thermal(Omega, w_th)
5464
```
5565

@@ -90,45 +100,56 @@ axes[0].plot(result.times, result.expect[2], "b",
90100
axes[0].legend()
91101
axes[0].set_ylim(-1, 1)
92102

103+
axes[0].set_ylabel(r"$\langle\sigma_{x,y,z}\rangle$", fontsize=16)
104+
axes[0].set_title("Bloch Vector Components vs Time")
93105

94106
axes[1].plot(result.times, result.expect[5], "b", label=r"$P_e$")
95107

96-
# axes[1].set_ylabel(r'$\langle\sigma_z\rangle$', fontsize=16)
108+
axes[1].set_ylabel(r"$P_g$", fontsize=16)
97109
axes[1].set_xlabel("time", fontsize=16)
98110
axes[1].legend()
99-
axes[1].set_ylim(0, 1);
111+
axes[1].set_ylim(0, 1)
112+
axes[1].set_title("Ground State Population vs Time");
100113
```
101114

102115
```python
103116
fig, ax = plt.subplots(1, 1, figsize=(12, 6), sharex=True)
104117

105-
106118
for idx, gamma0 in enumerate([0.1 * Omega, 0.5 * Omega, 1.0 * Omega]):
107119

108120
HL, c_ops = system_spec(Omega, gamma0, N)
109121
result = mesolve(HL, psi0, tlist, c_ops, e_ops)
110122

111-
ax.plot(result.times, result.expect[5], "b",
112-
label=r"$\langle\sigma_z\rangle$")
123+
ax.plot(
124+
result.times, result.expect[5], "b",
125+
label=fr"$P_g$ ($\gamma_0={gamma0:.2f}$)"
126+
)
113127

114-
ax.set_ylim(0, 1);
128+
ax.set_ylim(0, 1)
129+
ax.set_xlabel("time", fontsize=16)
130+
ax.set_ylabel(r"$P_g$", fontsize=16)
131+
ax.set_title("Ground State Population for Different Decay Rates")
132+
ax.legend();
115133
```
116134

117135
```python
118136
fig, ax = plt.subplots(1, 1, figsize=(12, 6), sharex=True)
119137

120-
121138
for idx, gamma0 in enumerate([0.1 * Omega, 0.5 * Omega, 1.0 * Omega]):
122139

123140
HL, c_ops = system_spec(Omega, gamma0, N)
124141
result = mesolve(HL, psi0, tlist, c_ops, e_ops)
125142

126143
ax.plot(
127144
result.times, np.imag(result.expect[4]),
128-
label=r"im $\langle\sigma_+\rangle$"
145+
label=fr"Im $\langle\sigma_+\rangle$ ($\gamma_0={gamma0:.2f}$)"
129146
)
130147

131-
ax.set_ylim(-0.5, 0.5);
148+
ax.set_ylim(-0.5, 0.5)
149+
ax.set_xlabel("time", fontsize=16)
150+
ax.set_ylabel(r"Im $\langle\sigma_+\rangle$", fontsize=16)
151+
ax.set_title(r"Imaginary Part of $\langle\sigma_+\rangle$ for Different Decay Rates")
152+
ax.legend();
132153
```
133154

134155
```python
@@ -142,12 +163,21 @@ for idx, gamma0 in enumerate([2 * Omega, 0.5 * Omega, 0.25 * Omega]):
142163
corr_vec = correlation_2op_1t(HL, None, taulist, c_ops, sigmap(), sigmam())
143164
w, S = spectrum_correlation_fft(taulist, corr_vec)
144165

145-
axes[0].plot(taulist, corr_vec, label=r"$<\sigma_+(\tau)\sigma_-(0)>$")
146-
axes[1].plot(-w / (gamma0), S, "b", label=r"$S(\omega)$")
147-
axes[1].plot(w / (gamma0), S, "b", label=r"$S(\omega)$")
166+
axes[0].plot(taulist, corr_vec, label=fr"$\gamma_0={gamma0:.2f}$")
167+
axes[1].plot(-w / (gamma0), S, "b", label=fr"$\gamma_0={gamma0:.2f}$")
168+
axes[1].plot(w / (gamma0), S, "b")
148169

149170
axes[0].set_xlim(0, 10)
150-
axes[1].set_xlim(-5, 5);
171+
axes[0].set_xlabel(r"$\tau$", fontsize=16)
172+
axes[0].set_ylabel(r"$\langle\sigma_+(\tau)\sigma_-(0)\rangle$", fontsize=16)
173+
axes[0].set_title("Two-Time Correlation Function")
174+
axes[0].legend()
175+
176+
axes[1].set_xlim(-5, 5)
177+
axes[1].set_xlabel(r"$\omega/\gamma_0$", fontsize=16)
178+
axes[1].set_ylabel(r"$S(\omega)$", fontsize=16)
179+
axes[1].set_title("Resonance Fluorescence Spectrum")
180+
axes[1].legend();
151181
```
152182

153183
### Software versions

tutorials-v4/lectures/Lecture-14-Kerr-nonlinearities.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jupyter:
1616

1717
Author: J. R. Johansson (robert@riken.jp), https://jrjohansson.github.io/
1818

19-
This lecture series was developed by J.R. Johannson. The original lecture notebooks are available [here](https://github.com/jrjohansson/qutip-lectures).
19+
This lecture series was developed by J.R. Johansson. The original lecture notebooks are available [here](https://github.com/jrjohansson/qutip-lectures).
2020

2121
This is a slightly modified version of the lectures, to work with the current release of QuTiP. You can find these lectures as a part of the [qutip-tutorials repository](https://github.com/qutip/qutip-tutorials). This lecture and other tutorial notebooks are indexed at the [QuTiP Tutorial webpage](https://qutip.org/tutorials.html).
2222

@@ -40,7 +40,7 @@ The Kerr effect describes a self-interaction electromagnetic quantum field which
4040

4141
$\displaystyle H = \frac{1}{2}\chi (a^\dagger)^2a^2$
4242

43-
where $\chi$ is related to the third-order nonlinear suseptibility. The Kerr effect is one of the typical nonlinearities that can occur in quantum optics due to a nonlinear medium.
43+
where $\chi$ is related to the third-order nonlinear susceptibility. The Kerr effect is one of the typical nonlinearities that can occur in quantum optics due to a nonlinear medium.
4444

4545
In this notebook we'll see how to setup the model in QuTiP and look at some interesting properties of the states that evolve according to this Hamiltonian.
4646

@@ -182,12 +182,12 @@ psi0 = coherent(N, 2.0)
182182

183183
```python
184184
# and evolve the state under the influence of the hamiltonian.
185-
# by passing an empty list as expecation value operators argument,
185+
# by passing an empty list as expectation value operators argument,
186186
# we get the full state of the system in result.states
187187
result = mesolve(H, psi0, tlist, [], [])
188188
```
189189

190-
First, let's look at how the expecation values and variances of the photon number operator $n$ and the $x$ and $p$ quadratures evolve in time:
190+
First, let's look at how the expectation values and variances of the photon number operator $n$ and the $x$ and $p$ quadratures evolve in time:
191191

192192
```python
193193
plot_expect_with_variance(N, [n, x, p], [r"n", r"x", r"p"], result.states);
@@ -201,7 +201,7 @@ To verify that the photon distribution indeed is time-independent, we can plot t
201201
plot_fock_distribution_vs_time(tlist, result.states);
202202
```
203203

204-
So the fock state distribution is constant, but let's see how the Wigner function of the state evolves in time. To best illustrate the dynamics of the Winger function we make a short movie that show the Wigner function from time $t=0$ to the the final time of the evolution.
204+
So the fock state distribution is constant, but let's see how the Wigner function of the state evolves in time. To best illustrate the dynamics of the Wigner function we make a short movie that shows the Wigner function from time $t=0$ to the final time of the evolution.
205205

206206
```python
207207
fig, ax = plt.subplots(1, 1, figsize=(8, 8))
@@ -226,7 +226,7 @@ display_embedded_video("animation-kerr-coherent-state.mp4")
226226

227227
Isn't that interesting! The dynamics is periodic, and we evolved the state for exactly one period, so that the final state is equal to the initial state.
228228

229-
In between there is interesting stuff going on. For example, after half the period the state ends up in something that look very much like a cat-state superposition of coherent states!
229+
In between there is interesting stuff going on. For example, after half the period the state ends up in something that looks very much like a cat-state superposition of coherent states!
230230

231231
```python
232232
fig, ax = plt.subplots(1, 1, figsize=(8, 8))

tutorials-v4/lectures/Lecture-15-Nonclassically-driven-atoms.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jupyter:
1717

1818
Author: J. R. Johansson (robert@riken.jp), https://jrjohansson.github.io/
1919

20-
This lecture series was developed by J.R. Johannson. The original lecture notebooks are available [here](https://github.com/jrjohansson/qutip-lectures).
20+
This lecture series was developed by J.R. Johansson. The original lecture notebooks are available [here](https://github.com/jrjohansson/qutip-lectures).
2121

2222
This is a slightly modified version of the lectures, to work with the current release of QuTiP. You can find these lectures as a part of the [qutip-tutorials repository](https://github.com/qutip/qutip-tutorials). This lecture and other tutorial notebooks are indexed at the [QuTiP Tutorial webpage](https://qutip.org/tutorials.html).
2323

tutorials-v4/lectures/Lecture-16-Gallery-of-Wigner-functions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jupyter:
1717

1818
Author: J. R. Johansson (robert@riken.jp), https://jrjohansson.github.io/
1919

20-
This lecture series was developed by J.R. Johannson. The original lecture notebooks are available [here](https://github.com/jrjohansson/qutip-lectures).
20+
This lecture series was developed by J.R. Johansson. The original lecture notebooks are available [here](https://github.com/jrjohansson/qutip-lectures).
2121

2222
This is a slightly modified version of the lectures, to work with the current release of QuTiP. You can find these lectures as a part of the [qutip-tutorials repository](https://github.com/qutip/qutip-tutorials). This lecture and other tutorial notebooks are indexed at the [QuTiP Tutorial webpage](https://qutip.org/tutorials.html).
2323

tutorials-v4/lectures/Lecture-2A-Cavity-Qubit-Gates.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jupyter:
1616

1717
Author: J. R. Johansson (robert@riken.jp), https://jrjohansson.github.io/
1818

19-
This lecture series was developed by J.R. Johannson. The original lecture notebooks are available [here](https://github.com/jrjohansson/qutip-lectures).
19+
This lecture series was developed by J.R. Johansson. The original lecture notebooks are available [here](https://github.com/jrjohansson/qutip-lectures).
2020

2121
This is a slightly modified version of the lectures, to work with the current release of QuTiP. You can find these lectures as a part of the [qutip-tutorials repository](https://github.com/qutip/qutip-tutorials). This lecture and other tutorial notebooks are indexed at the [QuTiP Tutorial webpage](https://qutip.org/tutorials.html).
2222

@@ -68,7 +68,7 @@ sm1 = tensor(qeye(N), destroy(2), qeye(2))
6868
sz1 = tensor(qeye(N), sigmaz(), qeye(2))
6969
n1 = sm1.dag() * sm1
7070

71-
# oeprators for qubit 2
71+
# operators for qubit 2
7272
sm2 = tensor(qeye(N), qeye(2), destroy(2))
7373
sz2 = tensor(qeye(N), qeye(2), sigmaz())
7474
n2 = sm2.dag() * sm2

0 commit comments

Comments
 (0)