Skip to content

Commit

Permalink
Add Gamma states to MolecularTermSymbol class
Browse files Browse the repository at this point in the history
  • Loading branch information
xnx committed Feb 2, 2022
1 parent e597d07 commit c56b385
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/pyvalem/states/molecular_term_symbol.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@
"PHI",
"PHIg",
"PHIu",
"Γ",
"Γg",
"Γu",
"GAMMA",
"GAMMAg",
"GAMMAu",
"A",
"A'",
'A"',
Expand Down Expand Up @@ -140,9 +146,13 @@
"PHI": "Φ",
"PHIg": "Φg",
"PHIu": "Φu",
"GAMMA": "Γ",
"GAMMAg": "Γg",
"GAMMAu": "Γu",
}

latex_terms = {"Σ": r"\Sigma", "Π": r"\Pi", "Δ": r"\Delta", "Φ": r"\Phi"}
latex_terms = {"Σ": r"\Sigma", "Π": r"\Pi", "Δ": r"\Delta", "Φ": r"\Phi",
"Γ": r"\Gamma"}

integer = pp.Word(pp.nums)
molecule_Smult = integer.setResultsName("Smult")
Expand Down
12 changes: 12 additions & 0 deletions tests/test_molecular_term_symbol.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,18 @@ def test_greek_letter_conversion(self):
self.assertEqual(str(m3), "3Σ+u")
self.assertEqual(m3.html, "<sup>3</sup>Σ<sup>+</sup><sub>u</sub>")

m3 = MolecularTermSymbol("4GAMMA")
self.assertEqual(m3.Smult, 4)
self.assertEqual(m3.irrep, "Γ")
self.assertEqual(str(m3), "4Γ")
self.assertEqual(m3.html, "<sup>4</sup>Γ")

m3 = MolecularTermSymbol("2GAMMAg")
self.assertEqual(m3.Smult, 2)
self.assertEqual(m3.irrep, "Γg")
self.assertEqual(str(m3), "2Γg")
self.assertEqual(m3.html, "<sup>2</sup>Γ<sub>g</sub>")

m3 = MolecularTermSymbol('A(1A")')
self.assertEqual(str(m3), 'A(1A")')
self.assertEqual(m3.html, 'A<sup>1</sup>A"')
Expand Down

0 comments on commit c56b385

Please sign in to comment.