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

Refactor Hamming weight phasing to use QVR #1245

Closed

Conversation

anurudhp
Copy link
Contributor

@anurudhp anurudhp commented Aug 3, 2024

fixes #1218

@anurudhp anurudhp force-pushed the 2024/08/02-refactor-hw-phasing branch from 5a66b97 to 8543542 Compare August 21, 2024 06:05
def via_phase_gradient(cls, bitsize: int, exponent: float = 1, eps: SymbolicFloat = 1e-10):
r"""Factory method for `HammingWeightPhasing` using a phase gradient state.

In this variant of Hamming Weight Phasing, instead of directly synthesizing $O(\log_2 (\texttt{bitsize}))$
Copy link
Collaborator

Choose a reason for hiding this comment

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

I know you copied this, but can you hard-wrap the text to <100 columns. vim is gq ; pycharm is "edit -> fill paragraph"

apply the phasing via addition.

References:
1. [Compilation of Fault-Tolerant Quantum Heuristics for Combinatorial Optimization]
Copy link
Collaborator

Choose a reason for hiding this comment

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

I know you copied this, but remove 1. from the list of references. We don't number them.

phase_grad : Phase gradient THRU register of size `O(log2(1/eps))`, to be used to
apply the phasing via addition.

References:
Copy link
Collaborator

Choose a reason for hiding this comment

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

consider moving the reference to the class docstring

@@ -66,6 +69,7 @@ class HammingWeightPhasing(GateWithRegisters):

Registers:
x: A `THRU` register of `bitsize` qubits.
extra_registers: Any additional registers used by the `QvrInterface` phase oracle.
Copy link
Collaborator

Choose a reason for hiding this comment

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

document the new phase_oracle arg and reference the new factory method in the class docstring somewhere

@mpharrigan
Copy link
Collaborator

@tanujkhattar original author of these bloqs: are you good with the merger?

@mpharrigan
Copy link
Collaborator

@tanujkhattar @anurudhp what's the status of this?

@anurudhp
Copy link
Contributor Author

This has deviated too much from main, closing it for now. We can make a new refactor PR if needed

@anurudhp anurudhp closed this Oct 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unify HammingWeightPhasing bloqs
2 participants