-
Notifications
You must be signed in to change notification settings - Fork 53
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 block encoding bloqs to use abstract base class. #967
Refactor block encoding bloqs to use abstract base class. #967
Conversation
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.
This is looking good! Do you want to merge this and continue the refactoring or continue the refactoring in this PR? Either way sounds good to me. I'll approve if you want to merge this once you mark it ready.
…ltran into revamp_block_encoding_bloqs
I will follow up with the updates to QubitizationWalkOperator / chemistry block encodings. |
…ltran into revamp_block_encoding_bloqs
@tanujkhattar PTAL, this is good to go I think |
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.
It's admirable that the user can either use the raw select and prepare subroutines and get all the registers, but do we actually want this? I.e. why can't we always go via the "black-box" interfaces
Yeah, originally I had an attrs converter which would just convert it to the abstract black box, which is probably the right thing to do, but for the chemistry bloqs I'll need yet another black box for the big block encodings, so thought it better to do things incrementally. (and maybe add the AutoPartition first to handle this). All these wrappers would have to be structured etc.. so all this is to say is yes, I think the end point would be use the black boxes, but maybe wait a few PRs. I also didn't want to open a can of worms here about how we want to write these algorithms, but I think now (or shortly) we can generate the more abstract linear T style diagrams of like a walk operator and QPE etc. |
Thanks for the additional color! Sounds good |
I also simplified the construction of the higher level block encoding to use attrs to automatically convert a SelectOracle and PrepareOracle into their "black boxes" to enable higher level abstractions.Make SF and DF inherit from BlockEncoding and define the appropriate signal state reflections.Update QubitizationWalkOperator to expect a block encoding rather than Sel and Prep.cc @tanujkhattar: does this sound sensible? If so I'll continue down this path. The goal is to enable phase estimation of all chemistry bloqs, not just those which follow the more standard LCU form. It is possible that I could further refactor SF and DF to build the sub block encodings but I'll leave that as a follow up.