Skip to content

Commit

Permalink
Merge branch 'main' into docfix
Browse files Browse the repository at this point in the history
  • Loading branch information
Strilanc authored Sep 10, 2024
2 parents 270821f + 5e4f8b2 commit 82c32a8
Show file tree
Hide file tree
Showing 207 changed files with 16,347 additions and 2,161 deletions.
1 change: 1 addition & 0 deletions .bazelversion
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
7.2.0
44 changes: 37 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ jobs:
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v2
- uses: actions/download-artifact@v4.1.7
with:
name: dist
path: dist
Expand Down Expand Up @@ -215,7 +215,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: bazelbuild/setup-bazelisk@v1
- uses: bazel-contrib/[email protected]
with:
bazelisk-cache: true
disk-cache: ${{ github.workflow }}
repository-cache: true
bazelisk-version: 1.x
- run: bazel build :all
- run: bazel test :stim_test
build_clang:
Expand Down Expand Up @@ -310,7 +315,12 @@ jobs:
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
- uses: bazelbuild/setup-bazelisk@v1
- uses: bazel-contrib/[email protected]
with:
bazelisk-cache: true
disk-cache: ${{ github.workflow }}
repository-cache: true
bazelisk-version: 1.x
- uses: actions/setup-node@v1
with:
node-version: 16.x
Expand Down Expand Up @@ -342,7 +352,12 @@ jobs:
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
- uses: bazelbuild/setup-bazelisk@v1
- uses: bazel-contrib/[email protected]
with:
bazelisk-cache: true
disk-cache: ${{ github.workflow }}
repository-cache: true
bazelisk-version: 1.x
- run: bazel build :stim_dev_wheel
- run: pip install bazel-bin/stim-0.0.dev0-py3-none-any.whl
- run: pip install pytest
Expand All @@ -353,7 +368,12 @@ jobs:
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
- uses: bazelbuild/setup-bazelisk@v1
- uses: bazel-contrib/[email protected]
with:
bazelisk-cache: true
disk-cache: ${{ github.workflow }}
repository-cache: true
bazelisk-version: 1.x
- run: bazel build :stim_dev_wheel
- run: pip install bazel-bin/stim-0.0.dev0-py3-none-any.whl
- run: pip install -e glue/cirq
Expand All @@ -365,7 +385,12 @@ jobs:
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
- uses: bazelbuild/setup-bazelisk@v1
- uses: bazel-contrib/[email protected]
with:
bazelisk-cache: true
disk-cache: ${{ github.workflow }}
repository-cache: true
bazelisk-version: 1.x
- run: bazel build :stim_dev_wheel
- run: pip install bazel-bin/stim-0.0.dev0-py3-none-any.whl
- run: pip install -e glue/sample
Expand All @@ -378,7 +403,12 @@ jobs:
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
- uses: bazelbuild/setup-bazelisk@v1
- uses: bazel-contrib/[email protected]
with:
bazelisk-cache: true
disk-cache: ${{ github.workflow }}
repository-cache: true
bazelisk-version: 1.x
- run: bazel build :stim_dev_wheel
- run: pip install bazel-bin/stim-0.0.dev0-py3-none-any.whl
- run: pip install -e glue/zx
Expand Down
9 changes: 9 additions & 0 deletions dev/doctest_proper.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,15 @@ def main():
module = __import__(module_name)
out = {}
gen(obj=module, fullname=module_name, out=out)
for k, v in out.items():
if v.__doc__ is None:
continue
v = v.__doc__.lower()
if '\n' in v.strip() and 'examples:' not in v and 'example:' not in v and '[deprecated]' not in v:
if k.split('.')[-1] not in ['__next__', '__iter__', '__init_subclass__', '__module__', '__eq__', '__ne__', '__str__', '__repr__']:
if all(not (e.startswith('_') and not e.startswith('__')) for e in k.split('.')):
print(f" Warning: Missing 'examples:' section in docstring of {k!r}", file=sys.stderr)

