slepc4py.SLEPc.EPS#

class slepc4py.SLEPc.EPS#

Bases: Object

EPS.

Enumerations

Balance

EPS type of balancing used for non-Hermitian problems.

CISSExtraction

EPS CISS extraction technique.

CISSQuadRule

EPS CISS quadrature rule.

Conv

EPS convergence test.

ConvergedReason

EPS convergence reasons.

ErrorType

EPS error type to assess accuracy of computed solutions.

Extraction

EPS extraction technique.

KrylovSchurBSEType

EPS Krylov-Schur method for BSE problems.

LanczosReorthogType

EPS Lanczos reorthogonalization type.

PowerShiftType

EPS Power shift type.

ProblemType

EPS problem type.

Stop

EPS stopping test.

Type

EPS type.

Which

EPS desired part of spectrum.

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 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 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

appendOptionsPrefix(prefix=None)#

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

Logically collective.

Parameters:

prefix (str | None) – The prefix string to prepend to all EPS option requests.

Return type:

None

Source code at slepc4py/SLEPc/EPS.pyx:421

cancelMonitor()#

Clear all monitors for an EPS object.

Logically collective.

Source code at slepc4py/SLEPc/EPS.pyx:1439

Return type:

None

computeError(i, etype=None)#

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.

Parameters:
  • i (int) – Index of the solution to be considered.

  • etype (ErrorType | None) – The error type to compute.

Returns:

The error bound, computed in various ways from the residual norm \(\|Ax-kBx\|_2\) where \(k\) is the eigenvalue and \(x\) is the eigenvector.

Return type:

float

Notes

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

Source code at slepc4py/SLEPc/EPS.pyx:1722

create(comm=None)#

Create the EPS object.

Collective.

Parameters:

comm (Comm | None) – MPI communicator; if not provided, it defaults to all processes.

Return type:

Self

Source code at slepc4py/SLEPc/EPS.pyx:323

destroy()#

Destroy the EPS object.

Collective.

Source code at slepc4py/SLEPc/EPS.pyx:305

Return type:

Self

errorView(etype=None, viewer=None)#

Display the errors associated with the computed solution.

Collective.

Display the errors and the eigenvalues.

Parameters:
Return type:

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.

Source code at slepc4py/SLEPc/EPS.pyx:1756

getArnoldiDelayed()#

Get the type of reorthogonalization used during the Arnoldi iteration.

Not collective.

Returns:

True if delayed reorthogonalization is to be used.

Return type:

bool

Source code at slepc4py/SLEPc/EPS.pyx:1887

getBV()#

Get the basis vector objects associated to the eigensolver.

Not collective.

Returns:

The basis vectors context.

Return type:

BV

Source code at slepc4py/SLEPc/EPS.pyx:1111

getBalance()#

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

Not collective.

Returns:

  • balance (Balance) – The balancing method

  • iterations (int) – Number of iterations of the balancing algorithm

  • cutoff (float) – Cutoff value

Return type:

tuple[Balance, int, float]

Source code at slepc4py/SLEPc/EPS.pyx:560

getCISSExtraction()#

Get the extraction technique used in the CISS solver.

Not collective.

Returns:

The extraction technique.

Return type:

CISSExtraction

Source code at slepc4py/SLEPc/EPS.pyx:3096

getCISSKSPs()#

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

Not collective.

Returns:

The linear solver objects.

Return type:

list of petsc4py.PETSc.KSP

Notes

The number of 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.

Source code at slepc4py/SLEPc/EPS.pyx:3326

getCISSQuadRule()#

Get the quadrature rule used in the CISS solver.

Not collective.

Returns:

The quadrature rule.

Return type:

CISSQuadRule

Source code at slepc4py/SLEPc/EPS.pyx:3125

getCISSRefinement()#

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

Not collective.

Returns:

  • inner (int) – Number of iterative refinement iterations (inner loop).

  • blsize (int) – Number of iterative refinement iterations (blocksize loop).

Return type:

tuple[int, int]

Source code at slepc4py/SLEPc/EPS.pyx:3276

getCISSSizes()#

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

Not collective.

Returns:

  • ip (int) – Number of integration points.

  • bs (int) – Block size.

  • ms (int) – Moment size.

  • npart (int) – Number of partitions when splitting the communicator.

  • bsmax (int) – Maximum block size.

  • realmats (bool) – True if A and B are real.

Return type:

tuple[int, int, int, int, int, bool]

Source code at slepc4py/SLEPc/EPS.pyx:3190

getCISSThreshold()#

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

Not collective.

