SyTen

◆ flip_in_product()

std::tuple< STensor, SBasisId > syten::STensorImpl::flip_in_product ( STensor const &  in,
SBasisId const &  which 
)

Flips the direction of basis which using insertIOSplitHalf.

Returns the updated tensor and basis.

This function fulfills

STensor x, y; SBasis b; // shared leg of x and y
STensor z = x * a;
auto [xf, b2] = flip_in_product(x, b);
auto [yf, b3] = flip_in_product(y, b);
return z == xf * yf;
std::tuple< STensor, SBasisId > flip_in_product(STensor const &in, SBasisId const &which)
Flips the direction of basis which using insertIOSplitHalf.
Definition: stensor_flip.cpp:16
STensorImpl::STensor STensor
‘Smart’ tensor class.
Definition: stensor_base.h:556
Remarks
This function turns the product (…<a|)(|a'>…) into (…|A>)(<A|…). The tensor product then introduces an additional minus sign for fermionic sectors. To counteract this minus sign, the function here multiplies blocks which are fermionic on the flipped leg by -1 if the which leg of the in tensor is incoming.
You cannot flip the same leg of a tensor twice with this function and then expect to get the original tensor back. To do so, use flip_on_tensor(). You can only use this function to (temporarily) flip the direction of a contracted leg of a tensor network.
This function is autodifferentiable.

References syten::STensorImpl::STensor::autodiff_enabled(), syten::STensorImpl::STensor::b(), syten::STensorImpl::STensor::bi(), syten::STensorImpl::SBasis::dir(), syten::STensorImpl::SBasis::f(), gen_io(), syten::STensorImpl::STensor::get_autodiff(), syten::STensorImpl::STensor::get_bases(), syten::STensorImpl::Autodiff::ComputeNode::get_cached_tensors(), syten::STensorImpl::STensor::get_fermionic_order(), syten::STensorImpl::Autodiff::ComputeNode::get_output_adjoint(), syten::Inc, syten::insertIOSplitHalf(), syten::isFermionic(), make_zero(), syten::STensorImpl::STensor::move(), std::move(), syten::mve(), syten::STensorImpl::STensor::new_autodiff_id(), syten::STensorImpl::Autodiff::new_id(), prod(), project(), syten::STensorImpl::STensor::set_autodiff_node(), and syten::STensorImpl::STensor::visnz().

Referenced by syten::IPEPSv2::State::build_dl(), syten::IPEPSv2::CornerTransferMatrix::CornerTransferMatrix(), syten::IPEPSv2::expectation_value(), syten::IPEPSv2::full_update_horizontal(), and syten::IPEPSv2::full_update_vertical().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: