Other utilities
Parity
AtomicLevels defines the Parity
type, which is used to represent the parity of atomic states etc.
AtomicLevels.Parity
— Typestruct Parity
Represents 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)
odd
AtomicLevels.@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"
even
The 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) -> Parity
Returns the parity of object
.
JJ to LSJ
AtomicLevels.jj2lsj
— Functionjj2lsj([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⟩