%\documentclass{article}
\documentclass[aps,pra,a4paper,showpacs]{revtex4}
\usepackage{graphicx,amsmath,amssymb,amsfonts,latexsym,dcolumn,bm}

\providecommand{\abs}[1]{\left\lvert#1\right\rvert}
\providecommand{\norm}[1]{\lVert #1 \rVert}
\providecommand{\moy}[1]{\langle #1 \rangle}
\providecommand{\bra}[1]{\langle #1 \rvert}
\providecommand{\ket}[1]{\lvert #1 \rangle}
\providecommand{\kket}[1]{\lvert #1 \rangle\rangle}
\providecommand{\braket}[2]{\langle #1 \rvert #2 \rangle}
\providecommand{\tr}[1]{\text{tr}\left[ #1 \right]}
\newcommand{\ketbra}[2]{\left| {#1} \right\rangle\left\langle {#2}\right|}
\newcommand{\ud}{\mathrm{d}}
\newcommand{\mmax}{_{\text{max}}}
\newcommand{\thetabar}{\overline{\theta}}
\newcommand{\un}{\openone}
\begin{document}

\section*{Supplementary Information}



\section{Theoretical Model}

Taking into account the finite duration of the pump pulse, the finite length of interaction, and the linearity of energy and momentum conservation, the wave function describing the two-photon state produced by pumping at a given angle $\theta$ can be written as~:
\begin{equation}
\ket{\Psi(\theta)} = \iiint \ud\omega_s\ud\omega_i\ud z
\left[\mathcal{A}_{+\theta}^{(1)}(\omega_s,\omega_i) a_{H}^{\dagger}(\omega_s)  a_{V}^{\dagger}(\omega_i)+\mathcal{A}_{+\theta}^{(2)}(\omega_s,\omega_i) a_{V}^{\dagger}(\omega_s)  a_{H}^{\dagger}(\omega_i)\right]S_+(z)\ket{\text{vac}}\ket{z}
\end{equation}

where $\mathcal{A}_{+\theta}^{(1)}(\omega_s,\omega_i) $ and $\mathcal{A}_{+\theta}^{(2)}(\omega_s,\omega_i) $ are the joint spectral amplitudes corresponding to the two possible phase-matching conditions, $z$ is the propagation direction of the generated photons and $S_+(z)$ the spatial  profile of the pumping beam in the $z$ direction. The functions  $\mathcal{A}_{+\theta}^{(1)}(\omega_s,\omega_i)$ and $\mathcal{A}_{+\theta}^{(2)}(\omega_s,\omega_i) $ are completely determined by the pump spectrum and the interaction length  in the medium.  Notice that, in principle, other photonic degrees of freedom of the pumping beam, as for instance its dispersion in momentum,  should be taken into account to provide the most complete theoretical model of the experiment. However, we expect that the spatial and frequency degrees of freedom should play the most important role to explain the observed results, and  Fig.5 indicates that our model indeed provides a very good description of the experiment. 



In general, the two interactions have different central frequencies and since the spectral width is small compared to other types of phase matching, photons generated by interaction~$(1)$  are distinguishable from  photons generated by interaction~$(2)$: frequency provides a ``which-way" information on each polarization and thus reduces the entanglement. 

To obtain indistinguishable photons from both sides of the medium (right and left),  two pump laser pulses must be used with different angles of incidence $ \pm \theta_{\text{deg}}$.
In this case, each pump generates a pair of photons, and the total state can be written as:
\begin{align}
\ket{\Psi(+\theta_{\text{deg}},-\theta_{\text{deg}})} &= \iiint\ud\omega_s\ud\omega_i\ud z
\left[\mathcal{A}_{+\theta_{\text{deg}}}^{(1)}(\omega_s,\omega_i)S_+(z) \ket{\omega_s,H}\ket{\omega_i,V}\ +
\mathcal{A}_{-\theta_{\text{deg}}}^{(2)}(\omega_s,\omega_i)S_-(z)\ket{\omega_s,V}\ket{\omega_i,H}\right]\ket{z} \nonumber \\
&+
\iiint \ud\omega_s\ud\omega_i \ud z
\left[\mathcal{A}_{+\theta_{\text{deg}}}^{(2)}(\omega_s,\omega_i)S_+(z) \ket{\omega_s,V}\ket{\omega_i,H} +
\mathcal{A}_{-\theta_{\text{deg}}}^{(1)}(\omega_s,\omega_i)S_-(z)\ket{\omega_s,H}\ket{\omega_i,V}\right]\ket{z}
\end{align}
where $S_{\pm}$ is the  spatial distribution for each pumping beam along $z$.
 When  nearly frequency degenerated photons are selected by filtering ({\it i.e.} $\abs{\omega_s-\omega_i}<\sigma$),
only the first integral is selected (see Fig. 2 in the main text).  


Finally the almost frequency indistinguishable two-photon state can be written as:
\begin{equation}
\ket{\Psi(+\theta_{\text{deg}},-\theta_{\text{deg}})} = \iiint \ud\omega_s\ud\omega_i\ud z
\left[\mathcal{A}_{+\theta_{\text{deg}}}^{(1)}(\omega_s,\omega_i)S_+(z) \ket{\omega_s,H}\ket{\omega_i,V} +
\mathcal{A}_{-\theta_{\text{deg}}}^{(2)}(\omega_s,\omega_i)S_-(z)\ket{\omega_s,V}\ket{\omega_i,H}\right] \ket{z}
\end{equation}
From now on, we simplify the notation, and write $\mathcal{A}^{(1)}_{+\theta_{deg}} \equiv \mathcal{A}_1$ , $\mathcal{A}^{(2)}_{-\theta_{deg}} \equiv \mathcal{A}_2$, $S_+ \equiv S_1$ and $S_- \equiv S_2$.


\section{Polarization only measurement}
Since experimentally we perform polarization sensitive but frequency insensitive measurements, it is convenient to work with the reduced state taking the trace over frequencies and space coordinates in $\ket{\Psi(+\theta_{\text{deg}},-\theta_{\text{deg}})} \bra{\Psi(+\theta_{\text{deg}},-\theta_{\text{deg}})}$:
\begin{equation}
\rho =
\alpha_1\ket{HV}\bra{HV}  
+\alpha_2 \ket{VH}\bra{VH} 
+\beta \ket{VH}\bra{HV} 
+\beta^*\ket{HV}\bra{VH} 
\end{equation}
with $\alpha_1 = \iiint \ud\omega_s \ud\omega_i \ud z \abs{\mathcal{A}_1 (\omega_s,\omega_i)S_1(z)}^2$,
$\alpha_2 = \iiint \ud\omega_s \ud\omega_i \ud z \abs{\mathcal{A}_2 (\omega_s,\omega_i)S_2(z)}^2$ and 
$\beta = \iiint \ud\omega_s \ud\omega_i \ud z \mathcal{A}_1 (\omega_s,\omega_i)\mathcal{A}_2^* (\omega_s,\omega_i)S_1(z)S_2^*(z)$


The reduced state can thus be represented as a $2\times 2$ density matrix in the $(\ket{HV},\ket{VH})$ basis. The two eigenvalues $\lambda_\pm$ are:
\begin{align}
  \label{eq:eigenvalues}
\lambda_{\pm} &= \frac{1}{2} \left[ \alpha_1 + \alpha_2 \pm \sqrt{(\alpha_1-\alpha_2)^2 +4\abs{\beta}^2}\right] \nonumber \\
&= \frac{1}{2} \left\{1 \pm \sqrt{1 + 4\left[\abs{\beta}^2 -\alpha_1(1-\alpha_1)\right]} \right\}
\end{align}
where the normalization condition $\alpha_1 + \alpha_2 = 1$ has been used. 
Using this expression, all relevant quantities such as purity and entanglement can be computed since they depend on the integrals $\alpha_1$ and $\abs{\beta}^2$. 


The density matrix $\rho$ is pure if and only if $Tr[\rho^2]=1$, that is $\lambda_-^2 + \lambda_+^2=1$. Using $\lambda_- + \lambda_+=1$, this is equivalent to $\lambda_-=0$, that is $\abs{\beta}^2 =\alpha_1(1-\alpha_1)$ (see Eq.~\eqref{eq:eigenvalues}) (note that $\abs{\beta}^2 \leq \frac{1}{4}$ since $\alpha_1 \leq 1$).
In that case $\lambda_+ = 1$ and the corresponding eigenvectors are~:
\begin{align}
\lambda_+ &= 1 \rightarrow \frac{1}{\sqrt{1-\alpha_1}}
\begin{pmatrix} 
\beta \\ 1-\alpha_1
\end{pmatrix} \\
\lambda_- &= 0 \rightarrow \frac{1}{\sqrt{\alpha_1}}
\begin{pmatrix} 
\beta \\ -\alpha_1
\end{pmatrix}
\end{align}
$\rho$ can thus be written as $\rho = \ket{\phi}\bra{\phi}$ with:
\begin{equation}
\ket{\phi} = \frac{1}{\sqrt{1-\alpha_1}}\left[\beta \ket{HV} +(1-\alpha_1) \ket{VH} \right].
\end{equation}
The pure state is maximally entangled in polarization if the two, orthogonal, contributions have an equal weight, that is $\abs{\beta}^2 = (1-\alpha_1)^2$ {\it i.e.} when $\alpha_1=\frac{1}{2} = \alpha_2$ and $\abs{\beta}^2 = \frac{1}{4}$. These conditions can be arranged by optimizing the pumping conditions: to obtain a maximally entangled state in polarization (which is necessarily pure) we  need to set up the two laser pumps such that there is perfect overlap between the joint spectral amplitudes of the generated pairs, as well as perfect spatial overlap between both pumping beams in the waveguide. 

The spectral overlap can be easily experimentally verified in our setup. However, ensuring the spatial overlap and perfect indistinguishability between the two different processes leading to photon pair generation is a more delicate task. This happens because the spatial transverse spatial profiles of the pumping beams are not the same, and thus cannot perfectly overlap. As a first approximation, we can consider that, after passing through the biprism, each pumping beam is a half gaussian. The point of maximum intensity of the two gaussians at the point they reach the sample is separated by a transverse ($z$) distance of $\delta z$. The spatial distribution of each beam can be modelized by the half-gaussian functions $S_1(z<0)=0$, $S_1(z>0)=\sqrt{\frac{2\sqrt{2}}{w_p \pi}}e^{-\frac{z^2}{w_p^2}}$ and $S_2(z>\delta z)=0$, $S_2(z<\delta z)=\sqrt{\frac{2\sqrt{2}}{w_p \pi}}e^{-\frac{(z-\delta z)^2}{w_p^2}}$. We see in Fig. 5 that, even in the case where the overlap between these two non-symmetric functions is maximized, we cannot reach $|\beta|=0.5$. 
\section{Concurrence and linear entropy}

We develop now our model to extract information about entanglement. Experimental measurements
of the photon countings for each interaction
 indicate that condition $\alpha_1=\alpha_2$ is satisfied. However, we can have $|\beta|^2 <1/4$ and consequently non-maximally polarization entangled states if both beams are not in perfect frequency degeneracy and/or if their spatial profiles in the waveguide do not overlap. It was experimentally verified (see main text) that the degeneracy condition is satisfied within our spectral resolution. However, the overlap between the two pumping beams spatial profiles is more difficult to quantify, since it requires a perfect knowledge of the propagation effect on the laser beam intensity distribution throughout the optical path. Fig. 3 of the main text indicates the dependence of $|\beta|$ on the distance between the central points of the  pumping beams in the $z$ axis. 

The concurrence ${\cal C}$ can be easily calculated, as a function of $|\beta|$,  using its definition:
\begin{equation}
{\cal C}={\rm max} \left \{0,\lambda_1-\lambda_2-\lambda_3-\lambda_4 \right \},
\end{equation}
where the $\lambda_i$ are the ordered eigenvalues of the matrix $R$, defined as:
\begin{equation}
R=\sqrt{\rho.\sigma_y\otimes\sigma_y \rho^T\sigma_y\otimes\sigma_y }.
\end{equation}
Using the model introduced in the previous section, we have that ${\cal C}=2|\beta|$ and thus the tangle ${\cal T}=4|\beta|^2$. The linear entropy $S_L=4/3(1-{\rm Tr}[\rho^2])$ can also be easily calculated in the conditions stated above. We have that $S_L=2/3(1-{\cal T})$ in this case. Notice that the value of $|\beta|$ quantities can be computed directly from a measurement of the experimental pumping beams profile. 
 This model illustrate the important role played by the spatial overlap of the pumping beams and provide us with a clear guideline for controlling the degree of entanglement in polarization. 

\end{document}
