def test_conditional_2bit(self): """Test conditional operations on 2-bit conditional register.""" circuits = ref_conditionals.conditional_circuits_2bit(final_measure=False) targets = ref_conditionals.conditional_statevector_2bit() job = execute(circuits, StatevectorSimulator(), shots=1) result = job.result() self.is_completed(result) self.compare_statevector(result, circuits, targets)
def test_conditional_2bit(self): """Test conditional operations on 2-bit conditional register.""" shots = 100 circuits = ref_conditionals.conditional_circuits_2bit(final_measure=True) targets = ref_conditionals.conditional_counts_2bit(shots) job = execute(circuits, QasmSimulator(), shots=shots) result = job.result() self.is_completed(result) self.compare_counts(result, circuits, targets, delta=0)
def test_conditional_2bit(self): """Test conditional operations on 2-bit conditional register.""" shots = 100 circuits = ref_conditionals.conditional_circuits_2bit( final_measure=True) qobj = qiskit_compile(circuits, QasmSimulator(), shots=shots) targets = ref_conditionals.conditional_counts_2bit(shots) job = QasmSimulator().run(qobj, backend_options={"method": "ch"}) result = job.result() self.is_completed(result) self.compare_counts(result, circuits, targets, delta=0)
def test_conditional_2bit(self): """Test conditional operations on 2-bit conditional register.""" shots = 100 circuits = ref_conditionals.conditional_circuits_2bit( final_measure=True) targets = ref_conditionals.conditional_counts_2bit(shots) qobj = compile(circuits, self.SIMULATOR, shots=shots) result = self.SIMULATOR.run( qobj, backend_options=self.BACKEND_OPTS).result() self.is_completed(result) self.compare_counts(result, circuits, targets, delta=0)