1. A photonic cluster state generator, comprising an optical divider stage having an input into which photons from a photon source are applied, and a plurality of optical divider outputs among which said photons are evenly divided and output; a like plurality of polarization and delay stages for synchronizing said photons in time; a like plurality of first entanglement stages for creating entangled chains of said synchronized photons, wherein each of said first entanglement stages comprise a plurality of delay lines for synchronizing said photons in time; an entangling gate having bypass and entangling inputs and bypass and entangling outputs for selectively entangling said photons; and a plurality of multimode interferometers for selectably routing said photons, in response to signals from said controller, through any of said interconnecting optical waveguide to any of said plurality of delay lines and entangling gate inputs and outputs; a plurality of second entanglement stages for entangling said photon chains so as to produce and output cluster states; a controller for selectably controlling said delay and entanglement of said photons and photon chains; and a clock source for synchronizing said controller with the arrival of said photons; wherein optical divider stage, polarization and delay stages, first entanglement stages, and second entanglement stages are fabricated as integrated optical components on a chip, each being interconnected by optical waveguide disposed therein.