Skip to main contentIBM Quantum Documentation
This page is from an old version of Qiskit SDK and does not exist in the latest version. We recommend you migrate to the latest version. See the release notes for more information.

qiskit.chemistry.core.Hamiltonian

class Hamiltonian(transformation=<TransformationType.FULL: 'full'>, qubit_mapping=<QubitMappingType.PARITY: 'parity'>, two_qubit_reduction=True, freeze_core=False, orbital_reduction=None, z2symmetry_reduction=None)

GitHub

A molecular Hamiltonian operator, representing the energy of the electrons and nuclei in a molecule.

Parameters

  • 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 resulting qubit operators that are computed. For each symmetry detected the operator will be split in two where each requires one qubit less for computation. So for example 3 symmetries will split in the original operator into 8 new operators each requiring 3 less qubits. Now only one of these operators will have the ground state and be the correct symmetry sector needed for the ground state. 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. Note that dipole and other operators such as spin, num particles etc are also symmetry reduced according to the symmetries found in the main operator if this operator commutes with the main operator symmetry. If it does not then the operator will be discarded since no meaningful measurement can take place.

Raises

QiskitChemistryError – Invalid symmetry reduction

__init__

__init__(transformation=<TransformationType.FULL: 'full'>, qubit_mapping=<QubitMappingType.PARITY: 'parity'>, two_qubit_reduction=True, freeze_core=False, orbital_reduction=None, z2symmetry_reduction=None)

Parameters

  • 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 resulting qubit operators that are computed. For each symmetry detected the operator will be split in two where each requires one qubit less for computation. So for example 3 symmetries will split in the original operator into 8 new operators each requiring 3 less qubits. Now only one of these operators will have the ground state and be the correct symmetry sector needed for the ground state. 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. Note that dipole and other operators such as spin, num particles etc are also symmetry reduced according to the symmetries found in the main operator if this operator commutes with the main operator symmetry. If it does not then the operator will be discarded since no meaningful measurement can take place.

Raises

QiskitChemistryError – Invalid symmetry reduction


Methods

__init__([transformation, qubit_mapping, …])type transformationTransformationType
process_algorithm_result(algo_result)Takes the algorithm result and processes it as required, e.g.
run(qmolecule)run method

Attributes

INFO_NUM_ORBITALS
INFO_NUM_PARTICLES
INFO_TWO_QUBIT_REDUCTION
INFO_Z2SYMMETRIES
molecule_inforeturns molecule info

molecule_info

returns molecule info

process_algorithm_result

process_algorithm_result(algo_result)

Takes the algorithm result and processes it as required, e.g. by combination of any parts that were classically computed, for the final result.

Parameters

algo_result (Union[dict, MinimumEigensolverResult, EigensolverResult]) – Result from algorithm

Return type

Union[Tuple[List[str], dict], MolecularGroundStateResult, MolecularExcitedStatesResult]

Returns

Final chemistry result computed from the algorithm result

run

run(qmolecule)

run method

Return type

Tuple[WeightedPauliOperator, List[WeightedPauliOperator]]

Was this page helpful?
Report a bug or request content on GitHub.