Skip to content

Commit 0f69597

Browse files
committed
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.
1 parent 39c7eb7 commit 0f69597

8 files changed

Lines changed: 132 additions & 46 deletions

File tree

SeQuant/core/index_space_registry.hpp

Lines changed: 67 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -905,8 +905,16 @@ class IndexSpaceRegistry {
905905
return false;
906906
}
907907
// this introduces icky dependence on bit footprint of vacuum_occupied_space
908-
if (IS.type().to_int32() <=
909-
vacuum_occupied_space(IS.qns()).type().to_int32()) {
908+
// Reduce qns to physical-particle (e.g. spin) attributes before the
909+
// occupancy lookup: non-particle traits (LCAO/factorization bits) do not
910+
// participate in occupancy. The non-throwing lookup returns a null
911+
// vacuum-occupied type for a non-physical auxiliary space (e.g. a
912+
// density-fitting or batching index that carries no particle/spin
913+
// character), so such a space is reported not pure-occupied rather than
914+
// triggering a throw.
915+
auto const vacocc_type =
916+
vacuum_occupied_type_or_null(physical_particle_attributes(IS.qns()));
917+
if (IS.type().to_int32() <= vacocc_type.to_int32()) {
910918
return true;
911919
} else {
912920
return false;
@@ -938,8 +946,10 @@ class IndexSpaceRegistry {
938946
// Q: would be better to express as IS is a subspace of
939947
// vacuum_unoccupied_space? Then subspaces that are part of neither (this
940948
// is not supposed to happen) will not cause an issue here
949+
// non-throwing lookup: a non-physical auxiliary space yields null
950+
// vacuum-occupied type, so this reports it as (trivially) unoccupied
941951
return !IS.type().intersection(
942-
vacuum_occupied_space(physical_particle_attributes(IS.qns())).type());
952+
vacuum_occupied_type_or_null(physical_particle_attributes(IS.qns())));
943953
}
944954
}
945955

