JuliaAtoms / AtomicLevels.jl

https://juliaatoms.org/AtomicLevels.jl
Other
12 stars 3 forks source link

Fix regex for orbital parsing in configurations #20

Closed mortenpi closed 5 years ago

mortenpi commented 5 years ago

Adds another set of parentheses to group the n quantum number part properly, fixing #19.

codecov[bot] commented 5 years ago

Codecov Report

Merging #20 into revamp will not change coverage. The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##           revamp      #20   +/-   ##
=======================================
  Coverage   86.43%   86.43%           
=======================================
  Files          16       16           
  Lines         656      656           
=======================================
  Hits          567      567           
  Misses         89       89
Impacted Files Coverage Δ
src/configurations.jl 98.3% <100%> (ø) :arrow_up:

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 22e1845...207ea97. Read the comment docs.

jagot commented 5 years ago
  • Do I understand correctly that instead of an integer, the "n quantum number" could also be a single arbitrary character? Should the class be restricted to something perhaps?

That is correct. The reason I want this is ionization problems, where you'd use a symbol instead of a number for the main quantum number. Common choices are k, k′ (so maybe we should not limit the symbol to one character) if you label by momentum and ε if you label by energy.

  • And the angular part is either (a) a single a-z character, interpreted as the spectroscopic label, or (b) an integer surrounded by square brackets?

Yes, the integer is necessary to represent ℓ values beyond the spdf... string. Of course, you'd be more likely to generate the orbitals yourself programmatically using the Orbital constructor at that point, but to not limit the string macro interface, I thought that was a good way.