Skip to content

Commit 09fb8e1

Browse files
authored
fix: cumulant example (#398)
1 parent 228e4e1 commit 09fb8e1

File tree

1 file changed

+5
-12
lines changed

1 file changed

+5
-12
lines changed

examples/cumulants_KPO.jl

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# Let us compare the higher cumulant approximations for the Kerr parametric oscillator (KPO). The KPO is a model for a cavity with a Kerr nonlinearity and a parametric drive after one applied the Rotating Wave approximation. For this we use the `QuantumCumulants` and the `QuantumCumulantsExt` module in `HarmonicBalance`.
44

5-
using QuantumCumulants, HarmonicBalance
5+
using QuantumCumulants, HarmonicBalance, Plots
66

77
# ## first order cumulant
88

@@ -37,7 +37,7 @@ plot_phase_diagram(result; class="stable")
3737
# The next order cumulant can be computed by setting the `order` keyword.
3838

3939
ops = [a]
40-
eqs_RWA = meanfield(ops, H_RWA, Jop; rates=rates, order=2)
40+
eqs_RWA = meanfield(ops, H_RWA, [a]; rates=[κ], order=2)
4141
eqs_c2 = complete(eqs_RWA)
4242
problem_c2 = HarmonicBalance.Problem(eqs_c2, param, varied, fixed)
4343

@@ -52,7 +52,7 @@ fixed = (U => 0.001, κ => 0.002, G => 0.01)
5252
varied ==> range(-0.03, 0.03, 200))
5353
problem_c2 = HarmonicBalance.Problem(eqs_c2, param, varied, fixed)
5454
result = get_steady_states(problem_c2, TotalDegree())
55-
plot(result; y="a⁺aᵣ")
55+
plot(result; y="a⁺aᵣ", class="stable")
5656

5757
# Let us classify the solutions having negative photon numbers. That way we can filter out these solutions.
5858

@@ -64,19 +64,12 @@ plot(result; y="aᵣ", class="stable", not_class="neg photon number")
6464
# Similarly, for third order
6565

6666
ops = [a]
67-
eqs_RWA = meanfield(ops, H_RWA, Jop; rates=rates, order=3)
67+
eqs_RWA = meanfield(ops, H_RWA, [a]; rates=[κ], order=3)
6868
eqs_c3 = complete(eqs_RWA)
69-
problem_c3 = HarmonicBalance.Problem(eqs_c3, param, varied, fixed)
70-
71-
result = get_steady_states(problem_c3, WarmUp())
72-
classify_solutions!(result, "a⁺aᵣ < 0", "neg photon number");
73-
plot_phase_diagram(result; class="stable", clim=(0, 4))
74-
75-
# and for a frequency sweep
7669

7770
fixed = (U => 0.001, κ => 0.002, G => 0.01)
7871
varied ==> range(-0.03, 0.03, 50))
7972
problem_c3 = HarmonicBalance.Problem(eqs_c3, param, varied, fixed)
8073
result = get_steady_states(problem_c3, TotalDegree())
8174
classify_solutions!(result, "a⁺aᵣ < 0", "neg photon number");
82-
plot(result; y="a⁺aᵣ")
75+
plot(result; y="a⁺aᵣ", class="stable")

0 commit comments

Comments
 (0)