Returns:

  • delta (float) – Threshold for numerical rank.

  • spur (float) – Spurious threshold (to discard spurious eigenpairs.

Return type:

tuple[float, float]

Source code at slepc4py/SLEPc/EPS.pyx:3239

getCISSUseST()#

Get the flag indicating the use of the ST object in the CISS solver.

Not collective.

Returns:

Whether to use the ST object or not.

Return type:

bool

Source code at slepc4py/SLEPc/EPS.pyx:3311

getConverged()#

Get the number of converged eigenpairs.

Not collective.

Returns:

Number of converged eigenpairs.

Return type:

int

Notes

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

Source code at slepc4py/SLEPc/EPS.pyx:1508

getConvergedReason()#

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

Not collective.

Returns:

Negative value indicates diverged, positive value converged.

Return type:

ConvergedReason

Source code at slepc4py/SLEPc/EPS.pyx:1493

getConvergenceTest()#

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

Not collective.

Returns:

The method used to compute the error estimate used in the convergence test.

Return type:

Conv

Source code at slepc4py/SLEPc/EPS.pyx:925

getDS()#

Get the direct solver associated to the eigensolver.

Not collective.

Returns:

The direct solver context.

Return type:

DS

Source code at slepc4py/SLEPc/EPS.pyx:1140

getDimensions()#

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

Not collective.

Returns:

  • nev (int) – Number of eigenvalues to compute.

  • ncv (int) – Maximum dimension of the subspace to be used by the solver.

  • mpd (int) – Maximum dimension allowed for the projected problem.

Return type:

tuple[int, int, int]

Source code at slepc4py/SLEPc/EPS.pyx:1014

getEigenpair(i, Vr=None, Vi=None)#

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

Collective.

The solution consists of both the eigenvalue and the eigenvector.

Parameters:
  • i (int) – Index of the solution to be obtained.

  • Vr (Vec | None) – Placeholder for the returned eigenvector (real part).

  • Vi (Vec | None) – Placeholder for the returned eigenvector (imaginary part).

Returns:

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).

Return type:

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().

Source code at slepc4py/SLEPc/EPS.pyx:1615

getEigenvalue(i)#

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

Not collective.

Parameters:

i (int) – Index of the solution to be obtained.

Returns:

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).

Return type:

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().

Source code at slepc4py/SLEPc/EPS.pyx:1527

getEigenvector(i, Vr=None, Vi=None)#

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

Collective.

Parameters:
  • i (int) – Index of the solution to be obtained.

  • Vr (Vec | None) – Placeholder for the returned eigenvector (real part).

  • Vi (Vec | None) – Placeholder for the returned eigenvector (imaginary part).

Return type:

None

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().

Source code at slepc4py/SLEPc/EPS.pyx:1561

getErrorEstimate(i)#

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

Not collective.

Parameters:

i (int) – Index of the solution to be considered.

Returns:

Error estimate.

Return type:

float

Notes

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

Source code at slepc4py/SLEPc/EPS.pyx:1696

getExtraction()#

Get the extraction type used by the EPS object.

Not collective.

Returns:

The method of extraction.

Return type:

Extraction

Source code at slepc4py/SLEPc/EPS.pyx:613

getGDBOrth()#

Get the orthogonalization used in the search subspace.

Not collective.

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

Returns:

Whether to B-orthogonalize the search subspace.

Return type:

bool

Source code at slepc4py/SLEPc/EPS.pyx:2608

getGDBlockSize()#

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.

Returns:

The number of vectors added to the search space in every iteration.

Return type:

int

Source code at slepc4py/SLEPc/EPS.pyx:2501

getGDDoubleExpansion()#

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.

Returns:

True if using double expansion.

Return type:

bool

Source code at slepc4py/SLEPc/EPS.pyx:2646

getGDInitialSize()#

Get the initial size of the searching space.

Not collective.

Returns:

The number of vectors of the initial searching subspace.

Return type:

int

Source code at slepc4py/SLEPc/EPS.pyx:2576

getGDKrylovStart()#

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

Not collective.

Returns:

True if starting the search subspace with a Krylov basis.

Return type:

bool

Source code at slepc4py/SLEPc/EPS.pyx:2469

getGDRestart()#

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.

Returns:

  • minv (int) – The number of vectors of the search subspace after restart.

  • plusk (int) – The number of vectors saved from the previous iteration.

Return type:

tuple[int, int]

Source code at slepc4py/SLEPc/EPS.pyx:2541

getInterval()#

Get the computational interval for spectrum slicing.

Not collective.

Returns:

  • inta (float) – The left end of the interval.

  • intb (float) – The right end of the interval.

Return type:

tuple[float, float]

Notes

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

Source code at slepc4py/SLEPc/EPS.pyx:773

getInvariantSubspace()#

Get an orthonormal basis of the computed invariant subspace.

Collective.

Returns:

Basis of the invariant subspace.

Return type:

list of petsc4py.PETSc.Vec

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).

Source code at slepc4py/SLEPc/EPS.pyx:1657

getIterationNumber()#

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.

Returns:

Iteration number.

Return type:

int

Source code at slepc4py/SLEPc/EPS.pyx:1475

getJDBOrth()#

Get the orthogonalization used in the search subspace.

Not collective.

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

Returns:

Whether to B-orthogonalize the search subspace.

Return type:

bool

Source code at slepc4py/SLEPc/EPS.pyx:2890

getJDBlockSize()#

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.

Returns:

The number of vectors added to the search space in every iteration.

Return type:

int

Source code at slepc4py/SLEPc/EPS.pyx:2712

getJDConstCorrectionTol()#

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.

Returns:

True if the dynamic stopping criterion is not being used.

Return type:

bool

Source code at slepc4py/SLEPc/EPS.pyx:2855

getJDFix()#

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

Not collective.

Returns:

The threshold for changing the target.

Return type:

float

Source code at slepc4py/SLEPc/EPS.pyx:2822

