Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
479 commits
Select commit Hold shift + click to select a range
a2e6350
Adding more angle functionality
ciaranra Jan 6, 2025
7f3a824
Parsing strings to angles functionality
ciaranra Jan 7, 2025
5982e51
Add Steane-type and teleportation-based QEC for the Steane code (#115)
perlinm Jan 7, 2025
559f7a6
Fixing conversion from turn fraction
ciaranra Jan 6, 2025
6de2a41
Adding tryfrom for angle
ciaranra Jan 7, 2025
9d6fa5d
Merge branch 'feat/pauli' into feat/angle-parse-str
ciaranra Jan 7, 2025
b5d78ea
angle cleanup + Angle8 + Angle16
ciaranra Jan 7, 2025
41db3ed
Add angle +=, -=. *=, /=
ciaranra Jan 8, 2025
d582fdd
Merge branch 'feat/pauli' into feat/angle-parse-str
ciaranra Jan 8, 2025
52cf7c4
Adding radian string parsing to Angle
ciaranra Jan 8, 2025
0608a07
Rough draft implementation of classical operator support is added. Wi…
peter-campora Jan 8, 2025
b09350f
First binary operator test passed.
peter-campora Jan 8, 2025
4ff6bbc
More doc strings
ciaranra Jan 8, 2025
8c7e445
Removing debugging print statements
ciaranra Jan 8, 2025
64a5206
Compiled steane successfully
peter-campora Jan 8, 2025
7949bd8
Added better string input
ciaranra Jan 9, 2025
5bcab01
Splitting up the parsing function
ciaranra Jan 9, 2025
25c1043
Testing more str angle edge cases
ciaranra Jan 9, 2025
26467c6
fix spelling
ciaranra Jan 9, 2025
c6d0558
Merge branch 'development' into feat/angle-parse-str
ciaranra Jan 9, 2025
a2e54b7
Merge branch 'feat/angle-parse-str' into feat/pauli
ciaranra Jan 12, 2025
86848b0
Merge branch 'development' into feat/more-sims
ciaranra Jan 12, 2025
204baf2
Adding general Rng to state_vec
ciaranra Jan 12, 2025
dbf706d
Update state-vector docs
ciaranra Jan 12, 2025
3959be0
Unifying safety notification in state-vec docs
ciaranra Jan 12, 2025
fd044e7
Updated the test doc for state-vec
ciaranra Jan 12, 2025
ff415f2
Renaming rxxryyrzz gate base on actual gate application
ciaranra Jan 12, 2025
3116264
Updating state-vec docs
ciaranra Jan 12, 2025
5dd8496
Fix RXRYYRZZ -> RZZRYYRXX
ciaranra Jan 12, 2025
88ddbf7
more tests for state-vec + small doc improvement
ciaranra Jan 13, 2025
cb2055e
Reorganizing tests
ciaranra Jan 13, 2025
5abf95c
cleanup target and control arguments
ciaranra Jan 22, 2025
61afcba
adding hybrid engine files
ciaranra Jan 20, 2025
a37d959
Getting cli compile working again
ciaranra Jan 23, 2025
6b0a360
fixing license header typo
ciaranra Jan 24, 2025
3ffc8e2
Some clean up
ciaranra Jan 25, 2025
de437b4
Adding general noise model
ciaranra Jan 25, 2025
1f10e8c
Rust<>Python PHIRClassicalInterpeter
ciaranra Jan 26, 2025
175a4bd
Getting building working...
ciaranra Jan 26, 2025
5477d05
moving pecos-python into pecos-rslib + more PHIREngine Python functio…
ciaranra Jan 26, 2025
81888bf
Small tweaks for cargo test in pecos-rslib
ciaranra Jan 27, 2025
e62c649
PHIREngine 🚒
ciaranra Jan 28, 2025
752c05e
Adding simulation to engines
ciaranra Jan 28, 2025
bb675c3
Merge branch 'feat/more-sims' into feat/hyrbid-engine-rs
ciaranra Jan 28, 2025
9e56c1f
Finish adding in updated sims
ciaranra Jan 28, 2025
73a02bd
Integrating sims into hybrid engine workflow
ciaranra Jan 28, 2025
e5a9b15
Small tweaks
ciaranra Jan 29, 2025
ce21cbd
small refactor
ciaranra Jan 29, 2025
ef20b38
qir engine tweak
ciaranra Jan 29, 2025
90305b0
Merge branch 'feat/pauli' into feat/hyrbid-engine-rs
ciaranra Jan 29, 2025
cc01c9b
refactor pecos-noise out
ciaranra Jan 29, 2025
c0b6208
More refactoring
ciaranra Jan 29, 2025
da4b5be
refactor + linting + updating dependencies
ciaranra Feb 1, 2025
0c18833
Hopefully merged development correctly.
peter-campora Feb 3, 2025
a5f7f23
Merged successfully
peter-campora Feb 3, 2025
7feb82f
Fixed some linting
peter-campora Feb 3, 2025
3ff93a9
ruff unsafe fixes applied
peter-campora Feb 3, 2025
51958fb
Linter happy :)
peter-campora Feb 3, 2025
f821b3d
Removing failing asserts from QIR tests
peter-campora Feb 3, 2025
ccbb535
Precommit happy after tests use qir variable
peter-campora Feb 3, 2025
6a69cf1
Trying to remove circular QReg import in gen_qasm.py.
peter-campora Feb 3, 2025
a0efb67
Hopefully getting QIR testing supported in CI :D
peter-campora Feb 3, 2025
563c701
Ruff ruff
peter-campora Feb 3, 2025
f35a172
Let's try to install LLVM in workflows, surely nothing could go wrong.
peter-campora Feb 3, 2025
7ab4d8c
Things went wrong.
peter-campora Feb 3, 2025
086aa59
Weird yaml spacing issues in emacs
peter-campora Feb 3, 2025
c6a8d34
PyCharm any better???
ciaranra Feb 3, 2025
2b5eab8
Github happy now?
ciaranra Feb 3, 2025
fa039ba
Fixing circular import issues
peter-campora Feb 5, 2025
56f5040
Merge branch 'slr_qir_classical' of ssh://github.com/PECOS-packages/P…
peter-campora Feb 5, 2025
ded4e85
Black linting fix
peter-campora Feb 5, 2025
6290556
some qasm tests failing but overall fixed many tests
peter-campora Feb 5, 2025
9f29a1e
some qasm tests failing but overall fixed many tests
peter-campora Feb 5, 2025
c0ad7ad
Adding a method to generate bitcode
peter-campora Feb 13, 2025
bb280d7
prototype message system
ciaranra Feb 13, 2025
13147c5
prototype byte messages and DrivingProcessor/CoProcessor
ciaranra Feb 16, 2025
bd33a60
Making linting happy
ciaranra Feb 16, 2025
7a7a9e5
Fixing version number for proto_bytemessage_py
ciaranra Feb 16, 2025
2cf43c5
Adding plugin prototype
ciaranra Feb 22, 2025
b26bfb6
Updating to Rust edition 2024
ciaranra Feb 22, 2025
f07e21d
making linters happy + some other clean up
ciaranra Feb 22, 2025
e4a0223
Merging core code
ciaranra Feb 22, 2025
1b24335
Remove unused code
ciaranra Feb 22, 2025
605853b
Adding basic engine definitions + starting to update quantum engines
ciaranra Feb 23, 2025
811919c
Add more Engine system traits/structs + reorg
ciaranra Feb 23, 2025
278c55b
make clippy happy
ciaranra Feb 23, 2025
06372e1
Moving some CLI code into pecos-engines
ciaranra Feb 23, 2025
9e001a3
Fixing QIr Bell state prep and measure program.
ciaranra Feb 23, 2025
2dfac7f
Introducing MonteCarloEngine
ciaranra Feb 23, 2025
c4a0627
moving more functionality in monte_carlo.rs
ciaranra Feb 23, 2025
9f46c45
refactoring...
ciaranra Feb 24, 2025
1e0ce08
Adding SX, SXdg, and SY + fixing a qir test
ciaranra Feb 25, 2025
53deee7
linting...
ciaranra Feb 25, 2025
098384e
Cleaning up Cargo.tomls
ciaranra Feb 25, 2025
0d7590e
Adding run.sh script to run all prototype examples + deleting old files
ciaranra Feb 25, 2025
e2f960a
Moving pecos-noise into pecos-engines for now
ciaranra Feb 25, 2025
589b2e4
Refactor to use EngineSystem in HybridEngine
ciaranra Feb 26, 2025
1dbc6d3
code cleanup
ciaranra Feb 26, 2025
592899b
Moving some of the byte message code to pecos-engine...
ciaranra Feb 26, 2025
adbb938
Make MonteCarloEngine more stateless...
ciaranra Feb 26, 2025
d829996
Refactoring MonteCarloEngine to be a bit more plugin freindly
ciaranra Feb 28, 2025
33d049f
Small refactor to get rid of run_program()
ciaranra Mar 2, 2025
fbd195b
Make engines more fluent
ciaranra Mar 2, 2025
7b59de2
Introduces CReg size check for QIR + linting
ciaranra Mar 2, 2025
2fb6b16
Fixing bug brought up in issue #119 (#126)
ciaranra Mar 2, 2025
9711a89
Merge branch 'development' into slr_qir_classical
ciaranra Mar 2, 2025
3d87117
Adding run_with_engines and run_with_classical_engine
ciaranra Mar 2, 2025
4bf6806
fixing test regex issue
ciaranra Mar 2, 2025
2982046
Fixes test warnings (#128)
ciaranra Mar 3, 2025
babcdb4
Merge branch 'development' into slr_qir_classical
ciaranra Mar 3, 2025
6284851
Merge branch 'development' into feat/hyrbid-engine-rs
ciaranra Mar 3, 2025
f729b1c
Fixing Rust tests (monte_carlo.rs)
ciaranra Mar 3, 2025
7ae0fc4
hopefully fixes pecos.slr issue with optional QIR/LLVM
ciaranra Mar 3, 2025
caf4b67
Feat/depolar reset (#129)
ciaranra Mar 3, 2025
916b9eb
Remove stale libraries
ciaranra Mar 3, 2025
aed2795
Running a byte encoded message system for Bell state problem
ciaranra Mar 3, 2025
0456748
cleanup
ciaranra Mar 4, 2025
ab87bc3
more directly messaging with byte messages
ciaranra Mar 4, 2025
bb39ba5
Removing old code + making clippy happy
ciaranra Mar 4, 2025
ca73f09
Have clippy not bother about documentation until ready...
ciaranra Mar 5, 2025
d176dc9
Small step towards no CommandBatch
ciaranra Mar 5, 2025
7d60f8d
Remove more CommandBatch
ciaranra Mar 5, 2025
123231d
add example external CEngine
ciaranra Mar 6, 2025
a898583
Merge remote-tracking branch 'origin/feat/byte-time' into feat/byte-time
ciaranra Mar 6, 2025
05bf16f
Updating message builder
ciaranra Mar 6, 2025
26d55e9
making macos happywq
ciaranra Mar 7, 2025
547d216
Making sure the llvm module gets a fresh context each time
peter-campora Mar 7, 2025
472acd6
engine refactor
ciaranra Mar 8, 2025
f5f04ea
Removing some of QuantumCommand + MessageBuilder refactor
ciaranra Mar 8, 2025
25ae8a4
Merge remote-tracking branch 'origin/development' into slr_qir_classical
ciaranra Mar 8, 2025
da538aa
Merge branch 'development' into feat/byte-time
ciaranra Mar 8, 2025
0d34a47
explicit initalization of llvmlite.binding.initialize on QIR conversi…
peter-campora Mar 10, 2025
6c447b2
Using binding.shutdown() at the end of each compilation to prevent ne…
peter-campora Mar 10, 2025
90c7de5
Give better control over noise model etc.
ciaranra Mar 12, 2025
7031ab1
Updating builder to include prep and rzz
ciaranra Mar 12, 2025
ca2116d
Add extracting measurement results to vec
ciaranra Mar 12, 2025
b7d9ebd
Adding seed management
ciaranra Mar 13, 2025
b2097a9
Refactoring ByteMessage and related code
ciaranra Mar 13, 2025
a3bdbd0
Updating pyo3 version + adding reset() to byte message builder
ciaranra Mar 13, 2025
e87488f
Refactor to remove GateType, CommandBatch, etc.
ciaranra Mar 14, 2025
14215c6
More refactoring...
ciaranra Mar 14, 2025
117fc15
update phir.rs + PHIR Bell example test
ciaranra Mar 14, 2025
28ad8b3
Getting QIR examples working + refactorings...
ciaranra Mar 18, 2025
894b2ea
RZZ encoding/parsing fixes, parsing error handling, RZZ indexing fixe…
jake-arkinstall Mar 18, 2025
cf199b6
Getting depolarizing PHIR noise model working with Transport or Idle
ciaranra Mar 27, 2025
1dd7972
Getting generic error model working with more PHIR cases...
ciaranra Mar 27, 2025
3358cf0
Adding more complex PHIR examples + small refactoring
ciaranra Mar 29, 2025
148daf3
p2_mem None by default
ciaranra Mar 29, 2025
a08f703
Updating noise model to have conditional errors
ciaranra Mar 30, 2025
02115f5
Adding other noise channels
ciaranra Mar 30, 2025
f77a939
general_noise updates
ciaranra Apr 8, 2025
216eef4
Getting QuantumSystem implementing EngineSystem working
ciaranra Apr 18, 2025
0c90f9b
refactor the handling of rngs
ciaranra Apr 18, 2025
5b4669c
Polish rng implementation
ciaranra Apr 18, 2025
4edb47b
Remove deprecated code and polishing documentation
ciaranra Apr 19, 2025
1b78f78
linting
ciaranra Apr 19, 2025
d48d79c
Improved Python general noise model
ciaranra Apr 19, 2025
0ff544d
Simplifying. removing experimental code from this branch
ciaranra Apr 19, 2025
1efe606
Add shot argument to PECOS CLI and ensure deterministic output
ciaranra Apr 19, 2025
4bf157a
polishing rng
ciaranra Apr 20, 2025
fdb8fb1
Adding PyO3 wrapper of ByteMessage and ByteMessageBuilder
ciaranra Apr 20, 2025
978cd5f
Adding GeneralDepolarizingNoise
ciaranra Apr 23, 2025
db663bf
Adding biased noise model
ciaranra Apr 24, 2025
4c1d573
Polishing rng management in noise models
ciaranra Apr 25, 2025
388608a
Adding GeneralNoiseModel, which combines DepolarizingNoiseModel and B…
ciaranra Apr 25, 2025
019575f
Adding general noise...
ciaranra Apr 28, 2025
218ae7b
Some clean up
ciaranra Apr 28, 2025
9064c5c
Add with_przz_params()
ciaranra Apr 29, 2025
839c815
add new weighted sampling
ciaranra Apr 30, 2025
d6f4e01
Switching GeneralNoiseModel to new weighted index based sampler
ciaranra May 1, 2025
4c82362
Added more statements to the builder of the general noise
ciaranra May 1, 2025
ad631c8
noise model cleanup
ciaranra May 1, 2025
1bc87e1
Getting permute working for both QASM and QIR (#130)
ciaranra May 3, 2025
db44d1f
Updating workflow to deal with llc
ciaranra May 3, 2025
3493fdd
Fixing workflows
ciaranra May 5, 2025
9675f86
turning of flag forcing workflows to run
ciaranra May 5, 2025
ae9bb86
make windows happy
ciaranra May 7, 2025
a093d39
removed conditional statement in _create_qgate_call focused on unroll…
Jonhas-qtm May 13, 2025
2fd10d8
Refactor general noise (#136)
ciaranra May 13, 2025
423057d
Merge pull request #137 from PECOS-packages/bugfix/slr_qir_classical_…
peter-campora May 13, 2025
ce2587b
Removed crosstalk_per_gate for now
ciaranra May 14, 2025
c6d2100
with_p_crosstalk_meas -> with_p_meas_crosstalk
ciaranra May 14, 2025
fdd1763
Removed leak2depolar. Now just use leakage_scale to adjust leakage
ciaranra May 14, 2025
48701d2
Moving "memory"/"idle" noise to p_idle_*
ciaranra May 15, 2025
059c052
Adding the option of fake memory/idling noise after TQ gates
ciaranra May 15, 2025
774ae99
Have GeneralNoiseModelBuilder.build() return noise model instead of box
ciaranra May 15, 2025
6cf6d8c
Fixing F'd F gates
nealerickson-qtm May 15, 2025
0b43fa9
Commenting decompositions
nealerickson-qtm May 15, 2025
11c93f9
F4dg experiment
nealerickson-qtm May 15, 2025
da1d619
Update smash! (#139)
ciaranra May 17, 2025
883679e
Merge branch 'development' into feat/refactor-n-memory
ciaranra May 17, 2025
e1470df
Fixing some boxing
ciaranra May 17, 2025
6f511d7
feel the merge
ciaranra May 17, 2025
4259e08
Add crate preludes + make convenience
ciaranra May 19, 2025
8e112b7
fixed RZ call on qir gate mapping
Jonhas-qtm May 19, 2025
1c51cb2
Merge branch 'refactor' into feat/refactor-n-memory
ciaranra May 19, 2025
ede84b3
Fixed TQ seepage
ciaranra May 19, 2025
4a66e73
Moved run_qasm_sim to main pecos-qasm
ciaranra May 19, 2025
74e2f3e
Adding run_sim() to pecos and QASMProgram to pecos-qasm
ciaranra May 20, 2025
7cc63be
Fixing some misleading trace comments (#141)
PabloAndresCQ May 22, 2025
e7b8079
Added idling noise + multiple qubit support for quantum engines
ciaranra May 22, 2025
6962373
Merge remote-tracking branch 'origin/feat/hyrbid-engine-rs' into feat…
ciaranra May 22, 2025
c156ad8
Reduce requirements for numpy...
ciaranra May 22, 2025
9a3403e
Removing pyquest as it has been causing some issues...
ciaranra May 22, 2025
5c7159a
Add StateVecRs as a fallback for "state-vector" in Python PECOS.
ciaranra May 22, 2025
e9da908
Python cleanup...
ciaranra May 23, 2025
5393b93
Merge branch 'numpy-req' into python-lint
ciaranra May 23, 2025
e5bc590
More cleaning
ciaranra May 23, 2025
cc8e4f8
More cleaning
ciaranra May 24, 2025
a5a8705
More cleaning
ciaranra May 24, 2025
3617371
More cleaning
ciaranra May 27, 2025
0b5609b
Moving pecos-engines/engines/ files down + break engines.rs to engine…
ciaranra May 29, 2025
729ca22
Added linear idling noise
ciaranra May 29, 2025
8a77933
Removed explicit ResultId from measurements
ciaranra May 30, 2025
ab7c347
Removed Message from quantum_cmd.rs and deleted message_data.rs
ciaranra May 30, 2025
bdb49de
Added Rust errors comments
ciaranra May 30, 2025
a4989d4
Unifying QuantumCmd and QuantumCommand enums...
ciaranra May 30, 2025
1bba638
trigger workflows on dev branch too
ciaranra May 31, 2025
b8e7de4
Simplified pecos-qir static library compiling
ciaranra May 31, 2025
debdda0
Python lint (#12)
ciaranra May 31, 2025
ed320a3
Refactor pecos-qir & gate typing
ciaranra Jun 1, 2025
418e771
Simplifying pecos-engines and pecos-qir code (#15)
ciaranra Jun 1, 2025
a36f488
Polish QASM (#16)
ciaranra Jun 3, 2025
da4d8c3
improved simulation output with formatter
ciaranra Jun 3, 2025
34596cc
Refactor new result code into module
ciaranra Jun 3, 2025
001af5c
Using BitVec as the basic creg data type in pecos-qasm
ciaranra Jun 3, 2025
bbee58e
Simplifying byte_message/
ciaranra Jun 4, 2025
21130af
More cleaning
ciaranra Jun 4, 2025
ee66ea7
Fix QIR testing?
ciaranra Jun 5, 2025
d9b36ff
Simplify the parser for pecos-qasm
ciaranra Jun 5, 2025
232dd50
Adding const folding
ciaranra Jun 6, 2025
1718d50
adding run_qasm_sim to Python
ciaranra Jun 7, 2025
cf1c951
lint
ciaranra Jun 8, 2025
c0c5e99
Merge branch 'python-lint' into polish-qasm
ciaranra Jun 10, 2025
90f4d72
Make lint helping
ciaranra Jun 10, 2025
6c79f5a
Update some docs + cleanup of ByteMessage to use .add_outcomes and .o…
ciaranra Jun 11, 2025
45c6d79
Simplify ByteMessage
ciaranra Jun 11, 2025
8ffcf6c
Update builder pattern Python doc
ciaranra Jun 12, 2025
35b1ddb
Removing biased measurement noise since biased depolarizing noise giv…
ciaranra Jun 12, 2025
c2d3e47
Update p_idle_linear_rate to use validate_non_negative + switched p_i…
ciaranra Jun 12, 2025
e949d91
Add binary output formatting to qasm_sim
ciaranra Jun 12, 2025
fa3da10
lint
ciaranra Jun 12, 2025
bbf723c
Improve qasm_sim Python API
ciaranra Jun 12, 2025
43f256c
Add config to qasm_sim
ciaranra Jun 13, 2025
cc9986e
Fixing some qasm include issues
ciaranra Jun 13, 2025
4655dc7
Fixed issue with quadratic idling sometimes issuing gates with no qubits
PabloAndresCQ Jun 18, 2025
f545a1e
Merge branch 'refactor-n-memory' into slr_qir_classical
ciaranra Jun 23, 2025
962aaa9
Fix permute issue?
ciaranra Jun 23, 2025
0a650ca
Linting
ciaranra Jun 23, 2025
60c39c6
Fixed recursive Permute issue
ciaranra Jun 30, 2025
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
  •  
  •  
  •  
4 changes: 3 additions & 1 deletion .github/workflows/python-release.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
name: Python Artifacts

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

on:
push:
branches:
- dev
- development
- master
tags:
- 'py-*'
pull_request:
branches:
- dev
- development
- master
workflow_dispatch:
Expand Down
106 changes: 56 additions & 50 deletions .github/workflows/python-test.yml
Original file line number Diff line number Diff line change
@@ -1,40 +1,41 @@
name: Python test / linting

env:
TRIGGER_ON_PR_PUSH: true # Set to true to enable triggers on PR pushes
RUSTFLAGS: -C debuginfo=0
RUST_BACKTRACE: 1
PYTHONUTF8: 1

on:
push:
branches: [ "master", "development" ]
paths:
- 'python/**'
- '.github/workflows/python-test.yml'
- '.typos.toml'
- 'ruff.toml'
- '.pre-commit-config.yaml'
branches: [ "master", "development", "dev" ]
# # Comment out paths to force run on all pushes
# 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'
branches: [ "master", "development", "dev" ]
# # Comment out paths to force run on all PRs
# 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
Expand All @@ -50,51 +51,56 @@ jobs:
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 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: Install the latest version of uv
uses: astral-sh/setup-uv@v4
with:
enable-cache: true

- name: Set up Rust
run: rustup show

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

- name: Install LLVM
uses: KyleMayes/install-llvm-action@v2
with:
version: "14.0"
env: True

- name: Install pecos-rslib with maturin develop
- name: Configure LLVM
run: echo "LLVM_SYS_140_PREFIX=$LLVM_PATH" >>"$GITHUB_ENV" && "$LLVM_PATH/bin/llvm-config" --version

- name: Generate lockfile and install dependencies
run: |
uv lock --project .
uv sync --project .

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

- name: Install pure Python PECOS
run: pip install ./python/quantum-pecos/
- name: Install quantum-pecos
run: |
cd python/quantum-pecos
uv pip install -e .

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

- name: Install test dependencies
run: |
pre-commit run --all-files --show-diff-on-failure
cd python/quantum-pecos
uv pip install -e .[all,test] # Install with both all and test extras
uv pip install pytest pytest-cov # Explicitly install test requirements

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

- name: Run tests with optional dependencies
- name: Run optional dependency tests
run: |
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
uv run pytest ./python/tests --doctest-modules --junitxml=junit/test-results.xml --cov=com --cov-report=xml --cov-report=html -m optional_dependency
166 changes: 156 additions & 10 deletions .github/workflows/rust-test.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
name: Rust test / linting

env:
TRIGGER_ON_PR_PUSH: true # Set to true to enable triggers on PR pushes
RUSTFLAGS: -C debuginfo=0
RUST_BACKTRACE: 1

on:
push:
branches: [ "master", "development" ]
branches: [ "master", "development", "dev" ]
paths:
- 'crates/**'
- 'examples/**'
- 'Cargo.toml'
- '.github/workflows/rust-test.yml'
- '.pre-commit-config.yaml'
pull_request:
branches: [ "master", "development" ]
branches: [ "master", "development", "dev" ]
paths:
- 'crates/**'
- 'examples/**'
Expand All @@ -22,23 +27,25 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

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

jobs:
rust-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install Rust (for local testing)
run: |
curl https://sh.rustup.rs -sSf | sh -s -- -y
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
export PATH="$HOME/.cargo/bin:$PATH"

- name: Set up Rust
run: rustup override set stable && rustup update

- name: Cache Rust
uses: Swatinem/rust-cache@v2
with:
save-if: ${{ github.ref_name == 'master' || github.ref_name == 'development' }}
save-if: ${{ github.ref_name == 'master' || github.ref_name == 'development' || github.ref_name == 'dev' }}

- name: Install rustfmt
run: rustup component add rustfmt
Expand Down Expand Up @@ -76,16 +83,155 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Install Rust (for local testing)
if: matrix.os == 'windows-latest'
run: |
curl -sSf -o rustup-init.exe https://win.rustup.rs
./rustup-init.exe -y --default-toolchain stable --profile minimal
echo "$HOME\.cargo\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
$env:Path += ";$HOME\.cargo\bin"

- name: Install Rust (for local testing)
if: matrix.os != 'windows-latest'
run: |
curl https://sh.rustup.rs -sSf | sh -s -- -y
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
export PATH="$HOME/.cargo/bin:$PATH"

- name: Set up Rust
run: rustup show

- name: Cache Rust
uses: Swatinem/rust-cache@v2
with:
save-if: ${{ github.ref_name == 'master' || github.ref_name == 'development' }}
save-if: ${{ github.ref_name == 'master' || github.ref_name == 'development' || github.ref_name == 'dev' }}

- name: Install LLVM Tools (Ubuntu)
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
# Add LLVM 14 repository
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
sudo add-apt-repository "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-14 main"
sudo apt-get update
# Install LLVM 14 specifically
sudo apt-get install -y llvm-14 clang-14
# Create symlinks for llc and clang
sudo update-alternatives --install /usr/bin/llc llc /usr/bin/llc-14 100
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-14 100
# Verify installation
which llc
llc --version

- name: Install LLVM Tools (macOS)
if: matrix.os == 'macos-latest'
run: |
brew install llvm@14
echo "$(brew --prefix llvm@14)/bin" >> $GITHUB_PATH
# Make sure it's available in the current step too
export PATH="$(brew --prefix llvm@14)/bin:$PATH"
which llc
llc --version

- name: Install LLVM Tools (Windows)
if: matrix.os == 'windows-latest'
uses: KyleMayes/install-llvm-action@v2
with:
version: "14.0"
directory: ${{ runner.temp }}/llvm
env: true

- name: Setup LLVM Path (Windows)
if: matrix.os == 'windows-latest'
run: |
Write-Host "Setting up LLVM in PATH..."

# Display LLVM_PATH environment variable set by the action
Write-Host "LLVM_PATH environment variable: $env:LLVM_PATH"

# Add LLVM bin directory to PATH for this and subsequent steps
$llvmBinDir = Join-Path -Path $env:LLVM_PATH -ChildPath "bin"

# Verify the directory exists
if (Test-Path -Path $llvmBinDir) {
Write-Host "LLVM bin directory exists at $llvmBinDir"
# List contents to verify what's available
Write-Host "LLVM bin directory contents:"
Get-ChildItem -Path $llvmBinDir | Select-Object -First 10 | ForEach-Object {
Write-Host " $($_.Name)"
}

# Add to PATH
echo "$llvmBinDir" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
$env:PATH = "$llvmBinDir;$env:PATH"

# Verify llc is available
$llcPath = Join-Path -Path $llvmBinDir -ChildPath "llc.exe"
if (Test-Path -Path $llcPath) {
Write-Host "Found llc.exe at $llcPath"
Write-Host "Testing llc.exe:"
& "$llcPath" --version
} else {
Write-Host "WARNING: llc.exe not found at $llcPath"
# Display all exe files to help diagnose what might be available
Write-Host "Available executables in bin directory:"
Get-ChildItem -Path $llvmBinDir -Filter "*.exe" | ForEach-Object {
Write-Host " $($_.Name)"
}
}
} else {
Write-Host "ERROR: LLVM bin directory does not exist at $llvmBinDir"
Write-Host "LLVM_PATH contents:"
Get-ChildItem -Path $env:LLVM_PATH | ForEach-Object {
Write-Host " $($_.Name)"
}
exit 1
}

- name: Verify LLVM PATH (Windows)
if: matrix.os == 'windows-latest'
run: |
Write-Host "PATH environment variable:"
$env:PATH -split ';' | ForEach-Object { Write-Host " $_" }

Write-Host "Checking for llc command:"
try {
$llcCommand = Get-Command llc -ErrorAction Stop
Write-Host "Found llc at location $($llcCommand.Source)"
& $llcCommand.Source --version
} catch {
Write-Host "llc command not found in PATH. This may cause tests to fail."

# Look for llc.exe in LLVM_PATH
if ($env:LLVM_PATH) {
$llcPath = Join-Path -Path $env:LLVM_PATH -ChildPath "bin\llc.exe"
if (Test-Path -Path $llcPath) {
Write-Host "Found llc.exe at $llcPath, but it's not in PATH. Adding it now."
$llvmBinDir = Join-Path -Path $env:LLVM_PATH -ChildPath "bin"
$env:PATH = "$llvmBinDir;$env:PATH"
echo "PATH=$env:PATH" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
}
}
}

- name: Compile tests
run: cargo test --no-run

- name: Run tests
run: cargo test
- name: Run tests (Linux/macOS)
if: matrix.os != 'windows-latest'
run: cargo test --workspace

- name: Run tests (Windows)
if: matrix.os == 'windows-latest'
run: |
# Run all non-doctest tests
cargo test --workspace --exclude pecos-rslib --lib --bins --tests --examples

# For Windows, we need to run doctests for the pecos crate specially
# to ensure they run from the crate directory
cd crates/pecos
cargo test --doc
cd ../..

# Run doctests for other crates normally
cargo test --workspace --exclude pecos-rslib --exclude pecos --doc
2 changes: 2 additions & 0 deletions .github/workflows/rust-version-consistency.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
name: Rust Version Consistency Check

# bump

on:
push:
paths:
Expand Down
Loading