Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
84 commits
Select commit Hold shift + click to select a range
ef5faac
feat: initial implementation of OpRegistry
ajay-mk Dec 14, 2025
fc0fe2c
feat: introduce reserved labels and logic in mbpt namespace
ajay-mk Dec 23, 2025
0a2d2f5
refactor: move `OpClass` to op_registry.hpp
ajay-mk Dec 23, 2025
9841bb7
feat: implement more functionalities in `OpRegistry`
ajay-mk Dec 23, 2025
6b3952f
feat: introduce `mbpt::Context::Options`
ajay-mk Dec 23, 2025
fe9e0c1
feat(mbpt::Context): add support for `OpRegistry`
ajay-mk Dec 23, 2025
747c613
feat: add predefined OpRegistries
ajay-mk Dec 23, 2025
305c133
test: add `OpRegistry` unit tests
ajay-mk Dec 23, 2025
3ca9164
test: add `mbpt::Context` unit tests
ajay-mk Dec 23, 2025
f4d6a75
fix: update `mbpt::Context` initialization syntax in SRSO-PNO test case
ajay-mk Dec 23, 2025
081a556
Merge branch 'refs/heads/ajay/fix/mbpt-detail-ambiguity' into ajay/fe…
ajay-mk Dec 23, 2025
bca3e6b
fix: update `mbpt::Context` initialization in more places
ajay-mk Dec 23, 2025
3ab85e5
refactor: change initialization order in `mbpt::Context::Options`
ajay-mk Dec 24, 2025
8c207d9
feat: improve `mbpt::Context` setters, can use Options directly
ajay-mk Dec 24, 2025
1b2910b
feat: introduce `mbpt::to_op_class`
ajay-mk Dec 24, 2025
6ad45b3
feat: remove `OpType` enum and related objects
ajay-mk Dec 24, 2025
207fc59
feat: VEV methods are `OpType` free
ajay-mk Dec 24, 2025
2e78cde
feat: `CC` class is `OpType` free
ajay-mk Dec 24, 2025
453c883
fix(OpParams): default value of order should be 0
ajay-mk Dec 24, 2025
1b018a9
feat: `OpMaker` class is `OpType` free and supports arbitrary perturb…
ajay-mk Dec 24, 2025
9fa190b
feat(Operator): refactor constructors to use OpParams + Op is aware o…
ajay-mk Dec 24, 2025
a8e1a06
feat(to_latex): update the logic in `mbpt::Operator` overload
ajay-mk Dec 24, 2025
1c038fa
feat: move reserved labels and logic to a new header
ajay-mk Dec 24, 2025
557cb5b
feat: add [[nodiscard]] to `OpRegistry` methods
ajay-mk Dec 24, 2025
80662df
feat: add registry checks to built-in operators
ajay-mk Dec 24, 2025
b368b0d
fix: set spinor RDM label in tensor::ev_impl function
ajay-mk Dec 24, 2025
d96bdd2
test: add mbpt::Context setup in main, and fixup SRSO-PNO
ajay-mk Dec 24, 2025
9fd818d
test: update mbpt::Context related test cases
ajay-mk Dec 24, 2025
22e2075
integration: all CC examples set `mbpt::Context` correctly
ajay-mk Dec 24, 2025
dac60f8
integration: set RDM cumulant label in antisymmetrizer example
ajay-mk Dec 24, 2025
0b24f89
test: doc examples set `mbpt::Context` wherever needed
ajay-mk Dec 24, 2025
4499086
fix(RDM): replace optype2label with dedicated labels for RDMs and cum…
ajay-mk Dec 24, 2025
50279c3
fix(reserved): labels return reference to static storage so that view…
ajay-mk Dec 24, 2025
043ac25
test: update H_pt and T_pt calls to include order parameter
ajay-mk Dec 24, 2025
2641e62
fix: update include guards in `reserved.hpp`
ajay-mk Dec 24, 2025
37ec7a2
fix: consistent include style in docs example
ajay-mk Dec 24, 2025
792059e
fix: update namespacing in rdm.cpp, fixup 44990865
ajay-mk Dec 24, 2025
7c90db3
fix(python): Remove OpType from python interface
ajay-mk Dec 24, 2025
bbc8cda
fix: set MBPT context in eval examples
ajay-mk Dec 24, 2025
b1ef138
Merge remote-tracking branch 'refs/remotes/origin/master' into ajay/f…
ajay-mk Dec 25, 2025
66ecb61
feat: `to_op_class` checks if registry is non-empty
ajay-mk Dec 26, 2025
8ef1cb8
feat: `mbpt::Context` manipulation is thread-safe
ajay-mk Dec 26, 2025
f1b4fc6
feat: misc improvements in `OpRegistry`
ajay-mk Dec 26, 2025
1fe1c93
docs: document `OpRegistry` details and usage
ajay-mk Dec 26, 2025
fa54922
refactor: move `decorate_with_pert_order` to `mbpt::detail`
ajay-mk Dec 26, 2025
ed027b0
feat: `OpParams::validate()` checks the value of perturbation order
ajay-mk Dec 26, 2025
68c8932
fix: `Operator::static_equal` checks perturbation order
ajay-mk Dec 26, 2025
382b803
fix(Operator): adjoint preserves order and batching ordinals
ajay-mk Dec 26, 2025
7f8064b
test: extend `predefined` set to include higher-order perturbations
ajay-mk Dec 26, 2025
d714572
refac: move reserved namespace to SQ/core
ajay-mk Dec 28, 2025
c6bb9c7
test(mbpt): enable `REQUIRE_THROWS` cases only if `ASSERT_BEHAVIOUR` …
ajay-mk Dec 28, 2025
40e6366
refac: replace `L"A"` and `L"S"` with reserved labels
ajay-mk Dec 28, 2025
8dd63c5
fix(reserved): update includes and fix guards
ajay-mk Dec 28, 2025
105f85e
fix(op): update `OpParams` docs
ajay-mk Dec 28, 2025
ff02cb9
fix: remove extra fwd declaration
ajay-mk Dec 28, 2025
9ba527a
feat: `mbpt::Context` methods check for nullptrs
ajay-mk Dec 28, 2025
26e76b0
feat: mark `mutable_op_registry` as const in `mbpt::Context`
ajay-mk Dec 28, 2025
9004713
refac: split `to_op_class` implementation
ajay-mk Dec 28, 2025
6d11d83
docs: properly document MBPT Context initialization
ajay-mk Dec 28, 2025
b621a9b
fix: update missing/wrong assertions in operator methods
ajay-mk Dec 28, 2025
b52bc1a
refac(OpRegistry): avoid double map lookup in `to_class`
ajay-mk Dec 28, 2025
52f29fe
refac(OpRegistry): `ops()` return a view of registered operator labels
ajay-mk Dec 28, 2025
d4f0605
refac(reserved): return a const reference for reserved operator labels
ajay-mk Dec 28, 2025
f310939
refac(reserved): move overlap and kronecker labels to reserved.hpp
ajay-mk Dec 30, 2025
38d9c3a
feat(latex): implement support for hat/circumflex `U+0302`.
ajay-mk Dec 31, 2025
e8f3602
feat(reserved): update symm/antisymm labels to have hats
ajay-mk Jan 6, 2026
0e5434a
feat(to_latex): antisymmetrizer tensors will not have bars on them
ajay-mk Jan 6, 2026
6adb9f7
refac: `mbpt::cardinal_tensor_labels` use reserved labels
ajay-mk Jan 6, 2026
0c61873
fix(to_latex): Avoid double hats for `mbpt::Operator` case
ajay-mk Jan 6, 2026
826df37
refac(CC): alias symmetrizer and antisymmetrizer labels for OpConnect…
ajay-mk Jan 6, 2026
f027993
test(eval): eval_{ta,btas} uses `mbpt::cardinal_tensor_labels` for TNC
ajay-mk Jan 6, 2026
2c80297
test(unit): update antisymm/symm labels in canonicalize, mbpt, spin a…
ajay-mk Jan 6, 2026
1411fa7
test(unit/TN): update GraphViz reference output with update antisymme…
ajay-mk Jan 6, 2026
6c672af
test(unit/TN): update antisymmetrizer symbol in TNV3 SRCC reference
ajay-mk Jan 6, 2026
b6a6242
test(unit/TN): update antisymmetrizer symbol and TNV2 SRCC reference
ajay-mk Jan 6, 2026
b91604a
fix(spin): `trace_product` does not assume canonical ordering
ajay-mk Jan 6, 2026
9b139b7
fix(integration/*cc): set cardinal tensor labels in CC examples
ajay-mk Jan 7, 2026
72b08b2
fix(external_interface): replace hardcoded symmetrizer labels with re…
ajay-mk Jan 7, 2026
5ba9ddc
fix(external_interface): update antisymmetrizer symbols in example in…
ajay-mk Jan 7, 2026
8da308a
feat(TNC): introduce default cardinal tensor labels, and set method w…
ajay-mk Jan 7, 2026
207c52f
fix(op): remove antisymmetrizer and symmetrizer labels from `cardinal…
ajay-mk Jan 7, 2026
7de9a47
feat: revert 9b139b7 and f027993. Integration tests should now work w…
ajay-mk Jan 7, 2026
fea1717
fix(ci): Ninja uses only 2 threads
ajay-mk Dec 18, 2025
157f918
refac(TNC): update cardinal tensor label conflict check to compare wi…
ajay-mk Jan 8, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ jobs:
working-directory: ${{github.workspace}}/build
shell: bash
# Execute the build. You can specify a specific target with "--target <NAME>"
run: ccache -p && ccache -z && cmake --build . && ccache -s
run: ccache -p && ccache -z && cmake --build . -j 2 && ccache -s

- name: Test
if: ${{ !matrix.valgrind }}
Expand Down
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,7 @@ set(SeQuant_src
SeQuant/core/utility/tensor.hpp
SeQuant/core/utility/timer.hpp
SeQuant/core/utility/tuple.hpp
SeQuant/core/reserved.hpp
SeQuant/core/wick.hpp
SeQuant/core/wick.impl.hpp
SeQuant/core/wolfram.hpp
Expand All @@ -373,6 +374,8 @@ set(SeQuant_src
SeQuant/domain/mbpt/convention.hpp
SeQuant/domain/mbpt/models/cc.cpp
SeQuant/domain/mbpt/models/cc.hpp
SeQuant/domain/mbpt/op_registry.hpp
SeQuant/domain/mbpt/op_registry.cpp
SeQuant/domain/mbpt/op.cpp
SeQuant/domain/mbpt/op.hpp
SeQuant/domain/mbpt/op.ipp
Expand Down
23 changes: 9 additions & 14 deletions SeQuant/core/expressions/tensor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include <SeQuant/core/hash.hpp>
#include <SeQuant/core/index.hpp>
#include <SeQuant/core/latex.hpp>
#include <SeQuant/core/reserved.hpp>
#include <SeQuant/core/utility/macros.hpp>
#include <SeQuant/core/utility/strong.hpp>

Expand Down Expand Up @@ -516,8 +517,10 @@ class Tensor : public Expr, public AbstractTensor, public MutatableLabeled {
const auto bkst = ctx.braket_slot_typesetting();

// either rank > 1 or sum of bra and ket ranks > 1
const bool add_bar =
bra_rank() == ket_rank() ? rank() > 1 : bra_rank() + ket_rank() > 1;
// and label is not antisymmetrizer label, since it is already implied
bool add_bar =
(bra_rank() == ket_rank() ? rank() > 1 : bra_rank() + ket_rank() > 1) &&
this->label() != reserved::antisymm_label();

std::wstring core_label;
if ((this->symmetry() == Symmetry::Antisymm) && add_bar)
Expand Down Expand Up @@ -809,22 +812,14 @@ static_assert(is_tensor_v<Tensor>,

using TensorPtr = std::shared_ptr<Tensor>;

/// overlap/metric tensor label is reserved since it is used by low-level
/// SeQuant machinery. Users can create overlap Tensor using make_overlap()
inline std::wstring overlap_label() { return L"s"; }

inline ExprPtr make_overlap(const Index &bra_index, const Index &ket_index) {
return ex<Tensor>(Tensor(overlap_label(), bra{bra_index}, ket{ket_index},
aux{}, Tensor::reserved_tag{}));
return ex<Tensor>(Tensor(reserved::overlap_label(), bra{bra_index},
ket{ket_index}, aux{}, Tensor::reserved_tag{}));
}

/// kronecker tensor label is reserved since it is used by low-level
/// SeQuant machinery. Users can create Kronecker Tensor using make_kronecker()
inline std::wstring kronecker_label() { return L"δ"; }

inline ExprPtr make_kronecker(const Index &bra_index, const Index &ket_index) {
return ex<Tensor>(Tensor(kronecker_label(), bra{bra_index}, ket{ket_index},
aux{}, Tensor::reserved_tag{}));
return ex<Tensor>(Tensor(reserved::kronecker_label(), bra{bra_index},
ket{ket_index}, aux{}, Tensor::reserved_tag{}));
}

} // namespace sequant
Expand Down
29 changes: 29 additions & 0 deletions SeQuant/core/latex.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,11 @@ std::basic_string<Char, Traits, Alloc> diactrics_to_latex_impl(
case 0x30C:
append_latex(SQ_STRLIT(Char, "\\check{"));
continue;

// hat/circumflex
case 0x302:
append_latex(SQ_STRLIT(Char, "\\hat{"));
continue;
}
}

Expand Down Expand Up @@ -196,6 +201,30 @@ std::basic_string<Char, Traits, Alloc> diactrics_to_latex_impl(
}
}
} // tilde
{ // circumflex/hat
// lower-case characters with circumflex
const container::map<str_t, str_t> lc = {
{SQ_STRLIT(Char, "â"), SQ_STRLIT(Char, "\\hat{a}")},
{SQ_STRLIT(Char, "ê"), SQ_STRLIT(Char, "\\hat{e}")},
{SQ_STRLIT(Char, "î"), SQ_STRLIT(Char, "\\hat{i}")},
{SQ_STRLIT(Char, "ô"), SQ_STRLIT(Char, "\\hat{o}")}};
auto lc_it = lc.find(str_t{ch});
if (lc_it != lc.end()) {
append(lc_it->second);
} else {
// upper-case characters with circumflex
const container::map<str_t, str_t> uc = {
{SQ_STRLIT(Char, "Â"), SQ_STRLIT(Char, "\\hat{A}")},
{SQ_STRLIT(Char, "Ê"), SQ_STRLIT(Char, "\\hat{E}")},
{SQ_STRLIT(Char, "Î"), SQ_STRLIT(Char, "\\hat{I}")},
{SQ_STRLIT(Char, "Ô"), SQ_STRLIT(Char, "\\hat{O}")},
{SQ_STRLIT(Char, "Ŝ"), SQ_STRLIT(Char, "\\hat{S}")}};
auto uc_it = uc.find(str_t{ch});
if (uc_it != uc.end()) {
append(uc_it->second);
}
}
} // circumflex/hat
}
}

Expand Down
59 changes: 59 additions & 0 deletions SeQuant/core/reserved.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
//
// Created by Ajay Melekamburath on 12/24/25.
//

#ifndef SEQUANT_CORE_RESERVED_HPP
#define SEQUANT_CORE_RESERVED_HPP

#include <range/v3/algorithm/contains.hpp>

#include <array>
#include <string>

namespace sequant {

namespace reserved {
/// @brief returns the reserved label for the antisymmetrization operator
inline const std::wstring& antisymm_label() {
static const std::wstring label = L"Â";

return label;
}

/// @brief returns the reserved label for the symmetrization operator
inline const std::wstring& symm_label() {
static const std::wstring label = L"Ŝ";
return label;
}

/// @brief overlap/metric tensor label is reserved since it is used by low-level
/// SeQuant machinery. Users can create overlap Tensor using make_overlap()
inline const std::wstring& overlap_label() {
static const std::wstring label = L"s";
return label;
}

/// @brief kronecker tensor label is reserved since it is used by low-level
/// SeQuant machinery. Users can create Kronecker Tensor using make_kronecker()
inline const std::wstring& kronecker_label() {
static const std::wstring label = L"δ";
return label;
}

/// @brief returns a list of all reserved operator labels
inline const auto& labels() {
static const std::array reserved{antisymm_label(), symm_label(),
kronecker_label(), overlap_label()};
return reserved;
}

/// @brief checks if a label is not reserved
inline bool is_nonreserved(const std::wstring& label) {
return !ranges::contains(labels(), label);
}

} // namespace reserved

} // namespace sequant

#endif // SEQUANT_CORE_RESERVED_HPP
46 changes: 45 additions & 1 deletion SeQuant/core/tensor_canonicalizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include <SeQuant/core/expr.hpp>
#include <SeQuant/core/index.hpp>
#include <SeQuant/core/meta.hpp>
#include <SeQuant/core/reserved.hpp>
#include <SeQuant/core/tensor_canonicalizer.hpp>

#include <regex>
Expand Down Expand Up @@ -169,12 +170,55 @@ TensorCanonicalizer::instance_map_accessor() {
return std::make_pair(&map_, std::unique_lock<std::recursive_mutex>{mtx_});
}

container::vector<std::wstring>&
TensorCanonicalizer::default_cardinal_tensor_labels_accessor() {
// {antisymm_label, symm_label} is the default
static container::vector<std::wstring> default_ctlabels_{
reserved::antisymm_label(), reserved::symm_label()};
return default_ctlabels_;
}

container::vector<std::wstring>&
TensorCanonicalizer::cardinal_tensor_labels_accessor() {
static container::vector<std::wstring> ctlabels_;
static container::vector<std::wstring> ctlabels_ =
default_cardinal_tensor_labels_accessor();
return ctlabels_;
}

void TensorCanonicalizer::set_cardinal_tensor_labels(
const container::vector<std::wstring>& labels) {
// check for duplicates
#ifdef SEQUANT_ASSERT_ENABLED
// check for duplicates within user provided labels
auto sorted_labels = labels;
ranges::sort(sorted_labels);
auto duplicate = ranges::adjacent_find(sorted_labels);
SEQUANT_ASSERT(duplicate == sorted_labels.end() &&
"cardinal tensor labels must not contain duplicates");

// check if any label conflicts with existing ones
const auto& existing = cardinal_tensor_labels_accessor();
for (const auto& label : labels) {
auto conflict = ranges::find(existing, label);
SEQUANT_ASSERT(conflict == existing.end() &&
"cardinal tensor labels must not contain duplicates");
}
#endif
auto& ctlabels = cardinal_tensor_labels_accessor();
// get defaults
ctlabels = default_cardinal_tensor_labels_accessor();
// append
ctlabels.insert(ctlabels.end(), labels.begin(), labels.end());
}

void TensorCanonicalizer::reset_cardinal_tensor_labels() {
cardinal_tensor_labels_accessor() = default_cardinal_tensor_labels_accessor();
}

void TensorCanonicalizer::clear_all_cardinal_tensor_labels() {
cardinal_tensor_labels_accessor().clear();
}

std::shared_ptr<TensorCanonicalizer>
TensorCanonicalizer::nondefault_instance_ptr(std::wstring_view label) {
auto&& [map_ptr, lock] = instance_map_accessor();
Expand Down
18 changes: 14 additions & 4 deletions SeQuant/core/tensor_canonicalizer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,20 @@ class TensorCanonicalizer {
return cardinal_tensor_labels_accessor();
}

/// @param labels a list of Tensor labels with lexicographic
/// @brief Sets cardinal tensor labels by appending to defaults
/// @param labels a list of additional Tensor labels with lexicographic
/// preference (in order)
/// @note The default labels are always prepended to the provided labels
/// @note To restore defaults only, use reset_cardinal_tensor_labels()
static void set_cardinal_tensor_labels(
const container::vector<std::wstring>& labels) {
cardinal_tensor_labels_accessor() = labels;
}
const container::vector<std::wstring>& labels);

/// @brief Resets cardinal tensor labels to default values only
static void reset_cardinal_tensor_labels();

/// @brief Clears all cardinal tensor labels including defaults (sets to empty
/// list)
static void clear_all_cardinal_tensor_labels();

/// @return a side effect of canonicalization (e.g. phase), or nullptr if none
/// @internal what should be returned if canonicalization requires
Expand Down Expand Up @@ -122,6 +130,8 @@ class TensorCanonicalizer {
std::unique_lock<std::recursive_mutex>>
instance_map_accessor(); // map* + locked recursive mutex
static container::vector<std::wstring>& cardinal_tensor_labels_accessor();
static container::vector<std::wstring>&
default_cardinal_tensor_labels_accessor();
};

/// @brief null Tensor canonicalizer does nothing
Expand Down
5 changes: 3 additions & 2 deletions SeQuant/core/utility/expr.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include <SeQuant/core/container.hpp>
#include <SeQuant/core/expr.hpp>
#include <SeQuant/core/reserved.hpp>
#include <SeQuant/core/utility/expr.hpp>
#include <SeQuant/core/utility/indices.hpp>
#include <SeQuant/core/utility/macros.hpp>
Expand Down Expand Up @@ -386,8 +387,8 @@ bool is_valid(const ResultExpr &expr, std::string *msg) {
// We need to make sure to remove any symmetrizers from the expression in
// order to not mess up the determination of external indices
ExprPtr rhs = expr.expression().clone();
pop_tensor(rhs, L"A");
pop_tensor(rhs, L"S");
pop_tensor(rhs, reserved::antisymm_label());
pop_tensor(rhs, reserved::symm_label());

IndexGroups<> externals = get_unique_indices(rhs);

Expand Down
6 changes: 4 additions & 2 deletions SeQuant/core/utility/indices.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include <SeQuant/core/expr.hpp>
#include <SeQuant/core/index.hpp>
#include <SeQuant/core/op.hpp>
#include <SeQuant/core/reserved.hpp>
#include <SeQuant/core/utility/macros.hpp>

#include <range/v3/view.hpp>
Expand Down Expand Up @@ -462,8 +463,9 @@ Container external_indices(const Expr& expr) {
std::optional<Tensor> symmetrizer;
expr.visit(
[&](const ExprPtr& expr) {
if (expr.is<Tensor>() && (expr.as<Tensor>().label() == L"S" ||
expr.as<Tensor>().label() == L"A")) {
if (expr.is<Tensor>() &&
(expr.as<Tensor>().label() == reserved::symm_label() ||
expr.as<Tensor>().label() == reserved::antisymm_label())) {
SEQUANT_ASSERT(!symmetrizer.has_value() ||
symmetrizer.value() == expr.as<Tensor>());
symmetrizer = expr.as<Tensor>();
Expand Down
10 changes: 10 additions & 0 deletions SeQuant/core/wick.impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

#include <SeQuant/core/bliss.hpp>
#include <SeQuant/core/logger.hpp>
#include <SeQuant/core/reserved.hpp>
#include <SeQuant/core/tensor_canonicalizer.hpp>
#include <SeQuant/core/tensor_network.hpp>
#include <SeQuant/core/tensor_network/vertex.hpp>
Expand Down Expand Up @@ -350,6 +351,9 @@ compute_index_replacement_rules(
}
};

using sequant::reserved::kronecker_label;
using sequant::reserved::overlap_label;

/// this makes the list of replacements ... we do not mutate the expressions
/// to keep the information about which indices are related
for (auto it = ranges::begin(exrng); it != ranges::end(exrng); ++it) {
Expand Down Expand Up @@ -456,6 +460,9 @@ inline bool apply_index_replacement_rules(
do {
pass_mutated = false;

using sequant::reserved::kronecker_label;
using sequant::reserved::overlap_label;

for (auto it = ranges::begin(exrng); it != ranges::end(exrng);) {
const auto &factor = *it;
if (factor->is<AbstractTensor>()) {
Expand Down Expand Up @@ -514,6 +521,9 @@ bool reduce_wick_impl(std::shared_ptr<Product> &expr,
// every pass
const auto have_noncovariant_indices = !noncovariant_indices.empty();

using sequant::reserved::kronecker_label;
using sequant::reserved::overlap_label;

if (Logger::instance().wick_reduce) {
sequant::wprintf(
"reduce_wick_impl(expr, external_indices):\n input expr = ",
Expand Down
6 changes: 4 additions & 2 deletions SeQuant/domain/mbpt/biorthogonalization.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include <SeQuant/core/expr.hpp>
#include <SeQuant/core/index.hpp>
#include <SeQuant/core/math.hpp>
#include <SeQuant/core/reserved.hpp>
#include <SeQuant/core/utility/expr.hpp>
#include <SeQuant/core/utility/indices.hpp>
#include <SeQuant/core/utility/macros.hpp>
Expand Down Expand Up @@ -314,8 +315,9 @@ void biorthogonal_transform(container::svector<ResultExpr>& result_exprs,
bool found = false;
res.expression()->visit(
[&](const ExprPtr& expr) {
if (expr->is<Tensor>() && (expr->as<Tensor>().label() == L"S" ||
expr->as<Tensor>().label() == L"A")) {
if (expr->is<Tensor>() &&
(expr->as<Tensor>().label() == reserved::symm_label() ||
expr->as<Tensor>().label() == reserved::antisymm_label())) {
found = true;
};
},
Expand Down
Loading