Skip to content

Commit

Permalink
Adds release notes for PR
Browse files Browse the repository at this point in the history
  • Loading branch information
emilkovacev committed Oct 12, 2024
1 parent 616c67e commit 379c4e1
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions releasenotes/notes/dag_drawer_custom_style-ec99bd874858f6a6.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
features_visualization:
- |
Introduced custom styles for the dag_drawer() function. This allows you
to pass a dictionary to the `style` parameter with custom attributes that
changes the style of the DAG the function returns. For example::
from qiskit import QuantumRegister, ClassicalRegister, QuantumCircuit
from qiskit.converters import circuit_to_dag
from qiskit.visualization import dag_drawer
q = QuantumRegister(3, 'q')
c = ClassicalRegister(3, 'c')
circ = QuantumCircuit(q, c)
circ.h(q[0])
circ.cx(q[0], q[1])
circ.measure(q[0], c[0])
circ.rz(0.5, q[1]).c_if(c, 2)
dag = circuit_to_dag(circ)
style = {
"inputnodecolor": "pink",
"outputnodecolor": "lightblue",
"opnodecolor": "red",
}
dag_drawer(dag, style=style)
fixes:
- |
Fixes a bug where `style=plain` did not show circuit labels for the nodes
of the DAG.

0 comments on commit 379c4e1

Please sign in to comment.