-
Notifications
You must be signed in to change notification settings - Fork 14
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
[ENH] Geometry optimization #10
Comments
You can couple it with |
Ah great - somehow I missed that example, maybe it could be more prominently added to the documentation.
I can understand that. I have given that example try now and I can confirm that it appears to work for me, though I havn't done any rigorous testing. Having just given it a try, my personal preference would still be to add it to All of this could be wrapt inside a single Thanks again for the prompt and helpful reply. |
I think it can be put in the API along side with other properties: https://github.com/diffqc/dqc/blob/master/dqc/api/properties.py |
Hmm - that's a good call out. I could imagine that sometimes people might just want the optimized positions and I can see how it is much more in keeping with the design on the overall API to return a tensor and favor two calls to get the molecule back. I also tend not to like APIs that change return type based on a flag, so I think you have to go with one or the other. Even though it's slightly less convenient for me the following might be fine mol = dqc.Mol(moldesc=moldesc, basis="sto-3g") # moldesc is some initial starting description of the molecule
mol.atompos.requires_grad_()
hf = dqc.HF(mol).run()
geo_opt = dqc.optimimal_geometry(hf) # new proposed function
mol_opt = dqc.Mol(moldesc=(mol.atomzs, geo_opt), basis=mol.basis) # NOTE: mol.basis doesn't actually exist
# OR
mol.atompos = geo_opt # NOTE: attribute can't be set right now but update in place might be nice I will call out that I will also call out that Finally I suggested the name Curious what you think next step should be? |
Returning the tensor also works better if one wants to train a ML system that matches the atom positions to experimental data.
A solution that I can think of is to add a new method, say
Is there a special reason why it is |
Makes sense, I like that API - very explicit.
Nope, typo! Sorry about that. I think we're aligned on the API now. Is this something you're ok to implement or would you like me to take a pass at making a PR? |
You can take it if you want |
Great, thanks! I'd love to. I won't be able to make a PR till this weekend at the earliest though |
Is your feature request related to a problem? Please describe.
I would like to optimize the geometry of a molecule from an initial configuration. This would then allow me to compute vibrational frequencies and IR spectra at a local minimum of the potential energy surface.
Describe the solution you'd like
In PySCF I can use their geometry_optimizer to optimize the geometry of a molecule, for example something like
I would like to do something similar in dqc, for example something like
Describe alternatives you've considered
Alternatively this would have to be implemented outside of dqc.
Additional context
I know there are many algorithms possible for geometry optimization and I am very open to whichever is recommended.
The text was updated successfully, but these errors were encountered: