pub struct ReplayEngine { /* private fields */ }Expand description
Engine that records execution parameters and replays simulations for reproducibility verification.
Implementations§
Source§impl ReplayEngine
impl ReplayEngine
Sourcepub fn record_execution(
&self,
circuit: &QuantumCircuit,
config: &SimConfig,
shots: u32,
) -> ExecutionRecord
pub fn record_execution( &self, circuit: &QuantumCircuit, config: &SimConfig, shots: u32, ) -> ExecutionRecord
Capture all parameters needed to deterministically replay a simulation.
The returned ExecutionRecord is self-contained: given the same
circuit, the record holds enough information to reproduce the exact
measurement outcomes.
Sourcepub fn replay(&self, record: &ExecutionRecord, circuit: &QuantumCircuit) -> bool
pub fn replay(&self, record: &ExecutionRecord, circuit: &QuantumCircuit) -> bool
Replay a simulation using the parameters in record and verify that
the measurement outcomes match a fresh run.
Returns true when the replayed results are identical to a reference
run seeded with the same parameters. Both runs use the exact same seed
so the RNG sequences must agree.
Sourcepub fn circuit_hash(circuit: &QuantumCircuit) -> [u8; 32]
pub fn circuit_hash(circuit: &QuantumCircuit) -> [u8; 32]
Compute a deterministic 32-byte hash of a circuit’s structure.
The hash captures, for every gate: its type discriminant, the qubit indices it acts on, and any continuous parameters (rotation angles). Two circuits with the same gate sequence produce the same hash.
Uses DefaultHasher (SipHash-based) run twice with different seeds to
fill 32 bytes.