Skip to content

Commit

Permalink
Fix after qiskit update: qiskit_noise_model (#354)
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesB-1qbit authored Nov 24, 2023
1 parent 4a057cd commit d26e11c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tangelo/linq/target/target_qiskit.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit d26e11c

Please sign in to comment.