Ejemplo n.º 1
0
 def test_reset_nondeterministic(self):
     """Test StatevectorSimulator reset with for circuits with non-deterministic counts"""
     # For statevector output we can combine deterministic and non-deterministic
     # count output circuits
     circuits = ref_reset.reset_circuits_nondeterministic(final_measure=False)
     targets = ref_reset.reset_statevector_nondeterministic()
     job = execute(circuits, StatevectorSimulator(), shots=1)
     result = job.result()
     self.assertTrue(getattr(result, 'success', False))
     self.compare_statevector(result, circuits, targets)
 def test_reset_nondeterministic(self):
     """Test StatevectorSimulator reset with for circuits with non-deterministic counts"""
     # For statevector output we can combine deterministic and non-deterministic
     # count output circuits
     circuits = ref_reset.reset_circuits_nondeterministic(
         final_measure=False)
     targets = ref_reset.reset_statevector_nondeterministic()
     job = execute(circuits, self.SIMULATOR, shots=1, **self.BACKEND_OPTS)
     result = job.result()
     self.assertSuccess(result)
     self.compare_statevector(result, circuits, targets)
 def test_reset_nondeterministic(self, device):
     """Test StatevectorSimulator reset with for circuits with non-deterministic counts"""
     # For statevector output we can combine deterministic and non-deterministic
     # count output circuits
     backend = self.backend(device=device)
     circuits = ref_reset.reset_circuits_nondeterministic(
         final_measure=False)
     circuits = transpile(circuits, backend, optimization_level=1)
     result = backend.run(circuits, shots=1).result()
     targets = ref_reset.reset_statevector_nondeterministic()
     self.assertSuccess(result)
     self.compare_statevector(result, circuits, targets)