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

118 lines
6.1 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: WindowExtrapolator
description: API reference for qiskit.chemistry.algorithms.pes_samplers.WindowExtrapolator
in_page_toc_min_heading_level: 1
python_api_type: class
python_api_name: qiskit.chemistry.algorithms.pes_samplers.WindowExtrapolator
---
# qiskit.chemistry.algorithms.pes\_samplers.WindowExtrapolator
<Class id="qiskit.chemistry.algorithms.pes_samplers.WindowExtrapolator" isDedicatedPage={true} github="https://github.com/qiskit-community/qiskit-aqua/tree/stable/0.9/qiskit/chemistry/algorithms/pes_samplers/extrapolator.py" signature="WindowExtrapolator(extrapolator=None, window=2)" modifiers="class">
An extrapolator which wraps another extrapolator, limiting the internal extrapolators ground truth parameter set to a fixed window size.
Constructor.
**Parameters**
* **extrapolator** (`Union`\[`PolynomialExtrapolator`, `DifferentialExtrapolator`, `None`]) internal extrapolator that performs extrapolation on variational parameters based on data window
* **window** (`int`) Number of previous points to use for extrapolation. A value of zero indicates that all previous points will be used for bootstrapping.
### \_\_init\_\_
<Function id="qiskit.chemistry.algorithms.pes_samplers.WindowExtrapolator.__init__" signature="__init__(extrapolator=None, window=2)">
Constructor.
**Parameters**
* **extrapolator** (`Union`\[`PolynomialExtrapolator`, `DifferentialExtrapolator`, `None`]) internal extrapolator that performs extrapolation on variational parameters based on data window
* **window** (`int`) Number of previous points to use for extrapolation. A value of zero indicates that all previous points will be used for bootstrapping.
</Function>
## Methods
| | |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- |
| [`__init__`](#qiskit.chemistry.algorithms.pes_samplers.WindowExtrapolator.__init__ "qiskit.chemistry.algorithms.pes_samplers.WindowExtrapolator.__init__")(\[extrapolator, window]) | Constructor. |
| [`extrapolate`](#qiskit.chemistry.algorithms.pes_samplers.WindowExtrapolator.extrapolate "qiskit.chemistry.algorithms.pes_samplers.WindowExtrapolator.extrapolate")(points, param\_dict) | Extrapolate at specified point of interest given a set of variational parameters. |
| [`factory`](#qiskit.chemistry.algorithms.pes_samplers.WindowExtrapolator.factory "qiskit.chemistry.algorithms.pes_samplers.WindowExtrapolator.factory")(mode, \*\*kwargs) | Factory method for constructing extrapolators. |
## Attributes
| | |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------- |
| [`extrapolator`](#qiskit.chemistry.algorithms.pes_samplers.WindowExtrapolator.extrapolator "qiskit.chemistry.algorithms.pes_samplers.WindowExtrapolator.extrapolator") | Returns the internal extrapolator. |
| [`window`](#qiskit.chemistry.algorithms.pes_samplers.WindowExtrapolator.window "qiskit.chemistry.algorithms.pes_samplers.WindowExtrapolator.window") | Returns the size of the window. |
### extrapolate
<Function id="qiskit.chemistry.algorithms.pes_samplers.WindowExtrapolator.extrapolate" signature="extrapolate(points, param_dict)">
Extrapolate at specified point of interest given a set of variational parameters. Based on the specified window, a subset of the data points will be used for extrapolation. A default window of 2 points is used, while a value of zero indicates that all previous points will be used for extrapolation. This method defines the data window before performing the internal extrapolation.
**Parameters**
* **points** (`List`\[`float`]) List of point(s) to be used for extrapolation. Can represent some degree of freedom, ex, interatomic distance.
* **param\_dict** (`Optional`\[`Dict`\[`float`, `List`\[`float`]]]) Dictionary of variational parameters. Each key is the point and the value is a list of the variational parameters.
**Return type**
`Dict`\[`float`, `List`\[`float`]]
**Returns**
Dictionary of variational parameters for extrapolated point(s).
</Function>
### extrapolator
<Attribute id="qiskit.chemistry.algorithms.pes_samplers.WindowExtrapolator.extrapolator">
Returns the internal extrapolator.
**Return type**
`Extrapolator`
**Returns**
The internal extrapolator.
</Attribute>
### factory
<Function id="qiskit.chemistry.algorithms.pes_samplers.WindowExtrapolator.factory" signature="factory(mode, **kwargs)" modifiers="static">
Factory method for constructing extrapolators.
**Parameters**
* **mode** (`str`) Extrapolator to instantiate. Can be one of: - window - poly - diff\_model - pca - l1
* **kwargs** arguments to be passed to the constructor of an extrapolator
**Return type**
`Extrapolator`
**Returns**
A newly created extrapolator instance.
**Raises**
[**AquaError**](qiskit.aqua.AquaError "qiskit.aqua.AquaError") if specified mode is unknown.
</Function>
### window
<Attribute id="qiskit.chemistry.algorithms.pes_samplers.WindowExtrapolator.window">
Returns the size of the window.
**Return type**
`int`
**Returns**
The size of the window.
</Attribute>
</Class>