Skip to content

THC prepare#350

Merged
fdmalone merged 59 commits intomainfrom
thc_prepare
Oct 18, 2023
Merged

THC prepare#350
fdmalone merged 59 commits intomainfrom
thc_prepare

Conversation

@fdmalone
Copy link
Copy Markdown
Collaborator

@fdmalone fdmalone commented Aug 14, 2023

Add THC prepare bloqs: uniform superposition, and prepare.

Some issues which arose:

  1. We need more comparators (less than constant, equals a constant, greater than a constant, ...) I added these as placeholders.
  2. For tcomplexity to work I had to add t_complexity methods to several single qubit gates TComplexity is currently broken, XGate doesn't support decomposition
  3. relies on Add OnEach bloq #346 Multi controlled pauli #349 and Less than equal bloqs. #348
  4. Prepare t complexity is currently not working because controlled bloq (CZ) throws an error during decomposition (ZGate doesn't support decomposition).
  5. The complexity of the uniform superposition bloq is higher than the paper because inverting the inequalities should be free and the rotation cost is much higher due to the THC paper using a phased gradient gate rather than trying to synthesize the rotation. Similarly the prepare step is larger because of difference in QROAM Many Variations of QROAM #368

@fdmalone
Copy link
Copy Markdown
Collaborator Author

cc @mpharrigan

Comment thread dev_tools/autogenerate-bloqs-notebooks.py Outdated
Comment thread qualtran/bloqs/chemistry/contiguous_register.py Outdated
Comment thread qualtran/bloqs/chemistry/thc.py Outdated
Comment thread qualtran/bloqs/chemistry/thc.py Outdated
@mpharrigan
Copy link
Copy Markdown
Collaborator

Is this ready for review? can you resolve conflicts?

@fdmalone
Copy link
Copy Markdown
Collaborator Author

I would look tomorrow if you have a chance. There were some dirty hacks in the mean time to do some accounting.

@fdmalone
Copy link
Copy Markdown
Collaborator Author

@mpharrigan PTAL

@fdmalone fdmalone reopened this Oct 17, 2023
@fdmalone
Copy link
Copy Markdown
Collaborator Author

weird merging #419 closed this somehow.

@mpharrigan
Copy link
Copy Markdown
Collaborator

Any time you use the word "fixes" and an issue, apparently it will try to close the thing that it "fixes". Makes sense for issues (but clearly not for PRs)

@fdmalone
Copy link
Copy Markdown
Collaborator Author

So the comparator issue is now resolved since #394, which removes the need for my hacky code. I'll incorporate the changes and any CirqGateAsBloq deprecations as necessary before merging.

Copy link
Copy Markdown
Collaborator

@mpharrigan mpharrigan left a comment

Choose a reason for hiding this comment

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

some more notebook things

Comment thread qualtran/bloqs/chemistry/thc.ipynb Outdated
Comment thread qualtran/bloqs/chemistry/thc.ipynb Outdated
Comment thread qualtran/bloqs/chemistry/thc.ipynb Outdated
Comment thread qualtran/bloqs/chemistry/thc.ipynb Outdated
@fdmalone
Copy link
Copy Markdown
Collaborator Author

fdmalone commented Oct 18, 2023

I've opened #425 to track the notebook_utils clean up. This is good to go I think @mpharrigan

@fdmalone fdmalone merged commit f54e03d into main Oct 18, 2023
@fdmalone fdmalone deleted the thc_prepare branch October 18, 2023 23:45
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.

3 participants