Metadata-Version: 2.4
Name: gem-suite
Version: 0.2.0
Summary: Qiskit Experiments suite for generation of entanglement using measurements.
Author-email: Naoki Kanazawa <knzwnao@jp.ibm.com>
License-Expression: Apache-2.0
Project-URL: Homepage, https://github.com/qiskit-community/gem-suite
Project-URL: Repository, https://github.com/qiskit-community/gem-suite
Project-URL: Issues, https://github.com/qiskit-community/gem-suite/issues
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Rust
Classifier: Topic :: Scientific/Engineering :: Physics
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE.txt
Requires-Dist: pymatching
Requires-Dist: qiskit<3,>=2
Requires-Dist: qiskit-experiments>=0.7
Provides-Extra: dev
Requires-Dist: black; extra == "dev"
Requires-Dist: qiskit-aer; extra == "dev"
Requires-Dist: qiskit-ibm-runtime; extra == "dev"
Requires-Dist: ruff; extra == "dev"
Dynamic: license-file

# GEM Suite

[![License](https://img.shields.io/github/license/qiskit-community/gem-suite.svg?style=popout-square)](https://opensource.org/licenses/Apache-2.0)

> [!NOTE]
> This repository is under active development and the code here should not be considered stable. This is not an officially supported IBM Quantum software.

The GEM (Generation of Entanglement by Measurement) protocol prepares a quantum state across many qubits using an efficient, measurement-based protocol.
Generally, it is technical challenge to achieve this on current generation quantum devices because most preparation protocols are vulnerable to imperfections in gates and to noise. The protocol that realizes the Nishimori transition, also understood as a fault-tolerant threshold, is a constant depth method that demonstrates how measurement-based state preparation might be used on large-scale quantum devices exceeding a few hundred qubits.
Through injecting coherent errors, the GEM experiment provides an estimate for how far below the error correction threshold a device is operating.

All technical details are available on arXiv: <https://arxiv.org/abs/2309.02863>

Because of the computationally intensive subroutine responsible for decoding the measurement outcomes, this library is mostly implemented in Rust programming language for performance. The core library is interfaced with [Qiskit Experiments](https://github.com/qiskit-community/qiskit-experiments) via [PyO3](https://docs.rs/pyo3/latest/pyo3/index.html) to produce experiment circuits with the Qiskit model and analyze the results. We support two minimum weight perfect matching decoders; [pymatching](https://github.com/oscarhiggott/PyMatching) and [fusion-blossom](https://github.com/yuewuo/fusion-blossom).

This library is designed to work with, but not limited only to, IBM Quantum processors.

## Installation

This package can be installed with `pip` using the command

```bash
pip install gem-suite
```

## Example

In the GEM protocol, an atomic unit of the experiment is a plaquette, which is a collection of multiple qubits.
For the case of IBM Quantum processors with heavy hexagonal lattices,
a single plaquette contains 12 qubits and a single IBM Eagle processor has 18 plaquettes.
This is an efficient compact representation of a quantum processor with a few hundred qubits. We anticipate very minor changes to this representation when scaling up to larger devices.

![image](https://raw.githubusercontent.com/qiskit-community/gem-suite/main/images/plaquette_eagle.png)

We can partly reproduce experiments in the publication with a few lines of code using the Qiskit Experiments framework.

```python
from gem_suite.experiments import GemExperiment
from qiskit_ibm_runtime import QiskitRuntimeService

backend = QiskitRuntimeService().backend("ibm_cusco")

gem_exp = GemExperiment(plaquettes=range(18), backend=backend)
exp_data = gem_exp.run().block_for_results()
```

Please see [our example notebook](https://github.com/qiskit-community/gem-suite/blob/main/examples/01_gem_benchmark.ipynb) for the complete workflow.

## License

[Apache License 2.0](https://github.com/qiskit-community/gem-suite/blob/main/LICENSE.txt)
