Template Function sequant::opt::detail::contractible_adjacency

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 bit j set iff tensors i and j share at least one top-level (bra/ket/aux) index that is NOT a target index (tidxs) &#8212; i.e. an index that is summed somewhere in the term. Protoindices are never compared, so two composites a<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.