From d26e11caf8bc9e44bb949f3b57bb99638bae04f2 Mon Sep 17 00:00:00 2001 From: James Brown <84878946+JamesB-1qbit@users.noreply.github.com> Date: Fri, 24 Nov 2023 15:17:02 -0500 Subject: [PATCH] Fix after qiskit update: qiskit_noise_model (#354) --- tangelo/linq/target/target_qiskit.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tangelo/linq/target/target_qiskit.py b/tangelo/linq/target/target_qiskit.py index e90cd58f9..4ad13f81f 100644 --- a/tangelo/linq/target/target_qiskit.py +++ b/tangelo/linq/target/target_qiskit.py @@ -67,7 +67,7 @@ def simulate_circuit(self, source_circuit: Circuit, return_statevector=False, in """ def aer_backend_with_statevector(translated_circuit): "Generate AerSimulator backend and append save statevector instruction to translated_circuit" - backend = self.AerSimulator(method='statevector') + backend = self.AerSimulator(method='statevector', noise_model=qiskit_noise_model) translated_circuit = self.qiskit.transpile(translated_circuit, backend) translated_circuit.save_statevector() return backend, translated_circuit @@ -90,7 +90,7 @@ def load_statevector(translated_circuit, initial_statevector): def run_and_measure_one_shot(backend, translated_circuit): "Return statevector and mid-circuit measurement for one shot" - sim_results = backend.run(translated_circuit, noise_model=qiskit_noise_model, shots=1).result() + sim_results = backend.run(translated_circuit, shots=1).result() current_state = sim_results.get_statevector(translated_circuit) measure = next(iter(self.qiskit.result.marginal_counts(sim_results, indices=list(range(n_meas)), inplace=True).get_counts()))[::-1] return current_state, measure