You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+43-6Lines changed: 43 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,13 +8,25 @@ Specifically, it uses `O(q^2*m + q*c)` time and `O(q^2)` space where
8
8
`m` is the number of measurements,
9
9
and `c` is the number of Hadamard/CNOT/Phase gates.
10
10
11
+
# Installation
12
+
13
+
The `chp_sim` package is available on pypi and can be installed using `pip`:
14
+
15
+
```bash
16
+
python -m pip install chp_sim
17
+
```
18
+
19
+
Alternatively, you can just copy paste the `chp_sim` directory of this
20
+
repository into your project.
21
+
The only runtime dependency is `numpy`.
22
+
11
23
# Usage
12
24
13
25
Here is an example of simulating [a circuit](https://algassert.com/quirk#circuit=%7B%22cols%22%3A%5B%5B1%2C1%2C%22H%22%5D%2C%5B%22X%22%2C1%2C%22%E2%80%A2%22%5D%2C%5B1%2C%22X%22%2C%22%E2%80%A2%22%5D%2C%5B%22Z%5E%C2%BD%22%2C%22Z%5E%C2%BD%22%5D%2C%5B%22H%22%2C%22H%22%2C%22H%22%5D%2C%5B%22Measure%22%2C%22Measure%22%2C%22Measure%22%5D%2C%5B%22Chance3%22%5D%5D%7D):
14
26
15
27
```python
16
-
from stabilizer_sim importStabilizerSim
17
-
sim =StabilizerSim(num_qubits=3)
28
+
importchp_sim
29
+
sim =chp_sim.ChpSimulator(num_qubits=3)
18
30
19
31
# Desired circuit:
20
32
# 0: -------X-------S---H---M---
@@ -62,8 +74,33 @@ assert v2.determined
62
74
assertbool(v0) ^bool(v1) ^bool(v2)
63
75
```
64
76
65
-
# Installation
66
77
67
-
At the moment there is no special installation method such as a pypi package.
68
-
Just copy-paste the `stabilizer_sim` folder of this repository into your project.
69
-
The only runtime dependency is `numpy`.
78
+
# Packaging
79
+
80
+
(Notes to self on how to release a new version.)
81
+
82
+
1. Edit the source code as needed and run tests.
83
+
84
+
```bash
85
+
pytest
86
+
```
87
+
88
+
2. Build the wheel.
89
+
90
+
```bash
91
+
python3 setup.py -q bdist_wheel
92
+
```
93
+
94
+
3. Verify the wheel works.
95
+
96
+
```bash
97
+
python -m pip install dist/[INSERT FILE NAME HERE].whl
0 commit comments