module.__test__ = {k: v for k, v in out.items()}
if doctest.testmod(module, globs=globs).failed:
any_failed = True
Expand Down
24 changes: 23 additions & 1 deletion dev/gen_sinter_api_reference.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,25 @@ def main():
```
'''.strip())

replace_rules = []
for package in ['stim', 'sinter']:
p = __import__(package)
for name in dir(p):
x = getattr(p, name)
if isinstance(x, type) and 'class' in str(x):
desired_name = f'{package}.{name}'
if '._' in str(x):
bad_name = str(x).split("'")[1]
replace_rules.append((bad_name, desired_name))
lonely_name = desired_name.split(".")[-1]
for q in ['"', "'"]:
replace_rules.append(('ForwardRef(' + q + lonely_name + q + ')', desired_name))
replace_rules.append(('ForwardRef(' + q + desired_name + q + ')', desired_name))
replace_rules.append((q + desired_name + q, desired_name))
replace_rules.append((q + lonely_name + q, desired_name))
replace_rules.append(('ForwardRef(' + desired_name + ')', desired_name))
replace_rules.append(('ForwardRef(' + lonely_name + ')', desired_name))

for obj in objects:
print()
print(f'<a name="{obj.full_name}"></a>')
Expand All @@ -58,7 +77,10 @@ def main():
print(f'# (in class {".".join(obj.full_name.split(".")[:-1])})')
else:
print(f'# (at top-level in the sinter module)')
print('\n'.join(obj.lines))
for line in obj.lines:
for a, b in replace_rules:
line = line.replace(a, b)
print(line)
print("```")


Expand Down
13 changes: 1 addition & 12 deletions dev/util_gen_stub_file.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import dataclasses
import sys
import types
from typing import Any
from typing import Optional, Iterator, List
Expand All @@ -9,6 +8,7 @@

