Metadata-Version: 2.4
Name: quantum-loop
Version: 0.3.8
Summary: A set of tools for quantum calculations.
Project-URL: Homepage, https://kebasyaty.github.io/quantum-loop/
Project-URL: Repository, https://github.com/kebasyaty/quantum-loop
Project-URL: Source, https://github.com/kebasyaty/quantum-loop
Project-URL: Bug Tracker, https://github.com/kebasyaty/quantum-loop/issues
Project-URL: Changelog, https://github.com/kebasyaty/quantum-loop/blob/v0/CHANGELOG.md
Author-email: kebasyaty <kebasyaty@gmail.com>
License-Expression: MIT
License-File: LICENSE
Keywords: loop,quantum,quantum-loop,qubit
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: MacOS :: MacOS X
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: POSIX
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Typing :: Typed
Requires-Python: <4.0,>=3.12
Description-Content-Type: text/markdown

<div align="center">
  <p align="center">
    <a href="https://github.com/kebasyaty/quantum-loop">
      <img
        height="80"
        alt="Logo"
        src="https://raw.githubusercontent.com/kebasyaty/quantum-loop/main/assets/logo.svg">
    </a>
  </p>
  <p>
    <h1>quantum loop</h1>
    <h3>A set of tools for quantum calculations.</h3>
    <p align="center">
      <a href="https://github.com/kebasyaty/quantum-loop/actions/workflows/test.yml" alt="Build Status"><img src="https://github.com/kebasyaty/quantum-loop/actions/workflows/test.yml/badge.svg" alt="Build Status"></a>
      <a href="https://kebasyaty.github.io/quantum-loop/" alt="Docs"><img src="https://img.shields.io/badge/docs-available-brightgreen.svg" alt="Docs"></a>
      <a href="https://pypi.python.org/pypi/quantum-loop/" alt="PyPI pyversions"><img src="https://img.shields.io/pypi/pyversions/quantum-loop.svg" alt="PyPI pyversions"></a>
      <a href="https://pypi.python.org/pypi/quantum-loop/" alt="PyPI status"><img src="https://img.shields.io/pypi/status/quantum-loop.svg" alt="PyPI status"></a>
      <a href="https://pypi.python.org/pypi/quantum-loop/" alt="PyPI version fury.io"><img src="https://badge.fury.io/py/quantum-loop.svg" alt="PyPI version fury.io"></a>
      <br>
      <a href="https://pyrefly.org/" alt="Types: Pyrefly"><img src="https://img.shields.io/badge/types-Pyrefly-FFB74D.svg" alt="Types: Pyrefly"></a>
      <a href="https://docs.astral.sh/ruff/" alt="Code style: Ruff"><img src="https://img.shields.io/badge/code%20style-Ruff-FDD835.svg" alt="Code style: Ruff"></a>
      <a href="https://pypi.org/project/quantum-loop"><img src="https://img.shields.io/pypi/format/quantum-loop" alt="Format"></a>
      <a href="https://pepy.tech/projects/quantum-loop"><img src="https://static.pepy.tech/badge/quantum-loop" alt="PyPI Downloads"></a>
      <a href="https://github.com/kebasyaty/quantum-loop/blob/main/LICENSE" alt="GitHub license"><img src="https://img.shields.io/github/license/kebasyaty/quantum-loop" alt="GitHub license"></a>
    </p>
    <p align="center">
      A Qubit in a regular computer is quantum of algorithm that is executed in
      <br>
      one iteration of a cycle in a separate processor thread.
      <br>
      Quantum is a function with an algorithm of task for data processing.
      <br>
      In this case, the Qubit is not a single information,
      <br>
      but it is a concept of the principle of operation of quantum calculations on a regular computer.
    </p>
  </p>
</div>

##

<br>

## Documentation

[![Documentation](https://raw.githubusercontent.com/kebasyaty/quantum-loop/v0/assets/links/link-documentation.svg "Documentation")](https://kebasyaty.github.io/quantum-loop/ "Documentation")

## Requirements

[![Requirements](https://raw.githubusercontent.com/kebasyaty/quantum-loop/v0/assets/links/link-requirements.svg "Requirements")](https://github.com/kebasyaty/quantum-loop/blob/v0/REQUIREMENTS.md "Requirements")

## Installation

```shell
uv add quantum-loop
```

## Usage

[![Examples](https://raw.githubusercontent.com/kebasyaty/quantum-loop/v0/assets/links/link-examples.svg "Examples")](https://kebasyaty.github.io/quantum-loop/latest/pages/usage/ "Examples")

```python
"""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()
```

```python
"""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()
```

```python
"""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

[![Changelog](https://raw.githubusercontent.com/kebasyaty/quantum-loop/v0/assets/links/link-changelog.svg "Changelog")](https://github.com/kebasyaty/quantum-loop/blob/v0/CHANGELOG.md "Changelog")

## License

[![MIT](https://raw.githubusercontent.com/kebasyaty/quantum-loop/v0/assets/links/link-mit.svg "MIT")](https://github.com/kebasyaty/quantum-loop/blob/main/LICENSE "MIT")
