Skip to content

Commit

Permalink
Merge pull request #138 from CQCL/136-errorrootgate-phase05-unsupport…
Browse files Browse the repository at this point in the history
…ed-by-phir
  • Loading branch information
qartik authored Feb 27, 2024
2 parents 2604e8e + 7546a87 commit 3edc92f
Show file tree
Hide file tree
Showing 5 changed files with 2,223 additions and 13 deletions.
8 changes: 5 additions & 3 deletions pytket/phir/phirgen.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,9 @@ def convert_subcmd(op: tk.Op, cmd: tk.Command) -> JsonDict | None:
try:
gate = tket_gate_to_phir[op.type]
except KeyError:
if op.type == tk.OpType.Phase:
# ignore global phase
return {"mop": "Skip"}
logging.exception("Gate %s unsupported by PHIR", op.get_name())
raise
angles = (op.params, "pi") if op.params else None
Expand All @@ -186,8 +189,7 @@ def convert_subcmd(op: tk.Op, cmd: tk.Command) -> JsonDict | None:
"returns": [arg_to_bit(cmd.bits[0])],
"args": [arg_to_bit(cmd.args[0])],
}
case (
"CX"
case ("CX"
| "CY"
| "CZ"
| "RXX"
Expand All @@ -201,7 +203,7 @@ def convert_subcmd(op: tk.Op, cmd: tk.Command) -> JsonDict | None:
| "SZZ"
| "SZZdg"
| "SWAP"
): # two-qubit gates
): # two-qubit gates # fmt: skip
qop = {
"qop": gate,
"angles": angles,
Expand Down
5 changes: 3 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ networkx==2.8.8
phir==0.3.0
pre-commit==3.6.2
pydata_sphinx_theme==0.15.2
pytest==8.0.1
pytest==8.0.2
pytest-order==1.2.0
pytket==1.25.0
ruff==0.2.2
setuptools_scm==8.0.4
sphinx==7.2.6
wasmtime==17.0.1
wasmtime==18.0.0
wheel==0.42.0
Loading

0 comments on commit 3edc92f

Please sign in to comment.