  On-chip integrated photonic circuits are crucial to further progress towards
quantum technologies and in the science of quantum optics. Here we report
precise control of single photon states and multi-photon entanglement directly
on-chip. We manipulate the state of path-encoded qubits using integrated
optical phase control based on resistive elements, observing an interference
contrast of 98.2+/-0.3%. We demonstrate integrated quantum metrology by
observing interference fringes with 2- and 4-photon entangled states generated
in a waveguide circuit, with respective interference contrasts of 97.2+/-0.4%
and 92+/-4%, sufficient to beat the standard quantum limit. Finally, we
demonstrate a reconfigurable circuit that continuously and accurately tunes the
degree of quantum interference, yielding a maximum visibility of 98.2+/- 0.9%.
These results open up adaptive and fully reconfigurable photonic quantum
circuits not just for single photons, but for all quantum states of light.
