From 6a22db07ad96cea5a95c049d7a499c48631b8837 Mon Sep 17 00:00:00 2001 From: tankya2 Date: Mon, 24 Jul 2023 18:06:19 +0800 Subject: [PATCH] remove __main__ --- src/qibotn/cutn.py | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/src/qibotn/cutn.py b/src/qibotn/cutn.py index 21c316f..222ebc9 100644 --- a/src/qibotn/cutn.py +++ b/src/qibotn/cutn.py @@ -19,19 +19,3 @@ def eval_mps(qibo_circ, gate_algo, datatype): sv_mps = mps_helper.contract_state_vector( myconvertor.mps_tensors, myconvertor.options) return sv_mps - - -if __name__ == "__main__": - num_qubits = 25 - swaps = True - circ_qibo = QFT(num_qubits, swaps) - - exact_gate_algorithm = {'qr_method': False, - 'svd_method': {'partition': 'UV', 'abs_cutoff': 1e-12}} - dtype = "complex128" - sv_mps = eval_mps(circ_qibo, exact_gate_algorithm, dtype) - sv_reference = eval(circ_qibo, dtype) - state_vec = np.array(circ_qibo()) - print(f"State vector difference: {abs(sv_mps-sv_reference).max():0.3e}") - assert cp.allclose(sv_mps, sv_reference) - assert cp.allclose(sv_mps.flatten(), state_vec)