qrunch.chemistry.ground_state_problem.builders.builders_protocols

Protocols for ground state problem builders.

Functions

ground_state_problem_list_is_all_restricted(problem)

Tell static type checkers that in the True-branch this is a list of restricted ground state problems.

Classes

GroundStateProblemBuilder

Ground state problem builder.

GroundStateProblemModifier

Protocol for classes that modify a GroundStateProblem.

RestrictedGroundStateProblem

Restricted ground state problem.

UnrestrictedGroundStateProblem

Unrestricted ground state problem.

class GroundStateProblemBuilder

Bases: Protocol

Ground state problem builder.

__init__(*args, **kwargs)
build_restricted(molecular_configuration: MolecularConfiguration) RestrictedGroundStateProblem

Build the restricted ground state problem.

Parameters:

molecular_configuration (MolecularConfiguration)

Return type:

RestrictedGroundStateProblem

build_unrestricted(molecular_configuration: MolecularConfiguration) UnrestrictedGroundStateProblem

Build the unrestricted ground state problem.

Parameters:

molecular_configuration (MolecularConfiguration)

Return type:

UnrestrictedGroundStateProblem

class GroundStateProblemModifier

Bases: Protocol

Protocol for classes that modify a GroundStateProblem.

__init__(*args, **kwargs)
modify(problem: RestrictedGroundStateProblem) RestrictedGroundStateProblem
modify(problem: UnrestrictedGroundStateProblem) UnrestrictedGroundStateProblem

Modify the GroundStateProblem and return the modified instance.

Parameters:

problem (RestrictedGroundStateProblem | UnrestrictedGroundStateProblem) – The ground state problem to be modified.

Return type:

RestrictedGroundStateProblem | UnrestrictedGroundStateProblem

classmethod short_name() str

Provide a short name for logging purposes.

Return type:

str

class RestrictedGroundStateProblem

Bases: object

Restricted ground state problem.

All fields are immutable (frozen=True) so an instance can be safely reused.

Parameters:
  • electronic_structure_integrals – Integrals for the problem.

  • electron_configuration – Electronic configuration for the problem.

  • energy_contributions – Energy contributions needed for the final energy.

__init__(electronic_structure_integrals: RestrictedElectronicStructureIntegrals, electron_configuration: MolecularElectronConfiguration, energy_contributions: MolecularEnergyContributions) None
Parameters:
Return type:

None

electron_configuration: MolecularElectronConfiguration
electronic_structure_integrals: RestrictedElectronicStructureIntegrals
energy_contributions: MolecularEnergyContributions
property is_restricted: Literal[True]

Return True, if it is restricted.

class UnrestrictedGroundStateProblem

Bases: object

Unrestricted ground state problem.

All fields are immutable (frozen=True) so an instance can be safely reused.

Parameters:
  • electronic_structure_integrals – Integrals for the problem.

  • electron_configuration – Electronic configuration for the problem.

  • energy_contributions – Energy contributions needed for the final energy.

__init__(electronic_structure_integrals: UnrestrictedElectronicStructureIntegrals, electron_configuration: MolecularElectronConfiguration, energy_contributions: MolecularEnergyContributions) None
Parameters:
Return type:

None

electron_configuration: MolecularElectronConfiguration
electronic_structure_integrals: UnrestrictedElectronicStructureIntegrals
energy_contributions: MolecularEnergyContributions
property is_restricted: Literal[False]

Return True, if it is restricted.

ground_state_problem_list_is_all_restricted(problem: list[RestrictedGroundStateProblem] | list[UnrestrictedGroundStateProblem]) TypeGuard[list[RestrictedGroundStateProblem]]

Tell static type checkers that in the True-branch this is a list of restricted ground state problems.

Parameters:

problem (list[RestrictedGroundStateProblem] | list[UnrestrictedGroundStateProblem])

Return type:

TypeGuard[list[RestrictedGroundStateProblem]]