Skip to content

Commit e38257e

Browse files
committed
Documentation updated
1 parent e1e5981 commit e38257e

18 files changed

+682
-1931
lines changed

docs/matplotlibrc

Lines changed: 0 additions & 788 deletions
This file was deleted.
168 Bytes
Loading

docs/src/detection.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,36 @@
11
# [Detection and Projections](@id BStutorial)
2-
A beamsplitter is a partly reflective partly transmitive mirror that splits up an incomming photon as depicted here.
2+
A beamsplitter is a partly reflective, partly transmissive mirror that splits up an incoming photon, as depicted here.
33

44
![beamsplitter](./illustrations/single_beamsplitter.png)
55

6-
Asuming that the beamsplitter is equal (50% transmission and 50% reflection) and that we have only a single photon in one of waveguides impinging on the beamsplitter, the photon will go to detector plus 50% of the time and detector minus the other 50% of the time. This can be modeled in `WaveguideQED.jl` using [`LazyTensorKet`](@ref) and [`Detector`](@ref). We start by creating the two input waveguides.
6+
Assuming that the beamsplitter is equal (50% transmission and 50% reflection) and that we have only a single photon in one of waveguides impinging on the beamsplitter, the photon will go to detector plus 50% of the time and detector minus the other 50% of the time. This can be modeled in `WaveguideQED.jl` using [`LazyTensorKet`](@ref) and [`Detector`](@ref). We start by creating the two input waveguides.
77

88

99
## Background Theory
10-
Two photons inpinging on a beamsplitter is a classic example of destructive and constructive interference. If the two photons are indistinquishable, they will always appear in pairs on the other side of the beamsplitter. That is the following scenario:
10+
Two photons impinging on a beamsplitter is a classic example of destructive and constructive interference. If the two photons are indistinguishable, they will always appear in pairs on the other side of the beamsplitter. That is the following scenario:
1111

1212
![beamsplitter](./illustrations/hong_au_mandel.png)
1313

14-
However, what happens if the two photons have a slight mismatch in frequency or their temporal distribution and how do we model this? Assuming the beamsplitter is 50/50 the beamsplitter transformation is[^1] : $w_a \rightarrow (w_c + w_d)/\sqrt(2)$ and $w_b \rightarrow (w_c - w_d)/\sqrt(2)$, where $w_k$ is the annihilation operator for waveguide $k=\{a,b,c,d\}$. A one photon continous fockstate in waveguide a and b with wavefunction $\xi_a(t)$ and $\xi_b(t)$ has the combined state:
14+
However, what happens if the two photons have a slight mismatch in frequency or their temporal distribution, and how do we model this? Assuming the beamsplitter is 50/50 the beamsplitter transformation is[^1] : $w_a \rightarrow (w_c + w_d)/\sqrt(2)$ and $w_b \rightarrow (w_c - w_d)/\sqrt(2)$, where $w_k$ is the annihilation operator for waveguide $k=\{a,b,c,d\}$. A one photon continuous fockstate in waveguide a and b with wavefunction $\xi_a(t)$ and $\xi_b(t)$ has the combined state:
1515

