You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
index space registry: make occupancy predicates robust to non-physical spaces
is_pure_occupied/is_pure_unoccupied/contains_occupied/contains_unoccupied
reduced an index's quantum numbers to physical-particle (spin) attributes and
then looked up the vacuum-(un)occupied space at those qns via a throwing
retrieve. For an index whose reduced qns has no registered occupied space this
threw instead of answering the occupancy question. Two cases motivated this:
- Physical spaces (AO, PAO) span real particle states and are spin-independent,
not spin-less; they must carry the convention's spin_any in the physical
sector. add_ao_spaces/add_pao_spaces registered them with only their LCAO
trait bit (spin bits empty), so physical_particle_attributes() reported no
spin and the occupancy lookup queried a spin flavor with no occupied space.
Fix: add_ao_spaces/add_pao_spaces now take an explicit spin_any parameter
(Spin::null for SpinConvention::Legacy, else Spin::any, matching make_*_spaces)
and register the AO/PAO spaces with spin_any | trait.
- Non-physical auxiliary spaces (density-fitting, batching) legitimately carry
no spin; asking whether they are occupied must answer false, not throw. The
four occupancy predicates now route through non-throwing helpers
(vacuum_occupied_type_or_null / complete_type_or_null /
vacuum_unoccupied_type_or_null) that return a null type when no space is
registered at the reduced qns. Byte-identical for physical inputs.
Update unit-test callers of add_ao_spaces/add_pao_spaces to pass the spin_any
matching each test's registry convention.
0 commit comments