Skip to content

HoareOptimiser causes qiskit.dagcircuit.exceptions.DAGCircuitError #13165

@IlanIwumbwe

Description

@IlanIwumbwe

Environment

  • Qiskit version: 1.3.0 (compiled from source)
  • Python version: 3.11.6
  • Operating system: Ubuntu 23.01 LTS

Benny and I found this bug.

What is happening?

Passing circuit through transpiler with Hoare optimizer then running it causes qiskit.dagcircuit.exceptions.DAGCircuitError.

How can we reproduce the issue?

from qiskit import QuantumCircuit
from qiskit.transpiler import PassManager
from qiskit.transpiler.passes import HoareOptimizer

main_circ = QuantumCircuit(4)
main_circ.u(-0.273000,0.121000,0.659000, 2)
main_circ.cy(2,3)
main_circ.cy(2,3)
main_circ.cy(2,1)
main_circ.s(1)
main_circ.cy(1,3)
main_circ.h(1)
main_circ.cy(1,0)
main_circ.s(1)
main_circ.u(0.223000,0.989000,0.989000, 1)
main_circ.s(1)
main_circ.u(-0.120000,-0.509000,0.356000, 1)
main_circ.h(1)

print(main_circ)

pm = PassManager(HoareOptimizer())
pass_circ = pm.run(main_circ)

What should happen?

Circuit should run normally. This may have been introduced from commits made that aren't in 1.2.1. Just wanted to let you know about it before your next release even though we understand that this isn't the version that most users will be using.

Any suggestions?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions