Qibo is a Python library for classical simulation of quantum algorithms.
Some of the key features of Qibo are:
- A standard interface for the implementation and extension of quantum algorithms.
- Modular implementation on GPU and CPU with multi-threading support.
- Availability of multi-GPU distributed approach for circuit simulation.
- Full support of double precision simulation.
Qibo documentation is available at qibo.readthedocs.io.
A simple Quantum Fourier Transform (QFT) example to test your installation:
from qibo.models import QFT
# Create a QFT circuit with 15 qubits
circuit = QFT(15)
# Simulate final state wavefunction default initial state is |00>
final_state = circuit()
Here another example with more gates and shots simulation:
import numpy as np
from qibo.models import Circuit
from qibo import gates
c = Circuit(2)
c.add(gates.X(0))
# Add a measurement register on both qubits
c.add(gates.M(0, 1))
# Execute the circuit with the default initial state |00>.
result = c(nshots=100)
In both cases, the simulation will run in a single device CPU or GPU in double precision complex128
.
If you use the package please cite the following references: