qiskit/releasenotes/notes/0.25/relax_wire_order_restrictio...

35 lines
1.1 KiB
YAML

---
features:
- |
Some restrictions when using ``wire_order`` in the circuit drawers had been relaxed.
Now, ``wire_order`` can list just qubits and, in that case, it can be used
with ``cregbundle=True``, since it will not affect the classical bits.
.. code-block::
from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister
qr = QuantumRegister(4, "q")
cr = ClassicalRegister(4, "c")
cr2 = ClassicalRegister(2, "ca")
circuit = QuantumCircuit(qr, cr, cr2)
circuit.h(0)
circuit.h(3)
circuit.x(1)
circuit.x(3).c_if(cr, 10)
circuit.draw('text', wire_order=[2, 3, 0, 1], cregbundle=True)
.. code-block:: text
q_2: ────────────
┌───┐ ┌───┐
q_3: ┤ H ├─┤ X ├─
├───┤ └─╥─┘
q_0: ┤ H ├───╫───
├───┤ ║
q_1: ┤ X ├───╫───
└───┘┌──╨──┐
c: 4/═════╡ 0xa ╞
└─────┘
ca: 2/════════════