qrunch.chemistry.qrackle.integrals.pyscf_exchange_correlation_calculator
PySCF-backed exchange-correlation functional evaluation.
Functions
Return LibXC functionals available in the linked PySCF installation. |
|
|
Validate that PySCF LibXC accepts an exchange-correlation functional. |
Classes
Options controlling PySCF numerical exchange-correlation integration grids. |
|
Evaluate LibXC XC energies, potentials, and response kernels with PySCF. |
- class ExchangeCorrelationGridOptions
Bases:
DataclassPublicAPIOptions controlling PySCF numerical exchange-correlation integration grids.
- Parameters:
grid_level – PySCF radial and angular grid level. Higher values improve integration accuracy.
pruning – Grid-pruning strategy.
"default"uses PySCF’s NWChem pruning,"aggressive"uses SG-1 pruning, and"off"disables pruning.nonlocal_grid_level – PySCF grid level for VV10-style nonlocal correlation, which is usually far more expensive per point than the semilocal XC. None uses
grid_level. A coarser level, e.g. 1, often costs little accuracy but changes energies.
- __init__(*, grid_level: int = 3, pruning: Literal['default', 'aggressive', 'off'] = 'default', nonlocal_grid_level: int | None = None) None
- Parameters:
grid_level (int)
pruning (Literal['default', 'aggressive', 'off'])
nonlocal_grid_level (int | None)
- Return type:
None
- classmethod accurate() ExchangeCorrelationGridOptions
Return the accurate grid options.
- Return type:
- classmethod balanced() ExchangeCorrelationGridOptions
Return the balanced grid options.
- Return type:
- grid_level: int = 3
- nonlocal_grid_level: int | None = None
- pruning: Literal['default', 'aggressive', 'off'] = 'default'
- classmethod quick() ExchangeCorrelationGridOptions
Return the quick grid options.
- Return type:
- classmethod very_accurate() ExchangeCorrelationGridOptions
Return the very accurate grid options.
- Return type:
- classmethod very_quick() ExchangeCorrelationGridOptions
Return the very quick grid options.
- Return type:
- class PySCFExchangeCorrelationCalculator
Bases:
MetadataFromFields,ExchangeCorrelationCalculatorProtocol[TMatrix,TVector]Evaluate LibXC XC energies, potentials, and response kernels with PySCF.
- __init__(matrix_module: MatrixModuleProtocol[TMatrix, TVector], functional: str, grid_options: ExchangeCorrelationGridOptions | None = None, *, include_nonlocal_correlation: bool = True) None
Initialise the calculator.
- Parameters:
matrix_module (MatrixModuleProtocol[TMatrix, TVector]) – Matrix module used to allocate result matrices.
functional (str) – PySCF LibXC functional expression.
grid_options (ExchangeCorrelationGridOptions | None) – Options controlling the PySCF numerical integration grid.
include_nonlocal_correlation (bool) – Whether to evaluate the functional’s VV10-style nonlocal correlation. Disabling it is only meant for approximate Fock builders.
- Return type:
None
- compute_restricted_result(density_matrix: RestrictedMatrix[TMatrix], molecular_configuration: MolecularConfiguration) ExchangeCorrelationResult
Evaluate the restricted XC energy and potential.
- Parameters:
density_matrix (RestrictedMatrix[TMatrix]) – Spin-summed AO density matrix.
molecular_configuration (MolecularConfiguration) – Molecular configuration.
- Return type:
- compute_restricted_results_many(density_matrices: list[RestrictedMatrix[TMatrix]], molecular_configuration: MolecularConfiguration) list[ExchangeCorrelationResult]
Evaluate restricted XC energies and potentials in one PySCF call.
- Parameters:
density_matrices (list[RestrictedMatrix[TMatrix]])
molecular_configuration (MolecularConfiguration)
- Return type:
- compute_unrestricted_result(density_matrix: UnrestrictedMatrix[TMatrix], molecular_configuration: MolecularConfiguration) ExchangeCorrelationResult
Evaluate the unrestricted XC energy and potential.
- Parameters:
density_matrix (UnrestrictedMatrix[TMatrix]) – Spin-resolved AO density matrix.
molecular_configuration (MolecularConfiguration) – Molecular configuration.
- Return type:
- compute_unrestricted_results_many(density_matrices: list[UnrestrictedMatrix[TMatrix]], molecular_configuration: MolecularConfiguration) list[ExchangeCorrelationResult]
Evaluate unrestricted XC energies and potentials in one PySCF call.
- Parameters:
density_matrices (list[UnrestrictedMatrix[TMatrix]])
molecular_configuration (MolecularConfiguration)
- Return type:
- property exact_exchange: ExactExchange
Exact-exchange parameters implied by the configured functional.
- property functional: str
The configured functional expression.
- property prune: Callable[[...], Any] | None
PySCF pruning function for the configured strategy, or None when pruning is off.
- xc_response_on_density_restricted(reference_density_matrix: RestrictedMatrix[TMatrix], density_matrix_direction: RestrictedMatrix[TMatrix], molecular_configuration: MolecularConfiguration) RestrictedMatrix[TMatrix]
Apply the restricted first-order XC response at a reference density.
- Parameters:
reference_density_matrix (RestrictedMatrix[TMatrix])
density_matrix_direction (RestrictedMatrix[TMatrix])
molecular_configuration (MolecularConfiguration)
- Return type:
RestrictedMatrix[TMatrix]
- xc_response_on_density_restricted_many(reference_density_matrix: RestrictedMatrix[TMatrix], density_matrix_directions: list[RestrictedMatrix[TMatrix]], molecular_configuration: MolecularConfiguration) list[RestrictedMatrix[TMatrix]]
Apply the restricted XC response to several density directions.
- Parameters:
reference_density_matrix (RestrictedMatrix[TMatrix])
density_matrix_directions (list[RestrictedMatrix[TMatrix]])
molecular_configuration (MolecularConfiguration)
- Return type:
list[RestrictedMatrix[TMatrix]]
- xc_response_on_density_unrestricted(reference_density_matrix: UnrestrictedMatrix[TMatrix], density_matrix_direction: UnrestrictedMatrix[TMatrix], molecular_configuration: MolecularConfiguration) UnrestrictedMatrix[TMatrix]
Apply the unrestricted first-order XC response at a reference density.
- Parameters:
reference_density_matrix (UnrestrictedMatrix[TMatrix])
density_matrix_direction (UnrestrictedMatrix[TMatrix])
molecular_configuration (MolecularConfiguration)
- Return type:
UnrestrictedMatrix[TMatrix]
- xc_response_on_density_unrestricted_many(reference_density_matrix: UnrestrictedMatrix[TMatrix], density_matrix_directions: list[UnrestrictedMatrix[TMatrix]], molecular_configuration: MolecularConfiguration) list[UnrestrictedMatrix[TMatrix]]
Apply the unrestricted XC response to several density directions.
- Parameters:
reference_density_matrix (UnrestrictedMatrix[TMatrix])
density_matrix_directions (list[UnrestrictedMatrix[TMatrix]])
molecular_configuration (MolecularConfiguration)
- Return type:
list[UnrestrictedMatrix[TMatrix]]
- get_available_exchange_correlation_functionals() tuple[str, ...]
Return LibXC functionals available in the linked PySCF installation.
- Return type:
tuple[str, …]
- validate_libxc_functional(functional: str) None
Validate that PySCF LibXC accepts an exchange-correlation functional.
- Parameters:
functional (str) – PySCF LibXC functional expression.
- Return type:
None