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 support for more elements in qir for cirq #175

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

JettChenT
Copy link

#68

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))
Copy link
Contributor

Choose a reason for hiding this comment

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

if no value specified, controlled is for cx cy cz gates?

Copy link
Author

Choose a reason for hiding this comment

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

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.

Copy link
Contributor

Choose a reason for hiding this comment

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

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":
Copy link
Contributor

Choose a reason for hiding this comment

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

this gate has parameters

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.

2 participants