Mayank447 / Pseudo-Spectral-Discretization

GNU General Public License v3.0
0 stars 1 forks source link

General tests for spectra #11

Closed chillenzer closed 1 month ago

chillenzer commented 1 month ago

This small PR provides some general tests for the spectra, namely orthonormality of the eigenfunctions (in real space), identity of back and forth transformation and unitarity of the transformation.

These are general properties that hold completely independent of the concrete spectrum at hand (as long as the spectrum's interface is implemented in a way to cope with the terse broadcasting syntax used). So they should be easily generalisable by adding more TEST_DATA.

I took the liberty to make the tests pass by adjusting the conventions in spectra/derivative_1D.py.

Mayank447 commented 1 month ago

None of the tests are passing. Also in some of the tests there is a mismatch in the number of lattice points and the boundary length

EDIT: All the tests are working (just some variable names mismatch). I have integrated this code in #9.

chillenzer commented 1 month ago

No, don't do this! This is a separate PR because it is concerned with an independent concern. We should not mix this up. Please remove the code from your PR again and add a proper review here.

Mayank447 commented 1 month ago

Cool, couple of minor changes in all files input_space -> input_basis output_space -> output_basis

Otherwise the tests are throwing an error

chillenzer commented 1 month ago

Closes #13.