Skip to content

Commit b507a32

Browse files
authored
docs: add forward transmission example and update documentation API (#449)
1 parent f44f796 commit b507a32

File tree

6 files changed

+147
-0
lines changed

6 files changed

+147
-0
lines changed

docs/pages.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ pages = [
2222
"Adiabatic sweep" => "examples/steady_state_sweep.md",
2323
"Quantum Cumulants" => "examples/cumulants_KPO.md",
2424
"KB vs HB method" => "examples/harmonic_oscillator_KB_vs_HB.md",
25+
"Forward Transmission" => "examples/forward_transmission.md",
2526
],
2627
],
2728
"Resources" => [
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
```@meta
2+
EditURL = "../../../examples/forward_transmission.jl"
3+
```
4+
5+
# Linear response and transmission/reflection coeffictients for magnon three-wave mixing
6+
7+
````@example forward_transmission
8+
using HarmonicSteadyState, QuantumCumulants, Plots
9+
````
10+
11+
Consider a model of nonlinear magnon-magnon coupling, as described in [this](https://arxiv.org/abs/2506.11527) paper. The model describes a three-wave mixing interaction between a strongly driven $k=0$ FMR mode and two parametricallly excited propagating modes with opposite momentum $\pm k$ and at half frequency. In this notebook, we will show how the mean-field approximation can be used to calculate steady states, and to calculate the $S_{21}$ transmission coefficient.
12+
13+
````@example forward_transmission
14+
hm = FockSpace(:magnon)
15+
hc = FockSpace(:polariton)
16+
h = hm ⊗ hc # Hilbertspace
17+
18+
@qnumbers m::Destroy(h, 1) c::Destroy(h, 2) # Operators
19+
20+
@rnumbers Δ Vk Ωd γm γk # Parameters
21+
param = [Δ, Vk, Ωd, γm, γk]
22+
23+
H_RWA_sym = (
24+
Δ * m' * m + Δ / 2 * c' * c + Vk * m * c' * c' + Vk * m' * c * c + (Ωd * m + Ωd * m')
25+
)
26+
ops = [m, m', c, c'] # Operators for meanfield evolution
27+
28+
eqs_RWA = meanfield(ops, H_RWA_sym, [m, c]; rates=[γm, γk], order=1)
29+
eqs_completed_RWA = complete(eqs_RWA) # Meanfield equations using QuantumCumulants.jl
30+
````
31+
32+
We can use this meanfield equations to construct a `HarmonicEquation` object in HarmonicSteadyState.jl. In the construction, additional information is computed, such as the Jacobian of the equations, which is used to determine the stability if the the steady states.
33+
34+
````@example forward_transmission
35+
harmonic_eq = HarmonicEquation(eqs_completed_RWA, param)
36+
````
37+
38+
Let's sweep the power of the drive $\Omega_d$, with $\Delta=0$, and solve for the steady state. The steady-state solutions show that the FMR mode saturates after a threshold power, followed by the coherent excitation of the parametrically induced counter-propagating modes.
39+
40+
````@example forward_transmission
41+
drive_range = range(0, 1.8, 100)
42+
fixed = (Δ => 0, Vk => 0.0002, γm => 0.1, γk => 0.01)
43+
varied = (Ωd => drive_range)
44+
result = get_steady_states(harmonic_eq, TotalDegree(), varied, fixed)
45+
46+
plot(plot(result; y="1/sqrt(2)*(mᵣ+ mᵢ)"), plot(result; y="1/sqrt(2)*(cᵣ + cᵢ)"))
47+
48+
# Linear response and S21
49+
````
50+
51+
To find the response of the driven system to a second, weak probe, we use the method described [here](https://quantumengineeredsystems.github.io/HarmonicBalance.jl/stable/background/stability_response#linresp_background). Here, we calculate the response in the same rotating frame as the Hamiltonian. The linear response is related to the scattering parameter $S_{21}$ by
52+
$$S_{21}(\omega)=1-\sqrt{\kappa_{ext}} \chi(\omega),$$
53+
where $\kappa_{ext}$ is the coupling of the system to the measurement apparatus.
54+
55+
The result below shows the characteristic splitting of the magnon resonance above the power threshold, which matches the experiment.
56+
57+
````@example forward_transmission
58+
Ω_range = range(-0.1, 0.1, 500)
59+
χ3 = get_susceptibility(result, 1, Ω_range, 3);
60+
χ1 = get_susceptibility(result, 1, Ω_range, 1);
61+
κ_ext = 0.05
62+
S21_3 = 1 .- χ3 * κ_ext / 2
63+
S21_log_3 = 20 .* log10.(abs.(S21_3)) # expressed in dB
64+
S21_1 = 1 .- χ1 * κ_ext / 2
65+
S21_log_1 = 20 .* log10.(abs.(S21_1)) # expressed in dB
66+
````
67+
68+
Compare the two branches
69+
70+
````@example forward_transmission
71+
stable = get_class(result, 3, "physical")
72+
heatmap(
73+
Ω_range, drive_range, vcat(S21_log_1', S21_log_3'); c=:matter, cbar_title="S21 (dB)"
74+
)
75+
ylabel!("Ω_d")
76+
xlabel!("Probe detuning")
77+
````
78+
79+
---
80+
81+
*This page was generated using [Literate.jl](https://github.com/fredrikekre/Literate.jl).*
82+

docs/src/manual/API.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ Polyhedral
5050

5151
```@docs
5252
get_solutions
53+
get_branches
5354
attractors
5455
phase_diagram
5556
get_single_solution

docs/src/manual/analyse_solutions.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ For plotting, you can extract the solutions using the `get_solutions` function,
88

99
```@docs; canonical=false
1010
get_solutions
11+
get_branches
1112
get_single_solution
1213
```
1314

docs/src/manual/linear_response.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ HarmonicSteadyState.LinearResponse.get_response
5151
eigenvalues
5252
eigenvectors
5353
HarmonicSteadyState.LinearResponse.get_rotframe_jacobian_response
54+
get_susceptibility
55+
get_forward_transmission_response
5456
```
5557

5658
## Plotting

examples/forward_transmission.jl

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# # Linear response and transmission/reflection coeffictients for magnon three-wave mixing
2+
3+
using HarmonicSteadyState, QuantumCumulants, Plots
4+
5+
# Consider a model of nonlinear magnon-magnon coupling, as described in [this](https://arxiv.org/abs/2506.11527) paper. The model describes a three-wave mixing interaction between a strongly driven $k=0$ FMR mode and two parametricallly excited propagating modes with opposite momentum $\pm k$ and at half frequency. In this notebook, we will show how the mean-field approximation can be used to calculate steady states, and to calculate the $S_{21}$ transmission coefficient.
6+
7+
hm = FockSpace(:magnon)
8+
hc = FockSpace(:polariton)
9+
h = hm hc # Hilbertspace
10+
11+
@qnumbers m::Destroy(h, 1) c::Destroy(h, 2) # Operators
12+
13+
@rnumbers Δ Vk Ωd γm γk # Parameters
14+
param = [Δ, Vk, Ωd, γm, γk]
15+
16+
H_RWA_sym = (
17+
Δ * m' * m + Δ / 2 * c' * c + Vk * m * c' * c' + Vk * m' * c * c + (Ωd * m + Ωd * m')
18+
)
19+
ops = [m, m', c, c'] # Operators for meanfield evolution
20+
21+
eqs_RWA = meanfield(ops, H_RWA_sym, [m, c]; rates=[γm, γk], order=1)
22+
eqs_completed_RWA = complete(eqs_RWA) # Meanfield equations using QuantumCumulants.jl
23+
24+
# We can use this meanfield equations to construct a `HarmonicEquation` object in HarmonicSteadyState.jl. In the construction, additional information is computed, such as the Jacobian of the equations, which is used to determine the stability if the the steady states.
25+
harmonic_eq = HarmonicEquation(eqs_completed_RWA, param)
26+
27+
# Let's sweep the power of the drive $\Omega_d$, with $\Delta=0$, and solve for the steady state. The steady-state solutions show that the FMR mode saturates after a threshold power, followed by the coherent excitation of the parametrically induced counter-propagating modes.
28+
29+
drive_range = range(0, 1.8, 100)
30+
fixed ==> 0, Vk => 0.0002, γm => 0.1, γk => 0.01)
31+
varied = (Ωd => drive_range)
32+
result = get_steady_states(harmonic_eq, TotalDegree(), varied, fixed)
33+
34+
plot(plot(result; y="1/sqrt(2)*(mᵣ+ mᵢ)"), plot(result; y="1/sqrt(2)*(cᵣ + cᵢ)"))
35+
36+
## Linear response and S21
37+
38+
# To find the response of the driven system to a second, weak probe, we use the method described [here](https://quantumengineeredsystems.github.io/HarmonicBalance.jl/stable/background/stability_response#linresp_background). Here, we calculate the response in the same rotating frame as the Hamiltonian. The linear response is related to the scattering parameter $S_{21}$ by
39+
# $$S_{21}(\omega)=1-\sqrt{\kappa_{ext}} \chi(\omega),$$
40+
# where $\kappa_{ext}$ is the coupling of the system to the measurement apparatus.
41+
42+
# The result below shows the characteristic splitting of the magnon resonance above the power threshold, which matches the experiment.
43+
44+
Ω_range = range(-0.1, 0.1, 500)
45+
χ3 = get_susceptibility(result, 1, Ω_range, 3);
46+
χ1 = get_susceptibility(result, 1, Ω_range, 1);
47+
κ_ext = 0.05
48+
S21_3 = 1 .- χ3 * κ_ext / 2
49+
S21_log_3 = 20 .* log10.(abs.(S21_3)) # expressed in dB
50+
S21_1 = 1 .- χ1 * κ_ext / 2
51+
S21_log_1 = 20 .* log10.(abs.(S21_1)) # expressed in dB
52+
53+
# Compare the two branches
54+
55+
stable = get_class(result, 3, "physical")
56+
heatmap(
57+
Ω_range, drive_range, vcat(S21_log_1', S21_log_3'); c=:matter, cbar_title="S21 (dB)"
58+
)
59+
ylabel!("Ω_d")
60+
xlabel!("Probe detuning")

0 commit comments

Comments
 (0)