qiskit_nature/properties/second_quantization/electronic/electronic_energy.py
def from_legacy_driver_result(cls, result: LegacyDriverResult) -> "ElectronicEnergy":
        """Construct an ElectronicEnergy instance from a QMolecule.

        Args:
            result: the driver result from which to extract the raw data. For this property, a
                QMolecule is required!

        Returns:
            An instance of this property.

        Raises:
            QiskitNatureError: if a WatsonHamiltonian is provided.
        """
        cls._validate_input_type(result, LegacyElectronicStructureDriverResult)

        qmol = cast(QMolecule, result)

        energy_shift = qmol.energy_shift.copy()

        integrals: List[ElectronicIntegrals] = []
        if qmol.hcore is not None:
            integrals.append(
                OneBodyElectronicIntegrals(ElectronicBasis.AO, (qmol.hcore, qmol.hcore_b))
            )
        if qmol.eri is not None:
            integrals.append(
                TwoBodyElectronicIntegrals(ElectronicBasis.AO, (qmol.eri, None, None, None))
            )
        if qmol.mo_onee_ints is not None:
            integrals.append(
                OneBodyElectronicIntegrals(
                    ElectronicBasis.MO, (qmol.mo_onee_ints, qmol.mo_onee_ints_b)
                )
            )
        if qmol.mo_eri_ints is not None:
            integrals.append(
                TwoBodyElectronicIntegrals(
                    ElectronicBasis.MO,
                    (qmol.mo_eri_ints, qmol.mo_eri_ints_ba, qmol.mo_eri_ints_bb, None),
                )
            )

        ret = cls(
            integrals,
            energy_shift=energy_shift,
            nuclear_repulsion_energy=qmol.nuclear_repulsion_energy,
            reference_energy=qmol.hf_energy,
        )

        orb_energies = qmol.orbital_energies
        if qmol.orbital_energies_b is not None:
            orb_energies = np.asarray((qmol.orbital_energies, qmol.orbital_energies_b))
        ret.orbital_energies = orb_energies

        if qmol.kinetic is not None:
            ret.kinetic = OneBodyElectronicIntegrals(ElectronicBasis.AO, (qmol.kinetic, None))

        if qmol.overlap is not None:
            ret.overlap = OneBodyElectronicIntegrals(ElectronicBasis.AO, (qmol.overlap, None))

        return ret
Construct an ElectronicEnergy instance from a QMolecule.

        Args:
            result: the driver result from which to extract the raw data. For this property, a
                QMolecule is required!

        Returns:
            An instance of this property.

        Raises:
            QiskitNatureError: if a WatsonHamiltonian is provided.
        
Construct an ElectronicEnergy instance from a QMolecule.
Construct an ElectronicEnergy instance from a QMolecule .
def from_legacy_driver_result(cls, result: LegacyDriverResult) -> "ElectronicEnergy":
        cls._validate_input_type(result, LegacyElectronicStructureDriverResult)
        qmol = cast(QMolecule, result)
        energy_shift = qmol.energy_shift.copy()
        integrals: List[ElectronicIntegrals] = []
        if qmol.hcore is not None:
            integrals.append(
                OneBodyElectronicIntegrals(ElectronicBasis.AO, (qmol.hcore, qmol.hcore_b))
            )
        if qmol.eri is not None:
            integrals.append(
                TwoBodyElectronicIntegrals(ElectronicBasis.AO, (qmol.eri, None, None, None))
            )
        if qmol.mo_onee_ints is not None:
            integrals.append(
                OneBodyElectronicIntegrals(
                    ElectronicBasis.MO, (qmol.mo_onee_ints, qmol.mo_onee_ints_b)
                )
            )
        if qmol.mo_eri_ints is not None:
            integrals.append(
                TwoBodyElectronicIntegrals(
                    ElectronicBasis.MO,
                    (qmol.mo_eri_ints, qmol.mo_eri_ints_ba, qmol.mo_eri_ints_bb, None),
                )
            )
        ret = cls(
            integrals,
            energy_shift=energy_shift,
            nuclear_repulsion_energy=qmol.nuclear_repulsion_energy,
            reference_energy=qmol.hf_energy,
        )
        orb_energies = qmol.orbital_energies
        if qmol.orbital_energies_b is not None:
            orb_energies = np.asarray((qmol.orbital_energies, qmol.orbital_energies_b))
        ret.orbital_energies = orb_energies
        if qmol.kinetic is not None:
            ret.kinetic = OneBodyElectronicIntegrals(ElectronicBasis.AO, (qmol.kinetic, None))
        if qmol.overlap is not None:
            ret.overlap = OneBodyElectronicIntegrals(ElectronicBasis.AO, (qmol.overlap, None))
        return ret
def from_legacy_driver_result ( cls , result : LegacyDriverResult ) -> "ElectronicEnergy" : cls . _validate_input_type ( result , LegacyElectronicStructureDriverResult ) qmol = cast ( QMolecule , result ) energy_shift = qmol . energy_shift . copy ( ) integrals : List [ ElectronicIntegrals ] = [ ] if qmol . hcore is not None : integrals . append ( OneBodyElectronicIntegrals ( ElectronicBasis . AO , ( qmol . hcore , qmol . hcore_b ) ) ) if qmol . eri is not None : integrals . append ( TwoBodyElectronicIntegrals ( ElectronicBasis . AO , ( qmol . eri , None , None , None ) ) ) if qmol . mo_onee_ints is not None : integrals . append ( OneBodyElectronicIntegrals ( ElectronicBasis . MO , ( qmol . mo_onee_ints , qmol . mo_onee_ints_b ) ) ) if qmol . mo_eri_ints is not None : integrals . append ( TwoBodyElectronicIntegrals ( ElectronicBasis . MO , ( qmol . mo_eri_ints , qmol . mo_eri_ints_ba , qmol . mo_eri_ints_bb , None ) , ) ) ret = cls ( integrals , energy_shift = energy_shift , nuclear_repulsion_energy = qmol . nuclear_repulsion_energy , reference_energy = qmol . hf_energy , ) orb_energies = qmol . orbital_energies if qmol . orbital_energies_b is not None : orb_energies = np . asarray ( ( qmol . orbital_energies , qmol . orbital_energies_b ) ) ret . orbital_energies = orb_energies if qmol . kinetic is not None : ret . kinetic = OneBodyElectronicIntegrals ( ElectronicBasis . AO , ( qmol . kinetic , None ) ) if qmol . overlap is not None : ret . overlap = OneBodyElectronicIntegrals ( ElectronicBasis . AO , ( qmol . overlap , None ) ) return ret
Construct an ElectronicEnergy instance from a QMolecule.
Construct an ElectronicEnergy instance from a QMolecule .
"""Construct an ElectronicEnergy instance from a QMolecule.

        Args:
            result: the driver result from which to extract the raw data. For this property, a
                QMolecule is required!

        Returns:
            An instance of this property.

        Raises:
            QiskitNatureError: if a WatsonHamiltonian is provided.
        """
An instance of this property.
An instance of this property .
if a WatsonHamiltonian is provided.
if a WatsonHamiltonian is provided .
QiskitNatureError
cls
result
LegacyDriverResult
the driver result from which to extract the raw data. For this property, a
QMolecule is required!
the driver result from which to extract the raw data . For this property a QMolecule is required!