Skip to content

Commit

Permalink
[minor] added all aliases
Browse files Browse the repository at this point in the history
  • Loading branch information
01110011011101010110010001101111 committed Sep 15, 2023
1 parent 7ac5fa3 commit 15502ea
Showing 1 changed file with 21 additions and 6 deletions.
27 changes: 21 additions & 6 deletions torchquantum/operator/standard_gates/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,24 @@
op_name_dict = {x.op_name: x for x in all_variables}

# add aliases as well
op_name_dict["cx"] = CNOT
op_name_dict["paulix"] = PauliX
op_name_dict["h"] = H
op_name_dict["u"] = U
op_name_dict["qubitunitary"] = QubitUnitary
op_name_dict["qubitunitaryfast"] = QubitUnitaryFast
op_name_dict.update(
{
"h": H,
"sh": SH,
"u": U,
"qubitunitary": QubitUnitary,
"qubitunitaryfast": QubitUnitaryFast,
"x": PauliX,
"y": PauliY,
"z": PauliZ,
"cx": CNOT,
"xx": RXX,
"yy": RYY,
"zz": RZZ,
"zx": RZX,
"ccx": Toffoli,
"p": U1,
"cp": CU1,
"cr": CU1,
}
)

0 comments on commit 15502ea

Please sign in to comment.