Metadata-Version: 2.4
Name: guppyft
Version: 0.1.1
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: MacOS :: MacOS X
Classifier: Operating System :: POSIX :: Linux
Classifier: Operating System :: Microsoft :: Windows
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: Topic :: Scientific/Engineering
Requires-Dist: guppylang~=1.0.4
Requires-Dist: hugr>=0.18.6
Requires-Dist: tket>=0.15.8
Requires-Dist: tket-exts>=0.14.0
Requires-Dist: zixy~=0.3.2
Requires-Dist: selene-sim>=0.3.0
License-File: LICENCE
Summary: Tools for fault-tolerant quantum computing in the Guppy language
Author-email: TKET development team <tket-support@quantinuum.com>
Maintainer-email: TKET development team <tket-support@quantinuum.com>
Requires-Python: >=3.12, <4
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM

# Guppy FT

Guppy FT is an extension of the [Guppy](https://github.com/Quantinuum/guppylang) quantum programming language to aid
with writing, compiling and running fault-tolerant quantum programs. As a toolkit, it provides:

- A framework to define QEC architectures
- Transformations through quantum program abstraction layers: From computational to logical to physical
- Verification tools to validate QEC primitive implementations

Together, this enables automatic encoding of arbitrary Guppy programs, including measurement dependent control flow.

```python
from guppylang import guppy
from guppylang.std.builtins import owned, output
from guppylang.std.quantum import cx, h, measure, qubit, x, z
from guppyft.code.steane.encode import SteaneBuilder


@guppy
def teleport() -> None:
    """Teleports the state in `src` to `tgt`."""
    src = qubit()

    tmp = qubit()
    tgt = qubit()
    h(tmp)
    cx(tmp, tgt)

    cx(src, tmp)
    h(src)
    if measure(src).read():
        z(tgt)
    if measure(tmp).read():
        x(tgt)

    output("tgt", measure(tgt).read())


# Use Steane architecture to encode the program
steane = SteaneBuilder().build(n_blocks=3)
teleport_encoded = steane.encode(teleport.compile())
```

## Documentation

📖 [Getting Started][docs]

📒 [Example notebooks][examples]

[examples]: ./examples/
[docs]: https://docs.quantinuum.com/guppy/ft

## Installation

Guppy FT can be installed from [PyPI](https://pypi.org/project/guppyft/) using `pip`. Requires Python>=3.12.

```bash
pip install guppyft
```

## Development

See [DEVELOPMENT.md](DEVELOPMENT.md) for instructions on setting up the development environment.

## Licence

This project is licensed under Apache License, Version 2.0 ([LICENCE][]
or <http://www.apache.org/licenses/LICENSE-2.0>).

[LICENCE]: ./LICENCE

