MolSSI / QCEngine

Quantum chemistry program executor and IO standardizer (QCSchema).
https://molssi.github.io/QCEngine/
BSD 3-Clause "New" or "Revised" License
163 stars 79 forks source link

Add torsiondrive compute procedure #305

Closed SimonBoothroyd closed 3 years ago

SimonBoothroyd commented 3 years ago

Description

This PR implements an initial proof of concept torsiondrive procedure as outlined in issue #306.

There are a number of questions about this PR:

If the QCE maintainers would be happy to accept a PR similar to this I'd be happy to add an example / tests here.

An example input would look like:

molecule = Molecule(
    symbols=["C", "C", "H", "H", "H", "H", "H", "H"],
    connectivity=[
        (0, 1, 1),
        (0, 2, 1),
        (0, 3, 1),
        (0, 4, 1),
        (1, 5, 1),
        (1, 6, 1),
        (1, 7, 1),
    ],
    geometry=[
        1.5403406836914142, -1.0173082391323545, 0.9312810207342496,
        4.0719763300123235, -0.0975682592642413, -0.02203578938791481,
        0.0002563605701713713, 0.0013953403968729996, 0.0011121160323317373,
        1.309831306165048, -3.03614919350581, 0.5491856718564878,
        1.3800394103640543, -0.7181256543708329, 2.9707878359388222,
        5.6120991748009645, -1.1161249890160694, 0.907991575289461,
        4.302418801484787, 1.921022388748466, 0.36057345099334853,
        4.232223312568672, -0.3961916040297606, -2.061588178357897]
)

result = compute_procedure(
    input_data=TorsionDriveInput(
        keywords={
            "dihedrals": [(2, 0, 1, 5)],
            "grid_spacing": [60]
        },
        input_specification=QCInputSpecification(
            driver=DriverEnum.gradient,
            model=Model(method="UFF", basis=None)
        ),
        initial_molecule=molecule,
        optimization_spec=OptimizationSpecification(
            procedure="geomeTRIC",
            keywords={
                "coordsys": "dlc",
                "maxiter": 300,
                "program": "rdkit",
            }
        )
    ),
    procedure="torsiondrive"
)

print(result)

Closed #306

Changelog description

Adds a new torsiondrive compute procedure

Status

codecov[bot] commented 3 years ago

Codecov Report

Merging #305 (9a7b313) into master (e248d2f) will increase coverage by 0.19%. The diff coverage is 94.44%.

dotsdl commented 3 years ago

Looks great @SimonBoothroyd! Thank you for putting this together!

I think this covers all the bases, and I prefer the simplicity of running one optimization at a time with config settings indicating how many threads and how much memory is available to the program running the gradient calculations.

I think we should press forward with this. Would you like to create a test next?

SimonBoothroyd commented 3 years ago

Thanks @dotsdl - tests added in 4a68fe9.

It looks like the failures are mostly un-related. I'm not sure why test_geometric_generic is now failing - my guess is that the two entries of this test have always been skipped due to missing dependencies, and now that the dependencies (i.e. geometric + openmm) are present the test is actually being run but failing due to bad expected values.

dotsdl commented 3 years ago

Agree with you @SimonBoothroyd that the errors we see in the tests are unrelated to the changes introduced by this PR. I wouldn't consider those blocking for merge of this feature.

@loriab, is there anything additional you would like to see before merging this? This functionality simplifies execution of torsiondrives by QC* users substantially, and I'm eager to get it into the library!

SimonBoothroyd commented 3 years ago

Thanks @loriab - I've made the changes you suggested and have opened up an initial PR for adding the models to QCElemental here https://github.com/MolSSI/QCElemental/pull/268 where we can maybe discuss them in a bit more detail.

loriab commented 3 years ago

qcel 0.22 ready with the models this PR needs

SimonBoothroyd commented 3 years ago

Thanks @loriab ! These should be integrated in ff41b75.

As far as I can tell this should be G2G now (cc @dotsdl @bennybp)

dotsdl commented 3 years ago

Performing final review with aim to merge.

dotsdl commented 3 years ago

Merged! Thank you @SimonBoothroyd for this!