Skip to main content

QLEO (Quobly Logical Emulator Online): Python Interface for Quantum Circuits

Welcome to QLEO, a Python library designed for building, simulating, and analyzing quantum circuits powerd by MIMIQ emulator of QPerfect.

If you encounter any errors or bugs while using QLEO, please report them by opening an issue in the QLEO repository here.
Note: This package uses a proprietary C++ backend that is not part of the public repository.


Installation

Install the library directly from the Quobly GitHub repository:

pip install qleo

Optional Dependencies

To enable visualization feature, ensure you install:

pip install qleo[visualization]

Getting Started

Start by importing the qleo library. This library provides tools for creating, manipulating, and simulating quantum circuits.

  1. Import the Library

    By using from qleo import *, you gain access to all classes and methods required for quantum circuit operations.

    from qleo import *
    
  2. Create and Manipulate Circuits In this step, you create a quantum circuit with Circuit() and add gates to it. Hadamard Gate (GateH): Places each qubit in a superposition state. Controlled-Z Gate (GateCZ): Introduces entanglement between qubits by applying a phase shift if both qubits are in the |1⟩ state.

    n = 10
    c = Circuit()
    c.push(GateH(), range(n))
    c.push(GateCZ(), range(n-1), range(1,n))
    c.push(GateCZ(), 0, n-1)
    
  3. Execute & Get Result Here, you execute the circuit on QuoblySimulator (Simulates the quantum circuit using a state vector approach) and retrieve the result.

    processor = Qleo()
    result = processor.execute(c, nsamples=1000)
    
    print(result)
    

    The result contains detailed information about the circuit execution:

    QCSResults:
    ├── simulator: Quantanium StateVector 1.0
    ├── timings:
    │    ├── apply time: 0.000318101s
    │    └── sample time: 0.000277592s
    ├── fidelity estimate: 1
    ├── average multi-qubit gate error estimate: 0
    ├── most sampled:
    │    ├── bs"0100001000" => 5
    │    ├── bs"0000000000" => 5
    │    ├── bs"1001010001" => 5
    │    ├── bs"0111011110" => 5
    │    └── bs"0010001010" => 4
    ├── 1 executions
    ├── 0 amplitudes
    └── 1000 samples
    

    The output provides a summary of your simulation results, including key information about the backend used, execution details, and measurement outcomes. You'll find details such as the simulator type, timings for circuit execution and measurement, fidelity estimates, and the most frequently observed quantum states. Additionally, it includes the total number of samples and any specific execution metrics for analyzing the performance and accuracy of your quantum circuit.

  4. Get Histogram of the samples The result.histogram() method generates a counts distribution of the sampled measurement outcomes.

    result.histogram()
    
  5. Visualizing the results To visualize the results of your quantum circuits, you can use the plothistogram function provided by the qleo.visualization module.

    Example

    from qleo.visualization import plothistogram
    plothistogram(result)
    

    image


Documentation

The Quobly Framework is based on MIMIQ by QPerfect. Comprehensive documentation, tutorials, and examples on how to build circuits with the Quobly Framework and MIMIQ are available at docs.qperfect.io. Please remember to substitute any occurrences of mimiqcircuits in the documentation with quoblyframwork. For example, in place of from mimiqcircuits import *, use from qleo import *.


GPU support

Qleo supports GPU-accelerated simulation through NVIDIA’s cuStateVec library. This feature is currently available only on Linux systems equipped with an NVIDIA GPU.

To run a simulation on the GPU, use the following command:

sim = Qleo(use_gpu=True)
sim.execute(circuit)

Contact

For issues, suggestions, or inquiries, reach out via:

Metadata

Release files for qleo 0.22.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for qleo 0.22.6
File Interpreter ABI Platform
qleo-0.22.6-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details
qleo-0.22.6-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl Python 3 none Linux glibc 2.17+ x86-64 Details
qleo-0.22.6-py3-none-macosx_14_0_arm64.whl Python 3 none macOS 14.0+ ARM64 Details

Total release size: 2.9 MB

Release files / qleo-0.22.6-py3-none-win_amd64.whl

Download URL qleo-0.22.6-py3-none-win_amd64.whl
Size 8.7 kB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
507119e91e2ac54ccd4d5bbaa3100560f292dfc21f74bec2e78cac607198a24e
BLAKE2b-256 checksum
How to use checksums
1793cdeb1cc12b35116c8e159c89ed9ac5f1b58c7abb82319bb09be0db7a3edf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release files / qleo-0.22.6-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL qleo-0.22.6-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 2.8 MB
Tags Linux glibc 2.17+ x86-64 Python 3
SHA-256 checksum
How to use checksums
1e8176941a45f0cd7decf34f7669e14ab71a97c82765a462f302d3906299583b
BLAKE2b-256 checksum
How to use checksums
6b07a5cb22685eee805ce59f3da497930b1119b274541abadd2e656be6e2d107
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release files / qleo-0.22.6-py3-none-macosx_14_0_arm64.whl

Download URL qleo-0.22.6-py3-none-macosx_14_0_arm64.whl
Size 8.7 kB
Tags Python 3 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
b3e96251b1ce377fba9cb73e1c19ee59c61d55e7b6e2edb897b73043414a3de2
BLAKE2b-256 checksum
How to use checksums
ac6c187b84530e4a894c82f3c8aebf47a5720fd461238f716f614e7a9470ca44
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release history Release notifications | RSS feed

This release

0.22.6 This release

3 release files

0.22.5

3 release files

0.22.1

3 release files

0.22.0

4 release files

0.21.0

4 release files

0.2.0

2 release files

0.1.23

2 release files

0.1.22

2 release files

0.1.21

2 release files

0.1.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page