Add support for more elements in qir for cirq#175
Draft
JettChenT wants to merge 2 commits intotencent-quantum-lab:masterfrom
Draft
Add support for more elements in qir for cirq#175JettChenT wants to merge 2 commits intotencent-quantum-lab:masterfrom
JettChenT wants to merge 2 commits intotencent-quantum-lab:masterfrom
Conversation
| elif gate_name == "reset": | ||
| cmd.append(cirq.ResetChannel().on(*index)) | ||
| elif gate_name in ["ox", "oy", "oz"]: | ||
| cmd.append(getattr(cirq, gate_name[1:])().controlled().on(*index)) |
Contributor
There was a problem hiding this comment.
if no value specified, controlled is for cx cy cz gates?
Author
There was a problem hiding this comment.
Hi! Theoretically that would be the case, as Gate.controlled() turns a gate (x,y,z in this case) into a controlled gate according to cirq's documentation.
Though I am still having some trouble trying to set up the development environment on my mac M2 machine, and haven't been able to test the gates yet.
Contributor
There was a problem hiding this comment.
for m2, I guess this may help https://tensorcircuit.readthedocs.io/en/latest/contribs/development_Mac.html
| cmd.append(getattr(cirq, gate_name[1:])().controlled().on(*index)) | ||
| elif gate_name in ["orx", "ory", "orz"]: | ||
| cmd.append(getattr(cirq, gate_name[1:])(_get_float(parameters, "theta")).controlled().on(*index)) | ||
| elif gate_name == "phase": |
Contributor
There was a problem hiding this comment.
this gate has parameters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#68