In Qiskit, there are several ways to choose simulator: one is

from qiskit import Aer
backend = Aer.get_backend('aer_simulator')
result = backend.run(circ).result()

another one is

from qiskit.providers.aer import AerSimulator
backend = AerSimulator()

,where circ is QuantumCircuit(n). Do they always return the same result?


1 Answer 1


They're functionally equivalent the first approach is primarily just a shortcut that involves less typing to create a simulator backend and also follows the standardized "provider" interface for backends (which honestly makes more sense for remote backends, like real devices or remote simulators). But, both approaches will initialize a new AerSimulator backend object with the default settings and if you run the circuit you will get roughly the same result with either.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.