feat: trajectory simulator (4/5) (#1856)#1861
Draft
bramathon wants to merge 1 commit into
Draft
Conversation
Add TrajectorySimulator on top of the exact-simulator core: a jitted Kraus-stack kernel for programs with measurements and resets, batched sample() that discards states, and data-parallel multi-device sampling via jax.pmap. Includes qutrit, compression, and Surface-17 benchmark tests. Part of splitting PR #1848. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 4 of 5, stacked on #1860 — review/merge in order. Closes #1856.This PR adds
TrajectorySimulatoron top of the exact-simulator core: a Monte-Carlo trajectory simulator for programs with measurements and resets. Measurements and Kraus channels are compiled into a single homogeneous, zero-padded Kraus stack driven by one reusable jitted kernel (jax.lax.scan+jax.lax.switch), so repeated sampling batches reuse a single compilation.sample()streams trajectories in batches and discards state vectors, and runs data-parallel across multiple devices viajax.pmap(one independent replica per device, no cross-device communication).It also extends
ProgramSimulatorto resolve measurements as sampledQuantumInstruments (the"instrument"resolver path) and adds the trajectory compressor barriers. Tests cover the trajectory pipeline, qutrit trajectories and noise channels, compression invariants, and a Surface-17 benchmark fixture.The dynamic-shape trajectory simulator that also builds on this base lands in the final PR.
Stack
Tracked in #1863.