@@ -960,7 +970,10 @@ class IndexSpaceRegistry {
960970

961971
/// @brief some states are fermi vacuum occupied
962972
bool contains_occupied(const IndexSpace& IS) const {
963-
return IS.type().intersection(vacuum_occupied_space(IS.qns()).type()) !=
973+
// non-throwing lookup on physical-particle attributes: a non-physical
974+
// auxiliary space (no particle/spin character) contains no occupied states
975+
return IS.type().intersection(vacuum_occupied_type_or_null(
976+
physical_particle_attributes(IS.qns()))) !=
964977
IndexSpace::Type::null;
965978
}
966979

@@ -981,7 +994,11 @@ class IndexSpaceRegistry {
981994

982995
/// @brief some states are fermi vacuum unoccupied
983996
bool contains_unoccupied(const IndexSpace& IS) const {
984-
return IS.type().intersection(vacuum_unoccupied_space(IS.qns()).type()) !=
997+
// non-throwing lookup on physical-particle attributes: a non-physical
998+
// auxiliary space (no particle/spin character) contains no unoccupied
999+
// states
1000+
return IS.type().intersection(vacuum_unoccupied_type_or_null(
1001+
physical_particle_attributes(IS.qns()))) !=
9851002
IndexSpace::Type::null;
9861003
}
9871004

@@ -1385,6 +1402,51 @@ class IndexSpaceRegistry {
13851402
return bits && !(bits & (bits - 1));
13861403
}
13871404

1405+
/// @brief non-throwing counterpart of `vacuum_occupied_space(qn).type()`
1406+
/// @param qn quantum numbers (typically already reduced to
1407+
/// physical-particle attributes)
1408+
/// @return the vacuum-occupied TYPE registered for @p qn (per-qns override if
1409+
/// present, else the default), or IndexSpace::Type::null when no
1410+
/// occupied space is registered at @p qn -- e.g. a non-physical
1411+
/// auxiliary space (density-fitting, batching) that carries no
1412+
/// particle/spin character, hence no occupancy.
1413+
IndexSpace::Type vacuum_occupied_type_or_null(
1414+
IndexSpace::QuantumNumbers qn) const {
1415+
auto const& qn2type = std::get<1>(vacocc_);
1416+
auto const it = qn2type.find(qn);
1417+
IndexSpace::Type const t =
1418+
(it != qn2type.end()) ? it->second : std::get<0>(vacocc_);
1419+
if (!t) return IndexSpace::Type::null;
1420+
return retrieve_ptr(t, qn) ? t : IndexSpace::Type::null;
1421+
}
1422+
1423+
/// @brief non-throwing counterpart of `complete_space(qn).type()`
1424+
/// @param qn quantum numbers
1425+
/// @return the complete-space TYPE registered for @p qn, or
1426+
/// IndexSpace::Type::null when none is registered at @p qn
1427+
IndexSpace::Type complete_type_or_null(IndexSpace::QuantumNumbers qn) const {
1428+
auto const& qn2type = std::get<1>(complete_);
1429+
auto const it = qn2type.find(qn);
1430+
IndexSpace::Type const t =
1431+
(it != qn2type.end()) ? it->second : std::get<0>(complete_);
1432+
if (!t) return IndexSpace::Type::null;
1433+
return retrieve_ptr(t, qn) ? t : IndexSpace::Type::null;
1434+
}
1435+
1436+
/// @brief non-throwing counterpart of `vacuum_unoccupied_space(qn).type()`
1437+
/// @param qn quantum numbers (typically already reduced to
1438+
/// physical-particle attributes)
1439+
/// @return the vacuum-unoccupied TYPE (complete minus vacuum-occupied) for
1440+
/// @p qn, or IndexSpace::Type::null when no complete space is
1441+
/// registered at @p qn (non-physical auxiliary space)
1442+
IndexSpace::Type vacuum_unoccupied_type_or_null(
1443+
IndexSpace::QuantumNumbers qn) const {
1444+
auto const complete_t = complete_type_or_null(qn);
1445+
if (!complete_t) return IndexSpace::Type::null;
1446+
auto const vacocc_t = vacuum_occupied_type_or_null(qn);
1447+
return complete_t.xOr(vacocc_t).intersection(complete_t);
1448+
}
1449+
13881450
/// @brief find an IndexSpace from its attr. return nullspace if not present.
13891451
/// @param attr the attribute of the IndexSpace
13901452
const IndexSpace& find_by_attr(const IndexSpace::Attr& attr) const {

SeQuant/domain/mbpt/convention.cpp

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -71,30 +71,44 @@ void add_fermi_spin(IndexSpaceRegistry& isr) {
7171
isr = std::move(result);
7272
}
7373

74-
void add_ao_spaces(std::shared_ptr<IndexSpaceRegistry>& isr, bool vbs,
75-
bool abs) {
74+
void add_ao_spaces(std::shared_ptr<IndexSpaceRegistry>& isr,
75+
IndexSpace::QuantumNumbers spin_any, bool vbs, bool abs) {
7676
// matches the MPQC layout, see spindex.h
7777
// this will not work for MR
78+
// AO spaces are physical (spin-specific AOs can support particle states of a
79+
// given spin), so they carry the convention's spin-agnostic quantum numbers
80+
// (spin_any) in the physical (spin) sector alongside the LCAOQNS::ao trait
81+
// bit; leaving the spin bits empty would make physical_particle_attributes()
82+
// report no spin and break occupancy lookups (e.g. is_pure_occupied) that key
83+
// on spin. spin_any matches how make_*_spaces sets the base spaces' spin.
84+
auto const ao_qns = spin_any | LCAOQNS::ao;
7885
auto obs_lcao = isr->retrieve(vbs ? L"m" : L"p");
79-
isr->add(IndexSpace{L"μ", obs_lcao.type(), LCAOQNS::ao}); // OBS AO
86+
isr->add(IndexSpace{L"μ", obs_lcao.type(), ao_qns}); // OBS AO
8087
if (vbs) {
8188
auto vbs_lcao = isr->retrieve(L"e");
82-
isr->add(IndexSpace{L"Α", vbs_lcao.type(), LCAOQNS::ao}) // VBS AO
83-
.add_union(L"Γ", {L"μ", L"Α"}); // VBS+ = OBS + VBS
89+
isr->add(IndexSpace{L"Α", vbs_lcao.type(), ao_qns}) // VBS AO
90+
.add_union(L"Γ", {L"μ", L"Α"}); // VBS+ = OBS + VBS
8491
}
8592
if (abs) {
8693
auto abs_lcao = isr->retrieve(L"α'");
87-
isr->add(IndexSpace{L"σ", abs_lcao.type(),
88-
LCAOQNS::ao}) // ABS AO in F12 methods
94+
isr->add(
95+
IndexSpace{L"σ", abs_lcao.type(), ao_qns}) // ABS AO in F12 methods
8996
.add_union(L"ρ", {L"μ", L"σ"});
9097
if (vbs) // ABS+ = OBS + ABS
9198
isr->add_union(L"Ρ", {L"Γ", L"σ"}); // VABS+ = VBS+ + ABS
9299
}
93100
}
94101

95-
void add_pao_spaces(std::shared_ptr<IndexSpaceRegistry>& isr) {
102+
void add_pao_spaces(std::shared_ptr<IndexSpaceRegistry>& isr,
103+
IndexSpace::QuantumNumbers spin_any) {
96104
auto uocc_space = isr->particle_space(/* nulltype_ok = */ false);
97-
isr->add(IndexSpace{L"μ̃", uocc_space, LCAOQNS::pao}) // OBS PAO
105+
// PAO states are physical (spin-independent, but still particle states), so
106+
// they carry the convention's spin-agnostic quantum numbers (spin_any) in the
107+
// physical (spin) sector alongside the LCAOQNS::pao trait bit; leaving the
108+
// spin bits empty would make physical_particle_attributes() report no spin
109+
// and break occupancy lookups (e.g. is_pure_occupied) that key on spin.
110+
// spin_any matches how make_*_spaces sets the base spaces' spin.
111+
isr->add(IndexSpace{L"μ̃", uocc_space, spin_any | LCAOQNS::pao}) // OBS PAO
98112
;
99113
}
100114

SeQuant/domain/mbpt/convention.hpp

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,13 @@ void add_fermi_spin(IndexSpaceRegistry& isr);
4545
/// @brief add AO spaces to registry
4646

4747
/// @param isr the IndexSpaceRegistry to which add the AO spaces
48+
/// @param spin_any the quantum numbers carried by spin-agnostic physical
49+
/// spaces in the target convention (Spin::null for
50+
/// SpinConvention::Legacy, else Spin::any); AO spaces are physical, so
51+
/// they carry it in the spin sector alongside the LCAOQNS::ao trait bit
4852
/// @param vbs if true, have separate virtual basis
49-
void add_ao_spaces(std::shared_ptr<IndexSpaceRegistry>& isr, bool vbs = false,
53+
void add_ao_spaces(std::shared_ptr<IndexSpaceRegistry>& isr,
54+
IndexSpace::QuantumNumbers spin_any, bool vbs = false,
5055
bool abs = false);
5156

5257
/// @brief add DF spaces to registry
@@ -58,7 +63,12 @@ void add_thc_spaces(std::shared_ptr<IndexSpaceRegistry>& isr);
5863
/// @brief add PAO spaces to registry
5964

6065
/// expects \p isr to have a defined particle space
61-
void add_pao_spaces(std::shared_ptr<IndexSpaceRegistry>& isr);
66+
/// @param spin_any the quantum numbers carried by spin-agnostic physical
67+
/// spaces in the target convention (Spin::null for
68+
/// SpinConvention::Legacy, else Spin::any); PAO spaces are physical, so
69+
/// they carry it in the spin sector alongside the LCAOQNS::pao trait bit
70+
void add_pao_spaces(std::shared_ptr<IndexSpaceRegistry>& isr,
71+
IndexSpace::QuantumNumbers spin_any);
6272

6373
/// @brief add batching spaces to registry
6474
void add_batching_spaces(std::shared_ptr<IndexSpaceRegistry>& isr);

tests/unit/test_canonicalize.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ TEST_CASE("canonicalization", "[algorithms]") {
3434
TensorCanonicalizer::register_instance(
3535
std::make_shared<DefaultTensorCanonicalizer>());
3636
auto isr = sequant::mbpt::make_legacy_spaces();
37-
mbpt::add_pao_spaces(isr);
37+
mbpt::add_pao_spaces(isr, mbpt::Spin::null);
3838
auto ctx = get_default_context();
3939
ctx.set(isr);
4040
auto ctx_resetter = set_scoped_default_context(ctx);
@@ -319,8 +319,8 @@ TEST_CASE("canonicalization", "[algorithms]") {
319319
// intermediate.
320320
{
321321
auto sr_reg = mbpt::make_min_sr_spaces(mbpt::SpinConvention::None);
322-
mbpt::add_pao_spaces(sr_reg); // μ̃ (PAO)
323-
mbpt::add_df_spaces(sr_reg); // Κ (DF aux)
322+
mbpt::add_pao_spaces(sr_reg, mbpt::Spin::any); // μ̃ (PAO)
323+
mbpt::add_df_spaces(sr_reg); // Κ (DF aux)
324324
std::vector<std::wstring> keys;
325325
for (auto const& s : *sr_reg) keys.push_back(s.base_key());
326326
for (auto const& k : keys)

tests/unit/test_eval_btas.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -590,8 +590,8 @@ TEST_CASE("binarize_highorder_aux_hyperindex", "[eval_btas][hyperindex]") {
590590
// register the OBS AO space (μ) and the batching space (z) on top of the
591591
// standard single-reference spaces
592592
auto isr = mbpt::make_sr_spaces();
593-
mbpt::add_ao_spaces(isr); // μ (OBS AO)
594-
mbpt::add_batching_spaces(isr); // z (batching)
593+
mbpt::add_ao_spaces(isr, mbpt::Spin::any); // μ (OBS AO)
594+
mbpt::add_batching_spaces(isr); // z (batching)
595595
auto ctx_resetter =
596596
set_scoped_default_context(Context{get_default_context()}.set(isr));
597597

tests/unit/test_optimize.cpp

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1166,8 +1166,8 @@ TEST_CASE("optimize", "[optimize]") {
11661166
set_scoped_default_context(get_default_context().clone());
11671167
auto reg = get_default_context().mutable_index_space_registry();
11681168
mbpt::add_df_spaces(reg);
1169-
mbpt::add_pao_spaces(reg);
1170-
mbpt::add_ao_spaces(reg);
1169+
mbpt::add_pao_spaces(reg, mbpt::Spin::any);
1170+
mbpt::add_ao_spaces(reg, mbpt::Spin::any);
11711171
// i 10
11721172
// a 40
11731173
// μ̃ 50
@@ -1364,8 +1364,8 @@ TEST_CASE("OSV early-contraction reproducer", "[optimize][osv]") {
13641364
auto ctx_resetter = set_scoped_default_context(get_default_context().clone());
13651365
auto reg = get_default_context().mutable_index_space_registry();
13661366
mbpt::add_df_spaces(reg);
1367-
mbpt::add_pao_spaces(reg);
1368-
mbpt::add_ao_spaces(reg);
1367+
mbpt::add_pao_spaces(reg, mbpt::Spin::any);
1368+
mbpt::add_ao_spaces(reg, mbpt::Spin::any);
13691369
for (auto&& [k, v] :
13701370
std::initializer_list<std::pair<std::wstring_view, size_t>>{
13711371
{L"i", 10}, {L"a", 40}, {L"μ̃", 50}, {L"Κ", 90}}) {
@@ -1421,8 +1421,8 @@ TEST_CASE("OSV early-contraction reproducer (full term #1)",
14211421
auto ctx_resetter = set_scoped_default_context(get_default_context().clone());
14221422
auto reg = get_default_context().mutable_index_space_registry();
14231423
mbpt::add_df_spaces(reg);
1424-
mbpt::add_pao_spaces(reg);
1425-
mbpt::add_ao_spaces(reg);
1424+
mbpt::add_pao_spaces(reg, mbpt::Spin::any);
1425+
mbpt::add_ao_spaces(reg, mbpt::Spin::any);
14261426
for (auto&& [k, v] :
14271427
std::initializer_list<std::pair<std::wstring_view, size_t>>{
14281428
{L"i", 56}, {L"a", 12}, {L"μ̃", 602}, {L"Κ", 1652}}) {
@@ -1475,8 +1475,8 @@ TEST_CASE("OSV deferral reproducer (tetramer term 3)", "[optimize][osv]") {
14751475
auto ctx_resetter = set_scoped_default_context(get_default_context().clone());
14761476
auto reg = get_default_context().mutable_index_space_registry();
14771477
mbpt::add_df_spaces(reg);
1478-
mbpt::add_pao_spaces(reg);
1479-
mbpt::add_ao_spaces(reg);
1478+
mbpt::add_pao_spaces(reg, mbpt::Spin::any);
1479+
mbpt::add_ao_spaces(reg, mbpt::Spin::any);
14801480
for (auto&& [k, v] :
14811481
std::initializer_list<std::pair<std::wstring_view, size_t>>{
14821482
{L"i", 16}, {L"a", 12}, {L"μ̃", 170}, {L"Κ", 472}}) {
@@ -1711,8 +1711,8 @@ TEST_CASE("C60 member-2 double-proto probe", "[optimize][osv][c60]") {
17111711
auto ctx_resetter = set_scoped_default_context(get_default_context().clone());
17121712
auto reg = get_default_context().mutable_index_space_registry();
17131713
mbpt::add_df_spaces(reg);
1714-
mbpt::add_pao_spaces(reg);
1715-
mbpt::add_ao_spaces(reg);
1714+
mbpt::add_pao_spaces(reg, mbpt::Spin::any);
1715+
mbpt::add_ao_spaces(reg, mbpt::Spin::any);
17161716
// C60 cc-pVDZ-F12-ish extents: active occ 120, PNO domain 42, PAO 1800,
17171717
// DF aux 6000 (sliced to batch 30 by the batched objective).
17181718
for (auto&& [k, v] :
@@ -1835,8 +1835,8 @@ TEST_CASE("PPL: form 4-PNO W vs fold-t (peak-neutral, flop tie-break)",
18351835
auto ctx_resetter = set_scoped_default_context(get_default_context().clone());
18361836
auto reg = get_default_context().mutable_index_space_registry();
18371837
mbpt::add_df_spaces(reg);
1838-
mbpt::add_pao_spaces(reg);
1839-
mbpt::add_ao_spaces(reg);
1838+
mbpt::add_pao_spaces(reg, mbpt::Spin::any);
1839+
mbpt::add_ao_spaces(reg, mbpt::Spin::any);
18401840
for (auto&& [k, v] :
18411841
std::initializer_list<std::pair<std::wstring_view, size_t>>{
18421842
{L"i", 16}, {L"a", 12}, {L"μ̃", 170}, {L"Κ", 472}})
@@ -1995,8 +1995,8 @@ TEST_CASE("optimize emits an external batch axis for the PPL term",
19951995
auto ctx_resetter = set_scoped_default_context(get_default_context().clone());
19961996
auto reg = get_default_context().mutable_index_space_registry();
19971997
mbpt::add_df_spaces(reg);
1998-
mbpt::add_pao_spaces(reg);
1999-
mbpt::add_ao_spaces(reg);
1998+
mbpt::add_pao_spaces(reg, mbpt::Spin::any);
1999+
mbpt::add_ao_spaces(reg, mbpt::Spin::any);
20002000
for (auto&& [k, v] :
20012001
std::initializer_list<std::pair<std::wstring_view, size_t>>{
20022002
{L"i", 16}, {L"a", 12}, {L"μ̃", 170}, {L"Κ", 472}})
@@ -2077,8 +2077,8 @@ TEST_CASE("quadratic bubble: early-K integral vs late-K t·(gC)",
20772077
auto ctx_resetter = set_scoped_default_context(get_default_context().clone());
20782078
auto reg = get_default_context().mutable_index_space_registry();
20792079
mbpt::add_df_spaces(reg);
2080-
mbpt::add_pao_spaces(reg);
2081-
mbpt::add_ao_spaces(reg);
2080+
mbpt::add_pao_spaces(reg, mbpt::Spin::any);
2081+
mbpt::add_ao_spaces(reg, mbpt::Spin::any);
20822082
// water-20-scale extents (≈ water-14 OSV extents scaled by 20/14).
20832083
for (auto&& [k, v] :
20842084
std::initializer_list<std::pair<std::wstring_view, size_t>>{
@@ -2287,8 +2287,8 @@ TEST_CASE(
22872287
auto ctx_resetter = set_scoped_default_context(get_default_context().clone());
22882288
auto reg = get_default_context().mutable_index_space_registry();
22892289
mbpt::add_df_spaces(reg);
2290-
mbpt::add_pao_spaces(reg);
2291-
mbpt::add_ao_spaces(reg);
2290+
mbpt::add_pao_spaces(reg, mbpt::Spin::any);
2291+
mbpt::add_ao_spaces(reg, mbpt::Spin::any);
22922292
// water-20-scale extents (matches the "quadratic bubble" test above).
22932293
for (auto&& [k, v] :
22942294
std::initializer_list<std::pair<std::wstring_view, size_t>>{
@@ -2404,8 +2404,8 @@ TEST_CASE("batched DP peak matches oracle with two axes and accumulation",
24042404
auto ctx_resetter = set_scoped_default_context(get_default_context().clone());
24052405
auto reg = get_default_context().mutable_index_space_registry();
24062406
mbpt::add_df_spaces(reg);
2407-
mbpt::add_pao_spaces(reg);
2408-
mbpt::add_ao_spaces(reg);
2407+
mbpt::add_pao_spaces(reg, mbpt::Spin::any);
2408+
mbpt::add_ao_spaces(reg, mbpt::Spin::any);
24092409
for (auto&& [k, v] :
24102410
std::initializer_list<std::pair<std::wstring_view, size_t>>{
24112411
{L"i", 20}, {L"a", 20}, {L"μ̃", 200}, {L"Κ", 300}}) {
@@ -2780,8 +2780,8 @@ TEST_CASE("fast_flops equals flops_of over all bipartitions (parity)",
27802780
auto ctx_resetter = set_scoped_default_context(get_default_context().clone());
27812781
auto reg = get_default_context().mutable_index_space_registry();
27822782
mbpt::add_df_spaces(reg);
2783-
mbpt::add_pao_spaces(reg);
2784-
mbpt::add_ao_spaces(reg);
2783+
mbpt::add_pao_spaces(reg, mbpt::Spin::any);
2784+
mbpt::add_ao_spaces(reg, mbpt::Spin::any);
27852785
for (auto&& [k, v] :
27862786
std::initializer_list<std::pair<std::wstring_view, size_t>>{
27872787
{L"i", 10}, {L"a", 40}, {L"μ̃", 50}, {L"Κ", 90}})

tests/unit/test_space.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ TEST_CASE("index_space", "[elements]") {
209209

210210
SECTION("AO spaces") {
211211
auto isr = sequant::mbpt::make_min_sr_spaces();
212-
REQUIRE_NOTHROW(mbpt::add_ao_spaces(isr));
212+
REQUIRE_NOTHROW(mbpt::add_ao_spaces(isr, mbpt::Spin::any));
213213

214214
// OBS AO space ...
215215
REQUIRE_NOTHROW(isr->retrieve(L"μ"));
@@ -229,7 +229,7 @@ TEST_CASE("index_space", "[elements]") {
229229

230230
SECTION("PAO spaces") {
231231
auto isr = sequant::mbpt::make_min_sr_spaces();
232-
REQUIRE_NOTHROW(mbpt::add_pao_spaces(isr));
232+
REQUIRE_NOTHROW(mbpt::add_pao_spaces(isr, mbpt::Spin::any));
233233

234234
// OBS PAO space ...
235235
REQUIRE_NOTHROW(isr->retrieve(L"μ̃"));

tests/unit/test_tensor_network.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ TEMPLATE_TEST_CASE("tensor_network_shared", "[elements]", TensorNetworkV1,
6262
TensorCanonicalizer::register_instance(
6363
std::make_shared<DefaultTensorCanonicalizer>());
6464
auto isr = sequant::mbpt::make_legacy_spaces();
65-
mbpt::add_pao_spaces(isr);
65+
mbpt::add_pao_spaces(isr, mbpt::Spin::null);
6666
auto ctx = get_default_context();
6767
ctx.set(isr);
6868
ctx.set(Vacuum::SingleProduct);

0 commit comments

Comments
 (0)