Metadata-Version: 2.5
Name: parityos-qrisp
Version: 0.1.0
Summary: Qrisp extension for ParityOS
Project-URL: Homepage, https://parityqc.com/
Author-email: ParityQC <parityos@parityqc.com>
License-Expression: BSD-3-Clause
License-File: LICENSE.txt
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Typing :: Typed
Requires-Python: >=3.11
Requires-Dist: attrs
Requires-Dist: parityos>=3.1.0
Requires-Dist: qrisp~=0.9.7
Description-Content-Type: text/markdown

# ParityOS Qrisp

ParityOS extension adding an interface to [Qrisp](https://www.qrisp.eu/index.html).

## Installation

It is recommended to install this package in a separate Python virtual environment. For example:

```shell
# To create a standard Python virtual environment:
python -m venv my_new_venv && source my_new_venv/bin/activate
# Alternatively, to create a Anaconda/Miniconda environment:
conda create --name my_new_conda_env python=<version> && conda activate my_new_conda_env
# or a pyenv environment
pyenv virtualenv <version> my_new_venv && pyenv activate my_new_venv
# or a uv managed environment
uv venv -p <version>
```

where `<version>` is a python version and one of `[3.11, 3.12, 3.13]`.

After activating the virtual environment, install via your favorite package manager, e.g.:

```shell
# using pip
pip install parityos-qrisp
# using uv
uv pip install parityos-qrisp
```

## Exporter

`parityos-qrisp` offers an exporter of ParityOS quantum circuits to Qrisp quantum circuits.

### Basic usage

In the following you find a basic usage of the exporter:

```Python
from parityos.operators.circuit import Circuit
from parityos.operators.elementary_operator import H
from parityos_qrisp.exporter import export_parityos_to_qrisp

#      ┌───┐┌─┐
#   0: ┤ H ├┤M├──────
#      ├───┤└╥┘┌─┐
#   1: ┤ H ├─╫─┤M├───
#      ├───┤ ║ └╥┘┌─┐
#   2: ┤ H ├─╫──╫─┤M├
#      └───┘ ║  ║ └╥┘
# c: 3/══════╩══╩══╩═
#            0  1  2
parityos_circuit = Circuit(
    [
        H(q(0)),
        H(q(1)),
        H(q(2)),
    ]
).measure_all()

qrisp_circuit = export_parityos_to_qrisp(parityos_circuit)
```

### Unsupported features

Currently, `parityos-qrisp` cannot export the following circuits:

- Circuits containing conditional operators
- Circuits containing general rotation operators
- Circuits containing measurements in `Y`
- Circuits containing the following gates (including their controlled versions): `ISwap`, `ECR`, `RYY`, `RXZ`, `RExchangeTerm`

## License

This software package is made available under the 3-Clause BSD License.
See `License.txt` for details.
