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

155 lines
9.2 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: BosonicTransformation
description: API reference for qiskit.chemistry.transformations.BosonicTransformation
in_page_toc_min_heading_level: 1
python_api_type: class
python_api_name: qiskit.chemistry.transformations.BosonicTransformation
---
# qiskit.chemistry.transformations.BosonicTransformation
<Class id="qiskit.chemistry.transformations.BosonicTransformation" isDedicatedPage={true} github="https://github.com/qiskit-community/qiskit-aqua/tree/stable/0.9/qiskit/chemistry/transformations/bosonic_transformation.py" signature="BosonicTransformation(qubit_mapping=<BosonicQubitMappingType.DIRECT: 'direct'>, transformation_type=<BosonicTransformationType.HARMONIC: 'harmonic'>, basis_size=2, truncation=3)" modifiers="class">
A vibronic Hamiltonian operator representing the energy of the nuclei in the molecule
**Parameters**
* **qubit\_mapping** (`BosonicQubitMappingType`) a string giving the type of mapping (only the direct mapping is implemented at this point)
* **transformation\_type** (`BosonicTransformationType`) a string giving the modal basis. The Hamiltonian is expressed in this basis.
* **basis\_size** (`Union`\[`int`, `List`\[`int`]]) define the number of modals per mode. If the number of modals is the same for each mode, then only an int is required. However, if the number of modals differ depending on the mode basis\_size should be a list of int, for example: \[3,4] means 2 modes: first mode has 3 modals, second mode has 4 modals.
* **truncation** (`int`) where is the Hamiltonian expansion truncation (1 for having only 1-body terms, 2 for having on 1- and 2-body terms…)
### \_\_init\_\_
<Function id="qiskit.chemistry.transformations.BosonicTransformation.__init__" signature="__init__(qubit_mapping=<BosonicQubitMappingType.DIRECT: 'direct'>, transformation_type=<BosonicTransformationType.HARMONIC: 'harmonic'>, basis_size=2, truncation=3)">
**Parameters**
* **qubit\_mapping** (`BosonicQubitMappingType`) a string giving the type of mapping (only the direct mapping is implemented at this point)
* **transformation\_type** (`BosonicTransformationType`) a string giving the modal basis. The Hamiltonian is expressed in this basis.
* **basis\_size** (`Union`\[`int`, `List`\[`int`]]) define the number of modals per mode. If the number of modals is the same for each mode, then only an int is required. However, if the number of modals differ depending on the mode basis\_size should be a list of int, for example: \[3,4] means 2 modes: first mode has 3 modals, second mode has 4 modals.
* **truncation** (`int`) where is the Hamiltonian expansion truncation (1 for having only 1-body terms, 2 for having on 1- and 2-body terms…)
</Function>
## Methods
| | |
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- |
| [`__init__`](#qiskit.chemistry.transformations.BosonicTransformation.__init__ "qiskit.chemistry.transformations.BosonicTransformation.__init__")(\[qubit\_mapping, …]) | **type qubit\_mapping**`BosonicQubitMappingType` |
| [`build_hopping_operators`](#qiskit.chemistry.transformations.BosonicTransformation.build_hopping_operators "qiskit.chemistry.transformations.BosonicTransformation.build_hopping_operators")(\[excitations]) | **type excitations**`Union`\[`str`, `List`\[`List`\[`int`]]] |
| [`get_default_filter_criterion`](#qiskit.chemistry.transformations.BosonicTransformation.get_default_filter_criterion "qiskit.chemistry.transformations.BosonicTransformation.get_default_filter_criterion")() | Returns a default filter criterion method to filter the eigenvalues computed by the eigen solver. |
| [`interpret`](#qiskit.chemistry.transformations.BosonicTransformation.interpret "qiskit.chemistry.transformations.BosonicTransformation.interpret")(raw\_result) | Interprets an EigenstateResult in the context of this transformation. |
| [`transform`](#qiskit.chemistry.transformations.BosonicTransformation.transform "qiskit.chemistry.transformations.BosonicTransformation.transform")(driver\[, aux\_operators]) | Transformation to qubit operator from the driver |
## Attributes
| | |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | --------------------------------------------- |
| [`basis`](#qiskit.chemistry.transformations.BosonicTransformation.basis "qiskit.chemistry.transformations.BosonicTransformation.basis") | returns the basis (number of modals per mode) |
| [`commutation_rule`](#qiskit.chemistry.transformations.BosonicTransformation.commutation_rule "qiskit.chemistry.transformations.BosonicTransformation.commutation_rule") | Getter of the commutation rule |
| [`num_modes`](#qiskit.chemistry.transformations.BosonicTransformation.num_modes "qiskit.chemistry.transformations.BosonicTransformation.num_modes") | the number of modes |
| [`untapered_qubit_op`](#qiskit.chemistry.transformations.BosonicTransformation.untapered_qubit_op "qiskit.chemistry.transformations.BosonicTransformation.untapered_qubit_op") | Getter for the untapered qubit operator |
### basis
<Attribute id="qiskit.chemistry.transformations.BosonicTransformation.basis">
returns the basis (number of modals per mode)
**Return type**
`Union`\[`int`, `List`\[`int`]]
</Attribute>
### build\_hopping\_operators
<Function id="qiskit.chemistry.transformations.BosonicTransformation.build_hopping_operators" signature="build_hopping_operators(excitations='sd')">
**Parameters**
**excitations** (`Union`\[`str`, `List`\[`List`\[`int`]]])
**Return type**
`Tuple`\[`Dict`\[`str`, `WeightedPauliOperator`], `Dict`, `Dict`\[`str`, `List`\[`List`\[`int`]]]]
**Returns**
Dict of hopping operators, dict of commutativity types and dict of excitation indices
</Function>
### commutation\_rule
<Attribute id="qiskit.chemistry.transformations.BosonicTransformation.commutation_rule">
Getter of the commutation rule
**Return type**
`bool`
</Attribute>
### get\_default\_filter\_criterion
<Function id="qiskit.chemistry.transformations.BosonicTransformation.get_default_filter_criterion" signature="get_default_filter_criterion()">
Returns a default filter criterion method to filter the eigenvalues computed by the eigen solver. For more information see also aqua.algorithms.eigen\_solvers.NumPyEigensolver.filter\_criterion. In the fermionic case the default filter ensures that the number of particles is being preserved.
**Return type**
`Optional`\[`Callable`\[\[`Union`\[`List`, `ndarray`], `float`, `Optional`\[`List`\[`float`]]], `bool`]]
</Function>
### interpret
<Function id="qiskit.chemistry.transformations.BosonicTransformation.interpret" signature="interpret(raw_result)">
Interprets an EigenstateResult in the context of this transformation.
**Parameters**
**raw\_result** (`Union`\[`EigenstateResult`, `EigensolverResult`, `MinimumEigensolverResult`]) an eigenstate result object.
**Return type**
`VibronicStructureResult`
**Returns**
An vibronic structure result.
</Function>
### num\_modes
<Attribute id="qiskit.chemistry.transformations.BosonicTransformation.num_modes">
the number of modes
**Type**
Returns
**Return type**
`int`
</Attribute>
### transform
<Function id="qiskit.chemistry.transformations.BosonicTransformation.transform" signature="transform(driver, aux_operators=None)">
Transformation to qubit operator from the driver
**Parameters**
* **driver** (`BaseDriver`) BaseDriver
* **aux\_operators** (`Optional`\[`List`\[`Any`]]) Optional additional aux ops to evaluate
**Return type**
`Tuple`\[`WeightedPauliOperator`, `List`\[`WeightedPauliOperator`]]
**Returns**
qubit operator, auxiliary operators
</Function>
### untapered\_qubit\_op
<Attribute id="qiskit.chemistry.transformations.BosonicTransformation.untapered_qubit_op">
Getter for the untapered qubit operator
</Attribute>
</Class>