Skip to content

Commit

Permalink
export API of AbstractSymmetryVector
Browse files Browse the repository at this point in the history
- API is: `irreps`, `multiplicities`, `occupation`
  • Loading branch information
thchr committed Sep 13, 2024
1 parent 599b6e3 commit 5e34c7b
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/Crystalline.jl
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ export SymOperation, # types

include("types_symmetry_vectors.jl")
export SymmetryVector, NewBandRep, Collection
export irreps, multiplicities, occupation

include("notation.jl")
export schoenflies, iuc, centering, seitz, mulliken
Expand Down
30 changes: 27 additions & 3 deletions src/types_symmetry_vectors.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,33 @@
abstract type AbstractSymmetryVector{D} <: AbstractVector{Int} end

# ::: API :::
# multiplicities(::AbstractSymmetryVector) --> AbstractVector{<:AbstractVector{Int}}
# irreps(::AbstractSymmetryVector) --> AbstractVector{<:IrrepCollection}
# occupation(::AbstractSymmetryVector) --> Int
"""
irreps(n::AbstractSymmetryVector) -> AbstractVector{<:IrrepCollection}
Return the irreps referenced by `n`.
The returned value is an `AbstractVector` of `IrrepCollection`s, with irreps for distinct
groups and **k**-manifolds belonging to the same `IrrepCollection`.
See also [`multiplicities(::AbstractSymmetryVector)`](@ref).
"""
function irreps(::AbstractSymmetryVector) end

"""
multiplicities(n::AbstractSymmetryVector) -> AbstractVector{<:AbstractVector{Int}}
Return the multiplicities of the irreps referenced by `n`.
See also [`irreps(::AbstractSymmetryVector)`](@ref).
"""
function multiplicities(::AbstractSymmetryVector) end

"""
occupation(n::AbstractSymmetryVector) -> Int
Return the occupation of (i.e., number of bands contained within) `n`.
"""
function occupation(::AbstractSymmetryVector) end

# ::: AbstractArray interface :::
Base.size(n::AbstractSymmetryVector) = (mapreduce(length, +, multiplicities(n)) + 1,)
Expand Down

0 comments on commit 5e34c7b

Please sign in to comment.