Module 9: Solving the Model: The Exchange-Angle Method
Goal
After this module you can explain, check and implement the draft’s exchange-angle solver: derive the exact angles of draft Eq. (53), write the three-mode star unitary in closed form, explain why sequential rotations are wrong, build the eight-mode ring-site propagator, and run the validation checks that certify the numbers.
Module 8 ended with eight coupled equations, draft Eqs. (17)-(24), that contain delta functions, two-variable functions and a very fast SFG exchange. The question of this module is how to solve them without approximations that would hide a one-percent effect, since the gate errors to be resolved are of order and the identity-branch phase is claimed to be exactly zero.
A textbook finite-difference scheme is a poor fit. The delta couplings produce jumps in the bus amplitudes, so derivatives at the coupler are ill defined (Module 7). The SFG rate is large, , so an explicit step of size would rotate by two radians and become unstable. The draft (Version B, Sec. IV and Appendix I.A-E) uses a different idea: in the co-moving frame nothing moves except at the ring, so one can cut the buses into cells, let each cell meet the ring for exactly one time step, and perform each meeting as an exact unitary. This is a collision or repeated-interaction model. The course code code/cnot_add_drop.py implements a reduced version of the same algorithm (Appendix B).
The picture: a conveyor belt past a ring
The question here is what “co-moving frame” buys. In the frame of draft Eqs. (47)-(52) (Module 8), a wavepacket on a bus is frozen. The ring is what moves: it sits at , that is at , and sweeps across the frozen wavepackets at speed . Cut every bus into cells of width . In one time step the ring advances exactly one cell. Each cell is in contact with the ring for one step and then never again (Figure 9.1).
Figure 9.1. Left: the through and drop buses cut into cells of width v_g dt. In the co-moving frame the wavepackets are frozen and the ring moves one cell per step; at each step it touches one cell of each bus (shaded). Right: the three amplitudes that interact in one step form a star centred on the ring mode, and the step is the exact exponential of that star.
In the lab frame the same algorithm reads: shift every wavepacket one cell downstream, then let the ring exchange amplitude with the cell that has just arrived at . The two descriptions differ only in bookkeeping; the draft’s code uses a “ring pointer” that walks across a fixed grid, which is the co-moving version.
Discretizing a bus
The question here is how the continuum amplitudes become a finite vector, and what one step of exchange looks like.
Definition 9.1 (Cell amplitudes).
Cut each bus into cells of width . The cell amplitude of a one-photon function is ; of a two-photon function . On the ring cell the delta function becomes .
With these scalings , so cell amplitudes are probability amplitudes, and a unitary acting on them conserves probability exactly. Ring amplitudes (, , and the ring factor in , ) are already numbers and are not rescaled.
Take first one bus and one ring mode, the setting of Module 7 (Proposition 7.4): and in the co-moving, rotating frame. Let be the ring cell. Replacing by and by ,
This is a two-level system with coupling , using . During the one step for which the cell is at the ring, the pair rotates by the angle :
This is the first-order angle of the draft. Two features stand out. The coupling grows like while the cell amplitude shrinks like , so their product, the rate at which amplitude enters the ring, , stays finite as . That is the “repeated-interaction scaling” of draft Appendix I.D, and it is how the discrete model recovers input-output theory. Second, the step is unitary for any : the scheme cannot blow up, whatever is. Third, the collision settles the ambiguity of "" at a discontinuity for us. To first order the outgoing cell is , which is the jump condition, and the ring changes by , which is . That is Eq. (7.4) of Module 7, the equation obtained with the mean-value convention of Proposition 7.4. The from is the discrete origin of the damping (Homework 9, Problem 4).
Intuition
Picture the bus as a train of small boxes passing a station. Each box stops at the station for one tick and swaps a little amplitude with it, then leaves forever. The swap per box is small, of order in amplitude and in probability, and there are boxes per unit time, so the probability leaving the station per unit time is , as it should be.
Exact exchange angles
The question here is how large must be so that the discrete model has exactly the right decay, not only to first order in .
Consider an empty bus and a ring holding amplitude . In each step the ring meets a fresh, empty cell, and Eq. gives ; the remainder leaves on the cell and never returns. After steps . The continuum answer is . They agree for every if and only if
The first-order angle is the small-step limit of this, since . It is too large. Compare the probability leaked per step:
with . The first-order ring therefore leaks too much per step by a fraction of about .
exact leak
first-order leak
ratio
The signal mode with the draft’s production step has .
Reading note: how leaky is the first-order angle
Draft Appendix I.C says the first-order form “is 12% too leaky at our signal coupling”. At the production step , where , the per-step leakage is too large (the effective decay rate is too large). The figure is reached at , that is at , the coarse end of the draft’s convergence study. The conclusion (do not use the first-order angle) stands either way.
Now let the ring decay into two channels, , as the signal mode does into the through and drop buses. A second requirement appears: the probability leaving per step must split between the channels in the ratio , as it does in the continuum.
For a ring mode with decay channels , , the angles
used in the star unitary of Proposition 9.3 make the ring keep exactly of its probability per step and send the rest into channel with branching ratio exactly , for every .
The proof needs the star unitary, so it follows Proposition 9.3 below.
The star unitary
The question here is how to perform one step when the ring talks to two cells at once. On the space spanned by the ring amplitude , the through cell and the drop cell at the ring, the step generator is
a graph shaped like a star with the ring at the centre (Figure 9.1, right).
Proposition 9.3 (Closed form of the three-mode star).
Let , , and define the bright cell mode and the dark mode . Then and
In the basis , with and ,
Derivation
Bright and dark modes., so . The vector is orthogonal to (since ) and to , so : the dark mode does not couple to the ring.
Exponential. On the two-dimensional space , with , so . On the exponential is the identity. Adding the two blocks gives the stated form.
Matrix. Expand in , using and (completeness in the cell plane). The entry is , the entry is , and the entries involving come from the part. Unitarity holds because each block is unitary.
Proof of the exact angles
Start a step with amplitude in the ring and empty cells. The first column of Eq. gives: ring keeps , channel receives . With from Eq. , , the exact survival. With we have (consistent with the definition in Proposition 9.3) and , the exact branching ratio. Since every step starts with fresh empty cells, the same holds at every step.
Intuition
The ring does not see two cells; it sees one combination of them, the bright mode, weighted by the coupling strengths. The orthogonal combination is invisible to the ring and passes untouched. So two channels are no harder than one: rotate the ring against the bright mode by the total angle .
Why not one rotation per channel
A tempting shortcut is to apply Eq. twice per step, first ring-through with , then ring-drop with . The draft warns that this “would differ at and impose a spurious through-before-drop asymmetry”. Both claims follow from a short computation.
Proposition 9.4 (Error of sequential pairwise rotations).
Let . Then
; in particular while , whereas the star gives for both.
Starting from amplitude in the ring, the through cell receives and the drop cell , so the branching ratio is wrong by the factor , which favours the channel applied first.
Proof
Apply the two rotations to : the first gives ; the second leaves alone and turns into . The component is . Applied to , the first rotation does nothing and the second gives : no component. For the star, both entries are . The difference is of order . In operator language, the Baker-Campbell-Hausdorff formula gives with , the two generators, and : a spurious direct coupling between the two cells.
From : after the first rotation , after the second . Square the moduli.
Common trap: splitting a step is harmless, as in Trotter
In an ordinary Trotter splitting the two generators are proportional to , their commutator to , and the error per step is second order. Here the angles scale as , so the commutator is of order , the same order as the physics in the step. At the draft’s step, and ; the sequential scheme then sends to the through cell and to the drop cell per step, a bias for a ring that is perfectly balanced. The error does vanish as , but only linearly, and the star removes it at no cost.
The same structure occurs in a second place, which is why the draft says “both signal buses talking to the same resonator mode, or to the same pump-travelling amplitude”. When the pump is on its bus at some cell and the signal is in the ring, the amplitude exchanges with and : the signal leaves the ring into either bus while the pump waits at . That triple is again a star with angles .
Two photons: boundary slices and the ring-site cluster
The question here is which of the many two-photon amplitudes change in a step, and how. In the co-moving frame an amplitude changes only if at least one of its photons is in the ring or in the ring cell . That leaves three kinds of update (draft Appendix I.B-D).
Signal boundary rows. For each signal cell the pump exchanges between ring and pump cell while the signal waits at : the pairs and , each rotated as in Eq. with the pump angle .
Pump boundary columns. For each pump cell the signal exchanges between ring and its two bus cells while the pump waits at : the star with angles from Eq. .
Ring-site cluster. When every bus photon of an amplitude is at the ring cell, all couplings act together. The eight amplitudes form a closed cluster, coupled exactly as the graph of draft Table 2 (Module 8).
All other amplitudes, for instance a two-photon amplitude with both photons far from the ring, are frozen in this step. The two-dimensional arrays are therefore stored in full, but only one row and one column of each are touched per step, so a step costs a number of operations proportional to the number of cells.
Definition 9.5 (Ring-site propagator).
Order the cluster as . The ring-site propagator is with
where every bus-facing entry is an exact angle from Eq. (so the entries of itself are ) and the SFG entry is the bare rate .
Read the matrix against the graph of Module 8: row 6 () has four neighbours, the two signal buses, the pump and the SF mode; row 5 () is fed by both two-photon amplitudes. The matrix is Hermitian by construction, , so is unitary.
Two remarks explain the design.
Why exponentiate exactly. In the blockade regime radians: and swap amplitude back and forth within a single step. Splitting the SFG off from the couplings would alias this fast cycling; computing the exponential once (it does not change between steps) costs nothing.
Why the exact angles still hold. With the cluster is the product of a signal star and a pump pair, as the next proposition shows, so every coupling reduces to the calibrated one-channel or two-channel step.
Proposition 9.6 (The cluster factorizes without SFG).
If , then on the six amplitudes other than the propagator is , where the signal factor acts on and the pump factor on .
Proof
Label the six amplitudes by (signal place, pump place): , , , , , . Every or entry of moves the signal and leaves the pump label fixed; every entry moves the pump and leaves the signal label fixed. Hence with the star generator and the pair generator. The two terms commute, so .
This is the draft’s statement that “setting makes factorize and reduce exactly to the boundary beamsplitters, so each physical coupling carries one strength in every sector”. It is also the discrete form of Proposition 8.10.
Remark 9.7 (What is approximate).
In our reading of the draft, the three kinds of update act on disjoint sets of amplitudes (a signal row with , a pump column with , and the cluster at ), so their order within a step does not matter. The approximation lies in the collision picture itself: each cell is treated as meeting the ring for one step with the input held fixed during the step. The exact angles make free decay and branching exact; driven responses are correct up to errors that vanish as , which the convergence study measures. The draft phrases this as “no approximation enters beyond the ordering of cluster and boundary updates within a timestep”.
The algorithm
Putting the pieces together, one run of the solver is the following loop. Amplitude arrays are indexed by co-moving cell; the ring pointer moves down by one cell per step.
INPUT : cells 0..N-1 of width dz = vg*dt; signal psi_in[j]; pump p_in[k] rates k_st, k_sd, k_p, k_f; SFG rate Ups; start cell r0; n_stepsANGLES : Th = asin(sqrt(1 - exp(-(k_st + k_sd)*dt))) th_st = Th*sqrt(k_st/(k_st + k_sd)) th_sd = Th*sqrt(k_sd/(k_st + k_sd)) th_p = asin(sqrt(1 - exp(-k_p*dt))) th_f = asin(sqrt(1 - exp(-k_f*dt)))STATE : Pt[j,k], Pd[j,k] signal (thru / drop) at j, pump on bus at k St[j], Sd[j] signal (thru / drop) at j, pump in ring Pp[k] signal in ring, pump on bus at k F[k] SF photon on bus at k esp, ef both in ring; SF photon in ringINIT : Pt[j,k] = psi_in[j]*p_in[k]; everything else 0U8 : expm(-i*H8*dt), built once from (th_st, th_sd, th_p, th_f, Ups*dt)for n = 0 .. n_steps-1: r = r0 - n # ring cell at this step for j != r: # pump exchange, signal waits (St[j], Pt[j,r]) = PAIR(th_p) (St[j], Pt[j,r]) (Sd[j], Pd[j,r]) = PAIR(th_p) (Sd[j], Pd[j,r]) for k != r: # signal exchange, pump waits (Pp[k], Pt[r,k], Pd[r,k]) = STAR(th_st, th_sd) (Pp[k], Pt[r,k], Pd[r,k]) v = (Pt[r,r], Pd[r,r], St[r], Sd[r], Pp[r], esp, ef, F[r]) v = U8 @ v # everything at the ring at once write v backOUTPUT : P_thru = sum |Pt|^2 + sum |St|^2 (draft Eq. 3) P_drop = sum |Pd|^2 + sum |Sd|^2 (draft Eq. 4) P_SF = sum |F|^2 + |ef|^2; check total norm = 1
PAIR is Eq. with the exact angle, and STAR is Eq. . The pump-off branch is the same loop with the pump arrays removed: only and one STAR per step. The grid must be long enough that the ring pointer never runs off it; the draft uses no absorbing boundary and reads the port probabilities as final-state sums over all sectors (draft Appendix I.E).
Validation: how the digits are certified
The question here is how one knows the quoted four digits are right. The draft (Version B, Sec. IV) lists four checks.
Norm. Every operation is unitary, so the total probability is conserved up to round-off; the draft reports in every production run, and the course code code/cnot_add_drop.py conserves it to . This check catches indexing errors, which almost always destroy unitarity.
Convergence. All reported quantities change by less than when goes from to and the domain length by (draft). The course code finds stable to for from to .
Analytic limit. With the pump absent, the drop output must equal the input filtered by (Proposition 8.9). The draft reports overlap modulus , phase error , and a measured group delay matching .
Blockade off. Rerunning the pump-on case with must give the pump-off result (Proposition 9.6). It shows that the through-port output of the identity branch is caused by the blockade, not by the presence of the pump.
The single-photon branch is small enough to test the three step rules side by side. We ran the pump-off case (, balanced, Gaussian pulse of amplitude FWHM , the convention of Module 10) with three schemes: the exact star (Eq. with angles from Eq. ), a star with first-order angles , and two sequential pair rotations with exact angles. The continuum value from the frequency-domain integral of is .
exact star
first-order angles
sequential pairs
The exact star converges like (errors , , ) and at reproduces the draft’s . Both alternatives converge only like and are off by and at the production step, more than the effects the draft resolves. In all three schemes the drop output overlaps the analytically filtered input with modulus and zero phase error, so check 3 alone would not distinguish them; the probability itself does.
Worked example: one step by hand
Take the signal mode at the draft’s step: , , balanced, so .
Angles., so , , and . The first-order angle would be , larger.
Matrix., , , so and :
Free decay. A ring holding amplitude keeps and sends to each bus, exactly half of each.
Through-port cancellation in one step. Feed a through cell into an empty ring. The through cell keeps , the drop cell receives , the ring receives . In later steps the ring amplitude leaks out with the phase onto both buses; on the through bus it interferes destructively with the directly transmitted part, on the drop bus it adds to the . For a long pulse the through cells end with nothing and the drop cells with the input times : the flip branch of Proposition 8.2, built from three-by-three rotations.
How the paper uses this
Draft Version B, Sec. IV (“Numerical Simulation”) states the strategy; Appendix I.A is the co-moving reduction (Module 8), I.B the cluster reduction, I.C the exact angles (Proposition 9.2, Proposition 9.3, Proposition 9.4), I.D the ring-site propagator (Definition 9.5, Proposition 9.6), I.E the grid and convergence.
The four validation checks at the top of draft p. 9 are the list above.
Every number in draft Sec. V-VI, and in Module 10, is produced by this solver.
What breaks
The method relies on linear, lossless dynamics with a single coupling point and equal group velocities for all buses. With different group velocities the frames of signal and pump differ and the two-photon array would have to be sheared each step. Intrinsic loss can be added as an extra decay channel per mode (a dark sink cell), at the price of tracking lost probability. A frequency-dependent coupling (dispersion) or detuning makes the per-step exchange no longer a pure rotation; the exact-angle calibration then holds only for the decay, not for the phase. The two-dimensional arrays scale as the square of the number of cells, which limits long pulses and fine grids to a few thousand cells (the draft uses ).
Why it matters
The solver turns a set of singular partial differential equations into a sequence of small exact rotations, so the results of Module 10 are limited by physics, not by numerics. The exact angles and the star are the two ideas that make this possible, and both reappear whenever a cavity talks to more than one channel, for instance when intrinsic loss is added as a third channel. The same collision picture underlies the widget add-drop-cnot and the course code of Appendix B.
Vadlamani CM, Bu T, Huang Y. Deterministic Controlled-NOT Gate Between Single Photons via Quantum Zeno Blockade in an Add–Drop Microring. 2026.
2.
Gardiner CW, Collett MJ. Input and output in damped quantum systems: Quantum stochastic differential equations and the master equation. Physical Review A. 1985;31(6):3761–74.
3.
Shen JT, Fan S. Coherent photon transport from spontaneous emission in one-dimensional waveguides. Optics Letters. 2005;30(15):2001–3.
4.
Shen J-T, Fan S. Theory of single-photon transport in a single-mode waveguide. I. Coupling to a cavity containing a two-level atom. Physical Review A. 2009;79(2):023837.
5.
Cirac JI, Zoller P, Kimble HJ, Mabuchi H. Quantum state transfer and entanglement distribution among distant nodes in a quantum network. Physical Review Letters. 1997;78(16):3221–4.
6.
Fan S, Suh W, Joannopoulos JD. Temporal coupled-mode theory for the Fano resonance in optical resonators. Journal of the Optical Society of America A. 2003;20(3):569–72.