getJDInitialSize()#

Get the initial size of the searching space.

Not collective.

Returns:

The number of vectors of the initial searching subspace.

Return type:

int

Source code at slepc4py/SLEPc/EPS.pyx:2787

getJDKrylovStart()#

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

Not collective.

Returns:

True if starting the search subspace with a Krylov basis.

Return type:

bool

Source code at slepc4py/SLEPc/EPS.pyx:2680

getJDRestart()#

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.

Returns:

  • minv (int) – The number of vectors of the search subspace after restart.

  • plusk (int) – The number of vectors saved from the previous iteration.

Return type:

tuple[int, int]

Source code at slepc4py/SLEPc/EPS.pyx:2752

getKrylovSchurBSEType()#

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

Not collective.

Returns:

The BSE method.

Return type:

KrylovSchurBSEType

Source code at slepc4py/SLEPc/EPS.pyx:1959

getKrylovSchurDetectZeros()#

Get the flag that enforces zero detection in spectrum slicing.

Not collective.

Returns:

The zero detection flag.

Return type:

bool

Source code at slepc4py/SLEPc/EPS.pyx:2112

getKrylovSchurDimensions()#

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.

Returns:

  • nev (int) – Number of eigenvalues to compute.

  • ncv (int) – Maximum dimension of the subspace to be used by the solver.

  • mpd (int) – Maximum dimension allowed for the projected problem.

Return type:

tuple[int, int, int]

Source code at slepc4py/SLEPc/EPS.pyx:2159

getKrylovSchurInertias()#

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.

Returns:

  • shifts (ArrayReal) – The values of the shifts used internally in the solver.

  • inertias (ArrayInt) – The values of the inertia in each shift.

Return type:

tuple[ArrayReal, ArrayInt]

Source code at slepc4py/SLEPc/EPS.pyx:2404

getKrylovSchurKSP()#

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.

Returns:

The linear solver object.

Return type:

petsc4py.PETSc.KSP

Source code at slepc4py/SLEPc/EPS.pyx:2434

getKrylovSchurLocking()#

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

Not collective.

Returns:

The locking flag.

Return type:

bool

Source code at slepc4py/SLEPc/EPS.pyx:2030

getKrylovSchurPartitions()#

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

Not collective.

Returns:

The number of partitions.

Return type:

int

Source code at slepc4py/SLEPc/EPS.pyx:2070

getKrylovSchurRestart()#

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

Not collective.

Returns:

The number of vectors to be kept at restart.

Return type:

float

Source code at slepc4py/SLEPc/EPS.pyx:1994

getKrylovSchurSubcommInfo()#

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.

Returns:

  • k (int) – Number of the subinterval for the calling process.

  • n (int) – Number of eigenvalues found in the k-th subinterval.

  • v (petsc4py.PETSc.Vec) – A vector owned by processes in the subcommunicator with dimensions compatible for locally computed eigenvectors.

Return type:

tuple[int, int, petsc4py.PETSc.Vec]

Notes

This function is only available for spectrum slicing runs.

The returned Vec should be destroyed by the user.

Source code at slepc4py/SLEPc/EPS.pyx:2183

getKrylovSchurSubcommMats()#

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.

Returns:

Return type:

tuple[petsc4py.PETSc.Mat, petsc4py.PETSc.Mat] | tuple[petsc4py.PETSc.Mat, None]

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.

Source code at slepc4py/SLEPc/EPS.pyx:2246

getKrylovSchurSubcommPairs(i, V)#

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.

Parameters:
  • i (int) – Index of the solution to be obtained.

  • V (Vec) – Placeholder for the returned eigenvector.

Returns:

The computed eigenvalue.

Return type:

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().

Source code at slepc4py/SLEPc/EPS.pyx:2214

getKrylovSchurSubintervals()#

Get the points that delimit the subintervals.

Not collective.

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

Returns:

Real values specifying subintervals

Return type:

ArrayReal

Source code at slepc4py/SLEPc/EPS.pyx:2379

getLOBPCGBlockSize()#

Get the block size used in the LOBPCG method.

Not collective.

Returns:

The block size.

Return type:

int

Source code at slepc4py/SLEPc/EPS.pyx:2956

getLOBPCGLocking()#

Get the locking flag used in the LOBPCG method.

Not collective.

Returns:

The locking flag.

Return type:

bool

Source code at slepc4py/SLEPc/EPS.pyx:3028

getLOBPCGRestart()#

Get the restart parameter used in the LOBPCG method.

Not collective.

Returns:

The restart parameter.

Return type:

float

Source code at slepc4py/SLEPc/EPS.pyx:2993

getLanczosReorthogType()#

Get the type of reorthogonalization used during the Lanczos iteration.

Not collective.

Returns:

The type of reorthogonalization.

Return type:

LanczosReorthogType

Source code at slepc4py/SLEPc/EPS.pyx:1921

getLeftEigenvector(i, Wr=None, Wi=None)#

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

Collective.

Parameters:
  • i (int) – Index of the solution to be obtained.

  • Wr (Vec | None) – Placeholder for the returned eigenvector (real part).

  • Wi (Vec | None) – Placeholder for the returned eigenvector (imaginary part).

Return type:

None

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().

