STensor syten::STensorImpl::project_state | ( | STensor | input, |
SBasisId const & | which, | ||
Sector const & | sec, | ||
Index const | n | ||
) |
Projects the which
basis of tensor input
onto the n
-th state (1-indexed) of the sector sec
.
The returned tensor still has basis which
, it only lacks nearly all of its elements.
References syten::STensorImpl::SBasis::add(), syten::STensorImpl::STensor::b(), syten::STensorImpl::SBasis::dir(), syten::STensorImpl::SBasis::elementSize(), gen_io(), if_constexpr, syten::makeZero(), std::move(), project(), syten::projector(), syten::STensorImpl::STensor::rank(), syten::STensorImpl::SBasis::set_dir(), syten::STensorImpl::SBasis::set_id(), SYTEN_ASSERT, SYTEN_ASSERT_MSG, and SYTEN_TENSOR_RANK.