Exemplo n.º 1
0
 def test_measure_nondeterministic_multi_qubit_without_sampling(self):
     """Test QasmSimulator reset with non-deterministic counts"""
     shots = 2000
     qobj = ref_measure.measure_circuits_qobj_nondeterministic(allow_sampling=False)
     qobj.config.shots = shots
     circuits = [experiment.header.name for experiment in qobj.experiments]
     targets = ref_measure.measure_counts_qobj_nondeterministic(shots)
     job = QasmSimulator().run(qobj)
     result = job.result()
     self.is_completed(result)
     self.compare_counts(result, circuits, targets, delta=0.05 * shots)
Exemplo n.º 2
0
 def test_measure_nondeterministic_multi_qubit_without_sampling(self):
     """Test QasmSimulator measure with non-deterministic counts"""
     shots = 2000
     qobj = ref_measure.measure_circuits_qobj_nondeterministic(
         allow_sampling=False)
     qobj.config.shots = shots
     circuits = [experiment.header.name for experiment in qobj.experiments]
     targets = ref_measure.measure_counts_qobj_nondeterministic(shots)
     result = self.SIMULATOR.run(
         qobj, backend_options=self.BACKEND_OPTS).result()
     self.is_completed(result)
     self.compare_counts(result, circuits, targets, delta=0.05 * shots)
Exemplo n.º 3
0
 def test_measure_nondeterministic_multi_qubit_with_sampling(self):
     """Test CHimulator reset with non-deterministic counts"""
     shots = 2000
     qobj = ref_measure.measure_circuits_qobj_nondeterministic(allow_sampling=True)
     qobj.config.shots = shots
     circuits = [experiment.header.name for experiment in qobj.experiments]
     targets = ref_measure.measure_counts_qobj_nondeterministic(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.05 * shots)