Skip to content

Commit 20b7cc1

Browse files
committed
Merge branch 'dev' into feat/refactor-n-memory
2 parents 4f64a1b + debdda0 commit 20b7cc1

File tree

364 files changed

+11297
-9057
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

364 files changed

+11297
-9057
lines changed

.gitignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
tmp/
22
**/.*/settings.local.json
33

4-
# Ignore helper text in root
5-
*.txt
6-
74
# pytest results
85
junit/
96

.pre-commit-config.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,19 @@ repos:
1919
- id: debug-statements
2020

2121
- repo: https://github.com/crate-ci/typos
22-
rev: v1.28.3
22+
rev: v1
2323
hooks:
2424
- id: typos
2525
args: []
2626

2727
- repo: https://github.com/astral-sh/ruff-pre-commit
28-
rev: v0.8.3
28+
rev: v0.11.11
2929
hooks:
30-
- id: ruff
30+
- id: ruff-check
3131
args: [--fix, --exit-non-zero-on-fix]
3232

3333
- repo: https://github.com/psf/black
34-
rev: 24.10.0
34+
rev: 25.1.0
3535
hooks:
3636
- id: black
3737

.python-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.13

README.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,6 @@ If you are interested in editing or developing the code in this project, see thi
122122

123123
Certain simulators from `pecos.simulators` require external packages that are not installed by `pip install .[all]`.
124124

125-
- `QuEST` is installed along with the python package `pyquest` when calling `pip install .[all]`. However, it uses
126-
64-bit float point precision by default, and if you wish to make use of 32-bit float point precision you will need to
127-
follow the installation instructions provided by the developers [here](https://github.com/rrmeister/pyQuEST/tree/develop).
128125
- `CuStateVec` requires a Linux machine with an NVIDIA GPU (see requirements [here](https://docs.nvidia.com/cuda/cuquantum/latest/getting_started/getting_started.html#dependencies-custatevec-label)). PECOS' dependencies are
129126
specified in the `[cuda]` section of `pyproject.toml`, however, installation via `pip` is not reliable. The recommended method of installation is via `conda`, as discussed [here](https://docs.nvidia.com/cuda/cuquantum/latest/getting_started/getting_started.html#installing-cuquantum). Note that there might be conflicts between `conda` and `venv`; if you intend to use `CuStateVec`, you may follow the installation instructions for PECOS within a `conda` environment without involving the `venv` commands.
130127
- `MPS` uses `pytket-cutensornet` (see [repository](https://github.com/CQCL/pytket-cutensornet)) and can be installed via `pip install .[cuda]`. These

crates/pecos-qir/src/platform/windows_stub_gen.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ impl ExportedFunction {
1616
} else {
1717
self.params
1818
.iter()
19-
.map(|(typ, name)| format!("{typ} {name}"))
19+
.map(|(param_type, name)| format!("{param_type} {name}"))
2020
.collect::<Vec<_>>()
2121
.join(", ")
2222
};

docs/requirements.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
mkdocs>=1.5.3
2+
mkdocs-material>=9.4.7
3+
mkdocstrings>=0.24.0
4+
mkdocstrings-python>=1.7.4
5+
markdown-exec>=1.10.3
6+
pymdown-extensions>=10.4

examples/python_examples/logical_steane_code_program.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,13 @@
99
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
1010
# specific language governing permissions and limitations under the License.
1111

12+
"""Example demonstrating logical teleportation using Steane quantum error correction code.
13+
14+
This module provides an example implementation of logical teleportation using the
15+
7-qubit Steane quantum error correction code, showcasing fault-tolerant quantum
16+
computation with error correction circuits.
17+
"""
18+
1219
from pecos.qeclib.steane.steane_class import Steane
1320
from pecos.slr import Barrier, CReg, If, Main
1421

@@ -27,8 +34,8 @@ def telep(prep_basis: str, meas_basis: str) -> str:
2734
include: "X", "Y", and "Z".
2835
2936
Returns:
30-
A logical program written in extended OpenQASM 2.0"""
31-
37+
A logical program written in extended OpenQASM 2.0
38+
"""
3239
prog = Main(
3340
m_bell := CReg("m_bell", size=2),
3441
m_out := CReg("m_out", size=1),
@@ -82,8 +89,8 @@ def t_gate(prep_basis: str, meas_basis: str) -> str:
8289
include: "X", "Y", and "Z".
8390
8491
Returns:
85-
A logical program written in extended OpenQASM 2.0"""
86-
92+
A logical program written in extended OpenQASM 2.0
93+
"""
8794
prog = Main(
8895
m_reject := CReg("m_reject", size=2),
8996
m_t := CReg("m_t", 1),

python/docs/conf.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
1-
# ========================================================================= # # noqa: INP001
1+
"""Sphinx documentation configuration for PECOS quantum error correction framework.
2+
3+
This module configures Sphinx for generating the PECOS documentation, including
4+
API reference, user guides, and examples for the quantum error correction library.
5+
"""
6+
7+
# ruff: noqa: INP001
8+
9+
# ========================================================================= #
210
# Copyright 2023 The PECOS Developers
311
# Copyright 2018 National Technology & Engineering Solutions of Sandia,
412
# LLC (NTESS). Under the terms of Contract DE-NA0003525 with NTESS,
@@ -33,7 +41,7 @@
3341
# -- Project information -----------------------------------------------------
3442

3543
project = "PECOS"
36-
copyright = (
44+
copyright = ( # noqa: A001
3745
"2018-2023, The PECOS Developers. "
3846
"\xa9 Copyright 2018, National Technology & Engineering Solutions of Sandia, LLC (NTESS)"
3947
)

python/docs/reference/_autosummary/pecos.simulators.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
pecos.simulators.paulifaultprop
3737
pecos.simulators.projectq
3838
pecos.simulators.quantum_simulator
39-
pecos.simulators.quest
4039
pecos.simulators.qulacs
4140
pecos.simulators.sim_class_types
4241
pecos.simulators.sparsesim

python/pecos-rslib/examples/bell_state_example.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
from pecos_rslib import ByteMessage
2323

2424

25-
def bell_state_example():
25+
def bell_state_example() -> None:
2626
"""Demonstrate how to create a Bell state experiment using ByteMessage."""
2727
print("==== Bell State Experiment Example ====")
2828

@@ -64,7 +64,7 @@ def bell_state_example():
6464
return message
6565

6666

67-
def build_custom_message():
67+
def build_custom_message() -> None:
6868
"""Build a custom quantum circuit using ByteMessage."""
6969
print("\n==== Custom Circuit Example ====")
7070

0 commit comments

Comments
 (0)