Closed jagot closed 5 years ago
This is now dependent on #44 being merged first. The tests are semi-fixed, until excited_configurations
properly accounts for excitation orbital ordering, i.e. does not generate 2p 2p-
and 2p- 2p
(which although being distinct, are not linearly independent).
Merging #38 into master will increase coverage by
0.7%
. The diff coverage is98.91%
.
@@ Coverage Diff @@
## master #38 +/- ##
=========================================
+ Coverage 90.65% 91.35% +0.7%
=========================================
Files 15 15
Lines 749 810 +61
=========================================
+ Hits 679 740 +61
Misses 70 70
Impacted Files | Coverage Δ | |
---|---|---|
src/AtomicLevels.jl | 100% <ø> (+25%) |
:arrow_up: |
src/excited_configurations.jl | 100% <100%> (ø) |
:arrow_up: |
src/orbitals.jl | 94.39% <100%> (+0.05%) |
:arrow_up: |
src/configurations.jl | 98.66% <97.29%> (-0.27%) |
:arrow_down: |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update 2690274...6698541. Read the comment docs.
@mortenpi 3b73488 implements the prioritization of orbitals (the order is first the orbitals in the starting configuration, then the order of the substitution orbitals given) we discussed earlier, but it had the unfortunate side effect of breaking this:
julia> gst = spin_configurations(Configuration(o"1s", 2, :open, sorted=false))[1]
1s₀α 1s₀β
julia> orbitals = reduce(vcat, spin_orbitals.(os"2[s]"))
2-element Array{SpinOrbital{Orbital{Int64}},1}:
2s₀α
2s₀β
julia> cs = excited_configurations(gst, orbitals...)
6-element Array{Configuration{SpinOrbital{Orbital{Int64}}},1}:
1s₀α 1s₀β
1s₀α 2s₀α
1s₀α 2s₀β
1s₀β 2s₀α
1s₀β 2s₀β
2s₀α 2s₀β
The configurations I want, and arguably the reason for this PR, are:
julia> vcat(gst, [replace(gst, gst.orbitals[1]=>o) for o in orbitals], [replace(gst, gst.orbitals[2]=>o) for o in orbitals], Configuration(orbitals, [1,1]))
6-element Array{Configuration{SpinOrbital{Orbital{Int64}}},1}:
1s₀α 1s₀β
2s₀α 1s₀β
2s₀β 1s₀β
1s₀α 2s₀α
1s₀α 2s₀β
2s₀α 2s₀β
i.e., in-place substitution. At the moment, when I need it, I'm doing these replacements anyway, so it is not a dealbreaker, but I wish it could be solved somehow.
For the in-place substitutions: should there just be two different excitation routines? Is it fair to say that (1) in-place excitations generally only work for the fully-qualified (spin-)orbitals, and (2) even then there are cases where you can't uniquely determine what the result should be (I seem to remember something like that vaguely)?
Fair enough, but did you not want the possibility of generating arbitrary CSFs, i.e. with any order of the configurations? Or did that exclude in-place excitations? I.e., do you ever want to generate 3s 2p
starting from 1s 2p
and exciting to 3s
? Or is 2p 3s
"good enough"?
I want the Configuration
and CSF
objects to be able to represent configurations/CSFs with orbitals in any order. That is not related to excitation generation though.
@mortenpi While working on a better implementation for excited_configurations
for SpinOrbital
s, I discovered the following:
julia> excited_configurations(c"[Ne]*", os"3[s-d]"..., keep_parity=false)
22-element Array{Configuration{Orbital{Int64}},1}:
1s² 2s² 2p⁶
1s² 2s² 2p⁵ 3s
1s² 2s² 2p⁵ 3p
1s² 2s² 2p⁵ 3d
1s 2s² 2p⁶ 3s
1s 2s² 2p⁵ 3s²
1s² 2s 2p⁶ 3s
1s² 2s 2p⁵ 3s²
1s² 2s² 2p⁴ 3s²
1s 2s² 2p⁶ 3p
1s 2s² 2p⁵ 3p²
1s² 2s 2p⁶ 3p
1s² 2s 2p⁵ 3p²
1s² 2s² 2p⁴ 3s 3p
1s² 2s² 2p⁴ 3p²
1s 2s² 2p⁶ 3d
1s 2s² 2p⁵ 3d²
1s² 2s 2p⁶ 3d
1s² 2s 2p⁵ 3d²
1s² 2s² 2p⁴ 3s 3d
1s² 2s² 2p⁴ 3p 3d
1s² 2s² 2p⁴ 3d²
i.e., since the core orbitals occur before the substitution orbitals, the former are prioritized over the latter and thus excitation from the core orbitals is not allowed. By specifying the reference set as a sorted configuration, this can be circumvented, as below, but I am not sure if this is what we want.
julia> excited_configurations(c"[Ne]*"s, os"3[s-d]"..., keep_parity=false)
46-element Array{Configuration{Orbital{Int64}},1}:
1s² 2s² 2p⁶
1s 2s² 2p⁶ 3s
1s 2s² 2p⁶ 3p
1s 2s² 2p⁶ 3d
1s² 2s 2p⁶ 3s
1s² 2s 2p⁶ 3p
1s² 2s 2p⁶ 3d
1s² 2s² 2p⁵ 3s
1s² 2s² 2p⁵ 3p
1s² 2s² 2p⁵ 3d
2s² 2p⁶ 3s²
2s² 2p⁶ 3s 3p
2s² 2p⁶ 3s 3d
1s 2s 2p⁶ 3s²
1s 2s 2p⁶ 3s 3p
1s 2s 2p⁶ 3s 3d
1s 2s² 2p⁵ 3s²
1s 2s² 2p⁵ 3s 3p
1s 2s² 2p⁵ 3s 3d
2s² 2p⁶ 3p²
2s² 2p⁶ 3p 3d
1s 2s 2p⁶ 3p²
1s 2s 2p⁶ 3p 3d
1s 2s² 2p⁵ 3p²
1s 2s² 2p⁵ 3p 3d
2s² 2p⁶ 3d²
1s 2s 2p⁶ 3d²
1s 2s² 2p⁵ 3d²
1s² 2p⁶ 3s²
1s² 2p⁶ 3s 3p
1s² 2p⁶ 3s 3d
1s² 2s 2p⁵ 3s²
1s² 2s 2p⁵ 3s 3p
1s² 2s 2p⁵ 3s 3d
1s² 2p⁶ 3p²
1s² 2p⁶ 3p 3d
1s² 2s 2p⁵ 3p²
1s² 2s 2p⁵ 3p 3d
1s² 2p⁶ 3d²
1s² 2s 2p⁵ 3d²
1s² 2s² 2p⁴ 3s²
1s² 2s² 2p⁴ 3s 3p
1s² 2s² 2p⁴ 3s 3d
1s² 2s² 2p⁴ 3p²
1s² 2s² 2p⁴ 3p 3d
1s² 2s² 2p⁴ 3d²
The change was smaller than I anticipated. What remains to be implemented is printing of unsorted spin-configurations:
and maybe if we want to extend the configuration string macro to handle unsorted configurations (e.g.
c"1s2;"
?)