TwoSiteH
full name: tenpy.algorithms.mps_common.TwoSiteH
parent module:
tenpy.algorithms.mps_common
type: class
Inheritance Diagram
Methods
|
|
Return the hermitian conjugate of self. |
|
|
Combine LP and RP with W to form LHeff and RHeff. |
|
Combine the legs of theta, such that it fits to how we combined the legs of self. |
|
Apply the effective Hamiltonian to theta. |
Contract self to a matrix. |
|
|
Equivalent to |
|
Equivalent to |
Class Attributes and Properties
- class tenpy.algorithms.mps_common.TwoSiteH(env, i0, combine=False, move_right=True)[source]
Bases:
EffectiveH
Class defining the two-site effective Hamiltonian for Lanczos.
The effective two-site Hamiltonian looks like this:
| .--- ---. | | | | | | LP----W0--W1---RP | | | | | | .--- ---.
If combine is True, we define LHeff and RHeff, which are the contractions of LP with W0, and RP with W1, respectively.
- Parameters:
env (
MPOEnvironment
) – Environment for contraction<psi|H|psi>
.i0 (int) – Left-most site of the MPS it acts on.
combine (bool) – Whether to combine legs into pipes. This combines the virtual and physical leg for the left site (when moving right) or right side (when moving left) into pipes. This reduces the overhead of calculating charge combinations in the contractions, but one
matvec()
is formally more expensive, \(O(2 d^3 \chi^3 D)\).move_right (bool | None) – Whether the the sweep is moving right or left for the next update (or doesn’t move). Ignored for the
TwoSiteH
.
- combine
Whether to combine legs into pipes. This combines the virtual and physical leg for the left site and right site into pipes. This reduces the overhead of calculating charge combinations in the contractions, but one
matvec()
is formally more expensive, \(O(2 d^3 \chi^3 D)\).- Type:
- acts_on
Labels of the state on which self acts. NB: class attribute. Overwritten by normal attribute, if combine.
- LHeff
Left part of the effective Hamiltonian. Labels
'(vR*.p0)', 'wR', '(vR.p0*)'
for bra, MPO, ket.- Type:
- RHeff
Right part of the effective Hamiltonian. Labels
'(p1*.vL)', 'wL', '(p1.vL*)'
for ket, MPO, bra.- Type:
- LP, W0, W1, RP
Tensors making up the network of self.
- Type:
- combine_Heff(env, left=True, right=True)[source]
Combine LP and RP with W to form LHeff and RHeff.
Combine LP with W0 and RP with W1 to get the effective parts of the Hamiltonian with piped legs.
- Parameters:
env (
MPOEnvironment
) – Environment for contraction<psi|H|psi>
.left (bool) – The mixer might need only one of LHeff/RHeff after the Lanczos optimization even for combine=True. These flags allow to calculate them specifically.
right (bool) – The mixer might need only one of LHeff/RHeff after the Lanczos optimization even for combine=True. These flags allow to calculate them specifically.
- combine_theta(theta)[source]
Combine the legs of theta, such that it fits to how we combined the legs of self.
- update_LP(env, i, U=None)[source]
Equivalent to
env.get_LP(i, store=True)
; optimized for combine.- Parameters:
env (
MPOEnvironment
) – The same environment as given during class initialization.i (int) – We update the part left of site i. Can optimize if i ==
i0
andcombine
is True.U (None |
Array
) – The tensor on the left-most site self acts on, with combined legs after SVD. Only used if trying to optimize.
- update_RP(env, i, VH=None)[source]
Equivalent to
env.get_RP(i, store=True)
; optimized for combine.- Parameters:
env (
MPOEnvironment
) – The same environment as given during class initialization.i (int) – We update the part right of site i. Can optimize if i ==
i0
+ 2 -length
andcombine
is True.U (None |
Array
) – The tensor on the right-most site self acts on, with combined legs after SVD. Only used if trying to optimize.