Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tutorials-v4/lectures/Lecture-0-Introduction-to-QuTiP.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jupyter:

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

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

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).

Expand Down
10 changes: 5 additions & 5 deletions tutorials-v4/lectures/Lecture-1-Jaynes-Cumming-model.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jupyter:

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

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

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).

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

```python
# intial state
# initial state
psi0 = tensor(basis(N, 0), basis(2, 1)) # start with an excited atom

# operators
Expand Down Expand Up @@ -132,7 +132,7 @@ axes.set_title("Vacuum Rabi oscillations");

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.

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.
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.

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

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

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

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.
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.


### Alternative view of the same thing
Expand Down
2 changes: 1 addition & 1 deletion tutorials-v4/lectures/Lecture-10-cQED-dispersive-regime.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jupyter:

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

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

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).

Expand Down
6 changes: 3 additions & 3 deletions tutorials-v4/lectures/Lecture-11-Charge-Qubits.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jupyter:

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

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

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).

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

#### References

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


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

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.
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.


## Focus on the two lowest energy states
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jupyter:

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

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

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).

Expand Down Expand Up @@ -70,7 +70,7 @@ w_th = 0.0 * 2 * np.pi

```python
# the number of average excitations in the
# environment mode w0 at temperture w_th
# environment mode w0 at temperature w_th
Nth = n_thermal(w0, w_th)

Nth
Expand Down Expand Up @@ -126,7 +126,7 @@ L0 = liouvillian(H, c_ops)
L0
```

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

```python
Lsq = -gamma0 * M * spre(sp) * spost(sp) - gamma0 * \
Expand Down
60 changes: 45 additions & 15 deletions tutorials-v4/lectures/Lecture-13-Resonance-flourescence.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ jupyter:
name: python3
---

# Lecture 13 - Resonance flourescence
# Lecture 13 - Resonance fluorescence


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

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

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).

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

Resonance fluorescence, is the interaction between a two-level quantum system and a coherent driving field.

The Hamiltonian for a two-level system under resonant driving, is given by:

$\displaystyle H_L = -\frac{\Omega}{2}(\sigma_+ + \sigma_-)$


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

```python
# Rabi frequency (strength of the driving field)
Omega = 1.0 * 2 * np.pi
```

```python
# decay rate of the two-level system
gamma0 = 0.05

# thermal frequency of the bath
w_th = 0.0

# thermal occupation number for the bath
N = n_thermal(Omega, w_th)
```

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

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

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

# axes[1].set_ylabel(r'$\langle\sigma_z\rangle$', fontsize=16)
axes[1].set_ylabel(r"$P_g$", fontsize=16)
axes[1].set_xlabel("time", fontsize=16)
axes[1].legend()
axes[1].set_ylim(0, 1);
axes[1].set_ylim(0, 1)
axes[1].set_title("Ground State Population vs Time");
```

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


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

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

ax.plot(result.times, result.expect[5], "b",
label=r"$\langle\sigma_z\rangle$")
ax.plot(
result.times, result.expect[5], "b",
label=fr"$P_g$ ($\gamma_0={gamma0:.2f}$)"
)

ax.set_ylim(0, 1);
ax.set_ylim(0, 1)
ax.set_xlabel("time", fontsize=16)
ax.set_ylabel(r"$P_g$", fontsize=16)
ax.set_title("Ground State Population for Different Decay Rates")
ax.legend();
```

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


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

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

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

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

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

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

axes[0].set_xlim(0, 10)
axes[1].set_xlim(-5, 5);
axes[0].set_xlabel(r"$\tau$", fontsize=16)
axes[0].set_ylabel(r"$\langle\sigma_+(\tau)\sigma_-(0)\rangle$", fontsize=16)
axes[0].set_title("Two-Time Correlation Function")
axes[0].legend()

axes[1].set_xlim(-5, 5)
axes[1].set_xlabel(r"$\omega/\gamma_0$", fontsize=16)
axes[1].set_ylabel(r"$S(\omega)$", fontsize=16)
axes[1].set_title("Resonance Fluorescence Spectrum")
axes[1].legend();
```

### Software versions
Expand Down
12 changes: 6 additions & 6 deletions tutorials-v4/lectures/Lecture-14-Kerr-nonlinearities.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jupyter:

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

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

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).

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

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

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.
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.

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.

Expand Down Expand Up @@ -182,12 +182,12 @@ psi0 = coherent(N, 2.0)

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

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:
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:

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

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.
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.

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

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.

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!
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!

```python
fig, ax = plt.subplots(1, 1, figsize=(8, 8))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jupyter:

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

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

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).

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jupyter:

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

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

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).

Expand Down
4 changes: 2 additions & 2 deletions tutorials-v4/lectures/Lecture-2A-Cavity-Qubit-Gates.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jupyter:

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

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

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).

Expand Down Expand Up @@ -68,7 +68,7 @@ sm1 = tensor(qeye(N), destroy(2), qeye(2))
sz1 = tensor(qeye(N), sigmaz(), qeye(2))
n1 = sm1.dag() * sm1

# oeprators for qubit 2
# operators for qubit 2
sm2 = tensor(qeye(N), qeye(2), destroy(2))
sz2 = tensor(qeye(N), qeye(2), sigmaz())
n2 = sm2.dag() * sm2
Expand Down
Loading