We derive optimal N-photon two-mode input states for interferometric phase
measurements. Under canonical measurements the phase variance scales as N-2
for these states, as compared to N-1 or N-1/2 for states considered bq pre
vious authors. We prove, that it is not possible to realize the canonical m
easurement by counting photons in the outputs of the interferometer, even i
f an adjustable auxiliary phase shift is allowed in the interferometer. How
ever. we introduce a feedback algorithm based on Bayesian inference to cont
rol this auxiliary phase shift. This makes the measurement close to a canon
ical one, with a phase variance scaling slightly above N-2. With no feedbac
k, the best result (given that the phase to be measured is completely unkno
wn) is a scaling of N-1. For optimal input states having up to four photons
, our feedback scheme is the best possible one, but for higher photon numbe
rs more complicated schemes perform marginally better.