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.
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. This lecture and other tutorial notebooks are indexed at the QuTiP Tutorial webpage.
import matplotlib.pyplot as plt
import numpy as np
from qutip import Qobj, about, energy_level_diagram, ket2dm, mesolve
%matplotlib inline
The Hamiltonian for a Josephson charge qubit is
$\displaystyle H = \sum_n 4 E_C (n_g - n)^2 \left|n\right\rangle\left\langle n\right| - \frac{1}{2}E_J\sum_n\left(\left|n+1\right\rangle\left\langle n\right| + \left|n\right\rangle\left\langle n+1\right| \right)$
where $E_C$ is the charge energy, $E_J$ is the Josephson energy, and $\left| n\right\rangle$ is the charge state with $n$ Cooper-pairs on the island that makes up the charge qubit.
Below we will repeatedly need to obtain the charge qubit Hamiltonian for different parameters, and to plot the eigenenergies, so here we define two functions to do these tasks.
def hamiltonian(Ec, Ej, N, ng):
"""
Return the charge qubit hamiltonian as a Qobj instance.
"""
m = np.diag(4 * Ec * (np.arange(-N, N + 1) - ng) ** 2) + 0.5 * Ej * (
np.diag(-np.ones(2 * N), 1) + np.diag(-np.ones(2 * N), -1)
)
return Qobj(m)
def plot_energies(ng_vec, energies, ymax=(20, 3)):
"""
Plot energy levels as a function of bias parameter ng_vec.
"""
fig, axes = plt.subplots(1, 2, figsize=(16, 6))
for n in range(len(energies[0, :])):
axes[0].plot(ng_vec, energies[:, n])
axes[0].set_ylim(-2, ymax[0])
axes[0].set_xlabel(r"$n_g$", fontsize=18)
axes[0].set_ylabel(r"$E_n$", fontsize=18)
for n in range(len(energies[0, :])):
axes[1].plot(
ng_vec,
(energies[:, n] - energies[:, 0]) /
(energies[:, 1] - energies[:, 0]),
)
axes[1].set_ylim(-0.1, ymax[1])
axes[1].set_xlabel(r"$n_g$", fontsize=18)
axes[1].set_ylabel(r"$(E_n-E_0)/(E_1-E_0)$", fontsize=18)
return fig, axes
def visualize_dynamics(result, ylabel):
"""
Plot the evolution of the expectation values stored in result.
"""
fig, ax = plt.subplots(figsize=(12, 5))
ax.plot(result.times, result.expect[0])
ax.set_ylabel(ylabel, fontsize=16)
ax.set_xlabel(r"$t$", fontsize=16);
N = 10
Ec = 1.0
Ej = 1.0
ng_vec = np.linspace(-4, 4, 200)
energies = np.array([hamiltonian(Ec, Ej, N, ng).eigenenergies()
for ng in ng_vec])
plot_energies(ng_vec, energies);
ng_vec = np.linspace(-1, 1, 200)
energies = np.array([hamiltonian(Ec, Ej, N, ng).eigenenergies()
for ng in ng_vec])
plot_energies(ng_vec, energies, ymax=(7.5, 3.0));
ng_vec = np.linspace(-4, 4, 200)
Ec = 1.0
Ej = 5.0
energies = np.array([hamiltonian(Ec, Ej, N, ng).eigenenergies()
for ng in ng_vec])
plot_energies(ng_vec, energies, ymax=(50, 3));
Ec = 1.0
Ej = 10.0
energies = np.array([hamiltonian(Ec, Ej, N, ng).eigenenergies()
for ng in ng_vec])
plot_energies(ng_vec, energies, ymax=(50, 3));