3 where we have used Eq. (A4) and introduced an XPM- modified annihilation operator of this relation only after deriving general results in order to facilitate the extension to non-unitary dynamics. The solution of Eq. (2) for the propagation of light in an infinitely extended XPM medium is The physical interpretation of Eq. (11) is that the wavepacket ψ ∗ $_{i}$( z ′ − u ) is multiplied by a spatially varying phase factor that is given by the exponential in Eq. (11) and incorporates the effect of XPM on the light pulses. The expectation value for field 2 in Eq. (10) can then be reduced to The function θ$_{i}$ ( z$_{1}$, z$_{2}$ ) will play a central role in deter- mining the Kerr phase shift. One important property is that for a symmetric potential, V$_{i}$ ( − z ) = V$_{i}$ ( z ), we have θ$_{i}$ ( − z$_{1}$, − z$_{2}$ ) = − θ$_{i}$ ( z$_{1}$, z$_{2}$ ). so that ˜ a$_{i}$ [ u ; z, t ] ≡ 1 √ η ∫ ∞ −∞ dz ′ ψ ∗ $_{i}$( z ′ − u ) ˆ E$_{i}$ ( z $^{′}$, 0) × e − i η v 3 − i v i − v 3 − i θ$_{3}$$_{−}$$_{i}$ ( z − z $^{′}$− v$_{3}$$_{−}$$_{i}$t, ( v$_{i}$ − v$_{3}$$_{−}$$_{i}$ ) t ) . (11) E$_{i}$ ( z, t ) = U$_{3}$$_{−}$$_{i}$ ( z, t ) E$_{i}$ ( z − v$_{i}$t, 0) , (5) U$_{i}$ ( z, t ) = exp$^{(}$ − i$^{∫}$ ∞ −∞ ˆ I$_{i}$ ( z $^{′}$, 0) v$_{3}$$_{−}$$_{i}$ v$_{i}$ − v$_{3}$$_{−}$$_{i}$ × θ$_{3}$$_{−}$$_{i}$ ( z − z ′ − v$_{3}$$_{−}$$_{i}$t , [ v$_{i}$ − v$_{3}$$_{−}$$_{i}$ ] t ) dz ′ ) , (6) θ$_{i}$ ( z$_{1}$, z$_{2}$ ) ≡ ∫ z$_{2}$ 0 dz ′ V$_{i}$ ( z$_{1}$ − z $^{′}$) . (7) 〈 0 | a n $_{2}$(˜ a † $_{2}$[0; z, t ]) $^{n}$| 0 〉 = n ![ a$_{2}$, ˜ a † $_{2}$[0; z, t ] ] $^{n}$, (12) 〈E$_{1}$ ( z, t ) 〉 = α √ ηψ$_{1}$ ( z − v$_{1}$t ) × ( ∫ dz ′ | ψ$_{2}$ ( z $^{′}$) | $^{2}$ei η v 1 Δ $_{v}$θ$_{1}$ ( z $^{′}$− z + v$_{1}$t, Δ v t ) ) n , (13) A. Quantum non-demolition measurement of photon numbers with Δ v ≡ v$_{1}$ − v$_{2}$ . To better understand the physical implications of Eq. (13) we consider the specific configuration depicted in Fig. 1. The classical mode ψ$_{1}$ is initially centered around the origin while the n -photon pulse in mode ψ$_{2}$ is a distance d to the right of it [41]. Both pulses are mov- ing to the right, but pulse 1 is faster. The first line in Eq. (13) is basically the amplitude of the classical pulse ψ$_{1}$ at time t in absence of the XPM medium. The pulse is centered around z = v$_{1}$t . Hence, to achieve an maxi- mum phase contrast, we should observe the field at this point. The exponential in Eq. (13) is then proportional to θ$_{1}$ ( z $^{′}$, Δ v t ). As a first application we consider a QND measurement of the number of photons [38] in mode 2. This can be accomplished by sending a strong classical pulse in mode 1, which can be described by a coherent state | α 〉 , to- gether with an n photon pulse | n 〉 in mode 2 through the XPM medium. Single-mode treatments predict that in this case the phase of the classical pulse will be shifted by an amount that is proportional to n . Here we show that the uniform cross phase shift that we suggest will accomplish precisely this. The initial state of the two light pulses before they start to interact takes the form | ψ 〉 = | α 〉 ⊗ | n 〉 where the two kets refer to mode 1 and 2, repectively. Using the shift operator D$_{1}$ ( α ) = exp( αa † 1 − α $^{∗}$a$_{1}$ ) this can be expressed as In Appendix B it is shown that for any potential V$_{i}$ ( z ) that is consistent with causality, the function θ$_{1}$ ( z $^{′}$, Δ v t ) is nearly constant between the lines Δ v t = z ′ and z ′ = 0 and zero outside of this range. The support of the ini- tial wavepacket ψ$_{2}$ ( z $^{′}$) is in the area z ′ > 0 and peaked around z ′ = d . For sufficiently large times, such that Δ v t ≫ d , the support of ψ$_{2}$ ( z $^{′}$) is therefore completely inside the domain where θ$_{1}$ ( z $^{′}$, Δ vt ) ≈ V$_{1}$ , with the con- stant The complex amplitude of the classical pulse at time t and position z is given by 〈 ψ |E$_{1}$ ( z, t ) | ψ 〉 . Its phase can be measured using homodyne detection [39], for instance, which more specifically measures the observable X ( ϑ ) = e i $^{ϑ}$E$_{1}$ ( z, t ) + e − i $^{ϑ}$E † $_{1}$( z, t ). Using Eq. (A3) it is easy to see that This condition corresponds to the requirement that the classical pulse 1 had enough time to overtake the n - photon pulse 2. Because the mode function ψ$_{2}$ is nor- malized we thus find Exploiting this and solution (5) we get V$_{i}$ ≡ ∫ ∞ −∞ dz V$_{i}$ ( z ) . (14) | ψ 〉 = 1 √ n ! D$_{1}$ ( α )( a † $_{2}$) $^{n}$| 0 〉 . (8) D † $_{1}$( α ) E$_{1}$ ( z, 0) D$_{1}$ ( α ) = E$_{1}$ ( z, 0) + α √ ηψ$_{1}$ ( z ) . (9) 〈 ψ |E$_{1}$ ( z, t ) | ψ 〉 = α √ η n ! ψ$_{1}$ ( z − v$_{1}$t ) 〈 0 | a n $_{2}$U$_{2}$ ( z, t )( a † $_{2}$) $^{n}$| 0 〉 = α √ η n ! ψ$_{1}$ ( z − v$_{1}$t ) 〈 0 | a n $_{2}$(˜ a † $_{2}$[0; z, t ]) $^{n}$| 0 〉 , (10) 〈E$_{1}$ ( v$_{1}$t, t ) 〉 = α √ η ψ$_{1}$ (0) e − i $^{nφ$_{1}$}$, (15) φ$_{i}$ ≡ ηv$_{i}$ V$_{i}$ Δ v . (16)