Skip to content

Split2QUnitaries assumes node.op is ndarray #12970

@qci-amos

Description

@qci-amos

The TwoQubitWeylDecomposition says it only accepts ndarray:

def __init__(
self,
unitary_matrix: np.ndarray,
fidelity: float | None = 1.0 - 1.0e-9,
*,
_specialization: two_qubit_decompose.Specialization | None = None,
):

However this line is passing a node op:

decomp = TwoQubitWeylDecomposition(node.op, fidelity=self.requested_fidelity)

some of my code is now failing in qiskit 1.2.0 because in some of my unit tests, this is an Instruction which is, for what it's worth, not a gate in the qiskit library.

My problem goes away if I replace this:

    circuit = qiskit.transpile(circuit, basis_gates=basis_gates, optimization_level=2)

in my test with:

    circuit = qiskit.transpile(circuit, basis_gates=basis_gates, optimization_level=1)

Linking associated PRs:
#12727
#12898

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions