diff --git a/tests/test_tensor/test_optimizers.py b/tests/test_tensor/test_optimizers.py index 4a3b3c9b..0b67b8e7 100644 --- a/tests/test_tensor/test_optimizers.py +++ b/tests/test_tensor/test_optimizers.py @@ -78,12 +78,12 @@ def heis_pbc(): H = qtn.MPO_ham_heis(L, cyclic=True).astype(dtype) def norm_fn(psi): - factor = (psi & psi).contract(all, optimize='random-greedy') + factor = (psi & psi).contract(all, optimize="auto-hq") return psi / factor**0.5 def loss_fn(psi, H): k, H, b = qtn.tensor_network_align(psi, H, psi) - energy = (k & H & b).contract(all, optimize='random-greedy') + energy = (k & H & b).contract(all, optimize="auto-hq") return energy en_ex = qu.groundenergy(qu.ham_heis(L, cyclic=True, sparse=True)) @@ -102,12 +102,12 @@ def ham_mbl_pbc_complex(): H = qtn.MPO_ham_mbl(L, **ham_opts).astype(dtype) def norm_fn(psi): - factor = (psi.H & psi).contract(all, optimize='random-greedy') + factor = (psi.H & psi).contract(all, optimize="auto-hq") return psi * factor**-0.5 def loss_fn(psi, H): k, H, b = qtn.tensor_network_align(psi, H, psi.H) - energy = (k & H & b).contract(all, optimize='random-greedy') + energy = (k & H & b).contract(all, optimize="auto-hq") return real(energy) en_ex = qu.groundenergy(qu.ham_mbl(L, sparse=True, **ham_opts)) diff --git a/tests/test_tensor/test_tensor_2d.py b/tests/test_tensor/test_tensor_2d.py index 16dafb1f..710498f6 100644 --- a/tests/test_tensor/test_tensor_2d.py +++ b/tests/test_tensor/test_tensor_2d.py @@ -40,7 +40,7 @@ def test_basic_rand(self, Lx, Ly): assert isinstance(psi[f"I{i},{j}"], qtn.Tensor) if Lx == Ly == 3: - psi_dense = psi.to_qarray(optimize="random-greedy") + psi_dense = psi.to_qarray(optimize="auto-hq") assert psi_dense.shape == (512, 1) psi.show() @@ -392,7 +392,7 @@ def test_compute_local_expectation_one_sites(self, mode, normalized): ) ex = qu.expec(A, k) - opts = dict(cutoff=2e-3, max_bond=9, contract_optimize="random-greedy") + opts = dict(cutoff=2e-3, max_bond=9, contract_optimize="auto-hq") e = peps.compute_local_expectation( terms, mode=mode, normalized=normalized, **opts ) @@ -417,7 +417,7 @@ def test_compute_local_expectation_two_sites(self, mode, normalized): normalized=normalized, cutoff=2e-3, max_bond=16, - contract_optimize="random-greedy", + contract_optimize="auto-hq", ) # compute 2x1 and 1x2 plaquettes separately @@ -488,7 +488,7 @@ def test_basic_rand(self, Lx, Ly): assert isinstance(X[f"I{i},{j}"], qtn.Tensor) if Lx == Ly == 3: - X_dense = X.to_qarray(optimize="random-greedy") + X_dense = X.to_qarray(optimize="auto-hq") assert X_dense.shape == (512, 512) assert qu.isherm(X_dense)