make sat test run a little faster
@@ -45,14 +45,13 @@ p cnf 2 3
sols_2 = [(True, True)]
cnf_str_3 = '''
-p cnf 3 5
--1 -2 -3 0
+p cnf 3 4
1 -2 3 0
1 2 -3 0
1 -2 -3 0
-1 2 3 0
'''
-sols_3 = [(True, False, True), (False, False, False), (True, True, False)]
+sols_3 = [(True, True, True), (True, False, True), (False, False, False), (True, True, False)]
class TestSATOracle(QiskitAquaTestCase):
@@ -67,14 +66,14 @@ class TestSATOracle(QiskitAquaTestCase):
sat = SAT(cnf_str, mct_mode=mct_mode)
sat_circuit = sat.construct_circuit()
m = ClassicalRegister(1, name='m')
- for assignment in itertools.product([True, False], repeat=len(sat.variable_register())):
- qc = QuantumCircuit(m, sat.variable_register())
+ for assignment in itertools.product([True, False], repeat=len(sat.variable_register)):
+ qc = QuantumCircuit(m, sat.variable_register)
for idx, tf in enumerate(assignment):
if tf:
- qc.x(sat.variable_register()[idx])
+ qc.x(sat.variable_register[idx])
qc += sat_circuit
- qc.barrier(sat._qr_outcome)
- qc.measure(sat._qr_outcome, m)
+ qc.barrier(sat.outcome_register)
+ qc.measure(sat.outcome_register, m)
counts = q_execute(qc, get_aer_backend(
'qasm_simulator'), shots=num_shots).result().get_counts(qc)
if assignment in sols:
