qiskit_nature/properties/second_quantization/electronic/integrals/two_body_electronic_integrals.py
def transform_basis(self, transform: ElectronicBasisTransform) -> "TwoBodyElectronicIntegrals":
        """Transforms the integrals according to the given transform object.

        If the integrals are already in the correct basis, ``self`` is returned.

        Args:
            transform: the transformation object with the integral coefficients.

        Returns:
            The transformed ``ElectronicIntegrals``.

        Raises:
            QiskitNatureError: if the integrals do not match
                ``ElectronicBasisTransform.initial_basis``.
        """
        if self._basis == transform.final_basis:
            return self

        if self._basis != transform.initial_basis:
            raise QiskitNatureError(
                f"The integrals' basis, {self._basis}, does not match the initial basis of the "
                f"transform, {transform.initial_basis}."
            )

        coeff_alpha = transform.coeff_alpha
        coeff_beta = transform.coeff_beta

        coeff_list = [
            (coeff_alpha, coeff_alpha, coeff_alpha, coeff_alpha),
            (coeff_beta, coeff_beta, coeff_alpha, coeff_alpha),
            (coeff_beta, coeff_beta, coeff_beta, coeff_beta),
            (coeff_alpha, coeff_alpha, coeff_beta, coeff_beta),
        ]
        matrices: List[Optional[np.ndarray]] = []
        for mat, coeffs in zip(self._matrices, coeff_list):
            if mat is None:
                matrices.append(None)
                continue
            matrices.append(np.einsum(self.EINSUM_AO_TO_MO, mat, *coeffs))

        return TwoBodyElectronicIntegrals(transform.final_basis, tuple(matrices))
Transforms the integrals according to the given transform object.

        If the integrals are already in the correct basis, ``self`` is returned.

        Args:
            transform: the transformation object with the integral coefficients.

        Returns:
            The transformed ``ElectronicIntegrals``.

        Raises:
            QiskitNatureError: if the integrals do not match
                ``ElectronicBasisTransform.initial_basis``.
        
Transforms the integrals according to the given transform object.
If the integrals are already in the correct basis, ``self`` is returned.
Transforms the integrals according to the given transform object . If the integrals are already in the correct basis ` ` self ` ` is returned .
def transform_basis(self, transform: ElectronicBasisTransform) -> "TwoBodyElectronicIntegrals":
        if self._basis == transform.final_basis:
            return self
        if self._basis != transform.initial_basis:
            raise QiskitNatureError(
                f"The integrals' basis, {self._basis}, does not match the initial basis of the "
                f"transform, {transform.initial_basis}."
            )
        coeff_alpha = transform.coeff_alpha
        coeff_beta = transform.coeff_beta
        coeff_list = [
            (coeff_alpha, coeff_alpha, coeff_alpha, coeff_alpha),
            (coeff_beta, coeff_beta, coeff_alpha, coeff_alpha),
            (coeff_beta, coeff_beta, coeff_beta, coeff_beta),
            (coeff_alpha, coeff_alpha, coeff_beta, coeff_beta),
        ]
        matrices: List[Optional[np.ndarray]] = []
        for mat, coeffs in zip(self._matrices, coeff_list):
            if mat is None:
                matrices.append(None)
                continue
            matrices.append(np.einsum(self.EINSUM_AO_TO_MO, mat, *coeffs))
        return TwoBodyElectronicIntegrals(transform.final_basis, tuple(matrices))
def transform_basis ( self , transform : ElectronicBasisTransform ) -> "TwoBodyElectronicIntegrals" : if self . _basis == transform . final_basis : return self if self . _basis != transform . initial_basis : raise QiskitNatureError ( f"The integrals' basis, {self._basis}, does not match the initial basis of the " f"transform, {transform.initial_basis}." ) coeff_alpha = transform . coeff_alpha coeff_beta = transform . coeff_beta coeff_list = [ ( coeff_alpha , coeff_alpha , coeff_alpha , coeff_alpha ) , ( coeff_beta , coeff_beta , coeff_alpha , coeff_alpha ) , ( coeff_beta , coeff_beta , coeff_beta , coeff_beta ) , ( coeff_alpha , coeff_alpha , coeff_beta , coeff_beta ) , ] matrices : List [ Optional [ np . ndarray ] ] = [ ] for mat , coeffs in zip ( self . _matrices , coeff_list ) : if mat is None : matrices . append ( None ) continue matrices . append ( np . einsum ( self . EINSUM_AO_TO_MO , mat , * coeffs ) ) return TwoBodyElectronicIntegrals ( transform . final_basis , tuple ( matrices ) )
Transforms the integrals according to the given transform object.
Transforms the integrals according to the given transform object .
"""Transforms the integrals according to the given transform object.

        If the integrals are already in the correct basis, ``self`` is returned.

        Args:
            transform: the transformation object with the integral coefficients.

        Returns:
            The transformed ``ElectronicIntegrals``.

        Raises:
            QiskitNatureError: if the integrals do not match
                ``ElectronicBasisTransform.initial_basis``.
        """
The transformed ``ElectronicIntegrals``.
The transformed ` ` ElectronicIntegrals ` ` .
if the integrals do not match
``ElectronicBasisTransform.initial_basis``.
if the integrals do not match ` ` ElectronicBasisTransform . initial_basis ` ` .
QiskitNatureError
self
transform
ElectronicBasisTransform
the transformation object with the integral coefficients.
the transformation object with the integral coefficients .