Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Add functions to find correct sector for qubit tapering #2041
Add functions to find correct sector for qubit tapering #2041
Changes from 3 commits
981c1a0
7a1192a
158ae78
1a350db
067d44a
455a293
4036f5a
e32d8fb
1d42ebe
9d6ecdc
c8d0543
546fa10
c4e632f
90e6693
2abe0fa
3128fb8
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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'm still very confused by what we mean by "sector". I thought it was a list of eigenvalues? But here it is a Hamiltonian?
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 am sorry for the confusion. I somehow used "sector" here to represent the tapered Hamiltonian. I guess while implementing the function I more or less remembered quite a literal definition of the word sector (as in part of the whole). Didn't realize the conflict.
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.
Won't this be very expensive for more complicated Hamiltonians? Thinking long term, if there is ever an experiment attempting to simulate a large system, it may be prohibitive to directly diagonalize the Hamiltonian. Isn't that a problem here?
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.
Yes. The energy calculation was being done only to support the brute force method. Now that I have removed it, this is not needed either.
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 think this function should only return the correct sector and not the energy. This means that we should not perform the brute force method here since the user can always call the
transform_hamiltonian
function with any desired sector. Also, if the user can already obtain the correct sector, then no need to do a brute force at all. Therefore, the args and return might be:Args: generators, reference HF state
Return: list of eigenvalues
Instead of the reference HF state, we might have
mol, core=None, active=None
or something similar.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.
Agree with Soran 💯 Why use an inefficient brute force method when we know a better algorithm?
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.
Agreed. My original intention to include brute force was for the sake of completeness. But now that
transform_hamiltonian
can already allow users to do it already, I also believe that we can skip doing it here.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.
Shouldn't this be \sigma_z^{i} = 1 - 2 a_{i}^{\dagger}a_{i} or maybe I am missing something?
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.
Number operator is
[[0, 0], [0, 1]]
so indeed the formula Soran is quoting should be the correct one. Also, I think it's better to express the number operator in terms of the Pauli operators. I suggest changing ton_i=a_{i}^{\dagger}a_{i}=I-2\sigma_z^i
But please check that we are using labels on the Pauli operators consistently. I recall in other PRs we were using
\sigma_i^z
, though I may be wrongThere 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.
Updated. Even I'd gotten the same result when I was calculating it by myself. But I wonder why Setia's paper that we are following used this definition (Eq 17).
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 theory can be explained a bit better.
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.
Agree. How exactly does knowing if an orbital is occupied or not help us build the correct eigensector?
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.
Clever implementation!
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.
Why is this change being made?
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.
To avoid hardcoding the input Hamiltonian which could be huge for any molecule other than H2.