Skip to content

[SUGGESTION] berny procedure engine specification change #302

Description

@coltonbh

Is your feature request related to a problem? Please describe.

The BernyProcedure currently gets the compute engine to use from the keywords dictionary used to define keywords for the optimization procedure. I think it would be cleaner to get the engine value from the specification of the compute model instead. This would keep all keywords related to the compute engine in one dictionary, and all keywords related to the optimization in the other keywords dictionary.

The way it currently is

water = Molecule.from_data("pubchem:water")

input_spec = QCInputSpecification(
    driver="gradient",
    model={"method": "b3lyp", "basis": "6-31g"},
    # Keywords for compute engine
    keywords={"psi4keyword": "psi4value"},
)

opt_input = OptimizationInput(
    initial_molecule=water,
    input_specification=input_spec,
    protocols={"trajectory": "all"},
    # Define compute engine and keywords for pyberny
    # This seems an odd combination of keywords
    keywords={"program": "psi4", "bernykeyword": "bernyvalue"},
)

qcng.compute_procedure(opt_input, 'berny')

Then this line gets the "program" keyword to get a compute engine.

Describe the solution you'd like

water = Molecule.from_data("pubchem:water")

input_spec = QCInputSpecification(
    driver="gradient",
    model={"method": "b3lyp", "basis": "6-31g"},
    # QC program and its associated keywords kept together
    keywords={"program": "psi4", "psi4keyword": "psi4value"},
)

opt_input = OptimizationInput(
    initial_molecule=water,
    input_specification=input_spec,
    protocols={"trajectory": "all"},
    # Don't mix the program definition with keywords specific to the optimizer
    keywords={"bernykeyword1": "bernyvalue1"},
)

qcng.compute_procedure(opt_input, 'berny')

Change this line as follows:

Current:

program = input_data["keywords"].pop("program")

Desired:

program = comput["keywords"].pop("program")

Since geometric uses a different (internal) mechanism for accessing compute engines, this change would only affect the BernyProcedure

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions