Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ circuit = parser.parse_file("my_circuit.qasm")
| [x](https://openqasm.com/language/standard_library.html#x) | X |
| [y](https://openqasm.com/language/standard_library.html#y) | Y |
| [z](https://openqasm.com/language/standard_library.html#z) | Z |
| [id](https://openqasm.com/language/standard_library.html#id) | I |
| [rx](https://openqasm.com/language/standard_library.html#rx) | RX |
| [ry](https://openqasm.com/language/standard_library.html#ry) | RY |
| [rz](https://openqasm.com/language/standard_library.html#rz) | RZ |
Expand Down
5 changes: 4 additions & 1 deletion graphix_qasm_parser/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
ParserRuleContext,
)
from graphix import Circuit
from graphix.instruction import CCX, CNOT, RX, RY, RZ, RZZ, SWAP, H, S, X, Y, Z
from graphix.instruction import CCX, CNOT, RX, RY, RZ, RZZ, SWAP, H, I, S, X, Y, Z
from openqasm_parser import qasm3Lexer, qasm3Parser, qasm3ParserVisitor

# override introduced in Python 3.12
Expand Down Expand Up @@ -317,6 +317,9 @@ def visitGateCallStatement(self, ctx: qasm3Parser.GateCallStatementContext) -> N
elif gate == "z":
# https://openqasm.com/language/standard_library.html#z
instruction = Z(target=operands[0])
elif gate == "id":
# https://openqasm.com/language/standard_library.html#id
instruction = I(target=operands[0])
elif gate == "rx":
# https://openqasm.com/language/standard_library.html#rx
instruction = RX(target=operands[0], angle=exprs[0])
Expand Down