1. An apparatus for sequentially entangling photons in two dimensions, comprising: a waveguide chip having integrated optical components and interconnecting optical waveguide disposed therein, wherein said optical components further comprise an input port connected to said optical waveguide for inputting said photons into said waveguide chip; a polarization controller connected to said input port fir rotating the polarization of photons received via said input port; a plurality of delay lines for synchronizing said photons in time; a plurality of multimode interferometers for selectably routing said photons through any of said interconnecting optical waveguide; a controller for switching an input mode of any of said plurality of multimode interferometers so as to route said photons into and out of a selected interferometer's input and output ports; a clock source for synchronizing said controller with the arrival of said photons; a plurality of entangling gates having bypass and entangling inputs and bypass and entangling outputs for selectively entangling said photons; and an output port for routing said entangled photons out of said waveguide chip.