This is a Python3 code repository implementing the FEAST algorithm for computing eigenvalues of operators.
A python class hierarchy of spectral projectors is provided as the main mechanism for experimentation with the algorithm.
The base class
Derived classes implement various spectral projector approximations. Finite element approximations of spectral projectors of partial differential operators are implemented using the python interface to the NGSolve package.
Clone this repository: Go to the code and look for the Atlassian's boilerplate clone button (which allows you to clone in SourceTree or using an HTTPS address).
Once you clone the repository, you will have a
pyeigfeastfolder somewhere in your system. Identify your local full path to the enclosing folder and call it
<path-to-pyeigfeast>, i.e., the full path of your
pyeigfeastfolder will be
Modify your PYTHONPATH variable so python3 can find the
To run examples with finite element approximations, it is necessary to have the NGSolve package installed. If it is correctly installed, then typing
from ngsolve import *within a python shell should not give any errors.
Navigate to the
scriptsfolder. If your
PYTHONPATHis set as above, you should be able to run any of these files.
The first example requires only the
scipydependency. To apply the FEAST algorithm to the matrix of a 1D Dirichlet problem, run this:
- The third example uses a DPG approximation of the spectral projector to approximate the Dirichlet eigenmodes on the unit square.
Open a jupyter notebook and follow along with this tutorial if you would like to see more details of the DPG spectral projector.