This idiom is used in other places in the code, so we should
remain consistent.
... | ... |
@@ -53,7 +53,7 @@ def test_n_qubits_invalid(gate): |
53 | 53 |
|
54 | 54 |
@given(n_qubits, n_qubit_gates) |
55 | 55 |
def test_controlled(n, gate): |
56 |
- nq = 2 ** n |
|
56 |
+ nq = 1 << n |
|
57 | 57 |
controlled_gate = qsim.gate.controlled(gate) |
58 | 58 |
assert controlled_gate.shape[0] == 2 * nq |
59 | 59 |
assert np.all(controlled_gate[:nq, :nq] == np.identity(nq)) |