Source code at slepc4py/SLEPc/EPS.pyx:1587

getLyapIIRanks()#

Get the rank values used for the Lyapunov step.

Not collective.

Returns:

  • rkc (int) – The compressed rank.

  • rkl (int) – The Lyapunov rank.

Return type:

tuple[int, int]

Source code at slepc4py/SLEPc/EPS.pyx:3062

getMonitor()#

Get the list of monitor functions.

Source code at slepc4py/SLEPc/EPS.pyx:1435

Return type:

EPSMonitorFunction

getOperators()#

Get the matrices associated with the eigenvalue problem.

Collective.

Returns:

Return type:

tuple[petsc4py.PETSc.Mat, petsc4py.PETSc.Mat] | tuple[petsc4py.PETSc.Mat, None]

Source code at slepc4py/SLEPc/EPS.pyx:1198

getOptionsPrefix()#

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

Not collective.

Returns:

The prefix string set for this EPS object.

Return type:

str

Source code at slepc4py/SLEPc/EPS.pyx:379

getPowerShiftType()#

Get the type of shifts used during the power iteration.

Not collective.

Returns:

The type of shift.

Return type:

PowerShiftType

Source code at slepc4py/SLEPc/EPS.pyx:1848

getProblemType()#

Get the problem type from the EPS object.

Not collective.

Returns:

The problem type that was previously set.

Return type:

ProblemType

Source code at slepc4py/SLEPc/EPS.pyx:454

getPurify()#

Get the flag indicating whether purification is activated or not.

Not collective.

Returns:

Whether purification is activated or not.

Return type:

bool

Source code at slepc4py/SLEPc/EPS.pyx:896

getRG()#

Get the region object associated to the eigensolver.

Not collective.

Returns:

The region context.

Return type:

RG

Source code at slepc4py/SLEPc/EPS.pyx:1169

getRQCGReset()#

Get the reset parameter used in the RQCG method.

Not collective.

Returns:

The number of iterations between resets.

Return type:

int

Source code at slepc4py/SLEPc/EPS.pyx:2927

getST()#

Get the spectral transformation object associated to the eigensolver.

Not collective.

Returns:

The spectral transformation.

Return type:

ST

Source code at slepc4py/SLEPc/EPS.pyx:1082

getStoppingTest()#

Get the stopping function.

Not collective.

Source code at slepc4py/SLEPc/EPS.pyx:1353

Return type:

EPSStoppingFunction

getTarget()#

Get the value of the target.

Not collective.

Returns:

The value of the target.

Return type:

Scalar

Notes

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

Source code at slepc4py/SLEPc/EPS.pyx:734

getThreshold()#

Get the threshold used in the threshold stopping test.

Not collective.

Returns:

  • thres (float) – The threshold.

  • rel (bool) – Whether the threshold is relative or not.

Return type:

tuple[float, bool]

Source code at slepc4py/SLEPc/EPS.pyx:691

getTolerances()#

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.

Returns:

  • tol (float) – The convergence tolerance.

  • max_it (int) – The maximum number of iterations.

Return type:

tuple[float, int]

Source code at slepc4py/SLEPc/EPS.pyx:822

getTrackAll()#

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

Not collective.

Returns:

Whether the solver compute all residuals or not.

Return type:

bool

Source code at slepc4py/SLEPc/EPS.pyx:985

getTrueResidual()#

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

Not collective.

Returns:

Whether the solver compute all residuals or not.

Return type:

bool

Source code at slepc4py/SLEPc/EPS.pyx:956

getTwoSided()#

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

Not collective.

Returns:

Whether the two-sided variant is to be used or not.

Return type:

bool

Source code at slepc4py/SLEPc/EPS.pyx:867

getType()#

Get the EPS type of this object.

Not collective.

Returns:

The solver currently being used.

Return type:

str

Source code at slepc4py/SLEPc/EPS.pyx:364

getWhichEigenpairs()#

Get which portion of the spectrum is to be sought.

Not collective.

Returns:

The portion of the spectrum to be sought by the solver.

Return type:

Which

Source code at slepc4py/SLEPc/EPS.pyx:653

isGeneralized()#

Tell if the EPS object corresponds to a generalized eigenproblem.

Not collective.

Returns:

True if two matrices were set with setOperators().

Return type:

bool

Source code at slepc4py/SLEPc/EPS.pyx:497

isHermitian()#

Tell if the EPS object corresponds to a Hermitian eigenproblem.

Not collective.

Returns:

True if the problem type set with setProblemType() was Hermitian.

Return type:

bool

Source code at slepc4py/SLEPc/EPS.pyx:512

isPositive()#

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\).

Returns:

True if the problem type set with setProblemType() was positive.

Return type:

bool

Source code at slepc4py/SLEPc/EPS.pyx:527

isStructured()#

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

Not collective.

Returns:

True if the problem type set with setProblemType() was structured.

Return type:

bool

Source code at slepc4py/SLEPc/EPS.pyx:545

reset()#

Reset the EPS object.

Collective.

Source code at slepc4py/SLEPc/EPS.pyx:315

Return type:

None

setArbitrarySelection(arbitrary, args=None, kargs=None)#

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.

Source code at slepc4py/SLEPc/EPS.pyx:1363

