Metadata-Version: 2.4
Name: loqs
Version: 1.3
Summary: Logical Qubit Simulator (LoQS)
Author-email: Stefan Seritan <sserita@sandia.gov>, Kenneth Rudinger <kmrudin@sandia.gov>, Antonio Russo <arusso@sandia.gov>, Riley Murray <rjmurr@sandia.gov>, Daniel Hothem <dhothem@sandia.gov>, Megan Dahlhauser <mldahlh@sandia.gov>, Julie Campos <jacampo@sandia.gov>, Mario Morford-Oberst <mmorfor@sandia.gov>, Aliza Siddiqui <ausiddi@sandia.gov>
Maintainer-email: Kenneth Rudinger <kmrudin@sandia.gov>, Stefan Seritan <sserita@sandia.gov>
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: MacOS :: MacOS X
Classifier: Operating System :: Unix
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: Topic :: Scientific/Engineering :: Physics
Classifier: Typing :: Typed
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
License-File: NOTICE
Requires-Dist: numpy
Requires-Dist: scipy
Requires-Dist: tk
Requires-Dist: tqdm>=4
Requires-Dist: h5py>=3.5
Requires-Dist: libcst>=1
Provides-Extra: parallel
Requires-Dist: loky>=3.5.6; extra == "parallel"
Requires-Dist: submitit; extra == "parallel"
Requires-Dist: threadpoolctl>=3.5.0; extra == "parallel"
Requires-Dist: psutil; extra == "parallel"
Requires-Dist: rich>=13; extra == "parallel"
Provides-Extra: mpi
Requires-Dist: mpi4py; extra == "mpi"
Requires-Dist: threadpoolctl>=3.5.0; extra == "mpi"
Requires-Dist: psutil; extra == "mpi"
Provides-Extra: dev
Requires-Dist: pre-commit; extra == "dev"
Requires-Dist: black==26.10.1; extra == "dev"
Requires-Dist: flake8>=7; extra == "dev"
Requires-Dist: mypy>=1; extra == "dev"
Requires-Dist: snakeviz; extra == "dev"
Provides-Extra: docs
Requires-Dist: griffelib==2.0.2; extra == "docs"
Requires-Dist: ipykernel; extra == "docs"
Requires-Dist: jupytext; extra == "docs"
Requires-Dist: mkdocs==1.6.1; extra == "docs"
Requires-Dist: mkdocs-autorefs~=1.4.4; extra == "docs"
Requires-Dist: mkdocs-bibtex==4.4.0; extra == "docs"
Requires-Dist: mkdocs-gen-files~=0.6.1; extra == "docs"
Requires-Dist: mkdocs-include-markdown-plugin~=7.3.0; extra == "docs"
Requires-Dist: mkdocs-literate-nav~=0.6.3; extra == "docs"
Requires-Dist: mkdocs-material==9.7.7; extra == "docs"
Requires-Dist: mkdocs-simple-hooks~=0.1.5; extra == "docs"
Requires-Dist: mkdocstrings==1.0.3; extra == "docs"
Requires-Dist: mkdocstrings-python==2.0.3; extra == "docs"
Requires-Dist: nbclient; extra == "docs"
Requires-Dist: nbformat; extra == "docs"
Requires-Dist: pymdown-extensions~=10.21.2; extra == "docs"
Requires-Dist: pypandoc==1.17; extra == "docs"
Requires-Dist: pypandoc-binary==1.17; extra == "docs"
Provides-Extra: quantumsim
Requires-Dist: quantumsim==0.2.0; extra == "quantumsim"
Provides-Extra: pygsti
Requires-Dist: pygsti>=0.9.12; extra == "pygsti"
Provides-Extra: pymatching
Requires-Dist: pymatching>=2; extra == "pymatching"
Provides-Extra: stim
Requires-Dist: stim>=1.6; extra == "stim"
Provides-Extra: test
Requires-Dist: loqs[dev]; extra == "test"
Requires-Dist: mock>=5; extra == "test"
Requires-Dist: psutil; extra == "test"
Requires-Dist: pytest>=8; extra == "test"
Requires-Dist: pytest-cov>=5; extra == "test"
Requires-Dist: pytest-xdist>=3; extra == "test"
Provides-Extra: visualization
Requires-Dist: pdf2image; extra == "visualization"
Requires-Dist: pillow; extra == "visualization"
Requires-Dist: qiskit[visualization]; extra == "visualization"
Provides-Extra: backends
Requires-Dist: loqs[pygsti,pymatching,quantumsim,stim]; extra == "backends"
Provides-Extra: nobackends
Requires-Dist: loqs[dev,docs,parallel,test,visualization]; extra == "nobackends"
Provides-Extra: all
Requires-Dist: loqs[backends,nobackends]; extra == "all"
Dynamic: license-file

# LoQS v1.3

[![tests](https://github.com/sandialabs/LoQS/actions/workflows/loqs.yml/badge.svg)](https://github.com/sandialabs/LoQS/actions/workflows/loqs.yml)
[![coverage](https://coveralls.io/repos/github/sandialabs/LoQS/badge.svg?branch=main)](https://coveralls.io/github/sandialabs/LoQS)

The *Lo*gical *Q*ubit *S*imulator (LoQS) is designed to simulate a few logical qubits with arbitrary noise models and arbitrary quantum *and* classical operations.

## Installation

The following installation instructions can be used on M1/M2 Macs using Anaconda/Miniconda to create a local virtual environment.

```
conda create -n loqs-env python=3.14
conda activate loqs-env
pip install loqs
# pip install -e . ## for "editable" cloned repo install
```

There are various optional requirements that are available, including:

- `parallel`: Enables single-node (`loky`) and SLURM-array (`submitit`) parallelization over shots and/or programs. `submitit`'s SLURM-array support requires Linux/macOS -- it registers a POSIX-only signal internally and does not work on Windows.
- `mpi`: Enables multi-node parallelization over shots and/or programs via `mpi4py`. Requires a working MPI installation (e.g. OpenMPI/MPICH) already present in the environment -- `pip install` alone does not provide one.
- `dev`: Allows the use of `black` and `flake8` prior to committing
(see Code Formatting and Linting below).
- `docs`: Allows building of the documentation (see Documentation below).
- `quantumsim`: Enables the QuantumSim (state) backend.
- `pygsti`: Enables the PyGSTi (circuit, model, state) backend.
- `pymatching`: Enables the PyMatching (minimum-weight perfect matching) decoder for certain codepacks.
- `stim`: Enables the STIM (state) backend.
- `test`: Allows testing (see Testing below)
- `visualization`: Enables some of the visualization tools in `loqs.tools`. Note that
  `pdflatex` is also required for full visualization support.

There are several helper "categories" for optional dependencies, including:

- `backends`: Packages needed to enable *all* backends
- `nobackends`: The complement of `backends`, i.e. all developer packages with no backends
(useful for testing)
- `all`: All optional dependencies except `mpi`, which requires a real MPI installation and is
  deliberately excluded so it stays opt-in -- combine explicitly instead, e.g.
  `pip install -e ".[all,mpi]"`

To use these, simply modify the last line of the installation instructions. For example:

```
pip install -e ".[all]"
```

(where the quotes are only needed if using zsh instead of bash).

For developers who may want an editable version of `pyGSTi`, you can run:

```
pip install -e git+https://github.com/sandialabs/pyGSTi.git@v0.9.14#egg=pyGSTi
```

to get the 0.9.14 release of pyGSTi, which will be located in `src`.
Alternatively, you can use any other tag or commit hash instead of `v0.9.14`
if you are working off of a feature branch.

## Documentation

This project uses MkDocs and Jupytext-compatible Markdown notebooks under `docs/notebooks/` for its documentation and interactive tutorials. In order to build or preview the documentation locally, do at least an installation of `loqs[docs]`.

### Local Building & Preview

To build and serve the documentation locally, run:

```
python docs/serve.py
```

This will launch a local server typically accessible at `http://127.0.0.1:8000/`.

More details on the documentation structure and Jupytext workflow are available in [docs/DOCS_README](docs/DOCS_README).

### Interactive Cloud Notebooks (Binder)

The tutorials and examples are configured to be run interactively in the cloud using **Binder**! You can open any of the tutorial or example notebooks directly in your browser by clicking the "Launch Binder" badges on the generated documentation pages.

Note that the first launch may take up to 5-10 minutes to build the Binder environment.

### Contributing Interactive Notebooks

The easiest way to modify and add interactive notebooks is to use `loqs-nb-sync`, a command-line tool that's automatically installed alongside LoQS when you install the `docs` extra (`pip install ".[docs]"`).

1. Navigate to `docs/notebooks`, where all interactive notebooks are kept as Markdown for easy source control.
1. Generate a working Jupyter notebook via `loqs-nb-sync to-ipynb <target_to_edit>.md`.
1. Edit the notebook, e.g. `jupyter lab` to start a server, edit, and save.
1. Sync your edits back to Markdown via `loqs-nb-sync to-md <target_to_edit>.ipynb`.
1. Commit your changes!

Always use `loqs-nb-sync` for both directions -- converting or syncing these notebooks any other way can leave broken links in the result.
