diff --git a/src/mqt/qecc/ft_stateprep/__init__.py b/src/mqt/qecc/ft_stateprep/__init__.py index 7ffe9a81..3e597881 100644 --- a/src/mqt/qecc/ft_stateprep/__init__.py +++ b/src/mqt/qecc/ft_stateprep/__init__.py @@ -12,7 +12,7 @@ heuristic_prep_circuit, heuristic_verification_circuit, heuristic_verification_stabilizers, - naive_verification_circuit + naive_verification_circuit, ) __all__ = [ @@ -26,5 +26,5 @@ "heuristic_prep_circuit", "heuristic_verification_circuit", "heuristic_verification_stabilizers", - "naive_verification_circuit" + "naive_verification_circuit", ] diff --git a/test/python/ft_stateprep/test_simulation.py b/test/python/ft_stateprep/test_simulation.py index 4da13168..a97a5052 100644 --- a/test/python/ft_stateprep/test_simulation.py +++ b/test/python/ft_stateprep/test_simulation.py @@ -2,15 +2,15 @@ from typing import TYPE_CHECKING -import pytest import numpy as np +import pytest from mqt.qecc import CSSCode from mqt.qecc.ft_stateprep import ( + LutDecoder, NoisyNDFTStatePrepSimulator, heuristic_prep_circuit, heuristic_verification_circuit, - LutDecoder, ) if TYPE_CHECKING: # pragma: no cover @@ -42,19 +42,19 @@ def test_lut(steane_code: CSSCode): lut.generate_x_lut() lut.generate_z_lut() - + assert len(lut.x_lut) != 0 assert lut.x_lut is lut.z_lut # Code is self dual so luts should be the same error_1 = np.zeros(steane_code.n, dtype=np.int8) error_1[0] = 1 - + error_w1 = (steane_code.Hx[0] + error_1) % 2 syndrome_1 = steane_code.get_x_syndrome(error_w1) estimate_1 = lut.decode_x(syndrome_1.astype(np.int8)) assert steane_code.stabilizer_eq_x_error(estimate_1, error_1) assert steane_code.stabilizer_eq_z_error(estimate_1, error_1) - + error_2 = np.zeros(steane_code.n, dtype=np.int8) error_2[0] = 1 error_2[1] = 1 @@ -65,7 +65,7 @@ def test_lut(steane_code: CSSCode): # Weight 2 error should have be estimated to be weight 1 assert not steane_code.stabilizer_eq_x_error(estimate_2, error_2) assert np.sum(estimate_2) == 1 - + error_3 = np.ones((steane_code.n), dtype=np.int8) error_w3 = (steane_code.Hx[0] + error_3) % 2 syndrome_3 = steane_code.get_x_syndrome(error_w3) @@ -74,7 +74,7 @@ def test_lut(steane_code: CSSCode): assert not steane_code.stabilizer_eq_x_error(estimate_3, error_3) assert steane_code.stabilizer_eq_x_error(estimate_3, np.zeros(steane_code.n)) assert np.sum(estimate_3) == 0 - + def test_non_ft_sim(steane_code: CSSCode, non_ft_steane_zero: QuantumCircuit): tol = 5e-4 @@ -94,4 +94,3 @@ def test_ft_sim(steane_code: CSSCode, ft_steane_circ: QuantumCircuit): p_l, _, _, _ = simulator.logical_error_rate() assert p_l - tol < lower -