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

feat: Add almost all missing pure quantum ops from pytket to Tk2Op #430

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 52 additions & 10 deletions tket2-py/tket2/ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,69 @@
class Tk2Op(Enum):
"""A Tket2 built-in operation."""

H = auto()
CX = auto()
T = auto()
S = auto()
X = auto()
Y = auto()
Z = auto()
H = auto()
T = auto()
Tdg = auto()
S = auto()
Sdg = auto()
ZZMax = auto()
Measure = auto()
RzF64 = auto()
SX = auto()
SXdg = auto()
V = auto()
Vdg = auto()
RxF64 = auto()
RyF64 = auto()
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is not related to this PR, but I wonder why we added the "F64" suffix to Rx, Ry and Rz, but not to other operations that have angle parameters (e.g. U1).

(I actually prefer without, for conciseness.)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, I was going to propose dropping the suffix in another PR

RzF64 = auto()
TK1 = auto()
U1 = auto()
U2 = auto()
U3 = auto()
PhasedX = auto()
ZZPhase = auto()
AngleAdd = auto()
CX = auto()
CY = auto()
CZ = auto()
TK1 = auto()
CH = auto()
CT = auto()
CTdg = auto()
CS = auto()
CSdg = auto()
CSX = auto()
CSXdg = auto()
CV = auto()
CVdg = auto()
CRxF64 = auto()
CRyF64 = auto()
CRzF64 = auto()
CU1 = auto()
CU2 = auto()
CU3 = auto()
GPI = auto()
GPI2 = auto()
XXPhase = auto()
YYPhase = auto()
ZZPhase = auto()
ZZMax = auto()
TK2 = auto()
SWAP = auto()
CSWAP = auto()
BRIDGE = auto()
CCX = auto()
ECR = auto()
ISWAP = auto()
ISWAPMax = auto()
PhasedISWAP = auto()
ESWAP = auto()
XXPhase3 = auto()
FSim = auto()
Sycamore = auto()
AAMS = auto()
Measure = auto()
QAlloc = auto()
QFree = auto()
Reset = auto()
AngleAdd = auto()

def _to_rs(self) -> tket2._tket2.ops.Tk2Op:
"""Convert to the Rust-backed Tk2Op representation."""
Expand Down
Loading
Loading