Parameters:
Return type:

None

setArnoldiDelayed(delayed)#

Set (toggle) delayed reorthogonalization in the Arnoldi iteration.

Logically collective.

Parameters:

delayed (bool) – True if delayed reorthogonalization is to be used.

Return type:

None

Notes

This call is only relevant if the type was set to 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.

Source code at slepc4py/SLEPc/EPS.pyx:1863

setBV(bv)#

Set a basis vectors object associated to the eigensolver.

Collective.

Parameters:

bv (BV) – The basis vectors context.

Return type:

None

Source code at slepc4py/SLEPc/EPS.pyx:1127

setBalance(balance=None, iterations=None, cutoff=None)#

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.

Parameters:
  • balance (Balance | None) – The balancing method

  • iterations (int | None) – Number of iterations of the balancing algorithm

  • cutoff (float | None) – Cutoff value

Return type:

None

Source code at slepc4py/SLEPc/EPS.pyx:581

setCISSExtraction(extraction)#

Set the extraction technique used in the CISS solver.

Logically collective.

Parameters:

extraction (CISSExtraction) – The extraction technique.

Return type:

None

Source code at slepc4py/SLEPc/EPS.pyx:3082

setCISSQuadRule(quad)#

Set the quadrature rule used in the CISS solver.

Logically collective.

Parameters:

quad (CISSQuadRule) – The quadrature rule.

Return type:

None

Source code at slepc4py/SLEPc/EPS.pyx:3111

setCISSRefinement(inner=None, blsize=None)#

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

Logically collective.

Parameters:
  • inner (int | None) – Number of iterative refinement iterations (inner loop).

  • blsize (int | None) – Number of iterative refinement iterations (blocksize loop).

Return type:

None

Source code at slepc4py/SLEPc/EPS.pyx:3257

setCISSSizes(ip=None, bs=None, ms=None, npart=None, bsmax=None, realmats=False)#

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

Logically collective.

Parameters:
  • ip (int | None) – Number of integration points.

  • bs (int | None) – Block size.

  • ms (int | None) – Moment size.

  • npart (int | None) – Number of partitions when splitting the communicator.

  • bsmax (int | None) – Maximum block size.

  • realmats (bool) – True if A and B are real.

Return type:

None

Notes

The default number of partitions is 1. This means the internal 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 solves proceed simultaneously.

Source code at slepc4py/SLEPc/EPS.pyx:3140

setCISSThreshold(delta=None, spur=None)#

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

Logically collective.

Parameters:
  • delta (float | None) – Threshold for numerical rank.

  • spur (float | None) – Spurious threshold (to discard spurious eigenpairs).

Return type:

None

Source code at slepc4py/SLEPc/EPS.pyx:3220

setCISSUseST(usest)#

Set a flag indicating that the CISS solver will use the ST object.

Logically collective.

Set a flag indicating that the CISS solver will use the ST object for the linear solves.

Parameters:

usest (bool) – Whether to use the ST object or not.

Return type:

None

Source code at slepc4py/SLEPc/EPS.pyx:3294

setConvergenceTest(conv)#

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

Logically collective.

Parameters:

conv (Conv) – The method used to compute the error estimate used in the convergence test.

Return type:

None

Source code at slepc4py/SLEPc/EPS.pyx:941

setDS(ds)#

Set a direct solver object associated to the eigensolver.

Collective.

Parameters:

ds (DS) – The direct solver context.

Return type:

None

Source code at slepc4py/SLEPc/EPS.pyx:1156

setDeflationSpace(space)#

Add vectors to the basis of the deflation space.

Collective.

Parameters:

space (Vec | list[Vec]) – Set of basis vectors to be added to the deflation space.

Return type:

None

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.

Source code at slepc4py/SLEPc/EPS.pyx:1238

setDimensions(nev=None, ncv=None, mpd=None)#

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

Logically collective.

Parameters:
  • nev (int | None) – Number of eigenvalues to compute.

  • ncv (int | None) – Maximum dimension of the subspace to be used by the solver.

  • mpd (int | None) – Maximum dimension allowed for the projected problem.

Return type:

None

Notes

Use 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.

Source code at slepc4py/SLEPc/EPS.pyx:1035

setEigenvalueComparison(comparison, args=None, kargs=None)#

Set an eigenvalue comparison function.

Logically collective.

Specify the eigenvalue comparison function when setWhichEigenpairs() is set to EPS.Which.USER.

Source code at slepc4py/SLEPc/EPS.pyx:1390

Parameters:
Return type:

None

setExtraction(extraction)#

Set the extraction type used by the EPS object.

Logically collective.

Parameters:

extraction (Extraction) – The extraction method to be used by the solver.

Return type:

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().

Source code at slepc4py/SLEPc/EPS.pyx:628

setFromOptions()#

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.

Source code at slepc4py/SLEPc/EPS.pyx:436

Return type:

None

setGDBOrth(borth)#

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.

Parameters:

borth (bool) – Whether to B-orthogonalize the search subspace.

Return type:

int

Source code at slepc4py/SLEPc/EPS.pyx:2591

setGDBlockSize(bs)#

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.

Parameters:

bs (int) – The number of vectors added to the search space in every iteration.

Return type:

None

