From 63960ff6ad62329581c4b27ad4825388dfdc71e4 Mon Sep 17 00:00:00 2001 From: Filippo Vicentini Date: Wed, 5 Jun 2024 19:18:09 +0200 Subject: [PATCH] remove tests that are not relevant on reny2 was moved to main netket --- test/test_Renyi2.py | 56 --------------------------------------------- 1 file changed, 56 deletions(-) delete mode 100644 test/test_Renyi2.py diff --git a/test/test_Renyi2.py b/test/test_Renyi2.py deleted file mode 100644 index 5656301..0000000 --- a/test/test_Renyi2.py +++ /dev/null @@ -1,56 +0,0 @@ -import netket as nk -import numpy as np - - -from ._Renyi2_exact import _Renyi2_exact -from netket_fidelity.renyi2 import Renyi2EntanglementEntropy - -N = 3 -hi = nk.hilbert.Spin(0.5, N) - - -def _setup(): - n_samples = 1e4 - n_discard_per_chain = 1e3 - - sa = nk.sampler.MetropolisLocal(hilbert=hi, n_chains_per_rank=16) - ma = nk.models.RBM(alpha=1) - - vs = nk.vqs.MCState( - sampler=sa, - model=ma, - n_samples=n_samples, - n_discard_per_chain=n_discard_per_chain, - ) - - vs_exact = nk.vqs.FullSumState( - hilbert=hi, - model=ma, - ) - - subsys = [0, 1] - S2 = Renyi2EntanglementEntropy(hi, subsys) - - return vs, vs_exact, S2, subsys - - -def test_MCState(): - vs, vs_exact, S2, subsys = _setup() - S2_stats = vs.expect(S2) - S2_exact = _Renyi2_exact(vs, subsys) - - S2_mean = S2_stats.mean - err = 3 * S2_stats.error_of_mean - - np.testing.assert_allclose(S2_exact, S2_mean.real, atol=err) - - -def test_FullSumState(): - vs, vs_exact, S2, subsys = _setup() - S2_stats = vs_exact.expect(S2) - S2_exact = _Renyi2_exact(vs_exact, subsys) - - S2_mean = S2_stats.mean - err = 1e-12 - - np.testing.assert_allclose(S2_exact, S2_mean.real, atol=err)