qiskit-documentation/docs/api/qiskit/0.24/qiskit.chemistry.algorithms...

98 lines
6.4 KiB
Plaintext
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
title: NumPyEigensolverFactory
description: API reference for qiskit.chemistry.algorithms.NumPyEigensolverFactory
in_page_toc_min_heading_level: 1
python_api_type: class
python_api_name: qiskit.chemistry.algorithms.NumPyEigensolverFactory
---
<span id="qiskit-chemistry-algorithms-numpyeigensolverfactory" />
# qiskit.chemistry.algorithms.NumPyEigensolverFactory
<Class id="qiskit.chemistry.algorithms.NumPyEigensolverFactory" isDedicatedPage={true} github="https://github.com/qiskit-community/qiskit-aqua/tree/stable/0.8/qiskit/chemistry/algorithms/excited_states_solvers/eigensolver_factories/numpy_eigensolver_factory.py" signature="NumPyEigensolverFactory(filter_criterion=None, k=100, use_default_filter_criterion=False)" modifiers="class">
A factory to construct a NumPyEigensolver.
**Parameters**
* **filter\_criterion** (`Optional`\[`Callable`\[\[`Union`\[`List`, `ndarray`], `float`, `Optional`\[`List`\[`float`]]], `bool`]]) callable that allows to filter eigenvalues/eigenstates. The minimum eigensolver is only searching over feasible states and returns an eigenstate that has the smallest eigenvalue among feasible states. The callable has the signature filter(eigenstate, eigenvalue, aux\_values) and must return a boolean to indicate whether to consider this value or not. If there is no feasible element, the result can even be empty.
* **use\_default\_filter\_criterion** (`bool`) Whether to use default filter criteria or not
* **k** (`int`) How many eigenvalues are to be computed, has a min. value of 1.
* **use\_default\_filter\_criterion** whether to use the transformations default filter criterion if `filter_criterion` is `None`.
### \_\_init\_\_
<Function id="qiskit.chemistry.algorithms.NumPyEigensolverFactory.__init__" signature="__init__(filter_criterion=None, k=100, use_default_filter_criterion=False)">
**Parameters**
* **filter\_criterion** (`Optional`\[`Callable`\[\[`Union`\[`List`, `ndarray`], `float`, `Optional`\[`List`\[`float`]]], `bool`]]) callable that allows to filter eigenvalues/eigenstates. The minimum eigensolver is only searching over feasible states and returns an eigenstate that has the smallest eigenvalue among feasible states. The callable has the signature filter(eigenstate, eigenvalue, aux\_values) and must return a boolean to indicate whether to consider this value or not. If there is no feasible element, the result can even be empty.
* **use\_default\_filter\_criterion** (`bool`) Whether to use default filter criteria or not
* **k** (`int`) How many eigenvalues are to be computed, has a min. value of 1.
* **use\_default\_filter\_criterion** whether to use the transformations default filter criterion if `filter_criterion` is `None`.
</Function>
## Methods
| | |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- |
| [`__init__`](#qiskit.chemistry.algorithms.NumPyEigensolverFactory.__init__ "qiskit.chemistry.algorithms.NumPyEigensolverFactory.__init__")(\[filter\_criterion, k, …]) | **type filter\_criterion**`Optional`\[`Callable`\[\[`Union`\[`List`, `ndarray`], `float`, `Optional`\[`List`\[`float`]]], `bool`]] |
| [`get_solver`](#qiskit.chemistry.algorithms.NumPyEigensolverFactory.get_solver "qiskit.chemistry.algorithms.NumPyEigensolverFactory.get_solver")(transformation) | Returns a NumPyEigensolver with the desired filter |
## Attributes
| | |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------- |
| [`filter_criterion`](#qiskit.chemistry.algorithms.NumPyEigensolverFactory.filter_criterion "qiskit.chemistry.algorithms.NumPyEigensolverFactory.filter_criterion") | returns filter criterion |
| [`k`](#qiskit.chemistry.algorithms.NumPyEigensolverFactory.k "qiskit.chemistry.algorithms.NumPyEigensolverFactory.k") | returns k (number of eigenvalues requested) |
| [`use_default_filter_criterion`](#qiskit.chemistry.algorithms.NumPyEigensolverFactory.use_default_filter_criterion "qiskit.chemistry.algorithms.NumPyEigensolverFactory.use_default_filter_criterion") | returns whether to use the default filter criterion |
### filter\_criterion
<Attribute id="qiskit.chemistry.algorithms.NumPyEigensolverFactory.filter_criterion">
returns filter criterion
**Return type**
`Callable`\[\[`Union`\[`List`, `ndarray`], `float`, `Optional`\[`List`\[`float`]]], `bool`]
</Attribute>
### get\_solver
<Function id="qiskit.chemistry.algorithms.NumPyEigensolverFactory.get_solver" signature="get_solver(transformation)">
Returns a NumPyEigensolver with the desired filter
**Parameters**
**transformation** (`Transformation`) a fermionic/bosonic qubit operator transformation.
**Return type**
`Eigensolver`
**Returns**
A NumPyEigensolver suitable to compute the ground state of the molecule transformed by `transformation`.
</Function>
### k
<Attribute id="qiskit.chemistry.algorithms.NumPyEigensolverFactory.k">
returns k (number of eigenvalues requested)
**Return type**
`int`
</Attribute>
### use\_default\_filter\_criterion
<Attribute id="qiskit.chemistry.algorithms.NumPyEigensolverFactory.use_default_filter_criterion">
returns whether to use the default filter criterion
**Return type**
`bool`
</Attribute>
</Class>