pyNLO / PyNLO

Python package for nonlinear optics
https://pynlo.readthedocs.io/en/latest/
GNU General Public License v3.0
96 stars 52 forks source link

Added sinc pulse #23

Closed DanHickstein closed 8 years ago

DanHickstein commented 8 years ago

I added a sinc pulse child class. I tested it and it seems to work well.

I was having an issue with the “verify=True” failing in the SSFM, so I set this to False, which may not be the right thing to do.

I was using a fairly large (50 ps) temporal window (since the sinc takes so long to decay), and I think that there were some underflow errors in the values near the edges. Everything seems to work fine.

ycasg commented 8 years ago

I'll check the "verify" failure. This was added during the pyFFTW debugging, so in should be OK to disable or remove it. On the other hand, it is verifying that an fftshift function call does not alter the magnitude of the field array. This is probably nothing more than a (harmless) numerical underflow.

DanHickstein commented 8 years ago

If it is just an underflow causing there to be a tiny numerical difference between the two values, we could try using something like np.allclose() to check if they are the same within some relative and absolute tolerance.