Metadata-Version: 2.1
Name: UnionFindPy
Version: 0.2.1
Summary: C++ implemenation of UnionFind with a python binding
Home-page: https://github.com/chaeyeunpark/UnionFind
Maintainer: Chae-Yeun Park
Maintainer-email: chae.yeun.park@gmail.com
License: GNU Lesser General Public License v2.1
Platform: UNKNOWN
Classifier: Development Status :: 2 - Pre-Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: GNU Lesser General Public License v2 or later (LGPLv2+)
Classifier: Natural Language :: English
Classifier: Operating System :: POSIX
Classifier: Operating System :: MacOS :: MacOS X
Classifier: Operating System :: POSIX :: Linux
Classifier: Operating System :: Microsoft :: Windows
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Topic :: Scientific/Engineering :: Physics
Provides: UnionFindPy
Description-Content-Type: text/x-rst
License-File: LICENSE
Requires-Dist: ninja

UnionFind
=========

|Documentation Status| |CodeFactor|

Introduction
------------

C++ implementation of the Union-Find decoder
`arXiv:1709:06218 <https://arxiv.org/abs/1709.06218>`_. Python
interface is also implemented using
`pybind11 <https://github.com/pybind/pybind11>`_.

Based on a Python implementation by Kai Meinerz.

Under the LGPL lisence.

This repository includes codes for
`arXiv:2101.07285 <https://arxiv.org/abs/2101.07285>`_ which explores a
machine learning assisted preprocessing combined with conventional
decoders such as minimum-weight perfect matching (MWPM) and the
Union-Find decoder.

Installation
------------

.. installation-start-inclusion-marker-do-not-remove

Currently, you can install this project by cloning the source code tree and compiling it.
To clone the source tree, use ``git clone`` as

.. code-block:: bash 

	git clone https://github.com/chaeyeunpark/UnionFind.git && cd UnionFind
	git submodule update --init --recursive

Then you can compile the code using 

.. code-block:: bash

    pip install -r requirements.txt
    python3 setup.py install

Note that a compiler with some C++20 supports (e.g. GCC version => 10 or Clang++ version => 12) is required. For example, if you are using Ubuntu

.. code-block:: bash

    apt install -y g++-10
    CXX=g++-10 python3 setup.py install

will work.

PyPI support will be available soon. 

.. installation-end-inclusion-marker-do-not-remove

Basic Usage
-----------

.. code-block:: python

   from UnionFindPy import Decoder
   decoder = Decoder(parity_matrix)
   decoder.decode(syndromes) # syndromes is a list of measurment outcomes of each parity operator

For details, check the `document <https://unionfind.readthedocs.io/en/latest/?badge=latest>`_ and `examples <https://github.com/chaeyeunpark/UnionFind/tree/main/examples>`_ directory.

Notes
-----

This repository does not contain an implementation of weighted
Union-Find decoder.

Reference
---------

When you cite this repository, please use the following:

.. code-block:: bibtex

    @misc{UnionFindCPP, 
        author = {Chae-Yeun Park and Kai Meinerz}, 
        title = {Open-source C++ implementation of the Union-Find decoder}, 
        year = {2020}, 
        publisher = {GitHub}, 
        journal = {GitHub repository},
        howpublished = {\url{https://github.com/chaeyeunpark/UnionFind}}
    }



.. |Documentation Status| image:: https://readthedocs.org/projects/unionfind/badge/?version=latest
   :target: https://unionfind.readthedocs.io/en/latest/?badge=latest
.. |CodeFactor| image:: https://www.codefactor.io/repository/github/chaeyeunpark/unionfind/badge
   :target: https://www.codefactor.io/repository/github/chaeyeunpark/unionfind


