NumPyEigensolver
class NumPyEigensolver(k=1, filter_criterion=None)
Bases: qiskit.algorithms.eigen_solvers.eigen_solver.Eigensolver
Pending deprecation: NumPy Eigensolver algorithm.
The NumPyEigensolver class has been superseded by the qiskit.algorithms.eigensolvers.NumPyEigensolver
class. This class will be deprecated in a future release and subsequently removed after that.
NumPy Eigensolver computes up to the first eigenvalues of a complex-valued square matrix of dimension , with .
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.
Parameters
- k (
int
) – How many eigenvalues are to be computed, has a min. value of 1. - filter_criterion (
Optional
[Callable
[[Union
[List
,ndarray
],float
,Union
[List
[Optional
[float
]],Dict
[str
,float
],None
]],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
compute_eigenvalues
NumPyEigensolver.compute_eigenvalues(operator, aux_operators=None)
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.
Parameters
- operator (
OperatorBase
) – Qubit operator of the Observable - aux_operators (
Union
[List
[Optional
[OperatorBase
]],Dict
[str
,OperatorBase
],None
]) – 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.
Return type
Returns
EigensolverResult
supports_aux_operators
classmethod NumPyEigensolver.supports_aux_operators()
Whether computing the expectation value of auxiliary operators is supported.
Return type
bool
Returns
True if aux_operator expectations can be evaluated, False otherwise
Attributes
filter_criterion
returns the filter criterion if set
Return type
Optional
[Callable
[[Union
[List
, ndarray
], float
, Union
[List
[Optional
[float
]], Dict
[str
, float
], None
]], bool
]]
k
returns k (number of eigenvalues requested)
Return type
int