-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Leverage quantum_info
in StatevectorSimulatorPy
#7670
Comments
As part of QAMP spring 2022, my mentee @alejomonbar will be tackling this issue. |
In the end, the most important function used by a circuit execution using the BasicAer backend is run_experiment. A state vector attribute will be updated depending on the set of experiment instructions, which can be unitary, SINGLE_QUBIT_GATES, id or u0, CX, reset, barrier, measure, and bfunc . The idea is to create a similar function that we called sample_circuit, but in this case, using the quantum_info package, for that package all the functions less bfunc are already implemented. |
Thanks, @alejomonbar . Just to clarify, we did not have the time to fix this issue during QAMP. Someone else should feel free to pick this up. |
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 inBasicAer
usequantum_info.Statevector
under the hood for two main reasons: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 endStatevector
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 asBasicAer
we could for instance only use theStatevector
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 statevectorNow 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 theqiskit.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.
The text was updated successfully, but these errors were encountered: