# sfepy.solvers.eigen module

class sfepy.solvers.eigen.LOBPCGEigenvalueSolver(conf, **kwargs)

  SciPy-based LOBPCG solver for sparse symmetric problems.

  > Kind: ‘eig.scipy_lobpcg’

  > For common configuration parameters, see `Solver`.

  > Specific configuration parameters:

  Parameters:
    i_max int (default: 20)

      The maximum number of iterations.

    eps_a float

      The absolute tolerance for the convergence.

    largest bool (default: True)

      If True, solve for the largest eigenvalues, otherwise the smallest.

    precond{dense matrix, sparse matrix, LinearOperator}

      The preconditioner.

  name = 'eig.scipy_lobpcg'

class sfepy.solvers.eigen.MatlabEigenvalueSolver(conf, comm=None, context=None, **kwargs)

  Matlab eigenvalue problem solver.

  > Kind: ‘eig.matlab’

  > For common configuration parameters, see `Solver`.

  > Specific configuration parameters:

  Parameters:
    method{‘eig’, ‘eigs’, None} (default: ‘eigs’)

      The solution method. Note that eig() function cannot be used for all inputs. If n_eigs is not None, eigs() is used regardless of this parameter.

    balance{‘balance’, ‘nobalance’} (default: ‘balance’)

      The balance option for eig().

    algorithm{‘chol’, ‘qz’} (default: ‘chol’)

      The algorithm option for eig().

    which{‘lm’, ‘sm’, ‘la’, ‘sa’, ‘be’ ‘lr’, ‘sr’, ‘li’, ‘si’, sigma} (default: ‘lm’)

      Which eigenvectors and eigenvalues to find with eigs().

    **

      Additional parameters supported by eigs().

  name = 'eig.matlab'
  solver_call(mtx_filename, eigs_filename, which=None)

class sfepy.solvers.eigen.OctaveEigenvalueSolver(conf, comm=None, context=None, **kwargs)

  Octave eigenvalue problem solver.

  > Kind: ‘eig.octave’

  > For common configuration parameters, see `Solver`.

  > Specific configuration parameters:

  Parameters:

  name = 'eig.octave'
  solver_call(mtx_filename, eigs_filename, which)

class sfepy.solvers.eigen.PrimmeEigenvalueSolver(conf, comm=None, context=None, **kwargs)

  PRIMME eigenvalue problem solver.

  https://github.com/primme/primme

  Installation: pip install primme

  > Kind: ‘eig.primme’

  > For common configuration parameters, see `Solver`.

  > Specific configuration parameters:

  Parameters:
    which{‘LM’, ‘SM’, ‘LA’, ‘SA’, ‘CLT’, ‘CGT’} (default: ‘LM’)

      Which eigenvectors and eigenvalues to find.

    sigma float

      Find eigenvalues near sigma.

    maxiter int

      Maximum number of iterations.

    tol float (default: 0)

      Tolerance for eigenpairs (stopping criterion).

    **

      Additional parameters supported by eigsh().

  name = 'eig.primme'

class sfepy.solvers.eigen.SLEPcEigenvalueSolver(conf, comm=None, context=None, **kwargs)

  General SLEPc eigenvalue problem solver.

  > Kind: ‘eig.slepc’

  > For common configuration parameters, see `Solver`.

  > Specific configuration parameters:

  Parameters:
    method str (default: ‘krylovschur’)

      The actual solver to use.

    problem str (default: ‘gnhep’)

      The problem type: Hermitian (hep), non-Hermitian (nhep), generalized Hermitian (ghep), generalized non-Hermitian (gnhep), generalized non-Hermitian with positive semi-definite B (pgnhep), and generalized Hermitian-indefinite (ghiep).

    i_max int (default: 20)

      The maximum number of iterations.

    eps float

      The convergence tolerance.

    conv_test{“abs”, “rel”, “norm”, “user”}, (default: ‘abs’)

      The type of convergence test.

    which{‘largest_magnitude’, ‘smallest_magnitude’,

      ‘largest_real’, ‘smallest_real’, ‘largest_imaginary’, ‘smallest_imaginary’, ‘target_magnitude’, ‘target_real’, ‘target_imaginary’, ‘all’, ‘which_user’} (default: ‘largest_magnitude’) Which eigenvectors and eigenvalues to find.

    **

      Additional parameters supported by the method.

  create_eps(options=None, comm=None)
  create_petsc_matrix(mtx, comm=None)
  name = 'eig.slepc'

class sfepy.solvers.eigen.ScipyEigenvalueSolver(conf, **kwargs)

  SciPy-based solver for both dense and sparse problems.

  The problem is consirered sparse if n_eigs argument is not None.

  > Kind: ‘eig.scipy’

  > For common configuration parameters, see `Solver`.

  > Specific configuration parameters:

  Parameters:
    method{‘eig’, ‘eigh’, ‘eigs’, ‘eigsh’} (default: ‘eigs’)

      The method for solving general or symmetric eigenvalue problems: for dense problems `eig()` or `eigh()` can be used, for sparse problems `eigs()` or `eigsh()` should be used.

    which‘LM’ | ‘SM’ | ‘LR’ | ‘SR’ | ‘LI’ | ‘SI’ (default: ‘SM’)

      Which eigenvectors and eigenvalues to find, see `scipy.sparse.linalg.eigs()` or `scipy.sparse.linalg.eigsh()`. For dense problmes, only ‘LM’ and ‘SM’ can be used

    linear_solver({‘ls.cholesky’, ‘ls.mumps’, …}, ls_conf)

      The method used to construct an inverse linear operator. If None, the eigenvalue solver will solve the linear system internally.

    **

      Additional parameters supported by the method.

  name = 'eig.scipy'

class sfepy.solvers.eigen.ScipySGEigenvalueSolver(conf, **kwargs)

  SciPy-based solver for dense symmetric problems.

  > Kind: ‘eig.sgscipy’

  > For common configuration parameters, see `Solver`.

  > Specific configuration parameters:

  Parameters:

  name = 'eig.sgscipy'

sfepy.solvers.eigen.eig(mtx_a, mtx_b=None, n_eigs=None, eigenvectors=True, return_time=None, solver_kind='eig.scipy', **ckwargs)

  Utility function that constructs an eigenvalue solver given by solver_kind, calls it and returns its output.

sfepy.solvers.eigen.init_slepc_args()

sfepy.solvers.eigen.standard_call(call)

  Decorator handling argument preparation and timing for eigensolvers.