Quick start#

To quickly install Qibo and a lightweight simulator for CPU, open a terminal with python >= 3.8 and type:

pip install qibo

This will install the basic primitives to start coding quantum applications.

Instead, if you use conda type:

conda install -c conda-forge qibo

Note

The qibo package alone includes a lightweight numpy simulator for single-thread CPU. Please visit the backends documentation for more details about simulation backends.

Here an example of Quantum Fourier Transform (QFT) 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 an example of adding gates and measurements:

import numpy as np
from qibo import Circuit, 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)