Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
41dae07
convert QuantumCircuit/Stim to/from SLR
ciaranra Aug 24, 2025
31361c3
fix
ciaranra Aug 25, 2025
ab8fb2c
fix?
ciaranra Sep 8, 2025
5ae47c1
Merge remote-tracking branch 'origin/dev' into feat/qc-stim-to-from-slr
ciaranra Sep 8, 2025
267aa8e
Replace llvmlite with Rust/Inkwell
ciaranra Nov 9, 2025
9c2ad05
make matplotlib optional
ciaranra Nov 9, 2025
b1db1b8
Rust general numerical methods
ciaranra Nov 9, 2025
d34d596
Merge branch 'dev' into feat/pecos-num
ciaranra Nov 9, 2025
41dac21
fix lock
ciaranra Nov 9, 2025
18948f0
fix curve_fit error error
ciaranra Nov 9, 2025
d324216
Add rng related things to pecos-num
ciaranra Nov 9, 2025
63629d5
add power()
ciaranra Nov 10, 2025
f5a49b9
add sqrt()
ciaranra Nov 10, 2025
72c11f5
polish polyfit
ciaranra Nov 10, 2025
7d88369
add diag()
ciaranra Nov 10, 2025
15833ab
add linspace()
ciaranra Nov 10, 2025
275313b
add exp(), exp_complex(), isnan(), cos(), sin(), isclose(), math cons…
ciaranra Nov 10, 2025
bf5007d
adding more functions
ciaranra Nov 11, 2025
5e0f49e
Migration to bool array
ciaranra Nov 17, 2025
6b56fe6
Better array support
ciaranra Nov 18, 2025
354bcb3
Merge remote-tracking branch 'origin/dev' into feat/pecos-num-rng
ciaranra Nov 19, 2025
2b996b8
Adding array support for Pauli and PauliString
ciaranra Nov 19, 2025
387e344
more migration
ciaranra Nov 20, 2025
b3fc9fe
adding jackknife resampling
ciaranra Nov 23, 2025
88669d6
update build system for quantum-pecos
ciaranra Nov 23, 2025
a352904
Adding graph support via pecos-rslib
ciaranra Nov 23, 2025
8147fb5
Further migration
ciaranra Nov 24, 2025
28466d4
pecos-rslib py to rs migration
ciaranra Nov 28, 2025
b623fe0
Merge branch 'feat/qc-stim-to-from-slr' into feat/pecos-num-rng
ciaranra Nov 28, 2025
8f0f8b5
fix Guppy code generation
ciaranra Nov 29, 2025
67f3f29
fix
ciaranra Nov 29, 2025
d0ef7d1
fix
ciaranra Nov 29, 2025
3ce0b1e
fix
ciaranra Nov 29, 2025
db862b6
fix
ciaranra Nov 30, 2025
3093136
pecos-rslib py to rs
ciaranra Dec 1, 2025
227ce6c
Add timeout and retry logic to fix CI download failures
ciaranra Dec 2, 2025
9c7e8a7
lint
ciaranra Dec 2, 2025
b393c0f
Add error checking for Windows LLVM download/extraction
ciaranra Dec 2, 2025
98a8d42
Use pecos-llvm-utils for LLVM installation across all platforms
ciaranra Dec 2, 2025
b0b0594
Fix Windows LLVM path - use absolute path instead of $HOME
ciaranra Dec 3, 2025
ccb19a8
Fix randint dtype to match NumPy platform-dependent behavior
ciaranra Dec 3, 2025
dc91aad
Add detailed debugging for Windows LLVM installation
ciaranra Dec 3, 2025
cff1912
Fix Windows BEFORE_ALL script - use folded multiline with && chaining
ciaranra Dec 3, 2025
383e536
Fix python-test: update extension module path for pure Rust build
ciaranra Dec 3, 2025
7eac2e5
Fix test_abi3_wheels: update module name from pecos_rslib to _pecos_r…
ciaranra Dec 3, 2025
6ec5aef
Fix sdist: replace LICENSE symlinks with actual files
ciaranra Dec 3, 2025
4ae8e59
Add I32 support to array_equal for Windows randint compatibility
ciaranra Dec 3, 2025
9a81c02
Fix sdist: replace NOTICE and README symlinks with actual files
ciaranra Dec 3, 2025
41d0955
Add __version__ attribute to _pecos_rslib module
ciaranra Dec 3, 2025
1b9db2d
Add disk space cleanup for Ubuntu runners to prevent out-of-space fai…
ciaranra Dec 3, 2025
1bb7598
Add disk space cleanup for Ubuntu and Windows runners to prevent out-…
ciaranra Dec 3, 2025
f9becf8
Fix Ubuntu cleanup: keep large-packages to preserve libffi and build …
ciaranra Dec 3, 2025
d4164f9
Fix randint overflow on Windows by adding bounds checking for i32 range
ciaranra Dec 3, 2025
f6e5279
Fix missing PyValueError import for randint bounds checking
ciaranra Dec 3, 2025
c944ea6
Use fully qualified PyValueError for consistent error handling
ciaranra Dec 3, 2025
f70793a
Fix test_multiple_bounded_rand for Windows i32 platform limits
ciaranra Dec 3, 2025
20afa0d
Fix Windows test to use i32::MAX (2^31 - 1) not 2^31
ciaranra Dec 3, 2025
8182d95
Use inline format args to fix clippy warning
ciaranra Dec 3, 2025
c2c7534
Reduce macOS build verbosity and add job timeout for stability
ciaranra Dec 3, 2025
f7d5066
Clean up workflow debug output and other cleanup
ciaranra Dec 3, 2025
929a5d9
lint
ciaranra Dec 3, 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
  •  
  •  
  •  
48 changes: 47 additions & 1 deletion .github/workflows/python-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,52 @@ jobs:
with:
package-dir: python/pecos-rslib
output-dir: wheelhouse
env:
# Build configuration
CIBW_BUILD: "cp310-*"
CIBW_SKIP: "*-win32 *-manylinux_i686 *-musllinux*"
CIBW_MANYLINUX_X86_64_IMAGE: "manylinux_2_28"
CIBW_MANYLINUX_AARCH64_IMAGE: "manylinux_2_28"
# Linux configuration
CIBW_ENVIRONMENT_LINUX: >
PATH=$HOME/.cargo/bin:$HOME/.pecos/llvm/bin:$PATH
LLVM_SYS_140_PREFIX=$HOME/.pecos/llvm
CIBW_BEFORE_ALL_LINUX: |
curl -sSf https://sh.rustup.rs | sh -s -- -y
dnf install libffi-devel -y
cargo run --release -p pecos-llvm-utils --bin pecos-llvm -- install --force
CIBW_REPAIR_WHEEL_COMMAND_LINUX: >
auditwheel repair -w {dest_dir} {wheel} &&
pipx run abi3audit --strict --report {wheel}
# macOS configuration
CIBW_ENVIRONMENT_MACOS: >
PATH=$HOME/.pecos/llvm/bin:$PATH
LLVM_SYS_140_PREFIX=$HOME/.pecos/llvm
MACOSX_DEPLOYMENT_TARGET=13.2
CIBW_BEFORE_ALL_MACOS: |
curl -sSf https://sh.rustup.rs | sh -s -- -y
rustup update
cargo run --release -p pecos-llvm-utils --bin pecos-llvm -- install --force
CIBW_REPAIR_WHEEL_COMMAND_MACOS: >
DYLD_LIBRARY_PATH=$HOME/.pecos/llvm/lib delocate-wheel --require-archs {delocate_archs} -w {dest_dir} -v {wheel} &&
pipx run abi3audit --strict --report {wheel}
# Windows configuration
CIBW_ENVIRONMENT_WINDOWS: >
PATH="C:\\Users\\runneradmin\\.pecos\\llvm\\bin;$PATH"
LLVM_SYS_140_PREFIX="C:\\Users\\runneradmin\\.pecos\\llvm"
CIBW_BEFORE_ALL_WINDOWS: >
echo "=== Installing LLVM using pecos-llvm-utils ===" &&
rustup update &&
echo "=== Running pecos-llvm install ===" &&
cargo run --release -p pecos-llvm-utils --bin pecos-llvm -- install --force &&
echo "=== Checking LLVM installation ===" &&
(test -d "C:\\Users\\runneradmin\\.pecos\\llvm" && echo "LLVM directory exists" && ls -la "C:\\Users\\runneradmin\\.pecos\\llvm" && (ls -la "C:\\Users\\runneradmin\\.pecos\\llvm\\bin" || echo "bin directory not found")) || (echo "ERROR: LLVM directory not found!" && exit 1) &&
echo "=== Verifying LLVM_SYS_140_PREFIX ===" &&
echo "LLVM_SYS_140_PREFIX will be set to: C:\\Users\\runneradmin\\.pecos\\llvm"
CIBW_BEFORE_BUILD_WINDOWS: "pip install delvewheel"
CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: >
delvewheel repair -w {dest_dir} {wheel} &&
pipx run abi3audit --strict --report {wheel}

