Skip to content

Commit 20ebaf3

Browse files
authored
split up package in an ecosystem (#419)
* QuestBase * make QuestBase package * new HarmonicBalance module * update QuestBase * rm old folders * Make HarmonicSteadyState depending on HarmonicBalance for now * try to get test suite working of HarmonicSteadyState * Make HC wrapper a Module again and declare variables again * woop woop test working * exported QuestBase and HarmonicSteadyState * format * refactor: move get_Jacobian from QuestBase * new QuestBase version * up compat DocStringExtensions * up compat SymbolicUtils * format * CI fail-fast: false * up compat Aqua and JET * refactor: update comment for clarity on future Symbolics.jacobian replacement * bump QuestBase * fix: turn of JET on julia prerelease * start updating docs * empty commit * fix examples * Revert "fix examples" This reverts commit 15e72e8. * Reexport HarmonicSteadyState * limit to julia 1.11 for now * fix state_dependent_perturbation * bump Random dependency to version 1.11.0
1 parent 9e78543 commit 20ebaf3

File tree

88 files changed

+212
-6763
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

88 files changed

+212
-6763
lines changed

.github/workflows/Documentation.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ concurrency:
2323
group: ${{ github.workflow }}-${{ github.ref }}
2424
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
2525

26+
env:
27+
JULIA_NUM_THREADS: 10
28+
2629
jobs:
2730
# Build job
2831
build:
@@ -31,7 +34,7 @@ jobs:
3134
- uses: actions/checkout@v4
3235
- uses: julia-actions/setup-julia@v2
3336
with:
34-
version: 'lts'
37+
version: '1'
3538
- uses: julia-actions/cache@v2
3639
- uses: julia-actions/julia-buildpkg@v1
3740
- uses: julia-actions/julia-docdeploy@v1

.github/workflows/Tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ jobs:
2929
fail-fast: false
3030
matrix:
3131
version:
32-
- 'pre'
33-
- 'lts'
32+
# - 'pre'
33+
# - 'lts'
3434
- '1'
3535
os:
3636
- ubuntu-latest

Project.toml

Lines changed: 33 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,52 @@
11
name = "HarmonicBalance"
22
uuid = "e13b9ff6-59c3-11ec-14b1-f3d2cc6c135e"
33
authors = ["Orjan Ameye <orjan.ameye@hotmail.com>", "Jan Kosata <kosataj@phys.ethz.ch>", "Javier del Pino <jdelpino@phys.ethz.ch>"]
4-
version = "0.14.4"
4+
version = "0.15.0"
55

66
[deps]
7-
BijectiveHilbert = "91e7fc40-53cd-4118-bd19-d7fcd1de2a54"
8-
Distances = "b4f34e82-e78d-54a5-968a-f98e89d6e8f7"
97
DocStringExtensions = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae"
10-
FunctionWrappers = "069b7b12-0de2-55c6-9aab-29f3d0a68a2e"
11-
HomotopyContinuation = "f213a82b-91d6-5c5d-acf7-10f1c761b327"
12-
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
13-
OrderedCollections = "bac558e1-5e72-5ebc-8fee-abe8a469f55d"
8+
HarmonicSteadyState = "1158f75c-a779-4b85-8bfb-8fcf6bf02ced"
149
PrecompileTools = "aea7be01-6a6a-4083-8856-8a6e6704d82a"
15-
Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"
16-
ProgressMeter = "92933f4c-e287-5a05-a399-4b506db050ca"
10+
QuestBase = "7e80f742-43d6-403d-a9ea-981410111d43"
1711
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
18-
SciMLBase = "0bca4576-84f4-4d90-8ffe-ffa030f20462"
12+
Reexport = "189a3867-3050-52da-a836-e630ba90ab69"
1913
SymbolicUtils = "d1185830-fcd6-423d-90d6-eec64667417b"
2014
Symbolics = "0c5d862f-8b57-4792-8d23-62f2024744c7"
2115

2216
[weakdeps]
23-
LinearSolve = "7ed4a6bd-45f5-4d41-b270-4a48e9bafcae"
2417
ModelingToolkit = "961ee093-0014-501f-94e3-6117800e7a78"
25-
NaNMath = "77ba4419-2d1f-58cd-9bb1-8ffee604a2e3"
26-
OrdinaryDiffEqTsit5 = "b1df2697-797e-41e3-8120-5422d3b24e4a"
27-
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
28-
QuantumCumulants = "35bcea6d-e19f-57db-af74-8011de6c7255"
29-
SteadyStateDiffEq = "9672c7b4-1e72-59bd-8a11-6ac3964bc41f"
3018

3119
[extensions]
3220
ModelingToolkitExt = "ModelingToolkit"
33-
PlotsExt = "Plots"
34-
QuantumCumulantsExt = "QuantumCumulants"
35-
SteadyStateDiffEqExt = "SteadyStateDiffEq"
36-
TimeEvolution = "OrdinaryDiffEqTsit5"
3721

3822
[compat]
39-
BijectiveHilbert = "0.3.0, 0.5"
40-
Distances = "0.10.11"
41-
DocStringExtensions = "0.9.3"
42-
FunctionWrappers = "1.1.3"
43-
HomotopyContinuation = "2.12"
44-
LinearSolve = "2.39.0, 3"
45-
ModelingToolkit = "9.70.0"
46-
NaNMath = "1.1"
47-
OrderedCollections = "1.6"
48-
OrdinaryDiffEqTsit5 = "1.1"
49-
Plots = "1.40.9"
23+
Aqua = "0.8.11"
24+
DocStringExtensions = "0.9.4"
25+
Documenter = "1.4"
26+
ExplicitImports = "1.6"
27+
HarmonicSteadyState = "0.2.0"
28+
JET = "0.9.18"
29+
ModelingToolkit = "9.60"
5030
PrecompileTools = "1.2"
51-
ProgressMeter = "1.7.2"
52-
QuantumCumulants = "0.3.7"
53-
SciMLBase = "2.83.1"
54-
SteadyStateDiffEq = "2.5.0"
55-
SymbolicUtils = "3.25.1"
56-
Symbolics = "~6.34"
57-
julia = "1.10.0"
31+
QuestBase = "0.3.0"
32+
Random = "1.11.0"
33+
Reexport = "1.2.2"
34+
SymbolicUtils = "3.25"
35+
Symbolics = "~6.34.0"
36+
Test = "1.11.0"
37+
julia = "1.11.0"
38+
39+
[extras]
40+
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
41+
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
42+
ExplicitImports = "7d51a73a-1435-4ff3-83d9-f097790105c7"
43+
JET = "c3a54625-cd67-489e-a8e7-0a5a0ff4e31b"
44+
ModelingToolkit = "961ee093-0014-501f-94e3-6117800e7a78"
45+
QuestBase = "7e80f742-43d6-403d-a9ea-981410111d43"
46+
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
47+
SymbolicUtils = "d1185830-fcd6-423d-90d6-eec64667417b"
48+
Symbolics = "0c5d862f-8b57-4792-8d23-62f2024744c7"
49+
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
50+
51+
[targets]
52+
test = ["Aqua", "JET", "SymbolicUtils", "Symbolics", "ExplicitImports", "Test", "Random", "ModelingToolkit", "Documenter", "QuestBase"]

benchmark/3parametron.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ add_harmonic!(dEOM, x, ω)
2323
fixed ==> 1.0, γ => 1e-2, λ => 5e-2, F => 0, α => 1.0, η => 0.3, θ => 0, ψ => 0)
2424
varied = ω => range(0.9, 1.1, 100)
2525

