def _rcanonicalize(self, to_site):
"""Left-canonicalizes all local tensors _ltens[:to_site] in place
:param to_site: Index of the site up to which canonicalization is to be
performed
"""
assert 0 <= to_site < len(self), 'to_site={!r}'.format(to_site)
lcanon, rcanon = self._lt.canonical_form
for site in range(lcanon, to_site):
ltens = self._lt[site]
q, r = qr(ltens.reshape((-1, ltens.shape[-1])))
# if ltens.shape[-1] > prod(ltens.phys_shape) --> trivial comp.
# can be accounted by adapting rank here
newtens = (q.reshape(ltens.shape[:-1] + (-1,)),
matdot(r, self._lt[site + 1]))
self._lt.update(slice(site, site + 2), newtens,
canonicalization=('left', None))
评论列表
文章目录