David-Arius's picture
Publish ATON QAI Interactive Photonic Workbench
b3127c1 verified
Raw History Blame Contribute Delete
15.4 kB
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>ATON QAI — Interactive Photonic Workbench</title>
<style>
:root {
--bg-navy: #0A1128;
--bg-card: #101B38;
--bg-panel: #14213D;
--gold: #C5A059;
--gold-bright: #E2BE75;
--alabaster: #FAF9F6;
--muted: #A9B4C9;
--border: rgba(197, 160, 89, 0.38);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
background: radial-gradient(circle at top right, #16264C 0%, var(--bg-navy) 65%);
color: var(--alabaster);
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
min-height: 100vh;
padding: 24px;
line-height: 1.5;
}
.container { max-width: 1240px; margin: 0 auto; }
header {
border-bottom: 1px solid var(--border);
padding-bottom: 16px;
margin-bottom: 22px;
display: flex;
justify-content: space-between;
align-items: flex-end;
flex-wrap: wrap;
gap: 12px;
}
.kicker {
color: var(--gold);
font-family: monospace;
font-size: 12px;
letter-spacing: 0.14em;
text-transform: uppercase;
}
h1 { font-size: 26px; font-weight: 700; color: var(--alabaster); margin-top: 4px; }
.subtitle { color: var(--muted); font-size: 14px; margin-top: 4px; }
.links a {
color: var(--gold-bright);
text-decoration: none;
font-family: monospace;
font-size: 13px;
border: 1px solid var(--border);
padding: 6px 12px;
border-radius: 6px;
background: rgba(20, 33, 61, 0.7);
margin-left: 8px;
display: inline-block;
}
.links a:hover { background: var(--gold); color: var(--bg-navy); }
.grid { display: grid; grid-template-columns: 380px 1fr; gap: 20px; }
@media (max-width: 920px) { .grid { grid-template-columns: 1fr; } }
.card {
background: var(--bg-card);
border: 1px solid var(--border);
border-radius: 10px;
padding: 18px;
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}
.card h2 {
font-size: 14px;
text-transform: uppercase;
letter-spacing: 0.08em;
color: var(--gold);
margin-bottom: 14px;
font-family: monospace;
}
label { display: block; font-size: 13px; margin-bottom: 6px; color: var(--alabaster); }
select, input[type="range"] { width: 100%; margin-bottom: 14px; }
select {
background: var(--bg-panel);
color: var(--alabaster);
border: 1px solid var(--border);
padding: 8px 10px;
border-radius: 6px;
font-size: 13px;
}
.slider-row { margin-bottom: 12px; }
.slider-head { display: flex; justify-content: space-between; font-size: 12.5px; margin-bottom: 4px; }
.val-badge { color: var(--gold-bright); font-family: monospace; font-weight: 600; }
input[type="range"] { accent-color: var(--gold); cursor: pointer; }
pre.code-box {
background: #070C1C;
border: 1px solid var(--border);
border-radius: 8px;
padding: 12px;
font-family: "JetBrains Mono", Consolas, monospace;
font-size: 12.5px;
color: var(--gold-bright);
overflow-x: auto;
margin-bottom: 16px;
}
table { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 8px; }
th, td { border-bottom: 1px solid rgba(197, 160, 89, 0.2); padding: 8px 10px; text-align: left; }
th { color: var(--gold); font-family: monospace; font-size: 12px; text-transform: uppercase; }
td.num { font-family: monospace; color: var(--gold-bright); }
.bar-wrap {
width: 110px;
background: rgba(255,255,255,0.08);
height: 8px;
border-radius: 4px;
overflow: hidden;
display: inline-block;
vertical-align: middle;
margin-left: 8px;
}
.bar-fill { height: 100%; background: var(--gold); }
.metrics-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 14px 0; }
.metric-box { background: var(--bg-panel); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; }
.metric-box .m-label { font-size: 11px; color: var(--muted); text-transform: uppercase; font-family: monospace; }
.metric-box .m-val { font-size: 18px; font-weight: 700; color: var(--gold-bright); font-family: monospace; margin-top: 2px; }
</style>
</head>
<body>
<div class="container">
<header>
<div>
<div class="kicker">ATON QAI · Interactive Photonic Workbench</div>
<h1>From Abstraction to Physical Reality</h1>
<div class="subtitle">Explore <code>.qai 1.0</code> linear-optical circuits, interferometer schematics, and ideal vs. physical Fock-space distributions.</div>
</div>
<div class="links">
<a href="https://aton-qai.ai" target="_blank" rel="noopener">aton-qai.ai</a>
<a href="https://huggingface.co/ATON-QAI" target="_blank" rel="noopener">Hugging Face Hub</a>
<a href="https://huggingface.co/datasets/ATON-QAI/QAI-Photonic-Benchmark" target="_blank" rel="noopener">Benchmark Dataset</a>
</div>
</header>
<div class="grid">
<div class="card">
<h2>1. Circuit & Physical Channel Controls</h2>
<label for="progSelect">Select Curated <code>.qai 1.0</code> Experiment</label>
<select id="progSelect">
<option value="hom">HOM-01: Hong–Ou–Mandel Two-Photon Dip (2 Modes)</option>
<option value="mzi">MZI-02: Single-Photon Mach–Zehnder Sweep (2 Modes)</option>
<option value="clements">CLEMENTS-04: 4-Mode Universal Mesh (4 Modes, 2 Photons)</option>
</select>
<div class="slider-row">
<div class="slider-head"><span>Coupler / Phase Angle θ</span><span class="val-badge" id="thetaVal">0.50 π</span></div>
<input type="range" id="thetaInput" min="0" max="1" step="0.01" value="0.50" />
</div>
<div class="slider-row">
<div class="slider-head"><span>Waveguide Transmittance η</span><span class="val-badge" id="etaVal">0.92</span></div>
<input type="range" id="etaInput" min="0.10" max="1.00" step="0.01" value="0.92" />
</div>
<div class="slider-row">
<div class="slider-head"><span>Photon Indistinguishability V (HOM)</span><span class="val-badge" id="visVal">0.96</span></div>
<input type="range" id="visInput" min="0.00" max="1.00" step="0.01" value="0.96" />
</div>
<div class="slider-row">
<div class="slider-head"><span>Detector Dark-Count Probability p_dc</span><span class="val-badge" id="dcVal">0.0010</span></div>
<input type="range" id="dcInput" min="0.0000" max="0.0200" step="0.0005" value="0.0010" />
</div>
<div class="slider-row">
<div class="slider-head"><span>Multi-Photon Emission g^(2)(0)</span><span class="val-badge" id="g2Val">0.005</span></div>
<input type="range" id="g2Input" min="0.000" max="0.100" step="0.001" value="0.005" />
</div>
<h2 style="margin-top:18px;">2. Source Program (<code>.qai 1.0</code>)</h2>
<pre class="code-box" id="codeDisplay"></pre>
</div>
<div>
<div class="card" style="margin-bottom: 18px;">
<h2>3. Optical Interferometer Schematic (SVG)</h2>
<div id="svgContainer"></div>
<div class="metrics-strip">
<div class="metric-box"><div class="m-label">Observed HOM Visibility</div><div class="m-val" id="mHom">0.9552</div></div>
<div class="metric-box"><div class="m-label">Two-Photon Survival (η²)</div><div class="m-val" id="mSurv">0.8464</div></div>
<div class="metric-box"><div class="m-label">Simplex Conservation</div><div class="m-val" id="mSimplex">∑ P = 1.00000</div></div>
</div>
</div>
<div class="card">
<h2>4. Fock-Space Probability Distribution & Verification Receipt</h2>
<table>
<thead>
<tr><th>Fock Basis State</th><th>Ideal Lossless P</th><th>Noisy Physical P</th><th>Physical Interpretation</th></tr>
</thead>
<tbody id="fockTableBody"></tbody>
</table>
<h2 style="margin-top:18px;">Public Verification Receipt (JSON)</h2>
<pre class="code-box" id="receiptBox" style="margin-bottom:0; color:#FAF9F6;"></pre>
</div>
</div>
</div>
</div>
<script>
const PROGRAMS = {
hom: {
family: "HOM_INTERFERENCE", modes: 2, photons: 2,
invariant: "Balanced beam-splitter zero-coincidence bosonic bunching identity",
code: "qai 1.0;\nprofile photonic.dv.linear;\n\nexperiment hom_dip(theta: angle = pi / 2) {\n let m: modes<2, fock> = prepare fock [1, 1];\n let (a, b) = sym_mzi(theta)(m[0], m[1]);\n emit measure pnr (a, b);\n}"
},
mzi: {
family: "CLEMENTS_RECK_MZI", modes: 2, photons: 1,
invariant: "Probability simplex normalization & single-photon fringe visibility",
code: "qai 1.0;\nprofile photonic.dv.linear;\n\nexperiment mzi_fringe(theta: angle = pi / 3) {\n let m: modes<2, fock> = prepare fock [1, 0];\n let (a, b) = sym_mzi(theta)(m[0], m[1]);\n emit measure pnr (a, b);\n}"
},
clements: {
family: "BOSON_SAMPLING", modes: 4, photons: 2,
invariant: "SU(M) interferometer unitary preservation & Fock photon-number conservation",
code: "qai 1.0;\nprofile photonic.dv.linear;\n\nexperiment clements_4mode(theta: angle = pi / 2) {\n let m: modes<4, fock> = prepare fock [1, 1, 0, 0];\n let u = clements_mesh<4>(theta);\n emit measure pnr u(m);\n}"
}
};
function renderSVG(meta, thetaFrac, eta, homV) {
const modes = meta.modes, height = modes === 2 ? 165 : 250;
const ys = Array.from({ length: modes }, (_, i) => 58 + i * 50);
let lines = "";
ys.forEach((y, i) => {
lines += `<line x1="75" y1="${y}" x2="640" y2="${y}" stroke="#C5A059" stroke-width="2.5" stroke-opacity="0.85"/>`;
lines += `<text x="22" y="${y + 5}" fill="#FAF9F6" font-family="monospace" font-size="13">|m_${i}⟩</text>`;
lines += `<rect x="646" y="${y - 12}" width="52" height="24" rx="5" fill="#14213D" stroke="#C5A059" stroke-width="1.5"/>`;
lines += `<text x="658" y="${y + 4}" fill="#C5A059" font-family="monospace" font-size="11">PNR</text>`;
});
const boxH = ys[ys.length - 1] - ys[0] + 34;
const coupler = `<rect x="245" y="${ys[0] - 17}" width="215" height="${boxH}" rx="8" fill="#101B38" stroke="#C5A059" stroke-width="2"/><text x="262" y="${ys[0] + 18}" fill="#C5A059" font-family="monospace" font-size="13" font-weight="bold">Interferometer (θ = ${thetaFrac.toFixed(2)}π)</text><text x="262" y="${ys[0] + 38}" fill="#FAF9F6" font-family="monospace" font-size="11.5">η = ${eta.toFixed(2)} | V_obs = ${homV.toFixed(4)}</text>`;
return `<svg viewBox="0 0 725 ${height}" width="100%" height="${height}" xmlns="http://www.w3.org/2000/svg" style="background:#070C1C;border:1px solid rgba(197,160,89,0.45);border-radius:8px;"><text x="22" y="26" fill="#C5A059" font-family="monospace" font-size="13" font-weight="bold">ATON QAI — Optical Waveguide Mesh (${meta.family})</text>${lines}${coupler}</svg>`;
}
function updateSimulation() {
const key = document.getElementById("progSelect").value, meta = PROGRAMS[key];
const thetaFrac = parseFloat(document.getElementById("thetaInput").value);
const eta = parseFloat(document.getElementById("etaInput").value);
const vis = parseFloat(document.getElementById("visInput").value);
const dc = parseFloat(document.getElementById("dcInput").value);
const g2 = parseFloat(document.getElementById("g2Input").value);
document.getElementById("thetaVal").textContent = thetaFrac.toFixed(2) + " π";
document.getElementById("etaVal").textContent = eta.toFixed(2);
document.getElementById("visVal").textContent = vis.toFixed(2);
document.getElementById("dcVal").textContent = dc.toFixed(4);
document.getElementById("g2Val").textContent = g2.toFixed(3);
document.getElementById("codeDisplay").textContent = meta.code;
const theta = thetaFrac * Math.PI, c = Math.pow(Math.cos(theta / 2), 2), s = Math.pow(Math.sin(theta / 2), 2);
let rows = [], homObs = 0;
if (meta.photons === 1) {
const p10_i = c, p01_i = s, p00_n = (1 - eta) * (1 - dc), p10_n = eta * c + dc * 0.5 * (1 - eta), p01_n = eta * s + dc * 0.5 * (1 - eta);
const tot = p00_n + p10_n + p01_n;
homObs = vis * (eta / (eta + dc + 1e-12));
rows = [["|1, 0⟩", p10_i, p10_n / tot, "Single-photon upper waveguide"], ["|0, 1⟩", p01_i, p01_n / tot, "Single-photon lower waveguide"], ["|0, 0⟩ (Photon Loss)", 0.0, p00_n / tot, "Propagation & coupling loss (1 - η)"]];
} else {
const p20_i = 2 * c * s, p02_i = 2 * c * s, p11_i = Math.pow(c - s, 2);
let p11_p = (c * c + s * s) - 2 * vis * c * s + 0.5 * g2, p20_p = (1 + vis) * c * s, p02_p = (1 + vis) * c * s;
const norm2 = Math.max(1e-12, p20_p + p02_p + p11_p);
p20_p /= norm2; p02_p /= norm2; p11_p /= norm2;
const eta2 = eta * eta, p_loss1 = 2 * eta * (1 - eta), p_loss2 = Math.pow(1 - eta, 2);
const p20_n = eta2 * p20_p, p02_n = eta2 * p02_p, p11_n = eta2 * p11_p + dc * p_loss1, p10_n = p_loss1 * (1 - dc), p00_n = p_loss2;
const tot = p20_n + p02_n + p11_n + p10_n + p00_n, pClass = c * c + s * s;
homObs = Math.max(0, (pClass - p11_p) / Math.max(1e-9, pClass));
rows = [["|2, 0⟩ (Bunched Mode 0)", p20_i, p20_n / tot, "Two-photon bosonic bunching"], ["|0, 2⟩ (Bunched Mode 1)", p02_i, p02_n / tot, "Two-photon bosonic bunching"], ["|1, 1⟩ (Coincidence Dip)", p11_i, p11_n / tot, `HOM Dip (V_obs = ${homObs.toFixed(4)})`], ["|1, 0⟩ + |0, 1⟩ (1-Photon Loss)", 0.0, p10_n / tot, "Single-photon attenuation channel"], ["|0, 0⟩ (2-Photon Loss)", 0.0, p00_n / tot, "Two-photon attenuation channel"]];
}
document.getElementById("svgContainer").innerHTML = renderSVG(meta, thetaFrac, eta, homObs);
document.getElementById("mHom").textContent = homObs.toFixed(4);
document.getElementById("mSurv").textContent = Math.pow(eta, meta.photons).toFixed(4);
document.getElementById("fockTableBody").innerHTML = rows.map(r => `<tr><td style="font-family:monospace;">${r[0]}</td><td class="num">${r[1].toFixed(5)}</td><td class="num">${r[2].toFixed(5)} <span class="bar-wrap"><span class="bar-fill" style="width:${Math.min(100, r[2]*100).toFixed(1)}%"></span></span></td><td style="color:#A9B4C9;">${r[3]}</td></tr>`).join("");
document.getElementById("receiptBox").textContent = JSON.stringify({ schema: "aton-qai.public-benchmark-receipt.v1", organization: "ATON-QAI", website: "https://aton-qai.ai", family: meta.family, parameters: { theta_pi: thetaFrac, transmittance_eta: eta, indistinguishability_V: vis, dark_count_p_dc: dc, g2_zero: g2 }, observed_hom_visibility: Number(homObs.toFixed(5)), verified_invariant: meta.invariant }, null, 2);
}
["progSelect", "thetaInput", "etaInput", "visInput", "dcInput", "g2Input"].forEach(id => document.getElementById(id).addEventListener("input", updateSimulation));
updateSimulation();
</script>
</body>
</html>