def test_reset_nondeterministic(self, method, device):
     """Test AerSimulator reset with for circuits with non-deterministic counts"""
     backend = self.backend(method=method, device=device)
     # For statevector output we can combine deterministic and non-deterministic
     # count output circuits
     shots = 4000
     circuits = ref_reset.reset_circuits_nondeterministic(
         final_measure=True)
     targets = ref_reset.reset_counts_nondeterministic(shots)
     result = backend.run(circuits, shots=shots).result()
     self.assertSuccess(result)
     self.compare_counts(result, circuits, targets, delta=0.05 * shots)
Exemple #2
0
 def test_reset_nondeterministic(self):
     """Test ExtendedStabilizer reset with for circuits with non-deterministic counts"""
     # For statevector output we can combine deterministic and non-deterministic
     # count output circuits
     shots = 4000
     circuits = ref_reset.reset_circuits_nondeterministic(
         final_measure=True)
     qobj = assemble(circuits, QasmSimulator(), shots=shots)
     targets = ref_reset.reset_counts_nondeterministic(shots)
     job = QasmSimulator().run(qobj, **self.BACKEND_OPTS_SAMPLING)
     result = job.result()
     self.assertSuccess(result)
     self.compare_counts(result, circuits, targets, delta=0.05 * shots)
Exemple #3
0
 def test_reset_nondeterministic(self):
     """Test QasmSimulator reset with for circuits with non-deterministic counts"""
     # For statevector output we can combine deterministic and non-deterministic
     # count output circuits
     shots = 4000
     circuits = ref_reset.reset_circuits_nondeterministic(
         final_measure=True)
     targets = ref_reset.reset_counts_nondeterministic(shots)
     qobj = assemble(circuits, self.SIMULATOR, shots=shots)
     result = self.SIMULATOR.run(
         qobj, **self.BACKEND_OPTS).result()
     self.assertSuccess(result)
     self.compare_counts(result, circuits, targets, delta=0.05 * shots)
 def test_reset_nondeterministic(self):
     """Test ExtendedStabilizer reset with for circuits with non-deterministic counts"""
     # For statevector output we can combine deterministic and non-deterministic
     # count output circuits
     shots = 2000
     circuits = ref_reset.reset_circuits_nondeterministic(final_measure=True)
     qobj = qiskit_compile(circuits, QasmSimulator(), shots=shots)
     targets = ref_reset.reset_counts_nondeterministic(shots)
     job = QasmSimulator().run(qobj,
                               backend_options={
                                   "method": "extended_stabilizer",
                                   "disable_measurement_opt": False
                               })
     result = job.result()
     self.is_completed(result)
     self.compare_counts(result, circuits, targets, delta=0.05 * shots)