Skip to content

Commit b954f58

Browse files
authored
Add Kerr nonlinearity tutorial (#21)
2 parents 91e48ec + d4ca6d2 commit b954f58

File tree

2 files changed

+240
-0
lines changed

2 files changed

+240
-0
lines changed
13.1 MB
Loading
Lines changed: 240 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,240 @@
1+
---
2+
title: "Kerr nonlinearities"
3+
author: Li-Xun Cai
4+
date: 2025-02-02 # last update (keep this comment as a reminder)
5+
6+
engine: julia
7+
execution:
8+
freeze: auto
9+
---
10+
11+
Inspirations taken from [this QuTiP tutorial](https://nbviewer.org/urls/qutip.org/qutip-tutorials/tutorials-v5/lectures/Lecture-14-Kerr-nonlinearities.ipynb) by J. R. Johansson.
12+
13+
This tutorial demonstrates the use of
14+
15+
- [`plot_wigner`](https://qutip.org/QuantumToolbox.jl/stable/resources/api#QuantumToolbox.plot_wigner)
16+
- [`wigner`](https://qutip.org/QuantumToolbox.jl/stable/resources/api#QuantumToolbox.wigner)
17+
18+
by exploring Kerr nonlinearities.
19+
20+
## Introduction
21+
22+
Kerr nonlinearities arise from the interaction between the electromagnetic field and a nonlinear medium with a significant third-order susceptibility, $\chi^{(3)}$. Since experiments typically use monochromatic light sources such as lasers, we restrict our discussion to a single light mode.
23+
24+
To derive the Hamiltonian, we start by reviewing the classical theory:
25+
26+
1. **Nonlinear polarization density:**
27+
In a nonlinear medium, the $i$-th component of the polarization density $\vec{\mathcal{P}}$ is given by
28+
$$
29+
\mathcal{P}_i =
30+
\sum_j \chi^{(1)}_{ij} E_j +
31+
\sum_{jk} \chi^{(2)}_{ijk} E_j E_k +
32+
\sum_{jkl} \chi^{(3)}_{ijkl} E_j E_k E_l + \dots
33+
$$
34+
for $i,j,k,l \in \{x,y,z\}$, where ${\chi}^{(m)}$ is the $m$-th order nonlinear susceptibility and $E$ is the electric field. By the assumption that only the first and third order terms are non-vanishing for our Kerr medium in the single light mode, we can approximate the polarization density as
35+
$$
36+
\mathcal{P} \simeq
37+
\chi^{(1)} E +
38+
\chi^{(3)} E^3
39+
$$
40+
with the subscripts dropped.
41+
2. **Interaction of the Electric Field with the Polarization Density:**
42+
The interaction energy is proportional to $\mathcal{P} \cdot E$. The nonlinear term in the Hamiltonian is therefore
43+
$$
44+
H_{\text{NL}} = \chi E^4
45+
$$
46+
where $\chi$ is the effective coefficient primarily determined by the nonlinear susceptibility.
47+
3. **Quantization of the Electromagnetic Mode:**
48+
In quantum optics, the electric field operator for a single mode is proportional to the quardrature operator $\hat{x} = \frac{(\hat{a} + \hat{a}^\dagger)}{2}$ where $\hat{a}$ is the annihilation operator.
49+
50+
We then combine the above properties, expand $(\hat{a}^\dagger + \hat{a})^4$, drop the terms that do not conserve the photon number or irrelevant to this tutorial with [rotating wave approximation (RWA)](https://en.wikipedia.org/wiki/Rotating-wave-approximation), and put the remaining terms in normal order. Finally, we arrive at the effective Hamiltonian
51+
$$
52+
H = \frac{\chi}{2} (\hat{a}^\dagger)^2 \hat{a}^2,
53+
$$
54+
where $\chi$ again absorbed the coefficients.
55+
56+
57+
---
58+
59+
## Introduction
60+
61+
Kerr nonlinearities arise from the interaction between the electromagnetic field and a nonlinear medium with a significant third-order susceptibility, $\chi^{(3)}$. Since experiments typically use monochromatic light sources such as lasers, we restrict our discussion to a single light mode.
62+
63+
The derivation of the Hamiltonian is based on the following principles:
64+
65+
1. **Interaction of the Electric Field with the Polarization Density:**
66+
The interaction energy is given by
67+
$$
68+
H \sim \int dV\, \mathcal{P} \cdot E.
69+
$$
70+
71+
2. **Dominance of the Third-Order Polarization Term:**
72+
In the medium, the polarization density can be expanded as
73+
$$
74+
\mathcal{P} = \mathcal{P}_0 + \varepsilon_0 \chi^{(1)} E + \varepsilon_0 \chi^{(2)} E^2 + \varepsilon_0 \chi^{(3)} E^3 + \dots,
75+
$$
76+
and, for mediums where the third-order term dominates, we approximate
77+
$$
78+
\mathcal{P} \simeq \varepsilon_0 \chi^{(3)} E^3.
79+
$$
80+
81+
3. **Quantization of the Electromagnetic Mode:**
82+
In quantum optics, the electric field operator for a single mode is expressed as
83+
$$
84+
E \propto \hat{a}^\dagger + \hat{a},
85+
$$
86+
where $\hat{a}$ is the annihilation operator.
87+
88+
Substituting this expression into the polarization term, we obtain a Hamiltonian proportional to $(\hat{a}^\dagger + \hat{a})^4$. By expanding this expression and applying the [rotating wave approximation (RWA)](https://en.wikipedia.org/wiki/Rotating-wave-approximation) to discard rapidly oscillating, non-resonant terms that do not conserve the number of excitations, we arrive at the effective Hamiltonian
89+
$$
90+
H = \frac{\chi}{2} (\hat{a}^\dagger)^2 \hat{a}^2,
91+
$$
92+
where $\chi$ is the effective nonlinear coupling determined primarily by the third-order susceptibility $\chi^{(3)}$.
93+
94+
## Code demonstration
95+
96+
```{julia}
97+
using QuantumToolbox
98+
using CairoMakie
99+
```
100+
101+
We begin by defining functions for visualization:
102+
103+
1. `plot_variance` plots the expectation value of an operator `op` and shades the variance.
104+
2. `plot_Fock_dist` plots the dynamics of the Fock distribution.
105+
```{julia}
106+
function plot_variance(op, tlist, states)
107+
e = real.(expect(op, states))
108+
v = real.(variance(op, states))
109+
110+
fig = Figure()
111+
ax = Axis(fig[1,1])
112+
lines!(ax, tlist, e)
113+
band!(ax, tlist, e .- v, e .+ v, alpha = 0.3)
114+
return fig, ax
115+
end
116+
117+
function plot_Fock_dist(tlist, states)
118+
fig = Figure()
119+
ax = Axis(
120+
fig[1,1],
121+
xlabel = L"N",
122+
ylabel = L"t"
123+
)
124+
125+
n_col = prod(states[1].dims)
126+
n_row = length(tlist)
127+
128+
data = zeros(Float64, n_row, n_col)
129+
130+
for (idx, state) in enumerate(states)
131+
data[idx, :] = real.(diag(state))
132+
end
133+
134+
hm = heatmap!(
135+
ax,
136+
0:(n_col-1),
137+
tlist,
138+
data',
139+
colormap = cgrad([:white, :magenta]),
140+
colorrange = (0,1)
141+
)
142+
Colorbar(fig[1,2], hm, label = "Probability")
143+
144+
145+
return fig, ax
146+
end
147+
```
148+
149+
Next, we define the system parameters and operators.
150+
```{julia}
151+
N = 15 # Dimension of the Hilbert space
152+
χ = 1 # effective susceptibility
153+
154+
a = destroy(N) # annihilation operator
155+
n = num(N) # number operator
156+
157+
# quadrature operators
158+
x = a + a'
159+
p = -1 * im * (a - a')
160+
161+
# Hamiltonian
162+
H = 0.5 * χ * a' * a' * a * a
163+
```
164+
165+
Since we are considering unitary dynamics, i.e., no dissipation, the dynamics are fully captured for $\chi t \in \left[0, 2 \pi \right]$, and the coherent initial state is representative for a laser light source.
166+
167+
Note that if the keyword argument `e_ops` is not supplied to [`mesolve`](https://qutip.org/QuantumToolbox.jl/stable/resources/api#QuantumToolbox.sesolve), the returned `result` contains the state at each time point at field `states`. Consult the [user guide to `TimeEvolutionSol`](https://qutip.org/QuantumToolbox.jl/stable/users_guide/time_evolution/solution) for more details.
168+
```{julia}
169+
ψ0 = coherent(N, 2.0)
170+
tlist = 0:0.01:(2*π / χ)
171+
172+
result = mesolve(H, ψ0, tlist)
173+
```
174+
175+
We first check the expectation value dynamics of the number operator `n` with the two visualization functions we defined previously.
176+
```{julia}
177+
fig1, ax1 = plot_variance(n, tlist, result.states)
178+
ax1.title = L"N"
179+
display(fig1)
180+
181+
fig2, ax2 = plot_Fock_dist(tlist, result.states)
182+
display(fig2)
183+
```
184+
As expected, the photon number is conserved throughout. Either the expectation value or the Fock distribution are conserved in the nonlinear interaction.
185+
186+
We now turn to the quadrature operators. The expectation value dynamics of `x` and `p` are plotted below.
187+
```{julia}
188+
titles = [L"x", L"p"]
189+
for (idx, op) in enumerate([x, p])
190+
_fig, _ax = plot_variance(op, tlist, result.states)
191+
_ax.title = titles[idx]
192+
display(_fig)
193+
end
194+
```
195+
There are two clear observations from these plots that indicate how the nonlinear interaction has modified the initial coherent state:
196+
197+
1. **Non-oscillatory Behavior of Expectation Values:**
198+
In a quantum harmonic oscillator, the expectation values of the quadrature operators typically exhibit simple sinusoidal oscillations. However, under the Kerr nonlinearity, the expectation values deviate from this periodic behavior. This deviation reflects the phase distortions introduced by the nonlinear term in the Hamiltonian.
199+
200+
2. **Departure from Minimum Uncertainty:**
201+
Coherent states in a harmonic oscillator are known to saturate the uncertainty relation, meaning they maintain a constant uncertainty product, ideally at
202+
$$
203+
\Delta x \Delta p = (\frac{\hbar}{2})^2.
204+
$$
205+
In contrast, the evolving state in the presence of the Kerr interaction shows a time-varying variance product. This variation is indicative of squeezing effects and confirms that the state is no longer a minimum uncertainty state.
206+
207+
We can extend the investigation to the Wigner function with the built-in function [`plot_wigner`](https://qutip.org/QuantumToolbox.jl/stable/resources/api#QuantumToolbox.plot_wigner).
208+
```{julia}
209+
fig3, ax3, hm3 = plot_wigner(result.states[315])
210+
ax3.title = "χt = " * string(tlist[315])
211+
Colorbar(fig3[1,2], hm3)
212+
display(fig3)
213+
```
214+
As the plot revealed, the state at $\chi t = \pi$ is in fact the [**cat state**](https://en.wikipedia.org/wiki/Cat_state#Cat_states_in_single_modes) for a single mode. One of the main characteristics of the cat state is the superposition of two coherent states with opposite phase.
215+
216+
The dynamics of the Wigner function offer a powerful phase-space perspective on the quantum state evolution under the Kerr nonlinearity. We again use `plot_wigner` to setup the initial plot and update frames with the function [`wigner`](https://qutip.org/QuantumToolbox.jl/stable/resources/api#QuantumToolbox.wigner) to record the dynamics as an animated GIF.
217+
```{julia}
218+
fig4, ax4, hm4 = plot_wigner(result.states[1])
219+
220+
Colorbar(fig4[1,2], hm4)
221+
222+
record(fig4, "images/kerr/wigner_dyn.gif", 1:length(tlist); framerate=24) do t
223+
wig = wigner(
224+
result.states[t],
225+
range(-7.5, 7.5, 200),
226+
range(-7.5, 7.5, 200)
227+
)
228+
ax4.title = "χt = " * string(round(tlist[t]; digits = 2))
229+
hm4[3] = transpose(wig)
230+
end
231+
```
232+
![](images/kerr/wigner_dyn.gif)
233+
234+
235+
As the animation progresses, you can observe how the initial Gaussian distribution, typical of a coherent state, is gradually deformed by the nonlinear interaction.
236+
237+
## Version Information
238+
```{julia}
239+
QuantumToolbox.versioninfo()
240+
```

0 commit comments

Comments
 (0)