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

Support symbolic parameters in QROM bloq #945

Merged
merged 10 commits into from
May 13, 2024

Conversation

tanujkhattar
Copy link
Collaborator

@tanujkhattar tanujkhattar commented May 10, 2024

Part of a larger effort to refresh all unary iteration based bloqs and add symbolic support. Will also form the base of refactoring SelectSwapQROM and fix cost discrepancies with QROAM.

As a follow up PR, i'll update the unary_iteration bloq to support symbolics in general and also its other derived bloqs.

Based on top off #942

Copy link
Collaborator

@fdmalone fdmalone left a comment

Choose a reason for hiding this comment

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

Very nice. I had a question about the shape in symbolic qrom.

@fdmalone
Copy link
Collaborator

The bitsizes are a bit unfortunate here:
Screenshot 2024-05-11 at 5 22 50 AM

Do we have an issue to convert symbolics to math? (Is it possible for show_bloqs)

@fdmalone
Copy link
Collaborator

Maybe my jupyter is whacky but the MSD also looks off:
Screenshot 2024-05-11 at 5 39 43 AM

@fdmalone
Copy link
Collaborator

nvm just need to make it big:

Screenshot 2024-05-11 at 5 42 23 AM

@tanujkhattar
Copy link
Collaborator Author

Do we have an issue to convert symbolics to math? (Is it possible for show_bloqs)

I'm not sure, but +1 that it'll be a useful feature - Maybe @mpharrigan knows more.

@tanujkhattar tanujkhattar enabled auto-merge (squash) May 13, 2024 18:28
@tanujkhattar tanujkhattar merged commit 57d14d0 into quantumlib:main May 13, 2024
7 checks passed
@mpharrigan
Copy link
Collaborator

what do you mean convert it to math?

@tanujkhattar
Copy link
Collaborator Author

Render a latex expression $\lceil x \rceil$ instead of 'ceiling(x)'

@mpharrigan
Copy link
Collaborator

The graphviz dot/svg exporter can't render latex math. There exists https://ctan.org/pkg/dot2tex?lang=en which would -- in theory -- render latex math from a graphviz format

The matplotlib circuit drawer can render latex math, because matplotlib can render latex math. You have to enclose it in $.

To get latex math from a sympy expression, you use the latex() printing function https://docs.sympy.org/latest/tutorials/intro-tutorial/printing.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants