Template Function sequant::mbpt::detail::hardcoded_nns_projector

Function Documentation

template<typename T>
std::optional<std::vector<T>> sequant::mbpt::detail::hardcoded_nns_projector(std::size_t n_particles)

Provides one row of the NNS projector matrix, hardcoded from Mathematica to avoid numerical precision loss.

The NNS projector weights are obtained from the normalized pseudoinverse of M: first compute M_pinv (the pseudoinverse), then normalize it by the factor ((n_particles)!/rank(M)). Finally, NNS projector = normalized_M_pinv · M.

Parameters:

n_particles – The rank of external index pairs

Returns:

Optional vector of NNS projector weights representing the last row, std::nullopt if n_particles is outside the range [1,5].