- name: Upload wheels
uses: actions/upload-artifact@v4
Expand Down Expand Up @@ -139,7 +185,7 @@ jobs:
echo "Testing abi3 wheel with Python ${{ matrix.python-version }}"
python --version
pip install --force-reinstall --verbose ./pecos-rslib-wheel/*.whl
python -c 'import pecos_rslib; print(f"pecos_rslib version: {pecos_rslib.__version__}")'
python -c 'import _pecos_rslib; print(f"_pecos_rslib version: {_pecos_rslib.__version__}")'
python -c 'import sys; print(f"Python version: {sys.version}")'

build_sdist_quantum_pecos:
Expand Down
162 changes: 55 additions & 107 deletions .github/workflows/python-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,59 @@ defaults:
jobs:
python-test:
runs-on: ${{ matrix.os }}
timeout-minutes: 90
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]

steps:
- name: Free Disk Space (Ubuntu)
if: runner.os == 'Linux'
uses: jlumbroso/free-disk-space@main
with:
# Remove Android tools (saves ~14GB)
android: true
# Remove .NET runtime (saves ~2.7GB)
dotnet: true
# Remove Haskell runtime
haskell: true
# Don't remove large packages - may include libffi and other build deps
large-packages: false
# Remove Docker images (saves space)
docker-images: true
# Keep tool-cache as we may need some tools
tool-cache: false
# Remove swap storage (saves ~4GB)
swap-storage: true

- name: Free Disk Space (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
Write-Host "Disk space before cleanup:"
Get-PSDrive C | Select-Object Used,Free

# Remove Android SDK (saves ~9GB)
Write-Host "Removing Android SDK..."
Remove-Item -Path "C:\Android" -Recurse -Force -ErrorAction SilentlyContinue

# Remove .NET runtime and libraries (saves ~2GB)
Write-Host "Removing .NET..."
Remove-Item -Path "C:\Program Files\dotnet" -Recurse -Force -ErrorAction SilentlyContinue

# Remove CodeQL (saves ~5GB)
Write-Host "Removing CodeQL..."
Remove-Item -Path "C:\hostedtoolcache\CodeQL" -Recurse -Force -ErrorAction SilentlyContinue

# Remove large packages
Write-Host "Removing large packages..."
Remove-Item -Path "C:\ProgramData\chocolatey" -Recurse -Force -ErrorAction SilentlyContinue

Write-Host "Disk space after cleanup:"
Get-PSDrive C | Select-Object Used,Free

- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
Expand Down Expand Up @@ -95,9 +141,6 @@ jobs:
shell: pwsh
run: |
# Ensure LLVM environment variable is available
Write-Host "LLVM_SYS_140_PREFIX: $env:LLVM_SYS_140_PREFIX"
Write-Host "LLVM_PATH: $env:LLVM_PATH"

# If LLVM_SYS_140_PREFIX is not set but LLVM_PATH is, use LLVM_PATH
if (-not $env:LLVM_SYS_140_PREFIX -and $env:LLVM_PATH) {
Write-Host "Setting LLVM_SYS_140_PREFIX from LLVM_PATH"
Expand All @@ -120,17 +163,8 @@ jobs:
$env:PATH = "$llvmBinDir;$env:PATH"
# Update PATH for future steps
"$llvmBinDir" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
Write-Host "Added LLVM bin to PATH: $llvmBinDir"
}

# Verify LLVM installation
Write-Host "Checking for llvm-config..."
Get-Command llvm-config -ErrorAction SilentlyContinue || Write-Host "llvm-config not found in PATH"

# List LLVM directory contents
Write-Host "LLVM directory contents:"
Get-ChildItem $env:LLVM_SYS_140_PREFIX -ErrorAction SilentlyContinue | Select-Object Name

# Find MSVC link.exe and create cargo config
$vsWhere = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe"
$vsPath = & $vsWhere -latest -property installationPath
Expand All @@ -139,8 +173,6 @@ jobs:
Select-Object -First 1 -ExpandProperty FullName

if ($linkPath) {
Write-Host "Found MSVC link.exe at: $linkPath"

# Create .cargo directory and config in multiple locations
# Create in root
New-Item -ItemType Directory -Force -Path .cargo | Out-Null
Expand Down Expand Up @@ -174,10 +206,6 @@ jobs:
$configContent | Out-File -FilePath "$cargoHome\config.toml" -Encoding UTF8
}

Write-Host "Created cargo configs with LLVM_SYS_140_PREFIX=$escapedLLVMPath"
Write-Host "Root .cargo\config.toml:"
Get-Content .cargo\config.toml
Write-Host "User cargo config appended to: $cargoHome\config.toml"
} else {
Write-Error "Could not find MSVC link.exe"
exit 1
Expand Down Expand Up @@ -234,102 +262,22 @@ jobs:
# Set explicit library path to ONLY include system directories
export LIBRARY_PATH=/usr/lib

# DEBUG: Show what environment variables are set
echo "=== Environment variables that affect linking ==="
env | grep -E "LIBRARY|DYLD|PKG_CONFIG|HOMEBREW|PATH" | sort

# DEBUG: Check what libraries are in Homebrew paths
echo "=== Checking for libunwind in Homebrew locations ==="
ls -la /usr/local/lib/libunwind* 2>&1 || echo "No libunwind in /usr/local/lib"
ls -la /opt/homebrew/lib/libunwind* 2>&1 || echo "No libunwind in /opt/homebrew/lib"

# DEBUG: Check system libunwind
echo "=== System libunwind ==="
ls -la /usr/lib/system/libunwind* 2>&1 || echo "No libunwind in /usr/lib/system"
ls -la /usr/lib/libunwind* 2>&1 || echo "No libunwind in /usr/lib"

# DEBUG: Check if LLVM itself has libunwind references
echo "=== Checking LLVM libraries for libunwind references ==="
echo "LLVM dylib files:"
ls -lh /tmp/llvm/lib/*.dylib 2>&1 | head -10 || echo "No dylib files found"

# Check ALL LLVM dylibs for libunwind references
echo ""
echo "Checking each LLVM library for libunwind:"
for lib in /tmp/llvm/lib/*.dylib; do
if [ -f "$lib" ]; then
libname=$(basename "$lib")
if otool -L "$lib" 2>/dev/null | grep -q "libunwind"; then
echo " [WARNING] $libname HAS libunwind reference:"
otool -L "$lib" | grep libunwind
fi
fi
done
echo "Done checking LLVM libraries"

# Check what libc++ the system has
echo ""
echo "=== System C++ library ==="
ls -lh /usr/lib/libc++* 2>&1 | head -5 || echo "No libc++ in /usr/lib"

# Check if clang has any default library search paths configured
echo ""
echo "=== Clang default library search paths ==="
/tmp/llvm/bin/clang -Xlinker -v 2>&1 | grep -A 20 "Library search" || echo "Could not get search paths"

echo ""
echo "=== RUSTFLAGS: $RUSTFLAGS ==="
echo "=== LIBRARY_PATH: $LIBRARY_PATH ==="
echo "macOS environment configured for build (LIBRARY_PATH=/usr/lib)"
fi

# Build with verbose cargo output to see linker commands
echo ""
echo "=== Starting build ==="
if [[ "${{ runner.os }}" == "macOS" ]]; then
# Enable verbose cargo output to see full linker commands
CARGO_LOG=cargo::core::compiler::fingerprint=info make build 2>&1 | tee /tmp/build.log
else
make build 2>&1 | tee /tmp/build.log
fi
# Build the project
make build

# After build, check if the extension has the bad reference
# After build, verify the extension module on macOS
if [[ "${{ runner.os }}" == "macOS" ]]; then
echo ""
echo "=== Checking built extension module ==="
EXT_MODULE=$(find python/pecos-rslib/src/pecos_rslib -name "_pecos_rslib*.so" | head -1)
EXT_MODULE=$(find .venv/lib -name "_pecos_rslib*.so" 2>/dev/null | head -1)
if [ -n "$EXT_MODULE" ]; then
echo "Found: $EXT_MODULE"
echo ""
echo "=== ALL dependencies of extension module ==="
otool -L "$EXT_MODULE"

echo ""
echo "=== Checking for problematic @rpath reference ==="
if otool -L "$EXT_MODULE" | grep "@rpath/libunwind"; then
echo "❌ ERROR: Still has @rpath/libunwind reference!"

echo ""
echo "=== Let's trace where this comes from ==="
echo "Dependencies that might be the source:"
otool -L "$EXT_MODULE" | grep -v "$EXT_MODULE" | grep "\.dylib" | while read -r line; do
dep=$(echo "$line" | awk '{print $1}')
if [ -f "$dep" ] || [ -L "$dep" ]; then
echo ""
echo "Checking $dep:"
otool -L "$dep" 2>/dev/null | grep -i unwind || echo " No libunwind reference"
fi
done

echo ""
echo "=== Last 100 lines of build log (looking for linking commands) ==="
tail -100 /tmp/build.log | grep -B 2 -A 2 "linking\|rustc.*cdylib\|-L"

if otool -L "$EXT_MODULE" | grep -q "@rpath/libunwind"; then
echo "ERROR: Extension has @rpath/libunwind reference"
otool -L "$EXT_MODULE"
exit 1
else
echo "[OK] No @rpath/libunwind reference found"
fi
else
echo "[WARNING] Could not find extension module to check"
echo "macOS extension module built successfully"
fi
fi

Expand Down
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ repos:
)
- id: check-toml
- id: check-yaml
args: [--unsafe]
- id: check-added-large-files
# Python-specific
- id: check-ast
Expand Down
6 changes: 6 additions & 0 deletions .typos.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,9 @@ ine = "ine" # Integer not equal operation
inot = "inot" # Integer bitwise NOT operation
# QuEST v4.1.0 uses "calcExpec" (not "calcExpect") in function names
Expec = "Expec"
# NumPy uses "arange" (array range), not "arrange"
arange = "arange"
# Common variable name prefix for ndarray
nd = "nd"
# delocate is a macOS wheel repair tool (delocate-wheel command)
delocate = "delocate"
Loading
Loading