Other utilities
Parity
AtomicLevels defines the Parity type, which is used to represent the parity of atomic states etc.
AtomicLevels.Parity — Typestruct ParityRepresents the parity of a quantum system, taking two possible values: even or odd.
The integer values that correspond to even and odd parity are +1 and -1, respectively. Base.convert can be used to convert integers into Parity values.
julia> convert(Parity, 1)
even
julia> convert(Parity, -1)
oddAtomicLevels.@p_str — MacroThe parity values also define an algebra and an ordering:
julia> p"odd" < p"even"
true
julia> p"even" * p"odd"
odd
julia> (p"odd")^3
odd
julia> -p"odd"
evenThe exported parity function is overloaded for many of the types in AtomicLevels, defining a uniform API to determine the parity of an object.
AtomicLevels.parity — Functionparity(object) -> ParityReturns the parity of object.
JJ to LSJ
AtomicLevels.jj2ℓsj — Functionjj2ℓsj([T=Float64, ]orbs...)Generates the block-diagonal matrix that transforms jj-coupled configurations to lsj-coupled ones.
The blocks correspond to invariant subspaces, which rotate among themselves to form new linear combinations.
They are sorted according to n,ℓ and within the blocks, the columns are sorted according to mⱼ,j (increasing) and the rows according to s,ℓ,m (increasing).
E.g. the p-block will have the following structure:
⟨p;-1,↓|3/2,-3/2⟩ │ ⋅ ⋅ │ ⋅ ⋅ │ ⋅
───────────────────┼────────────────────────────────────────┼────────────────────────────────────┼─────────────────
⋅ │ ⟨p;0,↓|1/2,-1/2⟩ ⟨p;0,↓|3/2,-1/2⟩ │ ⋅ ⋅ │ ⋅
⋅ │ ⟨p;-1,↑|1/2,-1/2⟩ ⟨p;-1,↑|3/2,-1/2⟩ │ ⋅ ⋅ │ ⋅
───────────────────┼────────────────────────────────────────┼────────────────────────────────────┼─────────────────
⋅ │ ⋅ ⋅ │ ⟨p;1,↓|1/2,1/2⟩ ⟨p;1,↓|3/2,1/2⟩ │ ⋅
⋅ │ ⋅ ⋅ │ ⟨p;0,↑|1/2,1/2⟩ ⟨p;0,↑|3/2,1/2⟩ │ ⋅
───────────────────┼────────────────────────────────────────┼────────────────────────────────────┼─────────────────
⋅ │ ⋅ ⋅ │ ⋅ ⋅ │ ⟨p;1,↑|3/2,3/2⟩Angular momentum quantum numbers
AtomicLevels.str2κ — Functionstr2κ(s) -> IntA function to convert the canonical string representation of a $\ell_j$ angular label (i.e. ℓ- or ℓ) into the corresponding $\kappa$ quantum number.
julia> str2κ.(["s", "p-", "p"])
3-element Vector{Int64}:
-1
1
-2AtomicLevels.@κ_str — Macro@κ_str -> IntA string macro to convert the canonical string representation of a $\ell_j$ angular label (i.e. ℓ- or ℓ) into the corresponding $\kappa$ quantum number.
julia> κ"s", κ"p-", κ"p"
(-1, 1, -2)AtomicLevels.κ2ℓ — Functionκ2ℓ(κ::Integer) -> IntegerCalculate the ℓ quantum number corresponding to the κ quantum number.
Note: κ and ℓ values are always integers.
AtomicLevels.κ2j — Functionκ2j(κ::Integer) -> HalfIntegerCalculate the j quantum number corresponding to the κ quantum number.
Note: κ is always an integer, but j will be a half-integer value.
AtomicLevels.ℓj2κ — Functionℓj2κ(ℓ::Integer, j::Real) -> IntegerConverts a valid (ℓ, j) pair to the corresponding κ value.
Note: there is a one-to-one correspondence between valid (ℓ,j) pairs and κ values such that for j = ℓ ± 1/2, κ = ∓(j + 1/2).