DensityMatrixMixer¶
full name: tenpy.algorithms.dmrg.DensityMatrixMixer
parent module:
tenpy.algorithms.dmrg
type: class
-
class
tenpy.algorithms.dmrg.
DensityMatrixMixer
(mixer_params)[source]¶ Bases:
tenpy.algorithms.dmrg.Mixer
Mixer based on density matrices.
This mixer constructs density matrices as described in the original paper [White2005].
Methods
get_xL
(self, wL_leg, Id_L, Id_R)Generate the coupling of the MPO legs for the reduced density matrix.
get_xR
(self, wR_leg, Id_L, Id_R)Generate the coupling of the MPO legs for the reduced density matrix.
mix_rho_L
(self, engine, theta, i0, mix_enabled)Calculated mixed reduced density matrix for left site.
mix_rho_R
(self, engine, theta, i0, mix_enabled)Calculated mixed reduced density matrix for left site.
perturb_svd
(self, engine, theta, i0, …)Mix extra terms to theta and perform an SVD.
update_amplitude
(self, sweeps)Update the amplitude, possibly disable the mixer.
-
perturb_svd
(self, engine, theta, i0, update_LP, update_RP)[source]¶ Mix extra terms to theta and perform an SVD.
We calculate the left and right reduced density using the mixer (which might include applications of H). These density matrices are diagonalized and truncated such that we effectively perform a svd for the case
mixer.amplitude=0
.- Parameters
- engine
SingleSiteDMRGEngine
|TwoSiteDMRGEngine
The DMRG engine calling the mixer.
- theta
Array
The optimized wave function, prepared for svd.
- i0int
Site index; theta lives on
i0, i0+1
.- update_LPbool
Whether to calculate the next
env.LP[i0+1]
.- update_RPbool
Whether to calculate the next
env.RP[i0]
.
- engine
- Returns
- U
Array
Left-canonical part of theta. Labels
'(vL.p0)', 'vR'
.- S1D ndarray | 2D
Array
Without mixer just the singluar values of the array; with mixer it might be a general matrix; see comment above.
- VH
Array
Right-canonical part of theta. Labels
'vL', '(p1.vR)'
.- err
TruncationError
The truncation error introduced.
- U
-
mix_rho_L
(self, engine, theta, i0, mix_enabled)[source]¶ Calculated mixed reduced density matrix for left site.
Pictorially:
| mix_enabled=False mix_enabled=True | | .---theta---. .---theta-------. | | | | | | | | | | | | LP---H0--H1--. | | | | | | | | | | | | .---theta*--. | xR | | | | | | | | LP*--H0*-H1*-. | | | | | | | .---theta*------.
- Parameters
- engine
Engine
The DMRG engine calling the mixer.
- theta
Array
Ground state of the effective Hamiltonian, prepared for svd.
- i0int
Site index; theta lives on
i0, i0+1
.- mix_enabledbool
Whether we should perturb the density matrix.
- engine
- Returns
- rho_L
Array
A (hermitian) square array with labels
'(vL.p0)', '(vL*.p0*)'
, Mainly the reduced density matrix of the left part, but with some additional mixing.
- rho_L
-
mix_rho_R
(self, engine, theta, i0, mix_enabled)[source]¶ Calculated mixed reduced density matrix for left site.
Pictorially:
| mix_enabled=False mix_enabled=True | | .---theta---. .------theta---. | | | | | | | | | | | | | .--H0--H1--RP | | | | | | | | | | | .---theta*--. | wL | | | | | | | | | .--H0*-H1*-RP* | | | | | | .------theta*--.
- Parameters
- engine
Engine
The DMRG engine calling the mixer.
- theta
Array
Ground state of the effective Hamiltonian, prepared for svd.
- i0int
Site index; theta lives on
i0, i0+1
.- mix_enabledbool
Whether we should perturb the density matrix.
- engine
- Returns
- rho_R
Array
A (hermitian) square array with labels
'(p1.vR)', '(p1*.vR*)'
. Mainly the reduced density matrix of the right part, but with some additional mixing.
- rho_R
-
get_xR
(self, wR_leg, Id_L, Id_R)[source]¶ Generate the coupling of the MPO legs for the reduced density matrix.
- Parameters
- wR_leg
LegCharge
LegCharge to be connected to.
- IdLint |
None
Index within the leg for which the MPO has only identities to the left.
- IdRint |
None
Index within the leg for which the MPO has only identities to the right.
- wR_leg
- Returns
- mixed_xR
Array
Connection of the MPOs on the right for the reduced density matrix rhoL. Labels
('wL', 'wL*')
.- add_separate_Idbool
If Id_L is
None
, we can’t include the identity into mixed_xR, so it has to be added directly inmix_rho_L()
.
- mixed_xR
-
get_xL
(self, wL_leg, Id_L, Id_R)[source]¶ Generate the coupling of the MPO legs for the reduced density matrix.
- Parameters
- wL_leg
LegCharge
LegCharge to be connected to.
- Id_Lint |
None
Index within the leg for which the MPO has only identities to the left.
- Id_Rint |
None
Index within the leg for which the MPO has only identities to the right.
- wL_leg
- Returns
- mixed_xL
Array
Connection of the MPOs on the left for the reduced density matrix rhoR. Labels
('wR', 'wR*')
.- add_separate_Idbool
If Id_R is
None
, we can’t include the identity into mixed_xL, so it has to be added directly inmix_rho_R()
.
- mixed_xL
-