Skip to content

Add support for more elements in qir for cirq#175

Draft
JettChenT wants to merge 2 commits intotencent-quantum-lab:masterfrom
JettChenT:cirq-transp
Draft

Add support for more elements in qir for cirq#175
JettChenT wants to merge 2 commits intotencent-quantum-lab:masterfrom
JettChenT:cirq-transp

Conversation

@JettChenT
Copy link
Copy Markdown

#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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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