Skip to content

Commit abf141d

Browse files
committed
Add: Gate check in ElidePermutations.
1 parent 89ee4d7 commit abf141d

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

crates/transpiler/src/passes/elide_permutations.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,12 @@ pub fn run_elide_permutations(dag: &DAGCircuit) -> PyResult<Option<(DAGCircuit,
4949
let index1 = qargs[1].index();
5050
mapping.swap(index0, index1);
5151
}
52-
OperationRef::PyCustom(gate) if gate.name() == "permutation" => {
52+
OperationRef::PyCustom(
53+
gate @ qiskit_circuit::operations::PyInstruction {
54+
kind: qiskit_circuit::operations::PyOpKind::Gate,
55+
..
56+
},
57+
) if gate.name() == "permutation" => {
5358
Python::attach(|py| -> PyResult<()> {
5459
let params = inst.params_view();
5560
if let Param::Obj(ref pyobj) = params[0] {

0 commit comments

Comments
 (0)