compas / grasp

General Relativistic Atomic Structure Package
https://compas.github.io/grasp/
MIT License
56 stars 25 forks source link

bug in the generation of csf's using rcsfgenerate #26

Open jongrumer opened 4 years ago

jongrumer commented 4 years ago

@gaigalas found a serious bug in rcsfgenerate:

Email from Gediminas [2019-10-18] It seems that there are some bug in the rcsfgenerate program.

Here is the scripts for rcsfgenerate program:

*
5
4f(11,10)6s(1,*)

6s, 6p, 4d, 4f
18,18
2
n

and script for old csl program

y
1s 2s 2p 3s 3p 3d 4s 4p 4d 5s 5p
4f 6s 6p
n
y
4f(10)
4f(11)6s(1)
9

2

The csl program reproduce 43 CSFs. This is correct. But rcsfgenerate reproduce 292 CSFs. This is NOT CORRECT !!! because we have 9 electrons in the 4f shell (we was asking for minimum 10 electrons).

Please be very careful with the using rcsfgenerate program for investigation of lanthanides !!!

jongrumer commented 4 years ago

Email from @cffischer [2019-10-29]

I think the error has to do with the 2-character digit for the minimum occupation of the 4f shell. If you run the case for 4f(10,9) instead of 4f(11,10), everything is fine. I noticed that the code is written at the basic character level, so a special procedure is need for 2-digit numbers versus a one-digit number.

mortenpi commented 4 years ago

If necessary, AtomicLevels can easily generate the CSLs for comparison & testing various argument combinations. E.g.:

using AtomicLevels
term(c::CSF) = last(c.terms)
# reference configuration:
configuration = c"4f11 6s"
# generate all configurations SD substitutions away, but require min. 10 electrons on 4f
cs = excited_configurations(configuration, o"6p"; min_occupancy=[10, 0])
# convert from non-relativistic to relativistic configurations
rcs = relconfigurations(cs)
# generate CSFs and filter down to J = 9
rcsfs = filter(c -> term(c) == 9, csfs(rcs))
display(rcsfs)

yields

43-element Array{CSF{RelativisticOrbital{Int64},HalfIntegers.Half{Int64},HalfIntegers.Half{Int64}},1}:
 4f-⁵(5/2|5/2) 4f⁶(6|17/2) 6s(1/2|9)-               
 4f-⁶(0|0) 4f⁴(8|8) 6s(1/2|17/2) 6p-(1/2|9)-        
 4f-⁵(5/2|5/2) 4f⁵(11/2|8) 6s(1/2|17/2) 6p-(1/2|9)-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|17/2) 6p(3/2|9)-  
 4f-⁵(5/2|5/2) 4f⁵(15/2|9) 6s(1/2|17/2) 6p(3/2|9)-  
 4f-⁵(5/2|5/2) 4f⁵(15/2|9) 6s(1/2|19/2) 6p(3/2|9)-  
 4f-⁵(5/2|5/2) 4f⁵(15/2|10) 6s(1/2|19/2) 6p(3/2|9)- 
 4f-⁵(5/2|5/2) 4f⁵(15/2|10) 6s(1/2|21/2) 6p(3/2|9)- 
 4f-⁴(2|2) 4f⁶(6|7) 6s(1/2|15/2) 6p(3/2|9)-         
 4f-⁴(2|2) 4f⁶(6|8) 6s(1/2|15/2) 6p(3/2|9)-         
 4f-⁴(2|2) 4f⁶(6|8) 6s(1/2|17/2) 6p(3/2|9)-         
 4f-⁴(4|4) 4f⁶(4|7) 6s(1/2|15/2) 6p(3/2|9)-         
 4f-⁴(4|4) 4f⁶(4|8) 6s(1/2|15/2) 6p(3/2|9)-         
 4f-⁴(4|4) 4f⁶(4|8) 6s(1/2|17/2) 6p(3/2|9)-         
 4f-⁴(4|4) 4f⁶(6|7) 6s(1/2|15/2) 6p(3/2|9)-         
 4f-⁴(4|4) 4f⁶(6|8) 6s(1/2|15/2) 6p(3/2|9)-         
 4f-⁴(4|4) 4f⁶(6|8) 6s(1/2|17/2) 6p(3/2|9)-         
 4f-⁴(4|4) 4f⁶(6|9) 6s(1/2|17/2) 6p(3/2|9)-         
 4f-⁴(4|4) 4f⁶(6|9) 6s(1/2|19/2) 6p(3/2|9)-         
 4f-⁴(4|4) 4f⁶(6|10) 6s(1/2|19/2) 6p(3/2|9)-        
 4f-⁴(4|4) 4f⁶(6|10) 6s(1/2|21/2) 6p(3/2|9)-        
 4f-³(9/2|9/2) 4f⁷(7/2|7) 6s(1/2|15/2) 6p(3/2|9)-   
 4f-³(9/2|9/2) 4f⁷(7/2|8) 6s(1/2|15/2) 6p(3/2|9)-   
 4f-³(9/2|9/2) 4f⁷(7/2|8) 6s(1/2|17/2) 6p(3/2|9)- 
CYChenFudan commented 4 years ago

@jongrumer In master/src/appl/rcsfgenerate90/matain.f90, lines 265 and 315: if (Y(2:2).GE.'1' .AND. Y(2:2).LE.'9') should be replaced with if (Y(2:2).GE.'0' .AND. Y(2:2).LE.'9')

jongrumer commented 4 years ago

This issue is addressed in PR #45