Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
186 commits
Select commit Hold shift + click to select a range
1865590
Initial Pauli prop code add
ciaranra Dec 10, 2024
c290c75
Merge branch 'development' into feat/rs-pauli-prop
ciaranra Dec 14, 2024
07aafb7
Unroll broadcast face rotations (#110)
perlinm Dec 15, 2024
5fa6163
Upgrade to using uv instead of pip (#111)
ciaranra Dec 17, 2024
4277973
Turn on artifact generation (#117)
ciaranra Dec 17, 2024
899330d
Merge branch 'development' into feat/rs-pauli-prop
ciaranra Dec 18, 2024
00a9064
Add Rust state vector
ciaranra Dec 18, 2024
bbaa88e
Making clippy happy
ciaranra Dec 18, 2024
e6c430a
Small tweaks
ciaranra Dec 18, 2024
7aaa226
Merge branch 'feat/rs-statevec' into feat/more-sims
ciaranra Dec 18, 2024
7f95894
Merge branch 'feat/rs-pauli-prop' into feat/more-sims
ciaranra Dec 18, 2024
ef6b257
More documentation for stab sim
ciaranra Dec 18, 2024
eec20ec
More docs
ciaranra Dec 18, 2024
0cade4c
qsim documenting + tweaks
ciaranra Dec 20, 2024
e39cf4c
Refactoring: CliffordGateable
ciaranra Dec 21, 2024
bda321b
Refactor state-vec
ciaranra Dec 21, 2024
1fc111d
Adding MeasurementResult struct
ciaranra Dec 21, 2024
f2e45d0
small tweaks
ciaranra Dec 21, 2024
c3dd2ad
Improved testing of RX, RY, RZ.
ciaranra Dec 21, 2024
27d60bc
test doc tweaks
ciaranra Dec 21, 2024
c727061
adding r1xy
ciaranra Dec 21, 2024
c989843
Adding initial Rust state-vec Python bindings
ciaranra Dec 21, 2024
4581a91
refactor sparse_sim.rs to sparse_stab_bindings.rs
ciaranra Dec 21, 2024
06144a1
Adding missing gates for Python wrapper of RS state vec
ciaranra Dec 22, 2024
722c21e
Refactor QuantumStateSimulator -> QuantumSimulator + more PauliProp docs
ciaranra Dec 22, 2024
03dac2c
Add iSWAP to CliffordGateable
ciaranra Dec 22, 2024
21af974
CliffordGateable cleanup
ciaranra Dec 22, 2024
67239da
Update docs. Introduce mp*()
ciaranra Dec 23, 2024
fd4228c
pauli stub
ciaranra Jan 1, 2025
5fb9335
Implementing basic pauli structs
ciaranra Jan 2, 2025
4d42b10
Updating documentation
ciaranra Jan 2, 2025
3e2ef42
Add T gates with active error correction (#118)
perlinm Jan 2, 2025
cc28567
Permute all variables of the Steane code (#114)
perlinm Jan 2, 2025
c943eed
Merge branch 'development' into feat/more-sims
ciaranra Jan 2, 2025
7536d27
Merge branch 'development' into feat/pauli
ciaranra Jan 2, 2025
bcf332e
adding pauli structs
ciaranra Jan 4, 2025
7d1ee4a
more pauli code
ciaranra Jan 4, 2025
34a5b95
Add angle struct
ciaranra Jan 5, 2025
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
4ff6bbc
More doc strings
ciaranra Jan 8, 2025
8c7e445
Removing debugging print statements
ciaranra 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
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
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
2fb6b16
Fixing bug brought up in issue #119 (#126)
ciaranra Mar 2, 2025
3d87117
Adding run_with_engines and run_with_classical_engine
ciaranra Mar 2, 2025
2982046
Fixes test warnings (#128)
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
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
472acd6
engine refactor
ciaranra Mar 8, 2025
f5f04ea
Removing some of QuantumCommand + MessageBuilder refactor
ciaranra Mar 8, 2025
da538aa
Merge branch 'development' into feat/byte-time
ciaranra Mar 8, 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
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
2fd10d8
Refactor general noise (#136)
ciaranra May 13, 2025
da1d619
Update smash! (#139)
ciaranra May 17, 2025
4259e08
Add crate preludes + make convenience
ciaranra May 19, 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
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
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .github/workflows/python-release.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
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:
Expand Down
65 changes: 30 additions & 35 deletions .github/workflows/python-test.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
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" ]
Expand All @@ -22,19 +28,12 @@ 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,25 +49,10 @@ 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
Expand All @@ -78,23 +62,34 @@ jobs:
with:
workspaces: python/pecos-rslib

- name: Install pecos-rslib with maturin develop
- 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
158 changes: 152 additions & 6 deletions .github/workflows/rust-test.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
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" ]
Expand All @@ -22,16 +27,18 @@ 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

Expand Down Expand Up @@ -76,6 +83,21 @@ 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

Expand All @@ -84,8 +106,132 @@ jobs:
with:
save-if: ${{ github.ref_name == 'master' || github.ref_name == 'development' }}

- 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
70 changes: 70 additions & 0 deletions .github/workflows/test-docs-examples.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: Documentation Tests & Build

on:
push:
branches: [ master, development ]
paths:
- 'docs/**'
pull_request:
branches: [ master, development ]
paths:
- 'docs/**'
workflow_dispatch:

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

jobs:
docs-ci:
name: Test and build documentation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'

- 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

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

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

- name: Install quantum-pecos from local source
run: |
cd python/quantum-pecos
uv pip install -e .

- name: Test working documentation examples
run: |
uv run python scripts/docs/test_working_examples.py

- name: Test all code examples
run: |
uv run python scripts/docs/test_code_examples.py

- name: Build documentation
if: success()
run: |
uv run mkdocs build
Loading
Loading