-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Description
What is the expected enhancement?
We previously discussed whether we can remove the BasicAer
provider, see #4443, and concluded that we will still keep it for the time being. It might be good to make the statevector simulator in BasicAer
use quantum_info.Statevector
under the hood for two main reasons:
- (probably the more important reason!)
quantum_info
is a module we're further developing and makingBasicAer
depend on it might (1) push us to add more features like supporting classical instructions and (2) make it easier to removeBasicAer
in the end - the
Statevector
can be much faster than the current statevector simulator inBasicAer
(see below) and speeding it up would be great both for users and us (as several tests useBasicAer
)
Since right now the Statevector
does not support all the same instructions as BasicAer
we could for instance only use the Statevector
if the simulated circuit consists of unitary operations, or we have to directly extend the supported operation set of it (which would probably be a project on itself).
BasicAer's statevector vs quantum_info
s statevector
Now the performance of the simulator does depend on the system specifications, e.g. @mtreinish and I obtained very different results using the Statevector
class. These are some small benchmarks for 2-16 qubits circuits with different depth using the qiskit.circuit.library.EfficientSU2(num_qubits, reps=reps)
circuit.
This was run on macOS 12.1 with a 2.3GHz i7 processor and 32 GB of RAM and Terra main @ 1ae663d (version 0.20.0), NumPy 1.19.0. Here, the relative speedups vary and range from ~4 times faster for the 16 qubit circuits to ~20 for the 2q systems.