-
Notifications
You must be signed in to change notification settings - Fork 3
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
[FEATURE] - Add optimizations with Sella/ASE #33
Comments
Thanks for the detailed write up! Super helpful. A few clarifications:
Sella does seem pretty slick! My initial impression for how I'd implement this is provide the usual Thanks for the detail and time to write this up. As they say--measure twice, cut once :) So I try to get clarity on exactly what needs to be built before getting started ✨ |
No, it isn't important that those things run via ASE. Any way I can get them is fine, as long as the results are consistent (i.e. running a single point on the optimized geometry gives me the same answer). |
Regarding electronic structure back-ends, the main packages I plan to use in the near term I believe are all available in If it were possible, though, it would be cool if the interface could be done in a generic way, so that all of the ASE back-ends are automatically available through Another "nice to have" feature from ASE is the ability to externally define a "calculator" and pass it into the program. I really like this feature, because of the flexibility it would provide to users. For example, in my PhD I implemented my own electronic structure methods. It would have been great to be able to simply define some sort of "calculator" object and instantly be able to plug into any routines that were built on top of But again, those are separate features. Simply being able to run Sella through |
Yes. I could add an You can already add new |
Here's a quick version; I should add some better docs for this. This also makes me want to move the All you have to do is create a new
With that, from typing import Callable, Optional, Tuple
from qcio import CalcType, ProgramInput, SinglePointResults, Structure
from qcop import compute, exceptions
from qcop.adapters.base import ProgramAdapter
class MyAdapter(ProgramAdapter[ProgramInput, SinglePointResults]):
# Fill in supported_calctypes and program
supported_calctypes = [CalcType.energy]
program = "myprog"
def program_version(self, stdout: Optional[str]) -> str:
"""Modify to return the actual version of the program.
It can find this value from the command line, a Python package, or by parsing
the stdout from the program.
"""
return "v0.0.1"
def compute_results(
self,
inp_obj: ProgramInput,
update_func: Optional[Callable] = None,
update_interval: Optional[float] = None,
**kwargs
) -> Tuple[SinglePointResults, str]:
"""Perform the calculation with external Program. Return the results and stdout."""
# Perform the calculation and return the results and stdout
return SinglePointResults(energy=123.456), "stdout stuff"
# Now your new Adapter is ready to use inside of qcop!
prog_input = ProgramInput(
calctype="energy",
structure=Structure(symbols=["H", "O"], geometry=[[0, 0, 0], [0, 0, 1]]),
model={"method": "HF", "basis": "sto-3g"},
)
try:
po = compute("myprog", prog_input)
except exceptions.QCOPBaseError as e:
po = e.program_output |
Wow, that sounds great! If it all works, this would be my dream! I have been looking for a package that does these things literally for years. As soon as you have an interface for Sella optimizations, I can start prototyping code on top of |
@avcopan sorry I've been slow on this! Added a new feature this week that I think you'll find really valuable--the ability to visualize all your results in a Jupyter notebook with a single command! Details here. I needed this for viewing some of my own results this week so I prioritized it. Sella/ASE up next... |
No worries! I am in for a busy month, so it isn't a huge rush from my end. The visualization looks nice! Are you using py3Dmol or something else? |
Yes, Ok good to hear it's not holding you up! Will get to it in the next few weeks then :) |
No, I like py3dmol! It's what I use as well. |
I like the API for qcop and would love to use it as a common interface for energy, hessian, and structure calculations with Sella/ASE, similar to the current geomeTRIC/QCEngine calculators in qcop. The motivation for adding the former is two-fold:
In particular, my workflow involves the following list of routines, which might be performed through Sella/ASE:
I don't need any further tools from ASE, beyond these basic ones. These building blocks would allow me to write my own routines for conformer sampling, relaxed scanning, and transition state finding using qcop.
The text was updated successfully, but these errors were encountered: