Skip to content

Commit d0344b9

Browse files
committed
linty
1 parent a6415e8 commit d0344b9

3 files changed

Lines changed: 7 additions & 1 deletion

File tree

qualtran/bloqs/reflections/reflection_using_prepare_test.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ def get_3q_uniform_dirac_notation(signs, global_phase: complex = 1):
116116
@pytest.mark.parametrize('global_phase', [+1, -1j])
117117
def test_reflection_using_prepare(num_ones, eps, global_phase):
118118
return pytest.xfail("Cirq regression") # TODO error message
119+
# pylint: disable=unreachable
119120

120121
data = [1] * num_ones
121122
prepare_gate = StatePreparationAliasSampling.from_probabilities(data, precision=eps)
@@ -142,6 +143,7 @@ def test_reflection_using_prepare(num_ones, eps, global_phase):
142143
"sign function has failed to return 1 or -1. This may be due to nan or complex input."
143144
)
144145
assert cirq.dirac_notation(prepared_state) == get_3q_uniform_dirac_notation(signs, global_phase)
146+
# pylint: enable=unreachable
145147

146148

147149
def test_reflection_using_prepare_diagram():

qualtran/bloqs/rotations/phasing_via_cost_function_test.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ def test_hamming_weight_phasing_using_phase_via_cost_function(
101101
n: int, exponent: float, eps: float, use_phase_gradient: bool, normalize_cost_function: bool
102102
):
103103
return pytest.xfail("Cirq regression sigkill") # TODO: error message
104+
# pylint: disable=unreachable
104105
cost_reg_size = 2 ** n.bit_length()
105106
normalization_factor = 1 if normalize_cost_function else cost_reg_size
106107
sim = cirq.Simulator(dtype=np.complex128)
@@ -123,6 +124,7 @@ def test_hamming_weight_phasing_using_phase_via_cost_function(
123124
hw_phasing = cirq.Circuit(state_prep, gh.operation)
124125
hw_final_state = sim.simulate(hw_phasing).final_state_vector
125126
np.testing.assert_allclose(expected_final_state, hw_final_state, atol=eps)
127+
# pylint: enable=unreachable
126128

127129

128130
@attrs.frozen

qualtran/bloqs/rotations/quantum_variable_rotation_test.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,8 @@ def test_qvr_phase_gradient_unitary_for_inexact_gamma():
126126
@pytest.mark.slow
127127
@pytest.mark.parametrize('normalize', [True, False])
128128
def test_qvr_phase_gradient_cost_reg_greater_than_b_grad(normalize: bool):
129-
return pytest.xfail("Cirq regression sigkill") # TODO: github issue
129+
return pytest.xfail("Cirq regression sigkill") # TODO: github issue
130+
# pylint: disable=unreachable
130131
n, gamma, eps = (9, (2**20 - 1) / 2**20, 1e-1)
131132
# Note that `gamma` is of the form `0.111111111` and thus has worst case complexity
132133
# in terms of adding errors
@@ -146,6 +147,7 @@ def test_qvr_phase_gradient_cost_reg_greater_than_b_grad(normalize: bool):
146147
]
147148
)
148149
np.testing.assert_allclose(final_state, expected_state, atol=eps)
150+
# pylint: enable=unreachable
149151

150152

151153
@pytest.mark.parametrize('n', range(2, 50))

0 commit comments

Comments
 (0)