### Install PyValem from source Source: https://github.com/xnx/pyvalem/blob/master/README.rst Alternative installation methods for local source directories. ```bash # either python setup.py install # or python3 -m pip install . ``` -------------------------------- ### Install PyValem via pip Source: https://github.com/xnx/pyvalem/blob/master/README.rst Standard installation command for the PyValem package. ```bash python3 -m pip install pyvalem ``` -------------------------------- ### Install PyValem Source: https://github.com/xnx/pyvalem/blob/master/docs/source/introduction.md Installation commands for the PyValem package via pip or from source. ```bash python3 -m pip install pyvalem ``` ```bash # either python setup.py install # or python3 -m pip install . ``` -------------------------------- ### Install pyvalem in editable mode Source: https://github.com/xnx/pyvalem/blob/master/README.rst Install the package with development dependencies in a virtual environment. ```bash pip install -e .[dev] ``` ```zsh pip install -e .'[dev]' ``` -------------------------------- ### Retrieve HTML Representation of AtomicConfiguration Source: https://github.com/xnx/pyvalem/blob/master/docs/source/states.md Access the html attribute to get a formatted string representation of the configuration. ```pycon >>> print(c2.html) [Ne]3s23d10 ``` -------------------------------- ### Instantiate Reaction Objects Source: https://github.com/xnx/pyvalem/blob/master/docs/source/reaction.md Create Reaction instances using reactant and product strings separated by valid reaction arrows. ```pycon >>> from pyvalem.reaction import Reaction >>> r1 = Reaction('CO + O2 → CO2 + O') >>> r2 = Reaction('CO v=1 + O2 J=2;X(3SIGMA-g) → CO2 + O') >>> r3 = Reaction('HCl + hv -> H+ + Cl + e-') >>> r4 = Reaction('C6H5OH + 7O2 → 6CO2 + 3H2O') ``` -------------------------------- ### Use the Formula class Source: https://github.com/xnx/pyvalem/blob/master/README.rst Instantiate chemical formulas to access properties like charge, mass, and formatted strings. ```pycon >>> from pyvalem.formula import Formula >>> # neutral formulas: >>> Formula('C2H5OH') C2H5OH >>> # isotopes: >>> Formula('(14C)') (14C) >>> # ions >>> [Formula('H3O+'), Formula('(1H)(2H)+'), Formula('Co(H2O)6+2')] [H3O+, (1H)(2H)+, Co(H2O)6+2] >>> # special species >>> [Formula('e-'), Formula('hv')] [e-, hν] >>> # formula attributes: >>> Formula('Ar+2').charge 2 >>> Formula('H2(18O)').html 'H218O' >>> print(Formula('H2(18O)').latex) \mathrm{H}_{2}{}^{18}\mathrm{O} >>> Formula('(235U)').mass 235.04392819 ``` -------------------------------- ### Instantiating KeyValuePair objects Source: https://github.com/xnx/pyvalem/blob/master/docs/source/states.md Create KeyValuePair instances by passing a string in the 'key=value' format. Whitespace is not permitted within the string. ```pycon >>> from pyvalem.states import KeyValuePair >>> kv1 = KeyValuePair('n=1') >>> kv2 = KeyValuePair('|M|=2') >>> kv3 = KeyValuePair('sym=anti') ``` -------------------------------- ### Instantiate StatefulSpecies Source: https://github.com/xnx/pyvalem/blob/master/docs/source/stateful_species.md Create StatefulSpecies objects using a formula string followed by whitespace-delimited or punctuation-delimited quantum states. ```pycon >>> from pyvalem.stateful_species import StatefulSpecies >>> ss1 = StatefulSpecies('HCl v=2 J=0') >>> ss2 = StatefulSpecies('NCO v2+3v1;J=10.5;a(2Σ-g)') >>> ss3 = StatefulSpecies('Ar+ 1s2.2s2.2p5, 2P_3/2') >>> ss4 = StatefulSpecies('CrH 1sigma2.2sigma1.1pi4.3sigma1; 6SIGMA+') ``` -------------------------------- ### Handle configuration labels Source: https://github.com/xnx/pyvalem/blob/master/docs/source/states.md Use lowercase prefixes to distinguish terms with identical S and L values based on parity and energy order. ```pycon >>> from pyvalem.states import AtomicTermSymbol >>> a0 = AtomicTermSymbol('a5D') >>> a1 = AtomicTermSymbol('b5D') >>> a2 = AtomicTermSymbol('z3Po') >>> a3 = AtomicTermSymbol('y3Po') ``` -------------------------------- ### Instantiate AtomicConfiguration Source: https://github.com/xnx/pyvalem/blob/master/docs/source/states.md Create atomic configuration objects using orbital specifiers separated by periods. ```pycon >>> from pyvalem.states import AtomicConfiguration >>> c0 = AtomicConfiguration('1s2') >>> c1 = AtomicConfiguration('1s2.2s2.2p6') >>> c2 = AtomicConfiguration('1s2.2s2.2p6.3s2.3d10') ``` -------------------------------- ### Instantiate DiatomicMolecularConfiguration Source: https://github.com/xnx/pyvalem/blob/master/docs/source/states.md Create configuration objects using orbital strings with symmetry labels and occupancy numbers. ```pycon >>> from pyvalem.states import DiatomicMolecularConfiguration >>> c1 = DiatomicMolecularConfiguration('1σ') >>> c2 = DiatomicMolecularConfiguration('1σu2') >>> c3 = DiatomicMolecularConfiguration('1piu4.1pig3') >>> c4 = DiatomicMolecularConfiguration('1σg2.1σu2.2σg2.2σu2.1πu4.3σg2') ``` -------------------------------- ### Instantiate MolecularTermSymbol Source: https://github.com/xnx/pyvalem/blob/master/docs/source/states.md Demonstrates creating MolecularTermSymbol instances with various term symbol formats. ```pycon >>> from pyvalem.states import MolecularTermSymbol >>> c1 = MolecularTermSymbol('1Σ-') >>> c2 = MolecularTermSymbol('1SIGMA-') >>> c3 = MolecularTermSymbol('3Σ+g') >>> c4 = MolecularTermSymbol('3SIGMA+g') >>> c5 = MolecularTermSymbol('b(4Π_-3/2)') >>> c6 = MolecularTermSymbol("A'(1A1g_0)") >>> c7 = MolecularTermSymbol('A(1A")') ``` -------------------------------- ### Instantiate VibrationalState Source: https://github.com/xnx/pyvalem/blob/master/docs/source/states.md Create vibrational state objects for diatomic or polyatomic molecules using string representations of quanta. ```pycon >>> from pyvalem.states import VibrationalState >>> v0 = VibrationalState('v=0') >>> v1 = VibrationalState('v=*') >>> v2 = VibrationalState('3v2+v3') >>> v3 = VibrationalState('ν1+ν2') >>> v4 = VibrationalState('2v1+3v4') >>> v5 = VibrationalState('2ν1+1ν2+ν3') ``` -------------------------------- ### Execute project tests Source: https://github.com/xnx/pyvalem/blob/master/README.rst Run the test suite from the project root directory using pytest or tox. ```bash # either pytest # or tox ``` -------------------------------- ### Initialize AtomicTermSymbol objects Source: https://github.com/xnx/pyvalem/blob/master/docs/source/states.md Create instances of AtomicTermSymbol using standard LS-coupling notation strings. ```pycon >>> from pyvalem.states import AtomicTermSymbol >>> a0 = AtomicTermSymbol('3P_1') >>> a1 = AtomicTermSymbol('4D') >>> a2 = AtomicTermSymbol('2Po_1/2') ``` -------------------------------- ### DiatomicMolecularConfiguration(config_string) Source: https://github.com/xnx/pyvalem/blob/master/docs/source/states.md Constructor for creating a new diatomic molecular configuration object from a string representation. ```APIDOC ## DiatomicMolecularConfiguration(config_string) ### Description Instantiates a new configuration object representing the electronic state of a diatomic molecule. The input string consists of a sequence of numbered molecular orbitals separated by periods. ### Parameters - **config_string** (string) - Required - A string representing the molecular orbitals (e.g., '1σg2.1σu2'). ### Attributes - **html** (string) - An HTML representation of the configuration with proper subscript and superscript formatting. ### Errors - **DiatomicMolecularConfigurationError** - Raised if an orbital is filled with too many electrons or if an orbital is repeated in the configuration string. ``` -------------------------------- ### Instantiate and Access RotationalState Source: https://github.com/xnx/pyvalem/blob/master/docs/source/states.md Create rotational state objects using J quantum number strings and access the parsed numerical value. ```pycon >>> from pyvalem.states import RotationalState >>> r0 = RotationalState('J=0') >>> r1 = RotationalState('J=3/2') >>> r2 = RotationalState('J=1.5') >>> r3 = RotationalState('J=*') >>> print(r1.J) 1.5 ``` -------------------------------- ### Use the Reaction class Source: https://github.com/xnx/pyvalem/blob/master/README.rst Define chemical reactions and collisional processes, which automatically validate charge and stoichiometry. ```pycon >>> from pyvalem.reaction import Reaction >>> reaction = Reaction('He+2 + H -> He+ 3p1 + H+ + hv') >>> reaction He+2 + H → He+ 3p + H+ + hν >>> reaction.html 'He2+ + H → He+ 3p + H+ + hν' >>> print(reaction.latex) \mathrm{He}^{2+} + \mathrm{H} \rightarrow \mathrm{He}^{+} \; 3p + \mathrm{H}^{+} + h\nu ``` -------------------------------- ### Access HTML representation Source: https://github.com/xnx/pyvalem/blob/master/docs/source/states.md Retrieve the HTML-formatted string for a configuration object using the html attribute. ```pycon >>> print(c3.html) 1πu4.1πg3 >>> print(c4.html) 1σg2.1σu2.2σg2.2σu2.1πu4.3σg2 ``` -------------------------------- ### Manage Stateful Species Source: https://github.com/xnx/pyvalem/blob/master/docs/source/introduction.md Work with species that include quantum state information, supporting atomic configurations and term symbols. ```pycon >>> from pyvalem.stateful_species import StatefulSpecies >>> stateful_species = StatefulSpecies('Ne+ 1s2.2s2.2p5; 2P_1/2') >>> stateful_species.formula Ne+ >>> type(stateful_species.formula) >>> stateful_species.states [1s2.2s2.2p5, 2P_1/2] >>> state1, state2 = stateful_species.states >>> type(state1) >>> state1.orbitals [1s2, 2s2, 2p5] >>> type(state2) >>> state2.L, state2.J (1, 0.5) ``` ```pycon >>> print(stateful_species.latex) \mathrm{Ne}^{+} \; 1s^{2}2s^{2}2p^{5} \; {}^{2}\mathrm{P}_{1/2} >>> StatefulSpecies('(52Cr)(1H) 1sigma2.2sigma1.1delta2.1pi2; 6SIGMA+; v=0; J=2').html '52Cr1H 1σ2.2σ1.1δ2.1π2 6Σ+ v=0 J=2' ``` -------------------------------- ### Instantiate GenericExcitedState Source: https://github.com/xnx/pyvalem/blob/master/docs/source/states.md Create generic excited state objects using asterisk notation or numeric prefixes. ```pycon >>> from pyvalem.states import GenericExcitedState >>> x0 = GenericExcitedState('*') >>> x1 = GenericExcitedState('***') >>> x2 = GenericExcitedState('5*') ``` -------------------------------- ### Use Noble Gas Shorthand in AtomicConfiguration Source: https://github.com/xnx/pyvalem/blob/master/docs/source/states.md Specify closed-shell configurations using noble gas symbols in square brackets. ```pycon >>> c2 = AtomicConfiguration('[Ne].3s2.3d10') ``` -------------------------------- ### Generate Stoichiometric Formulas Source: https://github.com/xnx/pyvalem/blob/master/docs/source/formula.md Output the stoichiometric formula in either increasing atomic number order or alphabetical order. ```pycon >>> lys.stoichiometric_formula() 'H14C6N2O2' >>> lys.stoichiometric_formula('alphabetical') 'C6H14N2O2' ``` -------------------------------- ### Calculate Formula Properties Source: https://github.com/xnx/pyvalem/blob/master/docs/source/formula.md Retrieve atomic counts, relative molecular mass, charge, and stoichiometric dictionaries from a Formula object. ```pycon >>> f = Formula('CO3-2') >>> f.natoms 4 >>> round(f.rmm, 3) # relative molecular mass 60.008 >>> f.charge -2 >>> dict(f.atom_stoich) {'C': 1, 'O': 3} >>> lys = Formula('(NH3+)(CH2)4CH(NH2)CO2-') >>> lys.natoms 24 >>> round(lys.rmm, 2) 146.19 >>> lys.charge 0 ``` -------------------------------- ### Generate Formula Representations Source: https://github.com/xnx/pyvalem/blob/master/docs/source/formula.md Access HTML, LaTeX, and URL-safe slug representations of a chemical formula. ```pycon >>> from pyvalem.formula import Formula >>> f = Formula("Co(H2O)6+2") >>> print(f.formula) # or simply print(f) Co(H2O)6+2 >>> print(f.html) Co(H2O)62+ >>> print(f.latex) \mathrm{Co}(\mathrm{H}_{2}\mathrm{O})_{6}^{2+} >>> print(f.slug) Co-_l_H2O_r_6_p2 ``` -------------------------------- ### Compare StatefulSpecies Equality Source: https://github.com/xnx/pyvalem/blob/master/docs/source/stateful_species.md Two StatefulSpecies objects are equal if their formulas and states match, regardless of state order. ```pycon >>> ss5 = StatefulSpecies('CO2 v2+3v1; J=2') >>> ss6 = StatefulSpecies('CO2 J=2; ν2+3ν1') >>> ss5 == ss6 True ``` -------------------------------- ### Represent Chemical Formulas Source: https://github.com/xnx/pyvalem/blob/master/docs/source/introduction.md Instantiate and inspect chemical formulas, including ions, isotopes, and special species. ```pycon >>> from pyvalem.formula import Formula >>> # neutral formulas: >>> Formula('C2H5OH') C2H5OH >>> # isotopes: >>> Formula('(14C)') (14C) >>> # ions >>> [Formula('H3O+'), Formula('(1H)(2H)+'), Formula('Co(H2O)6+2')] [H3O+, (1H)(2H)+, Co(H2O)6+2] >>> # special species >>> [Formula('e-'), Formula('hv')] [e-, hν] >>> # formula attributes: >>> Formula('Ar+2').charge 2 >>> Formula('H2(18O)').html 'H218O' >>> print(Formula('H2(18O)').latex) \mathrm{H}_{2}{}^{18}\mathrm{H}_{2}{}^{18}\mathrm{O} >>> Formula('(235U)').mass 235.04392819 ``` -------------------------------- ### Handle AtomicConfiguration Errors Source: https://github.com/xnx/pyvalem/blob/master/docs/source/states.md Invalid configurations, such as repeated subshells or exceeding electron limits, raise AtomicConfigurationError. ```pycon >>> c3 = AtomicConfiguration('[Ar].3s2') Traceback (most recent call last): ... pyvalem.states.atomic_configuration.AtomicConfigurationError: Repeated subshell in [Ar].3s2 >>> c3 = AtomicConfiguration('1s2.2s2.2p7') Traceback (most recent call last): ... pyvalem.states.atomic_configuration.AtomicConfigurationError: Too many electrons in atomic orbital: 2p7 ``` -------------------------------- ### Access HTML Representation Source: https://github.com/xnx/pyvalem/blob/master/docs/source/reaction.md Retrieve the HTML-formatted string representation of a reaction using the html attribute. ```default >>> print(r2.html) CO v=1 + O2 J=2 X3Σ-g → CO2 + O >>> print(r4.html) C6H5OH + 7O2 → 6CO2 + 3H2O ``` -------------------------------- ### Access VibrationalState HTML Source: https://github.com/xnx/pyvalem/blob/master/docs/source/states.md Retrieve the HTML-formatted string representation of a vibrational state. ```pycon >>> print(v5.html) 2ν1 + ν2 + ν3 ``` -------------------------------- ### Retrieve Isotopic Mass Source: https://github.com/xnx/pyvalem/blob/master/docs/source/formula.md Access the exact mass for isotopically-pure molecules using the mass attribute. ```pycon >>> f = Formula('(1H)(35Cl)+') >>> f.mass 35.9766777262 ``` -------------------------------- ### Formula Class Source: https://github.com/xnx/pyvalem/blob/master/docs/source/formula.md The Formula class is the primary interface for creating and interacting with chemical formula objects. ```APIDOC ## Formula(formula_string) ### Description Instantiates a new Formula object from a chemical formula string. The string supports element symbols, isotopes in parentheses, charge notation (+n/-n), stoichiometry, and bracketed moieties. ### Attributes - **html** (str) - Returns the formula formatted in HTML. - **latex** (str) - Returns the formula formatted in LaTeX. - **slug** (str) - Returns a URL-safe slug representation of the formula. - **natoms** (int) - Returns the total count of atoms in the formula. - **rmm** (float) - Returns the relative molecular mass. - **mass** (float) - Returns the exact mass for isotopes and isotopically-pure molecules. - **charge** (int) - Returns the total species charge. - **atom_stoich** (dict) - Returns a dictionary mapping element symbols to their stoichiometric counts. ### Methods - **stoichiometric_formula(order='atomic_number')** - Returns the stoichiometric formula as a string. The 'order' parameter can be 'atomic_number' (default) or 'alphabetical'. ``` -------------------------------- ### Handle configuration errors Source: https://github.com/xnx/pyvalem/blob/master/docs/source/states.md Invalid configurations, such as exceeding electron capacity or repeating orbitals, raise a DiatomicMolecularConfigurationError. ```pycon >>> c5 = DiatomicMolecularConfiguration('1σ2.2σ2.3σ3') Traceback (most recent call last): ... pyvalem.states.diatomic_molecular_configuration.DiatomicMolecularConfigurationError: Only two electrons allowed in σ orbital, but received 3 >>> c6 = DiatomicMolecularConfiguration('1σ2.2σ2.2σ1') Traceback (most recent call last): ... pyvalem.states.diatomic_molecular_configuration.DiatomicMolecularConfigurationError: Repeated orbitals in 1σ2.2σ2.2σ1 ``` -------------------------------- ### Access HTML Representation Source: https://github.com/xnx/pyvalem/blob/master/docs/source/stateful_species.md Retrieve the HTML-formatted string of the species using the html attribute. ```pycon >>> print(ss4.html) CrH 1σ2.2σ1.1π4.3σ1 6Σ+ ``` -------------------------------- ### Access quantum numbers Source: https://github.com/xnx/pyvalem/blob/master/docs/source/states.md Retrieve the spin (S), orbital (L), and total (J) angular momentum quantum numbers from an initialized symbol. ```pycon >>> a0.S, a0.L, a0.J (1.0, 1, 1.0) >>> a1.S, a1.L, a1.J (1.5, 2, None) >>> a2.S, a2.L, a2.J, a2.parity (0.5, 1, 0.5, 'o') ``` -------------------------------- ### VibrationalState Source: https://github.com/xnx/pyvalem/blob/master/docs/source/states.md Represents molecular vibrational states for diatomic and polyatomic molecules. Initialized with a string representing the vibrational quanta. ```APIDOC ## VibrationalState ### Description Represents molecular vibrational states. Instantiated with a string representing the vibrational excitation (e.g., 'v=n', '3v2+v3', 'v=*'). ### Constructor `VibrationalState(state_string)` ### Attributes - **html** (string) - An HTML representation of the vibrational state. ### Example ```python from pyvalem.states import VibrationalState v = VibrationalState('2ν1+1ν2+ν3') print(v.html) # 2ν1 + ν2 + ν3 ``` ``` -------------------------------- ### Access Formula and States Source: https://github.com/xnx/pyvalem/blob/master/docs/source/stateful_species.md Retrieve the underlying Formula object and the list of parsed State objects. ```pycon >>> print(ss4.formula) CrH >>> print(ss4.states) [1σ2.2σ1.1π4.3σ1, 6Σ+] ``` -------------------------------- ### Validate Reaction Conservation Source: https://github.com/xnx/pyvalem/blob/master/docs/source/reaction.md Reaction objects raise errors if charge or stoichiometry are not conserved during instantiation. ```pycon >>> Reaction('BeH+ + I2 ⇌ BeI + HI') Traceback (most recent call last): ... pyvalem.reaction.ReactionChargeError: Charge not preserved for reaction: BeH+ + I2 ⇌ BeI + HI >>> Reaction('BeH + I2 ⇌ BeI') Traceback (most recent call last): ... pyvalem.reaction.ReactionStoichiometryError: Stoichiometry not preserved for reaction: BeH + I2 ⇌ BeI ``` -------------------------------- ### Generate HTML representation Source: https://github.com/xnx/pyvalem/blob/master/docs/source/states.md Access the html attribute to retrieve a formatted string for web display. ```pycon >>> print(a2.html) 2Po1/2 ``` -------------------------------- ### Access MolecularTermSymbol Attributes Source: https://github.com/xnx/pyvalem/blob/master/docs/source/states.md Shows how to retrieve quantum numbers and labels from a parsed MolecularTermSymbol object. ```pycon >>> c6 = MolecularTermSymbol('X(4Πu_-3/2)') >>> c6.S, c6.term_label, c6.irrep, c6.Omega (1.5, 'X', 'Πu', -1.5) ``` -------------------------------- ### Define Chemical Reactions Source: https://github.com/xnx/pyvalem/blob/master/docs/source/introduction.md Represent collisional processes and reactions, with built-in validation for charge and stoichiometry. ```pycon >>> from pyvalem.reaction import Reaction >>> reaction = Reaction('He+2 + H -> He+ 3p1 + H+ + hv') >>> reaction He+2 + H → He+ 3p + H+ + hν >>> reaction.html 'He2+ + H → He+ 3p + H+ + hν' >>> print(reaction.latex) \mathrm{He}^{2+} + \mathrm{H} \rightarrow \mathrm{He}^{+} \; 3p + \mathrm{H}^{+} + h\nu ``` ```pycon >>> Reaction('(2H) + (3H) -> (4He)') Traceback (most recent call last): ... pyvalem.reaction.ReactionStoichiometryError: Stoichiometry not preserved for reaction: (2H) + (3H) -> (4He) >>> Reaction('e- + Ar -> Ar+ + e-') Traceback (most recent call last): ... pyvalem.reaction.ReactionChargeError: Charge not preserved for reaction: e- + Ar -> Ar+ + e- ``` -------------------------------- ### Validate State Uniqueness Source: https://github.com/xnx/pyvalem/blob/master/docs/source/stateful_species.md StatefulSpecies raises a StatefulSpeciesError if multiple states of the same type are provided. ```pycon >>> StatefulSpecies('N2 J=0;J=1') Traceback (most recent call last): ... pyvalem.stateful_species.StatefulSpeciesError: Multiple states of type RotationalState specified for N2 J=0;J=1 >>> StatefulSpecies('Li 1s2.2s1; 1s2.2p1') Traceback (most recent call last): ... pyvalem.stateful_species.StatefulSpeciesError: Multiple states of type AtomicConfiguration specified for Li 1s2.2p;1s2.2s ``` -------------------------------- ### MolecularTermSymbol Class Source: https://github.com/xnx/pyvalem/blob/master/docs/source/states.md The MolecularTermSymbol class is used to represent and parse molecular electronic term symbols. It supports various symmetry labels and quantum number configurations. ```APIDOC ## Class: MolecularTermSymbol ### Description Represents a molecular electronic term symbol. It parses a string input containing spin multiplicity, orbital angular momentum symmetry, and optional quantum number Ω. ### Constructor `MolecularTermSymbol(term_string)` - **term_string** (str) - The string representation of the term symbol (e.g., '1Σ-', '3Σ+g', 'b(4Π_-3/2)'). ### Attributes - **S** (float) - Total spin angular momentum quantum number. - **term_label** (str) - The label associated with the term symbol. - **irrep** (str) - The electronic orbital angular momentum wave function irreducible representation. - **Omega** (float) - The projection of the total angular momentum along the symmetry axis. - **html** (str) - The HTML representation of the molecular term symbol. ### Example ```python from pyvalem.states import MolecularTermSymbol # Instantiation term = MolecularTermSymbol('X(4Πu_-3/2)') # Accessing attributes print(term.S) # 1.5 print(term.irrep) # 'Πu' print(term.Omega) # -1.5 ``` ``` -------------------------------- ### RotationalState Source: https://github.com/xnx/pyvalem/blob/master/docs/source/states.md Represents the total rotational angular momentum quantum number J for atoms and molecules. ```APIDOC ## RotationalState ### Description Represents the total rotational angular momentum quantum number, J. Instantiated with a string 'J=n' where n is an integer, half-integer, or asterisk notation. ### Constructor `RotationalState(state_string)` ### Attributes - **J** (float) - The parsed value of the rotational quantum number. ### Example ```python from pyvalem.states import RotationalState r = RotationalState('J=3/2') print(r.J) # 1.5 ``` ``` -------------------------------- ### Validate J with the triangle rule Source: https://github.com/xnx/pyvalem/blob/master/docs/source/states.md The class raises an AtomicTermSymbolError if the provided J value violates the |L-S| <= J <= L+S constraint. ```pycon >>> a3 = AtomicTermSymbol('3P_3') Traceback (most recent call last): ... pyvalem.states.atomic_term_symbol.AtomicTermSymbolError: Invalid atomic term symbol: 3P_3 |L-S| <= J <= L+S must be satisfied. ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.