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

Add ArcSin bloq #1188

Merged
merged 11 commits into from
Jul 26, 2024
Merged

Add ArcSin bloq #1188

merged 11 commits into from
Jul 26, 2024

Conversation

charlesyuan314
Copy link
Contributor

The deccomposition of this bloq is quite tricky (polynomial interpolation followed by some arithmetic and square roots), but for now we start with its Toffoli count as derived from the referenced paper.



@frozen
class ArcSin(Bloq):
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'd suggest we also override on_classical_vals and my_tensors to support simulations. The only protocol left would then be the decomposition; which can be added at a later point in time.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Happy to, but question: I saw this comment which suggested that classical values for QFxp are not correctly propagated through bloqs.

Is that something to watch out for?

Copy link
Collaborator

Choose a reason for hiding this comment

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

There's ongoing work to fix this, see #1142

You can look at implementation of AddScaledValIntoPhaseReg to see how to implement the simulation protocols for bloqs expecting QFxp to the best of the ability of the infrastructure we have right now.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added on_classical_vals and tests for it.

I'd like to add my_tensors in a follow-up PR given its increased complexity.

@mpharrigan mpharrigan enabled auto-merge (squash) July 26, 2024 20:02
@mpharrigan mpharrigan merged commit cde6cba into quantumlib:main Jul 26, 2024
8 checks passed
@charlesyuan314 charlesyuan314 deleted the trig branch July 26, 2024 21:15
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.

4 participants