LCOV - code coverage report
Current view: top level - tests - test_state_pair.py (source / functions) Hit Total Coverage
Test: coverage.info Lines: 10 10 100.0 %
Date: 2026-06-16 12:53:10 Functions: 1 1 100.0 %

          Line data    Source code
       1             : # SPDX-FileCopyrightText: 2026 PairInteraction Developers
       2             : # SPDX-License-Identifier: LGPL-3.0-or-later
       3             : 
       4           1 : from __future__ import annotations
       5             : 
       6           1 : from typing import TYPE_CHECKING
       7             : 
       8             : if TYPE_CHECKING:
       9             :     from .utils import PairinteractionModule
      10             : 
      11             : 
      12           1 : def test_state_pair_label(pi_module: PairinteractionModule) -> None:
      13             :     """Test the label of a pair eigenstate."""
      14           1 :     basis_atom = pi_module.BasisAtom("Rb", n=(60, 60), l=(0, 1))
      15           1 :     system_atom = pi_module.SystemAtom(basis_atom).set_electric_field([0, 0, 5], unit="V/cm").diagonalize()
      16           1 :     basis_pair = pi_module.BasisPair([system_atom, system_atom], m=(1, 1))
      17           1 :     system_pair = pi_module.SystemPair(basis_pair).diagonalize()
      18             : 
      19           1 :     state = system_pair.get_eigenbasis().get_state(0)
      20           1 :     expected_label = (
      21             :         "0.77 |Rb:60,S_1/2,1/2; Rb:60,S_1/2,1/2⟩ - 0.34 |Rb:60,P_3/2,1/2; Rb:60,S_1/2,1/2⟩ "
      22             :         "- 0.34 |Rb:60,S_1/2,1/2; Rb:60,P_3/2,1/2⟩ + ..."
      23             :     )
      24             : 
      25           1 :     assert state.get_label() == expected_label

Generated by: LCOV version 1.16