mparray.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:mpnum 作者: dseuss 项目源码 文件源码
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))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号