Skip to content
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

QCQMC part 3: Add Hamiltonian #345

Merged
merged 9 commits into from
Jun 22, 2024
Merged

Conversation

fdmalone
Copy link
Collaborator

@fdmalone fdmalone commented Jun 11, 2024

Adds hamiltonian module for specifying a second quantized hamiltonian used for optimizing a trial wavefunction.

Depends on #342 and #343.

cc @mpharrigan

@fdmalone fdmalone changed the title QCQMC-3 QCQMC part 3 Jun 11, 2024
@fdmalone
Copy link
Collaborator Author

@mpharrigan / @wjhuggins PTAL, the diff should be a lot more digestible now! The only change over the private repo is to use attrs instead of dataclasses.

@fdmalone
Copy link
Collaborator Author

Also this doesn't depend on quaff yet, so I didn't touch the CI.

@fdmalone fdmalone changed the title QCQMC part 3 QCQMC part 3: Add Hamiltonian Jun 20, 2024
@fdmalone
Copy link
Collaborator Author

@dstrain115 / @mpharrigan PTAL

recirq/qcqmc/hamiltonian.py Show resolved Hide resolved
import openfermion as of
from fqe.hamiltonians.restricted_hamiltonian import RestrictedHamiltonian
from fqe.openfermion_utils import integrals_to_fqe_restricted
from openfermionpyscf._run_pyscf import compute_integrals # type: ignore
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we importing from a private module? This is generally not advisable.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess the function didn't get lifted to a public module in openfermionpyscf. I can reproduce a simplified version of the function here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I copied the openfermion function into hamiltonian.py, WDYT?

recirq/qcqmc/hamiltonian.py Outdated Show resolved Hide resolved
recirq/qcqmc/hamiltonian.py Outdated Show resolved Hide resolved
recirq/qcqmc/hamiltonian.py Outdated Show resolved Hide resolved
recirq/qcqmc/hamiltonian.py Outdated Show resolved Hide resolved
recirq/qcqmc/hamiltonian.py Outdated Show resolved Hide resolved
recirq/qcqmc/hamiltonian.py Outdated Show resolved Hide resolved
recirq/qcqmc/hamiltonian_test.py Show resolved Hide resolved
@fdmalone
Copy link
Collaborator Author

@dstrain115 PTAL

@fdmalone fdmalone requested a review from dstrain115 June 21, 2024 19:47
recirq/qcqmc/hamiltonian.py Outdated Show resolved Hide resolved
recirq/qcqmc/hamiltonian.py Outdated Show resolved Hide resolved
@fdmalone
Copy link
Collaborator Author

@mpharrigan / @dstrain115 could you merge I don't have permission

@dstrain115 dstrain115 merged commit 49f9511 into quantumlib:master Jun 22, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants