Skip to content
Closed
Show file tree
Hide file tree
Changes from 12 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
177fbee
feat(python-native): Rust shim for adaptive Pauli-Lindbladian time ev…
AlexSchuckert May 26, 2026
962ba18
feat(python): adaptive Lindbladian demo, shim tests, lazy SciPy
AlexSchuckert May 27, 2026
1a7d054
feat(lindblad): extract ppvm-lindblad crate, non-Hermitian jumps, pur…
AlexSchuckert May 29, 2026
ea294e3
feat(python): Lindbladian pc_step, sigma_plus/minus jumps, convergenc…
AlexSchuckert May 29, 2026
5e70242
Fix SPDX header formatting in lindblad.py
Copilot Jun 2, 2026
e54b88c
review: address PR #98 review comments
AlexSchuckert Jun 2, 2026
9fd6ef5
review(ppvm-lindblad): swap custom CsrMatrix for sprs::CsMatI<f64, u3…
AlexSchuckert Jun 3, 2026
e043ae1
feat(ppvm-lindblad): add `drop_tol` to pc_step for in-Rust basis pruning
AlexSchuckert Jun 3, 2026
5ad4e83
Remove action_cache from LindbladSpec
AlexSchuckert Jun 4, 2026
53f7ff2
perf(ppvm-lindblad): mimalloc allocator + chunked leakage → ~50% peak…
AlexSchuckert Jun 4, 2026
d763aa8
feat(lindblad): K parameter for pc_step; default K=5
AlexSchuckert Jun 4, 2026
dfc3204
Merge remote-tracking branch 'origin/main' into lindblad-pr-fixes
AlexSchuckert Jun 6, 2026
a591310
feat(ppvm-lindblad): matrix-free pc_step, rk4_step, and memory opts
AlexSchuckert Jun 9, 2026
a8e4dcc
Update Julia version and make sure benchmarks are consistent
david-pl Jun 17, 2026
6dca8a5
Merge branch 'main' into david/update-julia-benches
david-pl Jun 17, 2026
13aaad4
More efficient weight calculation
david-pl Jun 17, 2026
1a67b31
Inline cutoff
david-pl Jun 17, 2026
1a2b8f8
Hard-code weight to avoid slicing overhead
david-pl Jun 17, 2026
8ea602f
Add an early return for max_weight == usize::MAX
david-pl Jun 17, 2026
0072256
Remove svg
david-pl Jun 17, 2026
3fa4a0f
Merge david/fix-weight-calc (#126, faster weight calc) into lindblad-…
AlexSchuckert Jun 17, 2026
b2e06c9
fix(ppvm-lindblad): set max_krylov_m in ExpmOpts test constructors
AlexSchuckert Jun 17, 2026
fe486ff
feat(ppvm-lindblad): drive real expm action via quspin-expm (matrix-f…
AlexSchuckert Jun 17, 2026
84ab1a1
refactor(ppvm-lindblad): remove retired expm engine and CSR-for-real …
AlexSchuckert Jun 17, 2026
b07f75d
refactor(ppvm-lindblad): address PR #98 review comments
AlexSchuckert Jun 17, 2026
f14edaf
refactor(ppvm-python-native): drop the mimalloc global allocator
AlexSchuckert Jun 17, 2026
7c458d6
Remove jfrog sources from uv.lock
david-pl Jul 7, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
129 changes: 129 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ ppvm-sym = { version = "0.1.0", path = "crates/ppvm-sym" }
members = [
"crates/ppvm-runtime",
"crates/ppvm-sym",
"crates/ppvm-lindblad",
"crates/ppvm-python-native",
"crates/ppvm-tableau",
"crates/ppvm-stim", "crates/stim-parser",
Expand Down
20 changes: 20 additions & 0 deletions crates/ppvm-lindblad/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[package]
name = "ppvm-lindblad"
version = "0.1.0"
edition = "2024"
description = "Direct Heisenberg-picture Lindbladian evolution on an adaptive Pauli-string basis."

[dependencies]
fxhash = "0.2.1"
num = "0.4.3"
ppvm-runtime = { version = "0.1.0", path = "../ppvm-runtime" }
rayon = "1.11"
sprs = { version = "0.11", default-features = false, features = ["multi_thread"] }

[dev-dependencies]
approx = "0.5.1"
criterion = "0.7.0"

[[bench]]
name = "spmv_scaling"
harness = false
66 changes: 66 additions & 0 deletions crates/ppvm-lindblad/benches/spmv_scaling.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
// SPDX-FileCopyrightText: 2026 The PPVM Authors
// SPDX-License-Identifier: Apache-2.0

//! Parallel SpMV scaling on a tridiagonal CSR matrix. Sweeps both matrix
//! size and thread count, so we can see where parallelism actually pays
//! off (compute-bound, L3-fitting) vs where DRAM bandwidth ceilings out
//! the speedup (large matrices). Each invocation runs inside a freshly
//! built rayon pool of the requested size.

use criterion::{BenchmarkId, Criterion, Throughput, criterion_group, criterion_main};
use ppvm_lindblad::{Csr, csr_from_triplets, spmv_parallel};

fn build_tridiagonal(n: usize) -> Csr {
let mut trips = Vec::with_capacity(3 * n);
for i in 0..n {
trips.push((i, i, -2.0));
if i > 0 {
trips.push((i, i - 1, 1.0));
}
if i + 1 < n {
trips.push((i, i + 1, 1.0));
}
}
csr_from_triplets(n, &trips)
}

fn bench_spmv_scaling(c: &mut Criterion) {
// (n, label) pairs: nnz ≈ 3n. ~16 bytes per nonzero (usize indices + f64)
// + 8 bytes per row.
//
// n = 100_000 → nnz ≈ 300_000 → ~5 MB (fits L2/L3, compute-bound)
// n = 500_000 → nnz ≈ 1_500_000 → ~24 MB (L3 boundary on M-series)
// n = 2_000_000 → nnz ≈ 6_000_000 → ~96 MB (busts L3, bandwidth-bound)
// n = 8_000_000 → nnz ≈ 24_000_000 → ~384 MB (well into DRAM)
let sizes = [100_000usize, 500_000, 2_000_000, 8_000_000];

for &n in &sizes {
let m = build_tridiagonal(n);
let x: Vec<f64> = (0..n).map(|i| (i as f64).sin()).collect();

let mut group = c.benchmark_group(format!("spmv_parallel/n={}", n));
group.throughput(Throughput::Elements(m.nnz() as u64));
group.sample_size(30);
group.measurement_time(std::time::Duration::from_secs(3));
group.warm_up_time(std::time::Duration::from_secs(1));

for &threads in &[1usize, 2, 4, 8] {
let pool = rayon::ThreadPoolBuilder::new()
.num_threads(threads)
.build()
.unwrap();
group.bench_with_input(BenchmarkId::from_parameter(threads), &threads, |b, _| {
b.iter_batched_ref(
|| vec![0f64; n],
|y| pool.install(|| spmv_parallel(&m, &x, y)),
criterion::BatchSize::SmallInput,
);
});
}

group.finish();
}
}

criterion_group!(benches, bench_spmv_scaling);
criterion_main!(benches);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we post in the PR comment about the result of this benchmark for future reference?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Obsolete: the spmv_scaling benchmark has been removed -- it benchmarked the now-deleted real-CSR SpMV. The matrix-exponential action is now provided by the external quspin-expm crate.

Loading
Loading