qrunch.chemistry.qrackle.integrals.exact_exchange_calculator_protocol

Protocol for exact-exchange-matrix calculators.

An exact-exchange calculator computes the Hartree-Fock exchange matrix (K matrix) from a given density matrix. It supports both restricted (single density matrix) and unrestricted (alpha/beta density matrices) calculations.

Classes

ExactExchangeCalculatorProtocol

Protocol for objects that compute exact-exchange matrices.

class ExactExchangeCalculatorProtocol

Bases: Protocol, Generic[TMatrix, TVector_co]

Protocol for objects that compute exact-exchange matrices.

The optional omega parameter selects a range-separated Coulomb kernel. None evaluates full-range exchange. Positive values evaluate the long-range erf(omega * r12) / r12 exchange kernel. Implementations may also support negative values for the complementary short-range kernel.

__init__(*args, **kwargs)
compute_restricted(density_matrix: RestrictedMatrix[TMatrix], molecular_configuration: MolecularConfiguration, *, omega: float | None = None) → RestrictedMatrix[TMatrix]

Compute an exchange matrix from a restricted density matrix.

Parameters:
  • density_matrix (RestrictedMatrix[TMatrix]) – The total density matrix in the AO basis.

  • molecular_configuration (MolecularConfiguration) – The molecular configuration.

  • omega (float | None) – Range-separation parameter. Use None for full-range exchange.

Return type:

RestrictedMatrix[TMatrix]

compute_restricted_many(density_matrices: list[RestrictedMatrix[TMatrix]], molecular_configuration: MolecularConfiguration, *, omega: float | None = None) → list[RestrictedMatrix[TMatrix]]

Compute exchange matrices for several restricted density matrices.

Parameters:
  • density_matrices (list[RestrictedMatrix[TMatrix]]) – Restricted density matrices in the AO basis.

  • molecular_configuration (MolecularConfiguration) – The molecular configuration.

  • omega (float | None) – Range-separation parameter. Use None for full-range exchange.

Return type:

list[RestrictedMatrix[TMatrix]]

compute_unrestricted(density_matrix: UnrestrictedMatrix[TMatrix], molecular_configuration: MolecularConfiguration, *, omega: float | None = None) → UnrestrictedMatrix[TMatrix]

Compute exchange matrices from an unrestricted density matrix.

Unlike the Coulomb matrix, the exchange matrix for each spin channel depends only on that channel’s own density.

Parameters:
  • density_matrix (UnrestrictedMatrix[TMatrix]) – The unrestricted density matrix holding alpha and beta components.

  • molecular_configuration (MolecularConfiguration) – The molecular configuration.

  • omega (float | None) – Range-separation parameter. Use None for full-range exchange.

Return type:

UnrestrictedMatrix[TMatrix]

compute_unrestricted_many(density_matrices: list[UnrestrictedMatrix[TMatrix]], molecular_configuration: MolecularConfiguration, *, omega: float | None = None) → list[UnrestrictedMatrix[TMatrix]]

Compute exchange matrices for several unrestricted density matrices.

Parameters:
  • density_matrices (list[UnrestrictedMatrix[TMatrix]]) – Unrestricted density matrices in the AO basis.

  • molecular_configuration (MolecularConfiguration) – The molecular configuration.

  • omega (float | None) – Range-separation parameter. Use None for full-range exchange.

Return type:

list[UnrestrictedMatrix[TMatrix]]