Skip to main content

A set of tools for quantum calculations.

Project description

Logo

quantum loop

A set of tools for quantum calculations.

Build Status Docs PyPI pyversions PyPI status PyPI version fury.io
Types: Pyrefly Code style: Ruff Format PyPI Downloads GitHub license

A Qubit in a regular computer is quantum of algorithm that is executed in
one iteration of a cycle in a separate processor thread.
Quantum is a function with an algorithm of task for data processing.
In this case, the Qubit is not a single information,
but it is a concept of the principle of operation of quantum calculations on a regular computer.


Documentation

Requirements

Installation

uv add quantum-loop

Usage

Examples

"""Count qubits."""

from ql import count_qubits


def main() -> None:
    # Counting the number of conceptual qubits of your computer.
    num = count_qubits()
    print(num)  # => 15


if __name__ == "__main__":
    main()
"""QuantumLoop - LoopMode.PROCESS_POOL ."""

from ql import QuantumLoop


def task(num: int) -> int | None:
    """Quantum."""
    return num * num if num % 2 == 0 else None


def main() -> None:
    # Separation of the cycle into quantum algorithms for
    # multiprocessing data processing.
    data = range(1, 10)
    results = QuantumLoop(task, data).run()
    print(results)  # => [4, 16, 36, 64]


if __name__ == "__main__":
    main()
"""QuantumLoop - LoopMode.THREAD_POOL ."""

from pathlib import Path
from ql import LoopMode, QuantumLoop


def task(path: str) -> str:
    """Quantum."""
    with Path(path).open("r", encoding="utf-8") as f:
        return f.readline().strip()


def main() -> None:
    # Separation of the cycle into quantum algorithms for
    # multiprocessing data processing.
    data = [
      "assets/files/file_1.txt",
      "assets/files/file_2.txt",
      "assets/files/file_3.txt",
    ]
    results = QuantumLoop(
      task,
      data,
      mode=LoopMode.THREAD_POOL,
    ).run()
    print(results)  # => ["Hello World 1", "Hello World 2", "Hello World 3"]


if __name__ == "__main__":
    main()

Changelog

MIT

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 Distribution

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

quantum_loop-0.3.12-py3-none-any.whl (6.6 kB view details)

Uploaded Python 3

File details

Details for the file quantum_loop-0.3.12-py3-none-any.whl.

File metadata

  • Download URL: quantum_loop-0.3.12-py3-none-any.whl
  • Upload date:
  • Size: 6.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Fedora Linux","version":"43","id":"","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for quantum_loop-0.3.12-py3-none-any.whl
Algorithm Hash digest
SHA256 0389757926b7c29dbc44b5386566baada2d5de4352dc1142913a2490b65ae697
MD5 f3fa3d57fd873f1cbe379aaa64054305
BLAKE2b-256 898faa8ced631ff6f56f7eb869d6a69d735e2f423af95e4cce7df2be1db62041

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