Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rust code #77

Closed
wants to merge 123 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
123 commits
Select commit Hold shift + click to select a range
e399000
Added files.
ciaranran Oct 3, 2018
863178f
Updated the README with Read the Docs info.
ciaranran Oct 3, 2018
a1e8f02
Updating docs/README since adding project to pypi.
ciaranran Oct 3, 2018
e1c6699
Small fix to README.
ciaranran Oct 3, 2018
b78a380
Small changes to install instructions.
ciaranra Oct 3, 2018
a3d8864
Added SVG PECOS icons and ProjectQ extension.
ciaranra Oct 5, 2018
32e8da8
Included initial version of Cirq wrapper. [Not fully functional...]
ciaranra Oct 5, 2018
500f887
Added the shorest_logicals method to the VerifyStabilizers tool.
ciaranra Oct 7, 2018
6c65f8a
Updated requirements for the simulator wrappers.
ciaranra Oct 10, 2018
d17d0c0
Simplified circuit_runners and took out kwargs `param` in circuit dat…
ciaranra Dec 28, 2018
26fd090
Changed circuit_runners method run_logic to just run. `run` now will …
ciaranra Dec 29, 2018
c0300f3
Merge branch 'master' into development
ciaranra Jan 1, 2019
3744da7
Added the MS (square root of XX) gate to PySparseSim. Added simulator…
ciaranra Jan 13, 2019
0ed9c0b
Took out cirq wrapper to move it to feature branch
ciaranra Jan 13, 2019
9821a48
Initial built initial wrapper for qcgpu
ciaranra Jan 13, 2019
b796173
Small improvements.
ciaranra Jan 13, 2019
41113b6
Took out circuit_runner not longer being used. Improved `Standard.` C…
ciaranra Jan 13, 2019
253e287
deleted old circuit runner
ciaranra Jan 13, 2019
f865476
Merge branch 'development' into feature_qcgpu
ciaranra Jan 13, 2019
0633cce
Wrapped most of the gates.
ciaranra Jan 14, 2019
99ea0b9
Fixed F2 definition error and made minor improvements in ProjectQ wra…
ciaranra Jan 14, 2019
88e45a2
Merge branch 'development' into feature-qcgpu
ciaranra Jan 14, 2019
4fec2e4
Added the MS gate (Sqrt XX).
ciaranra Jan 14, 2019
69ce2df
Merge branch 'feature-qcgpu' into development
ciaranra Jan 14, 2019
963ae2f
Removed quantum_circuit_duration to put it in a separate feature branch.
ciaranra Jan 14, 2019
a71170b
removed two unnecessary documentation pages.
ciaranra Jan 16, 2019
728d6c9
Improved installation documentation
ciaranra Jan 16, 2019
20d3d96
More doc improvements
ciaranra Jan 16, 2019
fa765aa
Added warnings that `run_circuit` and `run_logic` are being deprecate…
ciaranra Jan 17, 2019
63daecb
Added environment yml and described its use in the documentation.
ciaranra Jan 17, 2019
7a60d42
Updated install doc and removed unnecessary _build folder.
ciaranra Jan 17, 2019
defe50c
Merge branch 'master' into development
ciaranra Jan 17, 2019
8787e38
First pass at updating the documentation to just have the ``run`` met…
ciaranra Jan 17, 2019
d2c4d2e
Updated README
ciaranra Jan 20, 2019
e1d7f6c
Update to docs. Corrected version number to 0.2.dev
ciaranra Jan 20, 2019
d69c02f
Small modifications to simulators.
ciaranra Jan 20, 2019
78fd02e
Fixed a test.
ciaranra Jan 20, 2019
af4ef13
Simplified circuit runners.
ciaranra Jan 26, 2019
e79bbc9
Simplification to circuit runner. Added new logo. Small improvement t…
ciaranra Jan 28, 2019
df0d760
added things to gitignore
ciaranra Jan 29, 2019
03fb8c0
Changed README to point to the development branch documentation.
ciaranra Jan 29, 2019
926b146
Added MANIFEST and setup.cfg from master branch
ciaranra Jan 29, 2019
890b276
Edited doc index wording.
ciaranra Jan 29, 2019
46f682d
Edited doc index wording v2.
ciaranra Jan 29, 2019
5c6070b
Small bib fix to doc
ciaranra Jan 29, 2019
75dbdcd
Simplifications for std output and error circuits.
ciaranra Jan 30, 2019
11f28ca
Improved .gitignore and manifest prune
ciaranra Jan 30, 2019
60410d2
Small improvements to doc
ciaranra Feb 5, 2019
1a50f9d
Simplified/cleaned Standard, tests, and tools.
ciaranra Feb 6, 2019
7fca632
Corrected documentation on simulators.
ciaranra Feb 6, 2019
b16f105
Fixed other pages that included the init method of Standard.
ciaranra Feb 6, 2019
92af36e
Simplification to Standard in circuit_runners. Moved std_output to misc.
ciaranra Feb 7, 2019
c80cced
Removed deprecated Standard methods. Updated conda yml and requirements.
ciaranra Feb 19, 2019
d49ab1b
Added a Pauli propagation simulator. Improved the ProjectQ wrapper.
ciaranra Mar 12, 2019
ac4339c
Added a possible QuantumCircuit replacement (quantum_circuit_new)
ciaranra Mar 12, 2019
778d395
A collection of small improvements.
ciaranra Mar 12, 2019
404b72e
Fixed errors in Pauli prop sim and made small improvement to it.
ciaranra Mar 17, 2019
0628ad6
Added `logical_sign` method to Pauli prop sim and ProjectQ wrapper.
ciaranra Mar 18, 2019
71d0095
Simplifying the `logical_sign` method
ciaranra Mar 18, 2019
2330352
Improved the docstrings and typing of quantum_circuit_new.py
ciaranra Mar 20, 2019
1ecdbe4
Further improvements to quantum_circuit_new
ciaranra Mar 20, 2019
aff330d
Improvements to ProjectQ wrapper and gate_dict -> bindings in sims
ciaranra Mar 26, 2019
0289951
Improved wrapping of ProjectQ.
ciaranra Apr 9, 2019
e8fbb34
Fix error for random circuit test.
ciaranra Apr 11, 2019
fd66629
Updated simulators. Changed random_outcome to forced_outcome.
ciaranra Jun 7, 2019
1eebd18
added simulator class typing file
ciaranra Jun 7, 2019
5c78fff
small fix
ciaranra Jun 7, 2019
eedcf56
New circuit updates
ciaranra Jul 26, 2019
7395552
additional circuit update
ciaranra Jul 26, 2019
e76b8c9
change type name
ciaranra Jul 26, 2019
5338621
accumulated updates
ciaranra Jul 26, 2019
1304a98
Dev cleanup (#1)
qartik Oct 5, 2023
e113129
add makefile (#2)
qartik Oct 6, 2023
35245f2
Adding rtd yaml copied from https://docs.readthedocs.io/en/stable/con…
ciaranra Oct 6, 2023
be57b6a
Merge pull request #9 from CQCL/add-rtd-yaml
qciaran Oct 6, 2023
d2f59d4
Update documentation for modern rtd
ciaranra Oct 9, 2023
de5f07e
Until refactored, measurements need to accept **params (#13)
ciaranra Oct 9, 2023
da9c633
Update packages, cleanup ruff.toml (#14)
qartik Oct 11, 2023
e191d48
Fix sim (#15)
qciaran Oct 12, 2023
fbd95a8
Dev updates (#16)
qciaran Oct 12, 2023
ec52cb7
Dev update (#17)
qciaran Oct 18, 2023
8f70e7c
Minor fix to PHIR tests + adding pytest as metadependency (#18)
qciaran Oct 18, 2023
e16f4e0
fix: errors found in end to end testing with pytket-phir
qartik Nov 6, 2023
7ab222a
reviewfix: angles only needed in QOp
qartik Nov 27, 2023
78e6744
reviewfix: convert RZZ to I during phir -> pypmir conversion
qartik Nov 27, 2023
c19d1da
Merge pull request #20 from PECOS-packages/e2e-testing
qartik Nov 28, 2023
9adf3b6
Adding very simple depolarizing error model. (#24)
qciaran Dec 4, 2023
47ae191
changing the dev version number from 0.5.dev1 to 0.5.0.dev1 to be mor…
qciaran Dec 5, 2023
46cd61d
Version bump to fix pypi issue.
ciaranra Dec 6, 2023
80b124b
Bug phir if statement (#27)
qciaran Dec 7, 2023
3630697
add external phir dependency + remove Python 3.8 + test both required…
qciaran Dec 13, 2023
ef01a7b
Added support for qparallel. (#33)
qciaran Dec 13, 2023
f587093
Bug out of order seq (#35)
qciaran Jan 4, 2024
5a3ae19
Fixing support of PHIR's multi-assignment (#36)
qciaran Jan 5, 2024
6151a9b
Adding coder owners file
ciaranra Jan 16, 2024
95a84a9
Fixing code owners file typo
ciaranra Jan 17, 2024
ec85f3e
build: add typed marker for pecos
qartik Jan 23, 2024
70c4724
Initial support for barriers (skips barriers for now). (#38)
qciaran Feb 1, 2024
0856005
bumping version to 0.5.0.dev7
ciaranra Feb 1, 2024
7a77d23
Update requirements
ciaranra Feb 1, 2024
915a2dc
Bumping phir req (#39)
qciaran Feb 1, 2024
e97b6f0
Broadening wasmtime req. + simplifying [all] (#42)
qciaran Feb 2, 2024
83c59b7
Add wasmtime support for engines/cvm/wasm (#43)
qciaran Feb 2, 2024
c26e2bf
bumping to version 0.5.0.dev9 (#44)
qciaran Feb 5, 2024
133f8c3
Update docs (#47)
qciaran Feb 9, 2024
27d5935
Feature more simulators (#21)
PabloAndresCQ Mar 4, 2024
57f35d1
Cumulative development update (#54)
ciaranra Mar 15, 2024
51b862c
Bumping version number to 0.5.0.dev10
ciaranra Mar 15, 2024
5604e24
Feat hybrid noise (#60)
ciaranra Apr 29, 2024
3fab88f
version bump 0.5.0.dev11
ciaranra Apr 29, 2024
0021c2c
Adding specific error messaging and enforced maximum duration to WASM…
nealerickson-qtm May 15, 2024
13ed0b1
64 bit signed arithmetic support (#57)
qartik May 16, 2024
05a84ce
cuStateVec bugfixes and slight refactor (#64)
PabloAndresCQ May 24, 2024
5d2f4e7
Bumping version number to 0.6.0.dev3 (#65)
ciaranra May 24, 2024
ba09e21
Adding a numpy-based basic statevector simulator for more exhaustive …
PabloAndresCQ May 24, 2024
7c57b63
[feature] Adding support for QuEST and Qulacs statevector simulators …
PabloAndresCQ Aug 5, 2024
29e4c9e
[feature] Adding support for MPS simulation (#63)
PabloAndresCQ Aug 13, 2024
c9ea7e5
Bumping version number to 0.6.0.dev4
ciaranra Aug 21, 2024
98227e1
[Bugfixes] Solving some issues for qemulator MPS release (#73)
PabloAndresCQ Sep 5, 2024
967e2b6
Bump to 0.6.0.dev5
ciaranra Sep 6, 2024
b21be0d
Feat qeclib steane (#75)
qciaran Sep 12, 2024
d2ca018
Typo fixed in the implementation of `p` and `tdg` in `steane_class.py…
PabloAndresCQ Sep 13, 2024
2760ece
Branch smash!
ciaranra Nov 27, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @ciaranra
269 changes: 269 additions & 0 deletions .github/workflows/python-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,269 @@
name: Python Artifacts

env:
TRIGGER_ON_PR_PUSH: false # Set to true to enable triggers on PR pushes
PYTHON_VERSION: '3.10'

on:
push:
branches:
- development
- master
tags:
- 'py-*'
pull_request:
branches:
- development
- master
workflow_dispatch:
inputs:
sha:
description: Commit SHA
type: string
dry_run:
description: 'Dry run (build but not publish)'
type: boolean
default: true

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

defaults:
run:
shell: bash

jobs:
check_pr_push:
runs-on: ubuntu-latest
if: github.event_name == 'pull_request' && github.event.action != 'closed'
outputs:
run: ${{ steps.check.outputs.run }}
steps:
- name: Check if should run on PR push
id: check
run: |
if [ "${{ env.TRIGGER_ON_PR_PUSH }}" = "true" ]; then
echo "run=true" >> $GITHUB_OUTPUT
else
echo "run=false" >> $GITHUB_OUTPUT
fi

build_sdist_pecos_rslib:
needs: check_pr_push
if: |
always() &&
(needs.check_pr_push.result == 'success' && needs.check_pr_push.outputs.run == 'true' || needs.check_pr_push.result == 'skipped') &&
(github.event_name != 'pull_request' || github.event.pull_request.merged == true || github.event.action == 'opened' || github.event.action == 'synchronize')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.sha || github.sha }}

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}

- name: Remove conflicting README.md
run: |
if [ -f crates/pecos-python/README.md ]; then
mv crates/pecos-python/README.md crates/pecos-python/README.md.bak
echo "Moved conflicting README.md to README.md.bak"
else
echo "No conflicting README.md found"
fi

- name: Build pecos-rslib SDist
uses: PyO3/maturin-action@v1
with:
command: sdist
args: --out dist
working-directory: python/pecos-rslib

- name: Restore README.md
if: always()
run: |
if [ -f crates/pecos-python/README.md.bak ]; then
mv crates/pecos-python/README.md.bak crates/pecos-python/README.md
echo "Restored README.md from backup"
else
echo "No README.md backup found"
fi

- name: Test pecos-rslib SDist
run: |
pip install --force-reinstall --verbose python/pecos-rslib/dist/*.tar.gz
python -c 'import pecos_rslib; print(pecos_rslib.__version__)'

- name: Upload pecos-rslib SDist
uses: actions/upload-artifact@v4
with:
name: sdist-pecos-rslib
path: python/pecos-rslib/dist/*.tar.gz

build_wheels_pecos_rslib:
needs: check_pr_push
if: |
always() &&
(needs.check_pr_push.result == 'success' && needs.check_pr_push.outputs.run == 'true' || needs.check_pr_push.result == 'skipped') &&
(github.event_name != 'pull_request' || github.event.pull_request.merged == true || github.event.action == 'opened' || github.event.action == 'synchronize')
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ['3.10', '3.11', '3.12']
architecture: [ x86_64, aarch64 ]
exclude:
- os: windows-latest
architecture: aarch64

steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.sha || github.sha }}

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Remove conflicting README.md
run: |
if [ -f crates/pecos-python/README.md ]; then
mv crates/pecos-python/README.md crates/pecos-python/README.md.bak
echo "Moved conflicting README.md to README.md.bak"
else
echo "No conflicting README.md found"
fi

- name: Build wheel
uses: PyO3/maturin-action@v1
with:
command: build
args: --release --out dist --interpreter python${{ matrix.python-version }}
working-directory: python/pecos-rslib
target: ${{ matrix.architecture == 'aarch64' && (matrix.os == 'macos-latest' && 'aarch64-apple-darwin' || 'aarch64-unknown-linux-gnu') || '' }}
manylinux: auto

- name: Restore README.md
if: always()
run: |
if [ -f crates/pecos-python/README.md.bak ]; then
mv crates/pecos-python/README.md.bak crates/pecos-python/README.md
echo "Restored README.md from backup"
else
echo "No README.md backup found"
fi

- name: Test wheel
if: matrix.architecture == 'x86_64'
run: |
pip install --force-reinstall --verbose python/pecos-rslib/dist/*.whl
python -c 'import pecos_rslib; print(pecos_rslib.__version__)'

- name: Upload wheel
uses: actions/upload-artifact@v4
with:
name: wheel-pecos-rslib-${{ matrix.os }}-${{ matrix.architecture }}-py${{ matrix.python-version }}
path: python/pecos-rslib/dist/*.whl

build_sdist_quantum_pecos:
needs: [check_pr_push, build_sdist_pecos_rslib, build_wheels_pecos_rslib]
if: |
always() &&
(needs.check_pr_push.result == 'success' && needs.check_pr_push.outputs.run == 'true' || needs.check_pr_push.result == 'skipped') &&
(github.event_name != 'pull_request' || github.event.pull_request.merged == true || github.event.action == 'opened' || github.event.action == 'synchronize')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.sha || github.sha }}

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}

- name: Download pecos-rslib wheel
uses: actions/download-artifact@v4
with:
name: wheel-pecos-rslib-ubuntu-latest-x86_64-py${{ env.PYTHON_VERSION }}
path: ./pecos-rslib-wheel

- name: Install pecos-rslib
run: pip install ./pecos-rslib-wheel/*.whl

- name: Install build dependencies
run: |
python -m pip install --upgrade pip
pip install build

- name: Build quantum-pecos SDist
run: |
cd python/quantum-pecos
python -m build --sdist --outdir dist

- name: Test quantum-pecos SDist
run: |
pip install python/quantum-pecos/dist/*.tar.gz
python -c 'import pecos; print(pecos.__version__)'

- name: Upload quantum-pecos SDist
uses: actions/upload-artifact@v4
with:
name: sdist-quantum-pecos
path: python/quantum-pecos/dist/*.tar.gz

build_wheels_quantum_pecos:
needs: [check_pr_push, build_wheels_pecos_rslib, build_sdist_quantum_pecos]
if: |
always() &&
(needs.check_pr_push.result == 'success' && needs.check_pr_push.outputs.run == 'true' || needs.check_pr_push.result == 'skipped') &&
(github.event_name != 'pull_request' || github.event.pull_request.merged == true || github.event.action == 'opened' || github.event.action == 'synchronize')
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.10', '3.11', '3.12']

steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.sha || github.sha }}

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Download pecos-rslib wheel
uses: actions/download-artifact@v4
with:
name: wheel-pecos-rslib-ubuntu-latest-x86_64-py${{ matrix.python-version }}
path: ./pecos-rslib-wheel

- name: Install pecos-rslib
run: pip install ./pecos-rslib-wheel/*.whl

- name: Install build dependencies
run: |
python -m pip install --upgrade pip
pip install build

- name: Build quantum-pecos wheel
run: |
cd python/quantum-pecos
python -m build --wheel --outdir dist

- name: Test quantum-pecos wheel
run: |
pip install python/quantum-pecos/dist/*.whl
python -c 'import pecos; print(pecos.__version__)'

- name: Upload quantum-pecos wheel
uses: actions/upload-artifact@v4
with:
name: wheel-quantum-pecos-py${{ matrix.python-version }}
path: python/quantum-pecos/dist/*.whl
102 changes: 102 additions & 0 deletions .github/workflows/python-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
name: Python test / linting

on:
push:
branches: [ "master", "development" ]
paths:
- 'python/**'
- '.github/workflows/python-test.yml'
- '.typos.toml'
- 'ruff.toml'
- '.pre-commit-config.yaml'
pull_request:
branches: [ "master", "development" ]
paths:
- 'python/**'
- '.github/workflows/python-test.yml'
- '.typos.toml'
- 'ruff.toml'
- '.pre-commit-config.yaml'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true


env:
RUSTFLAGS: -C debuginfo=0
RUST_BACKTRACE: 1
PYTHONUTF8: 1

defaults:
run:
shell: bash

jobs:
python-test:

runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
python-version: ["3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Create and activate virtual environment
env:
BIN: ${{ matrix.os == 'windows-latest' && 'Scripts' || 'bin' }}
run: |
python -m venv .venv
source .venv/$BIN/activate
echo "$GITHUB_WORKSPACE/.venv/$BIN" >> $GITHUB_PATH
echo "VIRTUAL_ENV=$GITHUB_WORKSPACE/.venv" >> $GITHUB_ENV

- name: Install Python dependencies
run: |
python -m pip install --upgrade pip setuptools
pip install maturin pytest pre-commit
echo "Temporarily removing pecos-rslib from requirements... because we need to build it"
grep -v "pecos-rslib" python/quantum-pecos/requirements.txt > temp_requirements.txt
echo "Installing project requirements (excluding pecos-rslib)..."
pip install -r temp_requirements.txt
echo "Cleaning up temporary files..."
rm temp_requirements.txt

- name: Set up Rust
run: rustup show

- name: Cache Rust
uses: Swatinem/rust-cache@v2
with:
workspaces: python/pecos-rslib

- name: Install pecos-rslib with maturin develop
run: |
cd python/pecos-rslib
maturin develop

- name: Install pure Python PECOS
run: pip install ./python/quantum-pecos/

- name: Run pre-commit checks
run: |
pre-commit run --all-files --show-diff-on-failure

- name: Run standard tests
run: |
pip install pytest-cov
pytest ./python/tests --doctest-modules --junitxml=junit/test-results.xml --cov=com --cov-report=xml --cov-report=html

- name: Run tests with optional dependencies
run: |
pip install pytest-cov
pip install ./python/quantum-pecos/[all]
pytest ./python/tests --doctest-modules --junitxml=junit/test-results.xml --cov=com --cov-report=xml --cov-report=html -m optional_dependency
Loading