  Scaling up linear-optics quantum computing will require multi-photon gates
which are compact, phase-stable, exhibit excellent quantum interference, and
have success heralded by the detection of ancillary photons. We investigate
implementation of the optimal known gate design which meets these requirements:
the Knill controlled-Z gate, implemented in integrated laser-written waveguide
arrays. We show that device performance is more sensitive to the small
deviations in the coupler reflectivity, arising due to the tolerance values of
the fabrication method, than phase variations in the circuit. The mode fidelity
was also shown to be less sensitive to reflectivity and phase errors than
process fidelity. Our best device achieves a fidelity of 0.931+/-0.001 with the
ideal 4x4 unitary circuit and a process fidelity of 0.680+/-0.005 with the
ideal computational-basis process.
