Skip to content

Commit 3c163c0

Browse files
authored
Speed up gf2 quick tests (#1715)
These were each taking many tens of seconds on a fresh cloud-hosted linux box
1 parent 26df1ea commit 3c163c0

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

qualtran/bloqs/gf_arithmetic/gf2_multiplication_test.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,9 @@ def test_multiply_by_xk_bloq_counts(n, k):
177177
qlt_testing.assert_equivalent_bloq_counts(blq)
178178

179179

180-
@pytest.mark.parametrize(['n', 'k'], [(n, k) for n in range(1, 4) for k in range(1, n + 2)])
181-
def test_multiply_by_xk_classical_action(n, k):
180+
def test_multiply_by_xk_classical_action():
181+
n = 2
182+
k = 2
182183
blq = MultiplyPolyByOnePlusXk(n, k)
183184
fg_polys = tuple(itertools.product(range(2), repeat=n))[1:]
184185
h_polys = [*itertools.product(range(2), repeat=blq.signature[-1].shape[0])]
@@ -222,7 +223,7 @@ def test_binary_mult_classical_action(n):
222223
qlt_testing.assert_consistent_classical_action(blq, f=fg_polys, g=fg_polys, h=h_polys)
223224

224225

225-
# @pytest.mark.slow
226+
@pytest.mark.slow
226227
@pytest.mark.parametrize('n', range(4, 7))
227228
def test_binary_mult_classical_action_slow(n):
228229
blq = BinaryPolynomialMultiplication(n)
@@ -331,8 +332,8 @@ def test_gf2mulmod_complexity(m_x):
331332
assert cost.total_toffoli_only() == 3**k
332333

333334

334-
@pytest.mark.parametrize('m_x', [[2, 1, 0], [3, 1, 0], [5, 2, 0]])
335-
def test_gf2mulmod_classical_action(m_x):
335+
def test_gf2mulmod_classical_action():
336+
m_x = [3, 1, 0]
336337
blq = GF2MulViaKaratsuba(m_x)
337338
qlt_testing.assert_consistent_classical_action(blq, x=blq.gf.elements, y=blq.gf.elements)
338339

0 commit comments

Comments
 (0)