This codebase contains the implementation of the DiracOperator class, which is used for applying the Dirac operator to spectral coefficients, computing eigenvalues and eigenfunctions, generating lattice structures, and transforming values between real and spectral spaces.
pseudospectralfolder contains all the source code of the project which are mainly.pyfiles broadly categorized into Dirac operator and Spectra python files.pseudospectral/spectrafolder contains spectrum class implementations.example_scriptsfolder for example script usage of theDiracOperator,Spectrumclasses, methods and a boiler-plate to begin with.testsfolder contains all the pytests written for the project.
.
├── pseudospectral
├── __init__.py
├── dirac_operator.py
└── spectra
├── derivative1D.py
└── fermion2D.py
├── pyproject.toml
├── README.md
├── tutorial.md
├── example_scripts
└── cosine_derivative.py
├── LICENSE
└── tests
├── conftest.py
├── test_real_basis.py
├── test_spectral_basis.py
├── test_transform.py
└── test_spectra.py
- git clone the repository -
git clone https://github.com/Mayank447/Pseudo-Spectral-Discretization.git - cd into the repository -
cd Pseudo-Spectral-Discretization - run
pip install .
- After setting up the package, you can import the classes and methods from
pseudospectralmodule in your code as follows:from pseudospectral import DiracOperator, FreeFermions2D - You may further refer to:
examplesfolder for example script usage of the DiracOperator, Spectrum classes, methods and a boilerplate to begin with.
- As opposed to standard best practices,
spectra should not use
self.eigenvaluesinternally butself._eigenvalues(or wherever the data is actually stored) becauseself.eigenvaluesis public interface which is overridden when applying another spectrum on top.