we project $$\label{eq:gammatwophstate}
\vert\psi\rangle = \int_{-\infty}^{\infty}\int_{-\infty}^{\infty} d\omega_id\omega_s \Gamma(\omega_i, \omega_s)\hat{a}^{\dagger}_{i}(\omega_i)\hat{a}^{\dagger}_{s}(\omega_s)\vert0\rangle_i\vert0\rangle_s$$ into a discrete $d^2$-dimensional subspace spanned by orthonormal product states $\vert j \rangle_i \vert k\rangle_s$ with multi-mode states $\left\vert j\right\rangle_{i,s} \equiv\int_{-\infty}^{\infty}d\omega f^{i,s}_j\left(\omega\right)\hat{a}^{\dagger}_{i,s}(\omega)\left\vert 0\right\rangle_{i,s}$ and $j=0,\ldots,d-1$. The projected state then reads $$\label{eq:psidisc}
\vert\psi\rangle^{(d)} = \sum_{j=0}^{d-1}\sum_{k=0}^{d-1} c_{jk}\vert j \rangle_i \vert k\rangle_s$$ with coefficients $$c_{jk}=\int_{-\infty}^{\infty}\int_{-\infty}^{\infty}d\omega_{i}d\omega_{s}f_{j}^{i*}\left(\omega_{i}\right)f_{k}^{s*}\left(\omega_{s}\right)\Gamma\left(\omega_{i},\omega_{s}\right)$$ and the orthonormality condition $$\label{eq:orthonormality}
\int_{-\infty}^{\infty} d\omega f^{i,s \ast}_j(\omega)f^{i,s}_k(\omega)=\delta_{jk}.$$ Given (\[eq:psidisc\]), the probability to measure the direct product state $$\label{eq:chi}
\vert\chi\rangle=\left(\sum_{j=0}^{d-1}u^{i*}_j\vert j\rangle_i\right)\left(\sum_{k=0}^{d-1}u^{s*}_{k}\vert k\rangle_s\right)$$ reads $$\label{eq:projection}
S^{(d)}=\left\vert\langle\chi\vert\psi\rangle^{(d)}\right\vert^2=\left\vert\sum_{j,k=0}^{d-1}u^i_j u^s_k c_{jk}\right\vert^2.$$ If we decompose the transfer function of the SLM into the same basis, i.e. $$\label{eq:mslm}
M^{i,s}(\omega)=\sum_{j=0}^{d-1}u_j^{i,s}f_{j}^{i,s*}(\omega)=\sum_{j=0}^{d-1}|u_j^{i,s}|e^{i\phi_j^{i,s}}f_{j}^{i,s*}(\omega),$$ we obtain $S^{(d)}=S$ of (\[eq:signal\]). Therefore, the measured signal $S$ is given by the projection of the state $\vert\psi\rangle^{(d)}$ onto $\vert\chi\rangle$, and the SLM together with a SFG coincidence detection performs a projective measurement. Because $|u_j^{i,s}|$ and $\phi_j^{i,s}$ can be adjusted independently, any state $\vert\chi\rangle$ can be implemented provided the conditions in section \[manipulation\] are fulfilled.

Through a judicious choice of $f_{j}^{i,s}(\omega)$, various discretization schemes can be realized with the SLM using (\[eq:mslm\]). Here, we present three different basis functions $f_{j}^{i,s}(\omega)$ to encode qudits in the frequency domain.

### Frequency-bin basis

An intuitive method to discretize the frequency space is to subdivide the spectrum into 