@@ -17,10 +17,10 @@ def test_dependencies():
17
17
18
18
19
19
@pytest .mark .skipif (len (samplers ) == 0 , reason = "Missing necessary backends" )
20
- @pytest .mark .parametrize ("simulator" , [numpy .random .choice (samplers )])
21
20
@pytest .mark .parametrize ("p" , numpy .random .uniform (0.1 , .4 , 1 ))
22
21
@pytest .mark .parametrize ('method' , numpy .random .choice (['NELDER-MEAD' , 'COBYLA' ],1 ))
23
- def test_bit_flip_scipy_gradient_free (simulator , p , method ):
22
+ def test_bit_flip_scipy_gradient_free (p , method ):
23
+ simulator = numpy .random .choice (samplers )
24
24
qubit = 0
25
25
H = paulis .Qm (qubit )
26
26
U = gates .Rx (target = qubit , angle = tq .Variable ('a' ))
@@ -31,11 +31,11 @@ def test_bit_flip_scipy_gradient_free(simulator, p, method):
31
31
32
32
33
33
@pytest .mark .skipif (len (samplers ) == 0 , reason = "Missing necessary backends" )
34
- @pytest .mark .parametrize ("simulator" , [numpy .random .choice (samplers )])
35
34
@pytest .mark .parametrize ("p" , numpy .random .uniform (0.1 , .4 , 1 ))
36
35
@pytest .mark .parametrize ('method' ,
37
36
[tq .optimizer_scipy .OptimizerSciPy .gradient_based_methods [numpy .random .randint (0 , 4 , 1 )[0 ]]])
38
- def test_bit_flip_scipy_gradient (simulator , p , method ):
37
+ def test_bit_flip_scipy_gradient (p , method ):
38
+ simulator = numpy .random .choice (samplers )
39
39
qubit = 0
40
40
H = paulis .Qm (qubit )
41
41
U = gates .Rx (target = qubit , angle = tq .Variable ('a' ))
@@ -46,11 +46,11 @@ def test_bit_flip_scipy_gradient(simulator, p, method):
46
46
47
47
48
48
@pytest .mark .skipif (len (samplers ) == 0 , reason = "Missing necessary backends" )
49
- @pytest .mark .parametrize ("simulator" , [numpy .random .choice (samplers )])
50
49
@pytest .mark .parametrize ("p" , numpy .random .uniform (0.1 , .4 , 1 ))
51
50
@pytest .mark .parametrize ('method' ,
52
51
[["TRUST-KRYLOV" , "NEWTON-CG" , "TRUST-NCG" , "TRUST-CONSTR" ][numpy .random .randint (0 , 4 , 1 )[0 ]]])
53
- def test_bit_flip_scipy_hessian (simulator , p , method ):
52
+ def test_bit_flip_scipy_hessian (p , method ):
53
+ simulator = numpy .random .choice (samplers )
54
54
qubit = 0
55
55
H = paulis .Qm (qubit )
56
56
U = gates .Rx (target = qubit , angle = tq .Variable ('a' ))
@@ -62,9 +62,9 @@ def test_bit_flip_scipy_hessian(simulator, p, method):
62
62
63
63
@pytest .mark .skipif (len (samplers ) == 0 , reason = "Missing necessary backends" )
64
64
@pytest .mark .skipif (not tq .optimizers .has_phoenics , reason = "Missing phoenics installation" )
65
- @pytest .mark .parametrize ("simulator" , [numpy .random .choice (samplers )])
66
65
@pytest .mark .parametrize ("p" , numpy .random .uniform (0.1 , .4 , 1 ))
67
- def test_bit_flip_phoenics (simulator , p ):
66
+ def test_bit_flip_phoenics (p ):
67
+ simulator = numpy .random .choice (samplers )
68
68
qubit = 0
69
69
H = paulis .Qm (qubit )
70
70
U = gates .Rx (target = qubit , angle = tq .Variable ('a' ))
@@ -75,10 +75,10 @@ def test_bit_flip_phoenics(simulator, p):
75
75
76
76
@pytest .mark .skipif (len (samplers ) == 0 , reason = "Missing necessary backends" )
77
77
@pytest .mark .skipif (not tq .optimizers .has_gpyopt , reason = "Missing gpyopt installation" )
78
- @pytest .mark .parametrize ("simulator" , [numpy .random .choice (samplers )])
79
78
@pytest .mark .parametrize ("p" , numpy .random .uniform (0.1 , .4 , 1 ))
80
79
@pytest .mark .parametrize ('method' , ['lbfgs' , 'DIRECT' , 'CMA' ])
81
- def test_bit_flip_gpyopt (simulator , p , method ):
80
+ def test_bit_flip_gpyopt (p , method ):
81
+ simulator = numpy .random .choice (samplers )
82
82
qubit = 0
83
83
H = paulis .Qm (qubit )
84
84
U = gates .Rx (target = qubit , angle = tq .Variable ('a' ))
0 commit comments