-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* prepare release * change pr template * mod tests * change init * sort imports * rm CLIFFORD_CONJ * readme & requirements changed * fix tests * fix ubuntu test * fix ubuntu test * rename file * modify experiment --------- Co-authored-by: Kazuki Tsuoka <[email protected]>
- Loading branch information
1 parent
b7bc0d9
commit 3768c62
Showing
17 changed files
with
1,055 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,3 +6,5 @@ | |
**/build | ||
dist/* | ||
docs/source/gallery/** | ||
.tox/ | ||
.vscode/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
include README.md | ||
include MANIFEST.in | ||
include LICENSE | ||
include graphix_ibmq/version.py | ||
include graphix_perceval/version.py | ||
include requirements.txt | ||
prune docs/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Graphix Perceval interface | ||
<!-- | ||
![PyPI](https://img.shields.io/pypi/v/graphix-perceval) | ||
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/graphix-perceval) --> | ||
|
||
Provides an interface to run MBQC pattern (`graphix.Pattern`) on Quandela's optical quantum devices as well as Perceval's simulator backends. | ||
|
||
Requires [graphix](https://github.com/TeamGraphix/graphix) to generate the measurement pattern. | ||
|
||
## Installation | ||
|
||
install with `pip` | ||
|
||
```bash | ||
$ pip install graphix-perceval | ||
``` | ||
|
||
<!-- This can be installed as part of graphix, by | ||
``` | ||
$ pip install graphix[extra] | ||
``` --> | ||
|
||
## License | ||
|
||
[Apache License 2.0](LICENSE) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from .converter import to_perceval |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
import numpy as np | ||
import perceval.components as comp | ||
import sympy as sp | ||
|
||
# perceval representation of Clifford gates. | ||
# see graphix.clifford module for the definitions and details of Clifford operatos for each index. | ||
CLIFFORD_TO_PERCEVAL_BS = [ | ||
[comp.BS(theta=0.0)], | ||
[comp.BS(theta=sp.pi, phi_bl=-sp.pi / 2, phi_br=-sp.pi / 2)], | ||
[comp.BS(theta=sp.pi, phi_tl=-sp.pi / 2, phi_bl=sp.pi / 2, phi_tr=sp.pi / 2, phi_br=sp.pi / 2)], | ||
[comp.BS(theta=0.0, phi_bl=sp.pi / 2, phi_br=sp.pi / 2)], | ||
[comp.BS(theta=0.0, phi_br=sp.pi / 2)], | ||
[comp.BS(theta=0.0, phi_br=-sp.pi / 2)], | ||
[comp.BS(theta=sp.pi / 2, phi_bl=3 * sp.pi / 2, phi_br=3 * sp.pi / 2)], | ||
[comp.BS(theta=sp.pi / 2, phi_tl=sp.pi / 2, phi_bl=-sp.pi / 2, phi_tr=-sp.pi / 2, phi_br=sp.pi / 2)], | ||
[comp.BS(theta=sp.pi / 2, phi_bl=sp.pi / 2, phi_br=3 * sp.pi / 2)], | ||
[comp.BS(theta=sp.pi, phi_tl=3 * sp.pi / 4, phi_tr=-3 * sp.pi / 4)], | ||
[comp.BS(theta=sp.pi, phi_tl=-3 * sp.pi / 4, phi_tr=3 * sp.pi / 4)], | ||
[comp.BS(theta=sp.pi / 2, phi_bl=sp.pi / 2, phi_br=sp.pi / 2)], | ||
[comp.BS(theta=sp.pi / 2, phi_tl=3 * sp.pi / 4, phi_bl=sp.pi / 4, phi_tr=sp.pi / 4, phi_br=3 * sp.pi / 4)], | ||
[comp.BS(theta=sp.pi / 2, phi_tr=sp.pi / 2, phi_br=3 * sp.pi / 2)], | ||
[comp.BS(theta=sp.pi / 2, phi_tl=sp.pi / 2, phi_bl=3 * sp.pi / 2)], | ||
[comp.BS(theta=sp.pi / 2, phi_tr=sp.pi, phi_br=3 * sp.pi)], | ||
[comp.BS(theta=sp.pi / 2, phi_bl=sp.pi, phi_tr=3 * sp.pi / 4, phi_br=sp.pi / 4)], | ||
[comp.BS(theta=sp.pi / 2, phi_tr=3 * sp.pi / 4, phi_br=5 * sp.pi / 4)], | ||
[comp.BS(theta=sp.pi / 2, phi_bl=sp.pi, phi_tr=sp.pi / 4, phi_br=3 * sp.pi / 4)], | ||
[comp.BS(theta=sp.pi / 2, phi_tr=5 * sp.pi / 4, phi_br=3 * sp.pi / 4)], | ||
[comp.BS(theta=sp.pi / 2, phi_tl=5 * sp.pi / 4, phi_bl=3 * sp.pi / 4)], | ||
[comp.BS(theta=sp.pi / 2, phi_tl=sp.pi / 2, phi_tr=sp.pi / 4, phi_br=5 * sp.pi / 4)], | ||
[comp.BS(theta=sp.pi / 2, phi_bl=sp.pi / 2, phi_tr=sp.pi / 4, phi_br=5 * sp.pi / 4)], | ||
[comp.BS(theta=sp.pi / 2, phi_tl=3 * sp.pi / 4, phi_bl=5 * sp.pi / 4)], | ||
] | ||
|
||
CLIFFORD_TO_PERCEVAL_POLAR = [ | ||
[comp.WP(delta=0.0, xsi=0.0)], | ||
[comp.WP(delta=sp.pi / 2, xsi=sp.pi / 4), comp.PS(-sp.pi / 2)], | ||
[comp.WP(delta=sp.pi / 2, xsi=0.0), comp.WP(delta=sp.pi / 2, xsi=sp.pi / 4), comp.PS(-sp.pi / 2)], | ||
[comp.WP(delta=sp.pi / 2, xsi=0.0), comp.PS(-sp.pi / 2)], | ||
[comp.WP(delta=-sp.pi / 4, xsi=0.0), comp.PS(sp.pi / 4)], | ||
[comp.WP(delta=sp.pi / 4, xsi=0.0), comp.PS(7 * sp.pi / 4)], | ||
[comp.WP(delta=sp.pi / 2, xsi=np.pi / 8), comp.PS(3 * sp.pi / 2)], | ||
[comp.WP(delta=3 * sp.pi / 4, xsi=np.pi / 4), comp.PS(sp.pi)], | ||
[comp.WP(delta=sp.pi / 2, xsi=sp.pi / 8), comp.WP(delta=sp.pi / 2, xsi=sp.pi / 4), comp.PS(sp.pi)], | ||
[comp.WP(delta=-sp.pi / 4, xsi=sp.pi), comp.WP(delta=sp.pi / 2, xsi=sp.pi / 4), comp.PS(sp.pi)], | ||
[comp.WP(delta=sp.pi / 4, xsi=sp.pi), comp.WP(delta=sp.pi / 2, xsi=sp.pi / 4), comp.PS(-sp.pi)], | ||
[comp.WP(delta=sp.pi / 2, xsi=3 * sp.pi / 8), comp.PS(sp.pi / 2)], | ||
[comp.WP(delta=sp.pi / 2, xsi=3 * sp.pi / 8), comp.WP(delta=sp.pi / 2, xsi=sp.pi / 4)], | ||
[comp.WP(delta=sp.pi / 4, xsi=sp.pi / 4), comp.WP(delta=sp.pi / 2, xsi=0.0)], | ||
[comp.WP(delta=sp.pi / 4, xsi=3 * sp.pi / 4), comp.WP(delta=sp.pi / 2, xsi=0.0)], | ||
[comp.WP(delta=sp.pi / 4, xsi=sp.pi / 4), comp.PS(sp.pi)], | ||
[comp.WP(delta=sp.pi / 4, xsi=0.0), comp.WP(delta=sp.pi / 2, xsi=sp.pi / 8)], | ||
[comp.WP(delta=sp.pi / 4, xsi=0.0), comp.WP(delta=sp.pi / 2, xsi=3 * sp.pi / 8), comp.PS(sp.pi)], | ||
[comp.WP(delta=sp.pi / 4, xsi=sp.pi / 2), comp.WP(delta=sp.pi / 2, xsi=3 * sp.pi / 8), comp.PS(sp.pi)], | ||
[comp.WP(delta=sp.pi / 4, xsi=sp.pi / 2), comp.WP(delta=sp.pi / 2, xsi=5 * sp.pi / 8)], | ||
[comp.WP(delta=sp.pi / 4, xsi=0.0), comp.WP(delta=sp.pi / 4, xsi=sp.pi / 4), comp.PS(sp.pi)], | ||
[comp.WP(delta=sp.pi / 4, xsi=sp.pi / 4), comp.WP(delta=sp.pi / 2, xsi=sp.pi / 8)], | ||
[comp.WP(delta=sp.pi / 4, xsi=0.0), comp.WP(delta=sp.pi / 4, xsi=3 * sp.pi / 4)], | ||
[comp.WP(delta=sp.pi / 4, xsi=sp.pi / 2), comp.WP(delta=sp.pi / 4, xsi=sp.pi / 4), comp.PS(sp.pi)], | ||
] |
Oops, something went wrong.