Environment NTU#
Neighborhood tensor update environments#
- class yastn.tn.fpeps.EnvNTU(psi, which='NN')[source]#
Supports a family of NTU environments for truncation of PEPS tensors during time evolution. The local exact contractions, and SVD-1 approximation used in some environments, preserve hermiticity and positivity of the metric tensor. Numerical noise breaking those properties can still appear and grow with the number of environment layers.
- Parameters:
psi (yastn.tn.Peps) – Peps state being evolved.
which (str) – Type of environment from ‘NN’, ‘NN+’, ‘NN++’, ‘NNN’, ‘NNN+’, ‘NNN++’
- bond_metric(Q0, Q1, s0, s1, dirn)[source]#
Calculate bond metric. The environment size is controlled by
which
.Below, double lines indicate core bonds that are contracted exactly. Dashed lines indicate tree-like approximations, where border tensors are approximated using SVD-1, i.e., product boundary vectors from a rank-one SVD decomposition. Such approximation preserves positivity of the calculated metric.
If which == 'NN': (-1 +0)══(-1 +1) ║ ║ (+0 -1)═══Q0══ ══Q1═══(+0 +2) ║ ║ (+1 +0)══(+1 +1) If which == 'NN+': (-2 +0)┈┈(-2 +1) ┊ ┊ (-1 -1)┄(-1 +0)══(-1 +1)┄(-1 +2) ┊ ║ ║ ┆ (+0 -2)═(+0 -1)════Q0══ ══Q1═══(+0 +2)═(+0 +3) ┊ ║ ║ ┆ (+1 -1)┄(+1 +0)══(+1 +1)┄(+1 +2) ┊ ┊ (+2 +0)┈┈(+2 +1) If which == 'NN++': (-3 +0)┈┈(-3 +1) ┊ ┊ (-2 -1)┈(-2 +0)┈┈(-2 +1)┈(-2 +2) ┊ ┊ ┊ ┊ (-1 -2)┈(-1 -1)┈(-1 +0)══(-1 +1)┈(-1 +2)┈(-1 +3) ┊ ┊ ║ ║ ┊ ┊ (+0 -3)═(+0 -2)═(+0 -1)════Q0══ ══Q1═══(+0 +2)=(+0 +3)=(+0 +4) ┊ ┊ ║ ║ ┊ ┊ (+1 -2)┈(+1 -1)┈(+1 +0)══(+1 +1)┈(+1 +2)┈(+1 +3) ┊ ┊ ┊ ┊ (+2 -1)┈(+2 +0)┈┈(+2 +1)┈(+2 +2) ┊ ┊ (+3 +0)┈┈(+3 +1) If which == 'NNN': (-1 -1)=(-1 +0)══(-1 +1)=(-1 +2) ║ ║ ║ ║ (+0 -1)════Q0══ ══Q1═══(+0 +2) ║ ║ ║ ║ (+1 -1)=(+1 +0)══(+1 +1)=(+1 +2) If which == 'NNN+': (-2 -1) (-2 +0) (-2 +1) (-2 +2) ║ ║ ║ ║ (-1 -2)=(-1 -1)=(-1 +0)══(-1 +1)=(-1 +2)=(-1 +3) ║ ║ ║ ║ (+0 -2)=(+0 -1)════Q0══ ══Q1═══(+0 +2)=(+0 +3) ║ ║ ║ ║ (+1 -2)=(+1 -1)=(+1 +0)══(+1 +1)=(+1 +2)=(+1 +3) ║ ║ ║ ║ (+2 -1) (+2 +0) (+2 +1) (+2 +2) If which == 'NNN++': (-3 -2)┈(-3 -1)┈(-3 +0)┈┈(-3 +1)┈(-3 +2)┈(-3 +3) ┊ ┊ ┊ ┊ ┊ ┊ (-2 -3)┈(-2 -2)┈(-2 -1)┈(-2 +0)┈┈(-2 +1)┈(-2 +2)┈(-2 +3)┈(-2 +4) ┊ ┊ ┊ ┊ ┊ ┊ ┊ ┊ (-1 -3)┈(-1 -2)┈(-1 -1)=(-1 +0)══(-1 +1)=(-1 +2)┈(-1 +3)┈(-1 +4) ┊ ┊ ║ ║ ║ ║ ┊ ┊ (+0 -3)=(+0 -2)=(+0 -1)════Q0══ ══Q1═══(+0 +2)=(+0 +3)=(+0 +4) ┊ ┊ ║ ║ ║ ║ ┊ ┊ (+1 -3)┈(+1 -2)┈(+1 -1)=(+1 +0)══(+1 +1)=(+1 +2)┈(+1 +3)┈(+1 +4) ┊ ┊ ┊ ┊ ┊ ┊ ┊ ┊ (+2 -3)┈(+2 -2)┈(+2 -1)┈(+2 +0)┈┈(+2 +1)┈(+2 +2)┈(+2 +3)┈(+2 +4) ┊ ┊ ┊ ┊ ┊ ┊ (+3 -2)┈(+3 -1)┈(+3 +0)┈┈(+3 +1)┈(+3 +2)┈(+3 +3)
Approximate cluster update#
- class yastn.tn.fpeps.EnvApproximate(psi, which='65', opts_svd=None, opts_var=None, update_sweeps=None)[source]#
Supports calculation of bond metric for larger local clusters, which are contracted approximately using the boundary MPS approach.
- Parameters:
psi (yastn.tn.Peps) – Peps state being evolved.
which (str) – Type of environment from ‘43’, ‘43+’, ‘65’, ‘65+’, ‘87’, ‘87+’
opts_svd (dict) – Passed to
yastn.tn.mps.zipper()
for truncation in boundary MPS calculation.opts_var – Passed to
yastn.tn.mps.compression_()
for boundary MPS variational fine-tunning.update_sweeps – Passed as max_sweeps to
yastn.tn.mps.compression_()
for boundary MPS variational fine-tunning.
- bond_metric(Q0, Q1, s0, s1, dirn)[source]#
Calculates bond metric. The environment size is controlled by
which
.Approximately contract the diagram using boundary MPS approach, parallel to the metric (open) bond direction.
If which == '65': (-2 -2)═(-2 -1)═(-2 +0)══(-2 +1)═(-2 +2)═(-2 +3) ║ ║ ║ ║ ║ ║ (-1 -2)═(-1 -1)═(-1 +0)══(-1 +1)═(-1 +2)═(-1 +3) ║ ║ ║ ║ ║ ║ (+0 -2)═(+0 -1)════Q0══ ══Q1═══(+0 +2)═(+0 +3) ║ ║ ║ ║ ║ ║ (+1 -2)═(+1 -1)═(+1 +0)══(+1 +1)═(+1 +2)═(+1 +3) ║ ║ ║ ║ ║ ║ (+2 -2)═(+2 -1)═(+2 +0)══(+2 +1)═(+2 +2)═(+2 +3) If which == '65+': (-3 -2) (-3 -1) (-3 +0) (-3 +1) (-3 +2) (-3 +3) ║ ║ ║ ║ ║ ║ (-2 -3)═(-2 -2)═(-2 -1)═(-2 +0)══(-2 +1)═(-2 +2)══(-2 +3)═(-2 +4) ║ ║ ║ ║ ║ ║ (-1 -3)═(-1 -2)═(-1 -1)═(-1 +0)══(-1 +1)═(-1 +2)══(-1 +3)═(-1 +4) ║ ║ ║ ║ ║ ║ (+0 -3)═(+0 -2)═(+0 -1)════Q0══ ══Q1═══(+0 +2)══(+0 +3)═(+0 +4) ║ ║ ║ ║ ║ ║ (+1 -3)═(+1 -2)═(+1 -1)═(+1 +0)══(+1 +1)═(+1 +2)══(+1 +3)═(+1 +4) ║ ║ ║ ║ ║ ║ (+2 -3)═(+2 -2)═(+2 -1)═(+2 +0)══(+2 +1)═(+2 +2)══(+2 +3)═(+2 +4) ║ ║ ║ ║ ║ ║ (+3 -2) (+3 -1) (+3 +0) (+3 +1) (+3 +2) (+3 +3)