def test_expand_mpo(self): h = MPO_ham_heis(12) assert h.site[0].dtype == float he = h.expand_bond_dimension(13) assert h.site[0].dtype == float assert max(he.site[6].shape) == 13 h.lower_ind_id = h.upper_ind_id t = h ^ ... he.upper_ind_id = he.lower_ind_id te = he ^ ... assert_allclose(t, te)
def test_expand_mpo(self, cyclic, rand_strength): h = MPO_ham_heis(12, cyclic=cyclic) assert h[0].dtype == float he = h.expand_bond_dimension(13, rand_strength=rand_strength) assert h[0].dtype == float assert max(he[6].shape) == 13 if cyclic: assert he.bond_size(0, -1) == 13 t = h.trace() te = he.trace() assert_allclose(t, te)
def test_expand_mpo(self, cyclic, rand_strength): h = MPO_ham_heis(12, cyclic=cyclic) assert h[0].dtype == float he = h.expand_bond_dimension(13, rand_strength=rand_strength) assert h[0].dtype == float assert max(he[6].shape) == 13 if cyclic: assert he.bond_size(0, -1) == 13 h.lower_ind_id = h.upper_ind_id t = h ^ ... he.upper_ind_id = he.lower_ind_id te = he ^ ... assert_allclose(t, te)
def test_expand_mpo_limited(self, cyclic, rand_strength): h = MPO_ham_heis(12, cyclic=cyclic) he = h.expand_bond_dimension(3, rand_strength=rand_strength) # should do nothing assert max(he[6].shape) == 5
def test_expand_mpo_limited(self): h = MPO_ham_heis(12) he = h.expand_bond_dimension(3) # should do nothing assert max(he.site[6].shape) == 5