Source code at slepc4py/SLEPc/EPS.pyx:2484

setGDDoubleExpansion(doubleexp)#

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.

Parameters:

doubleexp (bool) – True if using double expansion.

Return type:

None

Source code at slepc4py/SLEPc/EPS.pyx:2626

setGDInitialSize(initialsize)#

Set the initial size of the searching space.

Logically collective.

Parameters:

initialsize (int) – The number of vectors of the initial searching subspace.

Return type:

None

Source code at slepc4py/SLEPc/EPS.pyx:2562

setGDKrylovStart(krylovstart=True)#

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

Logically collective.

Parameters:

krylovstart (bool) – True if starting the search subspace with a Krylov basis.

Return type:

None

Source code at slepc4py/SLEPc/EPS.pyx:2455

setGDRestart(minv=None, plusk=None)#

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.

Parameters:
  • minv (int) – The number of vectors of the search subspace after restart.

  • plusk (int) – The number of vectors saved from the previous iteration.

Return type:

None

Source code at slepc4py/SLEPc/EPS.pyx:2519

setInitialSpace(space)#

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

Collective.

Parameters:

space (Vec | list[Vec]) – The initial space

Return type:

None

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.

Source code at slepc4py/SLEPc/EPS.pyx:1272

setInterval(inta, intb)#

Set the computational interval for spectrum slicing.

Logically collective.

Parameters:
  • inta (float) – The left end of the interval.

  • intb (float) – The right end of the interval.

Return type:

None

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, see setWhichEigenpairs().

Source code at slepc4py/SLEPc/EPS.pyx:795

setJDBOrth(borth)#

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.

Parameters:

borth (bool) – Whether to B-orthogonalize the search subspace.

Return type:

None

Source code at slepc4py/SLEPc/EPS.pyx:2873

setJDBlockSize(bs)#

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.

Parameters:

bs (int) – The number of vectors added to the search space in every iteration.

Return type:

None

Source code at slepc4py/SLEPc/EPS.pyx:2695

setJDConstCorrectionTol(constant)#

Deactivate the dynamic stopping criterion.

Logically collective.

Deactivate the dynamic stopping criterion that sets the petsc4py.PETSc.KSP relative tolerance to 0.5**i, where i is the number of EPS iterations from the last converged value.

Parameters:

constant (bool) – If False, the petsc4py.PETSc.KSP relative tolerance is set to 0.5**i.

Return type:

None

Source code at slepc4py/SLEPc/EPS.pyx:2837

setJDFix(fix)#

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

Logically collective.

Parameters:

fix (float) – The threshold for changing the target.

Return type:

None

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.

Source code at slepc4py/SLEPc/EPS.pyx:2802

setJDInitialSize(initialsize)#

Set the initial size of the searching space.

Logically collective.

Parameters:

initialsize (int) – The number of vectors of the initial searching subspace.

Return type:

None

Source code at slepc4py/SLEPc/EPS.pyx:2773

setJDKrylovStart(krylovstart=True)#

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

Logically collective.

Parameters:

krylovstart (bool) – True if starting the search subspace with a Krylov basis.

Return type:

None

Source code at slepc4py/SLEPc/EPS.pyx:2666

setJDRestart(minv=None, plusk=None)#

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.

Parameters:
  • minv (int | None) – The number of vectors of the search subspace after restart.

  • plusk (int | None) – The number of vectors saved from the previous iteration.

Return type:

None

Source code at slepc4py/SLEPc/EPS.pyx:2730

setKrylovSchurBSEType(bse)#

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

Logically collective.

Parameters:

bse (KrylovSchurBSEType) – The BSE method.

Return type:

None

Notes

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

Source code at slepc4py/SLEPc/EPS.pyx:1939

setKrylovSchurDetectZeros(detect)#

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.

Parameters:

detect (bool) – True if zeros must checked for.

Return type:

None

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.

Source code at slepc4py/SLEPc/EPS.pyx:2085

setKrylovSchurDimensions(nev=None, ncv=None, mpd=None)#

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().

Parameters:
  • nev (int | None) – Number of eigenvalues to compute.

  • ncv (int | None) – Maximum dimension of the subspace to be used by the solver.

  • mpd (int | None) – Maximum dimension allowed for the projected problem.

Return type:

None

Source code at slepc4py/SLEPc/EPS.pyx:2127

setKrylovSchurLocking(lock)#

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

Logically collective.

Parameters:

lock (bool) – True if the locking variant must be selected.

Return type:

None

Notes

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

Source code at slepc4py/SLEPc/EPS.pyx:2009

setKrylovSchurPartitions(npart)#

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.

Parameters:

npart (int) – The number of partitions.

Return type:

None

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.

Source code at slepc4py/SLEPc/EPS.pyx:2045

setKrylovSchurRestart(keep)#

Set the restart parameter for the Krylov-Schur method.

Logically collective.

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

Parameters:

keep (float) – The number of vectors to be kept at restart.

Return type:

None

Notes

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

Source code at slepc4py/SLEPc/EPS.pyx:1974

setKrylovSchurSubintervals(subint)#

Set the subinterval boundaries.

Logically collective.

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

Parameters:

subint (Sequence[float]) – Real values specifying subintervals

Return type:

None

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.

