Skip to content

Commit

Permalink
🩹🏁 skip slow tests on Windows
Browse files Browse the repository at this point in the history
Signed-off-by: burgholzer <[email protected]>
  • Loading branch information
burgholzer committed Sep 10, 2024
1 parent e17b995 commit c3dc83a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
4 changes: 4 additions & 0 deletions test/python/ft_stateprep/test_simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

from __future__ import annotations

import os
import sys
from typing import TYPE_CHECKING

import numpy as np
Expand Down Expand Up @@ -108,6 +110,7 @@ def test_non_ft_sim_zero(steane_code: CSSCode, non_ft_steane_zero: QuantumCircui
assert p_l - tol > lower


@pytest.mark.skipif(os.environ.get("CI", "") and sys.platform == "win32", reason="Too slow for CI on Windows")
def test_ft_sim_zero(steane_code: CSSCode, ft_steane_zero: QuantumCircuit) -> None:
"""Test the simulation of a fault-tolerant state preparation circuit for the Steane |0>."""
tol = 5e-4
Expand All @@ -130,6 +133,7 @@ def test_non_ft_sim_plus(steane_code: CSSCode, non_ft_steane_plus: QuantumCircui
assert p_l - tol > lower


@pytest.mark.skipif(os.environ.get("CI", "") and sys.platform == "win32", reason="Too slow for CI on Windows")
def test_ft_sim_plus(steane_code: CSSCode, ft_steane_plus: QuantumCircuit) -> None:
"""Test the simulation of a fault-tolerant state preparation circuit for the Steane |0>."""
tol = 5e-4
Expand Down
10 changes: 10 additions & 0 deletions test/python/ft_stateprep/test_stateprep.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

from __future__ import annotations

import os
import sys
from typing import TYPE_CHECKING

import numpy as np
Expand Down Expand Up @@ -127,6 +129,7 @@ def test_heuristic_prep_consistent(code: CSSCode, request) -> None: # type: ign
assert eq_span(np.vstack((code.Hz, code.Lz)), z)


@pytest.mark.skipif(os.environ.get("CI", "") and sys.platform == "win32", reason="Too slow for CI on Windows")
@pytest.mark.parametrize("code", ["steane_code", "css_4_2_2_code", "css_6_4_2_code"])
def test_gate_optimal_prep_consistent(code: CSSCode, request) -> None: # type: ignore[no-untyped-def]
"""Check that gate_optimal_prep_circuit returns a valid circuit with the correct stabilizers."""
Expand All @@ -146,6 +149,7 @@ def test_gate_optimal_prep_consistent(code: CSSCode, request) -> None: # type:
assert eq_span(np.vstack((code.Hz, code.Lz)), z)


@pytest.mark.skipif(os.environ.get("CI", "") and sys.platform == "win32", reason="Too slow for CI on Windows")
@pytest.mark.parametrize("code", ["steane_code", "css_4_2_2_code", "css_6_4_2_code"])
def test_depth_optimal_prep_consistent(code: CSSCode, request) -> None: # type: ignore[no-untyped-def]
"""Check that depth_optimal_prep_circuit returns a valid circuit with the correct stabilizers."""
Expand All @@ -164,6 +168,7 @@ def test_depth_optimal_prep_consistent(code: CSSCode, request) -> None: # type:
assert eq_span(np.vstack((code.Hz, code.Lz)), z)


@pytest.mark.skipif(os.environ.get("CI", "") and sys.platform == "win32", reason="Too slow for CI on Windows")
@pytest.mark.parametrize("code", ["steane_code", "css_4_2_2_code", "css_6_4_2_code"])
def test_plus_state_gate_optimal(code: CSSCode, request) -> None: # type: ignore[no-untyped-def]
"""Test synthesis of the plus state."""
Expand Down Expand Up @@ -231,6 +236,7 @@ def test_plus_state_heuristic(code: CSSCode, request) -> None: # type: ignore[n
assert not np.array_equal(z, x_zero)


@pytest.mark.skipif(os.environ.get("CI", "") and sys.platform == "win32", reason="Too slow for CI on Windows")
def test_optimal_steane_verification_circuit(steane_code_sp: StatePrepCircuit) -> None:
"""Test that the optimal verification circuit for the Steane code is correct."""
circ = steane_code_sp
Expand Down Expand Up @@ -284,6 +290,7 @@ def test_heuristic_steane_verification_circuit(steane_code_sp: StatePrepCircuit)
assert circ_ver.depth() == np.sum(ver_stabs) + circ.circ.depth() + 1 # 1 for the measurement


@pytest.mark.skipif(os.environ.get("CI", "") and sys.platform == "win32", reason="Too slow for CI on Windows")
def test_optimal_tetrahedral_verification_circuit(tetrahedral_code_sp: StatePrepCircuit) -> None:
"""Test the optimal verification circuit for the tetrahedral code is correct.
Expand Down Expand Up @@ -344,6 +351,7 @@ def test_heuristic_tetrahedral_verification_circuit(tetrahedral_code_sp: StatePr
assert circ_ver.depth() == np.sum(ver_stabs) + circ.circ.depth() + 1 # 1 for the measurement


@pytest.mark.skipif(os.environ.get("CI", "") and sys.platform == "win32", reason="Too slow for CI on Windows")
def test_not_full_ft_opt_cc5(color_code_d5_sp: StatePrepCircuit) -> None:
"""Test that the optimal verification is also correct for higher distance.
Expand Down Expand Up @@ -417,6 +425,7 @@ def test_not_full_ft_heuristic_cc5(color_code_d5_sp: StatePrepCircuit) -> None:
assert circ_ver.num_nonlocal_gates() == n_cnots + circ.circ.num_nonlocal_gates()


@pytest.mark.skipif(os.environ.get("CI", "") and sys.platform == "win32", reason="Too slow for CI on Windows")
def test_full_ft_opt_cc5(color_code_d5_sp: StatePrepCircuit) -> None:
"""Test that the optimal verification is also correct for higher distance.
Expand Down Expand Up @@ -444,6 +453,7 @@ def test_full_ft_heuristic_cc5(color_code_d5_sp: StatePrepCircuit) -> None:
assert circ_ver_full_ft.depth() > circ_ver_x_ft.depth()


@pytest.mark.skipif(os.environ.get("CI", "") and sys.platform == "win32", reason="Too slow for CI on Windows")
def test_error_detection_code() -> None:
"""Test that different circuits are obtained when using an error detection code."""
code = CSSCode.from_code_name("carbon")
Expand Down

0 comments on commit c3dc83a

Please sign in to comment.