keep = {
"__add__",
"__radd__",
"__eq__",
"__call__",
"__ge__",
Expand Down Expand Up @@ -224,17 +224,6 @@ def print_doc(*, full_name: str, parent: object, obj: object, level: int) -> Opt
text += '@abc.abstractmethod\n'
sig_name = f'{term_name}{inspect.signature(obj)}'
text += "\n".join(splay_signature(f"def {sig_name}:"))
text = text.replace('''ForwardRef('sinter.TaskStats')''', 'sinter.TaskStats')
text = text.replace('''ForwardRef('sinter.Task')''', 'sinter.Task')
text = text.replace('''ForwardRef('sinter.Progress')''', 'sinter.Progress')
text = text.replace('''ForwardRef('sinter.Decoder')''', 'sinter.Decoder')
text = text.replace("'AnonTaskStats'", "sinter.AnonTaskStats")
text = text.replace('sinter._decoding_decoder_class.CompiledDecoder', 'sinter.CompiledDecoder')
text = text.replace("'AnonTaskStats'", "sinter.AnonTaskStats")
text = text.replace("'stim.Circuit'", "stim.Circuit")
text = text.replace("'stim.DetectorErrorModel'", "stim.DetectorErrorModel")
text = text.replace("'sinter.CollectionOptions'", "sinter.CollectionOptions")
text = text.replace("'sinter.Fit'", 'sinter.Fit')

# Replace default value lambdas with their source.
if 'lambda' in str(text):
Expand Down
31 changes: 31 additions & 0 deletions doc/circuit_data_references.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
## 2021

- [arXiv:2103.02202](https://arxiv.org/abs/2103.02202)[Ancillary files of "Stim: a fast stabilizer circuit simulator"](https://arxiv.org/src/2103.02202v3/anc)
- [arXiv:2108.10457](https://arxiv.org/abs/2108.10457)[Ancillary files of "A Fault-Tolerant Honeycomb Memory"](https://arxiv.org/src/2108.10457v2/anc)

## 2022

- [arXiv:2202.11845](https://arxiv.org/abs/2202.11845)[Data for "Benchmarking the Planar Honeycomb Code"](https://zenodo.org/records/7072889)
- [arXiv:2204.13834](https://arxiv.org/abs/2204.13834)[Data for "Stability Experiments: The Overlooked Dual of Memory Experiments"](https://zenodo.org/records/6859486)
- [arXiv:2206.12780](https://arxiv.org/abs/2206.12780)[Data for "A Pair Measurement Surface Code on Pentagons"](https://zenodo.org/records/6626417)
- [arXiv:2207.06431](https://arxiv.org/abs/2207.06431)[Data for "Suppressing quantum errors by scaling a surface code logical qubit"](https://zenodo.org/records/6804040)
- [arXiv:2209.08552](https://arxiv.org/abs/2209.08552)[Parallel window decoding enables scalable fault tolerant quantum computation](https://doi.org/10.5281/zenodo.8422904)

## 2023

- [arXiv:2302.02192](https://arxiv.org/abs/2302.02192)[Data for "Relaxing Hardware Requirements for Surface Code Circuits using Time-dynamics"](https://zenodo.org/records/7587578)
- [arXiv:2302.07395](https://arxiv.org/abs/2302.07395)[Data for "Inplace Access to the Surface Code Y Basis"](https://zenodo.org/records/7487893)
- [arXiv:2302.12292](https://arxiv.org/abs/2302.12292)[Data for "Cleaner magic states with hook injection"](https://zenodo.org/records/7575030)
- [arXiv:2305.12046](https://arxiv.org/abs/2305.12046)[Data for "Less Bacon More Threshold"](https://zenodo.org/records/7901729)
- [arXiv:2307.10147](https://arxiv.org/abs/2307.10147)[Stim circuits for "Tangling schedules eases hardware connectivity requirements for quantum error correction" manuscript](https://zenodo.org/records/8391674)
- [arXiv:2308.03750](https://arxiv.org/abs/2308.03750)[Ancillary data for the paper "Constructions and performance of hyperbolic and semi-hyperbolic Floquet codes" ](https://github.com/oscarhiggott/hyperbolic-floquet-data)
- [arXiv:2312.04522](https://arxiv.org/abs/2312.04522)[Data for "Yoked Surface Codes"](https://zenodo.org/records/10277397)
- [arXiv:2312.08813](https://arxiv.org/abs/2312.08813)[Data for "New circuits and an open source decoder for the colorcode"](https://zenodo.org/records/10375289)
- [arXiv:2312.11605](https://arxiv.org/abs/2312.11605)[Stim circuits and collected data for "Error-corrected Hadamard gate simulated at the circuit level" manuscript](https://zenodo.org/records/10391116)

## 2024

- [arXiv:2405.15854](https://arxiv.org/abs/2405.15854)[Stim circuits for 'Accommodating Fabrication Defects on Floquet Codes with Minimal Hardware Requirements' manuscript](https://zenodo.org/records/11241876)
- [arXiv:2407.13826 ](https://arxiv.org/abs/2407.13826)[Stim circuits for 'Designing fault-tolerant circuits using detector error models'](https://github.com/peter-janderks/short_measurement_schedules_simulations/tree/main/stim_circuits)
- [arXiv:2408.00758](https://arxiv.org/abs/2408.00758)[Stim circuits for ``To reset, or not to reset -- that is the question" manuscript](https://zenodo.org/records/13152440)
- [arXiv:2408.11894](https://arxiv.org/abs/2408.11894)[Stim circuits for 'Automated Synthesis of Fault-Tolerant State Preparation Circuits for Quantum Error Correction Codes'](https://github.com/cda-tum/mqt-qecc/tree/main/src/mqt/qecc/ft_stateprep/eval/circuits)
Loading

0 comments on commit 82c32a8

Please sign in to comment.