Source code at slepc4py/SLEPc/EPS.pyx:2342

setLOBPCGBlockSize(bs)#

Set the block size of the LOBPCG method.

Logically collective.

Parameters:

bs (int) – The block size.

Return type:

None

Source code at slepc4py/SLEPc/EPS.pyx:2942

setLOBPCGLocking(lock)#

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

Logically collective.

Parameters:

lock (bool) – True if the locking variant must be selected.

Return type:

None

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).

Source code at slepc4py/SLEPc/EPS.pyx:3008

setLOBPCGRestart(restart)#

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.

Parameters:

restart (float) – The percentage of the block of vectors to force a restart.

Return type:

None

Notes

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

Source code at slepc4py/SLEPc/EPS.pyx:2971

setLanczosReorthogType(reorthog)#

Set the type of reorthogonalization used during the Lanczos iteration.

Logically collective.

Parameters:

reorthog (LanczosReorthogType) – The type of reorthogonalization.

Return type:

None

Notes

This call is only relevant if the type was set to EPS.Type.LANCZOS with setType().

Source code at slepc4py/SLEPc/EPS.pyx:1902

setLeftInitialSpace(space)#

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

Collective.

Parameters:

space (Vec | list[Vec]) – The left initial space

Return type:

None

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.

Source code at slepc4py/SLEPc/EPS.pyx:1305

setLyapIIRanks(rkc=None, rkl=None)#

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

Logically collective.

Parameters:
  • rkc (int | None) – The compressed rank.

  • rkl (int | None) – The Lyapunov rank.

Return type:

None

Source code at slepc4py/SLEPc/EPS.pyx:3043

setMonitor(monitor, args=None, kargs=None)#

Append a monitor function to the list of monitors.

Logically collective.

Source code at slepc4py/SLEPc/EPS.pyx:1414

Parameters:
Return type:

None

setOperators(A, B=None)#

Set the matrices associated with the eigenvalue problem.

Collective.

Parameters:
  • A (Mat) – The matrix associated with the eigensystem.

  • B (Mat | None) – The second matrix in the case of generalized eigenproblems; if not provided, a standard eigenproblem is assumed.

Return type:

None

Source code at slepc4py/SLEPc/EPS.pyx:1221

setOptionsPrefix(prefix=None)#

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

Logically collective.

Parameters:

prefix (str | None) – The prefix string to prepend to all EPS option requests.

Return type:

None

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_")

Source code at slepc4py/SLEPc/EPS.pyx:394

setPowerShiftType(shift)#

Set the type of shifts used during the power iteration.

Logically collective.

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

Parameters:

shift (PowerShiftType) – The type of shift.

Return type:

None

Notes

This call is only relevant if the type was set to EPS.Type.POWER with setType().

By default, shifts are constant (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 or EPS.PowerShiftType.WILKINSON). In this case, the iteration behaves rather like a cubic converging method as RQI.

Source code at slepc4py/SLEPc/EPS.pyx:1816

setProblemType(problem_type)#

Set the type of the eigenvalue problem.

Logically collective.

Parameters:

problem_type (ProblemType) – The problem type to be set.

Return type:

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.

Source code at slepc4py/SLEPc/EPS.pyx:469

setPurify(purify=True)#

Set (toggle) eigenvector purification.

Logically collective.

Parameters:

purify (bool) – True to activate purification (default).

Return type:

None

Source code at slepc4py/SLEPc/EPS.pyx:911

setRG(rg)#

Set a region object associated to the eigensolver.

Collective.

Parameters:

rg (RG) – The region context.

Return type:

None

Source code at slepc4py/SLEPc/EPS.pyx:1185

setRQCGReset(nrest)#

Set the reset parameter of the RQCG iteration.

Logically collective.

Every nrest iterations the solver performs a Rayleigh-Ritz projection step.

Parameters:

nrest (int) – The number of iterations between resets.

Return type:

None

Source code at slepc4py/SLEPc/EPS.pyx:2910

setST(st)#

Set a spectral transformation object associated to the eigensolver.

Collective.

Parameters:

st (ST) – The spectral transformation.

Return type:

None

Source code at slepc4py/SLEPc/EPS.pyx:1098

setStoppingTest(stopping, args=None, kargs=None)#

Set when to stop the outer iteration of the eigensolver.

Logically collective.

Source code at slepc4py/SLEPc/EPS.pyx:1333

Parameters:
Return type:

None

setTarget(target)#

Set the value of the target.

Logically collective.

Parameters:

target (Scalar) – The value of the target.

Return type:

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().

Source code at slepc4py/SLEPc/EPS.pyx:753

setThreshold(thres, rel=False)#

Set the threshold used in the threshold stopping test.

Logically collective.

Parameters:
  • thres (float) – The threshold.

  • rel (bool) – Whether the threshold is relative or not.

Return type:

None

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).

Source code at slepc4py/SLEPc/EPS.pyx:709

setTolerances(tol=None, max_it=None)#

Set the tolerance and max. iter. used by the default EPS convergence tests.

Logically collective.

Parameters:
  • tol (float | None) – The convergence tolerance.

  • max_it (int | None) – The maximum number of iterations.

Return type:

None

Notes

Use DECIDE for maxits to assign a reasonably good value, which is dependent on the solution method.

