-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pyberny addition #3
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you tried building this? Based on what's here, I suspect the build will fail.
Take a look at https://github.com/NWChemEx/FriendZone. In particular, try to mirror its file structure (notably the C++/Python split).
You also need a test for your function see here for an example of how to add one to the build system.
… to src/python subdir.
make lowercase to avoid problems on case-insensitive filesystems.
I'd add your toolchain to the .gitignore. We've talked about at some point having a repo with some starter toolchains, but for now we're not checking them in to any repos.
…er the molecule object
Small refactor
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple of comments regarding documentation and workflows.
…r and pyberny modules
removes redundant file (this function is now merged with the newly created module)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In case you haven't figured this out yet, the EnergyNuclearGradientStdVectorD
property type actually returns both the energy and the gradient. Also the module needs not only the chemical system, but the point at which to take the derivative.
…dient' and added a conversion from xyz to chemical system
…t.PointSetD()' it does provide output
|
||
energy = submods["Energy"].run_as(TotalEnergy(), geom) | ||
gradients = submods["Gradient"].run_as( | ||
EnergyNuclearGradientStdVectorD(), geom, pointset1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
EnergyNuclearGradientStdVectorD(), geom, pointset1) | |
EnergyNuclearGradientStdVectorD(), geom, geom.molecule.nuclei) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have tried this, unfortunately it does not work. Here is the resulting output:
ValueError: Input value: "Pybind11 Object" has failed bounds checks: Type == chemist::PointSet<double>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That error is because Nuclei
does not derive from PointSet<double>
like I originally thought. It's the point charges in Nuclei
that that derive from PointSet<double>
, i.e. you actually need geom.molecule.nuclei.charges
. See if that fixes the error.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I get back an error that states geom.molecule.nuclei
has no attribute charges
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NWChemEx/Chemist#417 should fix that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The aforementioned PR has been merged, try again.
…e as well as removal of unecessary property type
@jlheflin your current error is because you're depending on friendzone for your module. Modules shouldn't directly depend on other modules/functionality found in other plugins. Instead they should depend on property types. For now, what I would do is write a function which loops over the |
@jwaldrop107 and I discussed some options for making a more reusable solution, but let's tackle that later. |
CMakeLists.txt
Outdated
nwx_pybind11_tests( | ||
py_${PROJECT_NAME} | ||
"${${PROJECT_NAME}_PYTHON_TEST_DIR}/unit_tests/test_${PROJECT_NAME}.py" | ||
SUBMODULES simde chemist pluginplay parallelzone | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nwx_pybind11_tests( | |
py_${PROJECT_NAME} | |
"${${PROJECT_NAME}_PYTHON_TEST_DIR}/unit_tests/test_${PROJECT_NAME}.py" | |
SUBMODULES simde chemist pluginplay parallelzone | |
) | |
cmaize_find_or_build_dependency( | |
nwchemex | |
URL github.com/NWChemEx/NWChemEx | |
BUILD_TARGET nwchemex | |
FIND_TARGET nwx::nwchemex | |
CMAKE_ARGS BUILD_TESTING=OFF | |
) | |
nwx_pybind11_tests( | |
py_${PROJECT_NAME} | |
"${${PROJECT_NAME}_PYTHON_TEST_DIR}/unit_tests/test_${PROJECT_NAME}.py" | |
DEPENDS nwchemex | |
SUBMODULES simde chemist pluginplay parallelzone friendzone chemcache nwchemex | |
) |
Try this for your CI error. Your unit test depends on NWChemEx (which also means it's technically an integration test) so you need to install NWChemEx and link to it.
Is this pull request associated with an issue(s)?
No.
Description
Adds a beginning branch for adding PyBerny as an option for optimizing a chemical system geometry.
TODOs
Implement ModuleManager so that modules can be loaded