1616
$$\begin{align*}
1717
\ket{\psi}_{a,b} &= \ket{\psi}_a \otimes \ket{\psi}_b = \int_{t_0}^{t_{end}} \mathrm{d}t \ \xi_a(t) w_a^\dagger(t) \ket{0}_a \otimes \int_{t_0}^{t_{end}} \mathrm{d}t \ \xi_b(t) w_b^\dagger(t) \ket{0}_b \\
1818
& \int_{t_0}^{t_{end}} \mathrm{d}t \int_{t_0}^{t_{end}} \mathrm{d}t' \xi_a(t)\xi_b(t') w_a^\dagger(t) w_b^\dagger(t') \ket{0}_a\ket{0}_b
1919
\end{align*}$$
2020

21-
Using the beamsplitter transformation, we thus have the following state after the two photons have interfered on the beamsplitter:
21+
Using the beamsplitter transformation, we thus have the following state after the two photons have interfered with the beamsplitter:
2222

2323
$$\begin{align*}
2424
\ket{\psi}_{a,b} &\xrightarrow[]{BS} \frac{1}{2} \int_{t_0}^{t_{end}} \mathrm{d}t \int_{t_0}^{t_{end}} \mathrm{d}t' \xi_a(t)\xi_b(t') (w_c^\dagger(t) + w_d^\dagger(t)) (w_c^\dagger(t') - w_d^\dagger(t')) \ket{0}_a\ket{0}_b \\
2525
&= \frac{1}{2} \int_{t_0}^{t_{end}} \mathrm{d}t \int_{t_0}^{t_{end}} \mathrm{d}t' \xi_a(t)\xi_b(t') \left [ w_c^\dagger(t) w_c^\dagger(t') + w_d^\dagger(t)w_c^\dagger(t') - w_c^\dagger(t)w_d^\dagger(t') - w_d^\dagger(t)w_d^\dagger(t') \right ] \ket{0}_c\ket{0}_d \\
2626
&= \frac{1}{2} \left ( W_c^\dagger(\xi_a) W_c^\dagger(\xi_b) \ket{0}_c - W_d^\dagger(\xi_a) W_d^\dagger(\xi_b) \ket{0}_d + \int_{t_0}^{t_{end}} \mathrm{d}t \int_{t_0}^{t_{end}} \mathrm{d}t' \left [ \xi_a(t)\xi_b(t') - \xi_a(t')\xi_b(t) \right] \ket{1}_c\ket{1}_d \right)
2727
\end{align*}$$
2828

29-
where we introduced $$W_{c/d}^\dagger(\xi_a) W_{c/d}^\dagger(\xi_b) \ket{0}_{c/d} = int_{t_0}^{t_{end}} \mathrm{d}t \int_{t_0}^{t_{end}} \mathrm{d}t' \xi_a(t)\xi_b(t') w_{c/d}^\dagger(t) w_{c/d}^\dagger(t') \ket{0}_{c/d}$$. $$W_{c/d}^\dagger(\xi_a) W_{c/d}^\dagger(\xi_b) \ket{0}_{c/d}$$ thus corresponds to both photons going into the same direction. It is also evident that if $$\xi_a(t)\xi_b(t') - \xi_a(t')\xi_b(t) \right = 0$$ then we will have no photons in waveguide c and d simultanously. This condition is exactly fulfilled if the photon in waveguide a is indistinquishable from the photon in waveguide b. This also means that if the photons ARE distinquishable, we will start to see photon occuring in waveguide c and d simultanously. All this and more can be simulated in the code and in the next section we walk through how to set the above example up in the code.
29+
where we introduced $$W_{c/d}^\dagger(\xi_a) W_{c/d}^\dagger(\xi_b) \ket{0}_{c/d} = int_{t_0}^{t_{end}} \mathrm{d}t \int_{t_0}^{t_{end}} \mathrm{d}t' \xi_a(t)\xi_b(t') w_{c/d}^\dagger(t) w_{c/d}^\dagger(t') \ket{0}_{c/d}$$. $$W_{c/d}^\dagger(\xi_a) W_{c/d}^\dagger(\xi_b) \ket{0}_{c/d}$$ thus corresponds to both photons going into the same direction. It is also evident that if $$\xi_a(t)\xi_b(t') - \xi_a(t')\xi_b(t) \right = 0$$ then we will have no photons in waveguide c and d simultaneously. This condition is exactly fulfilled if the photon in waveguide a is indistinguishable from the photon in waveguide b. This also means that if the photons ARE distinguishable, we will start to see photon occurring in waveguide c and d simultaneously. All this and more can be simulated in the code, and in the next section, we walk through how to set the above example up in the code.
3030

3131
## Beamsplitter and detection in WaveguideQED.jl
3232

33-
In `CaviyWaveguide.jl` we create the two incoming photons in each of their respective waveguides and define the corresponding annihilation operators:
33+
In `WaveguideQED.jl` we create the two incoming photons in each of their respective waveguides and define the corresponding annihilation operators:
3434

3535
```@example detection
3636
using WaveguideQED #hide
@@ -45,14 +45,14 @@ wb = destroy(bw)
4545
nothing #hide
4646
```
4747

48-
We then combine the states of waveguide a and b in a lazy tensor structure (tensor product is never calculated but the dimensions are inferred in subsequent calculations):
48+
We then combine the states of waveguide a and b in a lazy tensor structure (tensor product is never calculated, but the dimensions are inferred in subsequent calculations):
4949

5050
```@example detection
5151
ψ_total = LazyTensorKet(waveguide_a,waveguide_b)
5252
nothing #hide
5353
```
5454

55-
Now we define [`Detector`](@ref) operators, which defines the beamsplitter and subsequent detection operation. In the following $\mathrm{Dplus} = D_+ = \frac{1}{\sqrt{2}}(w_a + w_b) $ and $\mathrm{Dminus} = D_- = \frac{1}{\sqrt{2}}(w_a - w_b)$
55+
Now we define [`Detector`](@ref) operators, which define the beamsplitter and subsequent detection operation. In the following $\mathrm{Dplus} = D_+ = \frac{1}{\sqrt{2}}(w_a + w_b) $ and $\mathrm{Dminus} = D_- = \frac{1}{\sqrt{2}}(w_a - w_b)$
5656

5757
```@example detection
5858
Dplus = Detector(wa/sqrt(2),wb/sqrt(2))
@@ -67,21 +67,21 @@ p_plus = Dplus * ψ_total
6767
p_minus = Dminus * ψ_total
6868
```
6969

70-
The returned probabilities are zero because there is no states that result in only ONE click at the detectors. Instead we have to ask for the probability of detecting TWO photons:
70+
The returned probabilities are zero because there is no states that result in only ONE click at the detectors. Instead, we have to ask for the probability of detecting TWO photons:
7171

7272
```@repl detection
7373
p_plus_plus = Dplus * Dplus * ψ_total
7474
p_minus_minus = Dminus * Dminus * ψ_total
7575
```
7676

77-
Notice that we here asked what is the probability of having a detection event in detector plus/minus and subsequently another detection event in detector plus/minus. The output was $50\%$ for both cases reflecting the above calculations where we would expect the two photons always come in pairs. As a consequence the probability of having a click in detector plus and then in detector minus (or vice versa) is given as:
77+
Notice that we here asked what the probability of having a detection event in detector plus/minus and, subsequently, another detection event in detector plus/minus is. The output was $50\%$ for both cases reflecting the above calculations where we would expect the two photons always come in pairs. As a consequence, the probability of having a click in detector plus and then in detector minus (or vice versa) is given as:
7878

7979
```@repl detection
8080
p_plus_minus = Dplus * Dminus * ψ_total
8181
p_minus_plus = Dminus * Dplus * ψ_total
8282
```
8383

84-
As expected the resulting probabilities are zero. If we instead displace the photons in time so that one is centered around $t = 5$ and another around $t = 15$ we get:
84+
As expected, the resulting probabilities are zero. If we instead displace the photons in time so that one is centered around $t = 5$ and another around $t = 15$ we get:
8585

8686
```@repl detection
8787
waveguide_a = onephoton(bw,ξfun,times,1,5);
@@ -93,7 +93,7 @@ p_plus_minus = Dplus * Dminus * ψ_total
9393
p_minus_plus = Dminus * Dplus * ψ_total
9494
```
9595

96-
Thus we have an equal probability detection events in the same detector and in opposite detectors, since the two photon pulse are temporaly seperated.
96+
Thus we have an equal probability of detection events in the same detector and opposite detectors since the two photon-pulses are temporarily separated.
9797

9898

9999
[^1]: [Gerry2004](@cite)

docs/src/example_lodahl.md

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
# Scattering on two level system
2-
In the following, we show that with our framwework we can reproduce the theoretical results obtained in [Le Jeannic, et al. Nat. Phys. 18, 1191–1195 (2022)](https://www.nature.com/articles/s41567-022-01720-x)
1+
# Scattering on a two-level system
2+
In the following, we show that with our framework, we can reproduce the theoretical results obtained in [Le Jeannic, et al. Nat. Phys. 18, 1191–1195 (2022)](https://www.nature.com/articles/s41567-022-01720-x)
33

44

5-
In many of the examples considered so far, we only consider a single waveguide that serves as both input and output, thus only allowing for only one-sided cavities or quantum systems at the end of a waveguide. A more realistic scenario is having a waveguide with a quantum system in the middle. Here an incoming waveguide carying an excitation could scatter on the quantum system and one would have excitations going away from the quantum system in both the first and latter part of the waveguide as illustrated here:[^1]
5+
In many of the examples considered so far, we only consider a single waveguide that serves as both input and output, thus only allowing for only one-sided cavities or quantum systems at the end of a waveguide. A more realistic scenario is having a waveguide with a quantum system in the middle. Here an incoming waveguide carrying an excitation could scatter on the quantum system, and one would have excitations going away from the quantum system in both the first and latter part of the waveguide, as illustrated here:[^1]
66

77
[^1]: [DynamicalPhotonLodahl2022](@cite)
88

99
![`alt text`](./illustrations/two_waveguide_lodahl.png)
1010

1111

12-
A way to model this scenario is to have two waveguides: a waveguide to the left and the right, describing the first half of the waveguide and the latter part of the waveguide. For this we use [`WaveguideBasis`](@ref) but with an extra argument specifying that we need 2 waveguides (see [`Two Waveguides`](@ref twowaveguide) for an introduction). We initialize [`WaveguideBasis`](@ref) with two waveguides and a basis for the atom (note that a fockbasis with only one excitation allowed is the same as a two-level-system):
12+
A way to model this scenario is to have two waveguides: a waveguide to the left and the right, describing the first half of the waveguide and the latter half. For this, we use [`WaveguideBasis`](@ref) but with an extra argument specifying that we need two waveguides (see [`twowaveguide`](@ref) for an introduction). We initialize [`WaveguideBasis`](@ref) with two waveguides and a basis for the atom (note that a fockbasis with only one excitation allowed is the same as a two-level-system):
1313

1414
```@example lodahl
1515
using WaveguideQED #hide
@@ -21,7 +21,7 @@ be = FockBasis(1)
2121
nothing #hide
2222
```
2323

24-
We then define the operators for the interaction between atom and waveguide as (notice the second argument in create(bw,1) that defines which waveguide we are adressing):
24+
We then define the operators for the interaction between atom and waveguide as (notice the second argument in `create(bw,1)` that defines which waveguide we are addressing):
2525

2626
```@example lodahl
2727
wdLa = create(bw,1) ⊗ destroy(be)
@@ -31,7 +31,7 @@ adwR = destroy(bw,2) ⊗ create(be)
3131
nothing #hide
3232
```
3333

34-
where $\mathrm{wdLa} = w_L ^\dagger a$, $\mathrm{wdRa} = w_R ^\dagger a$, $\mathrm{adwL} = w_L a^\dagger$, and $\mathrm{adwR} = w_R a^\dagger$. In this example, we, however, also need an interaction between the waveguides. We therefore we define the creation and annihilation operators
34+
where $\mathrm{wdLa} = w_L ^\dagger a$, $\mathrm{wdRa} = w_R ^\dagger a$, $\mathrm{adwL} = w_L a^\dagger$, and $\mathrm{adwR} = w_R a^\dagger$. In this example, we, however, also need an interaction between the waveguides. Therefore we define the creation and annihilation operators:
3535

3636
```@example lodahl
3737
wdL = create(bw,1) ⊗ identityoperator(be)
@@ -41,7 +41,7 @@ wR = destroy(bw,2) ⊗ identityoperator(be)
4141
nothing #hide
4242
```
4343

44-
The interaction should carry over the momentum of the left pulse into the right waveguide and the interaction should therefore model a SWAP gate. This corresponds to $V = \pi /2$ and thus we have the interaction Hamiltonian:
44+
The interaction should carry over the momentum of the left waveguide into the waveguide on the right, and the interaction should therefore model a SWAP gate. This corresponds to $V = \pi /2$ and thus we have the interaction Hamiltonian:
4545

4646
```@example lodahl
4747
V = pi/2
@@ -51,8 +51,7 @@ H = im*sqrt(κ1/dt)*(adwL-wdLa) + im*sqrt(κ2/dt)*(wdRa-adwR) + V/dt *(wdR*wL +
5151
nothing #hide
5252
```
5353

54-
We can now study how single or two photon states scatter on the atom. We define the initial onephoton or twophoton gaussian state and solve it using the defined Hamiltonian:
55-
54+
We can now study how single or two-photon states scatter on the atom. We define the initial one-photon or two-photon Gaussian state and solve it using the defined Hamiltonian:
5655

5756
```@example lodahl
5857
ξ₁(t1,σ,t0) = sqrt(2/σ)* (log(2)/pi)^(1/4)*exp(-2*log(2)*(t1-t0)^2/σ^2)
@@ -66,23 +65,23 @@ t0 = 5
6665
nothing #hide
6766
```
6867

69-
Viewing the scattered states is then done using TwoPhotonView and the index for the corresponding waveguide. Giving two indeces returns instead the combined single photon state in both waveguides $\sum_{j,k} \ket{1_j}_1 \ket{1_k}_2$:
68+
Viewing the scattered states is then done using TwoPhotonView and the index for the corresponding waveguide. Giving two indices returns instead the combined single photon state in both waveguides $\sum_{j,k} \ket{1_j}_1 \ket{1_k}_2$:
7069

7170
```@example lodahl
72-
ψ2LeftScat = TwoPhotonView(ψScat2,[:,1],1)
73-
ψ2RightScat = TwoPhotonView(ψScat2,[:,1],2)
74-
ψ2LeftRightScat = TwoPhotonView(ψScat2,[:,1],2,1)
71+
ψ2LeftScat = TwoPhotonView(ψScat2,1,[:,1])
72+
ψ2RightScat = TwoPhotonView(ψScat2,2,[:,1])
73+
ψ2LeftRightScat = TwoPhotonView(ψScat2,2,1,[:,1])
7574
nothing #hide
7675
```
7776

78-
For the single photon states we have to calculate the two time scattered distribution as:
77+
For the single-photon states, we have to calculate the two-time scattered distribution as:
7978

8079
```@example lodahl
8180
ψ1LeftScat = zeros(ComplexF64,(length(times),length(times)))
8281
ψ1RightScat = zeros(ComplexF64,(length(times),length(times)))
8382
ψ1LeftRightScat = zeros(ComplexF64,(length(times),length(times)))
84-
ψ1Right = OnePhotonView(ψScat1,[:,1],2)
85-
ψ1Left = OnePhotonView(ψScat1,[:,1],1)
83+
ψ1Right = OnePhotonView(ψScat1,2,[:,1])
84+
ψ1Left = OnePhotonView(ψScat1,1,[:,1])
8685
8786
for i in eachindex(times)
8887
for j in eachindex(times)
@@ -94,11 +93,15 @@ end
9493
nothing #hide
9594
```
9695

97-
Finall, this can be plotted and we note that this matches fig. 3 in Ref. ^[1]:
96+
Finally, we can plot the scattered wavefunctions, and we note that this matches Fig. 3 in Ref. ^[1]:
9897

9998
```@example lodahl
10099
using PyPlot; #hide
101-
fig,axs = subplots(3,2,figsize=(9,17))
100+
rcParams = PyPlot.PyDict(PyPlot.matplotlib."rcParams") #hide
101+
rcParams["font.size"] = 20 #hide
102+
rcParams["font.family"] = "serif" #hide
103+
rcParams["mathtext.fontset"] ="cm" #hide
104+
fig,axs = subplots(3,2,figsize=(6,17))
102105
plot_list = [ψ2RightScat,ψ2LeftScat,ψ2LeftRightScat,ψ1RightScat,ψ1LeftScat,ψ1LeftRightScat]
103106
for (i,ax) in enumerate(axs)
104107
plot_twophoton!(ax,plot_list[i],times)

docs/src/index.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
# WaveguideQED.jl
22

3-
WaveguideQED.jl is a package for simulating continous fockstates in waveguides. It expands on [`QuantumOptics.jl`](https://qojulia.org/) by adding custom basises, operators, and routines for doing detection.
3+
WaveguideQED.jl is a package for simulating continuous fockstates in waveguides. It expands on [`QuantumOptics.jl`](https://qojulia.org/) by adding a custom basis, operators, and routines for doing detection.
44

55
### Dev docs
66
Added functionalities:
77
* [`WaveguideBasis`](@ref) for representing the waveguide space and the related generator functions: [`zerophoton`](@ref), [`onephoton`](@ref), and [`twophoton`](@ref). Also see [`OnePhotonView`](@ref), [`TwoPhotonView`](@ref), and [`plot_twophoton!`](@ref) for viewing the waveguide data for plotting. Note that [`WaveguideBasis`](@ref) can contain multiple waveguides.
8-
* [`WaveguideOperator`](@ref) which are specialized operators allowing efficient annihilation and creation operators at each timebin in the waveguide. They are created by giving a basis to [`WaveguideQED.destroy`](@ref) and [`WaveguideQED.create`](@ref)
9-
* Since the interaction between the waveguide timebin mode $k$ and cavity/emitter is always given as: $a^\dagger w_k - a w_k^\dagger$ there are specially optimized functions for doing these operations called [`CavityWaveguideOperator`](@ref) which are created using a fockbasis and a waveguide basis and the functions [`emission`](@ref) and [`absorption`](@ref).
10-
* [`Detector`](@ref), [`LazyTensorKet`](@ref), and [`LazySumKet`](@ref) together with [`detect_single_click`](@ref) and [`detect_double_click`](@ref) allows one to do a beamsplitter interference and subsequent detection on photons comming from two waveguides.
8+
* [`WaveguideOperator`](@ref) which are specialized operators allowing efficient annihilation and creation operators at each time-bin in the waveguide. They are created by giving a basis to [`WaveguideQED.destroy`](@ref) and [`WaveguideQED.create`](@ref)
9+
* Since the interaction between the waveguide time-bin mode $k$ and cavity/emitter is given as: $a^\dagger w_k - a w_k^\dagger$ there are specially optimized functions for doing these operations called [`CavityWaveguideOperator`](@ref) which are created using a fockbasis and a waveguide basis and the functions [`emission`](@ref) and [`absorption`](@ref).
10+
* [`Detector`](@ref), [`LazyTensorKet`](@ref), and [`LazySumKet`](@ref), together with [`detect_single_click`](@ref) and [`detect_double_click`](@ref) allow one to do a beamsplitter interference and subsequent detection of photons coming from two waveguides.
1111

1212
![alt text](./animations/firstgif.gif)
1313

0 commit comments

Comments
 (0)