Skip to content

Commit

Permalink
added QFT to gates_to_decompose
Browse files Browse the repository at this point in the history
  • Loading branch information
gluonhiggs committed Nov 22, 2024
1 parent 7db464f commit 3b81eb2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions mitiq/interface/mitiq_qiskit/conversions.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,17 +249,19 @@ def from_qiskit(circuit: qiskit.QuantumCircuit) -> cirq.Circuit:
Returns:
Mitiq circuit representation equivalent to the input Qiskit circuit.
"""

try:
mitiq_circuit = from_qasm(qasm2.dumps(circuit))
except QasmException:
# Try to decompose circuit before running
# This is necessary for converting qiskit circuits with
# custom packaged gates, e.g., QFT gates
gates_to_decompose = ["rxx", "rzz", "rzx", "ryy", "QFT"]
circuit = circuit.decompose(
gates_to_decompose=["u3", "cx", "rx", "ry", "rz"]
gates_to_decompose=gates_to_decompose, reps=10
)
circuit = circuit.decompose()
mitiq_circuit = from_qasm(qasm2.dumps(circuit))

return mitiq_circuit


Expand Down

0 comments on commit 3b81eb2

Please sign in to comment.