qrunch.chemistry.molecular_orbital_calculators.custom_molecular_orbital_calculator

Adapter making a user-supplied molecular orbital solver usable everywhere in qrunch.

Classes

CustomMolecularOrbitalCalculator

Wrap a user-supplied molecular orbital solver so that it fulfills the internal calculator interface.

class CustomMolecularOrbitalCalculator

Bases: object

Wrap a user-supplied molecular orbital solver so that it fulfills the internal calculator interface.

A user only has to implement MolecularOrbitalSolver, i.e. solve_restricted and solve_unrestricted. The metadata hash needed by the data persisters is derived from the type of the wrapped solver, unless the solver provides a metadata hash itself.

__init__(molecular_orbital_solver: MolecularOrbitalSolver) None

Initialize the custom molecular orbital calculator.

Parameters:

molecular_orbital_solver (MolecularOrbitalSolver) – The user-supplied solver to delegate the calculations to.

Return type:

None

solve_restricted(molecular_configuration: MolecularConfiguration, initial_guess: RestrictedDensityOperator | None = None, additional_potential: RestrictedElectronPotential | None = None) RestrictedMolecularOrbitalCalculatorResult

Solve the restricted problem with the user-supplied solver.

Parameters:
Return type:

RestrictedMolecularOrbitalCalculatorResult

solve_unrestricted(molecular_configuration: MolecularConfiguration, initial_guess: UnrestrictedDensityOperator | None = None, additional_potential: UnrestrictedElectronPotential | None = None) UnrestrictedMolecularOrbitalCalculatorResult

Solve the unrestricted problem with the user-supplied solver.

Parameters:
Return type:

UnrestrictedMolecularOrbitalCalculatorResult