-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Use Boolean Hamiltonian Gate for QAOA #3989
Conversation
@tonybruguier @balopat I just want to mention that this diagonal Hamiltonian representation is highly related with diagonal gate decomposition #3890. One main application of diagonal gate is to simulate the Hamiltonian (Ref. Sec 4. in (https://iopscience.iop.org/article/10.1088/1367-2630/16/3/033040/pdf). |
Ohhhh, nice! Thanks for the reference. I will need more time to digest the paper and your PR. I took a little time to study both, and my temporary understanding is that the approach you just linked is that it approximates a function defined by its enumerated values while the present PR is an exact representation of a function defined by its formula. Also, do you suggest a refactoring (now or later)? I'm open to suggestions, I just could use some more advice on how to proceed (if you have the time). I will read the paper more carefully later no matter what. |
@tonybruguier I don't suggest any refactoring at all. Just mention the connection. For example, here this Hamiltonian representation exploited the special format of QAOA |
Thanks. I think I understand a little bit more now. I think it is indeed the case that the diagonal gates uses the values directly to construct an approximate circuit, while the present PR uses the formula to construct an exact circuit. It seems the circuit could be a bit different though: |
The main difference and the biggest advantage of this work, I think, is it does not evaluate the whole truth table of boolean function directly to construct the circuit. Meanwhile, the diagonal gate has to know all values (not limited to boolean function through).
Yes, they will give different circuits. As for this particular circuit example you showed, they are exactly the same actually (if you ignore the identical operator Since the connection, I am reviewing this PR. (so me again :) ) Will send more comments after I understand this 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.
@tonybruguier This is an interesting work, thanks for adding an example for this! I left some comments more about the coding actually.
After understanding better the reference you gave, the following is my latest understanding of the connection between diagonal gates :
- Same: The underlying math foundation is exactly the same. One called Fourier expansions, one called Walsh-Hadamard transform (They are the same thing under Z_2^n). The construction of these basis/expansions --
exp^(-i \gamma H_f)
through CNOT and Z gates are the same as well. (Some re-ordering for optimization is used in the diagonal gate but is not important here.) - Diff: Diagonal gate use the full Walsh transform to get these coefficients directly, which requires
O(Nlog(N)) = O(n2^n)
even under the FFT style. Hamiltonian represents through the boolean expressions and composite rules. Under many well-structured situations, like the ISING model, it only needs to be expanded to be quadratic terms, hence it can save huge computation requirements. (I need to understand better on the cost of general cases)
Thanks. PTAL. I am thinking about what you said, and trying to see whether I can improve the number of gates. |
Thanks @balopat . I think this is what you had suggested. PTAL? |
@MichaelBroughton |
We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google. ℹ️ Googlers: Go here for more info. |
We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google. ℹ️ Googlers: Go here for more info. |
@MichaelBroughton |
We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google. ℹ️ Googlers: Go here for more info. |
…antumlib#4282) As part of the the review quantumlib#3989 we could use the ability to build a PauliSum from a Boolean expression. This PR makes available that function (smaller change).
…antumlib#4282) As part of the the review quantumlib#3989 we could use the ability to build a PauliSum from a Boolean expression. This PR makes available that function (smaller change).
No description provided.