EigSolver

class EigSolver(mat, **kwargs)[source]

Bases: object

Contains methods for setting up and solving for the boundary eigenvalues of a PETSc matrix.

Parameters:

mat (petsc4py.PETSc.Mat) – input matrix

Keyword Arguments:
 
  • esolver (str) – the eigensolver algorithm to use.

    • 'krylovschur' (default) - Krylov-Schur
    • 'arnoldi' - Arnoldi Method
    • 'lanczos' - Lanczos Method
    • 'power' - Power Iteration/Rayleigh Quotient Iteration
    • 'gd' - Generalized Davidson
    • 'jd' - Jacobi-Davidson,
    • 'lapack' - Uses LAPACK eigenvalue solver routines
    • 'arpack' - only available if SLEPc is compiled with ARPACK linking
  • workType (str) – can be used to set the eigensolver worktype (either 'ncv' or 'mpd'). The default is to let SLEPc decide.

  • workSize (int) – sets the work size if workType is set.

  • tolIn (float) – tolerance of the eigenvalue solver (default 0. (SLEPc decides)).

  • maxIt (int) – maximum number of iterations of the eigenvalue solver (default 0 (SLEPc decides)).

  • verbose (bool) – if True, writes eigensolver information to the console

  • emax_estimate (float) – used to override the calculation of the graphs maximum eigenvalue.

  • emin_estimate (float) – used to override the calculation of the graphs minimum eigenvalue. For a finite graph, emin_estimate=0 is set by default.

    Caution

    • If supplied, the value of emax_estimate (\(\hat{\lambda}_{\max}\)) must satisfy \(\hat{\lambda}_{\max}\geq\lambda_{\max}\), where \(\lambda_{\max}\) is the actual maximum eigenvalue of the graph.
    • Similarly, the value of emin_estimate (\(\hat{\lambda}_{\min}\)) must satisfy \(\hat{\lambda}_{\min}\leq\lambda_{\min}\), where \(\lambda_{\min}\) is the actual minimum eigenvalue of the graph.
    • The greater the difference value of \(|\hat{\lambda}_{\max} -\lambda_{\max}|\) and \(|\hat{\lambda}_{\min} -\lambda_{\min}|\), the longer the convergence time of the chebyshev propagator when simulating a CTQW.

    Note

Method Summary

EigSolver.findEmax() Returns the maximum Eigenvalue of the matrix, along with associated error.
EigSolver.findEmin() Returns the minimum Eigenvalue of the matrix, along with associated error.
EigSolver.getEigSolver(*args) Get some or all of the GraphISO properties.
EigSolver.setEigSolver(**kwargs) Set some or all of the eigenvalue solver properties.

Method Details

EigSolver.findEmax()[source]

Returns the maximum Eigenvalue of the matrix, along with associated error.

Example

>>> Emax, error = EigSolver.findEmax()

Fortran interface

This function calls the Fortran function min_max_eigs().

EigSolver.findEmin()[source]

Returns the minimum Eigenvalue of the matrix, along with associated error.

Example

>>> Emin, error = EigSolver.findEmin()

Fortran interface

This function calls the Fortran function min_max_eigs().

EigSolver.getEigSolver(*args)[source]

Get some or all of the GraphISO properties. For the list of the properties see setEigSolver().

EigSolver.setEigSolver(**kwargs)[source]

Set some or all of the eigenvalue solver properties.

Keyword Arguments:
 
  • esolver (str) – the eigensolver algorithm to use.
    • 'krylovschur' (default) - Krylov-Schur
    • 'arnoldi' - Arnoldi Method
    • 'lanczos' - Lanczos Method
    • 'power' - Power Iteration/Rayleigh Quotient Iteration
    • 'gd' - Generalized Davidson
    • 'jd' - Jacobi-Davidson,
    • 'lapack' - Uses LAPACK eigenvalue solver routines
    • 'arpack' - only available if SLEPc is compiled with ARPACK linking
  • workType (str) – can be used to set the eigensolver worktype (either 'ncv' or 'mpd'). The default is to let SLEPc decide.
  • workSize (int) – sets the work size if workType is set.
  • tolIn (float) – tolerance of the eigenvalue solver (default 0. (SLEPc decides)).
  • maxIt (int) – maximum number of iterations of the eigenvalue solver (default 0 (SLEPc decides)).
  • verbose (bool) – if True, writes eigensolver information to the console
  • emax_estimate (float) – used to override the calculation of the graphs maximum eigenvalue.

Caution

  • If supplied, the value of emax_estimate\(\hat{\lambda}_{\max}\) must satisfy \(\hat{\lambda}_{\max}\geq\lambda_{\max}\), where \(\lambda_{\max}\) is the actual maximum eigenvalue of the graph.
  • The greater the value of \(\hat{\lambda}_{\max} -\lambda_{\max}\), the longer the convergence time of the chebyshev propagator when simulating a CTQW.

Note