What is a channel? — an introductory notebook for the documentation - #36
Draft
giodefelice-agents wants to merge 9 commits into
Draft
giodefelice-agents wants to merge 9 commits into
giodefelice-agents wants to merge 9 commits into
Conversation
An introduction to photonic hardware and its simulation with optyx, building up from gates, states, effects, noise, distinguishability, measurement, classical control and feedback to the universal setup: a classically controlled isometry with a discarded environment, measured outputs, feedforward and feedback loops, defined as a class and simulated with at_time, eigen_fix and fix. Executed in CI like the fixpoints notebook.
… the universal setup The GHZ example composes the Z spider with one DualRail box per qubit instead of compiling to the path circuit. UniversalSetup now takes the domain, codomain, quantum and classical memory types, a Kraus-defined controlled unitary carrying the loss as its environment, the per-tick state, an initial memory state defaulting to the vacuum, and the feedforward; the same instance converges to the same fixed point.
Collaborator
Author
|
USER feedback from an interactive session:
done in f0b0a66 — GHZ is now Generated by Claude Code |
Part of the repo-wide Jupyter-to-marimo migration (matches discopy/discopy#404 and the same conversion landing on optyx's main).
…0p1g' into claude/optyx-photonics-notebook-lscc1x
The docs job now runs marimo export html on what_is_a_channel.md instead of nbconvert on the deleted .ipynb. With the base merged in, fix's loss argument inserts loss rather than describing it and its depth is certified from the loop's optical matrix, so the MZI loop shows fix and eigen_fix agreeing at the certified depth of five steps, and the universal setup — whose memory carries a classical control bit the certificate does not cover — converges to the eigen_fix distribution.
giodefelice-agents
pushed a commit
that referenced
this pull request
Aug 21, 2026
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.
Adds
docs/notebooks/what_is_a_channel.ipynb, executed end to end (~20 s), as the first entry ofdocs/notebooks.rst, with a CI step executing it like the fixpoints notebook.Structure — the nine sections requested, each with a drawn diagram and a simulation:
BS,Phase,MZI, theansatzinterferometer, and an arbitrary unitary viaGate(3-mode Fourier), withto_path()recovering the matrix.CreateFock states (HOM amplitudes), dual rail viaDualRailandto_dual_rail(GHZ).Selectamplitudes, observables viafrom_bosonic_operator(number operator, and a formal sum for total photon number conserved byBS).PhotonLossas a discarded environment, the Stinespring picture,double()drawn as anEquation, lossy HOM.internal_states+inflate, the HOM dip at overlapstate >> unitary >> measureboson sampling on the Fourier interferometer.ClassicalFunction+BitControlledGate: one gate measured, the other controlled.feedback(mem=..., state=...),unroll,at_timetrajectory,eigen_fixfixed point (the MZI loop).UniversalSetup(Diagram)class: state ψ into a classically controlled isometry from M+L to M+L+E with C control bits, E discarded (PhotonLoss), L qmode feedback loops, M outputs measured viaMeasure(qmode), feedforward into X+C with the C bits fed back as control. Drawn (draw+unroll(1)) and simulated:at_timetrajectory converges to the value botheigen_fixandfixagree on.Stacking — based on
claude/optyx-pr15-review-plan-cb0p1g(PR #26), since sections 8–9 use the feedback/fixpoint surface of PRs #12 → #15 → #26; the diff is the notebook, the docs index, the CI step andTODO.md.Found along the way — a multi-wire
Discardcannot be drawn (KeyErrorin discopy'sdraw_discard), filed as #35; the notebook works around it by passing the feedbackeffectas a tensor of single-wire discards.Checks — notebook executes cleanly from scratch;
pflake8 optyxclean (no source changes); fullpytestrun reported on the thread once finished.🤖 Generated with Claude Code
https://claude.ai/code/session_016rWouaGy14w1zC4DETweoN
Generated by Claude Code