qibo

repository·master·Indexed 17 days ago

https://github.com/qiboteam/qibo

A full-stack API and framework for quantum simulation and hardware control with hardware acceleration. Qibo provides a device-agnostic way to define and run quantum circuits across various CPU and GPU backends, supporting features such as adiabatic evolution, Variational Quantum Eigensolvers (VQE), and quantum autoencoders for anomaly detection.

Tokens
63.2K
Snippets
159
Records
267
Agent score
55%

What's inside qibo

  1. Overview of Qibo hardware control and ecosystem

    master

    Beyond simulation, Qibo provides tools for managing and controlling quantum hardware (specifically superconducting qubits):

    • qibolab: For automatic deployment of circuits on self-hosted hardware. Includes pulse sequence generation, drivers for control devices, and circuit-to-pulse transpilation.
    • qibocal: A library for Quantum Characterization, Validation, and Verification (QCVV) using Qibo and Qibolab.
    • qibosoq: A server integrating Qick into the Qibolab ecosystem for executing circuits and pulse sequences.
    • qibo-cloud-backends: Provides access to cloud-based quantum hardware, compatible with both internal labs and external vendors.
  2. Overview of the Qibo ecosystem

    master

    Qibo is an open-source full-stack API designed for quantum simulation and quantum hardware control. It provides an agnostic approach to bridge classical hardware and experimental setups through a software stack that automates quantum computation.

    The ecosystem consists of:

    • Language API: A Python 3-based interface for developing quantum applications, models, and algorithms.
    • Models and Algorithms: A large codebase of pre-implemented quantum models and algorithms.
    • Laboratory Management & Hardware Control: Tools for managing quantum hardware and controlling experimental apparatus.
    • Backend Drivers: A plug-and-play mechanism that allows users to specialize code for different execution environments, including classical simulators (multi-threading CPU, single GPU, multi-GPU) and quantum hardware (superconducting, ion trap, FPGA, and AWG devices).
  3. What is Qibo?

    master

    Qibo is an open-source, full-stack API designed for quantum simulation and quantum hardware control. It serves as a quantum middleware that provides a device-agnostic approach to constructing and executing quantum circuits.

    Key capabilities include:

    • Standardized Language: A common way to define and run quantum circuits regardless of the underlying hardware or simulator.
    • Plug-and-Play Backends: Support for various simulation and hardware drivers.
    • Efficient Simulation: Backends optimized for CPU (multi-threading), GPU, and multi-GPU environments.
    • Extensible Ecosystem: A growing collection of quantum algorithms, models, and applications.
  4. Overview of Qibo

    master

    Qibo is an open-source full-stack API designed for quantum simulation and quantum hardware control. It provides a device-agnostic approach to constructing and executing quantum circuits using plug-and-play backend drivers.

    Key capabilities include:

    • Standardized Circuit Language: Define circuits that can run on various simulation or hardware backends.
    • Efficient Simulation: Support for CPU (multi-threaded), single-GPU, and multi-GPU backends.
    • Extensibility: A simple mechanism for implementing new simulation and hardware backend drivers.
    • Algorithm Library: A growing collection of quantum algorithm applications and tutorials.
  5. Explore Qibo applications by topic

    master

    Qibo provides various tutorials and code examples categorized by scientific and computational domains. You can find implementation guides for the following topics:

    • Complexity theory: Grover's algorithm for 3-SAT and Adiabatic quantum computing for 3-SAT.
    • Condensed Matter Physics: AAVQE (Adaptive Variational Quantum Eigensolver).
    • Cryptography: Hash-based Grover's algorithm.
    • Finance: Unary encoding applications.
    • High-Energy Physics: qPDF and Anomaly Detection.
    • Quantum Physics: Quantum Singular Value Decomposition (QSVD), Tangle, Adiabatic computing, Shor's algorithm, Bell variational circuits, FALQON, and Grover's algorithm.
    • Quantum Machine Learning: Variational Classifiers, Data Reuploading Classifiers, Variational Quantum Regressors (VQRegressor), Autoencoders, EF_QAE, QFIAE, QCNN Classifiers, Quantum Clustering, and Adiabatic QML.
  6. Adiabatic evolution Benchmark overview

    master
    The Adiabatic evolution benchmark evaluates Qibo's performance when simulating adiabatic evolution under transverse field Ising Hamiltonians using linear scaling s(t) = t. The benchmark simulates for a total time of $T=1$ using double precision (complex128). It compares different solvers across both CPU and GPU hardware to analyze execution time scaling relative to the number of qubits and the time step dt used for discretization and integration.
  7. Explore Qibo quantum physics tutorials and examples

    master

    Qibo provides a variety of tutorials demonstrating quantum circuits applied to specific physics and machine learning problems. You can find implementations for:

    Quantum Machine Learning & Classifiers

    • Variational Quantum Classifier (variational_classifier/)
    • Quantum Convolutional Neural Network (QCNN) classifier (qcnn_classifier/)
    • Data reuploading for universal quantum classifiers (reuploading_classifier/)
    • Quantum autoencoder for data compression (autoencoder/)
    • Quantum autoencoders with enhanced data encoding (EF_QAE/)
    • Quantum anomaly detection (anomaly_detection/)
    • Quantum k-medians clustering (qclustering/)

    Algorithms & Optimization

    • Grover’s Algorithm for Satisfiability Problems (grover3sat/) and Toy Sponge Hash functions (hash-grover/)
    • Shor's factorization algorithm (shor/)
    • Quantum Fourier Iterative Amplitude Estimation (qfiae/)
    • Adiabatic Evolution examples (adiabatic/) and solving Exact Cover problems (adiabatic-3SAT/)
    • Feedback-based ALgorithm for Quantum OptimizatioN (FALQON) (falqon/)

    Physics & Mathematical Applications

    • Variational Quantum Regressor using the Parameter Shift Rule (vqregressor/)
    • Quantum Singular Value Decomposer (QSVD) (qsvd/)
    • Measuring the tangle of three-qubit states (3_tangle/)
    • Quantum unary approach to option pricing (unary/)
    • Determining proton content (qPDF/)
    • Maximal violation of Bell inequalities variationally (bell-variational/)
  8. Core abstractions in Qibo: Circuits, Gates, and Backends

    master

    Qibo is built around a backend-agnostic architecture. The primary components are:

    • Circuits: Defined in qibo/models/circuit.py, these represent the quantum computation structure.
    • Gates: Defined in qibo/gates, these are the building blocks of circuits.
    • Backends: Defined in qibo/backends, these are responsible for either simulating abstract circuits or executing them on physical quantum hardware.

    Because circuits and gates are backend-agnostic, you can define a single circuit and execute it using different backends (e.g., switching from a classical simulator to a hardware provider) without changing the circuit definition.

  9. Manage stabilizer states with the Clifford class

    master

    The qibo.quantum_info.clifford.Clifford object represents a stabilizer state using a phase-space (symplectic matrix) representation. This allows for efficient simulation of Clifford circuits.

    Key capabilities:

    • Creation: You can create a Clifford object by passing a symplectic matrix to the constructor or by executing a Clifford circuit via the CliffordBackend.
    • Extraction: You can extract the generators of the stabilizers, the full set of stabilizer operators, or the destabilizers.

    To create a zero state manually:

    1. Use CliffordBackend to generate a symplectic matrix.
    2. Pass that matrix to the Clifford constructor.
    from qibo.quantum_info import Clifford
    from qibo.backends import CliffordBackend
    
    # construct the |00...0> state
    backend = CliffordBackend("numpy")
    symplectic_matrix = backend.zero_state(nqubits=3)
    clifford = Clifford(symplectic_matrix, platform="numpy")
    
    # Extracting information
    generators, phases = clifford.generators()
    stabilizers = clifford.stabilizers()
    destabilizers = clifford.destabilizers()
  10. Use the qPDF variational circuit model for High Energy Physics

    master
    Qibo provides a specialized variational circuit model named qPDF for simulating parton distribution functions (PDFs). This model is built on top of qibo.models.Circuit and allows users to evaluate different PDF flavours at specific momentum fraction x values. For detailed implementation steps and usage patterns, refer to the examples/qPDF tutorial in the repository.
  11. Work with Hamiltonians in Qibo

    master

    Qibo provides several ways to represent and use Hamiltonians, centered around the qibo.hamiltonians.abstract.AbstractHamiltonian base class.

    Matrix Hamiltonian

    qibo.hamiltonians.Hamiltonian uses a full matrix representation in the computational basis. For $n$ qubits, the matrix size is $2^n \times 2^n$.

    • Sparse Matrices: You can construct Hamiltonians using sparse matrices from scipy.sparse (supported by numpy and qibojit backends) or tensorflow.sparse (supported by tensorflow backend).
    • Both backends support calculating expectation values using sparse matrices.

    Symbolic Hamiltonian

    qibo.hamiltonians.SymbolicHamiltonian allows defining Hamiltonians using sympy symbols. This is more efficient for larger qubit numbers as the full matrix is only constructed when required.

    • Time Evolution: When using a SymbolicHamiltonian for time evolution, Qibo automatically performs evolution using the Trotter method or the evolution operator by splitting the Hamiltonian into sums of commuting terms.