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

Inconsistent Gate Names #49

Closed
lazyoracle opened this issue Feb 9, 2021 · 7 comments · Fixed by #50
Closed

Inconsistent Gate Names #49

lazyoracle opened this issue Feb 9, 2021 · 7 comments · Fixed by #50
Assignees
Labels
enhancement New feature or request important Needs immediate work
Milestone

Comments

@lazyoracle
Copy link
Member

Describe the bug
Naming of gates in C3 is inconsistent with the standard naming convention followed in quantum computing textbooks and community.

Details
What we call X90p (and all similarly named gates for X, Y and Z) is essentially RX(90) as usually referenced elsewhere.

Expected behavior

Current Name Expected Name
X90p RX90p
Xp RXp
X90m RX90m
Same for Y, Z Same for Y, Z
CNOT CRXp
CZ CRZp
CR What does this do?
CR90 Seems fine?
iSWAP Can someone check this?
@lazyoracle lazyoracle added bug Something isn't working important Needs immediate work labels Feb 9, 2021
@lazyoracle lazyoracle added this to the 1.2.2 milestone Feb 9, 2021
@lazyoracle lazyoracle self-assigned this Feb 9, 2021
@lazyoracle lazyoracle linked a pull request Feb 9, 2021 that will close this issue
@fedroy
Copy link
Collaborator

fedroy commented Feb 9, 2021

I'm not sure that there is really a convention that is agreed upon.
I'm guessing most lab would compile an X in a circuit to be a RX(pi) because ultimately the only difference is a i.
Not sure how you would do it otherwise...

@GlaserN
Copy link
Collaborator

GlaserN commented Feb 9, 2021

I guess this new notation over complicates the notation.
I guess most textbooks would call x90p only to be a X-gate (also qiskit) analogous for being an Y and Z. However It will be useful to seperate between plus and minus gate. And find a unifying notation. However using rx is not really useful as this is mostly used as an pi/2 pulse and not using a notation in degrees, hence not making it more understandable.

For the CZ and CNOT gate I would say the new notation to be very confusing. As text books would only refer to them as such or for CNOT as CX.

@fedroy
Copy link
Collaborator

fedroy commented Feb 12, 2021

@lazyoracle
Copy link
Member Author

A renaming and restructuring of how we assign gates and qubits and indices and parameters is due as @nwittler is working on it. That should hopefully adopt OpenQasm specifications which would (ideally) mean we fully comply with Qiskit gate naming scheme. Which in short, is that X, Y, Z refer to Pauli matrix gates and all rotational (and other parametric) gates are specified with a parameter. This also has the added benefit of extra clarity in names reflecting actual gate implementations. If we wish to not take up the Qiskit nomenclature for gates, we would need to discuss, decide and thoroughly document our internal nomenclature that is scalable and flexible. Once that is in place, this discussion of X == RX90p would be moot.

@shaimach
Copy link
Collaborator

shaimach commented Feb 12, 2021 via email

@lazyoracle
Copy link
Member Author

Preview of what gate and qubit naming looks like in OpenQasm and what we hopefully will adopt.

instructions: [
                {"name": "rx", "qubits": [0], "params": [0.4]},
                {"name": "u2", "qubits": [0], "params": [0.4,0.2]},
                {"name": "u3", "qubits": [0], "params": [0.4,0.2,-0.3]},
                {"name": "cx", "qubits": [0,1]},
                {"name": "measure", "qubits": [0], "register": [1], "memory": [0]},
            ]

@lazyoracle lazyoracle added enhancement New feature or request and removed bug Something isn't working labels Feb 12, 2021
@lazyoracle
Copy link
Member Author

Related: #57

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request important Needs immediate work
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants