Improve Quantum Simulations With Qiskit Aer + cuQuantum

Qiskit
Qiskit
Published in
2 min readMar 22, 2022

Qiskit can now utilize NVIDIA’s cuQuantum software development kit to help accelerate quantum simulations on classical computers. The first cuQuantum library, cuStateVec, was released as a public beta late last year, and serves to accelerate statevector simulation. Now, you can use cuQuantum within Qiskit’s high-performance simulator, Qiskit Aer.

The Qiskit team began experimenting with cuQuantum to investigate whether it could further accelerate quantum circuit simulation within Aer. We have already found Aer+cuQuantum can deliver performance gains when simulating circuits with more than 20 qubits. There is, unfortunately, a small performance penalty for small circuits which we hope to address in a future release with the NVIDIA cuQuantum team.

High-performance simulators are a critical tool to debug and develop new quantum applications. We are pleased to enable the cuQuantum integration in Aer to improve the developer experience and deliver faster simulation capability.

So, how do you get started? Well, here is a simple example to simulate Quantum Volume circuit from Qiskit’s circuit library. You can change number of qubits, depth and shots to be simulated. Below, find a typical simulation of a Quantum Volume circuit.

15 qubits Quantum Volume, Simulation Time = 0.004826054 sec
{'011010000111101': 1, '100101001000001': 1, '101100010110011': 1, '011110101110001': 1, '000001110000100': 1, '001101110000100': 1, '101100010101010': 1, '010111001000001': 1, '100100010100111': 1, '001101110011000': 1}

The example above does not use cuStateVec but calculated by using default GPU backend of Qiskit Aer.

To enable cuStateVec, runtime option cuStateVec_enable should be set to True.

cuStateVector is used for the simulation
15 qubits, Time = 0.007037462 sec
{'011010000111101': 1, '100101001000001': 1, '101100010110011': 1, '011110101110001': 1, '000001110000100': 1, '001101110000100': 1, '101100010101010': 1, '010111001000001': 1, '100100010100111': 1, '001101110011000': 1}

Now let’s compare the performance, following the simulation time of Quantum Volume for range of qubits.

As you can see, cuStateVec is faster for higher number of qubits. This will be improved in the future release of cuQuantum so that it will be faster for lower number of qubits too. Before the improved release, please switch enabling/disabling cuStateVec by using cuStateVec_enable option suitable for your actual simulations.

Read more about cuQuantum here.

--

--

Qiskit
Qiskit

An open source quantum computing framework for writing quantum experiments and applications