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

Clarification: Standard function definitions #62

Open
MarquessV opened this issue Mar 22, 2023 · 1 comment
Open

Clarification: Standard function definitions #62

MarquessV opened this issue Mar 22, 2023 · 1 comment
Assignees
Labels
2024.1 Changes for the 2024.1 specification.

Comments

@MarquessV
Copy link

The Quil spec references the cis function in an example for DEFGATE:

The definition of CAN can be written as the following Quil matrix definition:

DEFGATE CAN(%alpha, %beta, %gamma):
    (cis((%alpha+%beta-%gamma)/2)+cis((%alpha-%beta+%gamma)/2))/2, 0, 0, (cis((%alpha-%beta+%gamma)/2)-cis((%alpha+%beta-%gamma)/2))/2
    0, (cis((%alpha+%beta+%gamma)/(-2))+cis((%beta+%gamma-%alpha)/2))/2, (cis((%alpha+%beta+%gamma)/(-2))-cis((%beta+%gamma-%alpha)/2))/2, 0
    0, (cis((%alpha+%beta+%gamma)/(-2))-cis((%beta+%gamma-%alpha)/2))/2, (cis((%alpha+%beta+%gamma)/(-2))+cis((%beta+%gamma-%alpha)/2))/2, 0
    (cis((%alpha-%beta+%gamma)/2)-cis((%alpha+%beta-%gamma)/2))/2, 0, 0, (cis((%alpha+%beta-%gamma)/2)+cis((%alpha-%beta+%gamma)/2))/2

If I understand correctly: cis, sin, cos, exp, and sqrt` are all standard functions that can be used in (at least) gate definitions, but they don't appear in the spec outside of the above example. It would be nice to document their existence, where they can be used, and if they are treated like other keywords.

@stylewarning
Copy link
Member

Great idea. By the way, CIS(x) is $e^{ix}$.

@stylewarning stylewarning self-assigned this Feb 15, 2024
@stylewarning stylewarning added the 2024.1 Changes for the 2024.1 specification. label Feb 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2024.1 Changes for the 2024.1 specification.
Projects
None yet
Development

No branches or pull requests

2 participants