Wiki
Clone wikipyeigfeast / Home
PYTHONIC FEAST
What?
This is a Python3 code repository implementing the FEAST algorithm for computing eigenvalues of operators.
How?
-
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.
Install
Setup:
-
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 yourpyeigfeast
folder will be<path-to-pyeigfeast>/pyeigfeast
. -
Modify your PYTHONPATH variable so python3 can find the
pyeigfeast
module:
export PYTHONPATH=$PYTHONPATH:<path-to-pyeigfeast>
Dependencies:
-
Make sure
scipy
andmatplotlib
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.
Run
-
Navigate to the
scripts
folder. If yourPYTHONPATH
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:
python3 dirichlet1D.py
- The third example uses a DPG approximation of the spectral projector to approximate the Dirichlet eigenmodes on the unit square.
netgen dirichletDPG.py
Tutorial
Open a jupyter notebook and follow along with this tutorial if you would like to see more details of the DPG spectral projector.
Updated