minor fix test on cnx
@@ -36,9 +36,9 @@ class TestCNX(QiskitAquaTestCase):
c = QuantumRegister(num_controls, name='c')
o = QuantumRegister(1, name='o')
a = QuantumRegister(num_ancillae, name='a')
- qc = QuantumCircuit(o, c, a)
allsubsets = list(chain(*[combinations(range(num_controls), ni) for ni in range(num_controls + 1)]))
for subset in allsubsets:
+ qc = QuantumCircuit(o, c, a)
for idx in subset:
qc.x(c[idx])
qc.cnx(
@@ -48,7 +48,6 @@ class TestCNX(QiskitAquaTestCase):
)
for idx in subset:
qc.x(c[idx])
- # print(qc.qasm())
vec = np.asarray(q_execute(qc, 'local_statevector_simulator').result().get_statevector(qc))
vec_o = [0, 1] if len(subset) == num_controls else [1, 0]
np.testing.assert_almost_equal(
