# A Novel Optical-Based Methodology for Improving Nonlinear Fourier Transform
## 4 Validation of the NFT and INFT Algorithm Implementations  
To verify our algorithm implementation for both the direct and inverse nonlinear Fourier methods, we have run multiple tests on soliton pulses taken as the initial condition with a well-known analytically closed form solution. The initial condition of our simulation is the hyperbolic secant function shown also in Figure 1:  
\[u(t,0)=e^{it}sech(t) \tag{55}\]  
The difference between the analytical continuous scattering, \(a(\lambda)\), and the numerical one, \(\hat{a}(\lambda)\), is measured in terms of the normalized means squared errors (NMSEs), defined as:  
\[NMSE=\frac{\int_{-\infty}^{+\infty}\lvert a(\lambda)-\hat{a}(\lambda)\rvert^{2}d \lambda}{\int_{-\infty}^{+\infty}\lvert a(\lambda)\rvert^{2}d\lambda} \tag{58}\]  
We compare the numerical results obtained with the proposed modified algorithm similiar to [36] and theoretical one given in Equations (56) and (57), for different numbers of discrete points \(M\), as shown in Figure 4. We have assumed a truncated soliton pulse in the range \(t\in[-6,6]\), and a spectral parameter \(\lambda\in[-10,10]\). The NMSE is used to measure the differences for both scattering coefficients \(a(\lambda)\) and \(b(\lambda)\) in order to understand how much the numerical simulations will deviate from the analytical one as a function of \(M\). If \(M=128\), it means that \(u(t,0)\) is discretized in \(2*M+1=257\) points. The results are highly correlated to \(M\), as can be observed from Figure 4. If \(M\) will increase, the NMSE will also increase more and more between the numerical and theoretical results.  
For further verification of our numerical algorithm procedure for the calculation of scattering data, we have checked if the following condition is satisfied (which we know that it should be always true):  
\[\lvert a(\lambda)\rvert^{2}+\lvert b(\lambda)\rvert^{2}=1 \tag{59}\]  
For a fixed \(M=128\), we have obtained an error that is approximately \(10^{-10}\), that is: \(\lvert a(\lambda)\rvert^{2}+\lvert b(\lambda)\rvert^{2}-1\approx 10^{-10}\); consequently we can conclude that the proposed methodology has been well implemented and that it is working.  
To verify for \(F(t;0)\), we recall that \(u(t,0)\) can be found from (41) and (44), and assuming \(z=0\) and \(y=t\), we have that: \(-2K(t,0)=u(t)\) and \(K(t,t)+F^{*}(2t)-\int_{t}^{\infty}\)\(K(t,r)F(r+s)F^{*}(s+t)drds=0\). When \(u(t,0)\) is very small, we can assume that \(K\) and \(F\) are also small. It follows that the third addendum of Equation (44) can be negligible and we can consider: \(\lvert u(t,0)\rvert\approx 2\lvert F(2t,0)\rvert\).  
Assuming as an initial condition: \(u(t,0)=10^{-3}e^{-x^{2}}\), we can simply use the FFT to find out \(F(t)\), taking into account strictly following the algorithm shown in the section above. The domain of \(\lambda\) is selected based on the maximum value that we have observed from the ratio of \(b(\lambda)/a(\lambda)\), which is in the order of \(10^{-3}\), such that: \(\lvert b(\lambda)/a(\lambda)\rvert>10^{-6}\)\(\forall\lambda\in[\lambda_{\text{min}},\lambda_{\text{max}}]\). In addition, to verify the hypothesis according to which \(\lvert u(t,0)\rvert\approx 2\lvert F(2t,0)\rvert\) and knowing that the maximum of \(u(t,0)\) is \(10^{-3}\), we can assume that the domain of \(F(t)\) is the interval where \(F(t)>10^{-6}\). We are going to look for the number of points \(N\) on which to calculate \(b(\lambda)/a(\lambda)\) and \(F(t)\) based on the above observation.  
Figure 4: NMSEs of \(a(\lambda)\) and \(b(\lambda)\) for different values of \(M\).  
In Figure 5, we show the result of both functions \(|u(t,0)|\) and \(2|F(2t,0)|\) with \(N=128\), which looks very similar to each other. Selecting the right number of points \(N\) is very important, as the two functions will not look so similar to each other in the case where \(N\) is lower than 128.