-
Notifications
You must be signed in to change notification settings - Fork 568
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
Prevent writing to a specific file when creating the Hamiltonian #5785
Comments
Thanks @minhtriet for creating the issue. Could you please benchmark this for a few molecules and provide the timing results here? This will help us to see how much improvement we gain. Thanks. |
sure, let me implement that and benchmark |
#5792 Please review guys :) |
Hi @minhtriet, |
Are we interested in the actual time, or just how many percent faster parallel mode is in comparison to serial mode? Right now I measured that it reduce the speed needed for NH3 by at least 40%. Can do with LiH and H2O. For H2 it parallel mode is slower than serial mode |
Knowing the actual times would be ideal @minhtriet . Even in cases where there's a slowdown. |
Hi, here is the update
The set up and test code can be found at
|
Thank you @minhtriet ! This is very useful info. |
@minhtriet Do you want to make a Pull Request (PR) to implement this? Have you done a contribution to PennyLane before? This blog post is a good guide on how to contribute. If you're interested you can start working on it already and we'll review it in the next few weeks. We won't be able to review it immediately but we'll review and provide feedback as soon as we have capacity. Let me know if you have any questions! |
Sure @CatalinaAlbornoz. Here is my PR |
Thanks @minhtriet ! It may take us a few weeks to review but we will get back to you. In the meantime, I noticed that there seem to be conflicts with a file. You need to resolve it using the command line. |
Hi @minhtriet I noticed the title and details of this issue do not match with the content or expectations set out by the title. I have also provided a review for the PR #5792 which seems to be concerned with using multiprocessing to handle the Hamiltonian building in parallel, which differs from the temporary file issue discussed here. Since the reported performance numbers show regressions for smaller systems, I think this will need to be mitigated for an implementation that provides the support to an end user. I'd recommend considering either updating the expectations and issue reported here to match the parallel work, or to consider the PR to implement the temporary file work. |
Feature details
When doing gradient descent for optimizing the coordinates of molecules, it is desirable to create many Hamiltonian quickly. It is because we are shifting every coordinate just by a tiny bit and regenerate the Hamiltonian
Right now, Pennylane is creating a file, for my case
molecule_pyscf_sto-3g.hdf5
, and other Hamiltonians created would just overwrite this file.Implementation
tempfile.NamedTemporaryFile
should be able to help us. I am willing to discuss further and author a PR :)How important would you say this feature is?
2: Somewhat important. Needed this quarter.
Additional information
Test case pseudocode (adapt from real code)
The text was updated successfully, but these errors were encountered: