def test_canonize_and_calc_current_orthog_center(self, dtype): p = MPS_rand_state(20, 3, dtype=dtype) co = p.calc_current_orthog_center() assert co == (0, 19) p.canonize((5, 15), co) co = p.calc_current_orthog_center() assert co == (5, 15) p.canonize((8, 11), co) co = p.calc_current_orthog_center() assert co == (8, 11) assert p.dtype == dtype
def test_compress_site(self): psi = MPS_rand_state(10, 7) psi.compress_site(3, max_bond=1) assert psi.bond_sizes() == [2, 4, 1, 1, 7, 7, 7, 4, 2] assert psi.calc_current_orthog_center() == (3, 3) psi = MPS_rand_state(10, 7) psi.compress_site(0, max_bond=1) assert psi.bond_sizes() == [1, 7, 7, 7, 7, 7, 7, 4, 2] assert psi.calc_current_orthog_center() == (0, 0) psi = MPS_rand_state(10, 7) psi.compress_site(9, max_bond=1) assert psi.bond_sizes() == [2, 4, 7, 7, 7, 7, 7, 7, 1] assert psi.calc_current_orthog_center() == (9, 9)