Source code at slepc4py/SLEPc/EPS.pyx:843

setTrackAll(trackall)#

Set if the solver must compute the residual of all approximate eigenpairs.

Logically collective.

Parameters:

trackall (bool) – Whether compute all residuals or not.

Return type:

None

Source code at slepc4py/SLEPc/EPS.pyx:1000

setTrueResidual(trueres)#

Set if the solver must compute the true residual explicitly or not.

Logically collective.

Parameters:

trueres (bool) – Whether compute the true residual or not.

Return type:

None

Source code at slepc4py/SLEPc/EPS.pyx:971

setTwoSided(twosided)#

Set to use a two-sided variant that also computes left eigenvectors.

Logically collective.

Parameters:

twosided (bool) – Whether the two-sided variant is to be used or not.

Return type:

None

Source code at slepc4py/SLEPc/EPS.pyx:882

setType(eps_type)#

Set the particular solver to be used in the EPS object.

Logically collective.

Parameters:

eps_type (Type | str) – The solver to be used.

Return type:

None

Notes

See EPS.Type for available methods. The default is 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.

Source code at slepc4py/SLEPc/EPS.pyx:340

setUp()#

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.

Source code at slepc4py/SLEPc/EPS.pyx:1450

Return type:

None

setWhichEigenpairs(which)#

Set which portion of the spectrum is to be sought.

Logically collective.

Parameters:

which (Which) – The portion of the spectrum to be sought by the solver.

Return type:

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 and EPS.Which.SMALLEST_IMAGINARY use the absolute value of the imaginary part for eigenvalue selection.

Source code at slepc4py/SLEPc/EPS.pyx:668

solve()#

Solve the eigensystem.

Collective.

Source code at slepc4py/SLEPc/EPS.pyx:1467

Return type:

None

updateKrylovSchurSubcommMats(s=1.0, a=1.0, Au=None, t=1.0, b=1.0, Bu=None, structure=None, globalup=False)#

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.

Parameters:
  • s (Scalar) – Scalar that multiplies the existing A matrix.

  • a (Scalar) – Scalar used in the axpy operation on A.

  • Au (petsc4py.PETSc.Mat | None) – The matrix used in the axpy operation on A.

  • t (Scalar) – Scalar that multiplies the existing B matrix.

  • b (Scalar) – Scalar used in the axpy operation on B.

  • Bu (petsc4py.PETSc.Mat | None) – The matrix used in the axpy operation on B.

  • structure (petsc4py.PETSc.Mat.Structure | None) – Either same, different, or a subset of the non-zero sparsity pattern.

  • globalup (bool) – Whether global matrices must be updated or not.

Return type:

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 operations to perform the updates.

If globalup is True, communication is carried out to reconstruct the updated matrices in the parent communicator.

Source code at slepc4py/SLEPc/EPS.pyx:2279

valuesView(viewer=None)#

Display the computed eigenvalues in a viewer.

Collective.

Parameters:

viewer (Viewer | None) – Visualization context; if not provided, the standard output is used.

Return type:

None

Source code at slepc4py/SLEPc/EPS.pyx:1784

vectorsView(viewer=None)#

Output computed eigenvectors to a viewer.

Collective.

Parameters:

viewer (Viewer | None) – Visualization context; if not provided, the standard output is used.

Return type:

None

Source code at slepc4py/SLEPc/EPS.pyx:1799

view(viewer=None)#

Print the EPS data structure.

Collective.

Parameters:

viewer (Viewer | None) – Visualization context; if not provided, the standard output is used.

Return type:

None

Source code at slepc4py/SLEPc/EPS.pyx:290

Attributes Documentation

bv#

The basis vectors (BV) object associated.

Source code at slepc4py/SLEPc/EPS.pyx:3427

ds#

The direct solver (DS) object associated.

Source code at slepc4py/SLEPc/EPS.pyx:3441

extraction#

The type of extraction technique to be employed.

Source code at slepc4py/SLEPc/EPS.pyx:3357

max_it#

The maximum iteration count.

Source code at slepc4py/SLEPc/EPS.pyx:3385

problem_type#

The type of the eigenvalue problem.

Source code at slepc4py/SLEPc/EPS.pyx:3350

purify#

Eigenvector purification.

Source code at slepc4py/SLEPc/EPS.pyx:3406

rg#

The region (RG) object associated.

Source code at slepc4py/SLEPc/EPS.pyx:3434

st#

The spectral transformation (ST) object associated.

Source code at slepc4py/SLEPc/EPS.pyx:3420

target#

The value of the target.

Source code at slepc4py/SLEPc/EPS.pyx:3371

tol#

The tolerance.

Source code at slepc4py/SLEPc/EPS.pyx:3378

track_all#

Compute the residual norm of all approximate eigenpairs.

Source code at slepc4py/SLEPc/EPS.pyx:3413

true_residual#

Compute the true residual explicitly.

Source code at slepc4py/SLEPc/EPS.pyx:3399

two_sided#

Two-sided that also computes left eigenvectors.

Source code at slepc4py/SLEPc/EPS.pyx:3392

which#

The portion of the spectrum to be sought.

Source code at slepc4py/SLEPc/EPS.pyx:3364