Worked Examples
Example 1: Runtime Default Foundry
- Input:
examples/runtime_default_foundry.json - Goal: minimal end-to-end run path.
Example 2: Fock Injection Smoke
- Input:
examples/fock_injection_smoke.json - Goal: demonstrate backend routing to Fock-compatible execution.
Example 3: Foundry Loss Map
- Input:
examples/foundry_loss_map.json - Goal: foundry validation and injected mode-loss behavior.
Example 4: GKP QEC Memory MVP
- Input:
examples/cv/qec_single_logical_gkp_memory_mvp.json - Goal: measurement-driven decode/correction loop and QEC metrics.
Example Playbook (Command + Expected Result)
1) Runtime Default Foundry
Command:
swift run schrosim-cli run examples/runtime_default_foundry.json
Expected backend resolution:
backend_requested = "auto"backend = "gaussian"
Key output fields:
status,backend,backend_requestedgate_count,source_gate_count,foundry_injected_gate_countmean_photon_number,measurement_countfinal_state.representation
Interpretation:
- This is the cleanest sanity check for parse -> compile -> execute.
foundry_injected_gate_countshould remain0for this input.
2) Fock Injection Smoke
Command:
swift run schrosim-cli run examples/fock_injection_smoke.json
Expected backend resolution:
backend_requested = "auto"backend = "fock"(non-Gaussian Fock injection routing)
Key output fields:
backend,compute_backend_usedcutoff,final_state.representationfinal_state.top_probabilities
Interpretation:
- Confirms backend router can switch from auto to Fock path.
- Useful for catching regressions in non-Gaussian routing behavior.
3) Foundry Loss Map
Command:
swift run schrosim-cli run examples/foundry_loss_map.json
Expected backend resolution:
backend_requested = "auto"backend = "gaussian"
Key output fields:
foundry,foundry_sourcesource_gate_count,gate_count,foundry_injected_gate_countloss_eta,mean_photon_number
Interpretation:
foundry_injected_gate_count > 0indicates injected static mode-loss.gate_count - source_gate_countshould match injected loss operations.
4) GKP QEC Memory MVP
Command:
swift run schrosim-cli run examples/cv/qec_single_logical_gkp_memory_mvp.json
Expected backend resolution:
backend_requested = "gaussian"backend = "gaussian"
Key output fields:
measurement_countqec.rounds_executed,qec.logical_error_rateqec.suppression_factor,qec.break_even_gain
Interpretation:
- Presence of
qecconfirms decode/correction rounds were recognized. - Track
logical_error_rateandbreak_even_gainacross commits for QEC-quality drift.