Supplementary Material — Bulk-optics stochastic NOT  

This package provides reproducible Colab/Notebook workflows and supporting artifacts
for a bulk-optics stochastic NOT gate implemented with two alternative architectures:
(A) folded PBS-based exchange and (B) 3×HWP chain exchange, including a harmonized
head-to-head comparison used for the main-text figures.

--------------------------------------------------------------------------------
A. Contents (what each file is)
--------------------------------------------------------------------------------

1) Supplement_S2.ipynb
   Architecture A (PBS-folded): non-ideal sweeps + Monte-Carlo + rankings.
   Outputs are written to the notebook-defined OUT_DIR (CSV/PNG/JSON).

2) supplement_s2.py
   Script export of Supplement_S2.ipynb (for quick code inspection / reproducibility).

3) Supplement_S3.ipynb
   Architecture B (3×HWP chain): non-ideal sweeps + Monte-Carlo + rankings, including
   wavelength mis-tuning via retardance detuning. Outputs written to OUT_DIR.

4) supplement_s3.py
   Script export of Supplement_S3.ipynb.

5) Supplement_S4a.ipynb
   Harmonized A vs B comparison under common decision settings:
   gamma = 0.60, erasure window = 0.35. Produces the comparison figures.

6) supplement_s4a.py
   Script export of Supplement_S4a.ipynb.

(Optional but recommended if referenced in the manuscript)
- S4a.Architecture A vs B comparison pack.pdf : exported figures from the harmonized comparison (used for Fig 6.2 / 6.3).
- Boundary result PDFs (S2.1 / S3.1) if probability-level tolerance limits are discussed.
- Phase compensation note (HTML/PDF) if the phase-reference section is included.

--------------------------------------------------------------------------------
B. How to run (quick start)
--------------------------------------------------------------------------------

Recommended environment: Google Colab (Python 3.x).

Step 1. Upload the corresponding .ipynb to Colab.
Step 2. Run all cells from top to bottom.
Step 3. The notebooks will create an output folder (OUT_DIR) and export:
        - CSV tables (sweeps, transfer curves, Monte-Carlo),
        - PNG figures (300 dpi),
        - JSON manifests/index files.

Reproducibility:
- Each notebook defines a GLOBAL_SEED (or equivalent) used to initialize RNG.
- To reproduce the same numbers, do not change seed values.

--------------------------------------------------------------------------------
C. Notes on interpretation
--------------------------------------------------------------------------------

- Some regimes may show BER ≈ 0 over the tested tolerance range (robust regime).
  In such cases contrast-margin metrics (e.g., margin = 1 − q0.05(|C|)) can be more
  informative than BER-based rankings.
- The harmonized comparison (S4a.Architecture A vs B comparison pack.pdf) uses the S3 decision settings:
  gamma = 0.60 and erasure window = 0.35 (p_test = 0.5, q = 0.05).

--------------------------------------------------------------------------------
D. Contact / metadata
--------------------------------------------------------------------------------
Generated/assembled by: (Myroslav Strynadko)
Date: (02.03.2026)