MolecularGroundStateEnergy
class 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)
Bases: object
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 oncompute_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 alsoHamiltonian
which has the core processing behind this class.
Methods
compute_energy
MolecularGroundStateEnergy.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 – If no MinimumEigensolver was given and no callback is being used that could supply one instead.
get_default_solver
static MolecularGroundStateEnergy.get_default_solver(quantum_instance)
Get the default solver callback that can be used with 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
Attributes
driver
Returns chemistry driver
Return type
FermionicDriver
solver
Returns minimum eigen solver
Return type
MinimumEigensolver