decompose_theta_qr_based
full name: tenpy.linalg.truncation.decompose_theta_qr_based
parent module:
tenpy.linalg.truncation
type: function
- tenpy.linalg.truncation.decompose_theta_qr_based(old_qtotal_L, old_qtotal_R, old_bond_leg, theta: Array, move_right: bool, expand: float, min_block_increase: int, use_eig_based_svd: bool, trunc_params: dict, compute_err: bool, return_both_T: bool)[source]
Performs a QR based decomposition of a matrix theta (= the wavefunction) and truncates it. The result is an approximation.
The decomposition for
use_eig_based_svd=False
is:| -- theta -- ~= renormalization * -- T_Lc --- S --- T_Rc -- | | | | |
Where T_Lc is in ‘A’ form and T_Rc in ‘B’ form.
The decomposition for
use_eig_based_svd=True
is:| -- theta -- ~= renormalization * -- T_Lc --- T_Rc -- | | | | |
Where T_Lc is in ‘A’ (‘Th’) form and T_Rc in ‘Th’ (‘B’) form, if
move_right=True
(move_right=False
).- Parameters:
old_qtotal_L (1D array) – The total charge of the old left tensor. e.g.
old_qtotal_L = T_L.qtotal
old_qtotal_R (1D array) – The total charge of the old right tensor. e.g.
old_qtotal_R = T_R.qtotal
old_bond_leg (
LegCharge
) – The leg between the old left tensor and the old right tensor. e.g.old_bond_leg = T_L.get_leg('vR')
orold_bond_leg = T_R.get_leg('vL')
theta (npc.Array) – Array with legs [(vL.p0), (p1.vR)]
expand (float | None) – Expansion rate. The QR-based decomposition is carried out at an expanded bond dimension.
min_block_increase (int) – Minimum bond dimension increase for each block.
move_right (bool) – If True, the left tensor T_Lc is returned in ‘A’ form and the right tensor T_Rc is set to None. If False, the right tensor T_Rc is returned in ‘B’ form and the left tensor T_Lc is set to None.
use_eig_based_svd (bool) – Whether the SVD of the bond matrix \(\Xi\) should be carried out numerically via the eigensystem. This is faster on GPUs, but less accurate. It makes no sense to do this on CPU.
trunc_par (dict) – truncation parameters as described in
truncate()
.compute_err (bool) – Whether the truncation error should be computed exactly. Computing the truncation error is significantly more expensive. If True, the full error is computed and
return_both_T=True
. Otherwise, the truncation error is set to NaN.return_both_T (bool) – Whether the other tensor (associated with
not move_right
) should be returned as well. If True andmove_right=True
, the right tensor T_Rc is returned in ‘Th’ (‘B’) form, ifuse_eig_based_svd=True
(use_eig_based_svd=False
). If True andmove_right=False
, the left tensor T_Lc is returned in ‘Th’ (‘A’) form, ifuse_eig_based_svd=True
(use_eig_based_svd=False
).
- Returns:
T_Lc (array with legs [(vL.p), vR] or None)
S (1D numpy array) – The singular values of the array. Normalized to
np.linalg.norm(S)==1
.T_Rc (array with legs [vL, (p.vR)] or None)
form (list) – List containing two entries providing the form of the two arrays T_Lc and T_Rc in string form. e.g.
['A','Th']
trunc_err (TruncationError)
renormalization (float) – Factor, by which S was renormalized.