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

96 lines
5.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: PCAExtrapolator (v0.26)
description: API reference for qiskit.chemistry.algorithms.pes_samplers.PCAExtrapolator in qiskit v0.26
in_page_toc_min_heading_level: 1
python_api_type: class
python_api_name: qiskit.chemistry.algorithms.pes_samplers.PCAExtrapolator
---
<span id="qiskit-chemistry-algorithms-pes-samplers-pcaextrapolator" />
# qiskit.chemistry.algorithms.pes\_samplers.PCAExtrapolator
<Class id="qiskit.chemistry.algorithms.pes_samplers.PCAExtrapolator" isDedicatedPage={true} github="https://github.com/qiskit-community/qiskit-aqua/tree/stable/0.9/qiskit/chemistry/algorithms/pes_samplers/extrapolator.py" signature="PCAExtrapolator(extrapolator=None, kernel=None, window=2)" modifiers="class">
A wrapper extrapolator which reduces the points dimensionality with PCA, performs extrapolation in the transformed pca space, and inverse transforms the results before returning. A user specifies the kernel within how the PCA transformation should be done.
Constructor.
**Parameters**
* **extrapolator** (`Union`\[`PolynomialExtrapolator`, `DifferentialExtrapolator`, `None`]) internal extrapolator that performs extrapolation on variational parameters based on data window.
* **kernel** (`Optional`\[`str`]) Kernel (from sklearn) that specifies how dimensionality reduction should be done for PCA. Default value is None, and switches the extrapolation to standard PCA.
* **window** (`int`) Number of previous points to use for extrapolation.
**Raises**
[**AquaError**](qiskit.aqua.AquaError "qiskit.aqua.AquaError") if kernel is not defined in sklearn module.
### \_\_init\_\_
<Function id="qiskit.chemistry.algorithms.pes_samplers.PCAExtrapolator.__init__" signature="__init__(extrapolator=None, kernel=None, window=2)">
Constructor.
**Parameters**
* **extrapolator** (`Union`\[`PolynomialExtrapolator`, `DifferentialExtrapolator`, `None`]) internal extrapolator that performs extrapolation on variational parameters based on data window.
* **kernel** (`Optional`\[`str`]) Kernel (from sklearn) that specifies how dimensionality reduction should be done for PCA. Default value is None, and switches the extrapolation to standard PCA.
* **window** (`int`) Number of previous points to use for extrapolation.
**Raises**
[**AquaError**](qiskit.aqua.AquaError "qiskit.aqua.AquaError") if kernel is not defined in sklearn module.
</Function>
## Methods
| | |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- |
| [`__init__`](#qiskit.chemistry.algorithms.pes_samplers.PCAExtrapolator.__init__ "qiskit.chemistry.algorithms.pes_samplers.PCAExtrapolator.__init__")(\[extrapolator, kernel, window]) | Constructor. |
| [`extrapolate`](#qiskit.chemistry.algorithms.pes_samplers.PCAExtrapolator.extrapolate "qiskit.chemistry.algorithms.pes_samplers.PCAExtrapolator.extrapolate")(points, param\_dict) | Extrapolate at specified point of interest given a set of variational parameters. |
| [`factory`](#qiskit.chemistry.algorithms.pes_samplers.PCAExtrapolator.factory "qiskit.chemistry.algorithms.pes_samplers.PCAExtrapolator.factory")(mode, \*\*kwargs) | Factory method for constructing extrapolators. |
### extrapolate
<Function id="qiskit.chemistry.algorithms.pes_samplers.PCAExtrapolator.extrapolate" signature="extrapolate(points, param_dict)">
Extrapolate at specified point of interest given a set of variational parameters. This method transforms the parameters in PCA space before performing the internal extrapolation. The parameters are transformed back to regular space after 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
* **the value is a list of the variational parameters.** (*and*)
**Return type**
`Dict`\[`float`, `List`\[`float`]]
**Returns**
Dictionary of variational parameters for extrapolated point(s).
</Function>
### factory
<Function id="qiskit.chemistry.algorithms.pes_samplers.PCAExtrapolator.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>
</Class>