qiskit_nature/properties/second_quantization/electronic/integrals/two_body_electronic_integrals.py
def compose(
        self, other: ElectronicIntegrals, einsum_subscript: Optional[str] = None
    ) -> OneBodyElectronicIntegrals:
        """Composes these TwoBodyElectronicIntegrals with an instance of OneBodyElectronicIntegrals.

        This method requires an `einsum_subscript` subscript and produces a new instance of
        OneBodyElectronicIntegrals.

        Args:
            other: an instance of OneBodyElectronicIntegrals.
            einsum_subscript: an additional `np.einsum` subscript.

        Returns:
            The resulting OneBodyElectronicIntegrals.

        Raises:
            TypeError: if `other` is not an `OneBodyElectronicIntegrals` instance.
            ValueError: if the bases of `self` and `other` do not match or if `einsum_subscript` is
                `None`.
            NotImplementedError: if the basis of `self` is not `ElectronicBasis.AO`.
        """
        if einsum_subscript is None:
            raise ValueError(
                "TwoBodyElectronicIntegrals.compose requires an Einsum summation convention "
                "(`einsum_subscript`) in order to evaluate the composition! It may not be `None`."
            )

        if not isinstance(other, OneBodyElectronicIntegrals):
            raise TypeError(
                "TwoBodyElectronicIntegrals.compose expected an `OneBodyElectronicIntegrals` object"
                f" and not one of type {type(other)}."
            )

        if self._basis != other._basis:
            raise ValueError(
                f"The basis of self, {self._basis.value}, does not match the basis of other, "
                f"{other._basis}!"
            )

        if self._basis != ElectronicBasis.AO:
            raise NotImplementedError(
                "TwoBodyElectronicIntegrals.compose is not yet implemented for integrals in a basis"
                " other than the AO basis!"
            )

        eri = self._matrices[0]

        alpha = np.einsum(einsum_subscript, eri, other._matrices[0])
        beta = None
        if other._matrices[1] is not None:
            beta = np.einsum(einsum_subscript, eri, other._matrices[1])

        return OneBodyElectronicIntegrals(self._basis, (alpha, beta), self._threshold)
Composes these TwoBodyElectronicIntegrals with an instance of OneBodyElectronicIntegrals.

        This method requires an `einsum_subscript` subscript and produces a new instance of
        OneBodyElectronicIntegrals.

        Args:
            other: an instance of OneBodyElectronicIntegrals.
            einsum_subscript: an additional `np.einsum` subscript.

        Returns:
            The resulting OneBodyElectronicIntegrals.

        Raises:
            TypeError: if `other` is not an `OneBodyElectronicIntegrals` instance.
            ValueError: if the bases of `self` and `other` do not match or if `einsum_subscript` is
                `None`.
            NotImplementedError: if the basis of `self` is not `ElectronicBasis.AO`.
        
Composes these TwoBodyElectronicIntegrals with an instance of OneBodyElectronicIntegrals.
This method requires an `einsum_subscript` subscript and produces a new instance of
OneBodyElectronicIntegrals.
Composes these TwoBodyElectronicIntegrals with an instance of OneBodyElectronicIntegrals . This method requires an ` einsum_subscript ` subscript and produces a new instance of OneBodyElectronicIntegrals .
def compose(
        self, other: ElectronicIntegrals, einsum_subscript: Optional[str] = None
    ) -> OneBodyElectronicIntegrals:
        if einsum_subscript is None:
            raise ValueError(
                "TwoBodyElectronicIntegrals.compose requires an Einsum summation convention "
                "(`einsum_subscript`) in order to evaluate the composition! It may not be `None`."
            )
        if not isinstance(other, OneBodyElectronicIntegrals):
            raise TypeError(
                "TwoBodyElectronicIntegrals.compose expected an `OneBodyElectronicIntegrals` object"
                f" and not one of type {type(other)}."
            )
        if self._basis != other._basis:
            raise ValueError(
                f"The basis of self, {self._basis.value}, does not match the basis of other, "
                f"{other._basis}!"
            )
        if self._basis != ElectronicBasis.AO:
            raise NotImplementedError(
                "TwoBodyElectronicIntegrals.compose is not yet implemented for integrals in a basis"
                " other than the AO basis!"
            )
        eri = self._matrices[0]
        alpha = np.einsum(einsum_subscript, eri, other._matrices[0])
        beta = None
        if other._matrices[1] is not None:
            beta = np.einsum(einsum_subscript, eri, other._matrices[1])
        return OneBodyElectronicIntegrals(self._basis, (alpha, beta), self._threshold)
def compose ( self , other : ElectronicIntegrals , einsum_subscript : Optional [ str ] = None ) -> OneBodyElectronicIntegrals : if einsum_subscript is None : raise ValueError ( "TwoBodyElectronicIntegrals.compose requires an Einsum summation convention " "(`einsum_subscript`) in order to evaluate the composition! It may not be `None`." ) if not isinstance ( other , OneBodyElectronicIntegrals ) : raise TypeError ( "TwoBodyElectronicIntegrals.compose expected an `OneBodyElectronicIntegrals` object" f" and not one of type {type(other)}." ) if self . _basis != other . _basis : raise ValueError ( f"The basis of self, {self._basis.value}, does not match the basis of other, " f"{other._basis}!" ) if self . _basis != ElectronicBasis . AO : raise NotImplementedError ( "TwoBodyElectronicIntegrals.compose is not yet implemented for integrals in a basis" " other than the AO basis!" ) eri = self . _matrices [ 0 ] alpha = np . einsum ( einsum_subscript , eri , other . _matrices [ 0 ] ) beta = None if other . _matrices [ 1 ] is not None : beta = np . einsum ( einsum_subscript , eri , other . _matrices [ 1 ] ) return OneBodyElectronicIntegrals ( self . _basis , ( alpha , beta ) , self . _threshold )
Composes these TwoBodyElectronicIntegrals with an instance of OneBodyElectronicIntegrals.
Composes these TwoBodyElectronicIntegrals with an instance of OneBodyElectronicIntegrals .
"""Composes these TwoBodyElectronicIntegrals with an instance of OneBodyElectronicIntegrals.

        This method requires an `einsum_subscript` subscript and produces a new instance of
        OneBodyElectronicIntegrals.

        Args:
            other: an instance of OneBodyElectronicIntegrals.
            einsum_subscript: an additional `np.einsum` subscript.

        Returns:
            The resulting OneBodyElectronicIntegrals.

        Raises:
            TypeError: if `other` is not an `OneBodyElectronicIntegrals` instance.
            ValueError: if the bases of `self` and `other` do not match or if `einsum_subscript` is
                `None`.
            NotImplementedError: if the basis of `self` is not `ElectronicBasis.AO`.
        """
The resulting OneBodyElectronicIntegrals.
The resulting OneBodyElectronicIntegrals .
if `other` is not an `OneBodyElectronicIntegrals` instance.
if ` other ` is not an ` OneBodyElectronicIntegrals ` instance .
TypeError
if the bases of `self` and `other` do not match or if `einsum_subscript` is
`None`.
if the bases of ` self ` and ` other ` do not match or if ` einsum_subscript ` is ` None ` .
ValueError
if the basis of `self` is not `ElectronicBasis.AO`.
if the basis of ` self ` is not ` ElectronicBasis . AO ` .
NotImplementedError
self
other
ElectronicIntegrals
an instance of OneBodyElectronicIntegrals.
an instance of OneBodyElectronicIntegrals .
einsum_subscript
Optional[str]
an additional `np.einsum` subscript.
an additional ` np . einsum ` subscript .