Miscellaneous

EnergyExpressions.coupled_statesFunction
coupled_states(E[; i₀=1])

Find all states coupled by the energy expression E, starting from the state with index i₀. This can be useful to reduce the necessary basis or to generate invariant sets for split-operator propagation.

source
EnergyExpressions.invariant_setsFunction
invariant_sets(E)

Generate a list of all invariant sets, i.e. configurations that are coupled through the matrix elements of E.

Example

julia> E = sparse([1 1 0; 1 1 0; 0 0 1])
3×3 SparseMatrixCSC{Int64, Int64} with 5 stored entries:
 1  1  ⋅
 1  1  ⋅
 ⋅  ⋅  1

julia> invariant_sets(E)
2-element Vector{Vector{Int64}}:
 [1, 2]
 [3]
source