# qiskit.algorithms.NumPyEigensolver¶

class NumPyEigensolver(k=1, filter_criterion=None)[código fonte]

The NumPy Eigensolver algorithm.

NumPy Eigensolver computes up to the first $$k$$ eigenvalues of a complex-valued square matrix of dimension $$n \times n$$, with $$k \leq n$$.

Nota

Operators are automatically converted to SciPy’s spmatrix as needed and this conversion can be costly in terms of memory and performance as the operator size, mostly in terms of number of qubits it represents, gets larger.

Parâmetros
• k (int) – How many eigenvalues are to be computed, has a min. value of 1.

• filter_criterion (Optional[Callable[[Union[List, ndarray], float, Optional[List[float]]], bool]]) – callable that allows to filter eigenvalues/eigenstates, only feasible eigenstates are returned in the results. The callable has the signature filter(eigenstate, eigenvalue, aux_values) and must return a boolean to indicate whether to keep this value in the final returned result or not. If the number of elements that satisfies the criterion is smaller than k then the returned list has fewer elements and can even be empty.

__init__(k=1, filter_criterion=None)[código fonte]
Parâmetros
• k (int) – How many eigenvalues are to be computed, has a min. value of 1.

• filter_criterion (Optional[Callable[[Union[List, ndarray], float, Optional[List[float]]], bool]]) – callable that allows to filter eigenvalues/eigenstates, only feasible eigenstates are returned in the results. The callable has the signature filter(eigenstate, eigenvalue, aux_values) and must return a boolean to indicate whether to keep this value in the final returned result or not. If the number of elements that satisfies the criterion is smaller than k then the returned list has fewer elements and can even be empty.

Methods

 __init__([k, filter_criterion]) type k int compute_eigenvalues(operator[, aux_operators]) Computes eigenvalues. Whether computing the expectation value of auxiliary operators is supported.

Attributes

 filter_criterion returns the filter criterion if set k returns k (number of eigenvalues requested)
compute_eigenvalues(operator, aux_operators=None)[código fonte]

Computes eigenvalues. Operator and aux_operators can be supplied here and if not None will override any already set into algorithm so it can be reused with different operators. While an operator is required by algorithms, aux_operators are optional. To ‘remove’ a previous aux_operators array use an empty list here.

Parâmetros
• operator (OperatorBase) – Qubit operator of the Observable

• aux_operators (Optional[List[Optional[OperatorBase]]]) – Optional list of auxiliary operators to be evaluated with the eigenstate of the minimum eigenvalue main result and their expectation values returned. For instance in chemistry these can be dipole operators, total particle count operators so we can get values for these at the ground state.

Tipo de retorno

EigensolverResult

Retorna

EigensolverResult

property filter_criterion

returns the filter criterion if set

Tipo de retorno

Optional[Callable[[Union[List, ndarray], float, Optional[List[float]]], bool]]

property k

returns k (number of eigenvalues requested)

Tipo de retorno

int

classmethod supports_aux_operators()[código fonte]

Whether computing the expectation value of auxiliary operators is supported.

Tipo de retorno

bool

Retorna

True if aux_operator expectations can be evaluated, False otherwise