Skip to content

feat: dynamic-shape trajectory simulator (5/5) (#1857)#1862

Draft
bramathon wants to merge 1 commit into
1856-trajectory-simulatorfrom
1857-dynamic-shape-trajectory-simulator
Draft

feat: dynamic-shape trajectory simulator (5/5) (#1857)#1862
bramathon wants to merge 1 commit into
1856-trajectory-simulatorfrom
1857-dynamic-shape-trajectory-simulator

Conversation

@bramathon

@bramathon bramathon commented Jul 4, 2026

Copy link
Copy Markdown
Collaborator

Part of the effort to land the experimental noise model and simulation module (originally PR #1848, branch nonbreaking-noise-model) as a reviewable stack. This is PR 5 of 5, stacked on #1861 — review/merge in order. Closes #1857.

This final PR adds DynamicTrajectorySimulator: an eager, single-trajectory simulator whose per-qudit dimensions grow and shrink at runtime. A qudit is promoted to dimension 3 only when an operator can populate its leakage level and squeezed back to 2 once that level empties, so in the realistic low-leakage regime the stored state stays far below the full 3**n. Unlike the other simulators it applies one operator at a time (shapes are data-dependent, so it is not jax.jit/grad-compilable) and carries a bounded truncation error controlled by squeeze_tol.

With this PR the stack's content matches the original #1848 branch (the five branches together reconstruct it exactly, modulo the per-PR version bumps).

Stack

  1. Drop Python 3.9 #1852 — Drop Python 3.9
  2. Qudit Noise model #1854 — Qudit noise model
  3. Experimental exact simulators #1855 — Experimental exact simulators
  4. Trajectory simulator #1856 — Trajectory simulator
  5. Dynamic shape trajectory simulator #1857 — Dynamic-shape trajectory simulator (this PR)

Tracked in #1863.

Add DynamicTrajectorySimulator: an eager, single-trajectory simulator whose qudit
dimensions grow and squeeze at runtime, keeping leakage-aware state far below the
full 3**n in the low-leakage regime. Completes the split of PR #1848.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@github-actions

github-actions Bot commented Jul 4, 2026

Copy link
Copy Markdown

🐰 Bencher Report

Branch1857-dynamic-shape-trajectory-simulator
Testbedci-runner-linux

⚠️ WARNING: No Threshold found!

Without a Threshold, no Alerts will ever be generated.

Click here to create a new Threshold
For more information, see the Threshold documentation.
To only post results if a Threshold exists, set the --ci-only-thresholds flag.

Click to view all benchmark results
BenchmarkLatencymilliseconds (ms)
test/benchmarks/test_program.py::test_copy_everything_except_instructions📈 view plot
⚠️ NO THRESHOLD
9,345.44 ms
test/benchmarks/test_program.py::test_instructions📈 view plot
⚠️ NO THRESHOLD
3,101.49 ms
test/benchmarks/test_program.py::test_iteration📈 view plot
⚠️ NO THRESHOLD
3,082.00 ms
test/benchmarks/test_state_vector.py::TestJitCompileTime::test_density_matrix_compile_depth[20L]📈 view plot
⚠️ NO THRESHOLD
630.05 ms
test/benchmarks/test_state_vector.py::TestJitCompileTime::test_density_matrix_compile_depth[40L]📈 view plot
⚠️ NO THRESHOLD
1,409.04 ms
test/benchmarks/test_state_vector.py::TestJitCompileTime::test_density_matrix_compile_depth[5L]📈 view plot
⚠️ NO THRESHOLD
321.12 ms
test/benchmarks/test_state_vector.py::TestJitCompileTime::test_state_vector_compile_depth[10L]📈 view plot
⚠️ NO THRESHOLD
211.12 ms
test/benchmarks/test_state_vector.py::TestJitCompileTime::test_state_vector_compile_depth[40L]📈 view plot
⚠️ NO THRESHOLD
202.57 ms
test/benchmarks/test_state_vector.py::TestJitCompileTime::test_state_vector_compile_depth[80L]📈 view plot
⚠️ NO THRESHOLD
209.88 ms
test/benchmarks/test_state_vector.py::TestPerformance::test_17q_batch_size[b16]📈 view plot
⚠️ NO THRESHOLD
132,320.83 ms
test/benchmarks/test_state_vector.py::TestPerformance::test_17q_batch_size[b64]📈 view plot
⚠️ NO THRESHOLD
118,645.45 ms
test/benchmarks/test_state_vector.py::TestPerformance::test_17q_batch_size[b8]📈 view plot
⚠️ NO THRESHOLD
152,836.43 ms
test/benchmarks/test_state_vector.py::TestPerformance::test_scaling_batch_size[b16]📈 view plot
⚠️ NO THRESHOLD
43,538.13 ms
test/benchmarks/test_state_vector.py::TestPerformance::test_scaling_batch_size[b64]📈 view plot
⚠️ NO THRESHOLD
28,225.18 ms
test/benchmarks/test_state_vector.py::TestPerformance::test_scaling_batch_size[b8]📈 view plot
⚠️ NO THRESHOLD
64,058.56 ms
test/benchmarks/test_state_vector.py::TestPerformance::test_scaling_depth[10L]📈 view plot
⚠️ NO THRESHOLD
33,041.84 ms
test/benchmarks/test_state_vector.py::TestPerformance::test_scaling_depth[1L]📈 view plot
⚠️ NO THRESHOLD
14,299.58 ms
test/benchmarks/test_state_vector.py::TestPerformance::test_scaling_depth[20L]📈 view plot
⚠️ NO THRESHOLD
53,446.08 ms
test/benchmarks/test_state_vector.py::TestPerformance::test_scaling_depth[3L]📈 view plot
⚠️ NO THRESHOLD
18,007.35 ms
test/benchmarks/test_state_vector.py::TestPerformance::test_scaling_qubits[12q]📈 view plot
⚠️ NO THRESHOLD
11,676.78 ms
test/benchmarks/test_state_vector.py::TestPerformance::test_scaling_qubits[15q]📈 view plot
⚠️ NO THRESHOLD
32,717.51 ms
test/benchmarks/test_state_vector.py::TestPerformance::test_scaling_qubits[3q]📈 view plot
⚠️ NO THRESHOLD
3,450.60 ms
test/benchmarks/test_state_vector.py::TestPerformance::test_scaling_qubits[6q]📈 view plot
⚠️ NO THRESHOLD
5,541.49 ms
test/benchmarks/test_state_vector.py::TestPerformance::test_scaling_qubits[9q]📈 view plot
⚠️ NO THRESHOLD
7,328.07 ms
test/benchmarks/test_state_vector.py::TestPerformance::test_scaling_subsystem_size[s0]📈 view plot
⚠️ NO THRESHOLD
91,696.85 ms
test/benchmarks/test_state_vector.py::TestPerformance::test_scaling_subsystem_size[s1]📈 view plot
⚠️ NO THRESHOLD
32,587.03 ms
test/benchmarks/test_state_vector.py::TestPerformance::test_surface17_depth5_cycle_noise📈 view plot
⚠️ NO THRESHOLD
76,626.45 ms
test/benchmarks/test_state_vector.py::TestPerformance::test_surface17_depth5_cycle_noise_low_trajectory📈 view plot
⚠️ NO THRESHOLD
4,751.32 ms
test/benchmarks/test_state_vector.py::TestPerformance::test_surface17_depth5_cycle_noise_measurements_only_micro📈 view plot
⚠️ NO THRESHOLD
2,451.32 ms
test/benchmarks/test_state_vector.py::TestPerformance::test_surface17_depth5_cycle_noise_micro📈 view plot
⚠️ NO THRESHOLD
4,039.39 ms
test/benchmarks/test_state_vector.py::TestPerformance::test_surface17_depth5_cycle_noise_micro_jit📈 view plot
⚠️ NO THRESHOLD
59.11 ms
test/benchmarks/test_state_vector.py::TestPerformance::test_surface17_depth5_cycle_noise_no_measurements_micro📈 view plot
⚠️ NO THRESHOLD
2,806.34 ms
🐰 View full continuous benchmarking report in Bencher

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant