Template Function sequant::opt::detail::contractible_adjacency¶
Defined in File single_term_detail.hpp
Function Documentation¶
-
template<typename TIdxs>
inline container::vector<std::size_t> sequant::opt::detail::contractible_adjacency(TensorNetwork const &network, TIdxs const &tidxs)¶ Per-tensor adjacency bitmask over “contractible” shared indices.
adj[i]has bitjset iff tensorsiandjshare at least one top-level (bra/ket/aux) index that is NOT a target index (tidxs) — i.e. an index that is summed somewhere in the term. Protoindices are never compared, so two compositesa<i,j>,b<i,j>that share only occupied protos create no edge. A hyperedge (a contractible index on three-plus tensors) makes all its carriers mutually adjacent. A tensor is never adjacent to itself.