Skip to content

Leverage quantum_info in StatevectorSimulatorPy #7670

@Cryoris

Description

@Cryoris

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 making BasicAer depend on it might (1) push us to add more features like supporting classical instructions and (2) make it easier to remove BasicAer in the end
  • the Statevector can be much faster than the current statevector simulator in BasicAer (see below) and speeding it up would be great both for users and us (as several tests use BasicAer)

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_infos 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.

image

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions