From b5681151d9d4b33e61505cdfefb9e5f889101b5e Mon Sep 17 00:00:00 2001 From: Will Shanks Date: Sun, 13 Oct 2024 23:36:09 -0400 Subject: [PATCH] Pass seed_simulator through to sampler and fix shots in tphi test --- qiskit_experiments/framework/base_experiment.py | 2 ++ test/library/tomography/test_state_tomography.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/qiskit_experiments/framework/base_experiment.py b/qiskit_experiments/framework/base_experiment.py index 0975481f18..4338b851c2 100644 --- a/qiskit_experiments/framework/base_experiment.py +++ b/qiskit_experiments/framework/base_experiment.py @@ -406,6 +406,8 @@ def _run_jobs( raise QiskitError("Only meas level 1 + 2 supported by sampler") if "noise_model" in run_options: sampler.options.simulator.noise_model = run_options["noise_model"] + if "seed_simulator" in run_options: + sampler.options.simulator.seed_simulator = run_options["seed_simulator"] if run_options.get("shots") is not None: sampler.options.default_shots = run_options.get("shots") diff --git a/test/library/tomography/test_state_tomography.py b/test/library/tomography/test_state_tomography.py index 4bc9a904a0..b0ec4b52c8 100644 --- a/test/library/tomography/test_state_tomography.py +++ b/test/library/tomography/test_state_tomography.py @@ -374,7 +374,7 @@ def test_mitigated_full_qst(self, qubits): target = qi.random_statevector(2 ** len(qubits), seed=seed) exp = MitigatedStateTomography(target, physical_qubits=qubits, backend=backend) exp.analysis.set_options(unmitigated_fit=True) - expdata = exp.run(analysis=None) + expdata = exp.run(analysis=None, shots=shots) self.assertExperimentDone(expdata) for fitter in FITTERS: