Skip to content

Commit

Permalink
improving release notes
Browse files Browse the repository at this point in the history
  • Loading branch information
alexanderivrii committed Jan 15, 2025
1 parent 9a3202c commit 0421e7f
Showing 1 changed file with 24 additions and 5 deletions.
29 changes: 24 additions & 5 deletions releasenotes/notes/add-max-block-width-arg-e3677a2d26575a73.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,27 @@
---
features_transpiler:
- |
Add a new argument ``max_block_width`` to the class :class:`~BlockCollector`,
and to the transpiler passes :class:`~CollectLinearFunctions` and :class:`~CollectCliffords`
that are based on this class.
This argument enforces block collection strategies to restrict the maximum number of qubits
over which a block of nodes is defined.
Added a new argument ``max_block_width`` to the class :class:`.BlockCollector`
and to the transpiler passes :class:`.CollectLinearFunctions` and :class:`.CollectCliffords`.
This argument allows to restrict the maximum number of qubits over which a block of nodes is
defined.
For example::
from qiskit.circuit import QuantumCircuit
from qiskit.transpiler.passes import CollectLinearFunctions
qc = QuantumCircuit(5)
qc.h(0)
qc.cx(0, 1)
qc.cx(1, 2)
qc.cx(2, 3)
qc.cx(3, 4)
# Collects all CX-gates into a single block
qc1 = CollectLinearFunctions()(qc)
qc1.draw(output='mpl')
# Collects CX-gates into two blocks of width 3
qc2 = CollectLinearFunctions(max_block_width=3)(qc)
qc2.draw(output='mpl')

0 comments on commit 0421e7f

Please sign in to comment.