Skip to content

Store the role of a harmonic variable as a HarmonicKind enum - #97

Merged
oameye merged 2 commits into
mainfrom
refactor/harmonic-kind
Oct 18, 2026
Merged

oameye merged 2 commits into
mainfrom
refactor/harmonic-kind

Conversation

@oameye

@oameye oameye commented Oct 18, 2026 •

Copy link
Copy Markdown
Member

HarmonicVariable now stores its role as a HarmonicKind enum in the field kind, replacing the string field type ("u", "v", "a", "Hopf", ""):

old type HarmonicKind
"u" CosineQuadrature
"v" SineQuadrature
"a" ZeroHarmonic
"Hopf" LimitCycleFrequency
"" Unassigned

kind_label gives the short label used in variable names. coordinate_transform throws an ArgumentError for kinds without an ansatz, instead of a KeyError from a Dict lookup.

HarmonicBalance and HarmonicSteadyState call three helpers, which therefore lose their underscore: create_harmonic_variable, remove_brackets and show_ansatz. show_ansatz(::HarmonicEquation) had runtime dispatch, which a new JET per-feature entry exposed; it is now type-stable.

Breaking, hence version 0.6.0. Merge together with the paired PRs (QuantumEngineeredSystems/HarmonicBalance.jl#539, QuantumEngineeredSystems/HarmonicSteadyState.jl#171), since both downstream packages source QuestBase from main.

Tests: 3452/3452, JET clean. HarmonicBalance 153/153 and HarmonicSteadyState 171/171 against this branch.

The kind field replaces the string type field ("u", "v", "a", "Hopf", "").
create_harmonic_variable, remove_brackets and show_ansatz lose their underscore,
since HarmonicBalance and HarmonicSteadyState use them. Breaking, hence 0.6.0.
@oameye
oameye merged commit a64eeaa into main Oct 18, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant