You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/src/multiplewaveguides.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
# Multiple waveguides
2
2
3
3
## [Two Waveguides](@id twowaveguide)
4
-
In the previous examples, we have only considered cases with a single waveguide. In this toturial, we show how to model a beamsplitter and an optical switch using two waveguides. A beamsplitter or a swap gate can be modelled using the Hamiltonian $H_I = V(w_1^\dagger w_2 + w_2^\dagger w_1)$ where V is some interaction strength that determines which interaction is moddeled (we will discuss this in detail later). $w_1$ and $w_2$ is the annihilation operators of the two waveguides. A sketch of the system can be seen here:
4
+
In the previous examples, we have only considered cases with a single waveguide. In this tutorial, we show how to model a beamsplitter and an optical switch using two waveguides. A beamsplitter or a swap gate can be modelled using the Hamiltonian $H_I = V(w_1^\dagger w_2 + w_2^\dagger w_1)$ where V is some interaction strength that determines which interaction is moddeled (we will discuss this in detail later). $w_1$ and $w_2$ is the annihilation operators of the two waveguides. A sketch of the system can be seen here:
5
5
6
6

7
7
@@ -49,7 +49,7 @@ nothing #hide
49
49
```
50
50
51
51
## Beamsplitter
52
-
Let's now treat the same example as in [Interference on Beamsplitter](@refBStoturial). We consider the two waveguides in a identic single photon state and thus use the above defined `ψ_single_1_and_2`. The Hamiltonian governing a beamsplitter in the time binned formalism has $V= \pi/4$:
52
+
Let's now treat the same example as in [Interference on Beamsplitter](@refBStutorial). We consider the two waveguides in a identic single photon state and thus use the above defined `ψ_single_1_and_2`. The Hamiltonian governing a beamsplitter in the time binned formalism has $V= \pi/4$:
Copy file name to clipboardExpand all lines: docs/src/theoreticalbackground.md
+1-2Lines changed: 1 addition & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -92,7 +92,6 @@ The effect of the creation operator is to create a photon in timebin k and can b
92
92
This is also seen if we plot the creation operator acting on the vacuum:
93
93
94
94
```@example theory
95
-
using PyPlot
96
95
ψ = wd*zerophoton(bw)
97
96
viewed_state = OnePhotonView(ψ)
98
97
fig,ax = subplots(1,1,figsize=(9,4.5))
@@ -143,6 +142,7 @@ We can define a twophoton basis and corresponding operator by:
143
142
```@example theory
144
143
bw = WaveguideBasis(2,times)
145
144
wd = create(bw)
145
+
nothing #hide
146
146
```
147
147
The creation operator can then be visualized by acting on a onephoton state with ones all over. This is seen in the following. Note that the state is visualized as a contour plot mirrored around the diagonal.
148
148
@@ -170,7 +170,6 @@ nothing #hide
170
170
Here, we defined the two photon equivalent of our single photon gaussian state. When we visualize it, we now need two times, and we make a contour plot. This is easily done viewing the twophoton state:
Copy file name to clipboardExpand all lines: docs/src/tutorial.md
+10-10Lines changed: 10 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,4 @@
1
-
# Toturials
1
+
# Tutorials
2
2
In this section, we show simple examples that illustrate how to use **WaveguideQED.jl** in combination with [`QuantumOptics.jl`](https://qojulia.org/)
3
3
4
4
## [Combining with QuantumOptics.jl](@id combining)
@@ -9,7 +9,7 @@ Basises, states, and operators defined in `WaveguideQED.jl` can be effortlesly c
9
9
10
10
We start by defining the basis of the cavity and waveguide:
11
11
12
-
```@exampletoturial
12
+
```@exampletutorial
13
13
using WaveguideQED
14
14
using QuantumOptics
15
15
times = 0:0.1:10
@@ -20,7 +20,7 @@ nothing #hide
20
20
21
21
Next we want to create the Hamiltonian for the system. The interaction between the waveguide and cavity is at timestep k given by[^1]$$H_k = i \hbar \sqrt{\gamma / \Delta t}( a^\dagger w_k - a w_k^\dagger)$$, where $$a$$ ($$a^\dagger$$) is the cavity annihilation (creation) operator, $$w_k$$($$w_k^\dagger$$) is the waveguide annihilation (creation) operator, $$\gamma$$ is the leakage rate of the cavity, and `\Delta t = times[2]-times[1]` is the width of the timebin. `WaveguideQED.jl` follows the same syntax as [`QuantumOptics.jl`](https://qojulia.org/) and operators are defined from a basis. Operators of different Hilbert spaces are then combined using ⊗ (``\otimes``):
22
22
23
-
```@exampletoturial
23
+
```@exampletutorial
24
24
a = destroy(bc)
25
25
ad = create(bc)
26
26
w = destroy(bw)
@@ -33,7 +33,7 @@ nothing #hide
33
33
34
34
With this we can now simulate the scattering of a single photon with a gaussian wavefunction scattered on a cavity. We define the initial state as waveguide state as:
Assuming the cavity is empty the combined initial state is then:
44
44
45
-
```@exampletoturial
45
+
```@exampletutorial
46
46
ψ_in = fockstate(bc,0) ⊗ ψ_waveguide
47
47
nothing #hide
48
48
```
49
49
50
50
With the initial state we can then call the solver the get the wavefunction after the interaction with the cavity.
51
51
52
-
```@exampletoturial
52
+
```@exampletutorial
53
53
ψ_out = waveguide_evolution(times,ψ_in,H)
54
54
nothing #hide
55
55
```
56
56
57
57
Plotting the wavefunction and its norm square gives:
58
58
59
-
```@exampletoturial
59
+
```@exampletutorial
60
60
using PyPlot
61
61
viewed_state = OnePhotonView(ψ_out)
62
62
fig,ax = subplots(1,2,figsize=(9,4.5))
@@ -79,7 +79,7 @@ We see that the wavefunction has changed after the interaction with the cavity.
79
79
80
80
In the previous example, only the state at the final timestep was shown. This shows the output wavefunction, but one might also be interested in intermediate states or expectation values. Expectation values can be outputtet from the solver by using the `fout` keyword. As an example, we can get the number of photons in the cavity as a function of time by:
81
81
82
-
```@exampletoturial
82
+
```@exampletutorial
83
83
n = (ad*a) ⊗ identityoperator(bw)
84
84
function exp_na(time,psi)
85
85
expect(n,psi)
@@ -90,7 +90,7 @@ nothing #hide
90
90
91
91
If we also want to know the number of photons in the waveguide state as a function of time another operator to out expectation function as:
0 commit comments