  We provide an efficient method for the calculation of high-gain, twin-beam
generation in waveguides derived from a canonical treatment of Maxwell's
equations. Equations of motion are derived that naturally accommodate photon
generation via spontaneous parametric down-conversion (SPDC) or spontaneous
four-wave mixing (SFWM), and also include the effects of both self-phase
modulation (SPM) of the pump, and of cross-phase modulation(XPM) of the twin
beams by the pump. The equations we solve involve fields that evolve in space
and are labelled by a frequency. We provide a proof that these fields satisfy
bonafide commutation relations, and that in the distant past and future they
reduce to standard time-evolving Heisenberg operators. Having solved for the
input-output relations of these Heisenberg operators we also show how to
construct the ket describing the quantum state of the twin-beams. Finally, we
consider the example of high-gain SPDC in a waveguide with a flat nonlinearity
profile, for which our approach provides an explicit solution that requires
only a single matrix exponentiation.
