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

112 lines
9.9 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: MolecularGroundStateEnergy
description: API reference for qiskit.chemistry.applications.MolecularGroundStateEnergy
in_page_toc_min_heading_level: 1
python_api_type: class
python_api_name: qiskit.chemistry.applications.MolecularGroundStateEnergy
---
# qiskit.chemistry.applications.MolecularGroundStateEnergy
<Class id="qiskit.chemistry.applications.MolecularGroundStateEnergy" isDedicatedPage={true} github="https://github.com/qiskit-community/qiskit-aqua/tree/stable/0.9/qiskit/chemistry/applications/molecular_ground_state_energy.py" signature="MolecularGroundStateEnergy(driver, solver=None, transformation=<TransformationType.FULL: 'full'>, qubit_mapping=<QubitMappingType.PARITY: 'parity'>, two_qubit_reduction=True, freeze_core=False, orbital_reduction=None, z2symmetry_reduction=None)" modifiers="class">
Molecular ground state energy chemistry application
**Parameters**
* **driver** (`FermionicDriver`) Chemistry driver
* **solver** (`Optional`\[`MinimumEigensolver`]) An Aqua MinimumEigensolver. This can be provided on the constructor or via the solver property, or via the callback on [`compute_energy()`](#qiskit.chemistry.applications.MolecularGroundStateEnergy.compute_energy "qiskit.chemistry.applications.MolecularGroundStateEnergy.compute_energy")
* **transformation** (`TransformationType`) full or particle\_hole
* **qubit\_mapping** (`QubitMappingType`) jordan\_wigner, parity or bravyi\_kitaev
* **two\_qubit\_reduction** (`bool`) Whether two qubit reduction should be used, when parity mapping only
* **freeze\_core** (`bool`) Whether to freeze core orbitals when possible
* **orbital\_reduction** (`Optional`\[`List`\[`int`]]) Orbital list to be frozen or removed
* **z2symmetry\_reduction** (`Union`\[`str`, `List`\[`int`], `None`]) If z2 symmetry reduction should be applied to the qubit operators that are computed. Setting auto will use an automatic computation of the correct sector. If from other experiments, with the z2symmetry logic, the sector is known, then the tapering values of that sector can be provided (a list of int of values -1, and 1). The default is None meaning no symmetry reduction is done. See also [`Hamiltonian`](qiskit.chemistry.core.Hamiltonian "qiskit.chemistry.core.Hamiltonian") which has the core processing behind this class.
### \_\_init\_\_
<Function id="qiskit.chemistry.applications.MolecularGroundStateEnergy.__init__" signature="__init__(driver, solver=None, transformation=<TransformationType.FULL: 'full'>, qubit_mapping=<QubitMappingType.PARITY: 'parity'>, two_qubit_reduction=True, freeze_core=False, orbital_reduction=None, z2symmetry_reduction=None)">
**Parameters**
* **driver** (`FermionicDriver`) Chemistry driver
* **solver** (`Optional`\[`MinimumEigensolver`]) An Aqua MinimumEigensolver. This can be provided on the constructor or via the solver property, or via the callback on [`compute_energy()`](#qiskit.chemistry.applications.MolecularGroundStateEnergy.compute_energy "qiskit.chemistry.applications.MolecularGroundStateEnergy.compute_energy")
* **transformation** (`TransformationType`) full or particle\_hole
* **qubit\_mapping** (`QubitMappingType`) jordan\_wigner, parity or bravyi\_kitaev
* **two\_qubit\_reduction** (`bool`) Whether two qubit reduction should be used, when parity mapping only
* **freeze\_core** (`bool`) Whether to freeze core orbitals when possible
* **orbital\_reduction** (`Optional`\[`List`\[`int`]]) Orbital list to be frozen or removed
* **z2symmetry\_reduction** (`Union`\[`str`, `List`\[`int`], `None`]) If z2 symmetry reduction should be applied to the qubit operators that are computed. Setting auto will use an automatic computation of the correct sector. If from other experiments, with the z2symmetry logic, the sector is known, then the tapering values of that sector can be provided (a list of int of values -1, and 1). The default is None meaning no symmetry reduction is done. See also [`Hamiltonian`](qiskit.chemistry.core.Hamiltonian "qiskit.chemistry.core.Hamiltonian") which has the core processing behind this class.
</Function>
## Methods
| | |
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [`__init__`](#qiskit.chemistry.applications.MolecularGroundStateEnergy.__init__ "qiskit.chemistry.applications.MolecularGroundStateEnergy.__init__")(driver\[, solver, transformation, …]) | **type driver**`FermionicDriver` |
| [`compute_energy`](#qiskit.chemistry.applications.MolecularGroundStateEnergy.compute_energy "qiskit.chemistry.applications.MolecularGroundStateEnergy.compute_energy")(\[callback]) | Compute the ground state energy of the molecule that was supplied via the driver |
| [`get_default_solver`](#qiskit.chemistry.applications.MolecularGroundStateEnergy.get_default_solver "qiskit.chemistry.applications.MolecularGroundStateEnergy.get_default_solver")(quantum\_instance) | Get the default solver callback that can be used with [`compute_energy()`](#qiskit.chemistry.applications.MolecularGroundStateEnergy.compute_energy "qiskit.chemistry.applications.MolecularGroundStateEnergy.compute_energy") :type quantum\_instance: `Union`\[`QuantumInstance`, `Backend`, `BaseBackend`] :param quantum\_instance: A Backend/Quantum Instance for the solver to run on |
## Attributes
| | |
| ---------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------- |
| [`driver`](#qiskit.chemistry.applications.MolecularGroundStateEnergy.driver "qiskit.chemistry.applications.MolecularGroundStateEnergy.driver") | Returns chemistry driver |
| [`solver`](#qiskit.chemistry.applications.MolecularGroundStateEnergy.solver "qiskit.chemistry.applications.MolecularGroundStateEnergy.solver") | Returns minimum eigen solver |
### compute\_energy
<Function id="qiskit.chemistry.applications.MolecularGroundStateEnergy.compute_energy" signature="compute_energy(callback=None)">
Compute the ground state energy of the molecule that was supplied via the driver
**Parameters**
**callback** (`Optional`\[`Callable`\[\[`List`, `int`, `str`, `bool`, `Z2Symmetries`], `MinimumEigensolver`]]) If not None will be called with the following values num\_particles, num\_orbitals, qubit\_mapping, two\_qubit\_reduction, z2\_symmetries in that order. This information can then be used to setup chemistry specific component(s) that are needed by the chosen MinimumEigensolver. The MinimumEigensolver can then be built and returned from this callback for use as the solver here.
**Return type**
`MolecularGroundStateResult`
**Returns**
A molecular ground state result
**Raises**
[**QiskitChemistryError**](qiskit.chemistry.QiskitChemistryError "qiskit.chemistry.QiskitChemistryError") If no MinimumEigensolver was given and no callback is being used that could supply one instead.
</Function>
### driver
<Attribute id="qiskit.chemistry.applications.MolecularGroundStateEnergy.driver">
Returns chemistry driver
**Return type**
`FermionicDriver`
</Attribute>
### get\_default\_solver
<Function id="qiskit.chemistry.applications.MolecularGroundStateEnergy.get_default_solver" signature="get_default_solver(quantum_instance)" modifiers="static">
Get the default solver callback that can be used with [`compute_energy()`](#qiskit.chemistry.applications.MolecularGroundStateEnergy.compute_energy "qiskit.chemistry.applications.MolecularGroundStateEnergy.compute_energy") :type quantum\_instance: `Union`\[`QuantumInstance`, `Backend`, `BaseBackend`] :param quantum\_instance: A Backend/Quantum Instance for the solver to run on
**Return type**
`Optional`\[`Callable`\[\[`List`, `int`, `str`, `bool`, `Z2Symmetries`], `MinimumEigensolver`]]
**Returns**
Default solver callback
</Function>
### solver
<Attribute id="qiskit.chemistry.applications.MolecularGroundStateEnergy.solver">
Returns minimum eigen solver
**Return type**
`MinimumEigensolver`
</Attribute>
</Class>