Skip to content

Commit ed7d013

Browse files
authored
build: migrate to Symbolics 7, SymbolicUtils 4 and ModelingToolkitBase (#446)
Migrate to Symbolics 7 and SymbolicUtils 4, and replace the ModelingToolkit weak dependency with ModelingToolkitBase 1. The extension is renamed from ModelingToolkitExt to ModelingToolkitBaseExt accordingly. Raise compat to HarmonicSteadyState 0.5, QuestBase 0.4.1 and OrdinaryDiffEqTsit5 2, and set the minimum Julia version to 1.12. LTS support will be restored in a following patch release. Add regression tests for Krylov-Bogoliubov averaging of second order systems, which Symbolics 7 broke via the new `order` field on `Differential`. Update the documentation and benchmark environments for the new QuantumCumulants and SciML APIs, and grant the benchmark workflow `pull-requests: write` so alert comments can be posted on pull requests.
1 parent 6e2047b commit ed7d013

18 files changed

Lines changed: 180 additions & 75 deletions

.github/codecov.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
coverage:
2+
status:
3+
project:
4+
default:
5+
informational: true
6+
patch:
7+
default:
8+
informational: true
9+
10+
comment: false

.github/workflows/Benchmarks.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ permissions:
3131
actions: write
3232
contents: write
3333
deployments: write
34+
pull-requests: write
3435

3536
jobs:
3637
benchmark:
@@ -40,7 +41,7 @@ jobs:
4041
- uses: actions/checkout@v7
4142
- uses: julia-actions/setup-julia@v3
4243
with:
43-
version: '1'
44+
version: '1.12'
4445
arch: x64
4546
- uses: julia-actions/cache@v3
4647
- name: Run benchmark

.github/workflows/Documentation.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
- uses: actions/checkout@v7
3636
- uses: julia-actions/setup-julia@v3
3737
with:
38-
version: 'lts'
38+
version: '1.12'
3939
- uses: julia-actions/cache@v3
4040
- uses: julia-actions/julia-buildpkg@v1
4141
- uses: julia-actions/julia-docdeploy@v1

.github/workflows/Tests.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,7 @@ jobs:
2929
fail-fast: false
3030
matrix:
3131
version:
32-
- 'lts'
33-
- '1'
32+
- '1.12'
3433
os:
3534
- ubuntu-latest
3635
arch:
@@ -60,4 +59,4 @@ jobs:
6059
files: lcov.info
6160
name: codecov-umbrella
6261
fail_ci_if_error: false
63-
if: ${{ matrix.version == 'lts' }}
62+
if: ${{ matrix.version == '1.12' }}

Project.toml

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

66
[deps]
77
DocStringExtensions = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae"
88
HarmonicSteadyState = "1158f75c-a779-4b85-8bfb-8fcf6bf02ced"
9+
ModelingToolkitBase = "7771a370-6774-4173-bd38-47e70ca0b839"
910
PrecompileTools = "aea7be01-6a6a-4083-8856-8a6e6704d82a"
1011
QuestBase = "7e80f742-43d6-403d-a9ea-981410111d43"
1112
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
1213
Reexport = "189a3867-3050-52da-a836-e630ba90ab69"
1314
SymbolicUtils = "d1185830-fcd6-423d-90d6-eec64667417b"
1415
Symbolics = "0c5d862f-8b57-4792-8d23-62f2024744c7"
1516

16-
[weakdeps]
17-
ModelingToolkit = "961ee093-0014-501f-94e3-6117800e7a78"
18-
1917
[extensions]
20-
ModelingToolkitExt = "ModelingToolkit"
18+
ModelingToolkitBaseExt = "ModelingToolkitBase"
2119

2220
[compat]
2321
Aqua = "0.8.11"
2422
DocStringExtensions = "0.9.4"
2523
Documenter = "1.4"
2624
ExplicitImports = "1.6"
27-
HarmonicSteadyState = "0.4.0"
25+
HarmonicSteadyState = "0.5"
2826
JET = "0.9.18, 0.10"
29-
ModelingToolkit = "10.6.0"
30-
OrdinaryDiffEqTsit5 = "1.1"
27+
ModelingToolkitBase = "1"
28+
OrdinaryDiffEqTsit5 = "2"
3129
PrecompileTools = "1.2"
32-
QuestBase = "0.3.1"
30+
QuestBase = "0.4.1"
3331
Random = "1.10"
3432
Reexport = "1.2.2"
35-
SymbolicUtils = "3.25"
36-
Symbolics = "6.34.0"
33+
SymbolicUtils = "4"
34+
Symbolics = "7"
3735
Test = "1.10"
38-
julia = "1.10.10, 1.11.9, 1.12.5"
36+
julia = "1.12"
3937

4038
[extras]
4139
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
4240
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
4341
ExplicitImports = "7d51a73a-1435-4ff3-83d9-f097790105c7"
4442
JET = "c3a54625-cd67-489e-a8e7-0a5a0ff4e31b"
45-
ModelingToolkit = "961ee093-0014-501f-94e3-6117800e7a78"
43+
ModelingToolkitBase = "7771a370-6774-4173-bd38-47e70ca0b839"
4644
OrdinaryDiffEqTsit5 = "b1df2697-797e-41e3-8120-5422d3b24e4a"
4745
QuestBase = "7e80f742-43d6-403d-a9ea-981410111d43"
4846
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
@@ -51,4 +49,4 @@ Symbolics = "0c5d862f-8b57-4792-8d23-62f2024744c7"
5149
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
5250

5351
[targets]
54-
test = ["Aqua", "JET", "SymbolicUtils", "Symbolics", "ExplicitImports", "Test", "Random", "ModelingToolkit", "Documenter", "QuestBase", "OrdinaryDiffEqTsit5"]
52+
test = ["Aqua", "JET", "SymbolicUtils", "Symbolics", "ExplicitImports", "Test", "Random", "ModelingToolkitBase", "Documenter", "QuestBase", "OrdinaryDiffEqTsit5"]

benchmarks/Project.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,11 @@ OrdinaryDiffEqRosenbrock = "43230ef6-c299-4910-a778-202eb28ce4ce"
99
OrdinaryDiffEqTsit5 = "b1df2697-797e-41e3-8120-5422d3b24e4a"
1010
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
1111
QuantumCumulants = "35bcea6d-e19f-57db-af74-8011de6c7255"
12+
QuestBase = "7e80f742-43d6-403d-a9ea-981410111d43"
1213
SteadyStateDiffEq = "9672c7b4-1e72-59bd-8a11-6ac3964bc41f"
1314

1415
[compat]
1516
Documenter = "1"
16-
julia = "1.10"
17+
HarmonicSteadyState = "0.5"
18+
QuestBase = "0.4.1"
19+
julia = "1.12"

docs/Project.toml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ FunctionWrappers = "069b7b12-0de2-55c6-9aab-29f3d0a68a2e"
88
HarmonicBalance = "e13b9ff6-59c3-11ec-14b1-f3d2cc6c135e"
99
HarmonicSteadyState = "1158f75c-a779-4b85-8bfb-8fcf6bf02ced"
1010
HomotopyContinuation = "f213a82b-91d6-5c5d-acf7-10f1c761b327"
11+
Latexify = "23fbe1c1-3f47-55db-b15f-69d7ec21a316"
1112
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
1213
Literate = "98b081ad-f1c9-55d3-8b20-4c87d4299306"
1314
ModelingToolkit = "961ee093-0014-501f-94e3-6117800e7a78"
@@ -26,5 +27,6 @@ Symbolics = "0c5d862f-8b57-4792-8d23-62f2024744c7"
2627

2728
[compat]
2829
Documenter = "1"
29-
julia = "1.11"
30-
HarmonicSteadyState = "0.4.0"
30+
julia = "1.12"
31+
HarmonicSteadyState = "0.5"
32+
QuestBase = "0.4.1"

docs/make.jl

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ using OrdinaryDiffEqTsit5
1414
using SteadyStateDiffEq
1515

1616
TimeEvolution = Base.get_extension(HarmonicSteadyState, :TimeEvolution)
17-
ModelingToolkitExt = Base.get_extension(HarmonicBalance, :ModelingToolkitExt)
17+
ModelingToolkitBaseExt = Base.get_extension(HarmonicBalance, :ModelingToolkitBaseExt)
1818
SteadyStateDiffEqExt = Base.get_extension(HarmonicSteadyState, :SteadyStateDiffEqExt)
1919
HarmonicBalanceExt = Base.get_extension(HarmonicSteadyState, :HarmonicBalanceExt)
2020

@@ -23,7 +23,7 @@ bib = CitationBibliography(
2323
style=:numeric, # default
2424
)
2525

26-
using Plots
26+
using Plots, Latexify
2727
PlotsExt = Base.get_extension(HarmonicSteadyState, :PlotsExt)
2828
default(; fmt=:png)
2929
# Gotta set this environment variable when using the GR run-time on CI machines.
@@ -49,16 +49,18 @@ end
4949
makedocs(;
5050
sitename="HarmonicBalance.jl",
5151
authors="Quest group",
52-
modules=[
53-
HarmonicBalance,
54-
QuestBase,
55-
HarmonicSteadyState,
56-
TimeEvolution,
57-
ModelingToolkitExt,
58-
SteadyStateDiffEqExt,
59-
HarmonicSteadyState.LinearResponse,
60-
PlotsExt,
61-
HarmonicBalanceExt,
52+
modules=Module[
53+
m for m in [
54+
HarmonicBalance,
55+
QuestBase,
56+
HarmonicSteadyState,
57+
TimeEvolution,
58+
ModelingToolkitBaseExt,
59+
SteadyStateDiffEqExt,
60+
HarmonicSteadyState.LinearResponse,
61+
PlotsExt,
62+
HarmonicBalanceExt,
63+
] if !isnothing(m)
6264
],
6365
format=DocumenterVitepress.MarkdownVitepress(;
6466
repo="github.com/QuantumEngineeredSystems/HarmonicBalance.jl",

examples/ab_initio_noise.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ plot(freqω, psd; yscale=:log10, xlabel="Frequency", ylabel="Power")
6868

6969
# We will perform parameter sweep to generate noise spectra across the driving frequency $\omega$. For this we use the `EnsembleProblem` API from the SciML ecosystem.
7070
setter! = setp(sdesystem, ω)
71-
prob_func(prob, i, repeat) = (prob′=remake(prob); setter!(prob′, ωrange[i]); prob′)
72-
output_func(sol, i) = (outputpsd(sol), false)
71+
prob_func(prob, ctx) = (prob′=remake(prob); setter!(prob′, ωrange[ctx.sim_id]); prob′)
72+
output_func(sol, ctx) = (outputpsd(sol), false)
7373
prob_ensemble = EnsembleProblem(sdeproblem; prob_func=prob_func, output_func=output_func)
7474
sol_ensemble = solve(
7575
prob_ensemble,

examples/forward_transmission.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ h = hm ⊗ hc # Hilbertspace
1010

1111
@qnumbers m::Destroy(h, 1) c::Destroy(h, 2) # Operators
1212

13-
@rnumbers Δ Vk Ωd γm γk # Parameters
13+
@variables Δ::Real Vk::Real Ωd::Real γm::Real γk::Real # Parameters
1414
param = [Δ, Vk, Ωd, γm, γk]
1515

1616
H_RWA_sym = (

0 commit comments

Comments
 (0)