def test_pauli_measure_noise(self, method, device): """Test simulation with Pauli measure error noise model.""" backend = self.backend(method=method, device=device) shots = 1000 circuits = ref_pauli_noise.pauli_measure_error_circuits() with self.assertWarns(DeprecationWarning): noise_models = ref_pauli_noise.pauli_measure_error_noise_models() targets = ref_pauli_noise.pauli_measure_error_counts(shots) for circuit, noise_model, target in zip(circuits, noise_models, targets): backend.set_options(noise_model=noise_model) result = backend.run(circuit, shots=shots).result() self.assertSuccess(result) self.compare_counts(result, [circuit], [target], delta=0.05 * shots)
def test_pauli_measure_noise(self): """Test simulation with Pauli measure error noise model.""" shots = 1000 circuits = ref_pauli_noise.pauli_measure_error_circuits() noise_models = ref_pauli_noise.pauli_measure_error_noise_models() targets = ref_pauli_noise.pauli_measure_error_counts(shots) for circuit, noise_model, target in zip(circuits, noise_models, targets): qobj = assemble(circuit, self.SIMULATOR, shots=shots) result = self.SIMULATOR.run( qobj, noise_model=noise_model, **self.BACKEND_OPTS).result() self.assertSuccess(result) self.compare_counts(result, [circuit], [target], delta=0.05 * shots)