Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ Parameters = "d96e819e-fc66-5662-9728-84c9c7592b0a"
UnicodeFun = "1cfade01-22cf-5700-b092-accc4b62d6e1"
WignerSymbols = "9f57e263-0b3d-5e2e-b1be-24f2bb48858b"

[weakdeps]
PeriodicTable = "7b2266bf-644c-5ea3-82d8-af4bbd25a884"

[extensions]
PeriodicTableExt = "PeriodicTable"

[compat]
BlockArrays = "1"
BlockBandedMatrices = "0.8, 0.9, 0.10, 0.11, 0.12, 0.13"
Expand All @@ -22,14 +28,16 @@ FillArrays = "1"
Format = "1.3"
HalfIntegers = "1"
Parameters = "0.12"
PeriodicTable = "1"
UnicodeFun = "0.4"
WignerSymbols = "1, 2"
julia = "1.6"

[extras]
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
PeriodicTable = "7b2266bf-644c-5ea3-82d8-af4bbd25a884"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["Test", "LinearAlgebra", "Random"]
test = ["Test", "LinearAlgebra", "Random", "PeriodicTable"]
13 changes: 13 additions & 0 deletions ext/PeriodicTableExt.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
module PeriodicTableExt

using AtomicLevels
using PeriodicTable

AtomicLevels.Configuration(element::Element) = sort(parse(Configuration{Orbital}, element.el_config))

function AtomicLevels.Configuration(element::Element, states::Vector{Symbol})
config = Configuration(element)
return Configuration(config.orbitals, config.occupancy, states)
end

end
10 changes: 10 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,13 @@ include("couple_terms.jl")
include("csfs.jl")
include("levels.jl")
include("jj2lsj.jl")

using PeriodicTable

@testset "PeriodicTable extension" begin
@test Configuration(elements[:Ne], [:closed, :closed, :closed]) == parse(Configuration{Orbital}, "[Ne]")
c1 = Configuration(elements[:Xe])
c2 = parse(Configuration{Orbital}, "[Xe]")
@test c1.orbitals == c2.orbitals
@test c1.occupancy == c2.occupancy
end