26-
prob = HarmonicBalance.Problem(harmonic_eq)
26+
prob = HarmonicSteadyState.HomotopyContinuationProblem(harmonic_eq)
2727
@btime res = get_steady_states(prob, WarmUp(), varied, fixed; show_progress=false) # 380.126 ms (925069 allocations: 50.84 MiB)
2828
@btime res = get_steady_states(
2929
prob, WarmUp(; compile=true), varied, fixed; show_progress=false

docs/Project.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ DocumenterCitations = "daee34ce-89f3-4625-b898-19384cb65244"
66
DocumenterVitepress = "4710194d-e776-4893-9690-8d956a29c365"
77
FunctionWrappers = "069b7b12-0de2-55c6-9aab-29f3d0a68a2e"
88
HarmonicBalance = "e13b9ff6-59c3-11ec-14b1-f3d2cc6c135e"
9+
HarmonicSteadyState = "1158f75c-a779-4b85-8bfb-8fcf6bf02ced"
910
HomotopyContinuation = "f213a82b-91d6-5c5d-acf7-10f1c761b327"
1011
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
1112
Literate = "98b081ad-f1c9-55d3-8b20-4c87d4299306"
@@ -17,6 +18,7 @@ OrdinaryDiffEqRosenbrock = "43230ef6-c299-4910-a778-202eb28ce4ce"
1718
OrdinaryDiffEqTsit5 = "b1df2697-797e-41e3-8120-5422d3b24e4a"
1819
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
1920
QuantumCumulants = "35bcea6d-e19f-57db-af74-8011de6c7255"
21+
QuestBase = "7e80f742-43d6-403d-a9ea-981410111d43"
2022
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
2123
SteadyStateDiffEq = "9672c7b4-1e72-59bd-8a11-6ac3964bc41f"
2224
StochasticDiffEq = "789caeaf-c7a9-5a7d-9973-96adeb23e2a0"

docs/make.jl

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
CI = get(ENV, "CI", nothing) == "true" || get(ENV, "GITHUB_TOKEN", nothing) !== nothing
22

33
using HarmonicBalance
4+
using HarmonicSteadyState
5+
using QuestBase
46

57
using Documenter
68
using DocumenterVitepress
@@ -11,17 +13,17 @@ using ModelingToolkit
1113
using OrdinaryDiffEqTsit5
1214
using SteadyStateDiffEq
1315

14-
TimeEvolution = Base.get_extension(HarmonicBalance, :TimeEvolution)
16+
TimeEvolution = Base.get_extension(HarmonicSteadyState, :TimeEvolution)
1517
ModelingToolkitExt = Base.get_extension(HarmonicBalance, :ModelingToolkitExt)
16-
SteadyStateDiffEqExt = Base.get_extension(HarmonicBalance, :SteadyStateDiffEqExt)
18+
SteadyStateDiffEqExt = Base.get_extension(HarmonicSteadyState, :SteadyStateDiffEqExt)
1719

1820
bib = CitationBibliography(
1921
joinpath(@__DIR__, "src", "refs.bib");
2022
style=:numeric, # default
2123
)
2224

2325
using Plots
24-
PlotsExt = Base.get_extension(HarmonicBalance, :PlotsExt)
26+
PlotsExt = Base.get_extension(HarmonicSteadyState, :PlotsExt)
2527
default(; fmt=:png)
2628
# Gotta set this environment variable when using the GR run-time on CI machines.
2729
# This happens as examples will use Plots.jl to make plots and movies.
@@ -37,10 +39,12 @@ makedocs(;
3739
authors="Quest group",
3840
modules=[
3941
HarmonicBalance,
42+
QuestBase,
43+
HarmonicSteadyState,
4044
TimeEvolution,
4145
ModelingToolkitExt,
4246
SteadyStateDiffEqExt,
43-
HarmonicBalance.LinearResponse,
47+
HarmonicSteadyState.LinearResponse,
4448
PlotsExt,
4549
],
4650
format=DocumenterVitepress.MarkdownVitepress(;
@@ -58,7 +62,7 @@ makedocs(;
5862
else
5963
[:linkcheck, :cross_references, :missing_docs, :docs_block]
6064
end,
61-
doctest=false, # We test it in the CI, no need to run it here
65+
doctest=false, # We test it in the CI, no need to run it here
6266
plugins=[bib],
6367
)
6468

docs/src/background/stability_response.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,6 @@ The above solution applies to every eigenvalue $\lambda$ of the Jacobian. It is
128128

129129
_Sidenote:_ As $J$ a real matrix, there is an eigenvalue $\lambda_r^*$ for each $\lambda_r$. The maximum number of peaks in the linear response is thus equal to the dimensionality of $\mathbf{u}(T)$.
130130

131-
The linear response of the system in the state $\mathbf{u}_0$ is thus fully specified by the complex eigenvalues and eigenvectors of $J(\mathbf{u}_0)$. In HarmonicBalance.jl, the module [LinearResponse](@ref linresp_man) creates a set of plottable [`Lorentzian`](@ref HarmonicBalance.LinearResponse.Lorentzian) objects to represent this.
131+
The linear response of the system in the state $\mathbf{u}_0$ is thus fully specified by the complex eigenvalues and eigenvectors of $J(\mathbf{u}_0)$. In HarmonicBalance.jl, the module [LinearResponse](@ref linresp_man) creates a set of plottable [`Lorentzian`](@ref HarmonicSteadyState.LinearResponse.Lorentzian) objects to represent this.
132132

133133
[Check out this example](@ref linresp_ex) of the linear response module of HarmonicBalance.jl

docs/src/examples/ab_initio_noise.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
EditURL = "../../../examples/ab_initio_noise.jl"
33
```
44

5-
Ab Initio Noise sidebands and spectra
5+
# Ab Initio Noise sidebands and spectra
66

77
This example demonstrates how to compute the spectra obtained from probing the system with noisy probe.
88

@@ -94,9 +94,7 @@ We will perform parameter sweep to generate noise spectra across the driving fre
9494

9595
````@example ab_initio_noise
9696
setter! = setp(sdesystem, ω)
97-
prob_func(prob, i, repeat) = (prob′ = remake(prob);
98-
setter!(prob′, ωrange[i]);
99-
prob′)
97+
prob_func(prob, i, repeat) = (prob′=remake(prob); setter!(prob′, ωrange[i]); prob′)
10098
output_func(sol, i) = (outputpsd(sol), false)
10199
prob_ensemble = EnsembleProblem(sdeproblem; prob_func=prob_func, output_func=output_func)
102100
sol_ensemble = solve(

docs/src/examples/cumulants_KPO.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ To compute the steady states of the KPO, we use `HarmonicBalance`. We define the
3636
````@example cumulants_KPO
3737
fixed = (U => 0.001, κ => 0.002)
3838
varied = (Δ => range(-0.03, 0.03, 100), G => range(1e-5, 0.02, 100))
39-
problem_c1 = HarmonicBalance.Problem(eqs_completed_RWA, param, varied, fixed)
39+
problem_c1 = HarmonicSteadyState.HomotopyContinuationProblem(eqs_completed_RWA, param, varied, fixed)
4040
````
4141

4242
This gives us the phase
@@ -54,7 +54,7 @@ The next order cumulant can be computed by setting the `order` keyword.
5454
ops = [a]
5555
eqs_RWA = meanfield(ops, H_RWA, [a]; rates=[κ], order=2)
5656
eqs_c2 = complete(eqs_RWA)
57-
problem_c2 = HarmonicBalance.Problem(eqs_c2, param, varied, fixed)
57+
problem_c2 = HarmonicSteadyState.HomotopyContinuationProblem(eqs_c2, param, varied, fixed)
5858
````
5959

6060
Which gives us the phase diagram
@@ -69,7 +69,7 @@ However, the phase diagram seems to wrong. Indeed, plotting, the photon number `
6969
````@example cumulants_KPO
7070
fixed = (U => 0.001, κ => 0.002, G => 0.01)
7171
varied = (Δ => range(-0.03, 0.03, 200))
72-
problem_c2 = HarmonicBalance.Problem(eqs_c2, param, varied, fixed)
72+
problem_c2 = HarmonicSteadyState.HomotopyContinuationProblem(eqs_c2, param, varied, fixed)
7373
result = get_steady_states(problem_c2, TotalDegree())
7474
plot(result; y="a⁺aᵣ", class="stable")
7575
````
@@ -92,7 +92,7 @@ eqs_c3 = complete(eqs_RWA)
9292
9393
fixed = (U => 0.001, κ => 0.002, G => 0.01)
9494
varied = (Δ => range(-0.03, 0.03, 50))
95-
problem_c3 = HarmonicBalance.Problem(eqs_c3, param, varied, fixed)
95+
problem_c3 = HarmonicSteadyState.HomotopyContinuationProblem(eqs_c3, param, varied, fixed)
9696
result = get_steady_states(problem_c3, TotalDegree())
9797
classify_solutions!(result, "a⁺aᵣ < 0", "neg photon number");
9898
plot(result; y="a⁺aᵣ", class="stable")

docs/src/examples/state_dependent_perturbation.md

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -228,19 +228,16 @@ harmonic_tmp.equations = HB.Symbolics.substitute(
228228
HB.rearrange_standard(harmonic_normal).equations[1:2], Dict(u2 => ua, v2 => va)
229229
)
230230
harmonic_tmp.parameters = push!(harmonic_tmp.parameters, ua, va)
231-
prob = HarmonicBalance.Problem(harmonic_tmp, varied, fixed)
231+
prob = HarmonicSteadyState.HomotopyContinuationProblem(harmonic_tmp, varied, fixed)
232232
````
233233

234234
We will sweep over the $\omega-\lambda$ plane and substitute the non-zero amplitude solution of the antisymmetric mode into the coupled equations of thesymmetric mode.
235235

236236
````@example state_dependent_perturbation
237237
all_keys = cat(collect(keys(varied)), collect(keys(fixed)); dims=1)
238-
permutation =
239-
first.(
240-
filter(
241-
!isempty, [findall(x -> isequal(x, par), all_keys) for par in prob.parameters]
242-
)
243-
)
238+
permutation = first.(
239+
filter(!isempty, [findall(x -> isequal(x, par), all_keys) for par in prob.parameters])
240+
)
244241
245242
param_ranges = collect(values(varied))
246243
input_array = collect(Iterators.product(param_ranges..., values(fixed)...))

0 commit comments

Comments
 (0)