def test_measure_deterministic_multi_qubit_without_sampling(self): """Test QasmSimulator multi-qubit measure with deterministic counts without sampling""" shots = 100 qobj = ref_measure.measure_circuits_qobj_deterministic(allow_sampling=False) qobj.config.shots = shots circuits = [experiment.header.name for experiment in qobj.experiments] targets = ref_measure.measure_counts_qobj_deterministic(shots) job = QasmSimulator().run(qobj) result = job.result() self.is_completed(result) self.compare_counts(result, circuits, targets, delta=0)
def test_measure_deterministic_multi_qubit_with_sampling(self): """Test QasmSimulator multi-qubit measure with deterministic counts with sampling""" shots = 100 qobj = ref_measure.measure_circuits_qobj_deterministic( allow_sampling=True) qobj.config.shots = shots circuits = [experiment.header.name for experiment in qobj.experiments] targets = ref_measure.measure_counts_qobj_deterministic(shots) result = self.SIMULATOR.run( qobj, backend_options=self.BACKEND_OPTS).result() self.is_completed(result) self.compare_counts(result, circuits, targets, delta=0)
def test_measure_deterministic_multi_qubit_with_sampling(self): """Test CHSimulator multi-qubit measure with deterministic counts with sampling""" shots = 100 qobj = ref_measure.measure_circuits_qobj_deterministic(allow_sampling=True) qobj.config.shots = shots circuits = [experiment.header.name for experiment in qobj.experiments] targets = ref_measure.measure_counts_qobj_deterministic(shots) job = QasmSimulator().run(qobj, backend_options={ "method": "ch", "disable_measurement_opt":False }) result = job.result() self.is_completed(result) self.compare_counts(result, circuits, targets, delta=0)