Skip to content

Commit ab9521f

Browse files
add r qiskit gate to qiskit2c
1 parent dcb85de commit ab9521f

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

tensorcircuit/translation.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -486,6 +486,13 @@ def qiskit2tc(
486486
getattr(tc_circuit, gate_name)(*idx, theta=parameters)
487487
elif gate_name in ["crx_o0", "cry_o0", "crz_o0"]:
488488
getattr(tc_circuit, "o" + gate_name[1:-3])(*idx, theta=parameters)
489+
elif gate_name in ["r"]:
490+
getattr(tc_circuit, "u")(
491+
*idx,
492+
theta=parameters[0],
493+
phi=parameters[1] - np.pi / 2,
494+
lbd=-parameters[1] + np.pi / 2,
495+
)
489496
elif gate_name in ["u3", "u"]:
490497
getattr(tc_circuit, "u")(
491498
*idx, theta=parameters[0], phi=parameters[1], lbd=parameters[2]

0 commit comments

Comments
 (0)