SyTen

◆ qr() [2/2]

template<Rank rank>
void syten::QR::qr ( Tensor< rank > const &  in,
Index  uncombinedLeg,
Tensor< rank > &  q,
Tensor< 2 > &  r,
DecompRescaleCGC const  rescaleCGC = DecompRescaleCGC::Yes,
FullQR const  full = FullQR{false},
SourceLocation  location = SourceLocation::current() 
)

QR decomposition orthogonalisation, does not truncate!

Parameters
[in]ininput tensor to decompose into in → q r
[in]uncombinedLegleg of in/q which is not combined and at which r attaches
[out]qoutput tensor with same rank as in
[out]routput tensor with rank 2
[in]rescaleCGCwhether or not to rescale the CGC spaces to unity
[in]fullFullQR::Yes if we do a full QR, FullQR::No for a thin QR (default)
[in]locationCallsite identifier.
Returns
void

Given a rank-3 MPS tensor a, you can left-orthogonalise it via (assuming MPS::State::[url]Idx == [123]).

QR::qr(a, 2, q, r);
auto same_as_a = prod<1>(q, r, {-1, -2, 1}, {1, -3});
auto left_identity = prod<2>(q, q, {1, 2, -1}, {1, 2, -2}, true);
void qr(Tensor< rank > const &in, Index uncombinedLeg, Tensor< rank > &q, Tensor< 2 > &r, DecompRescaleCGC const rescaleCGC=DecompRescaleCGC::Yes, FullQR const full=FullQR{false}, SourceLocation location=SourceLocation::current())
QR decomposition orthogonalisation, does not truncate!
Definition: tensor_qr.h:50

For a right-orthogonal tensor, you do

QR::qr(a, 3, q, r);
auto same_as_a = prod<1>(q, r, {-1, 1, -3}, {1, -2});
auto right_identity = prod<2>(q, q, {1, -1, 2}, {1, -2, 2}, true);
Remarks
If the input tensor is not fully in standard dense format, a copy of it will be created on-the-fly and brought into this format. Output tensors are always fully in standard dense format.

Referenced by syten::MPS::error_estimate_2svariance(), syten::IPEPS::gauge_fix(), syten::MPS::TDVP::Worker::gse_create_expanded(), syten::Pyten::init_tensor_decomp(), syten::MPS::left_complement(), syten::MPS::State::leftnorm(), syten::MPS::LBOState::leftnormM(), syten::MPS::LBOState::physnormM(), syten::MPS::LBOState::physnormV(), positify_diagonal(), syten::STensorImpl::qr(), syten::IPEPS::qr_to_back(), syten::IPEPS::qr_to_back_r(), syten::IPEPS::qr_to_front(), syten::IPEPS::qr_to_left(), syten::IPEPS::qr_to_right(), syten::MPS::right_complement(), syten::MPS::State::rightnorm(), syten::MPS::LBOState::rightnormM(), and syten::MPS::TDVP::LBOWorker::sweep_single().

+ Here is the caller graph for this function: