Пример #1
0
 def test_measure_nondeterministic_without_sampling(self):
     """Test QasmSimulator measure with nin-deterministic counts without sampling"""
     shots = 2000
     circuits = ref_measure.measure_circuits_nondeterministic(allow_sampling=False)
     targets = ref_measure.measure_counts_nondeterministic(shots)
     job = execute(circuits, QasmSimulator(), shots=shots)
     result = job.result()
     self.is_completed(result)
     self.compare_counts(result, circuits, targets, delta=0.05 * shots)
Пример #2
0
 def test_measure_nondeterministic_without_sampling(self):
     """Test CHimulator measure with non-deterministic counts without sampling"""
     shots = 2000
     circuits = ref_measure.measure_circuits_nondeterministic(
         allow_sampling=False)
     qobj = qiskit_compile(circuits, QasmSimulator(), shots=shots)
     targets = ref_measure.measure_counts_nondeterministic(shots)
     job = QasmSimulator().run(qobj, backend_options={"method": "ch"})
     result = job.result()
     self.is_completed(result)
     self.compare_counts(result, circuits, targets, delta=0.05 * shots)
Пример #3
0
 def test_measure_nondeterministic_without_sampling(self):
     """Test QasmSimulator measure with nin-deterministic counts without sampling"""
     shots = 2000
     circuits = ref_measure.measure_circuits_nondeterministic(
         allow_sampling=False)
     targets = ref_measure.measure_counts_nondeterministic(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.05 * shots)