Skip to main content

Quobly Logical Emulator Online

Project description

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:

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

qleo-0.22.1-py3-none-win_amd64.whl (8.7 kB view details)

Uploaded Python 3Windows x86-64

qleo-0.22.1-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (10.4 kB view details)

Uploaded Python 3manylinux: glibc 2.17+ x86-64

qleo-0.22.1-py3-none-macosx_14_0_arm64.whl (8.7 kB view details)

Uploaded Python 3macOS 14.0+ ARM64

File details

Details for the file qleo-0.22.1-py3-none-win_amd64.whl.

File metadata

  • Download URL: qleo-0.22.1-py3-none-win_amd64.whl
  • Upload date:
  • Size: 8.7 kB
  • Tags: Python 3, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for qleo-0.22.1-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 5b4c89bfb23e59aeae6b0a94d690c5365415c6ff453a09e29fc7228db7bd7c69
MD5 e25f967e1f521cf5bcb62aa9dc11de4f
BLAKE2b-256 aa49de3c7d15ba85341350a262cc84aecd0e8e66249dd5f885e8f1c8716d59a5

See more details on using hashes here.

File details

Details for the file qleo-0.22.1-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for qleo-0.22.1-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 898acdb2b7169740f034a8f06f4b62000fd8cb0268a98678091531f884fbe9a2
MD5 e3a8aeacd6f8d57cfd9a920fd75b2cff
BLAKE2b-256 2f04a94c250bc8968cca8b153780903f311a6790f868cba200798a60f1c3abeb

See more details on using hashes here.

File details

Details for the file qleo-0.22.1-py3-none-macosx_14_0_arm64.whl.

File metadata

  • Download URL: qleo-0.22.1-py3-none-macosx_14_0_arm64.whl
  • Upload date:
  • Size: 8.7 kB
  • Tags: Python 3, macOS 14.0+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for qleo-0.22.1-py3-none-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 65b7fc5b46bb973a28ae87c489c0149f92134802726de2529ae79e5f259a4e55
MD5 b1d41a228f36902f6c7a3ee547c6d01e
BLAKE2b-256 ef78d29f53a955a6f4d9b8defe1ecb9133b7ffd53d13b98d3be66bae5d048e71

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page