def test_conditional_1bit(self):
     """Test conditional operations on 1-bit conditional register."""
     circuits = ref_conditionals.conditional_circuits_1bit(final_measure=False)
     targets = ref_conditionals.conditional_statevector_1bit()
     job = execute(circuits, StatevectorSimulator(), shots=1)
     result = job.result()
     self.is_completed(result)
     self.compare_statevector(result, circuits, targets)
 def test_conditional_1bit(self):
     """Test conditional operations on 1-bit conditional register."""
     shots = 100
     circuits = ref_conditionals.conditional_circuits_1bit(final_measure=True)
     targets = ref_conditionals.conditional_counts_1bit(shots)
     job = execute(circuits, QasmSimulator(), shots=shots)
     result = job.result()
     self.is_completed(result)
     self.compare_counts(result, circuits, targets, delta=0)
Example #3
0
 def test_conditional_1bit(self):
     """Test conditional operations on 1-bit conditional register."""
     shots = 100
     circuits = ref_conditionals.conditional_circuits_1bit(
         final_measure=True)
     qobj = qiskit_compile(circuits, QasmSimulator(), shots=shots)
     targets = ref_conditionals.conditional_counts_1bit(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_1bit(self):
     """Test conditional operations on 1-bit conditional register."""
     shots = 100
     circuits = ref_conditionals.conditional_circuits_1bit(
         final_measure=True)
     targets = ref_conditionals.conditional_counts_1bit(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)