def test_reset_deterministic(self): """Test QasmSimulator reset with for circuits with deterministic counts""" # For statevector output we can combine deterministic and non-deterministic # count output circuits shots = 100 circuits = ref_reset.reset_circuits_deterministic(final_measure=True) targets = ref_reset.reset_counts_deterministic(shots) qobj = assemble(circuits, self.SIMULATOR, shots=shots) result = self.SIMULATOR.run( qobj, backend_options=self.BACKEND_OPTS).result() self.assertSuccess(result) self.compare_counts(result, circuits, targets, delta=0)
def test_reset_deterministic(self): """Test ExtendedStabilizer reset with for circuits with deterministic counts""" # For statevector output we can combine deterministic and non-deterministic # count output circuits shots = 100 circuits = ref_reset.reset_circuits_deterministic(final_measure=True) qobj = assemble(circuits, QasmSimulator(), shots=shots) targets = ref_reset.reset_counts_deterministic(shots) job = QasmSimulator().run(qobj, backend_options=self.BACKEND_OPTS) result = job.result() self.assertTrue(getattr(result, 'success', False)) self.compare_counts(result, circuits, targets, delta=0)
def test_reset_deterministic(self): """Test ExtendedStabilizer reset with for circuits with deterministic counts""" # For statevector output we can combine deterministic and non-deterministic # count output circuits shots = 100 circuits = ref_reset.reset_circuits_deterministic(final_measure=True) qobj = assemble(circuits, QasmSimulator(), shots=shots) targets = ref_reset.reset_counts_deterministic(shots) job = QasmSimulator().run( qobj, backend_options={"method": "extended_stabilizer"}) result = job.result() self.is_completed(result) self.compare_counts(result, circuits, targets, delta=0)