Scroll to navigation

SLEPC4PY(3) slepc4py SLEPC4PY(3)

NAME

slepc4py - SLEPc for Python

Lisandro Dalcin, Jose E. Roman
<dalcinl@gmail.com>, <jroman@dsic.upv.es>
<https://gitlab.com/slepc/slepc>
Nov 23, 2025

Abstract

This document describes slepc4py <https://gitlab.com/slepc/slepc>, a Python <https://www.python.org> port to the SLEPc <https://slepc.upv.es> libraries.

SLEPc <https://slepc.upv.es> is a software package for the parallel solution of large-scale eigenvalue problems. It can be used for computing eigenvalues and eigenvectors of large, sparse matrices, or matrix pairs, and also for computing singular values and vectors of a rectangular matrix.

SLEPc <https://slepc.upv.es> relies on PETSc <https://petsc.org> for basic functionality such as the representation of matrices and vectors, and the solution of linear systems of equations. Thus, slepc4py <https://gitlab.com/slepc/slepc> must be used together with its companion petsc4py <https://gitlab.com/petsc/petsc>.

CONTENTS

Overview

SLEPc for Python (slepc4py) is a Python package that provides convenient access to the functionality of SLEPc.

SLEPc [1], [2] implements algorithms and tools for the numerical solution of large, sparse eigenvalue problems on parallel computers. It can be used for linear eigenvalue problems in either standard or generalized form, with real or complex arithmetic. It can also be used for computing a partial SVD of a large, sparse, rectangular matrix, and to solve nonlinear eigenvalue problems (polynomial or general). Additionally, SLEPc provides solvers for the computation of the action of a matrix function on a vector.

SLEPc is intended for computing a subset of the spectrum of a matrix (or matrix pair). One can for instance approximate the largest magnitude eigenvalues, or the smallest ones, or even those eigenvalues located near a given region of the complex plane. Interior eigenvalues are harder to compute, so SLEPc provides different methodologies. One such method is to use a spectral transformation. Cheaper alternatives are also available.

[1]
J. E. Roman, C. Campos, L. Dalcin, E. Romero, A. Tomas. SLEPc Users Manual. DSIC-II/24/02 - Revision 3.24. D. Sistemas Informaticos y Computacion, Universitat Politecnica de Valencia. 2025.
[2]
Vicente Hernandez, Jose E. Roman and Vicente Vidal. SLEPc: A Scalable and Flexible Toolkit for the Solution of Eigenvalue Problems, ACM Trans. Math. Softw. 31(3), pp. 351-362, 2005.

Features

Currently, the following types of eigenproblems can be addressed:

  • Standard eigenvalue problem, Ax=kx, either for Hermitian or non-Hermitian matrices.
  • Generalized eigenvalue problem, Ax=kBx, either Hermitian positive-definite or not.
  • Partial singular value decomposition of a rectangular matrix, Au=sv.
  • Polynomial eigenvalue problem, P(k)x=0.
  • Nonlinear eigenvalue problem, T(k)x=0.
  • Computing the action of a matrix function on a vector, w=f(alpha A)v.

For the linear eigenvalue problem, the following methods are available:

  • Krylov eigensolvers, particularly Krylov-Schur, Arnoldi, and Lanczos.
  • Davidson-type eigensolvers, including Generalized Davidson and Jacobi-Davidson.
  • Subspace iteration and single vector iterations (inverse iteration, RQI).
  • Conjugate gradient for the minimization of the Rayleigh quotient.
  • A contour integral solver.

For singular value computations, the following alternatives can be used:

  • Use an eigensolver via the cross-product matrix A’A or the cyclic matrix [0 A; A’ 0].
  • Explicitly restarted Lanczos bidiagonalization.
  • Implicitly restarted Lanczos bidiagonalization (thick-restart Lanczos).

For polynomial eigenvalue problems, the following methods are available:

  • Use an eigensolver to solve the generalized eigenvalue problem obtained after linearization.
  • TOAR and Q-Arnoldi, memory efficient variants of Arnoldi for polynomial eigenproblems.

For general nonlinear eigenvalue problems, the following methods can be used:

  • Solve a polynomial eigenproblem obtained via polynomial interpolation.
  • Rational interpolation and linearization (NLEIGS).
  • Newton-type methods such as SLP or RII.

Computation of interior eigenvalues is supported by means of the following methodologies:

  • Spectral transformations, such as shift-and-invert. This technique implicitly uses the inverse of the shifted matrix (A-tI) in order to compute eigenvalues closest to a given target value, t.
  • Harmonic extraction, a cheap alternative to shift-and-invert that also tries to approximate eigenvalues closest to a target, t, but without requiring a matrix inversion.

Other remarkable features include:

  • High computational efficiency, by using NumPy and SLEPc under the hood.
  • Data-structure neutral implementation, by using efficient sparse matrix storage provided by PETSc. Implicit matrix representation is also available by providing basic operations such as matrix-vector products as user-defined Python functions.
  • Run-time flexibility, by specifying numerous setting at the command line.
  • Ability to do the computation in parallel.

Components

SLEPc provides the following components, which are mirrored by slepc4py for its use from Python. The first five components are solvers for different classes of problems, while the rest can be considered auxiliary object.

The Eigenvalue Problem Solver is the component that provides all the functionality necessary to define and solve an eigenproblem. It provides mechanisms for completely specifying the problem: the problem type (e.g. standard symmetric), number of eigenvalues to compute, part of the spectrum of interest. Once the problem has been defined, a collection of solvers can be used to compute the required solutions. The behavior of the solvers can be tuned by means of a few parameters, such as the maximum dimension of the subspace to be used during the computation.
This component is the analog of EPS for the case of Singular Value Decompositions. The user provides a rectangular matrix and specifies how many singular values and vectors are to be computed, whether the largest or smallest ones, as well as some other parameters for fine tuning the computation. Different solvers are available, as in the case of EPS.
This component is the analog of EPS for the case of Polynomial Eigenvalue Problems. The user provides the coefficient matrices of the polynomial. Several parameters can be specified, as in the case of EPS. It is also possible to indicate whether the problem belongs to a special type, e.g., symmetric or gyroscopic.
This component covers the case of general nonlinear eigenproblems, T(lambda)x=0. The user provides the parameter-dependent matrix T via the split form or by means of callback functions.
This component provides the functionality for computing the action of a matrix function on a vector. Given a matrix A and a vector b, the call MFNSolve(mfn,b,x) computes x=f(A)b, where f is a function such as the exponential.
This component provides the functionality for solving linear matrix equations such as Lyapunov or Sylvester where the solution has low rank.
The Spectral Transformation is a component that provides convenient implementations of common spectral transformations. These are simple transformations that map eigenvalues to different positions, in such a way that convergence to wanted eigenvalues is enhanced. The most common spectral transformation is shift-and-invert, that allows for the computation of eigenvalues closest to a given target value.
This component encapsulates the concept of a set of Basis Vectors spanning a vector space. This component provides convenient access to common operations such as orthogonalization of vectors. The BV component is usually not required by end-users.
The Dense System (or Direct Solver) component, used internally to solve dense eigenproblems of small size that appear in the course of iterative eigensolvers.
A component used to define mathematical functions. This is required by the end-user for instance to define function T(.) when solving nonlinear eigenproblems with NEP in split form.
A component used to define a region of the complex plane such as an ellipse or a rectangle. This is required by end-users in some cases such as contour-integral eigensolvers.

In addition to the above components, some extra functionality is provided in the :Sys: and :Util: sections.

Tutorial

This tutorial is intended for basic use of slepc4py. For more advanced use, the reader is referred to SLEPc tutorials as well as to slepc4py reference documentation.

Commented source of a simple example

In this section, we include the source code of example demo/ex1.py available in the slepc4py distribution, with comments inserted inline.

The first thing to do is initialize the libraries. This is normally not required, as it is done automatically at import time. However, if you want to gain access to the facilities for accessing command-line options, the following lines must be executed by the main script prior to any petsc4py or slepc4py calls:

import sys, slepc4py
slepc4py.init(sys.argv)


Next, we have to import the relevant modules. Normally, both PETSc and SLEPc modules have to be imported in all slepc4py programs. It may be useful to import NumPy as well:

from petsc4py import PETSc
from slepc4py import SLEPc
import numpy


At this point, we can use any petsc4py and slepc4py operations. For instance, the following lines allow the user to specify an integer command-line argument n with a default value of 30 (see the next section for example usage of command-line options):

opts = PETSc.Options()
n = opts.getInt('n', 30)


It is necessary to build a matrix to define an eigenproblem (or two in the case of generalized eigenproblems). The following fragment of code creates the matrix object and then fills the non-zero elements one by one. The matrix of this particular example is tridiagonal, with value 2 in the diagonal, and -1 in off-diagonal positions. See petsc4py documentation for details about matrix objects:

A = PETSc.Mat().create()
A.setSizes([n, n])
A.setFromOptions()
A.setUp()
rstart, rend = A.getOwnershipRange()
# first row
if rstart == 0:

A[0, :2] = [2, -1]
rstart += 1 # last row if rend == n:
A[n-1, -2:] = [-1, 2]
rend -= 1 # other rows for i in range(rstart, rend):
A[i, i-1:i+2] = [-1, 2, -1] A.assemble()


The solver object is created in a similar way as other objects in petsc4py:

E = SLEPc.EPS(); E.create()


Once the object is created, the eigenvalue problem must be specified. At least one matrix must be provided. The problem type must be indicated as well, in this case it is HEP (Hermitian eigenvalue problem). Apart from these, other settings could be provided here (for instance, the tolerance for the computation). After all options have been set, the user should call the setFromOptions() operation, so that any options specified at run time in the command line are passed to the solver object:

E.setOperators(A)
E.setProblemType(SLEPc.EPS.ProblemType.HEP)
E.setFromOptions()


After that, the solve() method will run the selected eigensolver, keeping the solution stored internally:

E.solve()


Once the computation has finished, we are ready to print the results. First, some informative data can be retrieved from the solver object:

Print = PETSc.Sys.Print
Print()
Print("******************************")
Print("*** SLEPc Solution Results ***")
Print("******************************")
Print()
its = E.getIterationNumber()
Print("Number of iterations of the method: %d" % its)
eps_type = E.getType()
Print("Solution method: %s" % eps_type)
nev, ncv, mpd = E.getDimensions()
Print("Number of requested eigenvalues: %d" % nev)
tol, maxit = E.getTolerances()
Print("Stopping condition: tol=%.4g, maxit=%d" % (tol, maxit))


For retrieving the solution, it is necessary to find out how many eigenpairs have converged to the requested precision:

nconv = E.getConverged()
Print("Number of converged eigenpairs %d" % nconv)


For each of the nconv eigenpairs, we can retrieve the eigenvalue k, and the eigenvector, which is represented by means of two petsc4py vectors vr and vi (the real and imaginary part of the eigenvector, since for real matrices the eigenvalue and eigenvector may be complex). We also compute the corresponding relative errors in order to make sure that the computed solution is indeed correct:

if nconv > 0:

# Create the results vectors
vr, wr = A.getVecs()
vi, wi = A.getVecs()
#
Print()
Print(" k ||Ax-kx||/||kx|| ")
Print("----------------- ------------------")
for i in range(nconv):
k = E.getEigenpair(i, vr, vi)
error = E.computeError(i)
if k.imag != 0.0:
Print(" %9f%+9f j %12g" % (k.real, k.imag, error))
else:
Print(" %12f %12g" % (k.real, error))
Print()


Example of command-line usage

Now we illustrate how to specify command-line options in order to extract the full potential of slepc4py.

A simple execution of the demo/ex1.py script will result in the following output:

$ python demo/ex1.py
******************************
*** SLEPc Solution Results ***
******************************
Number of iterations of the method: 4
Solution method: krylovschur
Number of requested eigenvalues: 1
Stopping condition: tol=1e-07, maxit=100
Number of converged eigenpairs 4

k ||Ax-kx||/||kx|| ----------------- ------------------
3.989739 5.76012e-09
3.959060 1.41957e-08
3.908279 6.74118e-08
3.837916 8.34269e-08


For specifying different setting for the solver parameters, we can use SLEPc command-line options with the -eps prefix. For instance, to change the number of requested eigenvalues and the tolerance:

$ python demo/ex1.py -eps_nev 10 -eps_tol 1e-11


The method used by the solver object can also be set at run time:

$ python demo/ex1.py -eps_type subspace


All the above settings can also be changed within the source code by making use of the appropriate slepc4py method. Since options can be set from within the code and the command-line, it is often useful to view the particular settings that are currently being used:

$ python demo/ex1.py -eps_view
EPS Object: 1 MPI process

type: krylovschur
50% of basis vectors kept after restart
using the locking variant
problem type: symmetric eigenvalue problem
selected portion of the spectrum: largest eigenvalues in magnitude
number of eigenvalues (nev): 1
number of column vectors (ncv): 16
maximum dimension of projected problem (mpd): 16
maximum number of iterations: 100
tolerance: 1e-08
convergence test: relative to the eigenvalue BV Object: 1 MPI process
type: mat
17 columns of global length 30
orthogonalization method: classical Gram-Schmidt
orthogonalization refinement: if needed (eta: 0.7071)
block orthogonalization method: GS
doing matmult as a single matrix-matrix product DS Object: 1 MPI process
type: hep
solving the problem with: Implicit QR method (_steqr) ST Object: 1 MPI process
type: shift
shift: 0
number of matrices: 1


Note that for computing eigenvalues of smallest magnitude we can use the option -eps_smallest_magnitude, but for interior eigenvalues things are not so straightforward. One possibility is to try with harmonic extraction, for instance to get the eigenvalues closest to 0.6:

$ python demo/ex1.py -eps_harmonic -eps_target 0.6


Depending on the problem, harmonic extraction may fail to converge. In those cases, it is necessary to specify a spectral transformation other than the default. In the command-line, this is indicated with the -st_ prefix. For example, shift-and-invert with a value of the shift equal to 0.6 would be:

$ python demo/ex1.py -st_type sinvert -eps_target 0.6


Installation

Using pip or easy_install

You can use pip to install slepc4py <#module-slepc4py> and its dependencies (mpi4py <https://mpi4py.readthedocs.io/en/stable/mpi4py.html#module-mpi4py> is optional but highly recommended):

$ pip install [--user] numpy mpi4py
$ pip install [--user] petsc petsc4py
$ pip install [--user] slepc slepc4py


Alternatively, you can use easy_install (deprecated):

$ easy_install [--user] slepc4py


If you already have working PETSc and SLEPc installs, set environment variables SLEPC_DIR and PETSC_DIR (and perhaps PETSC_ARCH for non-prefix installs) to appropriate values and next use pip:

$ export SLEPC_DIR=/path/to/slepc
$ export PETSC_DIR=/path/to/petsc
$ export PETSC_ARCH=arch-linux2-c-opt
$ pip install [--user] petsc4py slepc4py


Using distutils

Requirements

You need to have the following software properly installed in order to build SLEPc for Python:


[1]
Unless you have appropriately configured and built SLEPc and PETSc without MPI (configure option --with-mpi=0).
[2]
You may need to use a parallelized version of the Python interpreter with some MPI-1 implementations (e.g. MPICH1).

Downloading

The SLEPc for Python package is available for download at the Python Package Index. You can use curl or wget to get a release tarball.


Building

After unpacking the release tarball:

$ tar -zxf slepc4py-X.Y.tar.gz
$ cd slepc4py-X.Y


the distribution is ready for building.

Note:

Mac OS X users employing a Python distribution built with universal binaries may need to set the environment variables MACOSX_DEPLOYMENT_TARGET, SDKROOT, and ARCHFLAGS to appropriate values. As an example, assume your Mac is running Snow Leopard on a 64-bit Intel processor and you want to override the hard-wired cross-development SDK in Python configuration, your environment should be modified like this:

$ export MACOSX_DEPLOYMENT_TARGET=10.6
$ export SDKROOT=/
$ export ARCHFLAGS='-arch x86_64'




Some environment configuration is needed to inform the location of PETSc and SLEPc. You can set (using setenv, export or what applies to you shell or system) the environment variables SLEPC_DIR, PETSC_DIR, and PETSC_ARCH indicating where you have built/installed SLEPc and PETSc:

$ export SLEPC_DIR=/usr/local/slepc
$ export PETSC_DIR=/usr/local/petsc
$ export PETSC_ARCH=arch-linux2-c-opt


Alternatively, you can edit the file setup.cfg and provide the required information below the [config] section:

[config]
slepc_dir  = /usr/local/slepc
petsc_dir  = /usr/local/petsc
petsc_arch = arch-linux2-c-opt
...


Finally, you can build the distribution by typing:

$ python setup.py build


Installing

After building, the distribution is ready for installation.

If you have root privileges (either by log-in as the root user of by using sudo) and you want to install SLEPc for Python in your system for all users, just do:

$ python setup.py install


The previous steps will install the slepc4py <#module-slepc4py> package at standard location prefix/lib/pythonX.X/site-packages.

If you do not have root privileges or you want to install SLEPc for Python for your private use, just do:

$ python setup.py install --user


Citations

If SLEPc for Python been significant to a project that leads to an academic publication, please acknowledge that fact by citing the project.


Reference

slepc4py <#module-slepc4py> SLEPc for Python
slepc4py.typing <#module-slepc4py.typing> Typing support.
slepc4py.SLEPc <#module-slepc4py.SLEPc> Scalable Library for Eigenvalue Problem Computations

slepc4py

SLEPc for Python

This package is an interface to SLEPc <https://slepc.upv.es> libraries.

SLEPc <https://slepc.upv.es> (the Scalable Library for Eigenvalue Problem Computations) is a software library for the solution of large scale sparse eigenvalue problems on parallel computers. It is an extension of PETSc <https://petsc.org> and can be used for either standard or generalized eigenproblems, with real or complex arithmetic. It can also be used for computing a partial SVD of a large, sparse, rectangular matrix.

Functions

get_config <#slepc4py.get_config>()
get_include <#slepc4py.get_include>() Return the directory in the package that contains header files.
init <#slepc4py.init>([args, arch]) Initialize SLEPc.

slepc4py.get_config


slepc4py.get_include

Return the directory in the package that contains header files.

Extension modules that need to compile against slepc4py should use this function to locate the appropriate include directory. Using Python distutils (or perhaps NumPy distutils):

import petscc4py, slepc4py
Extension('extension_name', ...

include_dirs=[...,
petsc4py.get_include(),
slepc4py.get_include(),])




slepc4py.init

Initialize SLEPc.

Note:

This function should be called only once, typically at the very beginning of the bootstrap script of an application.



slepc4py.typing

Typing support.

Attributes

Scalar <#slepc4py.typing.Scalar> Scalar type.
ArrayInt <#slepc4py.typing.ArrayInt> Array of int <https://docs.python.org/3/library/functions.html#int>.
ArrayReal <#slepc4py.typing.ArrayReal> Array of float <https://docs.python.org/3/library/functions.html#float>.
ArrayComplex <#slepc4py.typing.ArrayComplex> Array of complex <https://docs.python.org/3/library/functions.html#complex>.
ArrayScalar <#slepc4py.typing.ArrayScalar> Array of Scalar <#slepc4py.typing.Scalar> numbers.
LayoutSizeSpec <#slepc4py.typing.LayoutSizeSpec> int <https://docs.python.org/3/library/functions.html#int> or 2-tuple <https://docs.python.org/3/library/stdtypes.html#tuple> of int <https://docs.python.org/3/library/functions.html#int> describing the layout sizes.
EPSStoppingFunction <#slepc4py.typing.EPSStoppingFunction> EPS <#slepc4py.SLEPc.EPS> stopping test callback.
EPSArbitraryFunction <#slepc4py.typing.EPSArbitraryFunction> EPS <#slepc4py.SLEPc.EPS> arbitrary selection callback.
EPSEigenvalueComparison <#slepc4py.typing.EPSEigenvalueComparison> EPS <#slepc4py.SLEPc.EPS> eigenvalue comparison callback.
EPSMonitorFunction <#slepc4py.typing.EPSMonitorFunction> EPS <#slepc4py.SLEPc.EPS> monitor callback.
PEPStoppingFunction <#slepc4py.typing.PEPStoppingFunction> PEP <#slepc4py.SLEPc.PEP> stopping test callback.
PEPMonitorFunction <#slepc4py.typing.PEPMonitorFunction> PEP <#slepc4py.SLEPc.PEP> monitor callback.
NEPStoppingFunction <#slepc4py.typing.NEPStoppingFunction> NEP <#slepc4py.SLEPc.NEP> stopping test callback.
NEPMonitorFunction <#slepc4py.typing.NEPMonitorFunction> NEP <#slepc4py.SLEPc.NEP> monitor callback.
NEPFunction <#slepc4py.typing.NEPFunction> NEP <#slepc4py.SLEPc.NEP> Function callback.
NEPJacobian <#slepc4py.typing.NEPJacobian> NEP <#slepc4py.SLEPc.NEP> Jacobian callback.
SVDStoppingFunction <#slepc4py.typing.SVDStoppingFunction> SVD <#slepc4py.SLEPc.SVD> stopping test callback.
SVDMonitorFunction <#slepc4py.typing.SVDMonitorFunction> SVD <#slepc4py.SLEPc.SVD> monitor callback.
MFNMonitorFunction <#slepc4py.typing.MFNMonitorFunction> MFN <#slepc4py.SLEPc.MFN> monitor callback.
LMEMonitorFunction <#slepc4py.typing.LMEMonitorFunction> LME <#slepc4py.SLEPc.LME> monitor callback.

slepc4py.typing.Scalar

slepc4py.typing.Scalar = float | complex
Scalar type.

Scalars can be either float <https://docs.python.org/3/library/functions.html#float> or complex <https://docs.python.org/3/library/functions.html#complex> (but not both) depending on how PETSc was configured (./configure --with-scalar-type=real|complex).


slepc4py.typing.ArrayInt


slepc4py.typing.ArrayReal


slepc4py.typing.ArrayComplex


slepc4py.typing.ArrayScalar


slepc4py.typing.LayoutSizeSpec

slepc4py.typing.LayoutSizeSpec = int | tuple[int, int]
int <https://docs.python.org/3/library/functions.html#int> or 2-tuple <https://docs.python.org/3/library/stdtypes.html#tuple> of int <https://docs.python.org/3/library/functions.html#int> describing the layout sizes.

A single int <https://docs.python.org/3/library/functions.html#int> indicates global size. A tuple <https://docs.python.org/3/library/stdtypes.html#tuple> of int <https://docs.python.org/3/library/functions.html#int> indicates (local_size, global_size).


slepc4py.typing.EPSStoppingFunction


slepc4py.typing.EPSArbitraryFunction


slepc4py.typing.EPSEigenvalueComparison


slepc4py.typing.EPSMonitorFunction

EPS <#slepc4py.SLEPc.EPS> monitor callback.

alias of Callable <https://docs.python.org/3/library/typing.html#typing.Callable>[[EPS <#slepc4py.SLEPc.EPS>, int <https://docs.python.org/3/library/functions.html#int>, int <https://docs.python.org/3/library/functions.html#int>, ndarray <https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html#numpy.ndarray>[tuple <https://docs.python.org/3/library/stdtypes.html#tuple>[Any <https://docs.python.org/3/library/typing.html#typing.Any>, …], dtype <https://numpy.org/doc/stable/reference/generated/numpy.dtype.html#numpy.dtype>[float <https://docs.python.org/3/library/functions.html#float> | complex <https://docs.python.org/3/library/functions.html#complex>]], ndarray <https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html#numpy.ndarray>[tuple <https://docs.python.org/3/library/stdtypes.html#tuple>[Any <https://docs.python.org/3/library/typing.html#typing.Any>, …], dtype <https://numpy.org/doc/stable/reference/generated/numpy.dtype.html#numpy.dtype>[float <https://docs.python.org/3/library/functions.html#float> | complex <https://docs.python.org/3/library/functions.html#complex>]], ndarray <https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html#numpy.ndarray>[tuple <https://docs.python.org/3/library/stdtypes.html#tuple>[Any <https://docs.python.org/3/library/typing.html#typing.Any>, …], dtype <https://numpy.org/doc/stable/reference/generated/numpy.dtype.html#numpy.dtype>[float <https://docs.python.org/3/library/functions.html#float>]], int <https://docs.python.org/3/library/functions.html#int>], None <https://docs.python.org/3/library/constants.html#None>]


slepc4py.typing.PEPStoppingFunction


slepc4py.typing.PEPMonitorFunction

PEP <#slepc4py.SLEPc.PEP> monitor callback.

alias of Callable <https://docs.python.org/3/library/typing.html#typing.Callable>[[PEP <#slepc4py.SLEPc.PEP>, int <https://docs.python.org/3/library/functions.html#int>, int <https://docs.python.org/3/library/functions.html#int>, ndarray <https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html#numpy.ndarray>[tuple <https://docs.python.org/3/library/stdtypes.html#tuple>[Any <https://docs.python.org/3/library/typing.html#typing.Any>, …], dtype <https://numpy.org/doc/stable/reference/generated/numpy.dtype.html#numpy.dtype>[float <https://docs.python.org/3/library/functions.html#float> | complex <https://docs.python.org/3/library/functions.html#complex>]], ndarray <https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html#numpy.ndarray>[tuple <https://docs.python.org/3/library/stdtypes.html#tuple>[Any <https://docs.python.org/3/library/typing.html#typing.Any>, …], dtype <https://numpy.org/doc/stable/reference/generated/numpy.dtype.html#numpy.dtype>[float <https://docs.python.org/3/library/functions.html#float> | complex <https://docs.python.org/3/library/functions.html#complex>]], ndarray <https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html#numpy.ndarray>[tuple <https://docs.python.org/3/library/stdtypes.html#tuple>[Any <https://docs.python.org/3/library/typing.html#typing.Any>, …], dtype <https://numpy.org/doc/stable/reference/generated/numpy.dtype.html#numpy.dtype>[float <https://docs.python.org/3/library/functions.html#float>]], int <https://docs.python.org/3/library/functions.html#int>], None <https://docs.python.org/3/library/constants.html#None>]


slepc4py.typing.NEPStoppingFunction


slepc4py.typing.NEPMonitorFunction

NEP <#slepc4py.SLEPc.NEP> monitor callback.

alias of Callable <https://docs.python.org/3/library/typing.html#typing.Callable>[[NEP <#slepc4py.SLEPc.NEP>, int <https://docs.python.org/3/library/functions.html#int>, int <https://docs.python.org/3/library/functions.html#int>, ndarray <https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html#numpy.ndarray>[tuple <https://docs.python.org/3/library/stdtypes.html#tuple>[Any <https://docs.python.org/3/library/typing.html#typing.Any>, …], dtype <https://numpy.org/doc/stable/reference/generated/numpy.dtype.html#numpy.dtype>[float <https://docs.python.org/3/library/functions.html#float> | complex <https://docs.python.org/3/library/functions.html#complex>]], ndarray <https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html#numpy.ndarray>[tuple <https://docs.python.org/3/library/stdtypes.html#tuple>[Any <https://docs.python.org/3/library/typing.html#typing.Any>, …], dtype <https://numpy.org/doc/stable/reference/generated/numpy.dtype.html#numpy.dtype>[float <https://docs.python.org/3/library/functions.html#float> | complex <https://docs.python.org/3/library/functions.html#complex>]], ndarray <https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html#numpy.ndarray>[tuple <https://docs.python.org/3/library/stdtypes.html#tuple>[Any <https://docs.python.org/3/library/typing.html#typing.Any>, …], dtype <https://numpy.org/doc/stable/reference/generated/numpy.dtype.html#numpy.dtype>[float <https://docs.python.org/3/library/functions.html#float>]], int <https://docs.python.org/3/library/functions.html#int>], None <https://docs.python.org/3/library/constants.html#None>]


slepc4py.typing.NEPFunction


slepc4py.typing.NEPJacobian


slepc4py.typing.SVDStoppingFunction


slepc4py.typing.SVDMonitorFunction


slepc4py.typing.MFNMonitorFunction


slepc4py.typing.LMEMonitorFunction


slepc4py.SLEPc

Scalable Library for Eigenvalue Problem Computations

Classes

BV <#slepc4py.SLEPc.BV> BV.
BVSVDMethod <#slepc4py.SLEPc.BVSVDMethod> BV methods for computing the SVD.
DS <#slepc4py.SLEPc.DS> DS.
EPS <#slepc4py.SLEPc.EPS> EPS.
EPSKrylovSchurBSEType <#slepc4py.SLEPc.EPSKrylovSchurBSEType> EPS Krylov-Schur method for BSE problems.
FN <#slepc4py.SLEPc.FN> FN.
LME <#slepc4py.SLEPc.LME> LME.
MFN <#slepc4py.SLEPc.MFN> MFN.
NEP <#slepc4py.SLEPc.NEP> NEP.
PEP <#slepc4py.SLEPc.PEP> PEP.
RG <#slepc4py.SLEPc.RG> RG.
ST <#slepc4py.SLEPc.ST> ST.
STFilterDamping <#slepc4py.SLEPc.STFilterDamping> ST filter damping.
STFilterType <#slepc4py.SLEPc.STFilterType> ST filter type.
SVD <#slepc4py.SLEPc.SVD> SVD.
Sys <#slepc4py.SLEPc.Sys> Sys.
Util <#slepc4py.SLEPc.Util> Util.

slepc4py.SLEPc.BV

Bases: Object <https://petsc.org/release/petsc4py/reference/petsc4py.PETSc.Object.html#petsc4py.PETSc.Object>

BV.

Enumerations

MatMultType <#slepc4py.SLEPc.BV.MatMultType> BV mat-mult types.
OrthogBlockType <#slepc4py.SLEPc.BV.OrthogBlockType> BV block-orthogonalization types.
OrthogRefineType <#slepc4py.SLEPc.BV.OrthogRefineType> BV orthogonalization refinement types.
OrthogType <#slepc4py.SLEPc.BV.OrthogType> BV orthogonalization types.
Type <#slepc4py.SLEPc.BV.Type> BV type.

slepc4py.SLEPc.BV.MatMultType

Bases: object <https://docs.python.org/3/library/functions.html#object>

BV mat-mult types.

  • VECS: Perform a matrix-vector multiply per each column.
  • MAT: Carry out a Mat-Mat product with a dense matrix.

Attributes Summary

MAT Constant MAT of type int <https://docs.python.org/3/library/functions.html#int>
VECS Constant VECS of type int <https://docs.python.org/3/library/functions.html#int>

Attributes Documentation




slepc4py.SLEPc.BV.OrthogBlockType

Bases: object <https://docs.python.org/3/library/functions.html#object>

BV block-orthogonalization types.

  • GS: Gram-Schmidt.
  • CHOL: Cholesky.
  • TSQR: Tall-skinny QR.
  • TSQRCHOL: Tall-skinny QR with Cholesky.
  • SVQB: SVQB.

Attributes Summary

CHOL Constant CHOL of type int <https://docs.python.org/3/library/functions.html#int>
GS Constant GS of type int <https://docs.python.org/3/library/functions.html#int>
SVQB Constant SVQB of type int <https://docs.python.org/3/library/functions.html#int>
TSQR Constant TSQR of type int <https://docs.python.org/3/library/functions.html#int>
TSQRCHOL Constant TSQRCHOL of type int <https://docs.python.org/3/library/functions.html#int>

Attributes Documentation







slepc4py.SLEPc.BV.OrthogRefineType

Bases: object <https://docs.python.org/3/library/functions.html#object>

BV orthogonalization refinement types.

  • IFNEEDED: Reorthogonalize if a criterion is satisfied.
  • NEVER: Never reorthogonalize.
  • ALWAYS: Always reorthogonalize.

Attributes Summary

ALWAYS Constant ALWAYS of type int <https://docs.python.org/3/library/functions.html#int>
IFNEEDED Constant IFNEEDED of type int <https://docs.python.org/3/library/functions.html#int>
NEVER Constant NEVER of type int <https://docs.python.org/3/library/functions.html#int>

Attributes Documentation





slepc4py.SLEPc.BV.OrthogType

Bases: object <https://docs.python.org/3/library/functions.html#object>

BV orthogonalization types.

  • CGS: Classical Gram-Schmidt.
  • MGS: Modified Gram-Schmidt.

Attributes Summary

CGS Constant CGS of type int <https://docs.python.org/3/library/functions.html#int>
MGS Constant MGS of type int <https://docs.python.org/3/library/functions.html#int>

Attributes Documentation




slepc4py.SLEPc.BV.Type


Methods Summary

appendOptionsPrefix([prefix]) Append to the prefix used for searching for all BV options in the database.
applyMatrix(x, y) Multiply a vector with the matrix associated to the bilinear form.
copy([result]) Copy a basis vector object into another one.
copyColumn(j, i) Copy the values from one of the columns to another one.
copyVec(j, v) Copy one of the columns of a basis vectors object into a Vec.
create([comm]) Create the BV object.
createFromMat(A) Create a basis vectors object from a dense Mat object.
createMat() Create a new Mat object of dense type and copy the contents of the BV.
createVec() Create a Vec with the type and dimensions of the columns of the BV.
destroy() Destroy the BV object.
dot(Y) Compute the 'block-dot' product of two basis vectors objects.
dotColumn(j) Dot products of a column against all the column vectors of a BV.
dotVec(v) Dot products of a vector against all the column vectors of the BV.
duplicate() Duplicate the BV object with the same type and dimensions.
duplicateResize(m) Create a BV object of the same type and dimensions as an existing one.
getActiveColumns() Get the current active dimensions.
getColumn(j) Get a Vec object with the entries of the column of the BV object.
getDefiniteTolerance() Get the tolerance to be used when checking a definite inner product.
getLeadingDimension() Get the leading dimension.
getMat() Get a Mat object of dense type that shares the memory of the BV object.
getMatMultMethod() Get the method used for the matMult() operation.
getMatrix() Get the matrix representation of the inner product.
getNumConstraints() Get the number of constraints.
getOptionsPrefix() Get the prefix used for searching for all BV options in the database.
getOrthogonalization() Get the orthogonalization settings from the BV object.
getRandomContext() Get the petsc4py.PETSc.Random <https://petsc.org/release/petsc4py/reference/petsc4py.PETSc.Random.html#petsc4py.PETSc.Random> object associated with the BV.
getSizes() Get the local and global sizes, and the number of columns.
getType() Get the BV type of this object.
getVecType() Get the vector type used by the basis vectors object.
insertConstraints(C) Insert a set of vectors as constraints.
insertVec(j, w) Insert a vector into the specified column.
insertVecs(s, W[, orth]) Insert a set of vectors into specified columns.
matMult(A[, Y]) Compute the matrix-vector product for each column, Y = A V.
matMultColumn(A, j) Mat-vec product for a column, storing the result in the next column.
matMultHermitianTranspose(A[, Y]) Pre-multiplication with the conjugate transpose of a matrix.
matMultHermitianTransposeColumn(A, j) Conjugate-transpose matrix-vector product for a specified column.
matMultTransposeColumn(A, j) Transpose matrix-vector product for a specified column.
matProject(A, Y) Compute the projection of a matrix onto a subspace.
mult(alpha, beta, X, Q) Compute Y = beta Y + alpha X Q.
multColumn(alpha, beta, j, q) Compute y = beta y + alpha X q.
multInPlace(Q, s, e) Update a set of vectors as V(:,s:e-1) = V Q(:,s:e-1).
multVec(alpha, beta, y, q) Compute y = beta y + alpha X q.
norm([norm_type]) Compute the matrix norm of the BV.
normColumn(j[, norm_type]) Compute the vector norm of a selected column.
orthogonalize([R]) Orthogonalize all columns (except leading ones) (QR decomposition).
orthogonalizeColumn(j) Orthogonalize a column vector with respect to the previous ones.
orthogonalizeVec(v) Orthogonalize a vector with respect to a set of vectors.
orthonormalizeColumn(j[, replace]) Orthonormalize a column vector with respect to the previous ones.
resize(m[, copy]) Change the number of columns.
restoreColumn(j, v) Restore a column obtained with getColumn().
restoreMat(A) Restore the Mat obtained with getMat().
scale(alpha) Multiply the entries by a scalar value.
scaleColumn(j, alpha) Scale column j by alpha.
setActiveColumns(l, k) Set the columns that will be involved in operations.
setDefiniteTolerance(deftol) Set the tolerance to be used when checking a definite inner product.
setFromOptions() Set BV options from the options database.
setLeadingDimension(ld) Set the leading dimension.
setMatMultMethod(method) Set the method used for the matMult() operation.
setMatrix(mat[, indef]) Set the bilinear form to be used for inner products.
setNumConstraints(nc) Set the number of constraints.
setOptionsPrefix([prefix]) Set the prefix used for searching for all BV options in the database.
setOrthogonalization([otype, refine, eta, block]) Set the method used for the (block-)orthogonalization of vectors.
setRandom() Set the active columns of the BV to random numbers.
setRandomColumn(j) Set one column of the BV to random numbers.
setRandomCond(condn) Set the columns of a BV to random numbers.
setRandomContext(rnd) Set the petsc4py.PETSc.Random <https://petsc.org/release/petsc4py/reference/petsc4py.PETSc.Random.html#petsc4py.PETSc.Random> object associated with the BV.
setRandomNormal() Set the active columns of the BV to normal random numbers.
setRandomSign() Set the entries of a BV to values 1 or -1 with equal probability.
setSizes(sizes, m) Set the local and global sizes, and the number of columns.
setSizesFromVec(w, m) Set the local and global sizes, and the number of columns.
setType(bv_type) Set the type for the BV object.
setVecType(vec_type) Set the vector type.
view([viewer]) Print the BV data structure.

Attributes Summary

column_size Basis vectors column size.
local_size Basis vectors local size.
size Basis vectors global size.
sizes Basis vectors local and global sizes, and the number of columns.

Methods Documentation

Append to the prefix used for searching for all BV options in the database.

Logically collective.


:sources:`Source code at slepc4py/SLEPc/BV.pyx:413 <slepc4py/SLEPc/BV.pyx#L413>`


Multiply a vector with the matrix associated to the bilinear form.

Neighbor-wise collective.


Notes

If the bilinear form has no associated matrix this function copies the vector.

:sources:`Source code at slepc4py/SLEPc/BV.pyx:605 <slepc4py/SLEPc/BV.pyx#L605>`


Copy a basis vector object into another one.

Logically collective.

result (BV <#slepc4py.SLEPc.BV> | None <https://docs.python.org/3/library/constants.html#None>) – The copy.
BV <#slepc4py.SLEPc.BV>

:sources:`Source code at slepc4py/SLEPc/BV.pyx:255 <slepc4py/SLEPc/BV.pyx#L255>`


Copy the values from one of the columns to another one.

Logically collective.


:sources:`Source code at slepc4py/SLEPc/BV.pyx:866 <slepc4py/SLEPc/BV.pyx#L866>`


Copy one of the columns of a basis vectors object into a Vec.

Logically collective.


:sources:`Source code at slepc4py/SLEPc/BV.pyx:850 <slepc4py/SLEPc/BV.pyx#L850>`


Create the BV object.

Collective.


:sources:`Source code at slepc4py/SLEPc/BV.pyx:175 <slepc4py/SLEPc/BV.pyx#L175>`


Create a basis vectors object from a dense Mat object.

Collective.


:sources:`Source code at slepc4py/SLEPc/BV.pyx:193 <slepc4py/SLEPc/BV.pyx#L193>`


Create a new Mat object of dense type and copy the contents of the BV.

Collective.


:sources:`Source code at slepc4py/SLEPc/BV.pyx:209 <slepc4py/SLEPc/BV.pyx#L209>`


Create a Vec with the type and dimensions of the columns of the BV.

Collective.


:sources:`Source code at slepc4py/SLEPc/BV.pyx:810 <slepc4py/SLEPc/BV.pyx#L810>`


Destroy the BV object.

Collective.

:sources:`Source code at slepc4py/SLEPc/BV.pyx:165 <slepc4py/SLEPc/BV.pyx#L165>`



Compute the ‘block-dot’ product of two basis vectors objects.

Collective.

M = Y^H X (m_{ij} = y_i^H x_j) or M = Y^H B X

Y (BV <#slepc4py.SLEPc.BV>) – Left basis vectors, can be the same as self, giving M = X^H X.
The resulting matrix.
petsc4py.PETSc.Mat <https://petsc.org/release/petsc4py/reference/petsc4py.PETSc.Mat.html#petsc4py.PETSc.Mat>

Notes

This is the generalization of VecDot() for a collection of vectors, M = Y^H X. The result is a matrix M whose entry m_{ij} is equal to y_i^H x_j (where y_i^H denotes the conjugate transpose of y_i).

X and Y can be the same object.

If a non-standard inner product has been specified with setMatrix(), then the result is M = Y^H B X. In this case, both X and Y must have the same associated matrix.

Only rows (resp. columns) of M starting from ly (resp. lx) are computed, where ly (resp. lx) is the number of leading columns of Y (resp. X).

:sources:`Source code at slepc4py/SLEPc/BV.pyx:1064 <slepc4py/SLEPc/BV.pyx#L1064>`


Dot products of a column against all the column vectors of a BV.

Collective.

j (int <https://docs.python.org/3/library/functions.html#int>) – The index of the column.
The computed values.
ArrayScalar <#slepc4py.typing.ArrayScalar>

:sources:`Source code at slepc4py/SLEPc/BV.pyx:948 <slepc4py/SLEPc/BV.pyx#L948>`


Dot products of a vector against all the column vectors of the BV.

Collective.

v (Vec <https://petsc.org/release/petsc4py/reference/petsc4py.PETSc.Vec.html#petsc4py.PETSc.Vec>) – A vector.
The computed values.
ArrayScalar <#slepc4py.typing.ArrayScalar>

Notes

This is analogue to VecMDot(), but using BV to represent a collection of vectors. The result is m = X^H y, so m_i is equal to x_j^H y. Note that here X is transposed as opposed to BVDot().

If a non-standard inner product has been specified with BVSetMatrix(), then the result is m = X^H B y.

:sources:`Source code at slepc4py/SLEPc/BV.pyx:912 <slepc4py/SLEPc/BV.pyx#L912>`


Duplicate the BV object with the same type and dimensions.

Collective.

:sources:`Source code at slepc4py/SLEPc/BV.pyx:224 <slepc4py/SLEPc/BV.pyx#L224>`

BV <#slepc4py.SLEPc.BV>


Create a BV object of the same type and dimensions as an existing one.

Collective.

m (int <https://docs.python.org/3/library/functions.html#int>) – The number of columns.
BV <#slepc4py.SLEPc.BV>

Notes

With possibly different number of columns.

:sources:`Source code at slepc4py/SLEPc/BV.pyx:234 <slepc4py/SLEPc/BV.pyx#L234>`


Get the current active dimensions.

Not collective.


:sources:`Source code at slepc4py/SLEPc/BV.pyx:642 <slepc4py/SLEPc/BV.pyx#L642>`


Get a Vec object with the entries of the column of the BV object.

Logically collective.

j (int <https://docs.python.org/3/library/functions.html#int>) – The index of the requested column.
The vector containing the jth column.
petsc4py.PETSc.Vec <https://petsc.org/release/petsc4py/reference/petsc4py.PETSc.Vec.html#petsc4py.PETSc.Vec>

Notes

Modifying the returned Vec will change the BV entries as well.

:sources:`Source code at slepc4py/SLEPc/BV.pyx:975 <slepc4py/SLEPc/BV.pyx#L975>`


Get the tolerance to be used when checking a definite inner product.

Not collective.


:sources:`Source code at slepc4py/SLEPc/BV.pyx:897 <slepc4py/SLEPc/BV.pyx#L897>`


Get the leading dimension.

Not collective.


:sources:`Source code at slepc4py/SLEPc/BV.pyx:377 <slepc4py/SLEPc/BV.pyx#L377>`


Get a Mat object of dense type that shares the memory of the BV object.

Collective.


Notes

The returned matrix contains only the active columns. If the content of the Mat is modified, these changes are also done in the BV object. The user must call restoreMat() when no longer needed.

:sources:`Source code at slepc4py/SLEPc/BV.pyx:1022 <slepc4py/SLEPc/BV.pyx#L1022>`


Get the method used for the matMult() operation.

Not collective.

The method for the matMult() operation.
MatMultType <#slepc4py.SLEPc.BV.MatMultType>

:sources:`Source code at slepc4py/SLEPc/BV.pyx:535 <slepc4py/SLEPc/BV.pyx#L535>`



Get the number of constraints.

Not collective.


:sources:`Source code at slepc4py/SLEPc/BV.pyx:795 <slepc4py/SLEPc/BV.pyx#L795>`


Get the prefix used for searching for all BV options in the database.

Not collective.

The prefix string set for this BV object.
str <https://docs.python.org/3/library/stdtypes.html#str>

:sources:`Source code at slepc4py/SLEPc/BV.pyx:428 <slepc4py/SLEPc/BV.pyx#L428>`


Get the orthogonalization settings from the BV object.

Not collective.

  • type (OrthogType <#slepc4py.SLEPc.BV.OrthogType>) – The type of orthogonalization technique.
  • refine (OrthogRefineType <#slepc4py.SLEPc.BV.OrthogRefineType>) – The type of refinement.
  • eta (float <https://docs.python.org/3/library/functions.html#float>) – Parameter for selective refinement (used when the refinement type is BV.OrthogRefineType.IFNEEDED <#slepc4py.SLEPc.BV.OrthogRefineType.IFNEEDED>).
  • block (OrthogBlockType <#slepc4py.SLEPc.BV.OrthogBlockType>) – The type of block orthogonalization .

tuple <https://docs.python.org/3/library/stdtypes.html#tuple>[OrthogType <#slepc4py.SLEPc.BV.OrthogType>, OrthogRefineType <#slepc4py.SLEPc.BV.OrthogRefineType>, float <https://docs.python.org/3/library/functions.html#float>, OrthogBlockType <#slepc4py.SLEPc.BV.OrthogBlockType>]

:sources:`Source code at slepc4py/SLEPc/BV.pyx:458 <slepc4py/SLEPc/BV.pyx#L458>`


Get the petsc4py.PETSc.Random <https://petsc.org/release/petsc4py/reference/petsc4py.PETSc.Random.html#petsc4py.PETSc.Random> object associated with the BV.

Collective.


:sources:`Source code at slepc4py/SLEPc/BV.pyx:1554 <slepc4py/SLEPc/BV.pyx#L1554>`


Get the local and global sizes, and the number of columns.

Not collective.


:sources:`Source code at slepc4py/SLEPc/BV.pyx:346 <slepc4py/SLEPc/BV.pyx#L346>`


Get the BV type of this object.

Not collective.

The inner product type currently being used.
str <https://docs.python.org/3/library/stdtypes.html#str>

:sources:`Source code at slepc4py/SLEPc/BV.pyx:288 <slepc4py/SLEPc/BV.pyx#L288>`


Get the vector type used by the basis vectors object.

Not collective.

:sources:`Source code at slepc4py/SLEPc/BV.pyx:840 <slepc4py/SLEPc/BV.pyx#L840>`



Insert a set of vectors as constraints.

Collective.


Notes

The constraints are relevant only during orthogonalization. Constraint vectors span a subspace that is deflated in every orthogonalization operation, so they are intended for removing those directions from the orthogonal basis computed in regular BV columns.

:sources:`Source code at slepc4py/SLEPc/BV.pyx:749 <slepc4py/SLEPc/BV.pyx#L749>`


Insert a vector into the specified column.

Logically collective.


:sources:`Source code at slepc4py/SLEPc/BV.pyx:694 <slepc4py/SLEPc/BV.pyx#L694>`


Insert a set of vectors into specified columns.

Collective.


Notes

Copies the contents of vectors W into self(:,s:s+n), where n is the length of W. If orthogonalization flag is set then the vectors are copied one by one then orthogonalized against the previous one. If any are linearly dependent then it is discared and the value of m is decreased.

:sources:`Source code at slepc4py/SLEPc/BV.pyx:710 <slepc4py/SLEPc/BV.pyx#L710>`


Compute the matrix-vector product for each column, Y = A V.

Neighbor-wise collective.


Notes

Only active columns (excluding the leading ones) are processed.

It is possible to choose whether the computation is done column by column or using dense matrices using the options database keys:

-bv_matmult_vecs -bv_matmult_mat


The default is bv_matmult_mat.

:sources:`Source code at slepc4py/SLEPc/BV.pyx:1139 <slepc4py/SLEPc/BV.pyx#L1139>`


Mat-vec product for a column, storing the result in the next column.

Neighbor-wise collective.

v_{j+1} = A v_j.


:sources:`Source code at slepc4py/SLEPc/BV.pyx:1234 <slepc4py/SLEPc/BV.pyx#L1234>`


Pre-multiplication with the conjugate transpose of a matrix.

Neighbor-wise collective.

Y = A^H V.


Notes

Only active columns (excluding the leading ones) are processed.

As opoosed to matMult(), this operation is always done by column by column, with a sequence of calls to MatMultHermitianTranspose().

:sources:`Source code at slepc4py/SLEPc/BV.pyx:1188 <slepc4py/SLEPc/BV.pyx#L1188>`


Conjugate-transpose matrix-vector product for a specified column.

Neighbor-wise collective.

Store the result in the next column: v_{j+1} = A^H v_j.


:sources:`Source code at slepc4py/SLEPc/BV.pyx:1270 <slepc4py/SLEPc/BV.pyx#L1270>`


Transpose matrix-vector product for a specified column.

Neighbor-wise collective.

Store the result in the next column: v_{j+1} = A^T v_j.


:sources:`Source code at slepc4py/SLEPc/BV.pyx:1252 <slepc4py/SLEPc/BV.pyx#L1252>`


Compute the projection of a matrix onto a subspace.

Collective.

M = Y^H A X


Projection of the matrix A onto the subspace.
petsc4py.PETSc.Mat <https://petsc.org/release/petsc4py/reference/petsc4py.PETSc.Mat.html#petsc4py.PETSc.Mat>

:sources:`Source code at slepc4py/SLEPc/BV.pyx:1109 <slepc4py/SLEPc/BV.pyx#L1109>`


Compute Y = beta Y + alpha X Q.

Logically collective.


None <https://docs.python.org/3/library/constants.html#None>

:sources:`Source code at slepc4py/SLEPc/BV.pyx:1288 <slepc4py/SLEPc/BV.pyx#L1288>`


Compute y = beta y + alpha X q.

Logically collective.

Compute y = beta y + alpha X q, where y is the j^{th} column.


None <https://docs.python.org/3/library/constants.html#None>

:sources:`Source code at slepc4py/SLEPc/BV.pyx:1329 <slepc4py/SLEPc/BV.pyx#L1329>`


Update a set of vectors as V(:,s:e-1) = V Q(:,s:e-1).

Logically collective.


:sources:`Source code at slepc4py/SLEPc/BV.pyx:1310 <slepc4py/SLEPc/BV.pyx#L1310>`


Compute y = beta y + alpha X q.

Logically collective.


None <https://docs.python.org/3/library/constants.html#None>

:sources:`Source code at slepc4py/SLEPc/BV.pyx:1360 <slepc4py/SLEPc/BV.pyx#L1360>`


Compute the matrix norm of the BV.

Collective.


Notes

All active columns (except the leading ones) are considered as a matrix. The allowed norms are NORM_1, NORM_FROBENIUS, and NORM_INFINITY.

This operation fails if a non-standard inner product has been specified with BVSetMatrix().

:sources:`Source code at slepc4py/SLEPc/BV.pyx:1420 <slepc4py/SLEPc/BV.pyx#L1420>`


Compute the vector norm of a selected column.

Collective.


Notes

The norm of V_j is computed (NORM_1, NORM_2, or NORM_INFINITY).

If a non-standard inner product has been specified with BVSetMatrix(), then the returned value is \sqrt{V_j^H B V_j}, where B is the inner product matrix (argument ‘type’ is ignored).

:sources:`Source code at slepc4py/SLEPc/BV.pyx:1387 <slepc4py/SLEPc/BV.pyx#L1387>`


Orthogonalize all columns (except leading ones) (QR decomposition).

Collective.


Notes

The output satisfies V_0 = V R (where V_0 represent the input V) and V' V = I.

:sources:`Source code at slepc4py/SLEPc/BV.pyx:1668 <slepc4py/SLEPc/BV.pyx#L1668>`


Orthogonalize a column vector with respect to the previous ones.

Collective.

j (int <https://docs.python.org/3/library/functions.html#int>) – Index of the column to be orthogonalized.

tuple <https://docs.python.org/3/library/stdtypes.html#tuple>[float <https://docs.python.org/3/library/functions.html#float>, bool <https://docs.python.org/3/library/functions.html#bool>]

Notes

This function applies an orthogonal projector to project vector V_j onto the orthogonal complement of the span of the columns V[0..j-1], where V[.] are the vectors of the BV. The columns V[0..j-1] are assumed to be mutually orthonormal.

This routine does not normalize the resulting vector.

:sources:`Source code at slepc4py/SLEPc/BV.pyx:1602 <slepc4py/SLEPc/BV.pyx#L1602>`


Orthogonalize a vector with respect to a set of vectors.

Collective.


Notes

This function applies an orthogonal projector to project vector v onto the orthogonal complement of the span of the columns of the BV.

This routine does not normalize the resulting vector.

:sources:`Source code at slepc4py/SLEPc/BV.pyx:1570 <slepc4py/SLEPc/BV.pyx#L1570>`


Orthonormalize a column vector with respect to the previous ones.

Collective.

This is equivalent to a call to orthogonalizeColumn() followed by a call to scaleColumn() with the reciprocal of the norm.



tuple <https://docs.python.org/3/library/stdtypes.html#tuple>[float <https://docs.python.org/3/library/functions.html#float>, bool <https://docs.python.org/3/library/functions.html#bool>]

:sources:`Source code at slepc4py/SLEPc/BV.pyx:1636 <slepc4py/SLEPc/BV.pyx#L1636>`


Change the number of columns.

Collective.


None <https://docs.python.org/3/library/constants.html#None>

Notes

Internal storage is reallocated. If copy is True, then the contents are copied to the leading part of the new space.

:sources:`Source code at slepc4py/SLEPc/BV.pyx:1451 <slepc4py/SLEPc/BV.pyx#L1451>`


Restore a column obtained with getColumn().

Logically collective.


Notes

The arguments must match the corresponding call to getColumn().

:sources:`Source code at slepc4py/SLEPc/BV.pyx:1001 <slepc4py/SLEPc/BV.pyx#L1001>`


Restore the Mat obtained with getMat().

Logically collective.


Notes

A call to this function must match a previous call of getMat(). The effect is that the contents of the Mat are copied back to the BV internal data structures.

:sources:`Source code at slepc4py/SLEPc/BV.pyx:1044 <slepc4py/SLEPc/BV.pyx#L1044>`


Multiply the entries by a scalar value.

Logically collective.

alpha (Scalar <#slepc4py.typing.Scalar>) – scaling factor.
None <https://docs.python.org/3/library/constants.html#None>

Notes

All active columns (except the leading ones) are scaled.

:sources:`Source code at slepc4py/SLEPc/BV.pyx:676 <slepc4py/SLEPc/BV.pyx#L676>`


Scale column j by alpha.

Logically collective.


None <https://docs.python.org/3/library/constants.html#None>

:sources:`Source code at slepc4py/SLEPc/BV.pyx:659 <slepc4py/SLEPc/BV.pyx#L659>`


Set the columns that will be involved in operations.

Logically collective.


:sources:`Source code at slepc4py/SLEPc/BV.pyx:625 <slepc4py/SLEPc/BV.pyx#L625>`


Set the tolerance to be used when checking a definite inner product.

Logically collective.


:sources:`Source code at slepc4py/SLEPc/BV.pyx:883 <slepc4py/SLEPc/BV.pyx#L883>`


Set BV options from the options database.

Collective.

Notes

To see all options, run your program with the -help option.

:sources:`Source code at slepc4py/SLEPc/BV.pyx:443 <slepc4py/SLEPc/BV.pyx#L443>`



Set the leading dimension.

Not collective.


:sources:`Source code at slepc4py/SLEPc/BV.pyx:363 <slepc4py/SLEPc/BV.pyx#L363>`


Set the method used for the matMult() operation.

Logically collective.

method (MatMultType <#slepc4py.SLEPc.BV.MatMultType>) – The method for the matMult() operation.
None <https://docs.python.org/3/library/constants.html#None>

:sources:`Source code at slepc4py/SLEPc/BV.pyx:550 <slepc4py/SLEPc/BV.pyx#L550>`


Set the bilinear form to be used for inner products.

Collective.


:sources:`Source code at slepc4py/SLEPc/BV.pyx:588 <slepc4py/SLEPc/BV.pyx#L588>`


Set the number of constraints.

Logically collective.


:sources:`Source code at slepc4py/SLEPc/BV.pyx:781 <slepc4py/SLEPc/BV.pyx#L781>`


Set the prefix used for searching for all BV options in the database.

Logically collective.


Notes

A hyphen (-) must NOT be given at the beginning of the prefix name. The first character of all runtime options is AUTOMATICALLY the hyphen.

:sources:`Source code at slepc4py/SLEPc/BV.pyx:392 <slepc4py/SLEPc/BV.pyx#L392>`


Set the method used for the (block-)orthogonalization of vectors.

Logically collective.

Ortogonalization of vectors (classical or modified Gram-Schmidt with or without refinement), and for the block-orthogonalization (simultaneous orthogonalization of a set of vectors).


None <https://docs.python.org/3/library/constants.html#None>

Notes

The default settings work well for most problems.

The parameter eta should be a real value between 0 and 1 (or DETERMINE <#slepc4py.SLEPc.DETERMINE>). The value of eta is used only when the refinement type is BV.OrthogRefineType.IFNEEDED <#slepc4py.SLEPc.BV.OrthogRefineType.IFNEEDED>.

When using several processors, BV.OrthogType.MGS <#slepc4py.SLEPc.BV.OrthogType.MGS> is likely to result in bad scalability.

If the method set for block orthogonalization is GS, then the computation is done column by column with the vector orthogonalization.

:sources:`Source code at slepc4py/SLEPc/BV.pyx:483 <slepc4py/SLEPc/BV.pyx#L483>`


Set the active columns of the BV to random numbers.

Logically collective.

Notes

All active columns (except the leading ones) are modified.

:sources:`Source code at slepc4py/SLEPc/BV.pyx:1473 <slepc4py/SLEPc/BV.pyx#L1473>`



Set one column of the BV to random numbers.

Logically collective.


:sources:`Source code at slepc4py/SLEPc/BV.pyx:1509 <slepc4py/SLEPc/BV.pyx#L1509>`


Set the columns of a BV to random numbers.

Logically collective.

The generated matrix has a prescribed condition number.


:sources:`Source code at slepc4py/SLEPc/BV.pyx:1523 <slepc4py/SLEPc/BV.pyx#L1523>`


Set the petsc4py.PETSc.Random <https://petsc.org/release/petsc4py/reference/petsc4py.PETSc.Random.html#petsc4py.PETSc.Random> object associated with the BV.

Collective.

To be used in operations that need random numbers.


:sources:`Source code at slepc4py/SLEPc/BV.pyx:1539 <slepc4py/SLEPc/BV.pyx#L1539>`


Set the active columns of the BV to normal random numbers.

Logically collective.

Notes

All active columns (except the leading ones) are modified.

:sources:`Source code at slepc4py/SLEPc/BV.pyx:1485 <slepc4py/SLEPc/BV.pyx#L1485>`



Set the entries of a BV to values 1 or -1 with equal probability.

Logically collective.

Notes

All active columns (except the leading ones) are modified.

:sources:`Source code at slepc4py/SLEPc/BV.pyx:1497 <slepc4py/SLEPc/BV.pyx#L1497>`



Set the local and global sizes, and the number of columns.

Collective.


None <https://docs.python.org/3/library/constants.html#None>

Notes

Either n or N (but not both) can be PETSc.DECIDE or None to have it automatically set.

:sources:`Source code at slepc4py/SLEPc/BV.pyx:303 <slepc4py/SLEPc/BV.pyx#L303>`


Set the local and global sizes, and the number of columns.

Collective.

Local and global sizes are specified indirectly by passing a template vector.


:sources:`Source code at slepc4py/SLEPc/BV.pyx:327 <slepc4py/SLEPc/BV.pyx#L327>`


Set the type for the BV object.

Logically collective.

bv_type (Type <#slepc4py.SLEPc.BV.Type> | str <https://docs.python.org/3/library/stdtypes.html#str>) – The inner product type to be used.
None <https://docs.python.org/3/library/constants.html#None>

:sources:`Source code at slepc4py/SLEPc/BV.pyx:273 <slepc4py/SLEPc/BV.pyx#L273>`


Set the vector type.

Collective.


:sources:`Source code at slepc4py/SLEPc/BV.pyx:825 <slepc4py/SLEPc/BV.pyx#L825>`


Print the BV data structure.

Collective.


:sources:`Source code at slepc4py/SLEPc/BV.pyx:150 <slepc4py/SLEPc/BV.pyx#L150>`


Attributes Documentation

Basis vectors column size.

:sources:`Source code at slepc4py/SLEPc/BV.pyx:1705 <slepc4py/SLEPc/BV.pyx#L1705>`


Basis vectors local size.

:sources:`Source code at slepc4py/SLEPc/BV.pyx:1700 <slepc4py/SLEPc/BV.pyx#L1700>`


Basis vectors global size.

:sources:`Source code at slepc4py/SLEPc/BV.pyx:1695 <slepc4py/SLEPc/BV.pyx#L1695>`


Basis vectors local and global sizes, and the number of columns.

:sources:`Source code at slepc4py/SLEPc/BV.pyx:1690 <slepc4py/SLEPc/BV.pyx#L1690>`




slepc4py.SLEPc.BVSVDMethod


slepc4py.SLEPc.DS

Bases: Object <https://petsc.org/release/petsc4py/reference/petsc4py.PETSc.Object.html#petsc4py.PETSc.Object>

DS.

Enumerations

MatType <#slepc4py.SLEPc.DS.MatType> To refer to one of the matrices stored internally in DS.
ParallelType <#slepc4py.SLEPc.DS.ParallelType> DS parallel types.
StateType <#slepc4py.SLEPc.DS.StateType> DS state types.
Type <#slepc4py.SLEPc.DS.Type> DS type.

slepc4py.SLEPc.DS.MatType

Bases: object <https://docs.python.org/3/library/functions.html#object>

To refer to one of the matrices stored internally in DS.

  • A: first matrix of eigenproblem/singular value problem.
  • B: second matrix of a generalized eigenproblem.
  • C: third matrix of a quadratic eigenproblem.
  • T: tridiagonal matrix.
  • D: diagonal matrix.
  • Q: orthogonal matrix of (right) Schur vectors.
  • Z: orthogonal matrix of left Schur vectors.
  • X: right eigenvectors.
  • Y: left eigenvectors.
  • U: left singular vectors.
  • V: right singular vectors.
  • W: workspace matrix.

Attributes Summary

A Constant A of type int <https://docs.python.org/3/library/functions.html#int>
B Constant B of type int <https://docs.python.org/3/library/functions.html#int>
C Constant C of type int <https://docs.python.org/3/library/functions.html#int>
D Constant D of type int <https://docs.python.org/3/library/functions.html#int>
Q Constant Q of type int <https://docs.python.org/3/library/functions.html#int>
T Constant T of type int <https://docs.python.org/3/library/functions.html#int>
U Constant U of type int <https://docs.python.org/3/library/functions.html#int>
V Constant V of type int <https://docs.python.org/3/library/functions.html#int>
W Constant W of type int <https://docs.python.org/3/library/functions.html#int>
X Constant X of type int <https://docs.python.org/3/library/functions.html#int>
Y Constant Y of type int <https://docs.python.org/3/library/functions.html#int>
Z Constant Z of type int <https://docs.python.org/3/library/functions.html#int>

Attributes Documentation














slepc4py.SLEPc.DS.ParallelType

Bases: object <https://docs.python.org/3/library/functions.html#object>

DS parallel types.

  • REDUNDANT: Every process performs the computation redundantly.
  • SYNCHRONIZED: The first process sends the result to the rest.


Attributes Summary

DISTRIBUTED Constant DISTRIBUTED of type int <https://docs.python.org/3/library/functions.html#int>
REDUNDANT Constant REDUNDANT of type int <https://docs.python.org/3/library/functions.html#int>
SYNCHRONIZED Constant SYNCHRONIZED of type int <https://docs.python.org/3/library/functions.html#int>

Attributes Documentation





slepc4py.SLEPc.DS.StateType

Bases: object <https://docs.python.org/3/library/functions.html#object>

DS state types.

  • RAW: Not processed yet.
  • INTERMEDIATE: Reduced to Hessenberg or tridiagonal form (or equivalent).
  • CONDENSED: Reduced to Schur or diagonal form (or equivalent).
  • TRUNCATED: Condensed form truncated to a smaller size.

Attributes Summary

CONDENSED Constant CONDENSED of type int <https://docs.python.org/3/library/functions.html#int>
INTERMEDIATE Constant INTERMEDIATE of type int <https://docs.python.org/3/library/functions.html#int>
RAW Constant RAW of type int <https://docs.python.org/3/library/functions.html#int>
TRUNCATED Constant TRUNCATED of type int <https://docs.python.org/3/library/functions.html#int>

Attributes Documentation






slepc4py.SLEPc.DS.Type

Bases: object <https://docs.python.org/3/library/functions.html#object>

DS type.

Attributes Summary

GHEP Object GHEP of type str <https://docs.python.org/3/library/stdtypes.html#str>
GHIEP Object GHIEP of type str <https://docs.python.org/3/library/stdtypes.html#str>
GNHEP Object GNHEP of type str <https://docs.python.org/3/library/stdtypes.html#str>
GSVD Object GSVD of type str <https://docs.python.org/3/library/stdtypes.html#str>
HEP Object HEP of type str <https://docs.python.org/3/library/stdtypes.html#str>
HSVD Object HSVD of type str <https://docs.python.org/3/library/stdtypes.html#str>
NEP Object NEP of type str <https://docs.python.org/3/library/stdtypes.html#str>
NHEP Object NHEP of type str <https://docs.python.org/3/library/stdtypes.html#str>
NHEPTS Object NHEPTS of type str <https://docs.python.org/3/library/stdtypes.html#str>
PEP Object PEP of type str <https://docs.python.org/3/library/stdtypes.html#str>
SVD Object SVD of type str <https://docs.python.org/3/library/stdtypes.html#str>

Attributes Documentation













Methods Summary

allocate(ld) Allocate memory for internal storage or matrices in DS.
appendOptionsPrefix([prefix]) Append to the prefix used for searching for all DS options in the database.
cond() Compute the inf-norm condition number of the first matrix.
create([comm]) Create the DS object.
destroy() Destroy the DS object.
duplicate() Duplicate the DS object with the same type and dimensions.
getBlockSize() Get the block size.
getCompact() Get the compact storage flag.
getDimensions() Get the current dimensions.
getExtraRow() Get the extra row flag.
getGSVDDimensions() Get the number of columns and rows of a DS of type GSVD <#slepc4py.SLEPc.DS.Type.GSVD>.
getHSVDDimensions() Get the number of columns of a DS of type HSVD <#slepc4py.SLEPc.DS.Type.HSVD>.
getLeadingDimension() Get the leading dimension of the allocated matrices.
getMat(matname) Get the requested matrix as a sequential dense Mat object.
getMethod() Get the method currently used in the DS.
getOptionsPrefix() Get the prefix used for searching for all DS options in the database.
getPEPCoefficients() Get the polynomial basis coefficients of a DS of type PEP <#slepc4py.SLEPc.PEP>.
getPEPDegree() Get the polynomial degree of a DS of type PEP <#slepc4py.SLEPc.PEP>.
getParallel() Get the mode of operation in parallel runs.
getRefined() Get the refined vectors flag.
getSVDDimensions() Get the number of columns of a DS of type SVD <#slepc4py.SLEPc.SVD>.
getState() Get the current state.
getType() Get the DS type of this object.
reset() Reset the DS object.
restoreMat(matname, mat) Restore the previously seized matrix.
setBlockSize(bs) Set the block size.
setCompact(comp) Set the matrices' compact storage flag.
setDimensions([n, l, k]) Set the matrices sizes in the DS object.
setExtraRow(ext) Set a flag to indicate that the matrix has one extra row.
setFromOptions() Set DS options from the options database.
setGSVDDimensions(m, p) Set the number of columns and rows of a DS of type GSVD <#slepc4py.SLEPc.DS.Type.GSVD>.
setHSVDDimensions(m) Set the number of columns of a DS of type HSVD <#slepc4py.SLEPc.DS.Type.HSVD>.
setIdentity(matname) Set the identity on the active part of a matrix.
setMethod(meth) Set the method to be used to solve the problem.
setOptionsPrefix([prefix]) Set the prefix used for searching for all DS options in the database.
setPEPCoefficients(pbc) Set the polynomial basis coefficients of a DS of type PEP <#slepc4py.SLEPc.PEP>.
setPEPDegree(deg) Set the polynomial degree of a DS of type PEP <#slepc4py.SLEPc.PEP>.
setParallel(pmode) Set the mode of operation in parallel runs.
setRefined(ref) Set a flag to indicate that refined vectors must be computed.
setSVDDimensions(m) Set the number of columns of a DS of type SVD <#slepc4py.SLEPc.SVD>.
setState(state) Set the state of the DS object.
setType(ds_type) Set the type for the DS object.
solve() Solve the problem.
truncate(n[, trim]) Truncate the system represented in the DS object.
updateExtraRow() Ensure that the extra row gets up-to-date after a call to DS.solve().
vectors([matname]) Compute vectors associated to the dense system such as eigenvectors.
view([viewer]) Print the DS data structure.

Attributes Summary

block_size The block size.
compact Compact storage of matrices.
extra_row If the matrix has one extra row.
method The method to be used to solve the problem.
parallel The mode of operation in parallel runs.
refined If refined vectors must be computed.
state The state of the DS object.

Methods Documentation

Allocate memory for internal storage or matrices in DS.

Logically collective.

ld (int <https://docs.python.org/3/library/functions.html#int>) – Leading dimension (maximum allowed dimension for the matrices, including the extra row if present).
None <https://docs.python.org/3/library/constants.html#None>

:sources:`Source code at slepc4py/SLEPc/DS.pyx:245 <slepc4py/SLEPc/DS.pyx#L245>`


Append to the prefix used for searching for all DS options in the database.

Logically collective.


:sources:`Source code at slepc4py/SLEPc/DS.pyx:190 <slepc4py/SLEPc/DS.pyx#L190>`


Compute the inf-norm condition number of the first matrix.

Logically collective.


:sources:`Source code at slepc4py/SLEPc/DS.pyx:654 <slepc4py/SLEPc/DS.pyx#L654>`


Create the DS object.

Collective.


:sources:`Source code at slepc4py/SLEPc/DS.pyx:122 <slepc4py/SLEPc/DS.pyx#L122>`


Destroy the DS object.

Collective.

:sources:`Source code at slepc4py/SLEPc/DS.pyx:104 <slepc4py/SLEPc/DS.pyx#L104>`



Duplicate the DS object with the same type and dimensions.

Collective.

:sources:`Source code at slepc4py/SLEPc/DS.pyx:233 <slepc4py/SLEPc/DS.pyx#L233>`

DS <#slepc4py.SLEPc.DS>


Get the block size.

Not collective.


:sources:`Source code at slepc4py/SLEPc/DS.pyx:409 <slepc4py/SLEPc/DS.pyx#L409>`


Get the compact storage flag.

Not collective.


:sources:`Source code at slepc4py/SLEPc/DS.pyx:477 <slepc4py/SLEPc/DS.pyx#L477>`


Get the current dimensions.

Not collective.


:sources:`Source code at slepc4py/SLEPc/DS.pyx:371 <slepc4py/SLEPc/DS.pyx#L371>`


Get the extra row flag.

Not collective.


:sources:`Source code at slepc4py/SLEPc/DS.pyx:516 <slepc4py/SLEPc/DS.pyx#L516>`


Get the number of columns and rows of a DS of type GSVD <#slepc4py.SLEPc.DS.Type.GSVD>.

Not collective.


:sources:`Source code at slepc4py/SLEPc/DS.pyx:784 <slepc4py/SLEPc/DS.pyx#L784>`


Get the number of columns of a DS of type HSVD <#slepc4py.SLEPc.DS.Type.HSVD>.

Not collective.


:sources:`Source code at slepc4py/SLEPc/DS.pyx:752 <slepc4py/SLEPc/DS.pyx#L752>`


Get the leading dimension of the allocated matrices.

Not collective.

Leading dimension (maximum allowed dimension for the matrices).
int <https://docs.python.org/3/library/functions.html#int>

:sources:`Source code at slepc4py/SLEPc/DS.pyx:260 <slepc4py/SLEPc/DS.pyx#L260>`


Get the requested matrix as a sequential dense Mat object.

Not collective.

matname (MatType <#slepc4py.SLEPc.DS.MatType>) – The requested matrix.
The matrix.
petsc4py.PETSc.Mat <https://petsc.org/release/petsc4py/reference/petsc4py.PETSc.Mat.html#petsc4py.PETSc.Mat>

:sources:`Source code at slepc4py/SLEPc/DS.pyx:599 <slepc4py/SLEPc/DS.pyx#L599>`


Get the method currently used in the DS.

Not collective.


:sources:`Source code at slepc4py/SLEPc/DS.pyx:438 <slepc4py/SLEPc/DS.pyx#L438>`


Get the prefix used for searching for all DS options in the database.

Not collective.

The prefix string set for this DS object.
str <https://docs.python.org/3/library/stdtypes.html#str>

:sources:`Source code at slepc4py/SLEPc/DS.pyx:205 <slepc4py/SLEPc/DS.pyx#L205>`


Get the polynomial basis coefficients of a DS of type PEP <#slepc4py.SLEPc.PEP>.

Not collective.

Coefficients.
ArrayReal <#slepc4py.typing.ArrayReal>

:sources:`Source code at slepc4py/SLEPc/DS.pyx:847 <slepc4py/SLEPc/DS.pyx#L847>`


Get the polynomial degree of a DS of type PEP <#slepc4py.SLEPc.PEP>.

Not collective.


:sources:`Source code at slepc4py/SLEPc/DS.pyx:816 <slepc4py/SLEPc/DS.pyx#L816>`


Get the mode of operation in parallel runs.

Not collective.

The parallel mode.
ParallelType <#slepc4py.SLEPc.DS.ParallelType>

:sources:`Source code at slepc4py/SLEPc/DS.pyx:329 <slepc4py/SLEPc/DS.pyx#L329>`


Get the refined vectors flag.

Not collective.


:sources:`Source code at slepc4py/SLEPc/DS.pyx:556 <slepc4py/SLEPc/DS.pyx#L556>`


Get the number of columns of a DS of type SVD <#slepc4py.SLEPc.SVD>.

Not collective.


:sources:`Source code at slepc4py/SLEPc/DS.pyx:723 <slepc4py/SLEPc/DS.pyx#L723>`


Get the current state.

Not collective.

The current state.
StateType <#slepc4py.SLEPc.DS.StateType>

:sources:`Source code at slepc4py/SLEPc/DS.pyx:300 <slepc4py/SLEPc/DS.pyx#L300>`


Get the DS type of this object.

Not collective.

The direct solver type currently being used.
str <https://docs.python.org/3/library/stdtypes.html#str>

:sources:`Source code at slepc4py/SLEPc/DS.pyx:154 <slepc4py/SLEPc/DS.pyx#L154>`


Reset the DS object.

Collective.

:sources:`Source code at slepc4py/SLEPc/DS.pyx:114 <slepc4py/SLEPc/DS.pyx#L114>`



Restore the previously seized matrix.

Not collective.


None <https://docs.python.org/3/library/constants.html#None>

:sources:`Source code at slepc4py/SLEPc/DS.pyx:621 <slepc4py/SLEPc/DS.pyx#L621>`


Set the block size.

Logically collective.


:sources:`Source code at slepc4py/SLEPc/DS.pyx:395 <slepc4py/SLEPc/DS.pyx#L395>`


Set the matrices’ compact storage flag.

Logically collective.


Notes

Compact storage is used in some DS types such as DS.Type.HEP <#slepc4py.SLEPc.DS.Type.HEP> when the matrix is tridiagonal. This flag can be used to indicate whether the user provides the matrix entries via the compact form (the tridiagonal DS.MatType.T <#slepc4py.SLEPc.DS.MatType.T>) or the non-compact one (DS.MatType.A <#slepc4py.SLEPc.DS.MatType.A>).

The default is False.

:sources:`Source code at slepc4py/SLEPc/DS.pyx:453 <slepc4py/SLEPc/DS.pyx#L453>`


Set the matrices sizes in the DS object.

Logically collective.


Notes

The internal arrays are not reallocated.

:sources:`Source code at slepc4py/SLEPc/DS.pyx:344 <slepc4py/SLEPc/DS.pyx#L344>`


Set a flag to indicate that the matrix has one extra row.

Logically collective.


Notes

In Krylov methods it is useful that the matrix representing the direct solver has one extra row, i.e., has dimension (n+1) n. If this flag is activated, all transformations applied to the right of the matrix also affect this additional row. In that case, (n+1) must be less or equal than the leading dimension.

The default is False.

:sources:`Source code at slepc4py/SLEPc/DS.pyx:492 <slepc4py/SLEPc/DS.pyx#L492>`


Set DS options from the options database.

Collective.

Notes

To see all options, run your program with the -help option.

:sources:`Source code at slepc4py/SLEPc/DS.pyx:220 <slepc4py/SLEPc/DS.pyx#L220>`



Set the number of columns and rows of a DS of type GSVD <#slepc4py.SLEPc.DS.Type.GSVD>.

Logically collective.


:sources:`Source code at slepc4py/SLEPc/DS.pyx:767 <slepc4py/SLEPc/DS.pyx#L767>`


Set the number of columns of a DS of type HSVD <#slepc4py.SLEPc.DS.Type.HSVD>.

Logically collective.


:sources:`Source code at slepc4py/SLEPc/DS.pyx:738 <slepc4py/SLEPc/DS.pyx#L738>`


Set the identity on the active part of a matrix.

Logically collective.

matname (MatType <#slepc4py.SLEPc.DS.MatType>) – The requested matrix.
None <https://docs.python.org/3/library/constants.html#None>

:sources:`Source code at slepc4py/SLEPc/DS.pyx:638 <slepc4py/SLEPc/DS.pyx#L638>`


Set the method to be used to solve the problem.

Logically collective.


:sources:`Source code at slepc4py/SLEPc/DS.pyx:424 <slepc4py/SLEPc/DS.pyx#L424>`


Set the prefix used for searching for all DS options in the database.

Logically collective.


Notes

A hyphen (-) must NOT be given at the beginning of the prefix name. The first character of all runtime options is AUTOMATICALLY the hyphen.

:sources:`Source code at slepc4py/SLEPc/DS.pyx:169 <slepc4py/SLEPc/DS.pyx#L169>`


Set the polynomial basis coefficients of a DS of type PEP <#slepc4py.SLEPc.PEP>.

Logically collective.


:sources:`Source code at slepc4py/SLEPc/DS.pyx:831 <slepc4py/SLEPc/DS.pyx#L831>`


Set the polynomial degree of a DS of type PEP <#slepc4py.SLEPc.PEP>.

Logically collective.


:sources:`Source code at slepc4py/SLEPc/DS.pyx:802 <slepc4py/SLEPc/DS.pyx#L802>`


Set the mode of operation in parallel runs.

Logically collective.

pmode (ParallelType <#slepc4py.SLEPc.DS.ParallelType>) – The parallel mode.
None <https://docs.python.org/3/library/constants.html#None>

:sources:`Source code at slepc4py/SLEPc/DS.pyx:315 <slepc4py/SLEPc/DS.pyx#L315>`


Set a flag to indicate that refined vectors must be computed.

Logically collective.


Notes

Normally the vectors returned in DS.MatType.X <#slepc4py.SLEPc.DS.MatType.X> are eigenvectors of the projected matrix. With this flag activated, vectors() will return the right singular vector of the smallest singular value of matrix At - theta I, where At is the extended (n+1) times n matrix and theta is the Ritz value. This is used in the refined Ritz approximation.

The default is False.

:sources:`Source code at slepc4py/SLEPc/DS.pyx:531 <slepc4py/SLEPc/DS.pyx#L531>`


Set the number of columns of a DS of type SVD <#slepc4py.SLEPc.SVD>.

Logically collective.


:sources:`Source code at slepc4py/SLEPc/DS.pyx:709 <slepc4py/SLEPc/DS.pyx#L709>`


Set the state of the DS object.

Logically collective.

state (StateType <#slepc4py.SLEPc.DS.StateType>) – The new state.
None <https://docs.python.org/3/library/constants.html#None>

Notes

The state indicates that the dense system is in an initial state (raw), in an intermediate state (such as tridiagonal, Hessenberg or Hessenberg-triangular), in a condensed state (such as diagonal, Schur or generalized Schur), or in a truncated state.

This function is normally used to return to the raw state when the condensed structure is destroyed.

:sources:`Source code at slepc4py/SLEPc/DS.pyx:275 <slepc4py/SLEPc/DS.pyx#L275>`


Set the type for the DS object.

Logically collective.

ds_type (Type <#slepc4py.SLEPc.DS.Type> | str <https://docs.python.org/3/library/stdtypes.html#str>) – The direct solver type to be used.
None <https://docs.python.org/3/library/constants.html#None>

:sources:`Source code at slepc4py/SLEPc/DS.pyx:139 <slepc4py/SLEPc/DS.pyx#L139>`


Solve the problem.

Logically collective.

Eigenvalues or singular values.
ArrayScalar <#slepc4py.typing.ArrayScalar>

:sources:`Source code at slepc4py/SLEPc/DS.pyx:669 <slepc4py/SLEPc/DS.pyx#L669>`


Truncate the system represented in the DS object.

Logically collective.


:sources:`Source code at slepc4py/SLEPc/DS.pyx:571 <slepc4py/SLEPc/DS.pyx#L571>`


Ensure that the extra row gets up-to-date after a call to DS.solve().

Logically collective.

Perform all necessary operations so that the extra row gets up-to-date after a call to DS.solve().

:sources:`Source code at slepc4py/SLEPc/DS.pyx:588 <slepc4py/SLEPc/DS.pyx#L588>`



Compute vectors associated to the dense system such as eigenvectors.

Logically collective.

matname (DS.MatType <#slepc4py.SLEPc.DS.MatType> enumerate) – The matrix, used to indicate which vectors are required.
None <https://docs.python.org/3/library/constants.html#None>

:sources:`Source code at slepc4py/SLEPc/DS.pyx:693 <slepc4py/SLEPc/DS.pyx#L693>`


Print the DS data structure.

Collective.


:sources:`Source code at slepc4py/SLEPc/DS.pyx:89 <slepc4py/SLEPc/DS.pyx#L89>`


Attributes Documentation

The block size.

:sources:`Source code at slepc4py/SLEPc/DS.pyx:885 <slepc4py/SLEPc/DS.pyx#L885>`


Compact storage of matrices.

:sources:`Source code at slepc4py/SLEPc/DS.pyx:899 <slepc4py/SLEPc/DS.pyx#L899>`


If the matrix has one extra row.

:sources:`Source code at slepc4py/SLEPc/DS.pyx:906 <slepc4py/SLEPc/DS.pyx#L906>`


The method to be used to solve the problem.

:sources:`Source code at slepc4py/SLEPc/DS.pyx:892 <slepc4py/SLEPc/DS.pyx#L892>`


The mode of operation in parallel runs.

:sources:`Source code at slepc4py/SLEPc/DS.pyx:878 <slepc4py/SLEPc/DS.pyx#L878>`


If refined vectors must be computed.

:sources:`Source code at slepc4py/SLEPc/DS.pyx:913 <slepc4py/SLEPc/DS.pyx#L913>`


The state of the DS object.

:sources:`Source code at slepc4py/SLEPc/DS.pyx:871 <slepc4py/SLEPc/DS.pyx#L871>`




slepc4py.SLEPc.EPS

Bases: Object <https://petsc.org/release/petsc4py/reference/petsc4py.PETSc.Object.html#petsc4py.PETSc.Object>

EPS.

Enumerations

Balance <#slepc4py.SLEPc.EPS.Balance> EPS type of balancing used for non-Hermitian problems.
CISSExtraction <#slepc4py.SLEPc.EPS.CISSExtraction> EPS CISS extraction technique.
CISSQuadRule <#slepc4py.SLEPc.EPS.CISSQuadRule> EPS CISS quadrature rule.
Conv <#slepc4py.SLEPc.EPS.Conv> EPS convergence test.
ConvergedReason <#slepc4py.SLEPc.EPS.ConvergedReason> EPS convergence reasons.
ErrorType <#slepc4py.SLEPc.EPS.ErrorType> EPS error type to assess accuracy of computed solutions.
Extraction <#slepc4py.SLEPc.EPS.Extraction> EPS extraction technique.
KrylovSchurBSEType <#slepc4py.SLEPc.EPS.KrylovSchurBSEType> EPS Krylov-Schur method for BSE problems.
LanczosReorthogType <#slepc4py.SLEPc.EPS.LanczosReorthogType> EPS Lanczos reorthogonalization type.
PowerShiftType <#slepc4py.SLEPc.EPS.PowerShiftType> EPS Power shift type.
ProblemType <#slepc4py.SLEPc.EPS.ProblemType> EPS problem type.
Stop <#slepc4py.SLEPc.EPS.Stop> EPS stopping test.
Type <#slepc4py.SLEPc.EPS.Type> EPS type.
Which <#slepc4py.SLEPc.EPS.Which> EPS desired part of spectrum.

slepc4py.SLEPc.EPS.Balance

Bases: object <https://docs.python.org/3/library/functions.html#object>

EPS type of balancing used for non-Hermitian problems.

  • NONE: None.
  • ONESIDE: One-sided balancing.
  • TWOSIDE: Two-sided balancing.
  • USER: User-provided balancing matrices.

Attributes Summary

NONE Constant NONE of type int <https://docs.python.org/3/library/functions.html#int>
ONESIDE Constant ONESIDE of type int <https://docs.python.org/3/library/functions.html#int>
TWOSIDE Constant TWOSIDE of type int <https://docs.python.org/3/library/functions.html#int>
USER Constant USER of type int <https://docs.python.org/3/library/functions.html#int>

Attributes Documentation






slepc4py.SLEPc.EPS.CISSExtraction

Bases: object <https://docs.python.org/3/library/functions.html#object>

EPS CISS extraction technique.

  • RITZ: Ritz extraction.
  • HANKEL: Extraction via Hankel eigenproblem.

Attributes Summary

HANKEL Constant HANKEL of type int <https://docs.python.org/3/library/functions.html#int>
RITZ Constant RITZ of type int <https://docs.python.org/3/library/functions.html#int>

Attributes Documentation




slepc4py.SLEPc.EPS.CISSQuadRule

Bases: object <https://docs.python.org/3/library/functions.html#object>

EPS CISS quadrature rule.

  • TRAPEZOIDAL: Trapezoidal rule.
  • CHEBYSHEV: Chebyshev points.

Attributes Summary

CHEBYSHEV Constant CHEBYSHEV of type int <https://docs.python.org/3/library/functions.html#int>
TRAPEZOIDAL Constant TRAPEZOIDAL of type int <https://docs.python.org/3/library/functions.html#int>

Attributes Documentation




slepc4py.SLEPc.EPS.Conv

Bases: object <https://docs.python.org/3/library/functions.html#object>

EPS convergence test.

  • ABS: Absolute convergence test.
  • REL: Convergence test relative to the eigenvalue.
  • NORM: Convergence test relative to the matrix norms.
  • USER: User-defined convergence test.

Attributes Summary

ABS Constant ABS of type int <https://docs.python.org/3/library/functions.html#int>
NORM Constant NORM of type int <https://docs.python.org/3/library/functions.html#int>
REL Constant REL of type int <https://docs.python.org/3/library/functions.html#int>
USER Constant USER of type int <https://docs.python.org/3/library/functions.html#int>

Attributes Documentation






slepc4py.SLEPc.EPS.ConvergedReason

Bases: object <https://docs.python.org/3/library/functions.html#object>

EPS convergence reasons.

  • CONVERGED_TOL: All eigenpairs converged to requested tolerance.
  • CONVERGED_USER: User-defined convergence criterion satisfied.
  • DIVERGED_ITS: Maximum number of iterations exceeded.
  • DIVERGED_BREAKDOWN: Solver failed due to breakdown.
  • DIVERGED_SYMMETRY_LOST: Lanczos-type method could not preserve symmetry.
  • CONVERGED_ITERATING: Iteration not finished yet.

Attributes Summary

CONVERGED_ITERATING Constant CONVERGED_ITERATING of type int <https://docs.python.org/3/library/functions.html#int>
CONVERGED_TOL Constant CONVERGED_TOL of type int <https://docs.python.org/3/library/functions.html#int>
CONVERGED_USER Constant CONVERGED_USER of type int <https://docs.python.org/3/library/functions.html#int>
DIVERGED_BREAKDOWN Constant DIVERGED_BREAKDOWN of type int <https://docs.python.org/3/library/functions.html#int>
DIVERGED_ITS Constant DIVERGED_ITS of type int <https://docs.python.org/3/library/functions.html#int>
DIVERGED_SYMMETRY_LOST Constant DIVERGED_SYMMETRY_LOST of type int <https://docs.python.org/3/library/functions.html#int>
ITERATING Constant ITERATING of type int <https://docs.python.org/3/library/functions.html#int>

Attributes Documentation









slepc4py.SLEPc.EPS.ErrorType

Bases: object <https://docs.python.org/3/library/functions.html#object>

EPS error type to assess accuracy of computed solutions.

  • ABSOLUTE: Absolute error.
  • RELATIVE: Relative error.
  • BACKWARD: Backward error.

Attributes Summary

ABSOLUTE Constant ABSOLUTE of type int <https://docs.python.org/3/library/functions.html#int>
BACKWARD Constant BACKWARD of type int <https://docs.python.org/3/library/functions.html#int>
RELATIVE Constant RELATIVE of type int <https://docs.python.org/3/library/functions.html#int>

Attributes Documentation





slepc4py.SLEPc.EPS.Extraction

Bases: object <https://docs.python.org/3/library/functions.html#object>

EPS extraction technique.

  • RITZ: Standard Rayleigh-Ritz extraction.
  • HARMONIC: Harmonic extraction.
  • HARMONIC_RELATIVE: Harmonic extraction relative to the eigenvalue.
  • HARMONIC_RIGHT: Harmonic extraction for rightmost eigenvalues.

  • REFINED: Refined extraction.
  • REFINED_HARMONIC: Refined harmonic extraction.

Attributes Summary

HARMONIC Constant HARMONIC of type int <https://docs.python.org/3/library/functions.html#int>
HARMONIC_LARGEST Constant HARMONIC_LARGEST of type int <https://docs.python.org/3/library/functions.html#int>
HARMONIC_RELATIVE Constant HARMONIC_RELATIVE of type int <https://docs.python.org/3/library/functions.html#int>
HARMONIC_RIGHT Constant HARMONIC_RIGHT of type int <https://docs.python.org/3/library/functions.html#int>
REFINED Constant REFINED of type int <https://docs.python.org/3/library/functions.html#int>
REFINED_HARMONIC Constant REFINED_HARMONIC of type int <https://docs.python.org/3/library/functions.html#int>
RITZ Constant RITZ of type int <https://docs.python.org/3/library/functions.html#int>

Attributes Documentation









slepc4py.SLEPc.EPS.KrylovSchurBSEType

Bases: object <https://docs.python.org/3/library/functions.html#object>

EPS Krylov-Schur method for BSE problems.

  • SHAO: Lanczos recurrence for H square.
  • GRUNING: Lanczos recurrence for H.
  • PROJECTEDBSE: Lanczos where the projected problem has BSE structure.

Attributes Summary

GRUNING Constant GRUNING of type int <https://docs.python.org/3/library/functions.html#int>
PROJECTEDBSE Constant PROJECTEDBSE of type int <https://docs.python.org/3/library/functions.html#int>
SHAO Constant SHAO of type int <https://docs.python.org/3/library/functions.html#int>

Attributes Documentation





slepc4py.SLEPc.EPS.LanczosReorthogType

Bases: object <https://docs.python.org/3/library/functions.html#object>

EPS Lanczos reorthogonalization type.

  • LOCAL: Local reorthogonalization only.
  • FULL: Full reorthogonalization.
  • SELECTIVE: Selective reorthogonalization.
  • PERIODIC: Periodic reorthogonalization.
  • PARTIAL: Partial reorthogonalization.
  • DELAYED: Delayed reorthogonalization.

Attributes Summary

DELAYED Constant DELAYED of type int <https://docs.python.org/3/library/functions.html#int>
FULL Constant FULL of type int <https://docs.python.org/3/library/functions.html#int>
LOCAL Constant LOCAL of type int <https://docs.python.org/3/library/functions.html#int>
PARTIAL Constant PARTIAL of type int <https://docs.python.org/3/library/functions.html#int>
PERIODIC Constant PERIODIC of type int <https://docs.python.org/3/library/functions.html#int>
SELECTIVE Constant SELECTIVE of type int <https://docs.python.org/3/library/functions.html#int>

Attributes Documentation








slepc4py.SLEPc.EPS.PowerShiftType

Bases: object <https://docs.python.org/3/library/functions.html#object>

EPS Power shift type.

  • CONSTANT: Constant shift.
  • RAYLEIGH: Rayleigh quotient.
  • WILKINSON: Wilkinson shift.

Attributes Summary

CONSTANT Constant CONSTANT of type int <https://docs.python.org/3/library/functions.html#int>
RAYLEIGH Constant RAYLEIGH of type int <https://docs.python.org/3/library/functions.html#int>
WILKINSON Constant WILKINSON of type int <https://docs.python.org/3/library/functions.html#int>

Attributes Documentation





slepc4py.SLEPc.EPS.ProblemType

Bases: object <https://docs.python.org/3/library/functions.html#object>

EPS problem type.

  • HEP: Hermitian eigenproblem.
  • NHEP: Non-Hermitian eigenproblem.
  • GHEP: Generalized Hermitian eigenproblem.
  • GNHEP: Generalized Non-Hermitian eigenproblem.

  • GHIEP: Generalized Hermitian-indefinite eigenproblem.
  • BSE: Structured Bethe-Salpeter eigenproblem.
  • HAMILT: Hamiltonian eigenproblem.

Attributes Summary

BSE Constant BSE of type int <https://docs.python.org/3/library/functions.html#int>
GHEP Constant GHEP of type int <https://docs.python.org/3/library/functions.html#int>
GHIEP Constant GHIEP of type int <https://docs.python.org/3/library/functions.html#int>
GNHEP Constant GNHEP of type int <https://docs.python.org/3/library/functions.html#int>
HAMILT Constant HAMILT of type int <https://docs.python.org/3/library/functions.html#int>
HEP Constant HEP of type int <https://docs.python.org/3/library/functions.html#int>
NHEP Constant NHEP of type int <https://docs.python.org/3/library/functions.html#int>
PGNHEP Constant PGNHEP of type int <https://docs.python.org/3/library/functions.html#int>

Attributes Documentation










slepc4py.SLEPc.EPS.Stop

Bases: object <https://docs.python.org/3/library/functions.html#object>

EPS stopping test.

  • BASIC: Default stopping test.
  • USER: User-defined stopping test.
  • THRESHOLD: Threshold stopping test.

Attributes Summary

BASIC Constant BASIC of type int <https://docs.python.org/3/library/functions.html#int>
THRESHOLD Constant THRESHOLD of type int <https://docs.python.org/3/library/functions.html#int>
USER Constant USER of type int <https://docs.python.org/3/library/functions.html#int>

Attributes Documentation





slepc4py.SLEPc.EPS.Type

Bases: object <https://docs.python.org/3/library/functions.html#object>

EPS type.

Native sparse eigensolvers.

  • POWER: Power Iteration, Inverse Iteration, RQI.
  • SUBSPACE: Subspace Iteration.
  • ARNOLDI: Arnoldi.
  • LANCZOS: Lanczos.
  • KRYLOVSCHUR: Krylov-Schur (default).
  • GD: Generalized Davidson.
  • JD: Jacobi-Davidson.
  • RQCG: Rayleigh Quotient Conjugate Gradient.
  • LOBPCG: Locally Optimal Block Preconditioned Conjugate Gradient.
  • CISS: Contour Integral Spectrum Slicing.
  • LYAPII: Lyapunov inverse iteration.
  • LAPACK: Wrappers to dense eigensolvers in Lapack.

Wrappers to external eigensolvers (should be enabled during installation of SLEPc)

  • ARPACK:
  • BLOPEX:
  • PRIMME:
  • FEAST:
  • SCALAPACK:
  • ELPA:
  • ELEMENTAL:
  • EVSL:
  • CHASE:

Attributes Summary

ARNOLDI Object ARNOLDI of type str <https://docs.python.org/3/library/stdtypes.html#str>
ARPACK Object ARPACK of type str <https://docs.python.org/3/library/stdtypes.html#str>
BLOPEX Object BLOPEX of type str <https://docs.python.org/3/library/stdtypes.html#str>
CHASE Object CHASE of type str <https://docs.python.org/3/library/stdtypes.html#str>
CISS Object CISS of type str <https://docs.python.org/3/library/stdtypes.html#str>
ELEMENTAL Object ELEMENTAL of type str <https://docs.python.org/3/library/stdtypes.html#str>
ELPA Object ELPA of type str <https://docs.python.org/3/library/stdtypes.html#str>
EVSL Object EVSL of type str <https://docs.python.org/3/library/stdtypes.html#str>
FEAST Object FEAST of type str <https://docs.python.org/3/library/stdtypes.html#str>
GD Object GD of type str <https://docs.python.org/3/library/stdtypes.html#str>
JD Object JD of type str <https://docs.python.org/3/library/stdtypes.html#str>
KRYLOVSCHUR Object KRYLOVSCHUR of type str <https://docs.python.org/3/library/stdtypes.html#str>
LANCZOS Object LANCZOS of type str <https://docs.python.org/3/library/stdtypes.html#str>
LAPACK Object LAPACK of type str <https://docs.python.org/3/library/stdtypes.html#str>
LOBPCG Object LOBPCG of type str <https://docs.python.org/3/library/stdtypes.html#str>
LYAPII Object LYAPII of type str <https://docs.python.org/3/library/stdtypes.html#str>
POWER Object POWER of type str <https://docs.python.org/3/library/stdtypes.html#str>
PRIMME Object PRIMME of type str <https://docs.python.org/3/library/stdtypes.html#str>
RQCG Object RQCG of type str <https://docs.python.org/3/library/stdtypes.html#str>
SCALAPACK Object SCALAPACK of type str <https://docs.python.org/3/library/stdtypes.html#str>
SUBSPACE Object SUBSPACE of type str <https://docs.python.org/3/library/stdtypes.html#str>

Attributes Documentation























slepc4py.SLEPc.EPS.Which

Bases: object <https://docs.python.org/3/library/functions.html#object>

EPS desired part of spectrum.

  • LARGEST_MAGNITUDE: Largest magnitude (default).
  • SMALLEST_MAGNITUDE: Smallest magnitude.
  • LARGEST_REAL: Largest real parts.
  • SMALLEST_REAL: Smallest real parts.
  • LARGEST_IMAGINARY: Largest imaginary parts in magnitude.
  • SMALLEST_IMAGINARY: Smallest imaginary parts in magnitude.
  • TARGET_MAGNITUDE: Closest to target (in magnitude).
  • TARGET_REAL: Real part closest to target.
  • TARGET_IMAGINARY: Imaginary part closest to target.
  • ALL: All eigenvalues in an interval.
  • USER: User defined selection.

Attributes Summary

ALL Constant ALL of type int <https://docs.python.org/3/library/functions.html#int>
LARGEST_IMAGINARY Constant LARGEST_IMAGINARY of type int <https://docs.python.org/3/library/functions.html#int>
LARGEST_MAGNITUDE Constant LARGEST_MAGNITUDE of type int <https://docs.python.org/3/library/functions.html#int>
LARGEST_REAL Constant LARGEST_REAL of type int <https://docs.python.org/3/library/functions.html#int>
SMALLEST_IMAGINARY Constant SMALLEST_IMAGINARY of type int <https://docs.python.org/3/library/functions.html#int>
SMALLEST_MAGNITUDE Constant SMALLEST_MAGNITUDE of type int <https://docs.python.org/3/library/functions.html#int>
SMALLEST_REAL Constant SMALLEST_REAL of type int <https://docs.python.org/3/library/functions.html#int>
TARGET_IMAGINARY Constant TARGET_IMAGINARY of type int <https://docs.python.org/3/library/functions.html#int>
TARGET_MAGNITUDE Constant TARGET_MAGNITUDE of type int <https://docs.python.org/3/library/functions.html#int>
TARGET_REAL Constant TARGET_REAL of type int <https://docs.python.org/3/library/functions.html#int>
USER Constant USER of type int <https://docs.python.org/3/library/functions.html#int>

Attributes Documentation













Methods Summary

appendOptionsPrefix([prefix]) Append to the prefix used for searching for all EPS options in the database.
cancelMonitor() Clear all monitors for an EPS object.
computeError(i[, etype]) Compute the error associated with the i-th computed eigenpair.
create([comm]) Create the EPS object.
destroy() Destroy the EPS object.
errorView([etype, viewer]) Display the errors associated with the computed solution.
getArnoldiDelayed() Get the type of reorthogonalization used during the Arnoldi iteration.
getBV() Get the basis vector objects associated to the eigensolver.
getBalance() Get the balancing type used by the EPS, and the associated parameters.
getCISSExtraction() Get the extraction technique used in the CISS solver.
getCISSKSPs() Get the array of linear solver objects associated with the CISS solver.
getCISSQuadRule() Get the quadrature rule used in the CISS solver.
getCISSRefinement() Get the values of various refinement parameters in the CISS solver.
getCISSSizes() Get the values of various size parameters in the CISS solver.
getCISSThreshold() Get the values of various threshold parameters in the CISS solver.
getCISSUseST() Get the flag indicating the use of the ST <#slepc4py.SLEPc.ST> object in the CISS solver.
getConverged() Get the number of converged eigenpairs.
getConvergedReason() Get the reason why the solve() iteration was stopped.
getConvergenceTest() Get how to compute the error estimate used in the convergence test.
getDS() Get the direct solver associated to the eigensolver.
getDimensions() Get number of eigenvalues to compute and the dimension of the subspace.
getEigenpair(i[, Vr, Vi]) Get the i-th solution of the eigenproblem as computed by solve().
getEigenvalue(i) Get the i-th eigenvalue as computed by solve().
getEigenvector(i[, Vr, Vi]) Get the i-th eigenvector as computed by solve().
getErrorEstimate(i) Get the error estimate associated to the i-th computed eigenpair.
getExtraction() Get the extraction type used by the EPS object.
getGDBOrth() Get the orthogonalization used in the search subspace.
getGDBlockSize() Get the number of vectors to be added to the searching space.
getGDDoubleExpansion() Get a flag indicating whether the double expansion variant is active.
getGDInitialSize() Get the initial size of the searching space.
getGDKrylovStart() Get a flag indicating if the search subspace is started with a Krylov basis.
getGDRestart() Get the number of vectors of the search space after restart.
getInterval() Get the computational interval for spectrum slicing.
getInvariantSubspace() Get an orthonormal basis of the computed invariant subspace.
getIterationNumber() Get the current iteration number.
getJDBOrth() Get the orthogonalization used in the search subspace.
getJDBlockSize() Get the number of vectors to be added to the searching space.
getJDConstCorrectionTol() Get the flag indicating if the dynamic stopping is being used.
getJDFix() Get the threshold for changing the target in the correction equation.
getJDInitialSize() Get the initial size of the searching space.
getJDKrylovStart() Get a flag indicating if the search subspace is started with a Krylov basis.
getJDRestart() Get the number of vectors of the search space after restart.
getKrylovSchurBSEType() Get the method used for BSE structured eigenproblems (Krylov-Schur).
getKrylovSchurDetectZeros() Get the flag that enforces zero detection in spectrum slicing.
getKrylovSchurDimensions() Get the dimensions used for each subsolve step (spectrum slicing).
getKrylovSchurInertias() Get the values of the shifts and their corresponding inertias.
getKrylovSchurKSP() Get the linear solver object associated with the internal EPS object.
getKrylovSchurLocking() Get the locking flag used in the Krylov-Schur method.
getKrylovSchurPartitions() Get the number of partitions of the communicator (spectrum slicing).
getKrylovSchurRestart() Get the restart parameter used in the Krylov-Schur method.
getKrylovSchurSubcommInfo() Get information related to the case of doing spectrum slicing.
getKrylovSchurSubcommMats() Get the eigenproblem matrices stored in the subcommunicator.
getKrylovSchurSubcommPairs(i, V) Get the i-th eigenpair stored in the multi-communicator of the process.
getKrylovSchurSubintervals() Get the points that delimit the subintervals.
getLOBPCGBlockSize() Get the block size used in the LOBPCG method.
getLOBPCGLocking() Get the locking flag used in the LOBPCG method.
getLOBPCGRestart() Get the restart parameter used in the LOBPCG method.
getLanczosReorthogType() Get the type of reorthogonalization used during the Lanczos iteration.
getLeftEigenvector(i[, Wr, Wi]) Get the i-th left eigenvector as computed by solve().
getLyapIIRanks() Get the rank values used for the Lyapunov step.
getMonitor() Get the list of monitor functions.
getOperators() Get the matrices associated with the eigenvalue problem.
getOptionsPrefix() Get the prefix used for searching for all EPS options in the database.
getPowerShiftType() Get the type of shifts used during the power iteration.
getProblemType() Get the problem type from the EPS object.
getPurify() Get the flag indicating whether purification is activated or not.
getRG() Get the region object associated to the eigensolver.
getRQCGReset() Get the reset parameter used in the RQCG method.
getST() Get the spectral transformation object associated to the eigensolver.
getStoppingTest() Get the stopping function.
getTarget() Get the value of the target.
getThreshold() Get the threshold used in the threshold stopping test.
getTolerances() Get the tolerance and max.
getTrackAll() Get the flag indicating if all residual norms must be computed or not.
getTrueResidual() Get the flag indicating if true residual must be computed explicitly.
getTwoSided() Get the flag indicating if a two-sided variant of the algorithm is being used.
getType() Get the EPS type of this object.
getWhichEigenpairs() Get which portion of the spectrum is to be sought.
isGeneralized() Tell if the EPS object corresponds to a generalized eigenproblem.
isHermitian() Tell if the EPS object corresponds to a Hermitian eigenproblem.
isPositive() Eigenproblem requiring a positive (semi-) definite matrix B.
isStructured() Tell if the EPS object corresponds to a structured eigenvalue problem.
reset() Reset the EPS object.
setArbitrarySelection(arbitrary[, args, kargs]) Set an arbitrary selection criterion function.
setArnoldiDelayed(delayed) Set (toggle) delayed reorthogonalization in the Arnoldi iteration.
setBV(bv) Set a basis vectors object associated to the eigensolver.
setBalance([balance, iterations, cutoff]) Set the balancing technique to be used by the eigensolver.
setCISSExtraction(extraction) Set the extraction technique used in the CISS solver.
setCISSQuadRule(quad) Set the quadrature rule used in the CISS solver.
setCISSRefinement([inner, blsize]) Set the values of various refinement parameters in the CISS solver.
setCISSSizes([ip, bs, ms, npart, bsmax, ...]) Set the values of various size parameters in the CISS solver.
setCISSThreshold([delta, spur]) Set the values of various threshold parameters in the CISS solver.
setCISSUseST(usest) Set a flag indicating that the CISS solver will use the ST <#slepc4py.SLEPc.ST> object.
setConvergenceTest(conv) Set how to compute the error estimate used in the convergence test.
setDS(ds) Set a direct solver object associated to the eigensolver.
setDeflationSpace(space) Add vectors to the basis of the deflation space.
setDimensions([nev, ncv, mpd]) Set number of eigenvalues to compute and the dimension of the subspace.
setEigenvalueComparison(comparison[, args, ...]) Set an eigenvalue comparison function.
setExtraction(extraction) Set the extraction type used by the EPS object.
setFromOptions() Set EPS options from the options database.
setGDBOrth(borth) Set the orthogonalization that will be used in the search subspace.
setGDBlockSize(bs) Set the number of vectors to be added to the searching space.
setGDDoubleExpansion(doubleexp) Set that the search subspace is expanded with double expansion.
setGDInitialSize(initialsize) Set the initial size of the searching space.
setGDKrylovStart([krylovstart]) Set (toggle) starting the search subspace with a Krylov basis.
setGDRestart([minv, plusk]) Set the number of vectors of the search space after restart.
setInitialSpace(space) Set the initial space from which the eigensolver starts to iterate.
setInterval(inta, intb) Set the computational interval for spectrum slicing.
setJDBOrth(borth) Set the orthogonalization that will be used in the search subspace.
setJDBlockSize(bs) Set the number of vectors to be added to the searching space.
setJDConstCorrectionTol(constant) Deactivate the dynamic stopping criterion.
setJDFix(fix) Set the threshold for changing the target in the correction equation.
setJDInitialSize(initialsize) Set the initial size of the searching space.
setJDKrylovStart([krylovstart]) Set (toggle) starting the search subspace with a Krylov basis.
setJDRestart([minv, plusk]) Set the number of vectors of the search space after restart.
setKrylovSchurBSEType(bse) Set the Krylov-Schur variant used for BSE structured eigenproblems.
setKrylovSchurDetectZeros(detect) Set the flag that enforces zero detection in spectrum slicing.
setKrylovSchurDimensions([nev, ncv, mpd]) Set the dimensions used for each subsolve step (spectrum slicing).
setKrylovSchurLocking(lock) Set (toggle) locking/non-locking variants of the Krylov-Schur method.
setKrylovSchurPartitions(npart) Set the number of partitions of the communicator (spectrum slicing).
setKrylovSchurRestart(keep) Set the restart parameter for the Krylov-Schur method.
setKrylovSchurSubintervals(subint) Set the subinterval boundaries.
setLOBPCGBlockSize(bs) Set the block size of the LOBPCG method.
setLOBPCGLocking(lock) Toggle between locking and non-locking (LOBPCG method).
setLOBPCGRestart(restart) Set the restart parameter for the LOBPCG method.
setLanczosReorthogType(reorthog) Set the type of reorthogonalization used during the Lanczos iteration.
setLeftInitialSpace(space) Set a left initial space from which the eigensolver starts to iterate.
setLyapIIRanks([rkc, rkl]) Set the ranks used in the solution of the Lyapunov equation.
setMonitor(monitor[, args, kargs]) Append a monitor function to the list of monitors.
setOperators(A[, B]) Set the matrices associated with the eigenvalue problem.
setOptionsPrefix([prefix]) Set the prefix used for searching for all EPS options in the database.
setPowerShiftType(shift) Set the type of shifts used during the power iteration.
setProblemType(problem_type) Set the type of the eigenvalue problem.
setPurify([purify]) Set (toggle) eigenvector purification.
setRG(rg) Set a region object associated to the eigensolver.
setRQCGReset(nrest) Set the reset parameter of the RQCG iteration.
setST(st) Set a spectral transformation object associated to the eigensolver.
setStoppingTest(stopping[, args, kargs]) Set when to stop the outer iteration of the eigensolver.
setTarget(target) Set the value of the target.
setThreshold(thres[, rel]) Set the threshold used in the threshold stopping test.
setTolerances([tol, max_it]) Set the tolerance and max.
setTrackAll(trackall) Set if the solver must compute the residual of all approximate eigenpairs.
setTrueResidual(trueres) Set if the solver must compute the true residual explicitly or not.
setTwoSided(twosided) Set to use a two-sided variant that also computes left eigenvectors.
setType(eps_type) Set the particular solver to be used in the EPS object.
setUp() Set up all the internal data structures.
setWhichEigenpairs(which) Set which portion of the spectrum is to be sought.
solve() Solve the eigensystem.
updateKrylovSchurSubcommMats([s, a, Au, t, ...]) Update the eigenproblem matrices stored internally in the communicator.
valuesView([viewer]) Display the computed eigenvalues in a viewer.
vectorsView([viewer]) Output computed eigenvectors to a viewer.
view([viewer]) Print the EPS data structure.

Attributes Summary

bv The basis vectors (BV) object associated.
ds The direct solver (DS) object associated.
extraction The type of extraction technique to be employed.
max_it The maximum iteration count.
problem_type The type of the eigenvalue problem.
purify Eigenvector purification.
rg The region (RG) object associated.
st The spectral transformation (ST) object associated.
target The value of the target.
tol The tolerance.
track_all Compute the residual norm of all approximate eigenpairs.
true_residual Compute the true residual explicitly.
two_sided Two-sided that also computes left eigenvectors.
which The portion of the spectrum to be sought.

Methods Documentation

Append to the prefix used for searching for all EPS options in the database.

Logically collective.


:sources:`Source code at slepc4py/SLEPc/EPS.pyx:421 <slepc4py/SLEPc/EPS.pyx#L421>`


Clear all monitors for an EPS object.

Logically collective.

:sources:`Source code at slepc4py/SLEPc/EPS.pyx:1439 <slepc4py/SLEPc/EPS.pyx#L1439>`



Compute the error associated with the i-th computed eigenpair.

Collective.

Compute the error (based on the residual norm) associated with the i-th computed eigenpair.


The error bound, computed in various ways from the residual norm \|Ax-kBx\|_2 where k is the eigenvalue and x is the eigenvector.
float <https://docs.python.org/3/library/functions.html#float>

Notes

The index i should be a value between 0 and nconv-1 (see getConverged()).

:sources:`Source code at slepc4py/SLEPc/EPS.pyx:1722 <slepc4py/SLEPc/EPS.pyx#L1722>`


Create the EPS object.

Collective.


:sources:`Source code at slepc4py/SLEPc/EPS.pyx:323 <slepc4py/SLEPc/EPS.pyx#L323>`


Destroy the EPS object.

Collective.

:sources:`Source code at slepc4py/SLEPc/EPS.pyx:305 <slepc4py/SLEPc/EPS.pyx#L305>`



Display the errors associated with the computed solution.

Collective.

Display the errors and the eigenvalues.


None <https://docs.python.org/3/library/constants.html#None>

Notes

By default, this function checks the error of all eigenpairs and prints the eigenvalues if all of them are below the requested tolerance. If the viewer has format ASCII_INFO_DETAIL then a table with eigenvalues and corresponding errors is printed.

:sources:`Source code at slepc4py/SLEPc/EPS.pyx:1756 <slepc4py/SLEPc/EPS.pyx#L1756>`


Get the type of reorthogonalization used during the Arnoldi iteration.

Not collective.

True if delayed reorthogonalization is to be used.
bool <https://docs.python.org/3/library/functions.html#bool>

:sources:`Source code at slepc4py/SLEPc/EPS.pyx:1887 <slepc4py/SLEPc/EPS.pyx#L1887>`


Get the basis vector objects associated to the eigensolver.

Not collective.

The basis vectors context.
BV <#slepc4py.SLEPc.BV>

:sources:`Source code at slepc4py/SLEPc/EPS.pyx:1111 <slepc4py/SLEPc/EPS.pyx#L1111>`


Get the balancing type used by the EPS, and the associated parameters.

Not collective.


tuple <https://docs.python.org/3/library/stdtypes.html#tuple>[Balance <#slepc4py.SLEPc.EPS.Balance>, int <https://docs.python.org/3/library/functions.html#int>, float <https://docs.python.org/3/library/functions.html#float>]

:sources:`Source code at slepc4py/SLEPc/EPS.pyx:560 <slepc4py/SLEPc/EPS.pyx#L560>`


Get the extraction technique used in the CISS solver.

Not collective.

The extraction technique.
CISSExtraction <#slepc4py.SLEPc.EPS.CISSExtraction>

:sources:`Source code at slepc4py/SLEPc/EPS.pyx:3096 <slepc4py/SLEPc/EPS.pyx#L3096>`


Get the array of linear solver objects associated with the CISS solver.

Not collective.


Notes

The number of petsc4py.PETSc.KSP <https://petsc.org/release/petsc4py/reference/petsc4py.PETSc.KSP.html#petsc4py.PETSc.KSP> solvers is equal to the number of integration points divided by the number of partitions. This value is halved in the case of real matrices with a region centered at the real axis.

:sources:`Source code at slepc4py/SLEPc/EPS.pyx:3326 <slepc4py/SLEPc/EPS.pyx#L3326>`


Get the quadrature rule used in the CISS solver.

Not collective.

The quadrature rule.
CISSQuadRule <#slepc4py.SLEPc.EPS.CISSQuadRule>

:sources:`Source code at slepc4py/SLEPc/EPS.pyx:3125 <slepc4py/SLEPc/EPS.pyx#L3125>`


Get the values of various refinement parameters in the CISS solver.

Not collective.


:sources:`Source code at slepc4py/SLEPc/EPS.pyx:3276 <slepc4py/SLEPc/EPS.pyx#L3276>`


Get the values of various size parameters in the CISS solver.

Not collective.


:sources:`Source code at slepc4py/SLEPc/EPS.pyx:3190 <slepc4py/SLEPc/EPS.pyx#L3190>`


Get the values of various threshold parameters in the CISS solver.

Not collective.


:sources:`Source code at slepc4py/SLEPc/EPS.pyx:3239 <slepc4py/SLEPc/EPS.pyx#L3239>`


Get the flag indicating the use of the ST <#slepc4py.SLEPc.ST> object in the CISS solver.

Not collective.

Whether to use the ST <#slepc4py.SLEPc.ST> object or not.
bool <https://docs.python.org/3/library/functions.html#bool>

:sources:`Source code at slepc4py/SLEPc/EPS.pyx:3311 <slepc4py/SLEPc/EPS.pyx#L3311>`


Get the number of converged eigenpairs.

Not collective.


Notes

This function should be called after solve() has finished.

:sources:`Source code at slepc4py/SLEPc/EPS.pyx:1508 <slepc4py/SLEPc/EPS.pyx#L1508>`


Get the reason why the solve() iteration was stopped.

Not collective.

Negative value indicates diverged, positive value converged.
ConvergedReason <#slepc4py.SLEPc.EPS.ConvergedReason>

:sources:`Source code at slepc4py/SLEPc/EPS.pyx:1493 <slepc4py/SLEPc/EPS.pyx#L1493>`


Get how to compute the error estimate used in the convergence test.

Not collective.

The method used to compute the error estimate used in the convergence test.
Conv <#slepc4py.SLEPc.EPS.Conv>

:sources:`Source code at slepc4py/SLEPc/EPS.pyx:925 <slepc4py/SLEPc/EPS.pyx#L925>`


Get the direct solver associated to the eigensolver.

Not collective.

The direct solver context.
DS <#slepc4py.SLEPc.DS>

:sources:`Source code at slepc4py/SLEPc/EPS.pyx:1140 <slepc4py/SLEPc/EPS.pyx#L1140>`


Get number of eigenvalues to compute and the dimension of the subspace.

Not collective.


:sources:`Source code at slepc4py/SLEPc/EPS.pyx:1014 <slepc4py/SLEPc/EPS.pyx#L1014>`


Get the i-th solution of the eigenproblem as computed by solve().

Collective.

The solution consists of both the eigenvalue and the eigenvector.


e – The computed eigenvalue. It will be a real variable in case of a Hermitian or generalized Hermitian eigenproblem. Otherwise it will be a complex variable (possibly with zero imaginary part).
Scalar <#slepc4py.typing.Scalar>

Notes

The index i should be a value between 0 and nconv-1 (see getConverged()). Eigenpairs are indexed according to the ordering criterion established with setWhichEigenpairs().

:sources:`Source code at slepc4py/SLEPc/EPS.pyx:1615 <slepc4py/SLEPc/EPS.pyx#L1615>`


Get the i-th eigenvalue as computed by solve().

Not collective.

i (int <https://docs.python.org/3/library/functions.html#int>) – Index of the solution to be obtained.
The computed eigenvalue. It will be a real variable in case of a Hermitian or generalized Hermitian eigenproblem. Otherwise it will be a complex variable (possibly with zero imaginary part).
Scalar <#slepc4py.typing.Scalar>

Notes

The index i should be a value between 0 and nconv-1 (see getConverged()). Eigenpairs are indexed according to the ordering criterion established with setWhichEigenpairs().

:sources:`Source code at slepc4py/SLEPc/EPS.pyx:1527 <slepc4py/SLEPc/EPS.pyx#L1527>`


Get the i-th eigenvector as computed by solve().

Collective.


Notes

The index i should be a value between 0 and nconv-1 (see getConverged()). Eigenpairs are indexed according to the ordering criterion established with setWhichEigenpairs().

:sources:`Source code at slepc4py/SLEPc/EPS.pyx:1561 <slepc4py/SLEPc/EPS.pyx#L1561>`


Get the error estimate associated to the i-th computed eigenpair.

Not collective.


Notes

This is the error estimate used internally by the eigensolver. The actual error bound can be computed with computeError().

:sources:`Source code at slepc4py/SLEPc/EPS.pyx:1696 <slepc4py/SLEPc/EPS.pyx#L1696>`


Get the extraction type used by the EPS object.

Not collective.

The method of extraction.
Extraction <#slepc4py.SLEPc.EPS.Extraction>

:sources:`Source code at slepc4py/SLEPc/EPS.pyx:613 <slepc4py/SLEPc/EPS.pyx#L613>`


Get the orthogonalization used in the search subspace.

Not collective.

Get the orthogonalization used in the search subspace in case of generalized Hermitian problems.

Whether to B-orthogonalize the search subspace.
bool <https://docs.python.org/3/library/functions.html#bool>

:sources:`Source code at slepc4py/SLEPc/EPS.pyx:2608 <slepc4py/SLEPc/EPS.pyx#L2608>`


Get the number of vectors to be added to the searching space.

Not collective.

Get the number of vectors to be added to the searching space in every iteration.

The number of vectors added to the search space in every iteration.
int <https://docs.python.org/3/library/functions.html#int>

:sources:`Source code at slepc4py/SLEPc/EPS.pyx:2501 <slepc4py/SLEPc/EPS.pyx#L2501>`


Get a flag indicating whether the double expansion variant is active.

Not collective.

Get a flag indicating whether the double expansion variant has been activated or not.


:sources:`Source code at slepc4py/SLEPc/EPS.pyx:2646 <slepc4py/SLEPc/EPS.pyx#L2646>`


Get the initial size of the searching space.

Not collective.

The number of vectors of the initial searching subspace.
int <https://docs.python.org/3/library/functions.html#int>

:sources:`Source code at slepc4py/SLEPc/EPS.pyx:2576 <slepc4py/SLEPc/EPS.pyx#L2576>`


Get a flag indicating if the search subspace is started with a Krylov basis.

Not collective.

True if starting the search subspace with a Krylov basis.
bool <https://docs.python.org/3/library/functions.html#bool>

:sources:`Source code at slepc4py/SLEPc/EPS.pyx:2469 <slepc4py/SLEPc/EPS.pyx#L2469>`


Get the number of vectors of the search space after restart.

Not collective.

Get the number of vectors of the search space after restart and the number of vectors saved from the previous iteration.


:sources:`Source code at slepc4py/SLEPc/EPS.pyx:2541 <slepc4py/SLEPc/EPS.pyx#L2541>`


Get the computational interval for spectrum slicing.

Not collective.


Notes

If the interval was not set by the user, then zeros are returned.

:sources:`Source code at slepc4py/SLEPc/EPS.pyx:773 <slepc4py/SLEPc/EPS.pyx#L773>`


Get an orthonormal basis of the computed invariant subspace.

Collective.


Notes

This function should be called after solve() has finished.

The returned vectors span an invariant subspace associated with the computed eigenvalues. An invariant subspace X of A` satisfies ``A x in X for all x in X (a similar definition applies for generalized eigenproblems).

:sources:`Source code at slepc4py/SLEPc/EPS.pyx:1657 <slepc4py/SLEPc/EPS.pyx#L1657>`


Get the current iteration number.

Not collective.

If the call to solve() is complete, then it returns the number of iterations carried out by the solution method.


:sources:`Source code at slepc4py/SLEPc/EPS.pyx:1475 <slepc4py/SLEPc/EPS.pyx#L1475>`


Get the orthogonalization used in the search subspace.

Not collective.

Get the orthogonalization used in the search subspace in case of generalized Hermitian problems.

Whether to B-orthogonalize the search subspace.
bool <https://docs.python.org/3/library/functions.html#bool>

:sources:`Source code at slepc4py/SLEPc/EPS.pyx:2890 <slepc4py/SLEPc/EPS.pyx#L2890>`


Get the number of vectors to be added to the searching space.

Not collective.

Get the number of vectors to be added to the searching space in every iteration.

The number of vectors added to the search space in every iteration.
int <https://docs.python.org/3/library/functions.html#int>

:sources:`Source code at slepc4py/SLEPc/EPS.pyx:2712 <slepc4py/SLEPc/EPS.pyx#L2712>`


Get the flag indicating if the dynamic stopping is being used.

Not collective.

Get the flag indicating if the dynamic stopping is being used for solving the correction equation.

True if the dynamic stopping criterion is not being used.
bool <https://docs.python.org/3/library/functions.html#bool>

:sources:`Source code at slepc4py/SLEPc/EPS.pyx:2855 <slepc4py/SLEPc/EPS.pyx#L2855>`


Get the threshold for changing the target in the correction equation.

Not collective.

The threshold for changing the target.
float <https://docs.python.org/3/library/functions.html#float>

:sources:`Source code at slepc4py/SLEPc/EPS.pyx:2822 <slepc4py/SLEPc/EPS.pyx#L2822>`


Get the initial size of the searching space.

Not collective.

The number of vectors of the initial searching subspace.
int <https://docs.python.org/3/library/functions.html#int>

:sources:`Source code at slepc4py/SLEPc/EPS.pyx:2787 <slepc4py/SLEPc/EPS.pyx#L2787>`


Get a flag indicating if the search subspace is started with a Krylov basis.

Not collective.

True if starting the search subspace with a Krylov basis.
bool <https://docs.python.org/3/library/functions.html#bool>

:sources:`Source code at slepc4py/SLEPc/EPS.pyx:2680 <slepc4py/SLEPc/EPS.pyx#L2680>`


Get the number of vectors of the search space after restart.

Not collective.

Get the number of vectors of the search space after restart and the number of vectors saved from the previous iteration.


:sources:`Source code at slepc4py/SLEPc/EPS.pyx:2752 <slepc4py/SLEPc/EPS.pyx#L2752>`


Get the method used for BSE structured eigenproblems (Krylov-Schur).

Not collective.

The BSE method.
KrylovSchurBSEType <#slepc4py.SLEPc.EPS.KrylovSchurBSEType>

:sources:`Source code at slepc4py/SLEPc/EPS.pyx:1959 <slepc4py/SLEPc/EPS.pyx#L1959>`


Get the flag that enforces zero detection in spectrum slicing.

Not collective.


:sources:`Source code at slepc4py/SLEPc/EPS.pyx:2112 <slepc4py/SLEPc/EPS.pyx#L2112>`


Get the dimensions used for each subsolve step (spectrum slicing).

Not collective.

Get the dimensions used for each subsolve step in case of doing spectrum slicing for a computational interval.


:sources:`Source code at slepc4py/SLEPc/EPS.pyx:2159 <slepc4py/SLEPc/EPS.pyx#L2159>`


Get the values of the shifts and their corresponding inertias.

Not collective.

Get the values of the shifts and their corresponding inertias in case of doing spectrum slicing for a computational interval.

  • shifts (ArrayReal <#slepc4py.typing.ArrayReal>) – The values of the shifts used internally in the solver.
  • inertias (ArrayInt <#slepc4py.typing.ArrayInt>) – The values of the inertia in each shift.

tuple <https://docs.python.org/3/library/stdtypes.html#tuple>[ArrayReal <#slepc4py.typing.ArrayReal>, ArrayInt <#slepc4py.typing.ArrayInt>]

:sources:`Source code at slepc4py/SLEPc/EPS.pyx:2404 <slepc4py/SLEPc/EPS.pyx#L2404>`


Get the linear solver object associated with the internal EPS object.

Collective.

Get the linear solver object associated with the internal EPS object in case of doing spectrum slicing for a computational interval.


:sources:`Source code at slepc4py/SLEPc/EPS.pyx:2434 <slepc4py/SLEPc/EPS.pyx#L2434>`


Get the locking flag used in the Krylov-Schur method.

Not collective.


:sources:`Source code at slepc4py/SLEPc/EPS.pyx:2030 <slepc4py/SLEPc/EPS.pyx#L2030>`


Get the number of partitions of the communicator (spectrum slicing).

Not collective.


:sources:`Source code at slepc4py/SLEPc/EPS.pyx:2070 <slepc4py/SLEPc/EPS.pyx#L2070>`


Get the restart parameter used in the Krylov-Schur method.

Not collective.

The number of vectors to be kept at restart.
float <https://docs.python.org/3/library/functions.html#float>

:sources:`Source code at slepc4py/SLEPc/EPS.pyx:1994 <slepc4py/SLEPc/EPS.pyx#L1994>`


Get information related to the case of doing spectrum slicing.

Collective on the subcommunicator (if v is given).

Get information related to the case of doing spectrum slicing for a computational interval with multiple communicators.


tuple <https://docs.python.org/3/library/stdtypes.html#tuple>[int <https://docs.python.org/3/library/functions.html#int>, int <https://docs.python.org/3/library/functions.html#int>, petsc4py.PETSc.Vec <https://petsc.org/release/petsc4py/reference/petsc4py.PETSc.Vec.html#petsc4py.PETSc.Vec>]

Notes

This function is only available for spectrum slicing runs.

The returned Vec should be destroyed by the user.

:sources:`Source code at slepc4py/SLEPc/EPS.pyx:2183 <slepc4py/SLEPc/EPS.pyx#L2183>`


Get the eigenproblem matrices stored in the subcommunicator.

Collective on the subcommunicator.

Get the eigenproblem matrices stored internally in the subcommunicator to which the calling process belongs.


Notes

This is the analog of getOperators(), but returns the matrices distributed differently (in the subcommunicator rather than in the parent communicator).

These matrices should not be modified by the user.

:sources:`Source code at slepc4py/SLEPc/EPS.pyx:2246 <slepc4py/SLEPc/EPS.pyx#L2246>`


Get the i-th eigenpair stored in the multi-communicator of the process.

Collective on the subcommunicator (if v is given).

Get the i-th eigenpair stored internally in the multi-communicator to which the calling process belongs.


The computed eigenvalue.
Scalar <#slepc4py.typing.Scalar>

Notes

The index i should be a value between 0 and n-1, where n is the number of vectors in the local subinterval, see getKrylovSchurSubcommInfo().

:sources:`Source code at slepc4py/SLEPc/EPS.pyx:2214 <slepc4py/SLEPc/EPS.pyx#L2214>`


Get the points that delimit the subintervals.

Not collective.

Get the points that delimit the subintervals used in spectrum slicing with several partitions.

Real values specifying subintervals
ArrayReal <#slepc4py.typing.ArrayReal>

:sources:`Source code at slepc4py/SLEPc/EPS.pyx:2379 <slepc4py/SLEPc/EPS.pyx#L2379>`


Get the block size used in the LOBPCG method.

Not collective.


:sources:`Source code at slepc4py/SLEPc/EPS.pyx:2956 <slepc4py/SLEPc/EPS.pyx#L2956>`


Get the locking flag used in the LOBPCG method.

Not collective.


:sources:`Source code at slepc4py/SLEPc/EPS.pyx:3028 <slepc4py/SLEPc/EPS.pyx#L3028>`


Get the restart parameter used in the LOBPCG method.

Not collective.


:sources:`Source code at slepc4py/SLEPc/EPS.pyx:2993 <slepc4py/SLEPc/EPS.pyx#L2993>`


Get the type of reorthogonalization used during the Lanczos iteration.

Not collective.

The type of reorthogonalization.
LanczosReorthogType <#slepc4py.SLEPc.EPS.LanczosReorthogType>

:sources:`Source code at slepc4py/SLEPc/EPS.pyx:1921 <slepc4py/SLEPc/EPS.pyx#L1921>`


Get the i-th left eigenvector as computed by solve().

Collective.


Notes

The index i should be a value between 0 and nconv-1 (see getConverged()). Eigensolutions are indexed according to the ordering criterion established with setWhichEigenpairs().

Left eigenvectors are available only if the twosided flag was set with setTwoSided().

:sources:`Source code at slepc4py/SLEPc/EPS.pyx:1587 <slepc4py/SLEPc/EPS.pyx#L1587>`


Get the rank values used for the Lyapunov step.

Not collective.


:sources:`Source code at slepc4py/SLEPc/EPS.pyx:3062 <slepc4py/SLEPc/EPS.pyx#L3062>`


Get the list of monitor functions.

:sources:`Source code at slepc4py/SLEPc/EPS.pyx:1435 <slepc4py/SLEPc/EPS.pyx#L1435>`

EPSMonitorFunction <#slepc4py.typing.EPSMonitorFunction>


Get the matrices associated with the eigenvalue problem.

Collective.


:sources:`Source code at slepc4py/SLEPc/EPS.pyx:1198 <slepc4py/SLEPc/EPS.pyx#L1198>`


Get the prefix used for searching for all EPS options in the database.

Not collective.

The prefix string set for this EPS object.
str <https://docs.python.org/3/library/stdtypes.html#str>

:sources:`Source code at slepc4py/SLEPc/EPS.pyx:379 <slepc4py/SLEPc/EPS.pyx#L379>`


Get the type of shifts used during the power iteration.

Not collective.

The type of shift.
PowerShiftType <#slepc4py.SLEPc.EPS.PowerShiftType>

:sources:`Source code at slepc4py/SLEPc/EPS.pyx:1848 <slepc4py/SLEPc/EPS.pyx#L1848>`


Get the problem type from the EPS object.

Not collective.

The problem type that was previously set.
ProblemType <#slepc4py.SLEPc.EPS.ProblemType>

:sources:`Source code at slepc4py/SLEPc/EPS.pyx:454 <slepc4py/SLEPc/EPS.pyx#L454>`


Get the flag indicating whether purification is activated or not.

Not collective.

Whether purification is activated or not.
bool <https://docs.python.org/3/library/functions.html#bool>

:sources:`Source code at slepc4py/SLEPc/EPS.pyx:896 <slepc4py/SLEPc/EPS.pyx#L896>`


Get the region object associated to the eigensolver.

Not collective.

The region context.
RG <#slepc4py.SLEPc.RG>

:sources:`Source code at slepc4py/SLEPc/EPS.pyx:1169 <slepc4py/SLEPc/EPS.pyx#L1169>`


Get the reset parameter used in the RQCG method.

Not collective.

The number of iterations between resets.
int <https://docs.python.org/3/library/functions.html#int>

:sources:`Source code at slepc4py/SLEPc/EPS.pyx:2927 <slepc4py/SLEPc/EPS.pyx#L2927>`


Get the spectral transformation object associated to the eigensolver.

Not collective.

The spectral transformation.
ST <#slepc4py.SLEPc.ST>

:sources:`Source code at slepc4py/SLEPc/EPS.pyx:1082 <slepc4py/SLEPc/EPS.pyx#L1082>`


Get the stopping function.

Not collective.

:sources:`Source code at slepc4py/SLEPc/EPS.pyx:1353 <slepc4py/SLEPc/EPS.pyx#L1353>`

EPSStoppingFunction <#slepc4py.typing.EPSStoppingFunction>


Get the value of the target.

Not collective.

The value of the target.
Scalar <#slepc4py.typing.Scalar>

Notes

If the target was not set by the user, then zero is returned.

:sources:`Source code at slepc4py/SLEPc/EPS.pyx:734 <slepc4py/SLEPc/EPS.pyx#L734>`


Get the threshold used in the threshold stopping test.

Not collective.


:sources:`Source code at slepc4py/SLEPc/EPS.pyx:691 <slepc4py/SLEPc/EPS.pyx#L691>`


Get the tolerance and max. iter. count used for convergence tests.

Not collective.

Get the tolerance and iteration limit used by the default EPS convergence tests.


:sources:`Source code at slepc4py/SLEPc/EPS.pyx:822 <slepc4py/SLEPc/EPS.pyx#L822>`


Get the flag indicating if all residual norms must be computed or not.

Not collective.

Whether the solver compute all residuals or not.
bool <https://docs.python.org/3/library/functions.html#bool>

:sources:`Source code at slepc4py/SLEPc/EPS.pyx:985 <slepc4py/SLEPc/EPS.pyx#L985>`


Get the flag indicating if true residual must be computed explicitly.

Not collective.

Whether the solver compute all residuals or not.
bool <https://docs.python.org/3/library/functions.html#bool>

:sources:`Source code at slepc4py/SLEPc/EPS.pyx:956 <slepc4py/SLEPc/EPS.pyx#L956>`


Get the flag indicating if a two-sided variant of the algorithm is being used.

Not collective.

Whether the two-sided variant is to be used or not.
bool <https://docs.python.org/3/library/functions.html#bool>

:sources:`Source code at slepc4py/SLEPc/EPS.pyx:867 <slepc4py/SLEPc/EPS.pyx#L867>`


Get the EPS type of this object.

Not collective.


:sources:`Source code at slepc4py/SLEPc/EPS.pyx:364 <slepc4py/SLEPc/EPS.pyx#L364>`


Get which portion of the spectrum is to be sought.

Not collective.

The portion of the spectrum to be sought by the solver.
Which <#slepc4py.SLEPc.EPS.Which>

:sources:`Source code at slepc4py/SLEPc/EPS.pyx:653 <slepc4py/SLEPc/EPS.pyx#L653>`


Tell if the EPS object corresponds to a generalized eigenproblem.

Not collective.

True if two matrices were set with setOperators().
bool <https://docs.python.org/3/library/functions.html#bool>

:sources:`Source code at slepc4py/SLEPc/EPS.pyx:497 <slepc4py/SLEPc/EPS.pyx#L497>`


Tell if the EPS object corresponds to a Hermitian eigenproblem.

Not collective.

True if the problem type set with setProblemType() was Hermitian.
bool <https://docs.python.org/3/library/functions.html#bool>

:sources:`Source code at slepc4py/SLEPc/EPS.pyx:512 <slepc4py/SLEPc/EPS.pyx#L512>`


Eigenproblem requiring a positive (semi-) definite matrix B.

Not collective.

Tell if the EPS corresponds to an eigenproblem requiring a positive (semi-) definite matrix B.

True if the problem type set with setProblemType() was positive.
bool <https://docs.python.org/3/library/functions.html#bool>

:sources:`Source code at slepc4py/SLEPc/EPS.pyx:527 <slepc4py/SLEPc/EPS.pyx#L527>`


Tell if the EPS object corresponds to a structured eigenvalue problem.

Not collective.

True if the problem type set with setProblemType() was structured.
bool <https://docs.python.org/3/library/functions.html#bool>

:sources:`Source code at slepc4py/SLEPc/EPS.pyx:545 <slepc4py/SLEPc/EPS.pyx#L545>`


Reset the EPS object.

Collective.

:sources:`Source code at slepc4py/SLEPc/EPS.pyx:315 <slepc4py/SLEPc/EPS.pyx#L315>`



Set an arbitrary selection criterion function.

Logically collective.

Set a function to look for eigenvalues according to an arbitrary selection criterion. This criterion can be based on a computation involving the current eigenvector approximation.

:sources:`Source code at slepc4py/SLEPc/EPS.pyx:1363 <slepc4py/SLEPc/EPS.pyx#L1363>`



Set (toggle) delayed reorthogonalization in the Arnoldi iteration.

Logically collective.


Notes

This call is only relevant if the type was set to EPS.Type.ARNOLDI <#slepc4py.SLEPc.EPS.Type.ARNOLDI> with setType().

Delayed reorthogonalization is an aggressive optimization for the Arnoldi eigensolver than may provide better scalability, but sometimes makes the solver converge less than the default algorithm.

:sources:`Source code at slepc4py/SLEPc/EPS.pyx:1863 <slepc4py/SLEPc/EPS.pyx#L1863>`


Set a basis vectors object associated to the eigensolver.

Collective.

bv (BV <#slepc4py.SLEPc.BV>) – The basis vectors context.
None <https://docs.python.org/3/library/constants.html#None>

:sources:`Source code at slepc4py/SLEPc/EPS.pyx:1127 <slepc4py/SLEPc/EPS.pyx#L1127>`


Set the balancing technique to be used by the eigensolver.

Logically collective.

Set the balancing technique to be used by the eigensolver, and some parameters associated to it.


:sources:`Source code at slepc4py/SLEPc/EPS.pyx:581 <slepc4py/SLEPc/EPS.pyx#L581>`


Set the extraction technique used in the CISS solver.

Logically collective.

extraction (CISSExtraction <#slepc4py.SLEPc.EPS.CISSExtraction>) – The extraction technique.
None <https://docs.python.org/3/library/constants.html#None>

:sources:`Source code at slepc4py/SLEPc/EPS.pyx:3082 <slepc4py/SLEPc/EPS.pyx#L3082>`


Set the quadrature rule used in the CISS solver.

Logically collective.

quad (CISSQuadRule <#slepc4py.SLEPc.EPS.CISSQuadRule>) – The quadrature rule.
None <https://docs.python.org/3/library/constants.html#None>

:sources:`Source code at slepc4py/SLEPc/EPS.pyx:3111 <slepc4py/SLEPc/EPS.pyx#L3111>`


Set the values of various refinement parameters in the CISS solver.

Logically collective.


:sources:`Source code at slepc4py/SLEPc/EPS.pyx:3257 <slepc4py/SLEPc/EPS.pyx#L3257>`


Set the values of various size parameters in the CISS solver.

Logically collective.


Notes

The default number of partitions is 1. This means the internal petsc4py.PETSc.KSP <https://petsc.org/release/petsc4py/reference/petsc4py.PETSc.KSP.html#petsc4py.PETSc.KSP> object is shared among all processes of the EPS communicator. Otherwise, the communicator is split into npart communicators, so that npart petsc4py.PETSc.KSP <https://petsc.org/release/petsc4py/reference/petsc4py.PETSc.KSP.html#petsc4py.PETSc.KSP> solves proceed simultaneously.

:sources:`Source code at slepc4py/SLEPc/EPS.pyx:3140 <slepc4py/SLEPc/EPS.pyx#L3140>`


Set the values of various threshold parameters in the CISS solver.

Logically collective.


:sources:`Source code at slepc4py/SLEPc/EPS.pyx:3220 <slepc4py/SLEPc/EPS.pyx#L3220>`


Set a flag indicating that the CISS solver will use the ST <#slepc4py.SLEPc.ST> object.

Logically collective.

Set a flag indicating that the CISS solver will use the ST <#slepc4py.SLEPc.ST> object for the linear solves.

usest (bool <https://docs.python.org/3/library/functions.html#bool>) – Whether to use the ST <#slepc4py.SLEPc.ST> object or not.
None <https://docs.python.org/3/library/constants.html#None>

:sources:`Source code at slepc4py/SLEPc/EPS.pyx:3294 <slepc4py/SLEPc/EPS.pyx#L3294>`


Set how to compute the error estimate used in the convergence test.

Logically collective.

conv (Conv <#slepc4py.SLEPc.EPS.Conv>) – The method used to compute the error estimate used in the convergence test.
None <https://docs.python.org/3/library/constants.html#None>

:sources:`Source code at slepc4py/SLEPc/EPS.pyx:941 <slepc4py/SLEPc/EPS.pyx#L941>`


Set a direct solver object associated to the eigensolver.

Collective.

ds (DS <#slepc4py.SLEPc.DS>) – The direct solver context.
None <https://docs.python.org/3/library/constants.html#None>

:sources:`Source code at slepc4py/SLEPc/EPS.pyx:1156 <slepc4py/SLEPc/EPS.pyx#L1156>`


Add vectors to the basis of the deflation space.

Collective.


Notes

When a deflation space is given, the eigensolver seeks the eigensolution in the restriction of the problem to the orthogonal complement of this space. This can be used for instance in the case that an invariant subspace is known beforehand (such as the nullspace of the matrix).

The vectors do not need to be mutually orthonormal, since they are explicitly orthonormalized internally.

These vectors do not persist from one solve() call to the other, so the deflation space should be set every time.

:sources:`Source code at slepc4py/SLEPc/EPS.pyx:1238 <slepc4py/SLEPc/EPS.pyx#L1238>`


Set number of eigenvalues to compute and the dimension of the subspace.

Logically collective.


Notes

Use DECIDE <#slepc4py.SLEPc.DECIDE> for ncv and mpd to assign a reasonably good value, which is dependent on the solution method.

The parameters ncv and mpd are intimately related, so that the user is advised to set one of them at most. Normal usage is the following:

  • In cases where nev is small, the user sets ncv (a reasonable default is 2 * nev).
  • In cases where nev is large, the user sets mpd.

The value of ncv should always be between nev and (nev + mpd), typically ncv = nev + mpd. If nev is not too large, mpd = nev is a reasonable choice, otherwise a smaller value should be used.

:sources:`Source code at slepc4py/SLEPc/EPS.pyx:1035 <slepc4py/SLEPc/EPS.pyx#L1035>`


Set an eigenvalue comparison function.

Logically collective.

Specify the eigenvalue comparison function when setWhichEigenpairs() is set to EPS.Which.USER <#slepc4py.SLEPc.EPS.Which.USER>.

:sources:`Source code at slepc4py/SLEPc/EPS.pyx:1390 <slepc4py/SLEPc/EPS.pyx#L1390>`



Set the extraction type used by the EPS object.

Logically collective.

extraction (Extraction <#slepc4py.SLEPc.EPS.Extraction>) – The extraction method to be used by the solver.
None <https://docs.python.org/3/library/constants.html#None>

Notes

Not all eigensolvers support all types of extraction. See the SLEPc documentation for details.

By default, a standard Rayleigh-Ritz extraction is used. Other extractions may be useful when computing interior eigenvalues.

Harmonic-type extractions are used in combination with a target. See setTarget().

:sources:`Source code at slepc4py/SLEPc/EPS.pyx:628 <slepc4py/SLEPc/EPS.pyx#L628>`


Set EPS options from the options database.

Collective.

This routine must be called before setUp() if the user is to be allowed to set the solver type.

Notes

To see all options, run your program with the -help option.

:sources:`Source code at slepc4py/SLEPc/EPS.pyx:436 <slepc4py/SLEPc/EPS.pyx#L436>`



Set the orthogonalization that will be used in the search subspace.

Logically collective.

Set the orthogonalization that will be used in the search subspace in case of generalized Hermitian problems.


:sources:`Source code at slepc4py/SLEPc/EPS.pyx:2591 <slepc4py/SLEPc/EPS.pyx#L2591>`


Set the number of vectors to be added to the searching space.

Logically collective.

Set the number of vectors to be added to the searching space in every iteration.

bs (int <https://docs.python.org/3/library/functions.html#int>) – The number of vectors added to the search space in every iteration.
None <https://docs.python.org/3/library/constants.html#None>

:sources:`Source code at slepc4py/SLEPc/EPS.pyx:2484 <slepc4py/SLEPc/EPS.pyx#L2484>`


Set that the search subspace is expanded with double expansion.

Logically collective.

Set a variant where the search subspace is expanded with K [A x, B x] (double expansion) instead of the classic K r, where K is the preconditioner, x the selected approximate eigenvector and r its associated residual vector.


:sources:`Source code at slepc4py/SLEPc/EPS.pyx:2626 <slepc4py/SLEPc/EPS.pyx#L2626>`


Set the initial size of the searching space.

Logically collective.

initialsize (int <https://docs.python.org/3/library/functions.html#int>) – The number of vectors of the initial searching subspace.
None <https://docs.python.org/3/library/constants.html#None>

:sources:`Source code at slepc4py/SLEPc/EPS.pyx:2562 <slepc4py/SLEPc/EPS.pyx#L2562>`


Set (toggle) starting the search subspace with a Krylov basis.

Logically collective.

krylovstart (bool <https://docs.python.org/3/library/functions.html#bool>) – True if starting the search subspace with a Krylov basis.
None <https://docs.python.org/3/library/constants.html#None>

:sources:`Source code at slepc4py/SLEPc/EPS.pyx:2455 <slepc4py/SLEPc/EPS.pyx#L2455>`


Set the number of vectors of the search space after restart.

Logically collective.

Set the number of vectors of the search space after restart and the number of vectors saved from the previous iteration.


None <https://docs.python.org/3/library/constants.html#None>

:sources:`Source code at slepc4py/SLEPc/EPS.pyx:2519 <slepc4py/SLEPc/EPS.pyx#L2519>`


Set the initial space from which the eigensolver starts to iterate.

Collective.


Notes

Some solvers start to iterate on a single vector (initial vector). In that case, the other vectors are ignored.

In contrast to setDeflationSpace(), these vectors do not persist from one solve() call to the other, so the initial space should be set every time.

The vectors do not need to be mutually orthonormal, since they are explicitly orthonormalized internally.

Common usage of this function is when the user can provide a rough approximation of the wanted eigenspace. Then, convergence may be faster.

:sources:`Source code at slepc4py/SLEPc/EPS.pyx:1272 <slepc4py/SLEPc/EPS.pyx#L1272>`


Set the computational interval for spectrum slicing.

Logically collective.


Notes

Spectrum slicing is a technique employed for computing all eigenvalues of symmetric eigenproblems in a given interval. This function provides the interval to be considered. It must be used in combination with EPS.Which.ALL <#slepc4py.SLEPc.EPS.Which.ALL>, see setWhichEigenpairs().

:sources:`Source code at slepc4py/SLEPc/EPS.pyx:795 <slepc4py/SLEPc/EPS.pyx#L795>`


Set the orthogonalization that will be used in the search subspace.

Logically collective.

Set the orthogonalization that will be used in the search subspace in case of generalized Hermitian problems.


:sources:`Source code at slepc4py/SLEPc/EPS.pyx:2873 <slepc4py/SLEPc/EPS.pyx#L2873>`


Set the number of vectors to be added to the searching space.

Logically collective.

Set the number of vectors to be added to the searching space in every iteration.

bs (int <https://docs.python.org/3/library/functions.html#int>) – The number of vectors added to the search space in every iteration.
None <https://docs.python.org/3/library/constants.html#None>

:sources:`Source code at slepc4py/SLEPc/EPS.pyx:2695 <slepc4py/SLEPc/EPS.pyx#L2695>`


Deactivate the dynamic stopping criterion.

Logically collective.

Deactivate the dynamic stopping criterion that sets the petsc4py.PETSc.KSP <https://petsc.org/release/petsc4py/reference/petsc4py.PETSc.KSP.html#petsc4py.PETSc.KSP> relative tolerance to 0.5**i, where i is the number of EPS iterations from the last converged value.


:sources:`Source code at slepc4py/SLEPc/EPS.pyx:2837 <slepc4py/SLEPc/EPS.pyx#L2837>`


Set the threshold for changing the target in the correction equation.

Logically collective.


Notes

The target in the correction equation is fixed at the first iterations. When the norm of the residual vector is lower than the fix value, the target is set to the corresponding eigenvalue.

:sources:`Source code at slepc4py/SLEPc/EPS.pyx:2802 <slepc4py/SLEPc/EPS.pyx#L2802>`


Set the initial size of the searching space.

Logically collective.

initialsize (int <https://docs.python.org/3/library/functions.html#int>) – The number of vectors of the initial searching subspace.
None <https://docs.python.org/3/library/constants.html#None>

:sources:`Source code at slepc4py/SLEPc/EPS.pyx:2773 <slepc4py/SLEPc/EPS.pyx#L2773>`


Set (toggle) starting the search subspace with a Krylov basis.

Logically collective.

krylovstart (bool <https://docs.python.org/3/library/functions.html#bool>) – True if starting the search subspace with a Krylov basis.
None <https://docs.python.org/3/library/constants.html#None>

:sources:`Source code at slepc4py/SLEPc/EPS.pyx:2666 <slepc4py/SLEPc/EPS.pyx#L2666>`


Set the number of vectors of the search space after restart.

Logically collective.

Set the number of vectors of the search space after restart and the number of vectors saved from the previous iteration.


:sources:`Source code at slepc4py/SLEPc/EPS.pyx:2730 <slepc4py/SLEPc/EPS.pyx#L2730>`


Set the Krylov-Schur variant used for BSE structured eigenproblems.

Logically collective.

bse (KrylovSchurBSEType <#slepc4py.SLEPc.EPS.KrylovSchurBSEType>) – The BSE method.
None <https://docs.python.org/3/library/constants.html#None>

Notes

This call is only relevant if the type was set to EPS.Type.KRYLOVSCHUR <#slepc4py.SLEPc.EPS.Type.KRYLOVSCHUR> with setType() and the problem type to EPS.ProblemType.BSE <#slepc4py.SLEPc.EPS.ProblemType.BSE> with setProblemType().

:sources:`Source code at slepc4py/SLEPc/EPS.pyx:1939 <slepc4py/SLEPc/EPS.pyx#L1939>`


Set the flag that enforces zero detection in spectrum slicing.

Logically collective.

Set a flag to enforce the detection of zeros during the factorizations throughout the spectrum slicing computation.


Notes

A zero in the factorization indicates that a shift coincides with an eigenvalue.

This flag is turned off by default, and may be necessary in some cases, especially when several partitions are being used. This feature currently requires an external package for factorizations with support for zero detection, e.g. MUMPS.

:sources:`Source code at slepc4py/SLEPc/EPS.pyx:2085 <slepc4py/SLEPc/EPS.pyx#L2085>`


Set the dimensions used for each subsolve step (spectrum slicing).

Logically collective.

Set the dimensions used for each subsolve step in case of doing spectrum slicing for a computational interval. The meaning of the parameters is the same as in setDimensions().


:sources:`Source code at slepc4py/SLEPc/EPS.pyx:2127 <slepc4py/SLEPc/EPS.pyx#L2127>`


Set (toggle) locking/non-locking variants of the Krylov-Schur method.

Logically collective.


Notes

The default is to lock converged eigenpairs when the method restarts. This behavior can be changed so that all directions are kept in the working subspace even if already converged to working accuracy (the non-locking variant).

:sources:`Source code at slepc4py/SLEPc/EPS.pyx:2009 <slepc4py/SLEPc/EPS.pyx#L2009>`


Set the number of partitions of the communicator (spectrum slicing).

Logically collective.

Set the number of partitions for the case of doing spectrum slicing for a computational interval with the communicator split in several sub-communicators.


Notes

By default, npart=1 so all processes in the communicator participate in the processing of the whole interval. If npart>1 then the interval is divided into npart subintervals, each of them being processed by a subset of processes.

:sources:`Source code at slepc4py/SLEPc/EPS.pyx:2045 <slepc4py/SLEPc/EPS.pyx#L2045>`


Set the restart parameter for the Krylov-Schur method.

Logically collective.

It is the proportion of basis vectors that must be kept after restart.


Notes

Allowed values are in the range [0.1,0.9]. The default is 0.5.

:sources:`Source code at slepc4py/SLEPc/EPS.pyx:1974 <slepc4py/SLEPc/EPS.pyx#L1974>`


Set the subinterval boundaries.

Logically collective.

Set the subinterval boundaries for spectrum slicing with a computational interval.


Notes

This function must be called after setKrylovSchurPartitions(). For npart partitions, the argument subint must contain npart+1 real values sorted in ascending order: subint_0, subint_1, …, subint_npart, where the first and last values must coincide with the interval endpoints set with EPSSetInterval(). The subintervals are then defined by two consecutive points: [subint_0,subint_1], [subint_1,subint_2], and so on.

:sources:`Source code at slepc4py/SLEPc/EPS.pyx:2342 <slepc4py/SLEPc/EPS.pyx#L2342>`


Set the block size of the LOBPCG method.

Logically collective.


:sources:`Source code at slepc4py/SLEPc/EPS.pyx:2942 <slepc4py/SLEPc/EPS.pyx#L2942>`


Toggle between locking and non-locking (LOBPCG method).

Logically collective.


Notes

This flag refers to soft locking (converged vectors within the current block iterate), since hard locking is always used (when nev is larger than the block size).

:sources:`Source code at slepc4py/SLEPc/EPS.pyx:3008 <slepc4py/SLEPc/EPS.pyx#L3008>`


Set the restart parameter for the LOBPCG method.

Logically collective.

The meaning of this parameter is the proportion of vectors within the current block iterate that must have converged in order to force a restart with hard locking.

restart (float <https://docs.python.org/3/library/functions.html#float>) – The percentage of the block of vectors to force a restart.
None <https://docs.python.org/3/library/constants.html#None>

Notes

Allowed values are in the range [0.1,1.0]. The default is 0.9.

:sources:`Source code at slepc4py/SLEPc/EPS.pyx:2971 <slepc4py/SLEPc/EPS.pyx#L2971>`


Set the type of reorthogonalization used during the Lanczos iteration.

Logically collective.

reorthog (LanczosReorthogType <#slepc4py.SLEPc.EPS.LanczosReorthogType>) – The type of reorthogonalization.
None <https://docs.python.org/3/library/constants.html#None>

Notes

This call is only relevant if the type was set to EPS.Type.LANCZOS <#slepc4py.SLEPc.EPS.Type.LANCZOS> with setType().

:sources:`Source code at slepc4py/SLEPc/EPS.pyx:1902 <slepc4py/SLEPc/EPS.pyx#L1902>`


Set a left initial space from which the eigensolver starts to iterate.

Collective.


Notes

Left initial vectors are used to initiate the left search space in two-sided eigensolvers. Users should pass here an approximation of the left eigenspace, if available.

The same comments in setInitialSpace() are applicable here.

:sources:`Source code at slepc4py/SLEPc/EPS.pyx:1305 <slepc4py/SLEPc/EPS.pyx#L1305>`


Set the ranks used in the solution of the Lyapunov equation.

Logically collective.


:sources:`Source code at slepc4py/SLEPc/EPS.pyx:3043 <slepc4py/SLEPc/EPS.pyx#L3043>`


Append a monitor function to the list of monitors.

Logically collective.

:sources:`Source code at slepc4py/SLEPc/EPS.pyx:1414 <slepc4py/SLEPc/EPS.pyx#L1414>`



Set the matrices associated with the eigenvalue problem.

Collective.


None <https://docs.python.org/3/library/constants.html#None>

:sources:`Source code at slepc4py/SLEPc/EPS.pyx:1221 <slepc4py/SLEPc/EPS.pyx#L1221>`


Set the prefix used for searching for all EPS options in the database.

Logically collective.


Notes

A hyphen (-) must NOT be given at the beginning of the prefix name. The first character of all runtime options is AUTOMATICALLY the hyphen.

For example, to distinguish between the runtime options for two different EPS contexts, one could call:

E1.setOptionsPrefix("eig1_")
E2.setOptionsPrefix("eig2_")


:sources:`Source code at slepc4py/SLEPc/EPS.pyx:394 <slepc4py/SLEPc/EPS.pyx#L394>`


Set the type of shifts used during the power iteration.

Logically collective.

This can be used to emulate the Rayleigh Quotient Iteration (RQI) method.

shift (PowerShiftType <#slepc4py.SLEPc.EPS.PowerShiftType>) – The type of shift.
None <https://docs.python.org/3/library/constants.html#None>

Notes

This call is only relevant if the type was set to EPS.Type.POWER <#slepc4py.SLEPc.EPS.Type.POWER> with setType().

By default, shifts are constant (EPS.PowerShiftType.CONSTANT <#slepc4py.SLEPc.EPS.PowerShiftType.CONSTANT>) and the iteration is the simple power method (or inverse iteration if a shift-and-invert transformation is being used).

A variable shift can be specified (EPS.PowerShiftType.RAYLEIGH <#slepc4py.SLEPc.EPS.PowerShiftType.RAYLEIGH> or EPS.PowerShiftType.WILKINSON <#slepc4py.SLEPc.EPS.PowerShiftType.WILKINSON>). In this case, the iteration behaves rather like a cubic converging method as RQI.

:sources:`Source code at slepc4py/SLEPc/EPS.pyx:1816 <slepc4py/SLEPc/EPS.pyx#L1816>`


Set the type of the eigenvalue problem.

Logically collective.

problem_type (ProblemType <#slepc4py.SLEPc.EPS.ProblemType>) – The problem type to be set.
None <https://docs.python.org/3/library/constants.html#None>

Notes

Allowed values are: Hermitian (HEP), non-Hermitian (NHEP), generalized Hermitian (GHEP), generalized non-Hermitian (GNHEP), and generalized non-Hermitian with positive semi-definite B (PGNHEP).

This function must be used to instruct SLEPc to exploit symmetry. If no problem type is specified, by default a non-Hermitian problem is assumed (either standard or generalized). If the user knows that the problem is Hermitian (i.e. A=A^H) or generalized Hermitian (i.e. A=A^H, B=B^H, and B positive definite) then it is recommended to set the problem type so that eigensolver can exploit these properties.

:sources:`Source code at slepc4py/SLEPc/EPS.pyx:469 <slepc4py/SLEPc/EPS.pyx#L469>`


Set (toggle) eigenvector purification.

Logically collective.


:sources:`Source code at slepc4py/SLEPc/EPS.pyx:911 <slepc4py/SLEPc/EPS.pyx#L911>`


Set a region object associated to the eigensolver.

Collective.

rg (RG <#slepc4py.SLEPc.RG>) – The region context.
None <https://docs.python.org/3/library/constants.html#None>

:sources:`Source code at slepc4py/SLEPc/EPS.pyx:1185 <slepc4py/SLEPc/EPS.pyx#L1185>`


Set the reset parameter of the RQCG iteration.

Logically collective.

Every nrest iterations the solver performs a Rayleigh-Ritz projection step.


:sources:`Source code at slepc4py/SLEPc/EPS.pyx:2910 <slepc4py/SLEPc/EPS.pyx#L2910>`


Set a spectral transformation object associated to the eigensolver.

Collective.

st (ST <#slepc4py.SLEPc.ST>) – The spectral transformation.
None <https://docs.python.org/3/library/constants.html#None>

:sources:`Source code at slepc4py/SLEPc/EPS.pyx:1098 <slepc4py/SLEPc/EPS.pyx#L1098>`


Set when to stop the outer iteration of the eigensolver.

Logically collective.

:sources:`Source code at slepc4py/SLEPc/EPS.pyx:1333 <slepc4py/SLEPc/EPS.pyx#L1333>`



Set the value of the target.

Logically collective.

target (Scalar <#slepc4py.typing.Scalar>) – The value of the target.
None <https://docs.python.org/3/library/constants.html#None>

Notes

The target is a scalar value used to determine the portion of the spectrum of interest. It is used in combination with setWhichEigenpairs().

:sources:`Source code at slepc4py/SLEPc/EPS.pyx:753 <slepc4py/SLEPc/EPS.pyx#L753>`


Set the threshold used in the threshold stopping test.

Logically collective.


Notes

This function internally sets a special stopping test based on the threshold, where eigenvalues are computed in sequence until one of the computed eigenvalues is below/above the threshold (depending on whether largest or smallest eigenvalues are computed).

:sources:`Source code at slepc4py/SLEPc/EPS.pyx:709 <slepc4py/SLEPc/EPS.pyx#L709>`


Set the tolerance and max. iter. used by the default EPS convergence tests.

Logically collective.


Notes

Use DECIDE <#slepc4py.SLEPc.DECIDE> for maxits to assign a reasonably good value, which is dependent on the solution method.

:sources:`Source code at slepc4py/SLEPc/EPS.pyx:843 <slepc4py/SLEPc/EPS.pyx#L843>`


Set if the solver must compute the residual of all approximate eigenpairs.

Logically collective.


:sources:`Source code at slepc4py/SLEPc/EPS.pyx:1000 <slepc4py/SLEPc/EPS.pyx#L1000>`


Set if the solver must compute the true residual explicitly or not.

Logically collective.


:sources:`Source code at slepc4py/SLEPc/EPS.pyx:971 <slepc4py/SLEPc/EPS.pyx#L971>`


Set to use a two-sided variant that also computes left eigenvectors.

Logically collective.

twosided (bool <https://docs.python.org/3/library/functions.html#bool>) – Whether the two-sided variant is to be used or not.
None <https://docs.python.org/3/library/constants.html#None>

:sources:`Source code at slepc4py/SLEPc/EPS.pyx:882 <slepc4py/SLEPc/EPS.pyx#L882>`


Set the particular solver to be used in the EPS object.

Logically collective.

eps_type (Type <#slepc4py.SLEPc.EPS.Type> | str <https://docs.python.org/3/library/stdtypes.html#str>) – The solver to be used.
None <https://docs.python.org/3/library/constants.html#None>

Notes

See EPS.Type <#slepc4py.SLEPc.EPS.Type> for available methods. The default is EPS.Type.KRYLOVSCHUR <#slepc4py.SLEPc.EPS.Type.KRYLOVSCHUR>. Normally, it is best to use setFromOptions() and then set the EPS type from the options database rather than by using this routine. Using the options database provides the user with maximum flexibility in evaluating the different available methods.

:sources:`Source code at slepc4py/SLEPc/EPS.pyx:340 <slepc4py/SLEPc/EPS.pyx#L340>`


Set up all the internal data structures.

Collective.

Set up all the internal data structures necessary for the execution of the eigensolver.

Notes

This function need not be called explicitly in most cases, since solve() calls it. It can be useful when one wants to measure the set-up time separately from the solve time.

:sources:`Source code at slepc4py/SLEPc/EPS.pyx:1450 <slepc4py/SLEPc/EPS.pyx#L1450>`



Set which portion of the spectrum is to be sought.

Logically collective.

which (Which <#slepc4py.SLEPc.EPS.Which>) – The portion of the spectrum to be sought by the solver.
None <https://docs.python.org/3/library/constants.html#None>

Notes

Not all eigensolvers implemented in EPS account for all the possible values. Also, some values make sense only for certain types of problems. If SLEPc is compiled for real numbers EPS.Which.LARGEST_IMAGINARY <#slepc4py.SLEPc.EPS.Which.LARGEST_IMAGINARY> and EPS.Which.SMALLEST_IMAGINARY <#slepc4py.SLEPc.EPS.Which.SMALLEST_IMAGINARY> use the absolute value of the imaginary part for eigenvalue selection.

:sources:`Source code at slepc4py/SLEPc/EPS.pyx:668 <slepc4py/SLEPc/EPS.pyx#L668>`


Solve the eigensystem.

Collective.

:sources:`Source code at slepc4py/SLEPc/EPS.pyx:1467 <slepc4py/SLEPc/EPS.pyx#L1467>`



Update the eigenproblem matrices stored internally in the communicator.

Collective.

Update the eigenproblem matrices stored internally in the subcommunicator to which the calling process belongs.


None <https://docs.python.org/3/library/constants.html#None>

Notes

This function modifies the eigenproblem matrices at subcommunicator level, and optionally updates the global matrices in the parent communicator. The updates are expressed as A \leftarrow s A + a Au, B \leftarrow t B + b Bu.

It is possible to update one of the matrices, or both.

The matrices Au and Bu must be equal in all subcommunicators.

The structure flag is passed to the petsc4py.PETSc.Mat.axpy <https://petsc.org/release/petsc4py/reference/petsc4py.PETSc.Mat.html#petsc4py.PETSc.Mat.axpy> operations to perform the updates.

If globalup is True, communication is carried out to reconstruct the updated matrices in the parent communicator.

:sources:`Source code at slepc4py/SLEPc/EPS.pyx:2279 <slepc4py/SLEPc/EPS.pyx#L2279>`


Display the computed eigenvalues in a viewer.

Collective.


:sources:`Source code at slepc4py/SLEPc/EPS.pyx:1784 <slepc4py/SLEPc/EPS.pyx#L1784>`


Output computed eigenvectors to a viewer.

Collective.


:sources:`Source code at slepc4py/SLEPc/EPS.pyx:1799 <slepc4py/SLEPc/EPS.pyx#L1799>`


Print the EPS data structure.

Collective.


:sources:`Source code at slepc4py/SLEPc/EPS.pyx:290 <slepc4py/SLEPc/EPS.pyx#L290>`


Attributes Documentation

The basis vectors (BV) object associated.

:sources:`Source code at slepc4py/SLEPc/EPS.pyx:3427 <slepc4py/SLEPc/EPS.pyx#L3427>`


The direct solver (DS) object associated.

:sources:`Source code at slepc4py/SLEPc/EPS.pyx:3441 <slepc4py/SLEPc/EPS.pyx#L3441>`


The type of extraction technique to be employed.

:sources:`Source code at slepc4py/SLEPc/EPS.pyx:3357 <slepc4py/SLEPc/EPS.pyx#L3357>`


The maximum iteration count.

:sources:`Source code at slepc4py/SLEPc/EPS.pyx:3385 <slepc4py/SLEPc/EPS.pyx#L3385>`


The type of the eigenvalue problem.

:sources:`Source code at slepc4py/SLEPc/EPS.pyx:3350 <slepc4py/SLEPc/EPS.pyx#L3350>`


Eigenvector purification.

:sources:`Source code at slepc4py/SLEPc/EPS.pyx:3406 <slepc4py/SLEPc/EPS.pyx#L3406>`


The region (RG) object associated.

:sources:`Source code at slepc4py/SLEPc/EPS.pyx:3434 <slepc4py/SLEPc/EPS.pyx#L3434>`


The spectral transformation (ST) object associated.

:sources:`Source code at slepc4py/SLEPc/EPS.pyx:3420 <slepc4py/SLEPc/EPS.pyx#L3420>`


The value of the target.

:sources:`Source code at slepc4py/SLEPc/EPS.pyx:3371 <slepc4py/SLEPc/EPS.pyx#L3371>`


The tolerance.

:sources:`Source code at slepc4py/SLEPc/EPS.pyx:3378 <slepc4py/SLEPc/EPS.pyx#L3378>`


Compute the residual norm of all approximate eigenpairs.

:sources:`Source code at slepc4py/SLEPc/EPS.pyx:3413 <slepc4py/SLEPc/EPS.pyx#L3413>`


Compute the true residual explicitly.

:sources:`Source code at slepc4py/SLEPc/EPS.pyx:3399 <slepc4py/SLEPc/EPS.pyx#L3399>`


Two-sided that also computes left eigenvectors.

:sources:`Source code at slepc4py/SLEPc/EPS.pyx:3392 <slepc4py/SLEPc/EPS.pyx#L3392>`


The portion of the spectrum to be sought.

:sources:`Source code at slepc4py/SLEPc/EPS.pyx:3364 <slepc4py/SLEPc/EPS.pyx#L3364>`




slepc4py.SLEPc.EPSKrylovSchurBSEType

Bases: object <https://docs.python.org/3/library/functions.html#object>

EPS Krylov-Schur method for BSE problems.

  • SHAO: Lanczos recurrence for H square.
  • GRUNING: Lanczos recurrence for H.
  • PROJECTEDBSE: Lanczos where the projected problem has BSE structure.

Attributes Summary

GRUNING Constant GRUNING of type int <https://docs.python.org/3/library/functions.html#int>
PROJECTEDBSE Constant PROJECTEDBSE of type int <https://docs.python.org/3/library/functions.html#int>
SHAO Constant SHAO of type int <https://docs.python.org/3/library/functions.html#int>

Attributes Documentation





slepc4py.SLEPc.FN

Bases: Object <https://petsc.org/release/petsc4py/reference/petsc4py.PETSc.Object.html#petsc4py.PETSc.Object>

FN.

Enumerations

CombineType <#slepc4py.SLEPc.FN.CombineType> FN type of combination of child functions.
ParallelType <#slepc4py.SLEPc.FN.ParallelType> FN parallel types.
Type <#slepc4py.SLEPc.FN.Type> FN type.

slepc4py.SLEPc.FN.CombineType

Bases: object <https://docs.python.org/3/library/functions.html#object>

FN type of combination of child functions.

  • ADD: Addition f(x) = f1(x)+f2(x)
  • MULTIPLY: Multiplication f(x) = f1(x)*f2(x)
  • DIVIDE: Division f(x) = f1(x)/f2(x)
  • COMPOSE: Composition f(x) = f2(f1(x))

Attributes Summary

ADD Constant ADD of type int <https://docs.python.org/3/library/functions.html#int>
COMPOSE Constant COMPOSE of type int <https://docs.python.org/3/library/functions.html#int>
DIVIDE Constant DIVIDE of type int <https://docs.python.org/3/library/functions.html#int>
MULTIPLY Constant MULTIPLY of type int <https://docs.python.org/3/library/functions.html#int>

Attributes Documentation






slepc4py.SLEPc.FN.ParallelType

Bases: object <https://docs.python.org/3/library/functions.html#object>

FN parallel types.

  • REDUNDANT: Every process performs the computation redundantly.
  • SYNCHRONIZED: The first process sends the result to the rest.

Attributes Summary

REDUNDANT Constant REDUNDANT of type int <https://docs.python.org/3/library/functions.html#int>
SYNCHRONIZED Constant SYNCHRONIZED of type int <https://docs.python.org/3/library/functions.html#int>

Attributes Documentation




slepc4py.SLEPc.FN.Type

Bases: object <https://docs.python.org/3/library/functions.html#object>

FN type.

Attributes Summary

COMBINE Object COMBINE of type str <https://docs.python.org/3/library/stdtypes.html#str>
EXP Object EXP of type str <https://docs.python.org/3/library/stdtypes.html#str>
INVSQRT Object INVSQRT of type str <https://docs.python.org/3/library/stdtypes.html#str>
LOG Object LOG of type str <https://docs.python.org/3/library/stdtypes.html#str>
PHI Object PHI of type str <https://docs.python.org/3/library/stdtypes.html#str>
RATIONAL Object RATIONAL of type str <https://docs.python.org/3/library/stdtypes.html#str>
SQRT Object SQRT of type str <https://docs.python.org/3/library/stdtypes.html#str>

Attributes Documentation









Methods Summary

appendOptionsPrefix([prefix]) Append to the prefix used for searching for all FN options in the database.
create([comm]) Create the FN object.
destroy() Destroy the FN object.
duplicate([comm]) Duplicate the FN object copying all parameters.
evaluateDerivative(x) Compute the value of the derivative f'(x) for a given x.
evaluateFunction(x) Compute the value of the function f(x) for a given x.
evaluateFunctionMat(A[, B]) Compute the value of the function f(A) for a given matrix A.
evaluateFunctionMatVec(A[, v]) Compute the first column of the matrix f(A) for a given matrix A.
getCombineChildren() Get the two child functions that constitute this combined function.
getMethod() Get the method currently used for matrix functions.
getOptionsPrefix() Get the prefix used for searching for all FN options in the database.
getParallel() Get the mode of operation in parallel runs.
getPhiIndex() Get the index of the phi-function.
getRationalDenominator() Get the coefficients of the denominator of the rational function.
getRationalNumerator() Get the coefficients of the numerator of the rational function.
getScale() Get the scaling parameters that define the matematical function.
getType() Get the FN type of this object.
setCombineChildren(comb, f1, f2) Set the two child functions that constitute this combined function.
setFromOptions() Set FN options from the options database.
setMethod(meth) Set the method to be used to evaluate functions of matrices.
setOptionsPrefix([prefix]) Set the prefix used for searching for all FN options in the database.
setParallel(pmode) Set the mode of operation in parallel runs.
setPhiIndex(k) Set the index of the phi-function.
setRationalDenominator(alpha) Set the coefficients of the denominator of the rational function.
setRationalNumerator(alpha) Set the coefficients of the numerator of the rational function.
setScale([alpha, beta]) Set the scaling parameters that define the matematical function.
setType(fn_type) Set the type for the FN object.
view([viewer]) Print the FN data structure.

Attributes Summary

method The method to be used to evaluate functions of matrices.
parallel The mode of operation in parallel runs.

Methods Documentation

Append to the prefix used for searching for all FN options in the database.

Logically collective.


:sources:`Source code at slepc4py/SLEPc/FN.pyx:212 <slepc4py/SLEPc/FN.pyx#L212>`


Create the FN object.

Collective.


:sources:`Source code at slepc4py/SLEPc/FN.pyx:144 <slepc4py/SLEPc/FN.pyx#L144>`


Destroy the FN object.

Collective.

:sources:`Source code at slepc4py/SLEPc/FN.pyx:134 <slepc4py/SLEPc/FN.pyx#L134>`



Duplicate the FN object copying all parameters.

Collective.

Duplicate the FN object copying all parameters, possibly with a different communicator.

comm (Comm <https://petsc.org/release/petsc4py/reference/petsc4py.PETSc.Comm.html#petsc4py.PETSc.Comm> | None <https://docs.python.org/3/library/constants.html#None>) – MPI communicator; if not provided, it defaults to the object’s communicator.
FN <#slepc4py.SLEPc.FN>

:sources:`Source code at slepc4py/SLEPc/FN.pyx:255 <slepc4py/SLEPc/FN.pyx#L255>`


Compute the value of the derivative f'(x) for a given x.

Not collective.

x (Scalar <#slepc4py.typing.Scalar>) – Value where the derivative must be evaluated.
The result of f'(x).
Scalar <#slepc4py.typing.Scalar>

:sources:`Source code at slepc4py/SLEPc/FN.pyx:298 <slepc4py/SLEPc/FN.pyx#L298>`


Compute the value of the function f(x) for a given x.

Not collective.

x (Scalar <#slepc4py.typing.Scalar>) – Value where the function must be evaluated.
The result of f(x).
Scalar <#slepc4py.typing.Scalar>

:sources:`Source code at slepc4py/SLEPc/FN.pyx:277 <slepc4py/SLEPc/FN.pyx#L277>`


Compute the value of the function f(A) for a given matrix A.

Logically collective.


:sources:`Source code at slepc4py/SLEPc/FN.pyx:319 <slepc4py/SLEPc/FN.pyx#L319>`


Compute the first column of the matrix f(A) for a given matrix A.

Logically collective.


:sources:`Source code at slepc4py/SLEPc/FN.pyx:341 <slepc4py/SLEPc/FN.pyx#L341>`


Get the two child functions that constitute this combined function.

Not collective.

Get the two child functions that constitute this combined function, and the way they must be combined.

  • comb (CombineType <#slepc4py.SLEPc.FN.CombineType>) – How to combine the functions (addition, multiplication, division, composition).
  • f1 (FN) – First function.
  • f2 (FN) – Second function.

tuple <https://docs.python.org/3/library/stdtypes.html#tuple>[CombineType <#slepc4py.SLEPc.FN.CombineType>, FN <#slepc4py.SLEPc.FN>, FN <#slepc4py.SLEPc.FN>]

:sources:`Source code at slepc4py/SLEPc/FN.pyx:564 <slepc4py/SLEPc/FN.pyx#L564>`


Get the method currently used for matrix functions.

Not collective.


:sources:`Source code at slepc4py/SLEPc/FN.pyx:422 <slepc4py/SLEPc/FN.pyx#L422>`


Get the prefix used for searching for all FN options in the database.

Not collective.

The prefix string set for this FN object.
str <https://docs.python.org/3/library/stdtypes.html#str>

:sources:`Source code at slepc4py/SLEPc/FN.pyx:227 <slepc4py/SLEPc/FN.pyx#L227>`


Get the mode of operation in parallel runs.

Not collective.

The parallel mode.
ParallelType <#slepc4py.SLEPc.FN.ParallelType>

:sources:`Source code at slepc4py/SLEPc/FN.pyx:451 <slepc4py/SLEPc/FN.pyx#L451>`


Get the index of the phi-function.

Not collective.


:sources:`Source code at slepc4py/SLEPc/FN.pyx:605 <slepc4py/SLEPc/FN.pyx#L605>`


Get the coefficients of the denominator of the rational function.

Not collective.

Coefficients.
ArrayScalar <#slepc4py.typing.ArrayScalar>

:sources:`Source code at slepc4py/SLEPc/FN.pyx:521 <slepc4py/SLEPc/FN.pyx#L521>`


Get the coefficients of the numerator of the rational function.

Not collective.

Coefficients.
ArrayScalar <#slepc4py.typing.ArrayScalar>

:sources:`Source code at slepc4py/SLEPc/FN.pyx:484 <slepc4py/SLEPc/FN.pyx#L484>`


Get the scaling parameters that define the matematical function.

Not collective.

  • alpha (Scalar <#slepc4py.typing.Scalar>) – Inner scaling (argument).
  • beta (Scalar <#slepc4py.typing.Scalar>) – Outer scaling (result).

tuple <https://docs.python.org/3/library/stdtypes.html#tuple>[Scalar <#slepc4py.typing.Scalar>, Scalar <#slepc4py.typing.Scalar>]

:sources:`Source code at slepc4py/SLEPc/FN.pyx:380 <slepc4py/SLEPc/FN.pyx#L380>`


Get the FN type of this object.

Not collective.

The inner product type currently being used.
str <https://docs.python.org/3/library/stdtypes.html#str>

:sources:`Source code at slepc4py/SLEPc/FN.pyx:176 <slepc4py/SLEPc/FN.pyx#L176>`


Set the two child functions that constitute this combined function.

Logically collective.

Set the two child functions that constitute this combined function, and the way they must be combined.

  • comb (CombineType <#slepc4py.SLEPc.FN.CombineType>) – How to combine the functions (addition, multiplication, division, composition).
  • f1 (FN <#slepc4py.SLEPc.FN>) – First function.
  • f2 (FN <#slepc4py.SLEPc.FN>) – Second function.

None <https://docs.python.org/3/library/constants.html#None>

:sources:`Source code at slepc4py/SLEPc/FN.pyx:542 <slepc4py/SLEPc/FN.pyx#L542>`


Set FN options from the options database.

Collective.

Notes

To see all options, run your program with the -help option.

:sources:`Source code at slepc4py/SLEPc/FN.pyx:242 <slepc4py/SLEPc/FN.pyx#L242>`



Set the method to be used to evaluate functions of matrices.

Logically collective.


Notes

In some FN types there are more than one algorithms available for computing matrix functions. In that case, this function allows choosing the wanted method.

If meth is currently set to 0 and the input argument of FN.evaluateFunctionMat() is a symmetric/Hermitian matrix, then the computation is done via the eigendecomposition, rather than with the general algorithm.

:sources:`Source code at slepc4py/SLEPc/FN.pyx:397 <slepc4py/SLEPc/FN.pyx#L397>`


Set the prefix used for searching for all FN options in the database.

Logically collective.


Notes

A hyphen (-) must NOT be given at the beginning of the prefix name. The first character of all runtime options is AUTOMATICALLY the hyphen.

:sources:`Source code at slepc4py/SLEPc/FN.pyx:191 <slepc4py/SLEPc/FN.pyx#L191>`


Set the mode of operation in parallel runs.

Logically collective.

pmode (ParallelType <#slepc4py.SLEPc.FN.ParallelType>) – The parallel mode.
None <https://docs.python.org/3/library/constants.html#None>

:sources:`Source code at slepc4py/SLEPc/FN.pyx:437 <slepc4py/SLEPc/FN.pyx#L437>`


Set the index of the phi-function.

Logically collective.


:sources:`Source code at slepc4py/SLEPc/FN.pyx:591 <slepc4py/SLEPc/FN.pyx#L591>`


Set the coefficients of the denominator of the rational function.

Logically collective.


:sources:`Source code at slepc4py/SLEPc/FN.pyx:505 <slepc4py/SLEPc/FN.pyx#L505>`


Set the coefficients of the numerator of the rational function.

Logically collective.


:sources:`Source code at slepc4py/SLEPc/FN.pyx:468 <slepc4py/SLEPc/FN.pyx#L468>`


Set the scaling parameters that define the matematical function.

Logically collective.


None <https://docs.python.org/3/library/constants.html#None>

:sources:`Source code at slepc4py/SLEPc/FN.pyx:361 <slepc4py/SLEPc/FN.pyx#L361>`


Set the type for the FN object.

Logically collective.

fn_type (Type <#slepc4py.SLEPc.FN.Type> | str <https://docs.python.org/3/library/stdtypes.html#str>) – The inner product type to be used.
None <https://docs.python.org/3/library/constants.html#None>

:sources:`Source code at slepc4py/SLEPc/FN.pyx:161 <slepc4py/SLEPc/FN.pyx#L161>`


Print the FN data structure.

Collective.


:sources:`Source code at slepc4py/SLEPc/FN.pyx:119 <slepc4py/SLEPc/FN.pyx#L119>`


Attributes Documentation

The method to be used to evaluate functions of matrices.

:sources:`Source code at slepc4py/SLEPc/FN.pyx:622 <slepc4py/SLEPc/FN.pyx#L622>`


The mode of operation in parallel runs.

:sources:`Source code at slepc4py/SLEPc/FN.pyx:629 <slepc4py/SLEPc/FN.pyx#L629>`




slepc4py.SLEPc.LME

Bases: Object <https://petsc.org/release/petsc4py/reference/petsc4py.PETSc.Object.html#petsc4py.PETSc.Object>

LME.

Enumerations

ConvergedReason <#slepc4py.SLEPc.LME.ConvergedReason> LME convergence reasons.
ProblemType <#slepc4py.SLEPc.LME.ProblemType> LME problem type.
Type <#slepc4py.SLEPc.LME.Type> LME type.

slepc4py.SLEPc.LME.ConvergedReason

Bases: object <https://docs.python.org/3/library/functions.html#object>

LME convergence reasons.

  • CONVERGED_TOL: All eigenpairs converged to requested tolerance.
  • DIVERGED_ITS: Maximum number of iterations exceeded.
  • DIVERGED_BREAKDOWN: Solver failed due to breakdown.
  • CONVERGED_ITERATING: Iteration not finished yet.

Attributes Summary

CONVERGED_ITERATING Constant CONVERGED_ITERATING of type int <https://docs.python.org/3/library/functions.html#int>
CONVERGED_TOL Constant CONVERGED_TOL of type int <https://docs.python.org/3/library/functions.html#int>
DIVERGED_BREAKDOWN Constant DIVERGED_BREAKDOWN of type int <https://docs.python.org/3/library/functions.html#int>
DIVERGED_ITS Constant DIVERGED_ITS of type int <https://docs.python.org/3/library/functions.html#int>
ITERATING Constant ITERATING of type int <https://docs.python.org/3/library/functions.html#int>

Attributes Documentation







slepc4py.SLEPc.LME.ProblemType

Bases: object <https://docs.python.org/3/library/functions.html#object>

LME problem type.

  • LYAPUNOV: Continuous-time Lyapunov.
  • SYLVESTER: Continuous-time Sylvester.
  • GEN_LYAPUNOV: Generalized Lyapunov.
  • GEN_SYLVESTER: Generalized Sylvester.
  • DT_LYAPUNOV: Discrete-time Lyapunov.
  • STEIN: Stein.

Attributes Summary

DT_LYAPUNOV Constant DT_LYAPUNOV of type int <https://docs.python.org/3/library/functions.html#int>
GEN_LYAPUNOV Constant GEN_LYAPUNOV of type int <https://docs.python.org/3/library/functions.html#int>
GEN_SYLVESTER Constant GEN_SYLVESTER of type int <https://docs.python.org/3/library/functions.html#int>
LYAPUNOV Constant LYAPUNOV of type int <https://docs.python.org/3/library/functions.html#int>
STEIN Constant STEIN of type int <https://docs.python.org/3/library/functions.html#int>
SYLVESTER Constant SYLVESTER of type int <https://docs.python.org/3/library/functions.html#int>

Attributes Documentation








slepc4py.SLEPc.LME.Type

Bases: object <https://docs.python.org/3/library/functions.html#object>

LME type.

KRYLOV: Restarted Krylov solver.

Attributes Summary

KRYLOV Object KRYLOV of type str <https://docs.python.org/3/library/stdtypes.html#str>

Attributes Documentation



Methods Summary

appendOptionsPrefix([prefix]) Append to the prefix used for searching in the database.
cancelMonitor() Clear all monitors for an LME object.
computeError() Compute the error associated with the last equation solved.
create([comm]) Create the LME object.
destroy() Destroy the LME object.
getBV() Get the basis vector object associated to the LME object.
getCoefficients() Get the coefficient matrices of the matrix equation.
getConvergedReason() Get the reason why the solve() iteration was stopped.
getDimensions() Get the dimension of the subspace used by the solver.
getErrorEstimate() Get the error estimate obtained during solve.
getErrorIfNotConverged() Get if solve() generates an error if the solver does not converge.
getIterationNumber() Get the current iteration number.
getMonitor() Get the list of monitor functions.
getOptionsPrefix() Get the prefix used for searching for all LME options in the database.
getProblemType() Get the LME problem type of this object.
getRHS() Get the right-hand side of the matrix equation.
getSolution() Get the solution of the matrix equation.
getTolerances() Get the tolerance and maximum iteration count.
getType() Get the LME type of this object.
reset() Reset the LME object.
setBV(bv) Set a basis vector object to the LME object.
setCoefficients(A[, B, D, E]) Set the coefficient matrices.
setDimensions(ncv) Set the dimension of the subspace to be used by the solver.
setErrorIfNotConverged([flg]) Set solve() to generate an error if the solver has not converged.
setFromOptions() Set LME options from the options database.
setMonitor(monitor[, args, kargs]) Append a monitor function to the list of monitors.
setOptionsPrefix([prefix]) Set the prefix used for searching for all LME options in the database.
setProblemType(lme_problem_type) Set the LME problem type of this object.
setRHS(C) Set the right-hand side of the matrix equation.
setSolution(X) Set the placeholder for the solution of the matrix equation.
setTolerances([tol, max_it]) Set the tolerance and maximum iteration count.
setType(lme_type) Set the particular solver to be used in the LME object.
setUp() Set up all the internal necessary data structures.
solve() Solve the linear matrix equation.
view([viewer]) Print the LME data structure.

Attributes Summary

bv The basis vectors (BV) object associated to the LME object.
fn The math function (FN) object associated to the LME object.
max_it The maximum iteration count used by the LME convergence tests.
tol The tolerance value used by the LME convergence tests.

Methods Documentation

Append to the prefix used for searching in the database.

Logically collective.

Append to the prefix used for searching for all LME options in the database.


:sources:`Source code at slepc4py/SLEPc/LME.pyx:350 <slepc4py/SLEPc/LME.pyx#L350>`


Clear all monitors for an LME object.

:sources:`Source code at slepc4py/SLEPc/LME.pyx:508 <slepc4py/SLEPc/LME.pyx#L508>`



Compute the error associated with the last equation solved.

Collective.

Computes the error (based on the residual norm) associated with the last equation solved.


:sources:`Source code at slepc4py/SLEPc/LME.pyx:302 <slepc4py/SLEPc/LME.pyx#L302>`


Create the LME object.

Collective.


:sources:`Source code at slepc4py/SLEPc/LME.pyx:91 <slepc4py/SLEPc/LME.pyx#L91>`


Destroy the LME object.

Collective.

:sources:`Source code at slepc4py/SLEPc/LME.pyx:73 <slepc4py/SLEPc/LME.pyx#L73>`



Get the basis vector object associated to the LME object.

Not collective.

The basis vectors context.
BV <#slepc4py.SLEPc.BV>

:sources:`Source code at slepc4py/SLEPc/LME.pyx:452 <slepc4py/SLEPc/LME.pyx#L452>`



Get the reason why the solve() iteration was stopped.

Not collective.

Negative value indicates diverged, positive value converged.
ConvergedReason <#slepc4py.SLEPc.LME.ConvergedReason>

:sources:`Source code at slepc4py/SLEPc/LME.pyx:552 <slepc4py/SLEPc/LME.pyx#L552>`


Get the dimension of the subspace used by the solver.

Not collective.

Maximum dimension of the subspace to be used by the solver.
int <https://docs.python.org/3/library/functions.html#int>

:sources:`Source code at slepc4py/SLEPc/LME.pyx:423 <slepc4py/SLEPc/LME.pyx#L423>`


Get the error estimate obtained during solve.

Not collective.


:sources:`Source code at slepc4py/SLEPc/LME.pyx:287 <slepc4py/SLEPc/LME.pyx#L287>`


Get if solve() generates an error if the solver does not converge.

Not collective.

Get a flag indicating whether solve() will generate an error if the solver does not converge.

True indicates you want the error generated.
bool <https://docs.python.org/3/library/functions.html#bool>

:sources:`Source code at slepc4py/SLEPc/LME.pyx:581 <slepc4py/SLEPc/LME.pyx#L581>`


Get the current iteration number.

Not collective.

If the call to solve() is complete, then it returns the number of iterations carried out by the solution method.


:sources:`Source code at slepc4py/SLEPc/LME.pyx:534 <slepc4py/SLEPc/LME.pyx#L534>`


Get the list of monitor functions.

:sources:`Source code at slepc4py/SLEPc/LME.pyx:502 <slepc4py/SLEPc/LME.pyx#L502>`

LMEMonitorFunction <#slepc4py.typing.LMEMonitorFunction>


Get the prefix used for searching for all LME options in the database.

Not collective.

The prefix string set for this LME object.
str <https://docs.python.org/3/library/stdtypes.html#str>

:sources:`Source code at slepc4py/SLEPc/LME.pyx:320 <slepc4py/SLEPc/LME.pyx#L320>`


Get the LME problem type of this object.

Not collective.

The problem type currently being used.
ProblemType <#slepc4py.SLEPc.LME.ProblemType>

:sources:`Source code at slepc4py/SLEPc/LME.pyx:152 <slepc4py/SLEPc/LME.pyx#L152>`


Get the right-hand side of the matrix equation.

Collective.

The low-rank matrix
C <#slepc4py.SLEPc.DS.MatType.C>

:sources:`Source code at slepc4py/SLEPc/LME.pyx:239 <slepc4py/SLEPc/LME.pyx#L239>`


Get the solution of the matrix equation.

Collective.

The low-rank matrix
X <#slepc4py.SLEPc.DS.MatType.X>

:sources:`Source code at slepc4py/SLEPc/LME.pyx:271 <slepc4py/SLEPc/LME.pyx#L271>`


Get the tolerance and maximum iteration count.

Not collective.

Get the tolerance and maximum iteration count used by the default LME convergence tests.


:sources:`Source code at slepc4py/SLEPc/LME.pyx:380 <slepc4py/SLEPc/LME.pyx#L380>`


Get the LME type of this object.

Not collective.


:sources:`Source code at slepc4py/SLEPc/LME.pyx:123 <slepc4py/SLEPc/LME.pyx#L123>`


Reset the LME object.

Collective.

:sources:`Source code at slepc4py/SLEPc/LME.pyx:83 <slepc4py/SLEPc/LME.pyx#L83>`



Set a basis vector object to the LME object.

Collective.

bv (BV <#slepc4py.SLEPc.BV>) – The basis vectors context.
None <https://docs.python.org/3/library/constants.html#None>

:sources:`Source code at slepc4py/SLEPc/LME.pyx:468 <slepc4py/SLEPc/LME.pyx#L468>`


Set the coefficient matrices.

Collective.

Set the coefficient matrices that define the linear matrix equation to be solved.


:sources:`Source code at slepc4py/SLEPc/LME.pyx:167 <slepc4py/SLEPc/LME.pyx#L167>`


Set the dimension of the subspace to be used by the solver.

Logically collective.

ncv (int <https://docs.python.org/3/library/functions.html#int>) – Maximum dimension of the subspace to be used by the solver.
None <https://docs.python.org/3/library/constants.html#None>

:sources:`Source code at slepc4py/SLEPc/LME.pyx:438 <slepc4py/SLEPc/LME.pyx#L438>`


Set solve() to generate an error if the solver has not converged.

Logically collective.


:sources:`Source code at slepc4py/SLEPc/LME.pyx:567 <slepc4py/SLEPc/LME.pyx#L567>`


Set LME options from the options database.

Collective.

Sets LME options from the options database. This routine must be called before setUp() if the user is to be allowed to set the solver type.

:sources:`Source code at slepc4py/SLEPc/LME.pyx:368 <slepc4py/SLEPc/LME.pyx#L368>`



Append a monitor function to the list of monitors.

Logically collective.

:sources:`Source code at slepc4py/SLEPc/LME.pyx:481 <slepc4py/SLEPc/LME.pyx#L481>`



Set the prefix used for searching for all LME options in the database.

Logically collective.


:sources:`Source code at slepc4py/SLEPc/LME.pyx:335 <slepc4py/SLEPc/LME.pyx#L335>`


Set the LME problem type of this object.

Logically collective.

lme_problem_type (ProblemType <#slepc4py.SLEPc.LME.ProblemType> | str <https://docs.python.org/3/library/stdtypes.html#str>) – The problem type to be used.
None <https://docs.python.org/3/library/constants.html#None>

:sources:`Source code at slepc4py/SLEPc/LME.pyx:138 <slepc4py/SLEPc/LME.pyx#L138>`


Set the right-hand side of the matrix equation.

Collective.

Set the right-hand side of the matrix equation, as a low-rank matrix.


:sources:`Source code at slepc4py/SLEPc/LME.pyx:223 <slepc4py/SLEPc/LME.pyx#L223>`


Set the placeholder for the solution of the matrix equation.

Collective.

Set the placeholder for the solution of the matrix equation, as a low-rank matrix.


:sources:`Source code at slepc4py/SLEPc/LME.pyx:255 <slepc4py/SLEPc/LME.pyx#L255>`


Set the tolerance and maximum iteration count.

Logically collective.

Set the tolerance and maximum iteration count used by the default LME convergence tests.


:sources:`Source code at slepc4py/SLEPc/LME.pyx:401 <slepc4py/SLEPc/LME.pyx#L401>`


Set the particular solver to be used in the LME object.

Logically collective.

lme_type (Type <#slepc4py.SLEPc.LME.Type> | str <https://docs.python.org/3/library/stdtypes.html#str>) – The solver to be used.
None <https://docs.python.org/3/library/constants.html#None>

:sources:`Source code at slepc4py/SLEPc/LME.pyx:108 <slepc4py/SLEPc/LME.pyx#L108>`


Set up all the internal necessary data structures.

Collective.

Set up all the internal data structures necessary for the execution of the eigensolver.

:sources:`Source code at slepc4py/SLEPc/LME.pyx:515 <slepc4py/SLEPc/LME.pyx#L515>`



Solve the linear matrix equation.

Collective.

:sources:`Source code at slepc4py/SLEPc/LME.pyx:526 <slepc4py/SLEPc/LME.pyx#L526>`



Print the LME data structure.

Collective.


:sources:`Source code at slepc4py/SLEPc/LME.pyx:58 <slepc4py/SLEPc/LME.pyx#L58>`


Attributes Documentation

The basis vectors (BV) object associated to the LME object.

:sources:`Source code at slepc4py/SLEPc/LME.pyx:622 <slepc4py/SLEPc/LME.pyx#L622>`


The math function (FN) object associated to the LME object.

:sources:`Source code at slepc4py/SLEPc/LME.pyx:615 <slepc4py/SLEPc/LME.pyx#L615>`


The maximum iteration count used by the LME convergence tests.

:sources:`Source code at slepc4py/SLEPc/LME.pyx:608 <slepc4py/SLEPc/LME.pyx#L608>`


The tolerance value used by the LME convergence tests.

:sources:`Source code at slepc4py/SLEPc/LME.pyx:601 <slepc4py/SLEPc/LME.pyx#L601>`




slepc4py.SLEPc.MFN

Bases: Object <https://petsc.org/release/petsc4py/reference/petsc4py.PETSc.Object.html#petsc4py.PETSc.Object>

MFN.

Enumerations

ConvergedReason <#slepc4py.SLEPc.MFN.ConvergedReason> MFN convergence reasons.
Type <#slepc4py.SLEPc.MFN.Type> MFN type.

slepc4py.SLEPc.MFN.ConvergedReason

Bases: object <https://docs.python.org/3/library/functions.html#object>

MFN convergence reasons.

  • ‘MFN_CONVERGED_TOL’: All eigenpairs converged to requested tolerance.
  • ‘MFN_CONVERGED_ITS’: Solver completed the requested number of steps.
  • ‘MFN_DIVERGED_ITS’: Maximum number of iterations exceeded.
  • ‘MFN_DIVERGED_BREAKDOWN’: Generic breakdown in method.

Attributes Summary

CONVERGED_ITERATING Constant CONVERGED_ITERATING of type int <https://docs.python.org/3/library/functions.html#int>
CONVERGED_ITS Constant CONVERGED_ITS of type int <https://docs.python.org/3/library/functions.html#int>
CONVERGED_TOL Constant CONVERGED_TOL of type int <https://docs.python.org/3/library/functions.html#int>
DIVERGED_BREAKDOWN Constant DIVERGED_BREAKDOWN of type int <https://docs.python.org/3/library/functions.html#int>
DIVERGED_ITS Constant DIVERGED_ITS of type int <https://docs.python.org/3/library/functions.html#int>
ITERATING Constant ITERATING of type int <https://docs.python.org/3/library/functions.html#int>

Attributes Documentation








slepc4py.SLEPc.MFN.Type

Bases: object <https://docs.python.org/3/library/functions.html#object>

MFN type.

Action of a matrix function on a vector.

  • KRYLOV: Restarted Krylov solver.
  • EXPOKIT: Implementation of the method in Expokit.

Attributes Summary

EXPOKIT Object EXPOKIT of type str <https://docs.python.org/3/library/stdtypes.html#str>
KRYLOV Object KRYLOV of type str <https://docs.python.org/3/library/stdtypes.html#str>

Attributes Documentation




Methods Summary

appendOptionsPrefix([prefix]) Append to the prefix used for searching for all MFN options in the database.
cancelMonitor() Clear all monitors for an MFN object.
create([comm]) Create the MFN object.
destroy() Destroy the MFN object.
getBV() Get the basis vector object associated to the MFN object.
getConvergedReason() Get the reason why the solve() iteration was stopped.
getDimensions() Get the dimension of the subspace used by the solver.
getErrorIfNotConverged() Get if solve() generates an error if the solver does not converge.
getFN() Get the math function object associated to the MFN object.
getIterationNumber() Get the current iteration number.
getMonitor() Get the list of monitor functions.
getOperator() Get the matrix associated with the MFN object.
getOptionsPrefix() Get the prefix used for searching for all MFN options in the database.
getTolerances() Get the tolerance and maximum iteration count.
getType() Get the MFN type of this object.
reset() Reset the MFN object.
setBV(bv) Set a basis vector object associated to the MFN object.
setDimensions(ncv) Set the dimension of the subspace to be used by the solver.
setErrorIfNotConverged([flg]) Set solve() to generate an error if the solver does not converge.
setFN(fn) Set a math function object associated to the MFN object.
setFromOptions() Set MFN options from the options database.
setMonitor(monitor[, args, kargs]) Append a monitor function to the list of monitors.
setOperator(A) Set the matrix associated with the MFN object.
setOptionsPrefix([prefix]) Set the prefix used for searching for all MFN options in the database.
setTolerances([tol, max_it]) Set the tolerance and maximum iteration count.
setType(mfn_type) Set the particular solver to be used in the MFN object.
setUp() Set up all the necessary internal data structures.
solve(b, x) Solve the matrix function problem.
solveTranspose(b, x) Solve the transpose matrix function problem.
view([viewer]) Print the MFN data structure.

Attributes Summary

bv The basis vectors (BV) object associated to the MFN object.
fn The math function (FN) object associated to the MFN object.
max_it The maximum iteration count used by the MFN convergence tests.
tol The tolerance count used by the MFN convergence tests.

Methods Documentation

Append to the prefix used for searching for all MFN options in the database.

Logically collective.


:sources:`Source code at slepc4py/SLEPc/MFN.pyx:154 <slepc4py/SLEPc/MFN.pyx#L154>`


Clear all monitors for an MFN object.

Logically collective.

:sources:`Source code at slepc4py/SLEPc/MFN.pyx:367 <slepc4py/SLEPc/MFN.pyx#L367>`



Create the MFN object.

Collective.


:sources:`Source code at slepc4py/SLEPc/MFN.pyx:77 <slepc4py/SLEPc/MFN.pyx#L77>`


Destroy the MFN object.

Logically collective.

:sources:`Source code at slepc4py/SLEPc/MFN.pyx:59 <slepc4py/SLEPc/MFN.pyx#L59>`



Get the basis vector object associated to the MFN object.

Not collective.

The basis vectors context.
BV <#slepc4py.SLEPc.BV>

:sources:`Source code at slepc4py/SLEPc/MFN.pyx:282 <slepc4py/SLEPc/MFN.pyx#L282>`


Get the reason why the solve() iteration was stopped.

Not collective.

Negative value indicates diverged, positive value converged.
ConvergedReason <#slepc4py.SLEPc.MFN.ConvergedReason>

:sources:`Source code at slepc4py/SLEPc/MFN.pyx:444 <slepc4py/SLEPc/MFN.pyx#L444>`


Get the dimension of the subspace used by the solver.

Not collective.

Maximum dimension of the subspace to be used by the solver.
int <https://docs.python.org/3/library/functions.html#int>

:sources:`Source code at slepc4py/SLEPc/MFN.pyx:224 <slepc4py/SLEPc/MFN.pyx#L224>`


Get if solve() generates an error if the solver does not converge.

Not collective.

Get a flag indicating whether solve() will generate an error if the solver does not converge.

True indicates you want the error generated.
bool <https://docs.python.org/3/library/functions.html#bool>

:sources:`Source code at slepc4py/SLEPc/MFN.pyx:473 <slepc4py/SLEPc/MFN.pyx#L473>`


Get the math function object associated to the MFN object.

Not collective.

The math function context.
FN <#slepc4py.SLEPc.FN>

:sources:`Source code at slepc4py/SLEPc/MFN.pyx:253 <slepc4py/SLEPc/MFN.pyx#L253>`


Get the current iteration number.

Not collective.

Get the current iteration number. If the call to solve() is complete, then it returns the number of iterations carried out by the solution method.


:sources:`Source code at slepc4py/SLEPc/MFN.pyx:425 <slepc4py/SLEPc/MFN.pyx#L425>`


Get the list of monitor functions.

:sources:`Source code at slepc4py/SLEPc/MFN.pyx:363 <slepc4py/SLEPc/MFN.pyx#L363>`

MFNMonitorFunction <#slepc4py.typing.MFNMonitorFunction>


Get the matrix associated with the MFN object.

Collective.

The matrix for which the matrix function is to be computed.
petsc4py.PETSc.Mat <https://petsc.org/release/petsc4py/reference/petsc4py.PETSc.Mat.html#petsc4py.PETSc.Mat>

:sources:`Source code at slepc4py/SLEPc/MFN.pyx:311 <slepc4py/SLEPc/MFN.pyx#L311>`


Get the prefix used for searching for all MFN options in the database.

Not collective.

The prefix string set for this MFN object.
str <https://docs.python.org/3/library/stdtypes.html#str>

:sources:`Source code at slepc4py/SLEPc/MFN.pyx:124 <slepc4py/SLEPc/MFN.pyx#L124>`


Get the tolerance and maximum iteration count.

Not collective.

Get the tolerance and maximum iteration count used by the default MFN convergence tests.


:sources:`Source code at slepc4py/SLEPc/MFN.pyx:181 <slepc4py/SLEPc/MFN.pyx#L181>`


Get the MFN type of this object.

Not collective.


:sources:`Source code at slepc4py/SLEPc/MFN.pyx:109 <slepc4py/SLEPc/MFN.pyx#L109>`


Reset the MFN object.

Collective.

:sources:`Source code at slepc4py/SLEPc/MFN.pyx:69 <slepc4py/SLEPc/MFN.pyx#L69>`



Set a basis vector object associated to the MFN object.

Collective.

bv (BV <#slepc4py.SLEPc.BV>) – The basis vectors context.
None <https://docs.python.org/3/library/constants.html#None>

:sources:`Source code at slepc4py/SLEPc/MFN.pyx:298 <slepc4py/SLEPc/MFN.pyx#L298>`


Set the dimension of the subspace to be used by the solver.

Logically collective.

ncv (int <https://docs.python.org/3/library/functions.html#int>) – Maximum dimension of the subspace to be used by the solver.
None <https://docs.python.org/3/library/constants.html#None>

:sources:`Source code at slepc4py/SLEPc/MFN.pyx:239 <slepc4py/SLEPc/MFN.pyx#L239>`


Set solve() to generate an error if the solver does not converge.

Logically collective.


:sources:`Source code at slepc4py/SLEPc/MFN.pyx:459 <slepc4py/SLEPc/MFN.pyx#L459>`


Set a math function object associated to the MFN object.

Collective.

fn (FN <#slepc4py.SLEPc.FN>) – The math function context.
None <https://docs.python.org/3/library/constants.html#None>

:sources:`Source code at slepc4py/SLEPc/MFN.pyx:269 <slepc4py/SLEPc/MFN.pyx#L269>`


Set MFN options from the options database.

Collective.

Set MFN options from the options database. This routine must be called before setUp() if the user is to be allowed to set the solver type.

:sources:`Source code at slepc4py/SLEPc/MFN.pyx:169 <slepc4py/SLEPc/MFN.pyx#L169>`



Append a monitor function to the list of monitors.

Logically collective.

:sources:`Source code at slepc4py/SLEPc/MFN.pyx:342 <slepc4py/SLEPc/MFN.pyx#L342>`



Set the matrix associated with the MFN object.

Collective.


:sources:`Source code at slepc4py/SLEPc/MFN.pyx:327 <slepc4py/SLEPc/MFN.pyx#L327>`


Set the prefix used for searching for all MFN options in the database.

Logically collective.


:sources:`Source code at slepc4py/SLEPc/MFN.pyx:139 <slepc4py/SLEPc/MFN.pyx#L139>`


Set the tolerance and maximum iteration count.

Logically collective.

Set the tolerance and maximum iteration count used by the default MFN convergence tests.


:sources:`Source code at slepc4py/SLEPc/MFN.pyx:202 <slepc4py/SLEPc/MFN.pyx#L202>`


Set the particular solver to be used in the MFN object.

Logically collective.

mfn_type (Type <#slepc4py.SLEPc.MFN.Type> | str <https://docs.python.org/3/library/stdtypes.html#str>) – The solver to be used.
None <https://docs.python.org/3/library/constants.html#None>

:sources:`Source code at slepc4py/SLEPc/MFN.pyx:94 <slepc4py/SLEPc/MFN.pyx#L94>`


Set up all the necessary internal data structures.

Collective.

Set up all the internal data structures necessary for the execution of the eigensolver.

:sources:`Source code at slepc4py/SLEPc/MFN.pyx:378 <slepc4py/SLEPc/MFN.pyx#L378>`



Solve the matrix function problem.

Collective.

Given a vector b, the vector x = f(A) b is returned.


:sources:`Source code at slepc4py/SLEPc/MFN.pyx:389 <slepc4py/SLEPc/MFN.pyx#L389>`


Solve the transpose matrix function problem.

Collective.

Given a vector b, the vector x = f(A^T) b is returned.


:sources:`Source code at slepc4py/SLEPc/MFN.pyx:407 <slepc4py/SLEPc/MFN.pyx#L407>`


Print the MFN data structure.

Collective.


:sources:`Source code at slepc4py/SLEPc/MFN.pyx:44 <slepc4py/SLEPc/MFN.pyx#L44>`


Attributes Documentation

The basis vectors (BV) object associated to the MFN object.

:sources:`Source code at slepc4py/SLEPc/MFN.pyx:514 <slepc4py/SLEPc/MFN.pyx#L514>`


The math function (FN) object associated to the MFN object.

:sources:`Source code at slepc4py/SLEPc/MFN.pyx:507 <slepc4py/SLEPc/MFN.pyx#L507>`


The maximum iteration count used by the MFN convergence tests.

:sources:`Source code at slepc4py/SLEPc/MFN.pyx:500 <slepc4py/SLEPc/MFN.pyx#L500>`


The tolerance count used by the MFN convergence tests.

:sources:`Source code at slepc4py/SLEPc/MFN.pyx:493 <slepc4py/SLEPc/MFN.pyx#L493>`




slepc4py.SLEPc.NEP

Bases: Object <https://petsc.org/release/petsc4py/reference/petsc4py.PETSc.Object.html#petsc4py.PETSc.Object>

NEP.

Enumerations

CISSExtraction <#slepc4py.SLEPc.NEP.CISSExtraction> NEP CISS extraction technique.
Conv <#slepc4py.SLEPc.NEP.Conv> NEP convergence test.
ConvergedReason <#slepc4py.SLEPc.NEP.ConvergedReason> NEP convergence reasons.
ErrorType <#slepc4py.SLEPc.NEP.ErrorType> NEP error type to assess accuracy of computed solutions.
ProblemType <#slepc4py.SLEPc.NEP.ProblemType> NEP problem type.
Refine <#slepc4py.SLEPc.NEP.Refine> NEP refinement strategy.
RefineScheme <#slepc4py.SLEPc.NEP.RefineScheme> NEP scheme for solving linear systems during iterative refinement.
Stop <#slepc4py.SLEPc.NEP.Stop> NEP stopping test.
Type <#slepc4py.SLEPc.NEP.Type> NEP type.
Which <#slepc4py.SLEPc.NEP.Which> NEP desired part of spectrum.

slepc4py.SLEPc.NEP.CISSExtraction

Bases: object <https://docs.python.org/3/library/functions.html#object>

NEP CISS extraction technique.

  • RITZ: Ritz extraction.
  • HANKEL: Extraction via Hankel eigenproblem.
  • CAA: Communication-avoiding Arnoldi.

Attributes Summary

CAA Constant CAA of type int <https://docs.python.org/3/library/functions.html#int>
HANKEL Constant HANKEL of type int <https://docs.python.org/3/library/functions.html#int>
RITZ Constant RITZ of type int <https://docs.python.org/3/library/functions.html#int>

Attributes Documentation





slepc4py.SLEPc.NEP.Conv

Bases: object <https://docs.python.org/3/library/functions.html#object>

NEP convergence test.

  • ABS: Absolute convergence test.
  • REL: Convergence test relative to the eigenvalue.
  • NORM: Convergence test relative to the matrix norms.
  • USER: User-defined convergence test.

Attributes Summary

ABS Constant ABS of type int <https://docs.python.org/3/library/functions.html#int>
NORM Constant NORM of type int <https://docs.python.org/3/library/functions.html#int>
REL Constant REL of type int <https://docs.python.org/3/library/functions.html#int>
USER Constant USER of type int <https://docs.python.org/3/library/functions.html#int>

Attributes Documentation






slepc4py.SLEPc.NEP.ConvergedReason

Bases: object <https://docs.python.org/3/library/functions.html#object>

NEP convergence reasons.



  • DIVERGED_ITS: Maximum number of iterations exceeded.
  • DIVERGED_BREAKDOWN: Solver failed due to breakdown.
  • DIVERGED_LINEAR_SOLVE: Inner linear solve failed.

CONVERGED_ITERATING: Iteration not finished yet.

Attributes Summary

CONVERGED_ITERATING Constant CONVERGED_ITERATING of type int <https://docs.python.org/3/library/functions.html#int>
CONVERGED_TOL Constant CONVERGED_TOL of type int <https://docs.python.org/3/library/functions.html#int>
CONVERGED_USER Constant CONVERGED_USER of type int <https://docs.python.org/3/library/functions.html#int>
DIVERGED_BREAKDOWN Constant DIVERGED_BREAKDOWN of type int <https://docs.python.org/3/library/functions.html#int>
DIVERGED_ITS Constant DIVERGED_ITS of type int <https://docs.python.org/3/library/functions.html#int>
DIVERGED_LINEAR_SOLVE Constant DIVERGED_LINEAR_SOLVE of type int <https://docs.python.org/3/library/functions.html#int>
DIVERGED_SUBSPACE_EXHAUSTED Constant DIVERGED_SUBSPACE_EXHAUSTED of type int <https://docs.python.org/3/library/functions.html#int>
ITERATING Constant ITERATING of type int <https://docs.python.org/3/library/functions.html#int>

Attributes Documentation










slepc4py.SLEPc.NEP.ErrorType

Bases: object <https://docs.python.org/3/library/functions.html#object>

NEP error type to assess accuracy of computed solutions.

  • ABSOLUTE: Absolute error.
  • RELATIVE: Relative error.
  • BACKWARD: Backward error.

Attributes Summary

ABSOLUTE Constant ABSOLUTE of type int <https://docs.python.org/3/library/functions.html#int>
BACKWARD Constant BACKWARD of type int <https://docs.python.org/3/library/functions.html#int>
RELATIVE Constant RELATIVE of type int <https://docs.python.org/3/library/functions.html#int>

Attributes Documentation





slepc4py.SLEPc.NEP.ProblemType

Bases: object <https://docs.python.org/3/library/functions.html#object>

NEP problem type.

  • GENERAL: General nonlinear eigenproblem.
  • RATIONAL: NEP defined in split form with all f_i rational.

Attributes Summary

GENERAL Constant GENERAL of type int <https://docs.python.org/3/library/functions.html#int>
RATIONAL Constant RATIONAL of type int <https://docs.python.org/3/library/functions.html#int>

Attributes Documentation




slepc4py.SLEPc.NEP.Refine

Bases: object <https://docs.python.org/3/library/functions.html#object>

NEP refinement strategy.

  • NONE: No refinement.
  • SIMPLE: Refine eigenpairs one by one.
  • MULTIPLE: Refine all eigenpairs simultaneously (invariant pair).

Attributes Summary

MULTIPLE Constant MULTIPLE of type int <https://docs.python.org/3/library/functions.html#int>
NONE Constant NONE of type int <https://docs.python.org/3/library/functions.html#int>
SIMPLE Constant SIMPLE of type int <https://docs.python.org/3/library/functions.html#int>

Attributes Documentation





slepc4py.SLEPc.NEP.RefineScheme

Bases: object <https://docs.python.org/3/library/functions.html#object>

NEP scheme for solving linear systems during iterative refinement.

  • SCHUR: Schur complement.
  • MBE: Mixed block elimination.
  • EXPLICIT: Build the explicit matrix.

Attributes Summary

EXPLICIT Constant EXPLICIT of type int <https://docs.python.org/3/library/functions.html#int>
MBE Constant MBE of type int <https://docs.python.org/3/library/functions.html#int>
SCHUR Constant SCHUR of type int <https://docs.python.org/3/library/functions.html#int>

Attributes Documentation





slepc4py.SLEPc.NEP.Stop

Bases: object <https://docs.python.org/3/library/functions.html#object>

NEP stopping test.

  • BASIC: Default stopping test.
  • USER: User-defined stopping test.

Attributes Summary

BASIC Constant BASIC of type int <https://docs.python.org/3/library/functions.html#int>
USER Constant USER of type int <https://docs.python.org/3/library/functions.html#int>

Attributes Documentation




slepc4py.SLEPc.NEP.Type

Bases: object <https://docs.python.org/3/library/functions.html#object>

NEP type.

Nonlinear eigensolvers.

  • RII: Residual inverse iteration.
  • SLP: Successive linear problems.
  • NARNOLDI: Nonlinear Arnoldi.
  • CISS: Contour integral spectrum slice.
  • INTERPOL: Polynomial interpolation.
  • NLEIGS: Fully rational Krylov method for nonlinear eigenproblems.

Attributes Summary

CISS Object CISS of type str <https://docs.python.org/3/library/stdtypes.html#str>
INTERPOL Object INTERPOL of type str <https://docs.python.org/3/library/stdtypes.html#str>
NARNOLDI Object NARNOLDI of type str <https://docs.python.org/3/library/stdtypes.html#str>
NLEIGS Object NLEIGS of type str <https://docs.python.org/3/library/stdtypes.html#str>
RII Object RII of type str <https://docs.python.org/3/library/stdtypes.html#str>
SLP Object SLP of type str <https://docs.python.org/3/library/stdtypes.html#str>

Attributes Documentation








slepc4py.SLEPc.NEP.Which

Bases: object <https://docs.python.org/3/library/functions.html#object>

NEP desired part of spectrum.

  • LARGEST_MAGNITUDE: Largest magnitude (default).
  • SMALLEST_MAGNITUDE: Smallest magnitude.
  • LARGEST_REAL: Largest real parts.
  • SMALLEST_REAL: Smallest real parts.
  • LARGEST_IMAGINARY: Largest imaginary parts in magnitude.
  • SMALLEST_IMAGINARY: Smallest imaginary parts in magnitude.
  • TARGET_MAGNITUDE: Closest to target (in magnitude).
  • TARGET_REAL: Real part closest to target.
  • TARGET_IMAGINARY: Imaginary part closest to target.
  • ALL: All eigenvalues in a region.
  • USER: User defined selection.

Attributes Summary

ALL Constant ALL of type int <https://docs.python.org/3/library/functions.html#int>
LARGEST_IMAGINARY Constant LARGEST_IMAGINARY of type int <https://docs.python.org/3/library/functions.html#int>
LARGEST_MAGNITUDE Constant LARGEST_MAGNITUDE of type int <https://docs.python.org/3/library/functions.html#int>
LARGEST_REAL Constant LARGEST_REAL of type int <https://docs.python.org/3/library/functions.html#int>
SMALLEST_IMAGINARY Constant SMALLEST_IMAGINARY of type int <https://docs.python.org/3/library/functions.html#int>
SMALLEST_MAGNITUDE Constant SMALLEST_MAGNITUDE of type int <https://docs.python.org/3/library/functions.html#int>
SMALLEST_REAL Constant SMALLEST_REAL of type int <https://docs.python.org/3/library/functions.html#int>
TARGET_IMAGINARY Constant TARGET_IMAGINARY of type int <https://docs.python.org/3/library/functions.html#int>
TARGET_MAGNITUDE Constant TARGET_MAGNITUDE of type int <https://docs.python.org/3/library/functions.html#int>
TARGET_REAL Constant TARGET_REAL of type int <https://docs.python.org/3/library/functions.html#int>
USER Constant USER of type int <https://docs.python.org/3/library/functions.html#int>

Attributes Documentation













Methods Summary

appendOptionsPrefix([prefix]) Append to the prefix used for searching for all NEP options in the database.
applyResolvent(omega, v, r[, rg]) Apply the resolvent T^{-1}(z) to a given vector.
cancelMonitor() Clear all monitors for a NEP object.
computeError(i[, etype]) Compute the error associated with the i-th computed eigenpair.
create([comm]) Create the NEP object.
destroy() Destroy the NEP object.
errorView([etype, viewer]) Display the errors associated with the computed solution.
getBV() Get the basis vectors object associated to the eigensolver.
getCISSExtraction() Get the extraction technique used in the CISS solver.
getCISSKSPs() Get the list of linear solver objects associated with the CISS solver.
getCISSRefinement() Get the values of various refinement parameters in the CISS solver.
getCISSSizes() Get the values of various size parameters in the CISS solver.
getCISSThreshold() Get the values of various threshold parameters in the CISS solver.
getConverged() Get the number of converged eigenpairs.
getConvergedReason() Get the reason why the solve() iteration was stopped.
getConvergenceTest() Get the method used to compute the error estimate used in the convergence test.
getDS() Get the direct solver associated to the eigensolver.
getDimensions() Get the number of eigenvalues to compute.
getEigenpair(i[, Vr, Vi]) Get the i-th solution of the eigenproblem as computed by solve().
getErrorEstimate(i) Get the error estimate associated to the i-th computed eigenpair.
getFunction() Get the function to compute the nonlinear Function T(\lambda).
getInterpolInterpolation() Get the tolerance and maximum degree for the interpolation polynomial.
getInterpolPEP() Get the associated polynomial eigensolver object.
getIterationNumber() Get the current iteration number.
getJacobian() Get the function to compute the Jacobian T'(\lambda) and J.
getLeftEigenvector(i, Wr[, Wi]) Get the i-th left eigenvector as computed by solve().
getMonitor() Get the list of monitor functions.
getNArnoldiKSP() Get the linear solver object associated with the nonlinear eigensolver.
getNArnoldiLagPreconditioner() Get how often the preconditioner is rebuilt.
getNLEIGSEPS() Get the linear eigensolver object associated with the nonlinear eigensolver.
getNLEIGSFullBasis() Get the flag that indicates if NLEIGS is using the full-basis variant.
getNLEIGSInterpolation() Get the tolerance and maximum degree for the interpolation polynomial.
getNLEIGSKSPs() Get the list of linear solver objects associated with the NLEIGS solver.
getNLEIGSLocking() Get the locking flag used in the NLEIGS method.
getNLEIGSRKShifts() Get the list of shifts used in the Rational Krylov method.
getNLEIGSRestart() Get the restart parameter used in the NLEIGS method.
getOptionsPrefix() Get the prefix used for searching for all NEP options in the database.
getProblemType() Get the problem type from the NEP object.
getRG() Get the region object associated to the eigensolver.
getRIIConstCorrectionTol() Get the constant tolerance flag.
getRIIDeflationThreshold() Get the threshold value that controls deflation.
getRIIHermitian() Get if the Hermitian version must be used by the solver.
getRIIKSP() Get the linear solver object associated with the nonlinear eigensolver.
getRIILagPreconditioner() Get how often the preconditioner is rebuilt.
getRIIMaximumIterations() Get the maximum number of inner iterations of RII.
getRefine() Get the refinement strategy used by the NEP object.
getRefineKSP() Get the KSP object used by the eigensolver in the refinement phase.
getSLPDeflationThreshold() Get the threshold value that controls deflation.
getSLPEPS() Get the linear eigensolver object associated with the nonlinear eigensolver.
getSLPEPSLeft() Get the left eigensolver.
getSLPKSP() Get the linear solver object associated with the nonlinear eigensolver.
getSplitOperator() Get the operator of the nonlinear eigenvalue problem in split form.
getSplitPreconditioner() Get the operator of the split preconditioner.
getStoppingTest() Get the stopping function.
getTarget() Get the value of the target.
getTolerances() Get the tolerance and maximum iteration count.
getTrackAll() Get the flag indicating whether all residual norms must be computed.
getTwoSided() Get the flag indicating if a two-sided variant is being used.
getType() Get the NEP type of this object.
getWhichEigenpairs() Get which portion of the spectrum is to be sought.
reset() Reset the NEP object.
setBV(bv) Set the basis vectors object associated to the eigensolver.
setCISSExtraction(extraction) Set the extraction technique used in the CISS solver.
setCISSRefinement([inner, blsize]) Set the values of various refinement parameters in the CISS solver.
setCISSSizes([ip, bs, ms, npart, bsmax, ...]) Set the values of various size parameters in the CISS solver.
setCISSThreshold([delta, spur]) Set the values of various threshold parameters in the CISS solver.
setConvergenceTest(conv) Set how to compute the error estimate used in the convergence test.
setDS(ds) Set a direct solver object associated to the eigensolver.
setDimensions([nev, ncv, mpd]) Set the number of eigenvalues to compute.
setFromOptions() Set NEP options from the options database.
setFunction(function[, F, P, args, kargs]) Set the function to compute the nonlinear Function T(\lambda).
setInitialSpace(space) Set the initial space from which the eigensolver starts to iterate.
setInterpolInterpolation([tol, deg]) Set the tolerance and maximum degree for the interpolation polynomial.
setInterpolPEP(pep) Set a polynomial eigensolver object associated to the nonlinear eigensolver.
setJacobian(jacobian[, J, args, kargs]) Set the function to compute the Jacobian T'(\lambda).
setMonitor(monitor[, args, kargs]) Append a monitor function to the list of monitors.
setNArnoldiKSP(ksp) Set a linear solver object associated to the nonlinear eigensolver.
setNArnoldiLagPreconditioner(lag) Set when the preconditioner is rebuilt in the nonlinear solve.
setNLEIGSEPS(eps) Set a linear eigensolver object associated to the nonlinear eigensolver.
setNLEIGSFullBasis([fullbasis]) Set TOAR-basis (default) or full-basis variants of the NLEIGS method.
setNLEIGSInterpolation([tol, deg]) Set the tolerance and maximum degree for the interpolation polynomial.
setNLEIGSLocking(lock) Toggle between locking and non-locking variants of the NLEIGS method.
setNLEIGSRKShifts(shifts) Set a list of shifts to be used in the Rational Krylov method.
setNLEIGSRestart(keep) Set the restart parameter for the NLEIGS method.
setOptionsPrefix([prefix]) Set the prefix used for searching for all NEP options in the database.
setProblemType(problem_type) Set the type of the eigenvalue problem.
setRG(rg) Set a region object associated to the eigensolver.
setRIIConstCorrectionTol(cct) Set a flag to keep the tolerance used in the linear solver constant.
setRIIDeflationThreshold(deftol) Set the threshold used to switch between deflated and non-deflated.
setRIIHermitian(herm) Set a flag to use the Hermitian version of the solver.
setRIIKSP(ksp) Set a linear solver object associated to the nonlinear eigensolver.
setRIILagPreconditioner(lag) Set when the preconditioner is rebuilt in the nonlinear solve.
setRIIMaximumIterations(its) Set the max.
setRefine(ref[, npart, tol, its, scheme]) Set the refinement strategy used by the NEP object.
setSLPDeflationThreshold(deftol) Set the threshold used to switch between deflated and non-deflated.
setSLPEPS(eps) Set a linear eigensolver object associated to the nonlinear eigensolver.
setSLPEPSLeft(eps) Set a linear eigensolver object associated to the nonlinear eigensolver.
setSLPKSP(ksp) Set a linear solver object associated to the nonlinear eigensolver.
setSplitOperator(A, f[, structure]) Set the operator of the nonlinear eigenvalue problem in split form.
setSplitPreconditioner(P[, structure]) Set the operator in split form.
setStoppingTest(stopping[, args, kargs]) Set a function to decide when to stop the outer iteration of the eigensolver.
setTarget(target) Set the value of the target.
setTolerances([tol, maxit]) Set the tolerance and max.
setTrackAll(trackall) Set if the solver must compute the residual of all approximate eigenpairs.
setTwoSided(twosided) Set the solver to use a two-sided variant.
setType(nep_type) Set the particular solver to be used in the NEP object.
setUp() Set up all the necessary internal data structures.
setWhichEigenpairs(which) Set which portion of the spectrum is to be sought.
solve() Solve the eigensystem.
valuesView([viewer]) Display the computed eigenvalues in a viewer.
vectorsView([viewer]) Output computed eigenvectors to a viewer.
view([viewer]) Print the NEP data structure.

Attributes Summary

bv The basis vectors (BV) object associated.
ds The direct solver (DS) object associated.
max_it The maximum iteration count used by the NEP convergence tests.
problem_type The problem type from the NEP object.
rg The region (RG) object associated.
target The value of the target.
tol The tolerance used by the NEP convergence tests.
track_all Compute the residual of all approximate eigenpairs.
which The portion of the spectrum to be sought.

Methods Documentation

Append to the prefix used for searching for all NEP options in the database.

Logically collective.


:sources:`Source code at slepc4py/SLEPc/NEP.pyx:289 <slepc4py/SLEPc/NEP.pyx#L289>`


Apply the resolvent T^{-1}(z) to a given vector.

Collective.


None <https://docs.python.org/3/library/constants.html#None>

:sources:`Source code at slepc4py/SLEPc/NEP.pyx:1339 <slepc4py/SLEPc/NEP.pyx#L1339>`


Clear all monitors for a NEP object.

Logically collective.

:sources:`Source code at slepc4py/SLEPc/NEP.pyx:821 <slepc4py/SLEPc/NEP.pyx#L821>`



Compute the error associated with the i-th computed eigenpair.

Collective.

Compute the error (based on the residual norm) associated with the i-th computed eigenpair.


The error bound, computed in various ways from the residual norm \|T(\lambda)x\|_2 where \lambda is the eigenvalue and x is the eigenvector.
float <https://docs.python.org/3/library/functions.html#float>

:sources:`Source code at slepc4py/SLEPc/NEP.pyx:978 <slepc4py/SLEPc/NEP.pyx#L978>`


Create the NEP object.

Collective.


:sources:`Source code at slepc4py/SLEPc/NEP.pyx:212 <slepc4py/SLEPc/NEP.pyx#L212>`


Destroy the NEP object.

Collective.

:sources:`Source code at slepc4py/SLEPc/NEP.pyx:194 <slepc4py/SLEPc/NEP.pyx#L194>`



Display the errors associated with the computed solution.

Collective.

Display the eigenvalues and the errors associated with the computed solution


None <https://docs.python.org/3/library/constants.html#None>

Notes

By default, this function checks the error of all eigenpairs and prints the eigenvalues if all of them are below the requested tolerance. If the viewer has format ASCII_INFO_DETAIL then a table with eigenvalues and corresponding errors is printed.

:sources:`Source code at slepc4py/SLEPc/NEP.pyx:1007 <slepc4py/SLEPc/NEP.pyx#L1007>`


Get the basis vectors object associated to the eigensolver.

Not collective.

The basis vectors context.
BV <#slepc4py.SLEPc.BV>

:sources:`Source code at slepc4py/SLEPc/NEP.pyx:653 <slepc4py/SLEPc/NEP.pyx#L653>`


Get the extraction technique used in the CISS solver.

Not collective.

The extraction technique.
CISSExtraction <#slepc4py.SLEPc.NEP.CISSExtraction>

:sources:`Source code at slepc4py/SLEPc/NEP.pyx:2068 <slepc4py/SLEPc/NEP.pyx#L2068>`


Get the list of linear solver objects associated with the CISS solver.

Collective.


Notes

The number of petsc4py.PETSc.KSP <https://petsc.org/release/petsc4py/reference/petsc4py.PETSc.KSP.html#petsc4py.PETSc.KSP> solvers is equal to the number of integration points divided by the number of partitions. This value is halved in the case of real matrices with a region centered at the real axis.

:sources:`Source code at slepc4py/SLEPc/NEP.pyx:2237 <slepc4py/SLEPc/NEP.pyx#L2237>`


Get the values of various refinement parameters in the CISS solver.

Not collective.


:sources:`Source code at slepc4py/SLEPc/NEP.pyx:2219 <slepc4py/SLEPc/NEP.pyx#L2219>`


Get the values of various size parameters in the CISS solver.

Not collective.


:sources:`Source code at slepc4py/SLEPc/NEP.pyx:2133 <slepc4py/SLEPc/NEP.pyx#L2133>`


Get the values of various threshold parameters in the CISS solver.

Not collective.


:sources:`Source code at slepc4py/SLEPc/NEP.pyx:2182 <slepc4py/SLEPc/NEP.pyx#L2182>`


Get the number of converged eigenpairs.

Not collective.


:sources:`Source code at slepc4py/SLEPc/NEP.pyx:885 <slepc4py/SLEPc/NEP.pyx#L885>`


Get the reason why the solve() iteration was stopped.

Not collective.

Negative value indicates diverged, positive value converged.
ConvergedReason <#slepc4py.SLEPc.NEP.ConvergedReason>

:sources:`Source code at slepc4py/SLEPc/NEP.pyx:869 <slepc4py/SLEPc/NEP.pyx#L869>`


Get the method used to compute the error estimate used in the convergence test.

Not collective.

The method used to compute the error estimate used in the convergence test.
Conv <#slepc4py.SLEPc.NEP.Conv>

:sources:`Source code at slepc4py/SLEPc/NEP.pyx:452 <slepc4py/SLEPc/NEP.pyx#L452>`


Get the direct solver associated to the eigensolver.

Not collective.

The direct solver context.
DS <#slepc4py.SLEPc.DS>

:sources:`Source code at slepc4py/SLEPc/NEP.pyx:711 <slepc4py/SLEPc/NEP.pyx#L711>`


Get the number of eigenvalues to compute.

Not collective.

Get the number of eigenvalues to compute, and the dimension of the subspace.


:sources:`Source code at slepc4py/SLEPc/NEP.pyx:598 <slepc4py/SLEPc/NEP.pyx#L598>`


Get the i-th solution of the eigenproblem as computed by solve().

Collective.

The solution consists of both the eigenvalue and the eigenvector.


:sources:`Source code at slepc4py/SLEPc/NEP.pyx:900 <slepc4py/SLEPc/NEP.pyx#L900>`


Get the error estimate associated to the i-th computed eigenpair.

Not collective.


:sources:`Source code at slepc4py/SLEPc/NEP.pyx:958 <slepc4py/SLEPc/NEP.pyx#L958>`


Get the function to compute the nonlinear Function T(\lambda).

Collective.

Get the function to compute the nonlinear Function T(\lambda) and the matrix.

  • F – Function matrix
  • P – preconditioner matrix (usually the same as the F)
  • function – Function evaluation routine

tuple <https://docs.python.org/3/library/stdtypes.html#tuple>[petsc4py.PETSc.Mat <https://petsc.org/release/petsc4py/reference/petsc4py.PETSc.Mat.html#petsc4py.PETSc.Mat>, petsc4py.PETSc.Mat <https://petsc.org/release/petsc4py/reference/petsc4py.PETSc.Mat.html#petsc4py.PETSc.Mat>, NEPFunction <#slepc4py.typing.NEPFunction>]

:sources:`Source code at slepc4py/SLEPc/NEP.pyx:1104 <slepc4py/SLEPc/NEP.pyx#L1104>`


Get the tolerance and maximum degree for the interpolation polynomial.

Not collective.


:sources:`Source code at slepc4py/SLEPc/NEP.pyx:1799 <slepc4py/SLEPc/NEP.pyx#L1799>`


Get the associated polynomial eigensolver object.

Collective.

Get the polynomial eigensolver object associated with the nonlinear eigensolver.

The polynomial eigensolver.
PEP <#slepc4py.SLEPc.PEP>

:sources:`Source code at slepc4py/SLEPc/NEP.pyx:1758 <slepc4py/SLEPc/NEP.pyx#L1758>`


Get the current iteration number.

Not collective.

If the call to solve() is complete, then it returns the number of iterations carried out by the solution method.


:sources:`Source code at slepc4py/SLEPc/NEP.pyx:851 <slepc4py/SLEPc/NEP.pyx#L851>`


Get the function to compute the Jacobian T'(\lambda) and J.

Collective.

Get the function to compute the Jacobian T'(\lambda) and the matrix.

  • J – Jacobian matrix
  • jacobian – Jacobian evaluation routine

tuple <https://docs.python.org/3/library/stdtypes.html#tuple>[petsc4py.PETSc.Mat <https://petsc.org/release/petsc4py/reference/petsc4py.PETSc.Mat.html#petsc4py.PETSc.Mat>, NEPJacobian <#slepc4py.typing.NEPJacobian>]

:sources:`Source code at slepc4py/SLEPc/NEP.pyx:1162 <slepc4py/SLEPc/NEP.pyx#L1162>`


Get the i-th left eigenvector as computed by solve().

Collective.


Notes

The index i should be a value between 0 and nconv-1 (see getConverged()). Eigensolutions are indexed according to the ordering criterion established with setWhichEigenpairs().

Left eigenvectors are available only if the twosided flag was set with setTwoSided().

:sources:`Source code at slepc4py/SLEPc/NEP.pyx:929 <slepc4py/SLEPc/NEP.pyx#L929>`


Get the list of monitor functions.

Not collective.

:sources:`Source code at slepc4py/SLEPc/NEP.pyx:813 <slepc4py/SLEPc/NEP.pyx#L813>`

NEPMonitorFunction <#slepc4py.typing.NEPMonitorFunction>


Get the linear solver object associated with the nonlinear eigensolver.

Collective.


:sources:`Source code at slepc4py/SLEPc/NEP.pyx:1691 <slepc4py/SLEPc/NEP.pyx#L1691>`


Get how often the preconditioner is rebuilt.

Not collective.


:sources:`Source code at slepc4py/SLEPc/NEP.pyx:1728 <slepc4py/SLEPc/NEP.pyx#L1728>`


Get the linear eigensolver object associated with the nonlinear eigensolver.

Collective.

The linear eigensolver.
EPS <#slepc4py.SLEPc.EPS>

:sources:`Source code at slepc4py/SLEPc/NEP.pyx:1978 <slepc4py/SLEPc/NEP.pyx#L1978>`


Get the flag that indicates if NLEIGS is using the full-basis variant.

Not collective.

True if the full-basis variant must be selected.
bool <https://docs.python.org/3/library/functions.html#bool>

:sources:`Source code at slepc4py/SLEPc/NEP.pyx:1950 <slepc4py/SLEPc/NEP.pyx#L1950>`


Get the tolerance and maximum degree for the interpolation polynomial.

Not collective.

Get the tolerance and maximum degree when building the interpolation via divided differences.


:sources:`Source code at slepc4py/SLEPc/NEP.pyx:1912 <slepc4py/SLEPc/NEP.pyx#L1912>`


Get the list of linear solver objects associated with the NLEIGS solver.

Collective.


Notes

The number of petsc4py.PETSc.KSP <https://petsc.org/release/petsc4py/reference/petsc4py.PETSc.KSP.html#petsc4py.PETSc.KSP> solvers is equal to the number of shifts provided by the user, or 1 if the user did not provide shifts.

:sources:`Source code at slepc4py/SLEPc/NEP.pyx:2031 <slepc4py/SLEPc/NEP.pyx#L2031>`


Get the locking flag used in the NLEIGS method.

Not collective.


:sources:`Source code at slepc4py/SLEPc/NEP.pyx:1875 <slepc4py/SLEPc/NEP.pyx#L1875>`


Get the list of shifts used in the Rational Krylov method.

Not collective.

The shift values.
ArrayScalar <#slepc4py.typing.ArrayScalar>

:sources:`Source code at slepc4py/SLEPc/NEP.pyx:2010 <slepc4py/SLEPc/NEP.pyx#L2010>`


Get the restart parameter used in the NLEIGS method.

Not collective.

The number of vectors to be kept at restart.
float <https://docs.python.org/3/library/functions.html#float>

:sources:`Source code at slepc4py/SLEPc/NEP.pyx:1839 <slepc4py/SLEPc/NEP.pyx#L1839>`


Get the prefix used for searching for all NEP options in the database.

Not collective.

The prefix string set for this NEP object.
str <https://docs.python.org/3/library/stdtypes.html#str>

:sources:`Source code at slepc4py/SLEPc/NEP.pyx:259 <slepc4py/SLEPc/NEP.pyx#L259>`


Get the problem type from the NEP object.

Not collective.

The problem type that was previously set.
ProblemType <#slepc4py.SLEPc.NEP.ProblemType>

:sources:`Source code at slepc4py/SLEPc/NEP.pyx:315 <slepc4py/SLEPc/NEP.pyx#L315>`


Get the region object associated to the eigensolver.

Not collective.

The region context.
RG <#slepc4py.SLEPc.RG>

:sources:`Source code at slepc4py/SLEPc/NEP.pyx:682 <slepc4py/SLEPc/NEP.pyx#L682>`


Get the constant tolerance flag.

Not collective.


:sources:`Source code at slepc4py/SLEPc/NEP.pyx:1413 <slepc4py/SLEPc/NEP.pyx#L1413>`


Get the threshold value that controls deflation.

Not collective.


:sources:`Source code at slepc4py/SLEPc/NEP.pyx:1512 <slepc4py/SLEPc/NEP.pyx#L1512>`


Get if the Hermitian version must be used by the solver.

Not collective.

Get the flag about using the Hermitian version of the scalar nonlinear equation.

If True, the Hermitian version is used.
bool <https://docs.python.org/3/library/functions.html#bool>

:sources:`Source code at slepc4py/SLEPc/NEP.pyx:1477 <slepc4py/SLEPc/NEP.pyx#L1477>`


Get the linear solver object associated with the nonlinear eigensolver.

Collective.


:sources:`Source code at slepc4py/SLEPc/NEP.pyx:1540 <slepc4py/SLEPc/NEP.pyx#L1540>`


Get how often the preconditioner is rebuilt.

Not collective.


:sources:`Source code at slepc4py/SLEPc/NEP.pyx:1384 <slepc4py/SLEPc/NEP.pyx#L1384>`


Get the maximum number of inner iterations of RII.

Not collective.


:sources:`Source code at slepc4py/SLEPc/NEP.pyx:1445 <slepc4py/SLEPc/NEP.pyx#L1445>`


Get the refinement strategy used by the NEP object.

Not collective.

Get the refinement strategy used by the NEP object and the associated parameters.


tuple <https://docs.python.org/3/library/stdtypes.html#tuple>[Refine <#slepc4py.SLEPc.NEP.Refine>, int <https://docs.python.org/3/library/functions.html#int>, float <https://docs.python.org/3/library/functions.html#float>, int <https://docs.python.org/3/library/functions.html#int>, RefineScheme <#slepc4py.SLEPc.NEP.RefineScheme>]

:sources:`Source code at slepc4py/SLEPc/NEP.pyx:483 <slepc4py/SLEPc/NEP.pyx#L483>`


Get the KSP object used by the eigensolver in the refinement phase.

Collective.


:sources:`Source code at slepc4py/SLEPc/NEP.pyx:553 <slepc4py/SLEPc/NEP.pyx#L553>`


Get the threshold value that controls deflation.

Not collective.


:sources:`Source code at slepc4py/SLEPc/NEP.pyx:1572 <slepc4py/SLEPc/NEP.pyx#L1572>`


Get the linear eigensolver object associated with the nonlinear eigensolver.

Collective.

The linear eigensolver.
EPS <#slepc4py.SLEPc.EPS>

:sources:`Source code at slepc4py/SLEPc/NEP.pyx:1600 <slepc4py/SLEPc/NEP.pyx#L1600>`


Get the left eigensolver.

Collective.

The linear eigensolver.
EPS <#slepc4py.SLEPc.EPS>

:sources:`Source code at slepc4py/SLEPc/NEP.pyx:1631 <slepc4py/SLEPc/NEP.pyx#L1631>`


Get the linear solver object associated with the nonlinear eigensolver.

Collective.


:sources:`Source code at slepc4py/SLEPc/NEP.pyx:1660 <slepc4py/SLEPc/NEP.pyx#L1660>`


Get the operator of the nonlinear eigenvalue problem in split form.

Collective.


:sources:`Source code at slepc4py/SLEPc/NEP.pyx:1218 <slepc4py/SLEPc/NEP.pyx#L1218>`


Get the operator of the split preconditioner.

Not collective.


:sources:`Source code at slepc4py/SLEPc/NEP.pyx:1279 <slepc4py/SLEPc/NEP.pyx#L1279>`


Get the stopping function.

Not collective.

:sources:`Source code at slepc4py/SLEPc/NEP.pyx:782 <slepc4py/SLEPc/NEP.pyx#L782>`

NEPStoppingFunction <#slepc4py.typing.NEPStoppingFunction>


Get the value of the target.

Not collective.

The value of the target.
Scalar <#slepc4py.typing.Scalar>

Notes

If the target was not set by the user, then zero is returned.

:sources:`Source code at slepc4py/SLEPc/NEP.pyx:373 <slepc4py/SLEPc/NEP.pyx#L373>`


Get the tolerance and maximum iteration count.

Not collective.

Get the tolerance and maximum iteration count used by the default NEP convergence tests.


:sources:`Source code at slepc4py/SLEPc/NEP.pyx:412 <slepc4py/SLEPc/NEP.pyx#L412>`


Get the flag indicating whether all residual norms must be computed.

Not collective.

Whether the solver compute all residuals or not.
bool <https://docs.python.org/3/library/functions.html#bool>

:sources:`Source code at slepc4py/SLEPc/NEP.pyx:569 <slepc4py/SLEPc/NEP.pyx#L569>`


Get the flag indicating if a two-sided variant is being used.

Not collective.

Get the flag indicating whether a two-sided variant of the algorithm is being used or not.

Whether the two-sided variant is to be used or not.
bool <https://docs.python.org/3/library/functions.html#bool>

:sources:`Source code at slepc4py/SLEPc/NEP.pyx:1304 <slepc4py/SLEPc/NEP.pyx#L1304>`


Get the NEP type of this object.

Not collective.


:sources:`Source code at slepc4py/SLEPc/NEP.pyx:244 <slepc4py/SLEPc/NEP.pyx#L244>`


Get which portion of the spectrum is to be sought.

Not collective.

The portion of the spectrum to be sought by the solver.
Which <#slepc4py.SLEPc.NEP.Which>

:sources:`Source code at slepc4py/SLEPc/NEP.pyx:344 <slepc4py/SLEPc/NEP.pyx#L344>`


Reset the NEP object.

Collective.

:sources:`Source code at slepc4py/SLEPc/NEP.pyx:204 <slepc4py/SLEPc/NEP.pyx#L204>`



Set the basis vectors object associated to the eigensolver.

Collective.

bv (BV <#slepc4py.SLEPc.BV>) – The basis vectors context.
None <https://docs.python.org/3/library/constants.html#None>

:sources:`Source code at slepc4py/SLEPc/NEP.pyx:669 <slepc4py/SLEPc/NEP.pyx#L669>`


Set the extraction technique used in the CISS solver.

Logically collective.

extraction (CISSExtraction <#slepc4py.SLEPc.NEP.CISSExtraction>) – The extraction technique.
None <https://docs.python.org/3/library/constants.html#None>

:sources:`Source code at slepc4py/SLEPc/NEP.pyx:2054 <slepc4py/SLEPc/NEP.pyx#L2054>`


Set the values of various refinement parameters in the CISS solver.

Logically collective.


:sources:`Source code at slepc4py/SLEPc/NEP.pyx:2200 <slepc4py/SLEPc/NEP.pyx#L2200>`


Set the values of various size parameters in the CISS solver.

Logically collective.


Notes

The default number of partitions is 1. This means the internal petsc4py.PETSc.KSP <https://petsc.org/release/petsc4py/reference/petsc4py.PETSc.KSP.html#petsc4py.PETSc.KSP> object is shared among all processes of the NEP communicator. Otherwise, the communicator is split into npart communicators, so that npart petsc4py.PETSc.KSP <https://petsc.org/release/petsc4py/reference/petsc4py.PETSc.KSP.html#petsc4py.PETSc.KSP> solves proceed simultaneously.

:sources:`Source code at slepc4py/SLEPc/NEP.pyx:2083 <slepc4py/SLEPc/NEP.pyx#L2083>`


Set the values of various threshold parameters in the CISS solver.

Logically collective.


:sources:`Source code at slepc4py/SLEPc/NEP.pyx:2163 <slepc4py/SLEPc/NEP.pyx#L2163>`


Set how to compute the error estimate used in the convergence test.

Logically collective.

conv (Conv <#slepc4py.SLEPc.NEP.Conv>) – The method used to compute the error estimate used in the convergence test.
None <https://docs.python.org/3/library/constants.html#None>

:sources:`Source code at slepc4py/SLEPc/NEP.pyx:468 <slepc4py/SLEPc/NEP.pyx#L468>`


Set a direct solver object associated to the eigensolver.

Collective.

ds (DS <#slepc4py.SLEPc.DS>) – The direct solver context.
None <https://docs.python.org/3/library/constants.html#None>

:sources:`Source code at slepc4py/SLEPc/NEP.pyx:727 <slepc4py/SLEPc/NEP.pyx#L727>`


Set the number of eigenvalues to compute.

Logically collective.

Set the number of eigenvalues to compute and the dimension of the subspace.


:sources:`Source code at slepc4py/SLEPc/NEP.pyx:622 <slepc4py/SLEPc/NEP.pyx#L622>`


Set NEP options from the options database.

Collective.

This routine must be called before setUp() if the user is to be allowed to set the solver type.

:sources:`Source code at slepc4py/SLEPc/NEP.pyx:304 <slepc4py/SLEPc/NEP.pyx#L304>`



Set the function to compute the nonlinear Function T(\lambda).

Collective.

Set the function to compute the nonlinear Function T(\lambda) as well as the location to store the matrix.


:sources:`Source code at slepc4py/SLEPc/NEP.pyx:1068 <slepc4py/SLEPc/NEP.pyx#L1068>`


Set the initial space from which the eigensolver starts to iterate.

Collective.


:sources:`Source code at slepc4py/SLEPc/NEP.pyx:742 <slepc4py/SLEPc/NEP.pyx#L742>`


Set the tolerance and maximum degree for the interpolation polynomial.

Collective.

Set the tolerance and maximum degree when building the interpolation polynomial.


:sources:`Source code at slepc4py/SLEPc/NEP.pyx:1777 <slepc4py/SLEPc/NEP.pyx#L1777>`


Set a polynomial eigensolver object associated to the nonlinear eigensolver.

Collective.

pep (PEP <#slepc4py.SLEPc.PEP>) – The polynomial eigensolver.
None <https://docs.python.org/3/library/constants.html#None>

:sources:`Source code at slepc4py/SLEPc/NEP.pyx:1745 <slepc4py/SLEPc/NEP.pyx#L1745>`


Set the function to compute the Jacobian T'(\lambda).

Collective.

Set the function to compute the Jacobian T'(\lambda) as well as the location to store the matrix.


:sources:`Source code at slepc4py/SLEPc/NEP.pyx:1130 <slepc4py/SLEPc/NEP.pyx#L1130>`


Append a monitor function to the list of monitors.

Logically collective.

:sources:`Source code at slepc4py/SLEPc/NEP.pyx:792 <slepc4py/SLEPc/NEP.pyx#L792>`



Set a linear solver object associated to the nonlinear eigensolver.

Collective.


:sources:`Source code at slepc4py/SLEPc/NEP.pyx:1678 <slepc4py/SLEPc/NEP.pyx#L1678>`


Set when the preconditioner is rebuilt in the nonlinear solve.

Logically collective.

lag (int <https://docs.python.org/3/library/functions.html#int>) – 0 indicates NEVER rebuild, 1 means rebuild every time the Jacobian is computed within the nonlinear iteration, 2 means every second time the Jacobian is built, etc.
None <https://docs.python.org/3/library/constants.html#None>

Notes

The default is 1. The preconditioner is ALWAYS built in the first iteration of a nonlinear solve.

:sources:`Source code at slepc4py/SLEPc/NEP.pyx:1707 <slepc4py/SLEPc/NEP.pyx#L1707>`


Set a linear eigensolver object associated to the nonlinear eigensolver.

Collective.

eps (EPS <#slepc4py.SLEPc.EPS>) – The linear eigensolver.
None <https://docs.python.org/3/library/constants.html#None>

:sources:`Source code at slepc4py/SLEPc/NEP.pyx:1965 <slepc4py/SLEPc/NEP.pyx#L1965>`


Set TOAR-basis (default) or full-basis variants of the NLEIGS method.

Logically collective.

Toggle between TOAR-basis (default) and full-basis variants of the NLEIGS method.


:sources:`Source code at slepc4py/SLEPc/NEP.pyx:1933 <slepc4py/SLEPc/NEP.pyx#L1933>`


Set the tolerance and maximum degree for the interpolation polynomial.

Collective.

Set the tolerance and maximum degree when building the interpolation via divided differences.


:sources:`Source code at slepc4py/SLEPc/NEP.pyx:1890 <slepc4py/SLEPc/NEP.pyx#L1890>`


Toggle between locking and non-locking variants of the NLEIGS method.

Logically collective.


Notes

The default is to lock converged eigenpairs when the method restarts. This behavior can be changed so that all directions are kept in the working subspace even if already converged to working accuracy (the non-locking variant).

:sources:`Source code at slepc4py/SLEPc/NEP.pyx:1854 <slepc4py/SLEPc/NEP.pyx#L1854>`


Set a list of shifts to be used in the Rational Krylov method.

Collective.

shifts (Sequence <https://docs.python.org/3/library/typing.html#typing.Sequence>[Scalar <#slepc4py.typing.Scalar>]) – Values specifying the shifts.
None <https://docs.python.org/3/library/constants.html#None>

:sources:`Source code at slepc4py/SLEPc/NEP.pyx:1994 <slepc4py/SLEPc/NEP.pyx#L1994>`


Set the restart parameter for the NLEIGS method.

Logically collective.

The proportion of basis vectors that must be kept after restart.


Notes

Allowed values are in the range [0.1,0.9]. The default is 0.5.

:sources:`Source code at slepc4py/SLEPc/NEP.pyx:1819 <slepc4py/SLEPc/NEP.pyx#L1819>`


Set the prefix used for searching for all NEP options in the database.

Logically collective.


:sources:`Source code at slepc4py/SLEPc/NEP.pyx:274 <slepc4py/SLEPc/NEP.pyx#L274>`


Set the type of the eigenvalue problem.

Logically collective.

problem_type (ProblemType <#slepc4py.SLEPc.NEP.ProblemType>) – The problem type to be set.
None <https://docs.python.org/3/library/constants.html#None>

:sources:`Source code at slepc4py/SLEPc/NEP.pyx:330 <slepc4py/SLEPc/NEP.pyx#L330>`


Set a region object associated to the eigensolver.

Collective.

rg (RG <#slepc4py.SLEPc.RG>) – The region context.
None <https://docs.python.org/3/library/constants.html#None>

:sources:`Source code at slepc4py/SLEPc/NEP.pyx:698 <slepc4py/SLEPc/NEP.pyx#L698>`


Set a flag to keep the tolerance used in the linear solver constant.

Logically collective.


:sources:`Source code at slepc4py/SLEPc/NEP.pyx:1399 <slepc4py/SLEPc/NEP.pyx#L1399>`


Set the threshold used to switch between deflated and non-deflated.

Logically collective.

Set the threshold value used to switch between deflated and non-deflated iteration.


:sources:`Source code at slepc4py/SLEPc/NEP.pyx:1495 <slepc4py/SLEPc/NEP.pyx#L1495>`


Set a flag to use the Hermitian version of the solver.

Logically collective.

Set a flag to indicate if the Hermitian version of the scalar nonlinear equation must be used by the solver.


:sources:`Source code at slepc4py/SLEPc/NEP.pyx:1460 <slepc4py/SLEPc/NEP.pyx#L1460>`


Set a linear solver object associated to the nonlinear eigensolver.

Collective.


:sources:`Source code at slepc4py/SLEPc/NEP.pyx:1527 <slepc4py/SLEPc/NEP.pyx#L1527>`


Set when the preconditioner is rebuilt in the nonlinear solve.

Logically collective.

lag (int <https://docs.python.org/3/library/functions.html#int>) – 0 indicates NEVER rebuild, 1 means rebuild every time the Jacobian is computed within the nonlinear iteration, 2 means every second time the Jacobian is built, etc.
None <https://docs.python.org/3/library/constants.html#None>

:sources:`Source code at slepc4py/SLEPc/NEP.pyx:1368 <slepc4py/SLEPc/NEP.pyx#L1368>`


Set the max. number of inner iterations to be used in the RII solver.

Logically collective.

These are the Newton iterations related to the computation of the nonlinear Rayleigh functional.


:sources:`Source code at slepc4py/SLEPc/NEP.pyx:1428 <slepc4py/SLEPc/NEP.pyx#L1428>`


Set the refinement strategy used by the NEP object.

Logically collective.

Set the refinement strategy used by the NEP object and the associated parameters.


None <https://docs.python.org/3/library/constants.html#None>

:sources:`Source code at slepc4py/SLEPc/NEP.pyx:513 <slepc4py/SLEPc/NEP.pyx#L513>`


Set the threshold used to switch between deflated and non-deflated.

Logically collective.


:sources:`Source code at slepc4py/SLEPc/NEP.pyx:1558 <slepc4py/SLEPc/NEP.pyx#L1558>`


Set a linear eigensolver object associated to the nonlinear eigensolver.

Collective.

eps (EPS <#slepc4py.SLEPc.EPS>) – The linear eigensolver.
None <https://docs.python.org/3/library/constants.html#None>

:sources:`Source code at slepc4py/SLEPc/NEP.pyx:1587 <slepc4py/SLEPc/NEP.pyx#L1587>`


Set a linear eigensolver object associated to the nonlinear eigensolver.

Collective.

Used to compute left eigenvectors in the two-sided variant of SLP.

eps (EPS <#slepc4py.SLEPc.EPS>) – The linear eigensolver.
None <https://docs.python.org/3/library/constants.html#None>

:sources:`Source code at slepc4py/SLEPc/NEP.pyx:1616 <slepc4py/SLEPc/NEP.pyx#L1616>`


Set a linear solver object associated to the nonlinear eigensolver.

Collective.


:sources:`Source code at slepc4py/SLEPc/NEP.pyx:1647 <slepc4py/SLEPc/NEP.pyx#L1647>`


Set the operator of the nonlinear eigenvalue problem in split form.

Collective.


:sources:`Source code at slepc4py/SLEPc/NEP.pyx:1184 <slepc4py/SLEPc/NEP.pyx#L1184>`


Set the operator in split form.

Collective.

Set the operator in split form from which to build the preconditioner to be used when solving the nonlinear eigenvalue problem in split form.


:sources:`Source code at slepc4py/SLEPc/NEP.pyx:1250 <slepc4py/SLEPc/NEP.pyx#L1250>`


Set a function to decide when to stop the outer iteration of the eigensolver.

Logically collective.

:sources:`Source code at slepc4py/SLEPc/NEP.pyx:762 <slepc4py/SLEPc/NEP.pyx#L762>`



Set the value of the target.

Logically collective.

target (Scalar <#slepc4py.typing.Scalar>) – The value of the target.
None <https://docs.python.org/3/library/constants.html#None>

Notes

The target is a scalar value used to determine the portion of the spectrum of interest. It is used in combination with setWhichEigenpairs().

:sources:`Source code at slepc4py/SLEPc/NEP.pyx:392 <slepc4py/SLEPc/NEP.pyx#L392>`


Set the tolerance and max. iteration count used in convergence tests.

Logically collective.


:sources:`Source code at slepc4py/SLEPc/NEP.pyx:433 <slepc4py/SLEPc/NEP.pyx#L433>`


Set if the solver must compute the residual of all approximate eigenpairs.

Logically collective.


:sources:`Source code at slepc4py/SLEPc/NEP.pyx:584 <slepc4py/SLEPc/NEP.pyx#L584>`


Set the solver to use a two-sided variant.

Logically collective.

Set the solver to use a two-sided variant so that left eigenvectors are also computed.

twosided (bool <https://docs.python.org/3/library/functions.html#bool>) – Whether the two-sided variant is to be used or not.
None <https://docs.python.org/3/library/constants.html#None>

:sources:`Source code at slepc4py/SLEPc/NEP.pyx:1322 <slepc4py/SLEPc/NEP.pyx#L1322>`


Set the particular solver to be used in the NEP object.

Logically collective.

nep_type (Type <#slepc4py.SLEPc.NEP.Type> | str <https://docs.python.org/3/library/stdtypes.html#str>) – The solver to be used.
None <https://docs.python.org/3/library/constants.html#None>

:sources:`Source code at slepc4py/SLEPc/NEP.pyx:229 <slepc4py/SLEPc/NEP.pyx#L229>`


Set up all the necessary internal data structures.

Collective.

Set up all the internal data structures necessary for the execution of the eigensolver.

:sources:`Source code at slepc4py/SLEPc/NEP.pyx:832 <slepc4py/SLEPc/NEP.pyx#L832>`



Set which portion of the spectrum is to be sought.

Logically collective.

which (Which <#slepc4py.SLEPc.NEP.Which>) – The portion of the spectrum to be sought by the solver.
None <https://docs.python.org/3/library/constants.html#None>

:sources:`Source code at slepc4py/SLEPc/NEP.pyx:359 <slepc4py/SLEPc/NEP.pyx#L359>`


Solve the eigensystem.

Collective.

:sources:`Source code at slepc4py/SLEPc/NEP.pyx:843 <slepc4py/SLEPc/NEP.pyx#L843>`



Display the computed eigenvalues in a viewer.

Collective.


:sources:`Source code at slepc4py/SLEPc/NEP.pyx:1036 <slepc4py/SLEPc/NEP.pyx#L1036>`


Output computed eigenvectors to a viewer.

Collective.


:sources:`Source code at slepc4py/SLEPc/NEP.pyx:1051 <slepc4py/SLEPc/NEP.pyx#L1051>`


Print the NEP data structure.

Collective.


:sources:`Source code at slepc4py/SLEPc/NEP.pyx:179 <slepc4py/SLEPc/NEP.pyx#L179>`


Attributes Documentation

The basis vectors (BV) object associated.

:sources:`Source code at slepc4py/SLEPc/NEP.pyx:2302 <slepc4py/SLEPc/NEP.pyx#L2302>`


The direct solver (DS) object associated.

:sources:`Source code at slepc4py/SLEPc/NEP.pyx:2316 <slepc4py/SLEPc/NEP.pyx#L2316>`


The maximum iteration count used by the NEP convergence tests.

:sources:`Source code at slepc4py/SLEPc/NEP.pyx:2288 <slepc4py/SLEPc/NEP.pyx#L2288>`


The problem type from the NEP object.

:sources:`Source code at slepc4py/SLEPc/NEP.pyx:2260 <slepc4py/SLEPc/NEP.pyx#L2260>`


The region (RG) object associated.

:sources:`Source code at slepc4py/SLEPc/NEP.pyx:2309 <slepc4py/SLEPc/NEP.pyx#L2309>`


The value of the target.

:sources:`Source code at slepc4py/SLEPc/NEP.pyx:2274 <slepc4py/SLEPc/NEP.pyx#L2274>`


The tolerance used by the NEP convergence tests.

:sources:`Source code at slepc4py/SLEPc/NEP.pyx:2281 <slepc4py/SLEPc/NEP.pyx#L2281>`


Compute the residual of all approximate eigenpairs.

:sources:`Source code at slepc4py/SLEPc/NEP.pyx:2295 <slepc4py/SLEPc/NEP.pyx#L2295>`


The portion of the spectrum to be sought.

:sources:`Source code at slepc4py/SLEPc/NEP.pyx:2267 <slepc4py/SLEPc/NEP.pyx#L2267>`




slepc4py.SLEPc.PEP

Bases: Object <https://petsc.org/release/petsc4py/reference/petsc4py.PETSc.Object.html#petsc4py.PETSc.Object>

PEP.

Enumerations

Basis <#slepc4py.SLEPc.PEP.Basis> PEP basis type for the representation of the polynomial.
CISSExtraction <#slepc4py.SLEPc.PEP.CISSExtraction> PEP CISS extraction technique.
Conv <#slepc4py.SLEPc.PEP.Conv> PEP convergence test.
ConvergedReason <#slepc4py.SLEPc.PEP.ConvergedReason> PEP convergence reasons.
ErrorType <#slepc4py.SLEPc.PEP.ErrorType> PEP error type to assess accuracy of computed solutions.
Extract <#slepc4py.SLEPc.PEP.Extract> PEP extraction strategy used.
JDProjection <#slepc4py.SLEPc.PEP.JDProjection> PEP type of projection to be used in the Jacobi-Davidson solver.
ProblemType <#slepc4py.SLEPc.PEP.ProblemType> PEP problem type.
Refine <#slepc4py.SLEPc.PEP.Refine> PEP refinement strategy.
RefineScheme <#slepc4py.SLEPc.PEP.RefineScheme> PEP scheme for solving linear systems during iterative refinement.
Scale <#slepc4py.SLEPc.PEP.Scale> PEP scaling strategy.
Stop <#slepc4py.SLEPc.PEP.Stop> PEP stopping test.
Type <#slepc4py.SLEPc.PEP.Type> PEP type.
Which <#slepc4py.SLEPc.PEP.Which> PEP desired part of spectrum.

slepc4py.SLEPc.PEP.Basis

Bases: object <https://docs.python.org/3/library/functions.html#object>

PEP basis type for the representation of the polynomial.

  • MONOMIAL: Monomials (default).
  • CHEBYSHEV1: Chebyshev polynomials of the 1st kind.
  • CHEBYSHEV2: Chebyshev polynomials of the 2nd kind.
  • LEGENDRE: Legendre polynomials.
  • LAGUERRE: Laguerre polynomials.
  • HERMITE: Hermite polynomials.

Attributes Summary

CHEBYSHEV1 Constant CHEBYSHEV1 of type int <https://docs.python.org/3/library/functions.html#int>
CHEBYSHEV2 Constant CHEBYSHEV2 of type int <https://docs.python.org/3/library/functions.html#int>
HERMITE Constant HERMITE of type int <https://docs.python.org/3/library/functions.html#int>
LAGUERRE Constant LAGUERRE of type int <https://docs.python.org/3/library/functions.html#int>
LEGENDRE Constant LEGENDRE of type int <https://docs.python.org/3/library/functions.html#int>
MONOMIAL Constant MONOMIAL of type int <https://docs.python.org/3/library/functions.html#int>

Attributes Documentation








slepc4py.SLEPc.PEP.CISSExtraction

Bases: object <https://docs.python.org/3/library/functions.html#object>

PEP CISS extraction technique.

  • RITZ: Ritz extraction.
  • HANKEL: Extraction via Hankel eigenproblem.
  • CAA: Communication-avoiding Arnoldi.

Attributes Summary

CAA Constant CAA of type int <https://docs.python.org/3/library/functions.html#int>
HANKEL Constant HANKEL of type int <https://docs.python.org/3/library/functions.html#int>
RITZ Constant RITZ of type int <https://docs.python.org/3/library/functions.html#int>

Attributes Documentation





slepc4py.SLEPc.PEP.Conv

Bases: object <https://docs.python.org/3/library/functions.html#object>

PEP convergence test.

  • ABS: Absolute convergence test.
  • REL: Convergence test relative to the eigenvalue.
  • NORM: Convergence test relative to the matrix norms.
  • USER: User-defined convergence test.

Attributes Summary

ABS Constant ABS of type int <https://docs.python.org/3/library/functions.html#int>
NORM Constant NORM of type int <https://docs.python.org/3/library/functions.html#int>
REL Constant REL of type int <https://docs.python.org/3/library/functions.html#int>
USER Constant USER of type int <https://docs.python.org/3/library/functions.html#int>

Attributes Documentation






slepc4py.SLEPc.PEP.ConvergedReason

Bases: object <https://docs.python.org/3/library/functions.html#object>

PEP convergence reasons.

  • CONVERGED_TOL: All eigenpairs converged to requested tolerance.
  • CONVERGED_USER: User-defined convergence criterion satisfied.
  • DIVERGED_ITS: Maximum number of iterations exceeded.
  • DIVERGED_BREAKDOWN: Solver failed due to breakdown.
  • DIVERGED_SYMMETRY_LOST: Lanczos-type method could not preserve symmetry.
  • CONVERGED_ITERATING: Iteration not finished yet.

Attributes Summary

CONVERGED_ITERATING Constant CONVERGED_ITERATING of type int <https://docs.python.org/3/library/functions.html#int>
CONVERGED_TOL Constant CONVERGED_TOL of type int <https://docs.python.org/3/library/functions.html#int>
CONVERGED_USER Constant CONVERGED_USER of type int <https://docs.python.org/3/library/functions.html#int>
DIVERGED_BREAKDOWN Constant DIVERGED_BREAKDOWN of type int <https://docs.python.org/3/library/functions.html#int>
DIVERGED_ITS Constant DIVERGED_ITS of type int <https://docs.python.org/3/library/functions.html#int>
DIVERGED_SYMMETRY_LOST Constant DIVERGED_SYMMETRY_LOST of type int <https://docs.python.org/3/library/functions.html#int>
ITERATING Constant ITERATING of type int <https://docs.python.org/3/library/functions.html#int>

Attributes Documentation









slepc4py.SLEPc.PEP.ErrorType

Bases: object <https://docs.python.org/3/library/functions.html#object>

PEP error type to assess accuracy of computed solutions.

  • ABSOLUTE: Absolute error.
  • RELATIVE: Relative error.
  • BACKWARD: Backward error.

Attributes Summary

ABSOLUTE Constant ABSOLUTE of type int <https://docs.python.org/3/library/functions.html#int>
BACKWARD Constant BACKWARD of type int <https://docs.python.org/3/library/functions.html#int>
RELATIVE Constant RELATIVE of type int <https://docs.python.org/3/library/functions.html#int>

Attributes Documentation





slepc4py.SLEPc.PEP.Extract

Bases: object <https://docs.python.org/3/library/functions.html#object>

PEP extraction strategy used.

PEP extraction strategy used to obtain eigenvectors of the PEP from the eigenvectors of the linearization.

  • NONE: Use the first block.
  • NORM: Use the first or last block depending on norm of H.
  • RESIDUAL: Use the block with smallest residual.
  • STRUCTURED: Combine all blocks in a certain way.

Attributes Summary

NONE Constant NONE of type int <https://docs.python.org/3/library/functions.html#int>
NORM Constant NORM of type int <https://docs.python.org/3/library/functions.html#int>
RESIDUAL Constant RESIDUAL of type int <https://docs.python.org/3/library/functions.html#int>
STRUCTURED Constant STRUCTURED of type int <https://docs.python.org/3/library/functions.html#int>

Attributes Documentation






slepc4py.SLEPc.PEP.JDProjection

Bases: object <https://docs.python.org/3/library/functions.html#object>

PEP type of projection to be used in the Jacobi-Davidson solver.

  • HARMONIC: Harmonic projection.
  • ORTHOGONAL: Orthogonal projection.

Attributes Summary

HARMONIC Constant HARMONIC of type int <https://docs.python.org/3/library/functions.html#int>
ORTHOGONAL Constant ORTHOGONAL of type int <https://docs.python.org/3/library/functions.html#int>

Attributes Documentation




slepc4py.SLEPc.PEP.ProblemType


slepc4py.SLEPc.PEP.Refine

Bases: object <https://docs.python.org/3/library/functions.html#object>

PEP refinement strategy.

  • NONE: No refinement.
  • SIMPLE: Refine eigenpairs one by one.
  • MULTIPLE: Refine all eigenpairs simultaneously (invariant pair).

Attributes Summary

MULTIPLE Constant MULTIPLE of type int <https://docs.python.org/3/library/functions.html#int>
NONE Constant NONE of type int <https://docs.python.org/3/library/functions.html#int>
SIMPLE Constant SIMPLE of type int <https://docs.python.org/3/library/functions.html#int>

Attributes Documentation





slepc4py.SLEPc.PEP.RefineScheme

Bases: object <https://docs.python.org/3/library/functions.html#object>

PEP scheme for solving linear systems during iterative refinement.

  • SCHUR: Schur complement.
  • MBE: Mixed block elimination.
  • EXPLICIT: Build the explicit matrix.

Attributes Summary

EXPLICIT Constant EXPLICIT of type int <https://docs.python.org/3/library/functions.html#int>
MBE Constant MBE of type int <https://docs.python.org/3/library/functions.html#int>
SCHUR Constant SCHUR of type int <https://docs.python.org/3/library/functions.html#int>

Attributes Documentation





slepc4py.SLEPc.PEP.Scale

Bases: object <https://docs.python.org/3/library/functions.html#object>

PEP scaling strategy.

  • NONE: No scaling.
  • SCALAR: Parameter scaling.
  • DIAGONAL: Diagonal scaling.
  • BOTH: Both parameter and diagonal scaling.

Attributes Summary

BOTH Constant BOTH of type int <https://docs.python.org/3/library/functions.html#int>
DIAGONAL Constant DIAGONAL of type int <https://docs.python.org/3/library/functions.html#int>
NONE Constant NONE of type int <https://docs.python.org/3/library/functions.html#int>
SCALAR Constant SCALAR of type int <https://docs.python.org/3/library/functions.html#int>

Attributes Documentation






slepc4py.SLEPc.PEP.Stop

Bases: object <https://docs.python.org/3/library/functions.html#object>

PEP stopping test.

  • BASIC: Default stopping test.
  • USER: User-defined stopping test.

Attributes Summary

BASIC Constant BASIC of type int <https://docs.python.org/3/library/functions.html#int>
USER Constant USER of type int <https://docs.python.org/3/library/functions.html#int>

Attributes Documentation




slepc4py.SLEPc.PEP.Type

Bases: object <https://docs.python.org/3/library/functions.html#object>

PEP type.

Polynomial eigensolvers.

  • LINEAR: Linearization via EPS.
  • QARNOLDI: Q-Arnoldi for quadratic problems.
  • TOAR: Two-level orthogonal Arnoldi.
  • STOAR: Symmetric TOAR.
  • JD: Polynomial Jacobi-Davidson.
  • CISS: Contour integral spectrum slice.

Attributes Summary

CISS Object CISS of type str <https://docs.python.org/3/library/stdtypes.html#str>
JD Object JD of type str <https://docs.python.org/3/library/stdtypes.html#str>
LINEAR Object LINEAR of type str <https://docs.python.org/3/library/stdtypes.html#str>
QARNOLDI Object QARNOLDI of type str <https://docs.python.org/3/library/stdtypes.html#str>
STOAR Object STOAR of type str <https://docs.python.org/3/library/stdtypes.html#str>
TOAR Object TOAR of type str <https://docs.python.org/3/library/stdtypes.html#str>

Attributes Documentation








slepc4py.SLEPc.PEP.Which

Bases: object <https://docs.python.org/3/library/functions.html#object>

PEP desired part of spectrum.

  • LARGEST_MAGNITUDE: Largest magnitude (default).
  • SMALLEST_MAGNITUDE: Smallest magnitude.
  • LARGEST_REAL: Largest real parts.
  • SMALLEST_REAL: Smallest real parts.
  • LARGEST_IMAGINARY: Largest imaginary parts in magnitude.
  • SMALLEST_IMAGINARY: Smallest imaginary parts in magnitude.
  • TARGET_MAGNITUDE: Closest to target (in magnitude).
  • TARGET_REAL: Real part closest to target.
  • TARGET_IMAGINARY: Imaginary part closest to target.
  • ALL: All eigenvalues in an interval.
  • USER: User-defined criterion.

Attributes Summary

ALL Constant ALL of type int <https://docs.python.org/3/library/functions.html#int>
LARGEST_IMAGINARY Constant LARGEST_IMAGINARY of type int <https://docs.python.org/3/library/functions.html#int>
LARGEST_MAGNITUDE Constant LARGEST_MAGNITUDE of type int <https://docs.python.org/3/library/functions.html#int>
LARGEST_REAL Constant LARGEST_REAL of type int <https://docs.python.org/3/library/functions.html#int>
SMALLEST_IMAGINARY Constant SMALLEST_IMAGINARY of type int <https://docs.python.org/3/library/functions.html#int>
SMALLEST_MAGNITUDE Constant SMALLEST_MAGNITUDE of type int <https://docs.python.org/3/library/functions.html#int>
SMALLEST_REAL Constant SMALLEST_REAL of type int <https://docs.python.org/3/library/functions.html#int>
TARGET_IMAGINARY Constant TARGET_IMAGINARY of type int <https://docs.python.org/3/library/functions.html#int>
TARGET_MAGNITUDE Constant TARGET_MAGNITUDE of type int <https://docs.python.org/3/library/functions.html#int>
TARGET_REAL Constant TARGET_REAL of type int <https://docs.python.org/3/library/functions.html#int>
USER Constant USER of type int <https://docs.python.org/3/library/functions.html#int>

Attributes Documentation













Methods Summary

appendOptionsPrefix([prefix]) Append to the prefix used for searching for all PEP options in the database.
cancelMonitor() Clear all monitors for a PEP object.
computeError(i[, etype]) Compute the error associated with the i-th computed eigenpair.
create([comm]) Create the PEP object.
destroy() Destroy the PEP object.
errorView([etype, viewer]) Display the errors associated with the computed solution.
getBV() Get the basis vectors object associated to the eigensolver.
getBasis() Get the type of polynomial basis used.
getCISSExtraction() Get the extraction technique used in the CISS solver.
getCISSKSPs() Get the array of linear solver objects associated with the CISS solver.
getCISSRefinement() Get the values of various refinement parameters in the CISS solver.
getCISSSizes() Get the values of various size parameters in the CISS solver.
getCISSThreshold() Get the values of various threshold parameters in the CISS solver.
getConverged() Get the number of converged eigenpairs.
getConvergedReason() Get the reason why the solve() iteration was stopped.
getConvergenceTest() Get the method used to compute the error estimate used in the convergence test.
getDS() Get the direct solver associated to the eigensolver.
getDimensions() Get the number of eigenvalues to compute and the dimension of the subspace.
getEigenpair(i[, Vr, Vi]) Get the i-th solution of the eigenproblem as computed by solve().
getErrorEstimate(i) Get the error estimate associated to the i-th computed eigenpair.
getExtract() Get the extraction technique used by the PEP object.
getInterval() Get the computational interval for spectrum slicing.
getIterationNumber() Get the current iteration number.
getJDFix() Get threshold for changing the target in the correction equation.
getJDMinimalityIndex() Get the maximum allowed value of the minimality index.
getJDProjection() Get the type of projection to be used in the Jacobi-Davidson solver.
getJDRestart() Get the restart parameter used in the Jacobi-Davidson method.
getJDReusePreconditioner() Get the flag for reusing the preconditioner.
getLinearEPS() Get the eigensolver object associated to the polynomial eigenvalue solver.
getLinearExplicitMatrix() Get if the matrices A and B for the linearization are built explicitly.
getLinearLinearization() Get the coeffs.
getMonitor() Get the list of monitor functions.
getOperators() Get the matrices associated with the eigenvalue problem.
getOptionsPrefix() Get the prefix used for searching for all PEP options in the database.
getProblemType() Get the problem type from the PEP object.
getQArnoldiLocking() Get the locking flag used in the Q-Arnoldi method.
getQArnoldiRestart() Get the restart parameter used in the Q-Arnoldi method.
getRG() Get the region object associated to the eigensolver.
getRefine() Get the refinement strategy used by the PEP object.
getRefineKSP() Get the KSP object used by the eigensolver in the refinement phase.
getST() Get the ST <#slepc4py.SLEPc.ST> object associated to the eigensolver object.
getSTOARCheckEigenvalueType() Get the flag for the eigenvalue type check in spectrum slicing.
getSTOARDetectZeros() Get the flag that enforces zero detection in spectrum slicing.
getSTOARDimensions() Get the dimensions used for each subsolve step.
getSTOARInertias() Get the values of the shifts and their corresponding inertias.
getSTOARLinearization() Get the coefficients that define the linearization of a quadratic eigenproblem.
getSTOARLocking() Get the locking flag used in the STOAR method.
getScale([Dl, Dr]) Get the strategy used for scaling the polynomial eigenproblem.
getStoppingTest() Get the stopping function.
getTOARLocking() Get the locking flag used in the TOAR method.
getTOARRestart() Get the restart parameter used in the TOAR method.
getTarget() Get the value of the target.
getTolerances() Get the tolerance and maximum iteration count.
getTrackAll() Get the flag indicating whether all residual norms must be computed.
getType() Get the PEP type of this object.
getWhichEigenpairs() Get which portion of the spectrum is to be sought.
reset() Reset the PEP object.
setBV(bv) Set a basis vectors object associated to the eigensolver.
setBasis(basis) Set the type of polynomial basis used.
setCISSExtraction(extraction) Set the extraction technique used in the CISS solver.
setCISSRefinement([inner, blsize]) Set the values of various refinement parameters in the CISS solver.
setCISSSizes([ip, bs, ms, npart, bsmax, ...]) Set the values of various size parameters in the CISS solver.
setCISSThreshold([delta, spur]) Set the values of various threshold parameters in the CISS solver.
setConvergenceTest(conv) Set how to compute the error estimate used in the convergence test.
setDS(ds) Set a direct solver object associated to the eigensolver.
setDimensions([nev, ncv, mpd]) Set the number of eigenvalues to compute and the dimension of the subspace.
setExtract(extract) Set the extraction strategy to be used.
setFromOptions() Set PEP options from the options database.
setInitialSpace(space) Set the initial space from which the eigensolver starts to iterate.
setInterval(inta, intb) Set the computational interval for spectrum slicing.
setJDFix(fix) Set the threshold for changing the target in the correction equation.
setJDMinimalityIndex(flag) Set the maximum allowed value for the minimality index.
setJDProjection(proj) Set the type of projection to be used in the Jacobi-Davidson solver.
setJDRestart(keep) Set the restart parameter for the Jacobi-Davidson method.
setJDReusePreconditioner(flag) Set a flag indicating whether the preconditioner must be reused or not.
setLinearEPS(eps) Set an eigensolver object associated to the polynomial eigenvalue solver.
setLinearExplicitMatrix(flag) Set flag to explicitly build the matrices A and B.
setLinearLinearization([alpha, beta]) Set the coefficients that define the linearization of a quadratic eigenproblem.
setMonitor(monitor[, args, kargs]) Append a monitor function to the list of monitors.
setOperators(operators) Set the matrices associated with the eigenvalue problem.
setOptionsPrefix([prefix]) Set the prefix used for searching for all PEP options in the database.
setProblemType(problem_type) Set the type of the eigenvalue problem.
setQArnoldiLocking(lock) Toggle between locking and non-locking variants of the Q-Arnoldi method.
setQArnoldiRestart(keep) Set the restart parameter for the Q-Arnoldi method.
setRG(rg) Set a region object associated to the eigensolver.
setRefine(ref[, npart, tol, its, scheme]) Set the refinement strategy used by the PEP object.
setST(st) Set a spectral transformation object associated to the eigensolver.
setSTOARCheckEigenvalueType(flag) Set flag to check if all eigenvalues have the same definite type.
setSTOARDetectZeros(detect) Set flag to enforce detection of zeros during the factorizations.
setSTOARDimensions([nev, ncv, mpd]) Set the dimensions used for each subsolve step.
setSTOARLinearization([alpha, beta]) Set the coefficients that define the linearization of a quadratic eigenproblem.
setSTOARLocking(lock) Toggle between locking and non-locking variants of the STOAR method.
setScale(scale[, alpha, Dl, Dr, its, lbda]) Set the scaling strategy to be used.
setStoppingTest(stopping[, args, kargs]) Set a function to decide when to stop the outer iteration of the eigensolver.
setTOARLocking(lock) Toggle between locking and non-locking variants of the TOAR method.
setTOARRestart(keep) Set the restart parameter for the TOAR method.
setTarget(target) Set the value of the target.
setTolerances([tol, max_it]) Set the tolerance and maximum iteration count.
setTrackAll(trackall) Set flag to compute the residual of all approximate eigenpairs.
setType(pep_type) Set the particular solver to be used in the PEP object.
setUp() Set up all the necessary internal data structures.
setWhichEigenpairs(which) Set which portion of the spectrum is to be sought.
solve() Solve the eigensystem.
valuesView([viewer]) Display the computed eigenvalues in a viewer.
vectorsView([viewer]) Output computed eigenvectors to a viewer.
view([viewer]) Print the PEP data structure.

Attributes Summary

bv The basis vectors (BV) object associated.
ds The direct solver (DS) object associated.
extract The type of extraction technique to be employed.
max_it The maximum iteration count.
problem_type The type of the eigenvalue problem.
rg The region (RG) object associated.
st The spectral transformation (ST) object associated.
target The value of the target.
tol The tolerance.
track_all Compute the residual norm of all approximate eigenpairs.
which The portion of the spectrum to be sought.

Methods Documentation

Append to the prefix used for searching for all PEP options in the database.

Logically collective.


:sources:`Source code at slepc4py/SLEPc/PEP.pyx:353 <slepc4py/SLEPc/PEP.pyx#L353>`


Clear all monitors for a PEP object.

Logically collective.

:sources:`Source code at slepc4py/SLEPc/PEP.pyx:1162 <slepc4py/SLEPc/PEP.pyx#L1162>`



Compute the error associated with the i-th computed eigenpair.

Collective.

Compute the error (based on the residual norm) associated with the i-th computed eigenpair.


The error bound, computed in various ways from the residual norm ||P(l)x||_2 where l is the eigenvalue and x is the eigenvector.
float <https://docs.python.org/3/library/functions.html#float>

Notes

The index i should be a value between 0 and nconv-1 (see getConverged()).

:sources:`Source code at slepc4py/SLEPc/PEP.pyx:1290 <slepc4py/SLEPc/PEP.pyx#L1290>`


Create the PEP object.

Collective.


:sources:`Source code at slepc4py/SLEPc/PEP.pyx:276 <slepc4py/SLEPc/PEP.pyx#L276>`


Destroy the PEP object.

Collective.

:sources:`Source code at slepc4py/SLEPc/PEP.pyx:258 <slepc4py/SLEPc/PEP.pyx#L258>`



Display the errors associated with the computed solution.

Collective.

Display the errors and the eigenvalues.


None <https://docs.python.org/3/library/constants.html#None>

Notes

By default, this function checks the error of all eigenpairs and prints the eigenvalues if all of them are below the requested tolerance. If the viewer has format ASCII_INFO_DETAIL then a table with eigenvalues and corresponding errors is printed.

:sources:`Source code at slepc4py/SLEPc/PEP.pyx:1324 <slepc4py/SLEPc/PEP.pyx#L1324>`


Get the basis vectors object associated to the eigensolver.

Not collective.

The basis vectors context.
BV <#slepc4py.SLEPc.BV>

:sources:`Source code at slepc4py/SLEPc/PEP.pyx:954 <slepc4py/SLEPc/PEP.pyx#L954>`


Get the type of polynomial basis used.

Not collective.

Get the type of polynomial basis used to describe the polynomial eigenvalue problem.

The basis that was previously set.
Basis <#slepc4py.SLEPc.PEP.Basis>

:sources:`Source code at slepc4py/SLEPc/PEP.pyx:379 <slepc4py/SLEPc/PEP.pyx#L379>`


Get the extraction technique used in the CISS solver.

Not collective.

The extraction technique.
CISSExtraction <#slepc4py.SLEPc.PEP.CISSExtraction>

:sources:`Source code at slepc4py/SLEPc/PEP.pyx:2049 <slepc4py/SLEPc/PEP.pyx#L2049>`


Get the array of linear solver objects associated with the CISS solver.

Collective.


Notes

The number of petsc4py.PETSc.KSP <https://petsc.org/release/petsc4py/reference/petsc4py.PETSc.KSP.html#petsc4py.PETSc.KSP> solvers is equal to the number of integration points divided by the number of partitions. This value is halved in the case of real matrices with a region centered at the real axis.

:sources:`Source code at slepc4py/SLEPc/PEP.pyx:2218 <slepc4py/SLEPc/PEP.pyx#L2218>`


Get the values of various refinement parameters in the CISS solver.

Not collective.


:sources:`Source code at slepc4py/SLEPc/PEP.pyx:2200 <slepc4py/SLEPc/PEP.pyx#L2200>`


Get the values of various size parameters in the CISS solver.

Not collective.


:sources:`Source code at slepc4py/SLEPc/PEP.pyx:2114 <slepc4py/SLEPc/PEP.pyx#L2114>`


Get the values of various threshold parameters in the CISS solver.

Not collective.


:sources:`Source code at slepc4py/SLEPc/PEP.pyx:2163 <slepc4py/SLEPc/PEP.pyx#L2163>`


Get the number of converged eigenpairs.

Not collective.


:sources:`Source code at slepc4py/SLEPc/PEP.pyx:1226 <slepc4py/SLEPc/PEP.pyx#L1226>`


Get the reason why the solve() iteration was stopped.

Not collective.

Negative value indicates diverged, positive value converged.
ConvergedReason <#slepc4py.SLEPc.PEP.ConvergedReason>

:sources:`Source code at slepc4py/SLEPc/PEP.pyx:1210 <slepc4py/SLEPc/PEP.pyx#L1210>`


Get the method used to compute the error estimate used in the convergence test.

Not collective.

The method used to compute the error estimate used in the convergence test.
Conv <#slepc4py.SLEPc.PEP.Conv>

:sources:`Source code at slepc4py/SLEPc/PEP.pyx:601 <slepc4py/SLEPc/PEP.pyx#L601>`


Get the direct solver associated to the eigensolver.

Not collective.

The direct solver context.
DS <#slepc4py.SLEPc.DS>

:sources:`Source code at slepc4py/SLEPc/PEP.pyx:1012 <slepc4py/SLEPc/PEP.pyx#L1012>`


Get the number of eigenvalues to compute and the dimension of the subspace.

Not collective.


:sources:`Source code at slepc4py/SLEPc/PEP.pyx:779 <slepc4py/SLEPc/PEP.pyx#L779>`


Get the i-th solution of the eigenproblem as computed by solve().

Collective.

The solution consists of both the eigenvalue and the eigenvector.


:sources:`Source code at slepc4py/SLEPc/PEP.pyx:1241 <slepc4py/SLEPc/PEP.pyx#L1241>`


Get the error estimate associated to the i-th computed eigenpair.

Not collective.


:sources:`Source code at slepc4py/SLEPc/PEP.pyx:1270 <slepc4py/SLEPc/PEP.pyx#L1270>`


Get the extraction technique used by the PEP object.

Not collective.

The extraction strategy.
Extract <#slepc4py.SLEPc.PEP.Extract>

:sources:`Source code at slepc4py/SLEPc/PEP.pyx:732 <slepc4py/SLEPc/PEP.pyx#L732>`


Get the computational interval for spectrum slicing.

Not collective.


Notes

If the interval was not set by the user, then zeros are returned.

:sources:`Source code at slepc4py/SLEPc/PEP.pyx:554 <slepc4py/SLEPc/PEP.pyx#L554>`


Get the current iteration number.

Not collective.

If the call to solve() is complete, then it returns the number of iterations carried out by the solution method.


:sources:`Source code at slepc4py/SLEPc/PEP.pyx:1192 <slepc4py/SLEPc/PEP.pyx#L1192>`


Get threshold for changing the target in the correction equation.

Not collective.

The threshold for changing the target.
float <https://docs.python.org/3/library/functions.html#float>

:sources:`Source code at slepc4py/SLEPc/PEP.pyx:1931 <slepc4py/SLEPc/PEP.pyx#L1931>`


Get the maximum allowed value of the minimality index.

Not collective.


:sources:`Source code at slepc4py/SLEPc/PEP.pyx:1989 <slepc4py/SLEPc/PEP.pyx#L1989>`


Get the type of projection to be used in the Jacobi-Davidson solver.

Not collective.

The type of projection.
JDProjection <#slepc4py.SLEPc.PEP.JDProjection>

:sources:`Source code at slepc4py/SLEPc/PEP.pyx:2018 <slepc4py/SLEPc/PEP.pyx#L2018>`


Get the restart parameter used in the Jacobi-Davidson method.

Not collective.

The number of vectors to be kept at restart.
float <https://docs.python.org/3/library/functions.html#float>

:sources:`Source code at slepc4py/SLEPc/PEP.pyx:1896 <slepc4py/SLEPc/PEP.pyx#L1896>`


Get the flag for reusing the preconditioner.

Not collective.


:sources:`Source code at slepc4py/SLEPc/PEP.pyx:1960 <slepc4py/SLEPc/PEP.pyx#L1960>`


Get the eigensolver object associated to the polynomial eigenvalue solver.

Collective.

The linear eigensolver.
EPS <#slepc4py.SLEPc.EPS>

:sources:`Source code at slepc4py/SLEPc/PEP.pyx:1398 <slepc4py/SLEPc/PEP.pyx#L1398>`


Get if the matrices A and B for the linearization are built explicitly.

Not collective.

Get the flag indicating if the matrices A and B for the linearization are built explicitly.

Boolean flag indicating if the matrices are built explicitly.
bool <https://docs.python.org/3/library/functions.html#bool>

:sources:`Source code at slepc4py/SLEPc/PEP.pyx:1472 <slepc4py/SLEPc/PEP.pyx#L1472>`


Get the coeffs. defining the linearization of a quadratic eigenproblem.

Not collective.

Return the coefficients that define the linearization of a quadratic eigenproblem.


:sources:`Source code at slepc4py/SLEPc/PEP.pyx:1434 <slepc4py/SLEPc/PEP.pyx#L1434>`


Get the list of monitor functions.

Not collective.

:sources:`Source code at slepc4py/SLEPc/PEP.pyx:1154 <slepc4py/SLEPc/PEP.pyx#L1154>`

PEPMonitorFunction <#slepc4py.typing.PEPMonitorFunction>


Get the matrices associated with the eigenvalue problem.

Collective.


:sources:`Source code at slepc4py/SLEPc/PEP.pyx:1041 <slepc4py/SLEPc/PEP.pyx#L1041>`


Get the prefix used for searching for all PEP options in the database.

Not collective.

The prefix string set for this PEP object.
str <https://docs.python.org/3/library/stdtypes.html#str>

:sources:`Source code at slepc4py/SLEPc/PEP.pyx:323 <slepc4py/SLEPc/PEP.pyx#L323>`


Get the problem type from the PEP object.

Not collective.

The problem type that was previously set.
ProblemType <#slepc4py.SLEPc.PEP.ProblemType>

:sources:`Source code at slepc4py/SLEPc/PEP.pyx:414 <slepc4py/SLEPc/PEP.pyx#L414>`


Get the locking flag used in the Q-Arnoldi method.

Not collective.


:sources:`Source code at slepc4py/SLEPc/PEP.pyx:1550 <slepc4py/SLEPc/PEP.pyx#L1550>`


Get the restart parameter used in the Q-Arnoldi method.

Not collective.

The number of vectors to be kept at restart.
float <https://docs.python.org/3/library/functions.html#float>

:sources:`Source code at slepc4py/SLEPc/PEP.pyx:1514 <slepc4py/SLEPc/PEP.pyx#L1514>`


Get the region object associated to the eigensolver.

Not collective.

The region context.
RG <#slepc4py.SLEPc.RG>

:sources:`Source code at slepc4py/SLEPc/PEP.pyx:983 <slepc4py/SLEPc/PEP.pyx#L983>`


Get the refinement strategy used by the PEP object.

Not collective.

Get the refinement strategy used by the PEP object, and the associated parameters.


tuple <https://docs.python.org/3/library/stdtypes.html#tuple>[Refine <#slepc4py.SLEPc.PEP.Refine>, int <https://docs.python.org/3/library/functions.html#int>, float <https://docs.python.org/3/library/functions.html#float>, int <https://docs.python.org/3/library/functions.html#int>, RefineScheme <#slepc4py.SLEPc.PEP.RefineScheme>]

:sources:`Source code at slepc4py/SLEPc/PEP.pyx:632 <slepc4py/SLEPc/PEP.pyx#L632>`


Get the KSP object used by the eigensolver in the refinement phase.

Collective.


:sources:`Source code at slepc4py/SLEPc/PEP.pyx:702 <slepc4py/SLEPc/PEP.pyx#L702>`


Get the ST <#slepc4py.SLEPc.ST> object associated to the eigensolver object.

Not collective.

Get the spectral transformation object associated to the eigensolver object.

The spectral transformation.
ST <#slepc4py.SLEPc.ST>

:sources:`Source code at slepc4py/SLEPc/PEP.pyx:828 <slepc4py/SLEPc/PEP.pyx#L828>`


Get the flag for the eigenvalue type check in spectrum slicing.

Not collective.

Whether the eigenvalue type is checked or not.
bool <https://docs.python.org/3/library/functions.html#bool>

:sources:`Source code at slepc4py/SLEPc/PEP.pyx:1857 <slepc4py/SLEPc/PEP.pyx#L1857>`


Get the flag that enforces zero detection in spectrum slicing.

Not collective.


:sources:`Source code at slepc4py/SLEPc/PEP.pyx:1739 <slepc4py/SLEPc/PEP.pyx#L1739>`


Get the dimensions used for each subsolve step.

Not collective.

Get the dimensions used for each subsolve step in case of doing spectrum slicing for a computational interval.


:sources:`Source code at slepc4py/SLEPc/PEP.pyx:1786 <slepc4py/SLEPc/PEP.pyx#L1786>`


Get the values of the shifts and their corresponding inertias.

Not collective.

Get the values of the shifts and their corresponding inertias in case of doing spectrum slicing for a computational interval.

  • shifts (ArrayReal <#slepc4py.typing.ArrayReal>) – The values of the shifts used internally in the solver.
  • inertias (ArrayInt <#slepc4py.typing.ArrayInt>) – The values of the inertia in each shift.

tuple <https://docs.python.org/3/library/stdtypes.html#tuple>[ArrayReal <#slepc4py.typing.ArrayReal>, ArrayInt <#slepc4py.typing.ArrayInt>]

:sources:`Source code at slepc4py/SLEPc/PEP.pyx:1810 <slepc4py/SLEPc/PEP.pyx#L1810>`


Get the coefficients that define the linearization of a quadratic eigenproblem.

Not collective.


:sources:`Source code at slepc4py/SLEPc/PEP.pyx:1659 <slepc4py/SLEPc/PEP.pyx#L1659>`


Get the locking flag used in the STOAR method.

Not collective.


:sources:`Source code at slepc4py/SLEPc/PEP.pyx:1698 <slepc4py/SLEPc/PEP.pyx#L1698>`


Get the strategy used for scaling the polynomial eigenproblem.

Not collective.



tuple <https://docs.python.org/3/library/stdtypes.html#tuple>[Scale <#slepc4py.SLEPc.PEP.Scale>, float <https://docs.python.org/3/library/functions.html#float>, int <https://docs.python.org/3/library/functions.html#int>, float <https://docs.python.org/3/library/functions.html#float>]

:sources:`Source code at slepc4py/SLEPc/PEP.pyx:860 <slepc4py/SLEPc/PEP.pyx#L860>`


Get the stopping function.

Not collective.

:sources:`Source code at slepc4py/SLEPc/PEP.pyx:1123 <slepc4py/SLEPc/PEP.pyx#L1123>`

PEPStoppingFunction <#slepc4py.typing.PEPStoppingFunction>


Get the locking flag used in the TOAR method.

Not collective.


:sources:`Source code at slepc4py/SLEPc/PEP.pyx:1625 <slepc4py/SLEPc/PEP.pyx#L1625>`


Get the restart parameter used in the TOAR method.

Not collective.

The number of vectors to be kept at restart.
float <https://docs.python.org/3/library/functions.html#float>

:sources:`Source code at slepc4py/SLEPc/PEP.pyx:1589 <slepc4py/SLEPc/PEP.pyx#L1589>`


Get the value of the target.

Not collective.

The value of the target.
Scalar <#slepc4py.typing.Scalar>

Notes

If the target was not set by the user, then zero is returned.

:sources:`Source code at slepc4py/SLEPc/PEP.pyx:472 <slepc4py/SLEPc/PEP.pyx#L472>`


Get the tolerance and maximum iteration count.

Not collective.

Get the tolerance and maximum iteration count used by the default PEP convergence tests.


:sources:`Source code at slepc4py/SLEPc/PEP.pyx:511 <slepc4py/SLEPc/PEP.pyx#L511>`


Get the flag indicating whether all residual norms must be computed.

Not collective.

Whether the solver compute all residuals or not.
bool <https://docs.python.org/3/library/functions.html#bool>

:sources:`Source code at slepc4py/SLEPc/PEP.pyx:747 <slepc4py/SLEPc/PEP.pyx#L747>`


Get the PEP type of this object.

Not collective.


:sources:`Source code at slepc4py/SLEPc/PEP.pyx:308 <slepc4py/SLEPc/PEP.pyx#L308>`


Get which portion of the spectrum is to be sought.

Not collective.

The portion of the spectrum to be sought by the solver.
Which <#slepc4py.SLEPc.PEP.Which>

:sources:`Source code at slepc4py/SLEPc/PEP.pyx:443 <slepc4py/SLEPc/PEP.pyx#L443>`


Reset the PEP object.

Collective.

:sources:`Source code at slepc4py/SLEPc/PEP.pyx:268 <slepc4py/SLEPc/PEP.pyx#L268>`



Set a basis vectors object associated to the eigensolver.

Collective.

bv (BV <#slepc4py.SLEPc.BV>) – The basis vectors context.
None <https://docs.python.org/3/library/constants.html#None>

:sources:`Source code at slepc4py/SLEPc/PEP.pyx:970 <slepc4py/SLEPc/PEP.pyx#L970>`


Set the type of polynomial basis used.

Logically collective.

Set the type of polynomial basis used to describe the polynomial eigenvalue problem.

basis (Basis <#slepc4py.SLEPc.PEP.Basis>) – The basis to be set.
None <https://docs.python.org/3/library/constants.html#None>

:sources:`Source code at slepc4py/SLEPc/PEP.pyx:397 <slepc4py/SLEPc/PEP.pyx#L397>`


Set the extraction technique used in the CISS solver.

Logically collective.

extraction (CISSExtraction <#slepc4py.SLEPc.PEP.CISSExtraction>) – The extraction technique.
None <https://docs.python.org/3/library/constants.html#None>

:sources:`Source code at slepc4py/SLEPc/PEP.pyx:2035 <slepc4py/SLEPc/PEP.pyx#L2035>`


Set the values of various refinement parameters in the CISS solver.

Logically collective.


:sources:`Source code at slepc4py/SLEPc/PEP.pyx:2181 <slepc4py/SLEPc/PEP.pyx#L2181>`


Set the values of various size parameters in the CISS solver.

Logically collective.


Notes

The default number of partitions is 1. This means the internal petsc4py.PETSc.KSP <https://petsc.org/release/petsc4py/reference/petsc4py.PETSc.KSP.html#petsc4py.PETSc.KSP> object is shared among all processes of the PEP communicator. Otherwise, the communicator is split into npart communicators, so that npart petsc4py.PETSc.KSP <https://petsc.org/release/petsc4py/reference/petsc4py.PETSc.KSP.html#petsc4py.PETSc.KSP> solves proceed simultaneously.

:sources:`Source code at slepc4py/SLEPc/PEP.pyx:2064 <slepc4py/SLEPc/PEP.pyx#L2064>`


Set the values of various threshold parameters in the CISS solver.

Logically collective.


:sources:`Source code at slepc4py/SLEPc/PEP.pyx:2144 <slepc4py/SLEPc/PEP.pyx#L2144>`


Set how to compute the error estimate used in the convergence test.

Logically collective.

conv (Conv <#slepc4py.SLEPc.PEP.Conv>) – The method used to compute the error estimate used in the convergence test.
None <https://docs.python.org/3/library/constants.html#None>

:sources:`Source code at slepc4py/SLEPc/PEP.pyx:617 <slepc4py/SLEPc/PEP.pyx#L617>`


Set a direct solver object associated to the eigensolver.

Collective.

ds (DS <#slepc4py.SLEPc.DS>) – The direct solver context.
None <https://docs.python.org/3/library/constants.html#None>

:sources:`Source code at slepc4py/SLEPc/PEP.pyx:1028 <slepc4py/SLEPc/PEP.pyx#L1028>`


Set the number of eigenvalues to compute and the dimension of the subspace.

Logically collective.


:sources:`Source code at slepc4py/SLEPc/PEP.pyx:800 <slepc4py/SLEPc/PEP.pyx#L800>`


Set the extraction strategy to be used.

Logically collective.

extract (Extract <#slepc4py.SLEPc.PEP.Extract>) – The extraction strategy.
None <https://docs.python.org/3/library/constants.html#None>

:sources:`Source code at slepc4py/SLEPc/PEP.pyx:718 <slepc4py/SLEPc/PEP.pyx#L718>`


Set PEP options from the options database.

Collective.

This routine must be called before setUp() if the user is to be allowed to set the solver type.

:sources:`Source code at slepc4py/SLEPc/PEP.pyx:368 <slepc4py/SLEPc/PEP.pyx#L368>`



Set the initial space from which the eigensolver starts to iterate.

Collective.


:sources:`Source code at slepc4py/SLEPc/PEP.pyx:1083 <slepc4py/SLEPc/PEP.pyx#L1083>`


Set the computational interval for spectrum slicing.

Logically collective.


Notes

Spectrum slicing is a technique employed for computing all eigenvalues of symmetric quadratic eigenproblems in a given interval. This function provides the interval to be considered. It must be used in combination with PEP.Which.ALL <#slepc4py.SLEPc.PEP.Which.ALL>, see setWhichEigenpairs().

:sources:`Source code at slepc4py/SLEPc/PEP.pyx:576 <slepc4py/SLEPc/PEP.pyx#L576>`


Set the threshold for changing the target in the correction equation.

Logically collective.


Notes

The target in the correction equation is fixed at the first iterations. When the norm of the residual vector is lower than the fix value, the target is set to the corresponding eigenvalue.

:sources:`Source code at slepc4py/SLEPc/PEP.pyx:1911 <slepc4py/SLEPc/PEP.pyx#L1911>`


Set the maximum allowed value for the minimality index.

Logically collective.


:sources:`Source code at slepc4py/SLEPc/PEP.pyx:1975 <slepc4py/SLEPc/PEP.pyx#L1975>`


Set the type of projection to be used in the Jacobi-Davidson solver.

Logically collective.

proj (JDProjection <#slepc4py.SLEPc.PEP.JDProjection>) – The type of projection.
None <https://docs.python.org/3/library/constants.html#None>

:sources:`Source code at slepc4py/SLEPc/PEP.pyx:2004 <slepc4py/SLEPc/PEP.pyx#L2004>`


Set the restart parameter for the Jacobi-Davidson method.

Logically collective.

Set the restart parameter for the Jacobi-Davidson method, in particular the proportion of basis vectors that must be kept after restart.


Notes

Allowed values are in the range [0.1,0.9]. The default is 0.5.

:sources:`Source code at slepc4py/SLEPc/PEP.pyx:1874 <slepc4py/SLEPc/PEP.pyx#L1874>`


Set a flag indicating whether the preconditioner must be reused or not.

Logically collective.


:sources:`Source code at slepc4py/SLEPc/PEP.pyx:1946 <slepc4py/SLEPc/PEP.pyx#L1946>`


Set an eigensolver object associated to the polynomial eigenvalue solver.

Collective.

eps (EPS <#slepc4py.SLEPc.EPS>) – The linear eigensolver.
None <https://docs.python.org/3/library/constants.html#None>

:sources:`Source code at slepc4py/SLEPc/PEP.pyx:1385 <slepc4py/SLEPc/PEP.pyx#L1385>`


Set flag to explicitly build the matrices A and B.

Logically collective.

Toggle if the matrices A and B for the linearization of the problem must be built explicitly.

flag (bool <https://docs.python.org/3/library/functions.html#bool>) – Boolean flag indicating if the matrices are built explicitly.
None <https://docs.python.org/3/library/constants.html#None>

:sources:`Source code at slepc4py/SLEPc/PEP.pyx:1455 <slepc4py/SLEPc/PEP.pyx#L1455>`


Set the coefficients that define the linearization of a quadratic eigenproblem.

Logically collective.

Set the coefficients that define the linearization of a quadratic eigenproblem.


None <https://docs.python.org/3/library/constants.html#None>

:sources:`Source code at slepc4py/SLEPc/PEP.pyx:1414 <slepc4py/SLEPc/PEP.pyx#L1414>`


Append a monitor function to the list of monitors.

Logically collective.

:sources:`Source code at slepc4py/SLEPc/PEP.pyx:1133 <slepc4py/SLEPc/PEP.pyx#L1133>`



Set the matrices associated with the eigenvalue problem.

Collective.


:sources:`Source code at slepc4py/SLEPc/PEP.pyx:1063 <slepc4py/SLEPc/PEP.pyx#L1063>`


Set the prefix used for searching for all PEP options in the database.

Logically collective.


:sources:`Source code at slepc4py/SLEPc/PEP.pyx:338 <slepc4py/SLEPc/PEP.pyx#L338>`


Set the type of the eigenvalue problem.

Logically collective.

problem_type (ProblemType <#slepc4py.SLEPc.PEP.ProblemType>) – The problem type to be set.
None <https://docs.python.org/3/library/constants.html#None>

:sources:`Source code at slepc4py/SLEPc/PEP.pyx:429 <slepc4py/SLEPc/PEP.pyx#L429>`


Toggle between locking and non-locking variants of the Q-Arnoldi method.

Logically collective.


Notes

The default is to lock converged eigenpairs when the method restarts. This behavior can be changed so that all directions are kept in the working subspace even if already converged to working accuracy (the non-locking variant).

:sources:`Source code at slepc4py/SLEPc/PEP.pyx:1529 <slepc4py/SLEPc/PEP.pyx#L1529>`


Set the restart parameter for the Q-Arnoldi method.

Logically collective.

Set the restart parameter for the Q-Arnoldi method, in particular the proportion of basis vectors that must be kept after restart.


Notes

Allowed values are in the range [0.1,0.9]. The default is 0.5.

:sources:`Source code at slepc4py/SLEPc/PEP.pyx:1492 <slepc4py/SLEPc/PEP.pyx#L1492>`


Set a region object associated to the eigensolver.

Collective.

rg (RG <#slepc4py.SLEPc.RG>) – The region context.
None <https://docs.python.org/3/library/constants.html#None>

:sources:`Source code at slepc4py/SLEPc/PEP.pyx:999 <slepc4py/SLEPc/PEP.pyx#L999>`


Set the refinement strategy used by the PEP object.

Logically collective.

Set the refinement strategy used by the PEP object, and the associated parameters.


None <https://docs.python.org/3/library/constants.html#None>

:sources:`Source code at slepc4py/SLEPc/PEP.pyx:662 <slepc4py/SLEPc/PEP.pyx#L662>`


Set a spectral transformation object associated to the eigensolver.

Collective.

st (ST <#slepc4py.SLEPc.ST>) – The spectral transformation.
None <https://docs.python.org/3/library/constants.html#None>

:sources:`Source code at slepc4py/SLEPc/PEP.pyx:847 <slepc4py/SLEPc/PEP.pyx#L847>`


Set flag to check if all eigenvalues have the same definite type.

Logically collective.

Set a flag to check that all the eigenvalues obtained throughout the spectrum slicing computation have the same definite type.


:sources:`Source code at slepc4py/SLEPc/PEP.pyx:1840 <slepc4py/SLEPc/PEP.pyx#L1840>`


Set flag to enforce detection of zeros during the factorizations.

Logically collective.

Set a flag to enforce detection of zeros during the factorizations throughout the spectrum slicing computation.


Notes

A zero in the factorization indicates that a shift coincides with an eigenvalue.

This flag is turned off by default, and may be necessary in some cases. This feature currently requires an external package for factorizations with support for zero detection, e.g. MUMPS.

:sources:`Source code at slepc4py/SLEPc/PEP.pyx:1713 <slepc4py/SLEPc/PEP.pyx#L1713>`


Set the dimensions used for each subsolve step.

Logically collective.

Set the dimensions used for each subsolve step in case of doing spectrum slicing for a computational interval. The meaning of the parameters is the same as in setDimensions().


:sources:`Source code at slepc4py/SLEPc/PEP.pyx:1754 <slepc4py/SLEPc/PEP.pyx#L1754>`


Set the coefficients that define the linearization of a quadratic eigenproblem.

Logically collective.


None <https://docs.python.org/3/library/constants.html#None>

:sources:`Source code at slepc4py/SLEPc/PEP.pyx:1642 <slepc4py/SLEPc/PEP.pyx#L1642>`


Toggle between locking and non-locking variants of the STOAR method.

Logically collective.


Notes

The default is to lock converged eigenpairs when the method restarts. This behavior can be changed so that all directions are kept in the working subspace even if already converged to working accuracy (the non-locking variant).

:sources:`Source code at slepc4py/SLEPc/PEP.pyx:1677 <slepc4py/SLEPc/PEP.pyx#L1677>`


Set the scaling strategy to be used.

Collective.

Set the scaling strategy to be used for scaling the polynomial problem before attempting to solve.


:sources:`Source code at slepc4py/SLEPc/PEP.pyx:909 <slepc4py/SLEPc/PEP.pyx#L909>`


Set a function to decide when to stop the outer iteration of the eigensolver.

Logically collective.

:sources:`Source code at slepc4py/SLEPc/PEP.pyx:1103 <slepc4py/SLEPc/PEP.pyx#L1103>`



Toggle between locking and non-locking variants of the TOAR method.

Logically collective.


Notes

The default is to lock converged eigenpairs when the method restarts. This behavior can be changed so that all directions are kept in the working subspace even if already converged to working accuracy (the non-locking variant).

:sources:`Source code at slepc4py/SLEPc/PEP.pyx:1604 <slepc4py/SLEPc/PEP.pyx#L1604>`


Set the restart parameter for the TOAR method.

Logically collective.

Set the restart parameter for the TOAR method, in particular the proportion of basis vectors that must be kept after restart.


Notes

Allowed values are in the range [0.1,0.9]. The default is 0.5.

:sources:`Source code at slepc4py/SLEPc/PEP.pyx:1567 <slepc4py/SLEPc/PEP.pyx#L1567>`


Set the value of the target.

Logically collective.

target (Scalar <#slepc4py.typing.Scalar>) – The value of the target.
None <https://docs.python.org/3/library/constants.html#None>

Notes

The target is a scalar value used to determine the portion of the spectrum of interest. It is used in combination with setWhichEigenpairs().

:sources:`Source code at slepc4py/SLEPc/PEP.pyx:491 <slepc4py/SLEPc/PEP.pyx#L491>`


Set the tolerance and maximum iteration count.

Logically collective.

Set the tolerance and maximum iteration count used by the default PEP convergence tests.


:sources:`Source code at slepc4py/SLEPc/PEP.pyx:532 <slepc4py/SLEPc/PEP.pyx#L532>`


Set flag to compute the residual of all approximate eigenpairs.

Logically collective.

Set if the solver must compute the residual of all approximate eigenpairs or not.


:sources:`Source code at slepc4py/SLEPc/PEP.pyx:762 <slepc4py/SLEPc/PEP.pyx#L762>`


Set the particular solver to be used in the PEP object.

Logically collective.

pep_type (Type <#slepc4py.SLEPc.PEP.Type> | str <https://docs.python.org/3/library/stdtypes.html#str>) – The solver to be used.
None <https://docs.python.org/3/library/constants.html#None>

:sources:`Source code at slepc4py/SLEPc/PEP.pyx:293 <slepc4py/SLEPc/PEP.pyx#L293>`


Set up all the necessary internal data structures.

Collective.

Set up all the internal data structures necessary for the execution of the eigensolver.

:sources:`Source code at slepc4py/SLEPc/PEP.pyx:1173 <slepc4py/SLEPc/PEP.pyx#L1173>`



Set which portion of the spectrum is to be sought.

Logically collective.

which (Which <#slepc4py.SLEPc.PEP.Which>) – The portion of the spectrum to be sought by the solver.
None <https://docs.python.org/3/library/constants.html#None>

:sources:`Source code at slepc4py/SLEPc/PEP.pyx:458 <slepc4py/SLEPc/PEP.pyx#L458>`


Solve the eigensystem.

Collective.

:sources:`Source code at slepc4py/SLEPc/PEP.pyx:1184 <slepc4py/SLEPc/PEP.pyx#L1184>`



Display the computed eigenvalues in a viewer.

Collective.


:sources:`Source code at slepc4py/SLEPc/PEP.pyx:1353 <slepc4py/SLEPc/PEP.pyx#L1353>`


Output computed eigenvectors to a viewer.

Collective.


:sources:`Source code at slepc4py/SLEPc/PEP.pyx:1368 <slepc4py/SLEPc/PEP.pyx#L1368>`


Print the PEP data structure.

Collective.


:sources:`Source code at slepc4py/SLEPc/PEP.pyx:243 <slepc4py/SLEPc/PEP.pyx#L243>`


Attributes Documentation

The basis vectors (BV) object associated.

:sources:`Source code at slepc4py/SLEPc/PEP.pyx:2299 <slepc4py/SLEPc/PEP.pyx#L2299>`


The direct solver (DS) object associated.

:sources:`Source code at slepc4py/SLEPc/PEP.pyx:2313 <slepc4py/SLEPc/PEP.pyx#L2313>`


The type of extraction technique to be employed.

:sources:`Source code at slepc4py/SLEPc/PEP.pyx:2264 <slepc4py/SLEPc/PEP.pyx#L2264>`


The maximum iteration count.

:sources:`Source code at slepc4py/SLEPc/PEP.pyx:2278 <slepc4py/SLEPc/PEP.pyx#L2278>`


The type of the eigenvalue problem.

:sources:`Source code at slepc4py/SLEPc/PEP.pyx:2243 <slepc4py/SLEPc/PEP.pyx#L2243>`


The region (RG) object associated.

:sources:`Source code at slepc4py/SLEPc/PEP.pyx:2306 <slepc4py/SLEPc/PEP.pyx#L2306>`


The spectral transformation (ST) object associated.

:sources:`Source code at slepc4py/SLEPc/PEP.pyx:2292 <slepc4py/SLEPc/PEP.pyx#L2292>`


The value of the target.

:sources:`Source code at slepc4py/SLEPc/PEP.pyx:2257 <slepc4py/SLEPc/PEP.pyx#L2257>`


The tolerance.

:sources:`Source code at slepc4py/SLEPc/PEP.pyx:2271 <slepc4py/SLEPc/PEP.pyx#L2271>`


Compute the residual norm of all approximate eigenpairs.

:sources:`Source code at slepc4py/SLEPc/PEP.pyx:2285 <slepc4py/SLEPc/PEP.pyx#L2285>`


The portion of the spectrum to be sought.

:sources:`Source code at slepc4py/SLEPc/PEP.pyx:2250 <slepc4py/SLEPc/PEP.pyx#L2250>`




slepc4py.SLEPc.RG

Bases: Object <https://petsc.org/release/petsc4py/reference/petsc4py.PETSc.Object.html#petsc4py.PETSc.Object>

RG.

Enumerations

QuadRule <#slepc4py.SLEPc.RG.QuadRule> RG quadrature rule for contour integral methods.
Type <#slepc4py.SLEPc.RG.Type> RG type.

slepc4py.SLEPc.RG.QuadRule

Bases: object <https://docs.python.org/3/library/functions.html#object>

RG quadrature rule for contour integral methods.

  • TRAPEZOIDAL: Trapezoidal rule.
  • CHEBYSHEV: Chebyshev points.

Attributes Summary

CHEBYSHEV Constant CHEBYSHEV of type int <https://docs.python.org/3/library/functions.html#int>
TRAPEZOIDAL Constant TRAPEZOIDAL of type int <https://docs.python.org/3/library/functions.html#int>

Attributes Documentation




slepc4py.SLEPc.RG.Type


Methods Summary

appendOptionsPrefix([prefix]) Append to the prefix used for searching for all RG options in the database.
canUseConjugates([realmats]) Half of integration points can be avoided (use their conjugates).
checkInside(a) Determine if a set of given points are inside the region or not.
computeBoundingBox() Endpoints of a rectangle in the complex plane containing the region.
computeContour(n) Compute the coordinates of several points of the contour on the region.
computeQuadrature(quad, n) Compute the values of the parameters used in a quadrature rule.
create([comm]) Create the RG object.
destroy() Destroy the RG object.
getComplement() Get the flag indicating whether the region is complemented or not.
getEllipseParameters() Get the parameters that define the ellipse region.
getIntervalEndpoints() Get the parameters that define the interval region.
getOptionsPrefix() Get the prefix used for searching for all RG options in the database.
getPolygonVertices() Get the parameters that define the interval region.
getRingParameters() Get the parameters that define the ring region.
getScale() Get the scaling factor.
getType() Get the RG type of this object.
isAxisymmetric([vertical]) Determine if the region is symmetric wrt.
isTrivial() Tell whether it is the trivial region (whole complex plane).
setComplement([comp]) Set a flag to indicate that the region is the complement of the specified one.
setEllipseParameters(center, radius[, vscale]) Set the parameters defining the ellipse region.
setFromOptions() Set RG options from the options database.
setIntervalEndpoints(a, b, c, d) Set the parameters defining the interval region.
setOptionsPrefix([prefix]) Set the prefix used for searching for all RG options in the database.
setPolygonVertices(v) Set the vertices that define the polygon region.
setRingParameters(center, radius, vscale, ...) Set the parameters defining the ring region.
setScale([sfactor]) Set the scaling factor to be used.
setType(rg_type) Set the type for the RG object.
view([viewer]) Print the RG data structure.

Attributes Summary

complement If the region is the complement of the specified one.
scale The scaling factor to be used.

Methods Documentation

Append to the prefix used for searching for all RG options in the database.

Logically collective.


:sources:`Source code at slepc4py/SLEPc/RG.pyx:141 <slepc4py/SLEPc/RG.pyx#L141>`


Half of integration points can be avoided (use their conjugates).

Not collective.

Used in contour integral methods to determine whether half of integration points can be avoided (use their conjugates).

realmats (bool <https://docs.python.org/3/library/functions.html#bool>) – True if the problem matrices are real.
Whether it is possible to use conjugates.
bool <https://docs.python.org/3/library/functions.html#bool>

:sources:`Source code at slepc4py/SLEPc/RG.pyx:361 <slepc4py/SLEPc/RG.pyx#L361>`


Determine if a set of given points are inside the region or not.

Not collective.

a (Sequence <https://docs.python.org/3/library/typing.html#typing.Sequence>[complex <https://docs.python.org/3/library/functions.html#complex>]) – The coordinates of the points.
Computed result for each point (1=inside, 0=on the contour, -1=outside).
ArrayInt <#slepc4py.typing.ArrayInt>

:sources:`Source code at slepc4py/SLEPc/RG.pyx:274 <slepc4py/SLEPc/RG.pyx#L274>`


Endpoints of a rectangle in the complex plane containing the region.

Not collective.

Determine the endpoints of a rectangle in the complex plane that contains the region.


tuple <https://docs.python.org/3/library/stdtypes.html#tuple>[float <https://docs.python.org/3/library/functions.html#float>, float <https://docs.python.org/3/library/functions.html#float>, float <https://docs.python.org/3/library/functions.html#float>, float <https://docs.python.org/3/library/functions.html#float>]

:sources:`Source code at slepc4py/SLEPc/RG.pyx:337 <slepc4py/SLEPc/RG.pyx#L337>`


Compute the coordinates of several points of the contour on the region.

Not collective.

Compute the coordinates of several points lying on the contour of the region.


:sources:`Source code at slepc4py/SLEPc/RG.pyx:306 <slepc4py/SLEPc/RG.pyx#L306>`


Compute the values of the parameters used in a quadrature rule.

Not collective.

Compute the values of the parameters used in a quadrature rule for a contour integral around the boundary of the region.


  • z (ArrayScalar <#slepc4py.typing.ArrayScalar>) – Quadrature points.
  • zn (ArrayScalar <#slepc4py.typing.ArrayScalar>) – Normalized quadrature points.
  • w (ArrayScalar <#slepc4py.typing.ArrayScalar>) – Quadrature weights.

tuple <https://docs.python.org/3/library/stdtypes.html#tuple>[ArrayScalar <#slepc4py.typing.ArrayScalar>, ArrayScalar <#slepc4py.typing.ArrayScalar>, ArrayScalar <#slepc4py.typing.ArrayScalar>]

:sources:`Source code at slepc4py/SLEPc/RG.pyx:385 <slepc4py/SLEPc/RG.pyx#L385>`


Create the RG object.

Collective.


:sources:`Source code at slepc4py/SLEPc/RG.pyx:58 <slepc4py/SLEPc/RG.pyx#L58>`


Destroy the RG object.

Collective.

:sources:`Source code at slepc4py/SLEPc/RG.pyx:48 <slepc4py/SLEPc/RG.pyx#L48>`



Get the flag indicating whether the region is complemented or not.

Not collective.

Whether the region is complemented or not.
bool <https://docs.python.org/3/library/functions.html#bool>

:sources:`Source code at slepc4py/SLEPc/RG.pyx:212 <slepc4py/SLEPc/RG.pyx#L212>`


Get the parameters that define the ellipse region.

Not collective.


tuple <https://docs.python.org/3/library/stdtypes.html#tuple>[Scalar <#slepc4py.typing.Scalar>, float <https://docs.python.org/3/library/functions.html#float>, float <https://docs.python.org/3/library/functions.html#float>]

:sources:`Source code at slepc4py/SLEPc/RG.pyx:442 <slepc4py/SLEPc/RG.pyx#L442>`


Get the parameters that define the interval region.

Not collective.


:sources:`Source code at slepc4py/SLEPc/RG.pyx:486 <slepc4py/SLEPc/RG.pyx#L486>`


Get the prefix used for searching for all RG options in the database.

Not collective.

The prefix string set for this RG object.
str <https://docs.python.org/3/library/stdtypes.html#str>

:sources:`Source code at slepc4py/SLEPc/RG.pyx:126 <slepc4py/SLEPc/RG.pyx#L126>`


Get the parameters that define the interval region.

Not collective.

The vertices.
ArrayComplex <#slepc4py.typing.ArrayComplex>

:sources:`Source code at slepc4py/SLEPc/RG.pyx:534 <slepc4py/SLEPc/RG.pyx#L534>`


Get the parameters that define the ring region.

Not collective.


:sources:`Source code at slepc4py/SLEPc/RG.pyx:593 <slepc4py/SLEPc/RG.pyx#L593>`


Get the scaling factor.

Not collective.


:sources:`Source code at slepc4py/SLEPc/RG.pyx:259 <slepc4py/SLEPc/RG.pyx#L259>`


Get the RG type of this object.

Not collective.

The inner product type currently being used.
str <https://docs.python.org/3/library/stdtypes.html#str>

:sources:`Source code at slepc4py/SLEPc/RG.pyx:90 <slepc4py/SLEPc/RG.pyx#L90>`


Determine if the region is symmetric wrt. the real or imaginary axis.

Not collective.

Determine if the region is symmetric with respect to the real or imaginary axis.

vertical (bool <https://docs.python.org/3/library/functions.html#bool>) – True if symmetry must be checked against the vertical axis.
True if the region is axisymmetric.
bool <https://docs.python.org/3/library/functions.html#bool>

:sources:`Source code at slepc4py/SLEPc/RG.pyx:188 <slepc4py/SLEPc/RG.pyx#L188>`


Tell whether it is the trivial region (whole complex plane).

Not collective.

True if the region is equal to the whole complex plane, e.g., an interval region with all four endpoints unbounded or an ellipse with infinite radius.
bool <https://docs.python.org/3/library/functions.html#bool>

:sources:`Source code at slepc4py/SLEPc/RG.pyx:171 <slepc4py/SLEPc/RG.pyx#L171>`


Set a flag to indicate that the region is the complement of the specified one.

Logically collective.

comp (bool <https://docs.python.org/3/library/functions.html#bool>) – Activate/deactivate the complementation of the region.
None <https://docs.python.org/3/library/constants.html#None>

:sources:`Source code at slepc4py/SLEPc/RG.pyx:227 <slepc4py/SLEPc/RG.pyx#L227>`


Set the parameters defining the ellipse region.

Logically collective.


:sources:`Source code at slepc4py/SLEPc/RG.pyx:421 <slepc4py/SLEPc/RG.pyx#L421>`


Set RG options from the options database.

Collective.

Notes

To see all options, run your program with the -help option.

:sources:`Source code at slepc4py/SLEPc/RG.pyx:156 <slepc4py/SLEPc/RG.pyx#L156>`



Set the parameters defining the interval region.

Logically collective.


None <https://docs.python.org/3/library/constants.html#None>

:sources:`Source code at slepc4py/SLEPc/RG.pyx:463 <slepc4py/SLEPc/RG.pyx#L463>`


Set the prefix used for searching for all RG options in the database.

Logically collective.


Notes

A hyphen (-) must NOT be given at the beginning of the prefix name. The first character of all runtime options is AUTOMATICALLY the hyphen.

:sources:`Source code at slepc4py/SLEPc/RG.pyx:105 <slepc4py/SLEPc/RG.pyx#L105>`


Set the vertices that define the polygon region.

Logically collective.


:sources:`Source code at slepc4py/SLEPc/RG.pyx:510 <slepc4py/SLEPc/RG.pyx#L510>`


Set the parameters defining the ring region.

Logically collective.


None <https://docs.python.org/3/library/constants.html#None>

:sources:`Source code at slepc4py/SLEPc/RG.pyx:556 <slepc4py/SLEPc/RG.pyx#L556>`


Set the scaling factor to be used.

Logically collective.

Set the scaling factor to be used when checking that a point is inside the region and when computing the contour.


:sources:`Source code at slepc4py/SLEPc/RG.pyx:241 <slepc4py/SLEPc/RG.pyx#L241>`


Set the type for the RG object.

Logically collective.

rg_type (Type <#slepc4py.SLEPc.RG.Type> | str <https://docs.python.org/3/library/stdtypes.html#str>) – The inner product type to be used.
None <https://docs.python.org/3/library/constants.html#None>

:sources:`Source code at slepc4py/SLEPc/RG.pyx:75 <slepc4py/SLEPc/RG.pyx#L75>`


Print the RG data structure.

Collective.


:sources:`Source code at slepc4py/SLEPc/RG.pyx:33 <slepc4py/SLEPc/RG.pyx#L33>`


Attributes Documentation

If the region is the complement of the specified one.

:sources:`Source code at slepc4py/SLEPc/RG.pyx:625 <slepc4py/SLEPc/RG.pyx#L625>`


The scaling factor to be used.

:sources:`Source code at slepc4py/SLEPc/RG.pyx:632 <slepc4py/SLEPc/RG.pyx#L632>`




slepc4py.SLEPc.ST

Bases: Object <https://petsc.org/release/petsc4py/reference/petsc4py.PETSc.Object.html#petsc4py.PETSc.Object>

ST.

Enumerations

FilterDamping <#slepc4py.SLEPc.ST.FilterDamping> ST filter damping.
FilterType <#slepc4py.SLEPc.ST.FilterType> ST filter type.
MatMode <#slepc4py.SLEPc.ST.MatMode> ST matrix mode.
Type <#slepc4py.SLEPc.ST.Type> ST types.

slepc4py.SLEPc.ST.FilterDamping


slepc4py.SLEPc.ST.FilterType

Bases: object <https://docs.python.org/3/library/functions.html#object>

ST filter type.

  • FILTLAN: An adapted implementation of the Filtered Lanczos Package.
  • CHEBYSEV: A polynomial filter based on a truncated Chebyshev series.

Attributes Summary

CHEBYSHEV Constant CHEBYSHEV of type int <https://docs.python.org/3/library/functions.html#int>
FILTLAN Constant FILTLAN of type int <https://docs.python.org/3/library/functions.html#int>

Attributes Documentation




slepc4py.SLEPc.ST.MatMode


slepc4py.SLEPc.ST.Type

Bases: object <https://docs.python.org/3/library/functions.html#object>

ST types.

  • SHELL: User-defined.
  • SHIFT: Shift from origin.
  • SINVERT: Shift-and-invert.
  • CAYLEY: Cayley transform.
  • PRECOND: Preconditioner.
  • FILTER: Polynomial filter.

Attributes Summary

CAYLEY Object CAYLEY of type str <https://docs.python.org/3/library/stdtypes.html#str>
FILTER Object FILTER of type str <https://docs.python.org/3/library/stdtypes.html#str>
PRECOND Object PRECOND of type str <https://docs.python.org/3/library/stdtypes.html#str>
SHELL Object SHELL of type str <https://docs.python.org/3/library/stdtypes.html#str>
SHIFT Object SHIFT of type str <https://docs.python.org/3/library/stdtypes.html#str>
SINVERT Object SINVERT of type str <https://docs.python.org/3/library/stdtypes.html#str>

Attributes Documentation








Methods Summary

appendOptionsPrefix([prefix]) Append to the prefix used for searching for all ST options in the database.
apply(x, y) Apply the spectral transformation operator to a vector.
applyHermitianTranspose(x, y) Apply the hermitian-transpose of the operator to a vector.
applyMat(x, y) Apply the spectral transformation operator to a matrix.
applyTranspose(x, y) Apply the transpose of the operator to a vector.
create([comm]) Create the ST object.
destroy() Destroy the ST object.
getCayleyAntishift() Get the value of the anti-shift for the Cayley spectral transformation.
getFilterDamping() Get the type of damping used in the polynomial filter.
getFilterDegree() Get the degree of the filter polynomial.
getFilterInterval() Get the interval containing the desired eigenvalues.
getFilterRange() Get the interval containing all eigenvalues.
getFilterType() Get the method to be used to build the polynomial filter.
getKSP() Get the KSP object associated with the spectral transformation.
getMatMode() Get a flag that indicates how the matrix is being shifted.
getMatStructure() Get the internal Mat.Structure attribute.
getMatrices() Get the matrices associated with the eigenvalue problem.
getOperator() Get a shell matrix that represents the operator of the spectral transformation.
getOptionsPrefix() Get the prefix used for searching for all ST options in the database.
getPreconditionerMat() Get the matrix previously set by setPreconditionerMat().
getShift() Get the shift associated with the spectral transformation.
getSplitPreconditioner() Get the matrices to be used to build the preconditioner.
getTransform() Get the flag indicating whether the transformed matrices are computed or not.
getType() Get the ST type of this object.
reset() Reset the ST object.
restoreOperator(op) Restore the previously seized operator matrix.
setCayleyAntishift(tau) Set the value of the anti-shift for the Cayley spectral transformation.
setFilterDamping(damping) Set the type of damping to be used in the polynomial filter.
setFilterDegree(deg) Set the degree of the filter polynomial.
setFilterInterval(inta, intb) Set the interval containing the desired eigenvalues.
setFilterRange(left, right) Set the numerical range (or field of values) of the matrix.
setFilterType(filter_type) Set the method to be used to build the polynomial filter.
setFromOptions() Set ST options from the options database.
setKSP(ksp) Set the KSP object associated with the spectral transformation.
setMatMode(mode) Set a flag to indicate how the matrix is being shifted.
setMatStructure(structure) Set an internal Mat.Structure attribute.
setMatrices(operators) Set the matrices associated with the eigenvalue problem.
setOptionsPrefix([prefix]) Set the prefix used for searching for all ST options in the database.
setPreconditionerMat([P]) Set the matrix to be used to build the preconditioner.
setShift(shift) Set the shift associated with the spectral transformation.
setSplitPreconditioner(operators[, structure]) Set the matrices to be used to build the preconditioner.
setTransform([flag]) Set a flag to indicate whether the transformed matrices are computed or not.
setType(st_type) Set the particular spectral transformation to be used.
setUp() Prepare for the use of a spectral transformation.
view([viewer]) Print the ST data structure.

Attributes Summary

ksp KSP object associated with the spectral transformation.
mat_mode How the transformed matrices are being stored in the ST.
mat_structure Relation of the sparsity pattern of all ST matrices.
shift Value of the shift.
transform If the transformed matrices are computed.

Methods Documentation

Append to the prefix used for searching for all ST options in the database.

Logically collective.


:sources:`Source code at slepc4py/SLEPc/ST.pyx:198 <slepc4py/SLEPc/ST.pyx#L198>`


Apply the spectral transformation operator to a vector.

Collective.

Apply the spectral transformation operator to a vector, for instance (A - s B)^{-1} B in the case of the shift-and-invert transformation and generalized eigenproblem.


:sources:`Source code at slepc4py/SLEPc/ST.pyx:563 <slepc4py/SLEPc/ST.pyx#L563>`


Apply the hermitian-transpose of the operator to a vector.

Collective.

Apply the hermitian-transpose of the operator to a vector, for instance B^H(A - s B)^{-H} in the case of the shift-and-invert transformation and generalized eigenproblem.


:sources:`Source code at slepc4py/SLEPc/ST.pyx:601 <slepc4py/SLEPc/ST.pyx#L601>`


Apply the spectral transformation operator to a matrix.

Collective.

Apply the spectral transformation operator to a matrix, for instance (A - s B)^{-1} B in the case of the shift-and-invert transformation and generalized eigenproblem.


:sources:`Source code at slepc4py/SLEPc/ST.pyx:620 <slepc4py/SLEPc/ST.pyx#L620>`


Apply the transpose of the operator to a vector.

Collective.

Apply the transpose of the operator to a vector, for instance B^T(A - s B)^{-T} in the case of the shift-and-invert transformation and generalized eigenproblem.


:sources:`Source code at slepc4py/SLEPc/ST.pyx:582 <slepc4py/SLEPc/ST.pyx#L582>`


Create the ST object.

Collective.


:sources:`Source code at slepc4py/SLEPc/ST.pyx:106 <slepc4py/SLEPc/ST.pyx#L106>`


Destroy the ST object.

Collective.

:sources:`Source code at slepc4py/SLEPc/ST.pyx:88 <slepc4py/SLEPc/ST.pyx#L88>`



Get the value of the anti-shift for the Cayley spectral transformation.

Not collective.

The anti-shift.
Scalar <#slepc4py.typing.Scalar>

:sources:`Source code at slepc4py/SLEPc/ST.pyx:692 <slepc4py/SLEPc/ST.pyx#L692>`


Get the type of damping used in the polynomial filter.

Not collective.

The type of damping.
FilterDamping <#slepc4py.SLEPc.ST.FilterDamping>

:sources:`Source code at slepc4py/SLEPc/ST.pyx:870 <slepc4py/SLEPc/ST.pyx#L870>`


Get the degree of the filter polynomial.

Not collective.


:sources:`Source code at slepc4py/SLEPc/ST.pyx:841 <slepc4py/SLEPc/ST.pyx#L841>`


Get the interval containing the desired eigenvalues.

Not collective.


:sources:`Source code at slepc4py/SLEPc/ST.pyx:765 <slepc4py/SLEPc/ST.pyx#L765>`


Get the interval containing all eigenvalues.

Not collective.


:sources:`Source code at slepc4py/SLEPc/ST.pyx:809 <slepc4py/SLEPc/ST.pyx#L809>`


Get the method to be used to build the polynomial filter.

Not collective.

The type of filter.
FilterType <#slepc4py.SLEPc.ST.FilterType>

:sources:`Source code at slepc4py/SLEPc/ST.pyx:721 <slepc4py/SLEPc/ST.pyx#L721>`


Get the KSP object associated with the spectral transformation.

Collective.


Notes

On output, the internal value of petsc4py.PETSc.KSP <https://petsc.org/release/petsc4py/reference/petsc4py.PETSc.KSP.html#petsc4py.PETSc.KSP> can be NULL if the combination of eigenproblem type and selected transformation does not require to solve a linear system of equations.

:sources:`Source code at slepc4py/SLEPc/ST.pyx:458 <slepc4py/SLEPc/ST.pyx#L458>`


Get a flag that indicates how the matrix is being shifted.

Not collective.

Get a flag that indicates how the matrix is being shifted in the shift-and-invert and Cayley spectral transformations.

The mode flag.
MatMode <#slepc4py.SLEPc.ST.MatMode>

:sources:`Source code at slepc4py/SLEPc/ST.pyx:342 <slepc4py/SLEPc/ST.pyx#L342>`


Get the internal Mat.Structure attribute.

Not collective.

Get the internal Mat.Structure attribute to indicate which is the relation of the sparsity pattern of the matrices.


:sources:`Source code at slepc4py/SLEPc/ST.pyx:427 <slepc4py/SLEPc/ST.pyx#L427>`


Get the matrices associated with the eigenvalue problem.

Collective.


:sources:`Source code at slepc4py/SLEPc/ST.pyx:378 <slepc4py/SLEPc/ST.pyx#L378>`


Get a shell matrix that represents the operator of the spectral transformation.

Collective.


:sources:`Source code at slepc4py/SLEPc/ST.pyx:639 <slepc4py/SLEPc/ST.pyx#L639>`


Get the prefix used for searching for all ST options in the database.

Not collective.

The prefix string set for this ST object.
str <https://docs.python.org/3/library/stdtypes.html#str>

:sources:`Source code at slepc4py/SLEPc/ST.pyx:183 <slepc4py/SLEPc/ST.pyx#L183>`


Get the matrix previously set by setPreconditionerMat().

Not collective.

The matrix that will be used in constructing the preconditioner.
petsc4py.PETSc.Mat <https://petsc.org/release/petsc4py/reference/petsc4py.PETSc.Mat.html#petsc4py.PETSc.Mat>

:sources:`Source code at slepc4py/SLEPc/ST.pyx:494 <slepc4py/SLEPc/ST.pyx#L494>`


Get the shift associated with the spectral transformation.

Not collective.

The value of the shift.
Scalar <#slepc4py.typing.Scalar>

:sources:`Source code at slepc4py/SLEPc/ST.pyx:250 <slepc4py/SLEPc/ST.pyx#L250>`



Get the flag indicating whether the transformed matrices are computed or not.

Not collective.

This flag is intended for the case of polynomial eigenproblems solved via linearization. If this flag is False (default) the spectral transformation is applied to the linearization (handled by the eigensolver), otherwise it is applied to the original problem.
bool <https://docs.python.org/3/library/functions.html#bool>

:sources:`Source code at slepc4py/SLEPc/ST.pyx:283 <slepc4py/SLEPc/ST.pyx#L283>`


Get the ST type of this object.

Not collective.

The spectral transformation currently being used.
str <https://docs.python.org/3/library/stdtypes.html#str>

:sources:`Source code at slepc4py/SLEPc/ST.pyx:147 <slepc4py/SLEPc/ST.pyx#L147>`


Reset the ST object.

Collective.

:sources:`Source code at slepc4py/SLEPc/ST.pyx:98 <slepc4py/SLEPc/ST.pyx#L98>`



Restore the previously seized operator matrix.

Logically collective.


:sources:`Source code at slepc4py/SLEPc/ST.pyx:655 <slepc4py/SLEPc/ST.pyx#L655>`


Set the value of the anti-shift for the Cayley spectral transformation.

Logically collective.

tau (Scalar <#slepc4py.typing.Scalar>) – The anti-shift.
None <https://docs.python.org/3/library/constants.html#None>

Notes

In the generalized Cayley transform, the operator can be expressed as OP = inv(A - \sigma B) (A + tau B). This function sets the value of tau. Use setShift() for setting \sigma.

:sources:`Source code at slepc4py/SLEPc/ST.pyx:671 <slepc4py/SLEPc/ST.pyx#L671>`


Set the type of damping to be used in the polynomial filter.

Logically collective.

Parameter

The type of damping.

:sources:`Source code at slepc4py/SLEPc/ST.pyx:856 <slepc4py/SLEPc/ST.pyx#L856>`

damping (FilterDamping <#slepc4py.SLEPc.ST.FilterDamping>)
None <https://docs.python.org/3/library/constants.html#None>



Set the degree of the filter polynomial.

Logically collective.


:sources:`Source code at slepc4py/SLEPc/ST.pyx:827 <slepc4py/SLEPc/ST.pyx#L827>`


Set the interval containing the desired eigenvalues.

Logically collective.


Notes

The filter will be configured to emphasize eigenvalues contained in the given interval, and damp out eigenvalues outside it. If the interval is open, then the filter is low- or high-pass, otherwise it is mid-pass.

Common usage is to set the interval in EPS <#slepc4py.SLEPc.EPS> with EPS.setInterval() <#slepc4py.SLEPc.EPS.setInterval>.

The interval must be contained within the numerical range of the matrix, see ST.setFilterRange().

:sources:`Source code at slepc4py/SLEPc/ST.pyx:736 <slepc4py/SLEPc/ST.pyx#L736>`


Set the numerical range (or field of values) of the matrix.

Logically collective.

Set the numerical range (or field of values) of the matrix, that is, the interval containing all eigenvalues.


Notes

The filter will be most effective if the numerical range is tight, that is, left and right are good approximations to the leftmost and rightmost eigenvalues, respectively.

:sources:`Source code at slepc4py/SLEPc/ST.pyx:783 <slepc4py/SLEPc/ST.pyx#L783>`


Set the method to be used to build the polynomial filter.

Logically collective.

Parameter

The type of filter.

:sources:`Source code at slepc4py/SLEPc/ST.pyx:707 <slepc4py/SLEPc/ST.pyx#L707>`

filter_type (FilterType <#slepc4py.SLEPc.ST.FilterType>)
None <https://docs.python.org/3/library/constants.html#None>



Set ST options from the options database.

Collective.

This routine must be called before setUp() if the user is to be allowed to set the solver type.

Notes

To see all options, run your program with the -help option.

:sources:`Source code at slepc4py/SLEPc/ST.pyx:213 <slepc4py/SLEPc/ST.pyx#L213>`



Set the KSP object associated with the spectral transformation.

Collective.


:sources:`Source code at slepc4py/SLEPc/ST.pyx:445 <slepc4py/SLEPc/ST.pyx#L445>`


Set a flag to indicate how the matrix is being shifted.

Logically collective.

Set a flag to indicate how the matrix is being shifted in the shift-and-invert and Cayley spectral transformations.

mode (MatMode <#slepc4py.SLEPc.ST.MatMode>) – The mode flag.
None <https://docs.python.org/3/library/constants.html#None>

Notes

By default (ST.MatMode.COPY <#slepc4py.SLEPc.ST.MatMode.COPY>), a copy of matrix A is made and then this copy is shifted explicitly, e.g. A \leftarrow (A - s B).

With ST.MatMode.INPLACE <#slepc4py.SLEPc.ST.MatMode.INPLACE>, the original matrix A is shifted at setUp() and unshifted at the end of the computations. With respect to the previous one, this mode avoids a copy of matrix A. However, a backdraw is that the recovered matrix might be slightly different from the original one (due to roundoff).

With ST.MatMode.SHELL <#slepc4py.SLEPc.ST.MatMode.SHELL>, the solver works with an implicit shell matrix that represents the shifted matrix. This mode is the most efficient in creating the shifted matrix but it places serious limitations to the linear solves performed in each iteration of the eigensolver (typically, only iterative solvers with Jacobi preconditioning can be used).

In the case of generalized problems, in the two first modes the matrix A - s B has to be computed explicitly. The efficiency of this computation can be controlled with setMatStructure().

:sources:`Source code at slepc4py/SLEPc/ST.pyx:302 <slepc4py/SLEPc/ST.pyx#L302>`


Set an internal Mat.Structure attribute.

Logically collective.

Set an internal Mat.Structure attribute to indicate which is the relation of the sparsity pattern of the two matrices A and B constituting the generalized eigenvalue problem. This function has no effect in the case of standard eigenproblems.

structure (petsc4py.PETSc.Mat.Structure <https://petsc.org/release/petsc4py/reference/petsc4py.PETSc.Mat.Structure.html#petsc4py.PETSc.Mat.Structure>) – Either same, different, or a subset of the non-zero sparsity pattern.
None <https://docs.python.org/3/library/constants.html#None>

Notes

By default, the sparsity patterns are assumed to be different. If the patterns are equal or a subset then it is recommended to set this attribute for efficiency reasons (in particular, for internal AXPY() matrix operations).

:sources:`Source code at slepc4py/SLEPc/ST.pyx:400 <slepc4py/SLEPc/ST.pyx#L400>`


Set the matrices associated with the eigenvalue problem.

Collective.


:sources:`Source code at slepc4py/SLEPc/ST.pyx:360 <slepc4py/SLEPc/ST.pyx#L360>`


Set the prefix used for searching for all ST options in the database.

Logically collective.


Notes

A hyphen (-) must NOT be given at the beginning of the prefix name. The first character of all runtime options is AUTOMATICALLY the hyphen.

:sources:`Source code at slepc4py/SLEPc/ST.pyx:162 <slepc4py/SLEPc/ST.pyx#L162>`


Set the matrix to be used to build the preconditioner.

Collective.


:sources:`Source code at slepc4py/SLEPc/ST.pyx:480 <slepc4py/SLEPc/ST.pyx#L480>`


Set the shift associated with the spectral transformation.

Collective.

shift (Scalar <#slepc4py.typing.Scalar>) – The value of the shift.
None <https://docs.python.org/3/library/constants.html#None>

Notes

In some spectral transformations, changing the shift may have associated a lot of work, for example recomputing a factorization.

:sources:`Source code at slepc4py/SLEPc/ST.pyx:230 <slepc4py/SLEPc/ST.pyx#L230>`


Set the matrices to be used to build the preconditioner.

Collective.


:sources:`Source code at slepc4py/SLEPc/ST.pyx:510 <slepc4py/SLEPc/ST.pyx#L510>`


Set a flag to indicate whether the transformed matrices are computed or not.

Logically collective.

flag (bool <https://docs.python.org/3/library/functions.html#bool>) – This flag is intended for the case of polynomial eigenproblems solved via linearization. If this flag is False (default) the spectral transformation is applied to the linearization (handled by the eigensolver), otherwise it is applied to the original problem.
None <https://docs.python.org/3/library/constants.html#None>

:sources:`Source code at slepc4py/SLEPc/ST.pyx:265 <slepc4py/SLEPc/ST.pyx#L265>`


Set the particular spectral transformation to be used.

Logically collective.

st_type (Type <#slepc4py.SLEPc.ST.Type> | str <https://docs.python.org/3/library/stdtypes.html#str>) – The spectral transformation to be used.
None <https://docs.python.org/3/library/constants.html#None>

Notes

See ST.Type <#slepc4py.SLEPc.ST.Type> for available methods. The default is ST.Type.SHIFT <#slepc4py.SLEPc.ST.Type.SHIFT> with a zero shift. Normally, it is best to use setFromOptions() and then set the ST type from the options database rather than by using this routine. Using the options database provides the user with maximum flexibility in evaluating the different available methods.

:sources:`Source code at slepc4py/SLEPc/ST.pyx:123 <slepc4py/SLEPc/ST.pyx#L123>`


Prepare for the use of a spectral transformation.

Collective.

:sources:`Source code at slepc4py/SLEPc/ST.pyx:555 <slepc4py/SLEPc/ST.pyx#L555>`



Print the ST data structure.

Collective.


:sources:`Source code at slepc4py/SLEPc/ST.pyx:73 <slepc4py/SLEPc/ST.pyx#L73>`


Attributes Documentation

KSP object associated with the spectral transformation.

:sources:`Source code at slepc4py/SLEPc/ST.pyx:915 <slepc4py/SLEPc/ST.pyx#L915>`


How the transformed matrices are being stored in the ST.

:sources:`Source code at slepc4py/SLEPc/ST.pyx:901 <slepc4py/SLEPc/ST.pyx#L901>`


Relation of the sparsity pattern of all ST matrices.

:sources:`Source code at slepc4py/SLEPc/ST.pyx:908 <slepc4py/SLEPc/ST.pyx#L908>`


Value of the shift.

:sources:`Source code at slepc4py/SLEPc/ST.pyx:887 <slepc4py/SLEPc/ST.pyx#L887>`


If the transformed matrices are computed.

:sources:`Source code at slepc4py/SLEPc/ST.pyx:894 <slepc4py/SLEPc/ST.pyx#L894>`




slepc4py.SLEPc.STFilterDamping


slepc4py.SLEPc.STFilterType

Bases: object <https://docs.python.org/3/library/functions.html#object>

ST filter type.

  • FILTLAN: An adapted implementation of the Filtered Lanczos Package.
  • CHEBYSEV: A polynomial filter based on a truncated Chebyshev series.

Attributes Summary

CHEBYSHEV Constant CHEBYSHEV of type int <https://docs.python.org/3/library/functions.html#int>
FILTLAN Constant FILTLAN of type int <https://docs.python.org/3/library/functions.html#int>

Attributes Documentation




slepc4py.SLEPc.SVD

Bases: Object <https://petsc.org/release/petsc4py/reference/petsc4py.PETSc.Object.html#petsc4py.PETSc.Object>

SVD.

Enumerations

Conv <#slepc4py.SLEPc.SVD.Conv> SVD convergence test.
ConvergedReason <#slepc4py.SLEPc.SVD.ConvergedReason> SVD convergence reasons.
ErrorType <#slepc4py.SLEPc.SVD.ErrorType> SVD error type to assess accuracy of computed solutions.
ProblemType <#slepc4py.SLEPc.SVD.ProblemType> SVD problem type.
Stop <#slepc4py.SLEPc.SVD.Stop> SVD stopping test.
TRLanczosGBidiag <#slepc4py.SLEPc.SVD.TRLanczosGBidiag> SVD TRLanczos bidiagonalization choices for the GSVD case.
Type <#slepc4py.SLEPc.SVD.Type> SVD types.
Which <#slepc4py.SLEPc.SVD.Which> SVD desired part of spectrum.

slepc4py.SLEPc.SVD.Conv

Bases: object <https://docs.python.org/3/library/functions.html#object>

SVD convergence test.

  • ABS: Absolute convergence test.
  • REL: Convergence test relative to the singular value.
  • NORM: Convergence test relative to the matrix norms.
  • MAXIT: No convergence until maximum number of iterations has been reached.
  • USER: User-defined convergence test.

Attributes Summary

ABS Constant ABS of type int <https://docs.python.org/3/library/functions.html#int>
MAXIT Constant MAXIT of type int <https://docs.python.org/3/library/functions.html#int>
NORM Constant NORM of type int <https://docs.python.org/3/library/functions.html#int>
REL Constant REL of type int <https://docs.python.org/3/library/functions.html#int>
USER Constant USER of type int <https://docs.python.org/3/library/functions.html#int>

Attributes Documentation







slepc4py.SLEPc.SVD.ConvergedReason

Bases: object <https://docs.python.org/3/library/functions.html#object>

SVD convergence reasons.


  • CONVERGED_USER: User-defined convergence criterion satisfied.

  • DIVERGED_ITS: Maximum number of iterations exceeded.
  • DIVERGED_BREAKDOWN: Solver failed due to breakdown.

CONVERGED_ITERATING: Iteration not finished yet.

Attributes Summary

CONVERGED_ITERATING Constant CONVERGED_ITERATING of type int <https://docs.python.org/3/library/functions.html#int>
CONVERGED_MAXIT Constant CONVERGED_MAXIT of type int <https://docs.python.org/3/library/functions.html#int>
CONVERGED_TOL Constant CONVERGED_TOL of type int <https://docs.python.org/3/library/functions.html#int>
CONVERGED_USER Constant CONVERGED_USER of type int <https://docs.python.org/3/library/functions.html#int>
DIVERGED_BREAKDOWN Constant DIVERGED_BREAKDOWN of type int <https://docs.python.org/3/library/functions.html#int>
DIVERGED_ITS Constant DIVERGED_ITS of type int <https://docs.python.org/3/library/functions.html#int>
DIVERGED_SYMMETRY_LOST Constant DIVERGED_SYMMETRY_LOST of type int <https://docs.python.org/3/library/functions.html#int>
ITERATING Constant ITERATING of type int <https://docs.python.org/3/library/functions.html#int>

Attributes Documentation










slepc4py.SLEPc.SVD.ErrorType

Bases: object <https://docs.python.org/3/library/functions.html#object>

SVD error type to assess accuracy of computed solutions.

  • ABSOLUTE: Absolute error.
  • RELATIVE: Relative error.
  • NORM: Error relative to the matrix norm.

Attributes Summary

ABSOLUTE Constant ABSOLUTE of type int <https://docs.python.org/3/library/functions.html#int>
NORM Constant NORM of type int <https://docs.python.org/3/library/functions.html#int>
RELATIVE Constant RELATIVE of type int <https://docs.python.org/3/library/functions.html#int>

Attributes Documentation





slepc4py.SLEPc.SVD.ProblemType

Bases: object <https://docs.python.org/3/library/functions.html#object>

SVD problem type.

  • STANDARD: Standard SVD.
  • GENERALIZED: Generalized singular value decomposition (GSVD).
  • HYPERBOLIC : Hyperbolic singular value decomposition (HSVD).

Attributes Summary

GENERALIZED Constant GENERALIZED of type int <https://docs.python.org/3/library/functions.html#int>
HYPERBOLIC Constant HYPERBOLIC of type int <https://docs.python.org/3/library/functions.html#int>
STANDARD Constant STANDARD of type int <https://docs.python.org/3/library/functions.html#int>

Attributes Documentation





slepc4py.SLEPc.SVD.Stop

Bases: object <https://docs.python.org/3/library/functions.html#object>

SVD stopping test.

  • BASIC: Default stopping test.
  • USER: User-defined stopping test.
  • THRESHOLD: Threshold stopping test.

Attributes Summary

BASIC Constant BASIC of type int <https://docs.python.org/3/library/functions.html#int>
THRESHOLD Constant THRESHOLD of type int <https://docs.python.org/3/library/functions.html#int>
USER Constant USER of type int <https://docs.python.org/3/library/functions.html#int>

Attributes Documentation





slepc4py.SLEPc.SVD.TRLanczosGBidiag


slepc4py.SLEPc.SVD.Type

Bases: object <https://docs.python.org/3/library/functions.html#object>

SVD types.

  • CROSS: Eigenproblem with the cross-product matrix.
  • CYCLIC: Eigenproblem with the cyclic matrix.
  • LAPACK: Wrappers to dense SVD solvers in Lapack.
  • LANCZOS: Lanczos.
  • TRLANCZOS: Thick-restart Lanczos.
  • RANDOMIZED: Iterative RSVD for low-rank matrices.

Wrappers to external SVD solvers (should be enabled during installation of SLEPc)

  • SCALAPACK:
  • KSVD:
  • ELEMENTAL:
  • PRIMME:

Attributes Summary

CROSS Object CROSS of type str <https://docs.python.org/3/library/stdtypes.html#str>
CYCLIC Object CYCLIC of type str <https://docs.python.org/3/library/stdtypes.html#str>
ELEMENTAL Object ELEMENTAL of type str <https://docs.python.org/3/library/stdtypes.html#str>
KSVD Object KSVD of type str <https://docs.python.org/3/library/stdtypes.html#str>
LANCZOS Object LANCZOS of type str <https://docs.python.org/3/library/stdtypes.html#str>
LAPACK Object LAPACK of type str <https://docs.python.org/3/library/stdtypes.html#str>
PRIMME Object PRIMME of type str <https://docs.python.org/3/library/stdtypes.html#str>
RANDOMIZED Object RANDOMIZED of type str <https://docs.python.org/3/library/stdtypes.html#str>
SCALAPACK Object SCALAPACK of type str <https://docs.python.org/3/library/stdtypes.html#str>
TRLANCZOS Object TRLANCZOS of type str <https://docs.python.org/3/library/stdtypes.html#str>

Attributes Documentation












slepc4py.SLEPc.SVD.Which

Bases: object <https://docs.python.org/3/library/functions.html#object>

SVD desired part of spectrum.

  • LARGEST: Largest singular values.
  • SMALLEST: Smallest singular values.

Attributes Summary

LARGEST Constant LARGEST of type int <https://docs.python.org/3/library/functions.html#int>
SMALLEST Constant SMALLEST of type int <https://docs.python.org/3/library/functions.html#int>

Attributes Documentation




Methods Summary

appendOptionsPrefix([prefix]) Append to the prefix used for searching for all SVD options in the database.
cancelMonitor() Clear all monitors for an SVD object.
computeError(i[, etype]) Compute the error associated with the i-th singular triplet.
create([comm]) Create the SVD object.
destroy() Destroy the SVD object.
errorView([etype, viewer]) Display the errors associated with the computed solution.
getBV() Get the basis vectors objects associated to the SVD object.
getConverged() Get the number of converged singular triplets.
getConvergedReason() Get the reason why the solve() iteration was stopped.
getConvergenceTest() Get the method used to compute the error estimate used in the convergence test.
getCrossEPS() Get the eigensolver object associated to the singular value solver.
getCrossExplicitMatrix() Get the flag indicating if A^T*A is built explicitly.
getCyclicEPS() Get the eigensolver object associated to the singular value solver.
getCyclicExplicitMatrix() Get the flag indicating if H(A) is built explicitly.
getDS() Get the direct solver associated to the singular value solver.
getDimensions() Get the number of singular values to compute and the dimension of the subspace.
getImplicitTranspose() Get the mode used to handle the transpose of the matrix associated.
getIterationNumber() Get the current iteration number.
getLanczosOneSide() Get if the variant of the Lanczos method to be used is one-sided or two-sided.
getMonitor() Get the list of monitor functions.
getOperators() Get the matrices associated with the singular value problem.
getOptionsPrefix() Get the prefix used for searching for all SVD options in the database.
getProblemType() Get the problem type from the SVD object.
getSignature([omega]) Get the signature matrix defining a hyperbolic singular value problem.
getSingularTriplet(i[, U, V]) Get the i-th triplet of the singular value decomposition.
getStoppingTest() Get the stopping function.
getTRLanczosExplicitMatrix() Get the flag indicating if Z=[A;B] is built explicitly.
getTRLanczosGBidiag() Get bidiagonalization choice used in the GSVD TRLanczos solver.
getTRLanczosKSP() Get the linear solver object associated with the SVD solver.
getTRLanczosLocking() Get the locking flag used in the thick-restart Lanczos method.
getTRLanczosOneSide() Get if the variant of the method to be used is one-sided or two-sided.
getTRLanczosRestart() Get the restart parameter used in the thick-restart Lanczos method.
getThreshold() Get the threshold used in the threshold stopping test.
getTolerances() Get the tolerance and maximum iteration count.
getTrackAll() Get the flag indicating if all residual norms must be computed or not.
getType() Get the SVD type of this object.
getValue(i) Get the i-th singular value as computed by solve().
getVectors(i, U, V) Get the i-th left and right singular vectors as computed by solve().
getWhichSingularTriplets() Get which singular triplets are to be sought.
isGeneralized() Tell if the SVD corresponds to a generalized singular value problem.
isHyperbolic() Tell whether the SVD object corresponds to a hyperbolic singular value problem.
reset() Reset the SVD object.
setBV(V[, U]) Set basis vectors objects associated to the SVD solver.
setConvergenceTest(conv) Set how to compute the error estimate used in the convergence test.
setCrossEPS(eps) Set an eigensolver object associated to the singular value solver.
setCrossExplicitMatrix([flag]) Set if the eigensolver operator A^T A must be computed.
setCyclicEPS(eps) Set an eigensolver object associated to the singular value solver.
setCyclicExplicitMatrix([flag]) Set if the eigensolver operator H(A) must be computed explicitly.
setDS(ds) Set a direct solver object associated to the singular value solver.
setDimensions([nsv, ncv, mpd]) Set the number of singular values to compute and the dimension of the subspace.
setFromOptions() Set SVD options from the options database.
setImplicitTranspose(mode) Set how to handle the transpose of the matrix associated.
setInitialSpace([spaceright, spaceleft]) Set the initial spaces from which the SVD solver starts to iterate.
setLanczosOneSide([flag]) Set if the variant of the Lanczos method to be used is one-sided or two-sided.
setMonitor(monitor[, args, kargs]) Append a monitor function to the list of monitors.
setOperators(A[, B]) Set the matrices associated with the singular value problem.
setOptionsPrefix([prefix]) Set the prefix used for searching for all SVD options in the database.
setProblemType(problem_type) Set the type of the singular value problem.
setSignature([omega]) Set the signature matrix defining a hyperbolic singular value problem.
setStoppingTest(stopping[, args, kargs]) Set a function to decide when to stop the outer iteration of the eigensolver.
setTRLanczosExplicitMatrix([flag]) Set if the matrix Z=[A;B] must be built explicitly.
setTRLanczosGBidiag(bidiag) Set the bidiagonalization choice to use in the GSVD TRLanczos solver.
setTRLanczosKSP(ksp) Set a linear solver object associated to the SVD solver.
setTRLanczosLocking(lock) Toggle between locking and non-locking variants of the method.
setTRLanczosOneSide([flag]) Set if the variant of the method to be used is one-sided or two-sided.
setTRLanczosRestart(keep) Set the restart parameter for the thick-restart Lanczos method.
setThreshold(thres[, rel]) Set the threshold used in the threshold stopping test.
setTolerances([tol, max_it]) Set the tolerance and maximum iteration count used.
setTrackAll(trackall) Set flag to compute the residual of all singular triplets.
setType(svd_type) Set the particular solver to be used in the SVD object.
setUp() Set up all the necessary internal data structures.
setWhichSingularTriplets(which) Set which singular triplets are to be sought.
solve() Solve the singular value problem.
valuesView([viewer]) Display the computed singular values in a viewer.
vectorsView([viewer]) Output computed singular vectors to a viewer.
view([viewer]) Print the SVD data structure.

Attributes Summary

ds The direct solver (DS) object associated.
max_it The maximum iteration count.
problem_type The type of the eigenvalue problem.
tol The tolerance.
track_all Compute the residual norm of all approximate eigenpairs.
transpose_mode How to handle the transpose of the matrix.
which The portion of the spectrum to be sought.

Methods Documentation

Append to the prefix used for searching for all SVD options in the database.

Logically collective.


:sources:`Source code at slepc4py/SLEPc/SVD.pyx:284 <slepc4py/SLEPc/SVD.pyx#L284>`


Clear all monitors for an SVD object.

Logically collective.

:sources:`Source code at slepc4py/SLEPc/SVD.pyx:912 <slepc4py/SLEPc/SVD.pyx#L912>`



Compute the error associated with the i-th singular triplet.

Collective.

Compute the error (based on the residual norm) associated with the i-th singular triplet.


The relative error bound, computed in various ways from the residual norm \sqrt{n_1^2+n_2^2} where n_1 = \|A v - \sigma u\|_2, n_2 = \|A^T u - \sigma v\|_2, \sigma is the singular value, u and v are the left and right singular vectors.
float <https://docs.python.org/3/library/functions.html#float>

Notes

The index i should be a value between 0 and nconv-1 (see getConverged()).

:sources:`Source code at slepc4py/SLEPc/SVD.pyx:1091 <slepc4py/SLEPc/SVD.pyx#L1091>`


Create the SVD object.

Collective.


:sources:`Source code at slepc4py/SLEPc/SVD.pyx:186 <slepc4py/SLEPc/SVD.pyx#L186>`


Destroy the SVD object.

Collective.

:sources:`Source code at slepc4py/SLEPc/SVD.pyx:168 <slepc4py/SLEPc/SVD.pyx#L168>`



Display the errors associated with the computed solution.

Collective.

Display the errors and the eigenvalues.


None <https://docs.python.org/3/library/constants.html#None>

Notes

By default, this function checks the error of all eigenpairs and prints the eigenvalues if all of them are below the requested tolerance. If the viewer has format ASCII_INFO_DETAIL then a table with eigenvalues and corresponding errors is printed.

:sources:`Source code at slepc4py/SLEPc/SVD.pyx:1128 <slepc4py/SLEPc/SVD.pyx#L1128>`


Get the basis vectors objects associated to the SVD object.

Not collective.

  • V (BV <#slepc4py.SLEPc.BV>) – The basis vectors context for right singular vectors.
  • U (BV <#slepc4py.SLEPc.BV>) – The basis vectors context for left singular vectors.

tuple <https://docs.python.org/3/library/stdtypes.html#tuple>[BV <#slepc4py.SLEPc.BV>, BV <#slepc4py.SLEPc.BV>]

:sources:`Source code at slepc4py/SLEPc/SVD.pyx:676 <slepc4py/SLEPc/SVD.pyx#L676>`


Get the number of converged singular triplets.

Not collective.

Number of converged singular triplets.
int <https://docs.python.org/3/library/functions.html#int>

Notes

This function should be called after solve() has finished.

:sources:`Source code at slepc4py/SLEPc/SVD.pyx:981 <slepc4py/SLEPc/SVD.pyx#L981>`


Get the reason why the solve() iteration was stopped.

Not collective.

Negative value indicates diverged, positive value converged.
ConvergedReason <#slepc4py.SLEPc.SVD.ConvergedReason>

:sources:`Source code at slepc4py/SLEPc/SVD.pyx:966 <slepc4py/SLEPc/SVD.pyx#L966>`


Get the method used to compute the error estimate used in the convergence test.

Not collective.

The method used to compute the error estimate used in the convergence test.
Conv <#slepc4py.SLEPc.SVD.Conv>

:sources:`Source code at slepc4py/SLEPc/SVD.pyx:546 <slepc4py/SLEPc/SVD.pyx#L546>`


Get the eigensolver object associated to the singular value solver.

Collective.

The eigensolver object.
EPS <#slepc4py.SLEPc.EPS>

:sources:`Source code at slepc4py/SLEPc/SVD.pyx:1202 <slepc4py/SLEPc/SVD.pyx#L1202>`


Get the flag indicating if A^T*A is built explicitly.

Not collective.


:sources:`Source code at slepc4py/SLEPc/SVD.pyx:1232 <slepc4py/SLEPc/SVD.pyx#L1232>`


Get the eigensolver object associated to the singular value solver.

Collective.

The eigensolver object.
EPS <#slepc4py.SLEPc.EPS>

:sources:`Source code at slepc4py/SLEPc/SVD.pyx:1260 <slepc4py/SLEPc/SVD.pyx#L1260>`


Get the flag indicating if H(A) is built explicitly.

Not collective.

Get the flag indicating if H(A) = [ 0\; A ; A^T\; 0 ] is built explicitly.


:sources:`Source code at slepc4py/SLEPc/SVD.pyx:1293 <slepc4py/SLEPc/SVD.pyx#L1293>`


Get the direct solver associated to the singular value solver.

Not collective.

The direct solver context.
DS <#slepc4py.SLEPc.DS>

:sources:`Source code at slepc4py/SLEPc/SVD.pyx:713 <slepc4py/SLEPc/SVD.pyx#L713>`


Get the number of singular values to compute and the dimension of the subspace.

Not collective.


:sources:`Source code at slepc4py/SLEPc/SVD.pyx:609 <slepc4py/SLEPc/SVD.pyx#L609>`


Get the mode used to handle the transpose of the matrix associated.

Not collective.

Get the mode used to handle the transpose of the matrix associated with the singular value problem.

How to handle the transpose (implicitly or not).
bool <https://docs.python.org/3/library/functions.html#bool>

:sources:`Source code at slepc4py/SLEPc/SVD.pyx:379 <slepc4py/SLEPc/SVD.pyx#L379>`


Get the current iteration number.

Not collective.

If the call to solve() is complete, then it returns the number of iterations carried out by the solution method.


:sources:`Source code at slepc4py/SLEPc/SVD.pyx:948 <slepc4py/SLEPc/SVD.pyx#L948>`


Get if the variant of the Lanczos method to be used is one-sided or two-sided.

Not collective.


:sources:`Source code at slepc4py/SLEPc/SVD.pyx:1333 <slepc4py/SLEPc/SVD.pyx#L1333>`


Get the list of monitor functions.

:sources:`Source code at slepc4py/SLEPc/SVD.pyx:908 <slepc4py/SLEPc/SVD.pyx#L908>`

SVDMonitorFunction <#slepc4py.typing.SVDMonitorFunction>



Get the prefix used for searching for all SVD options in the database.

Not collective.

The prefix string set for this SVD object.
str <https://docs.python.org/3/library/stdtypes.html#str>

:sources:`Source code at slepc4py/SLEPc/SVD.pyx:242 <slepc4py/SLEPc/SVD.pyx#L242>`


Get the problem type from the SVD object.

Not collective.

The problem type that was previously set.
ProblemType <#slepc4py.SLEPc.SVD.ProblemType>

:sources:`Source code at slepc4py/SLEPc/SVD.pyx:315 <slepc4py/SLEPc/SVD.pyx#L315>`


Get the signature matrix defining a hyperbolic singular value problem.

Collective.

omega (petsc4py.PETSc.Vec <https://petsc.org/release/petsc4py/reference/petsc4py.PETSc.Vec.html#petsc4py.PETSc.Vec> | None <https://docs.python.org/3/library/constants.html#None>) – Optional vector to store the diagonal elements of the signature matrix.
A vector containing the diagonal elements of the signature matrix.
petsc4py.PETSc.Vec <https://petsc.org/release/petsc4py/reference/petsc4py.PETSc.Vec.html#petsc4py.PETSc.Vec>

:sources:`Source code at slepc4py/SLEPc/SVD.pyx:782 <slepc4py/SLEPc/SVD.pyx#L782>`


Get the i-th triplet of the singular value decomposition.

Collective.

Get the i-th triplet of the singular value decomposition as computed by solve(). The solution consists of the singular value and its left and right singular vectors.


Notes

The index i should be a value between 0 and nconv-1 (see getConverged(). Singular triplets are indexed according to the ordering criterion established with setWhichSingularTriplets().

:sources:`Source code at slepc4py/SLEPc/SVD.pyx:1052 <slepc4py/SLEPc/SVD.pyx#L1052>`


Get the stopping function.

Not collective.

:sources:`Source code at slepc4py/SLEPc/SVD.pyx:877 <slepc4py/SLEPc/SVD.pyx#L877>`

SVDStoppingFunction <#slepc4py.typing.SVDStoppingFunction>


Get the flag indicating if Z=[A;B] is built explicitly.

Not collective.

True if Z=[A;B] is built explicitly.
bool <https://docs.python.org/3/library/functions.html#bool>

:sources:`Source code at slepc4py/SLEPc/SVD.pyx:1538 <slepc4py/SLEPc/SVD.pyx#L1538>`


Get bidiagonalization choice used in the GSVD TRLanczos solver.

Not collective.

The bidiagonalization choice.
TRLanczosGBidiag <#slepc4py.SLEPc.SVD.TRLanczosGBidiag>

:sources:`Source code at slepc4py/SLEPc/SVD.pyx:1404 <slepc4py/SLEPc/SVD.pyx#L1404>`


Get the linear solver object associated with the SVD solver.

Collective.


:sources:`Source code at slepc4py/SLEPc/SVD.pyx:1508 <slepc4py/SLEPc/SVD.pyx#L1508>`


Get the locking flag used in the thick-restart Lanczos method.

Not collective.


:sources:`Source code at slepc4py/SLEPc/SVD.pyx:1480 <slepc4py/SLEPc/SVD.pyx#L1480>`


Get if the variant of the method to be used is one-sided or two-sided.

Not collective.

Get if the variant of the thick-restart Lanczos method to be used is one-sided or two-sided.


:sources:`Source code at slepc4py/SLEPc/SVD.pyx:1372 <slepc4py/SLEPc/SVD.pyx#L1372>`


Get the restart parameter used in the thick-restart Lanczos method.

Not collective.

The number of vectors to be kept at restart.
float <https://docs.python.org/3/library/functions.html#float>

:sources:`Source code at slepc4py/SLEPc/SVD.pyx:1441 <slepc4py/SLEPc/SVD.pyx#L1441>`


Get the threshold used in the threshold stopping test.

Not collective.


:sources:`Source code at slepc4py/SLEPc/SVD.pyx:451 <slepc4py/SLEPc/SVD.pyx#L451>`


Get the tolerance and maximum iteration count.

Not collective.

Get the tolerance and maximum iteration count used by the default SVD convergence tests.


:sources:`Source code at slepc4py/SLEPc/SVD.pyx:498 <slepc4py/SLEPc/SVD.pyx#L498>`


Get the flag indicating if all residual norms must be computed or not.

Not collective.

Whether the solver compute all residuals or not.
bool <https://docs.python.org/3/library/functions.html#bool>

:sources:`Source code at slepc4py/SLEPc/SVD.pyx:577 <slepc4py/SLEPc/SVD.pyx#L577>`


Get the SVD type of this object.

Not collective.


:sources:`Source code at slepc4py/SLEPc/SVD.pyx:227 <slepc4py/SLEPc/SVD.pyx#L227>`


Get the i-th singular value as computed by solve().

Collective.

i (int <https://docs.python.org/3/library/functions.html#int>) – Index of the solution to be obtained.
The computed singular value.
float <https://docs.python.org/3/library/functions.html#float>

Notes

The index i should be a value between 0 and nconv-1 (see getConverged(). Singular triplets are indexed according to the ordering criterion established with setWhichSingularTriplets().

:sources:`Source code at slepc4py/SLEPc/SVD.pyx:1000 <slepc4py/SLEPc/SVD.pyx#L1000>`


Get the i-th left and right singular vectors as computed by solve().

Collective.


Notes

The index i should be a value between 0 and nconv-1 (see getConverged(). Singular triplets are indexed according to the ordering criterion established with setWhichSingularTriplets().

:sources:`Source code at slepc4py/SLEPc/SVD.pyx:1027 <slepc4py/SLEPc/SVD.pyx#L1027>`


Get which singular triplets are to be sought.

Not collective.

The singular values to be sought (either largest or smallest).
Which <#slepc4py.SLEPc.SVD.Which>

:sources:`Source code at slepc4py/SLEPc/SVD.pyx:422 <slepc4py/SLEPc/SVD.pyx#L422>`


Tell if the SVD corresponds to a generalized singular value problem.

Not collective.

Tell whether the SVD object corresponds to a generalized singular value problem.

True if two matrices were set with setOperators().
bool <https://docs.python.org/3/library/functions.html#bool>

:sources:`Source code at slepc4py/SLEPc/SVD.pyx:344 <slepc4py/SLEPc/SVD.pyx#L344>`


Tell whether the SVD object corresponds to a hyperbolic singular value problem.

Not collective.

True if the problem was specified as hyperbolic.
bool <https://docs.python.org/3/library/functions.html#bool>

:sources:`Source code at slepc4py/SLEPc/SVD.pyx:362 <slepc4py/SLEPc/SVD.pyx#L362>`


Reset the SVD object.

Collective.

:sources:`Source code at slepc4py/SLEPc/SVD.pyx:178 <slepc4py/SLEPc/SVD.pyx#L178>`



Set basis vectors objects associated to the SVD solver.

Collective.


None <https://docs.python.org/3/library/constants.html#None>

:sources:`Source code at slepc4py/SLEPc/SVD.pyx:696 <slepc4py/SLEPc/SVD.pyx#L696>`


Set how to compute the error estimate used in the convergence test.

Logically collective.

conv (Conv <#slepc4py.SLEPc.SVD.Conv>) – The method used to compute the error estimate used in the convergence test.
None <https://docs.python.org/3/library/constants.html#None>

:sources:`Source code at slepc4py/SLEPc/SVD.pyx:562 <slepc4py/SLEPc/SVD.pyx#L562>`


Set an eigensolver object associated to the singular value solver.

Collective.

eps (EPS <#slepc4py.SLEPc.EPS>) – The eigensolver object.
None <https://docs.python.org/3/library/constants.html#None>

:sources:`Source code at slepc4py/SLEPc/SVD.pyx:1189 <slepc4py/SLEPc/SVD.pyx#L1189>`


Set if the eigensolver operator A^T A must be computed.

Logically collective.


:sources:`Source code at slepc4py/SLEPc/SVD.pyx:1218 <slepc4py/SLEPc/SVD.pyx#L1218>`


Set an eigensolver object associated to the singular value solver.

Collective.

eps (EPS <#slepc4py.SLEPc.EPS>) – The eigensolver object.
None <https://docs.python.org/3/library/constants.html#None>

:sources:`Source code at slepc4py/SLEPc/SVD.pyx:1247 <slepc4py/SLEPc/SVD.pyx#L1247>`


Set if the eigensolver operator H(A) must be computed explicitly.

Logically collective.

Set if the eigensolver operator H(A) = [ 0\; A ; A^T\; 0 ] must be computed explicitly.


:sources:`Source code at slepc4py/SLEPc/SVD.pyx:1276 <slepc4py/SLEPc/SVD.pyx#L1276>`


Set a direct solver object associated to the singular value solver.

Collective.

ds (DS <#slepc4py.SLEPc.DS>) – The direct solver context.
None <https://docs.python.org/3/library/constants.html#None>

:sources:`Source code at slepc4py/SLEPc/SVD.pyx:729 <slepc4py/SLEPc/SVD.pyx#L729>`


Set the number of singular values to compute and the dimension of the subspace.

Logically collective.


Notes

Use DECIDE <#slepc4py.SLEPc.DECIDE> for ncv and mpd to assign a reasonably good value, which is dependent on the solution method.

The parameters ncv and mpd are intimately related, so that the user is advised to set one of them at most. Normal usage is the following:

  • In cases where nsv is small, the user sets ncv (a reasonable default is 2 * nsv).
  • In cases where nsv is large, the user sets mpd.



The value of ncv should always be between nsv and (nsv + mpd), typically ncv = nsv + mpd. If nsv is not too large, mpd = nsv is a reasonable choice, otherwise a smaller value should be used.

:sources:`Source code at slepc4py/SLEPc/SVD.pyx:630 <slepc4py/SLEPc/SVD.pyx#L630>`


Set SVD options from the options database.

Collective.

This routine must be called before setUp() if the user is to be allowed to set the solver type.

Notes

To see all options, run your program with the -help option.

:sources:`Source code at slepc4py/SLEPc/SVD.pyx:299 <slepc4py/SLEPc/SVD.pyx#L299>`



Set how to handle the transpose of the matrix associated.

Logically collective.

Set how to handle the transpose of the matrix associated with the singular value problem.


Notes

By default, the transpose of the matrix is explicitly built (if the matrix has defined the MatTranspose operation).

If this flag is set to true, the solver does not build the transpose, but handles it implicitly via MatMultTranspose().

:sources:`Source code at slepc4py/SLEPc/SVD.pyx:397 <slepc4py/SLEPc/SVD.pyx#L397>`



Set if the variant of the Lanczos method to be used is one-sided or two-sided.

Logically collective.


Notes

By default, a two-sided variant is selected, which is sometimes slightly more robust. However, the one-sided variant is faster because it avoids the orthogonalization associated to left singular vectors. It also saves the memory required for storing such vectors.

:sources:`Source code at slepc4py/SLEPc/SVD.pyx:1311 <slepc4py/SLEPc/SVD.pyx#L1311>`


Append a monitor function to the list of monitors.

Logically collective.

:sources:`Source code at slepc4py/SLEPc/SVD.pyx:887 <slepc4py/SLEPc/SVD.pyx#L887>`



Set the matrices associated with the singular value problem.

Collective.


:sources:`Source code at slepc4py/SLEPc/SVD.pyx:765 <slepc4py/SLEPc/SVD.pyx#L765>`


Set the prefix used for searching for all SVD options in the database.

Logically collective.


Notes

A hyphen (-) must NOT be given at the beginning of the prefix name. The first character of all runtime options is AUTOMATICALLY the hyphen.

For example, to distinguish between the runtime options for two different SVD contexts, one could call:

S1.setOptionsPrefix("svd1_")
S2.setOptionsPrefix("svd2_")


:sources:`Source code at slepc4py/SLEPc/SVD.pyx:257 <slepc4py/SLEPc/SVD.pyx#L257>`


Set the type of the singular value problem.

Logically collective.

problem_type (ProblemType <#slepc4py.SLEPc.SVD.ProblemType>) – The problem type to be set.
None <https://docs.python.org/3/library/constants.html#None>

:sources:`Source code at slepc4py/SLEPc/SVD.pyx:330 <slepc4py/SLEPc/SVD.pyx#L330>`


Set the signature matrix defining a hyperbolic singular value problem.

Collective.


:sources:`Source code at slepc4py/SLEPc/SVD.pyx:807 <slepc4py/SLEPc/SVD.pyx#L807>`


Set a function to decide when to stop the outer iteration of the eigensolver.

Logically collective.

:sources:`Source code at slepc4py/SLEPc/SVD.pyx:857 <slepc4py/SLEPc/SVD.pyx#L857>`



Set if the matrix Z=[A;B] must be built explicitly.

Logically collective.


:sources:`Source code at slepc4py/SLEPc/SVD.pyx:1524 <slepc4py/SLEPc/SVD.pyx#L1524>`


Set the bidiagonalization choice to use in the GSVD TRLanczos solver.

Logically collective.

bidiag (TRLanczosGBidiag <#slepc4py.SLEPc.SVD.TRLanczosGBidiag>) – The bidiagonalization choice.
None <https://docs.python.org/3/library/constants.html#None>

:sources:`Source code at slepc4py/SLEPc/SVD.pyx:1390 <slepc4py/SLEPc/SVD.pyx#L1390>`


Set a linear solver object associated to the SVD solver.

Collective.


:sources:`Source code at slepc4py/SLEPc/SVD.pyx:1495 <slepc4py/SLEPc/SVD.pyx#L1495>`


Toggle between locking and non-locking variants of the method.

Logically collective.

Toggle between locking and non-locking variants of the thick-restart Lanczos method.


Notes

The default is to lock converged singular triplets when the method restarts. This behavior can be changed so that all directions are kept in the working subspace even if already converged to working accuracy (the non-locking variant).

:sources:`Source code at slepc4py/SLEPc/SVD.pyx:1456 <slepc4py/SLEPc/SVD.pyx#L1456>`


Set if the variant of the method to be used is one-sided or two-sided.

Logically collective.

Set if the variant of the thick-restart Lanczos method to be used is one-sided or two-sided.


Notes

By default, a two-sided variant is selected, which is sometimes slightly more robust. However, the one-sided variant is faster because it avoids the orthogonalization associated to left singular vectors.

:sources:`Source code at slepc4py/SLEPc/SVD.pyx:1348 <slepc4py/SLEPc/SVD.pyx#L1348>`


Set the restart parameter for the thick-restart Lanczos method.

Logically collective.

Set the restart parameter for the thick-restart Lanczos method, in particular the proportion of basis vectors that must be kept after restart.


Notes

Allowed values are in the range [0.1,0.9]. The default is 0.5.

:sources:`Source code at slepc4py/SLEPc/SVD.pyx:1419 <slepc4py/SLEPc/SVD.pyx#L1419>`


Set the threshold used in the threshold stopping test.

Logically collective.


Notes

This function internally sets a special stopping test based on the threshold, where singular values are computed in sequence until one of the computed singular values is below/above the threshold (depending on whether largest or smallest singular values are computed).

In the case of largest singular values, the threshold can be made relative with respect to the largest singular value (i.e., the matrix norm).

:sources:`Source code at slepc4py/SLEPc/SVD.pyx:469 <slepc4py/SLEPc/SVD.pyx#L469>`


Set the tolerance and maximum iteration count used.

Logically collective.

Set the tolerance and maximum iteration count used by the default SVD convergence tests.


Notes

Use DECIDE <#slepc4py.SLEPc.DECIDE> for max_it to assign a reasonably good value, which is dependent on the solution method.

:sources:`Source code at slepc4py/SLEPc/SVD.pyx:519 <slepc4py/SLEPc/SVD.pyx#L519>`


Set flag to compute the residual of all singular triplets.

Logically collective.

Set if the solver must compute the residual of all approximate singular triplets or not.


:sources:`Source code at slepc4py/SLEPc/SVD.pyx:592 <slepc4py/SLEPc/SVD.pyx#L592>`


Set the particular solver to be used in the SVD object.

Logically collective.

svd_type (Type <#slepc4py.SLEPc.SVD.Type> | str <https://docs.python.org/3/library/stdtypes.html#str>) – The solver to be used.
None <https://docs.python.org/3/library/constants.html#None>

Notes

See SVD.Type <#slepc4py.SLEPc.SVD.Type> for available methods. The default is CROSS. Normally, it is best to use setFromOptions() and then set the SVD type from the options database rather than by using this routine. Using the options database provides the user with maximum flexibility in evaluating the different available methods.

:sources:`Source code at slepc4py/SLEPc/SVD.pyx:203 <slepc4py/SLEPc/SVD.pyx#L203>`


Set up all the necessary internal data structures.

Collective.

Set up all the internal data structures necessary for the execution of the singular value solver.

Notes

This function need not be called explicitly in most cases, since solve() calls it. It can be useful when one wants to measure the set-up time separately from the solve time.

:sources:`Source code at slepc4py/SLEPc/SVD.pyx:923 <slepc4py/SLEPc/SVD.pyx#L923>`



Set which singular triplets are to be sought.

Logically collective.

which (Which <#slepc4py.SLEPc.SVD.Which>) – The singular values to be sought (either largest or smallest).
None <https://docs.python.org/3/library/constants.html#None>

:sources:`Source code at slepc4py/SLEPc/SVD.pyx:437 <slepc4py/SLEPc/SVD.pyx#L437>`


Solve the singular value problem.

Collective.

:sources:`Source code at slepc4py/SLEPc/SVD.pyx:940 <slepc4py/SLEPc/SVD.pyx#L940>`



Display the computed singular values in a viewer.

Collective.


:sources:`Source code at slepc4py/SLEPc/SVD.pyx:1157 <slepc4py/SLEPc/SVD.pyx#L1157>`


Output computed singular vectors to a viewer.

Collective.


:sources:`Source code at slepc4py/SLEPc/SVD.pyx:1172 <slepc4py/SLEPc/SVD.pyx#L1172>`


Print the SVD data structure.

Collective.


:sources:`Source code at slepc4py/SLEPc/SVD.pyx:153 <slepc4py/SLEPc/SVD.pyx#L153>`


Attributes Documentation

The direct solver (DS) object associated.

:sources:`Source code at slepc4py/SLEPc/SVD.pyx:1599 <slepc4py/SLEPc/SVD.pyx#L1599>`


The maximum iteration count.

:sources:`Source code at slepc4py/SLEPc/SVD.pyx:1585 <slepc4py/SLEPc/SVD.pyx#L1585>`


The type of the eigenvalue problem.

:sources:`Source code at slepc4py/SLEPc/SVD.pyx:1557 <slepc4py/SLEPc/SVD.pyx#L1557>`


The tolerance.

:sources:`Source code at slepc4py/SLEPc/SVD.pyx:1578 <slepc4py/SLEPc/SVD.pyx#L1578>`


Compute the residual norm of all approximate eigenpairs.

:sources:`Source code at slepc4py/SLEPc/SVD.pyx:1592 <slepc4py/SLEPc/SVD.pyx#L1592>`


How to handle the transpose of the matrix.

:sources:`Source code at slepc4py/SLEPc/SVD.pyx:1564 <slepc4py/SLEPc/SVD.pyx#L1564>`


The portion of the spectrum to be sought.

:sources:`Source code at slepc4py/SLEPc/SVD.pyx:1571 <slepc4py/SLEPc/SVD.pyx#L1571>`




slepc4py.SLEPc.Sys

Bases: object <https://docs.python.org/3/library/functions.html#object>

Sys.

Methods Summary

getVersion([devel, date, author]) Return SLEPc version information.
getVersionInfo() Return SLEPc version information.
hasExternalPackage(package) Return whether SLEPc has support for external package.
isFinalized() Return whether SLEPc has been finalized.
isInitialized() Return whether SLEPc has been initialized.

Methods Documentation

Return SLEPc version information.

Not collective.



tuple <https://docs.python.org/3/library/stdtypes.html#tuple>[int <https://docs.python.org/3/library/functions.html#int>, int <https://docs.python.org/3/library/functions.html#int>, int <https://docs.python.org/3/library/functions.html#int>]

See also:


:sources:`Source code at slepc4py/SLEPc/Sys.pyx:6 <slepc4py/SLEPc/Sys.pyx#L6>`


Return SLEPc version information.

Not collective.

info – Dictionary with version information.
dict <https://docs.python.org/3/library/stdtypes.html#dict>

See also:


:sources:`Source code at slepc4py/SLEPc/Sys.pyx:62 <slepc4py/SLEPc/Sys.pyx#L62>`


Return whether SLEPc has support for external package.

Not collective.


See also:


:sources:`Source code at slepc4py/SLEPc/Sys.pyx:116 <slepc4py/SLEPc/Sys.pyx#L116>`


Return whether SLEPc has been finalized.

Not collective.

See also:

isInitialized


:sources:`Source code at slepc4py/SLEPc/Sys.pyx:101 <slepc4py/SLEPc/Sys.pyx#L101>`



Return whether SLEPc has been initialized.

Not collective.

See also:

isFinalized


:sources:`Source code at slepc4py/SLEPc/Sys.pyx:88 <slepc4py/SLEPc/Sys.pyx#L88>`




slepc4py.SLEPc.Util

Bases: object <https://docs.python.org/3/library/functions.html#object>

Util.

Methods Summary

createMatBSE(R, C) Create a matrix that can be used to define a BSE type problem.
createMatHamiltonian(A, B, C) Create matrix to be used for a structured Hamiltonian eigenproblem.

Methods Documentation

Create a matrix that can be used to define a BSE type problem.

Collective.

Create a matrix that can be used to define a structured eigenvalue problem of type BSE (Bethe-Salpeter Equation).


The matrix with the block form H = [ R\; C; {-C}^H\; {-R}^T ].
petsc4py.PETSc.Mat <https://petsc.org/release/petsc4py/reference/petsc4py.PETSc.Mat.html#petsc4py.PETSc.Mat>

:sources:`Source code at slepc4py/SLEPc/Util.pyx:6 <slepc4py/SLEPc/Util.pyx#L6>`


Create matrix to be used for a structured Hamiltonian eigenproblem.

Collective.


The matrix with the block form H = [ A B; C -A^* ].
petsc4py.PETSc.Mat <https://petsc.org/release/petsc4py/reference/petsc4py.PETSc.Mat.html#petsc4py.PETSc.Mat>

:sources:`Source code at slepc4py/SLEPc/Util.pyx:32 <slepc4py/SLEPc/Util.pyx#L32>`



Attributes

DECIDE <#slepc4py.SLEPc.DECIDE> Constant DECIDE of type int <https://docs.python.org/3/library/functions.html#int>
DEFAULT <#slepc4py.SLEPc.DEFAULT> Constant DEFAULT of type int <https://docs.python.org/3/library/functions.html#int>
DETERMINE <#slepc4py.SLEPc.DETERMINE> Constant DETERMINE of type int <https://docs.python.org/3/library/functions.html#int>
CURRENT <#slepc4py.SLEPc.CURRENT> Constant CURRENT of type int <https://docs.python.org/3/library/functions.html#int>

slepc4py.SLEPc.DECIDE


slepc4py.SLEPc.DEFAULT


slepc4py.SLEPc.DETERMINE


slepc4py.SLEPc.CURRENT


slepc4py demos

Standard symmetric eigenproblem for the Laplacian operator in 1-D

This tutorial is intended for basic use of slepc4py. For more advanced use, the reader is referred to SLEPc tutorials as well as to slepc4py reference documentation.

The source code for this demo can be downloaded here <../_static/ex1.py>

The first thing to do is initialize the libraries. This is normally not required, as it is done automatically at import time. However, if you want to gain access to the facilities for accessing command-line options, the following lines must be executed by the main script prior to any petsc4py or slepc4py calls:

import sys, slepc4py
slepc4py.init(sys.argv)


Next, we have to import the relevant modules. Normally, both PETSc and SLEPc modules have to be imported in all slepc4py programs. It may be useful to import NumPy as well:

from petsc4py import PETSc
from slepc4py import SLEPc
import numpy


At this point, we can use any petsc4py and slepc4py operations. For instance, the following lines allow the user to specify an integer command-line argument n with a default value of 30 (see the next section for example usage of command-line options):

opts = PETSc.Options()
n = opts.getInt('n', 30)


It is necessary to build a matrix to define an eigenproblem (or two in the case of generalized eigenproblems). The following fragment of code creates the matrix object and then fills the non-zero elements one by one. The matrix of this particular example is tridiagonal, with value 2 in the diagonal, and -1 in off-diagonal positions. See petsc4py documentation for details about matrix objects:

A = PETSc.Mat(); A.create()
A.setSizes([n, n])
A.setFromOptions()
rstart, rend = A.getOwnershipRange()
# first row
if rstart == 0:

A[0, :2] = [2, -1]
rstart += 1 # last row if rend == n:
A[n-1, -2:] = [-1, 2]
rend -= 1 # other rows for i in range(rstart, rend):
A[i, i-1:i+2] = [-1, 2, -1] A.assemble()


The solver object is created in a similar way as other objects in petsc4py:

E = SLEPc.EPS(); E.create()


Once the object is created, the eigenvalue problem must be specified. At least one matrix must be provided. The problem type must be indicated as well, in this case it is HEP (Hermitian eigenvalue problem). Apart from these, other settings could be provided here (for instance, the tolerance for the computation). After all options have been set, the user should call the setFromOptions() <#slepc4py.SLEPc.EPS.setFromOptions> operation, so that any options specified at run time in the command line are passed to the solver object:

E.setOperators(A)
E.setProblemType(SLEPc.EPS.ProblemType.HEP)
history = []
def monitor(eps, its, nconv, eig, err):

if nconv<len(err): history.append(err[nconv]) E.setMonitor(monitor) E.setFromOptions()


After that, the solve() <#slepc4py.SLEPc.EPS.solve> method will run the selected eigensolver, keeping the solution stored internally:

E.solve()


Once the computation has finished, we are ready to print the results. First, some informative data can be retrieved from the solver object:

Print = PETSc.Sys.Print
Print()
Print("******************************")
Print("*** SLEPc Solution Results ***")
Print("******************************")
Print()
its = E.getIterationNumber()
Print( "Number of iterations of the method: %d" % its )
eps_type = E.getType()
Print( "Solution method: %s" % eps_type )
nev, ncv, mpd = E.getDimensions()
Print( "Number of requested eigenvalues: %d" % nev )
tol, maxit = E.getTolerances()
Print( "Stopping condition: tol=%.4g, maxit=%d" % (tol, maxit) )


For retrieving the solution, it is necessary to find out how many eigenpairs have converged to the requested precision:

nconv = E.getConverged()
Print( "Number of converged eigenpairs %d" % nconv )


For each of the nconv eigenpairs, we can retrieve the eigenvalue k, and the eigenvector, which is represented by means of two petsc4py vectors vr and vi (the real and imaginary part of the eigenvector, since for real matrices the eigenvalue and eigenvector may be complex). We also compute the corresponding relative errors in order to make sure that the computed solution is indeed correct:

if nconv > 0:

# Create the results vectors
v, _ = A.createVecs()
#
Print()
Print(" k ||Ax-kx||/||kx|| ")
Print("----------------- ------------------")
for i in range(nconv):
k = E.getEigenpair(i, v)
error = E.computeError(i)
Print( " %12f %12g" % (k, error) )
Print()


Example of command-line usage

Now we illustrate how to specify command-line options in order to extract the full potential of slepc4py.

A simple execution of the demo/ex1.py script will result in the following output:

$ python demo/ex1.py
******************************
*** SLEPc Solution Results ***
******************************
Number of iterations of the method: 4
Solution method: krylovschur
Number of requested eigenvalues: 1
Stopping condition: tol=1e-07, maxit=100
Number of converged eigenpairs 4

k ||Ax-kx||/||kx|| ----------------- ------------------
3.989739 5.76012e-09
3.959060 1.41957e-08
3.908279 6.74118e-08
3.837916 8.34269e-08


For specifying different setting for the solver parameters, we can use SLEPc command-line options with the -eps prefix. For instance, to change the number of requested eigenvalues and the tolerance:

$ python demo/ex1.py -eps_nev 10 -eps_tol 1e-11


The method used by the solver object can also be set at run time:

$ python demo/ex1.py -eps_type subspace


All the above settings can also be changed within the source code by making use of the appropriate slepc4py method. Since options can be set from within the code and the command-line, it is often useful to view the particular settings that are currently being used:

$ python demo/ex1.py -eps_view
EPS Object: 1 MPI process

type: krylovschur
50% of basis vectors kept after restart
using the locking variant
problem type: symmetric eigenvalue problem
selected portion of the spectrum: largest eigenvalues in magnitude
number of eigenvalues (nev): 1
number of column vectors (ncv): 16
maximum dimension of projected problem (mpd): 16
maximum number of iterations: 100
tolerance: 1e-08
convergence test: relative to the eigenvalue BV Object: 1 MPI process
type: mat
17 columns of global length 30
orthogonalization method: classical Gram-Schmidt
orthogonalization refinement: if needed (eta: 0.7071)
block orthogonalization method: GS
doing matmult as a single matrix-matrix product DS Object: 1 MPI process
type: hep
solving the problem with: Implicit QR method (_steqr) ST Object: 1 MPI process
type: shift
shift: 0
number of matrices: 1


Note that for computing eigenvalues of smallest magnitude we can use the option -eps_smallest_magnitude, but for interior eigenvalues things are not so straightforward. One possibility is to try with harmonic extraction, for instance to get the eigenvalues closest to 0.6:

$ python demo/ex1.py -eps_harmonic -eps_target 0.6


Depending on the problem, harmonic extraction may fail to converge. In those cases, it is necessary to specify a spectral transformation other than the default. In the command-line, this is indicated with the -st_ prefix. For example, shift-and-invert with a value of the shift equal to 0.6 would be:

$ python demo/ex1.py -st_type sinvert -eps_target 0.6


Author

Lisandro Dalcin

November 23, 2025 3.24