Esempio n. 1
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)
     job = execute(circuits, QasmSimulator(), shots=shots)
     result = job.result()
     self.is_completed(result)
     self.compare_counts(result, circuits, targets, delta=0)
Esempio n. 2
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)