Clone wiki

pyeigfeast / Home




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 SpectralProj has afeast method.

  • 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 pyeigfeast folder 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 pyeigfeast folder will be <path-to-pyeigfeast>/pyeigfeast.

  • Modify your PYTHONPATH variable so python3 can find the pyeigfeast module:

 export PYTHONPATH=$PYTHONPATH:<path-to-pyeigfeast>
  • Make sure scipy and matplotlib is installed.

  • 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 scripts folder. If your PYTHONPATH is set as above, you should be able to run any of these files.

  • The first example requires only the scipy dependency. 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.