I have set the qml.drawer.use_style(‘black_white’), but it doesn’t seem to work
import pennylane as qml
qml.drawer.use_style('black_white')
# Set up the drawer (Corrected n_layers to 16 to include layer 15)
drawer = qml.drawer.MPLDrawer(wire_map={i: i for i in range(3)}, n_layers=16)
drawer.label(["qubit 0", "qubit 1", "qubit 2"])
# --- Your circuit drawing code ---
# Use a for loop to place individual gates instead of a block
for i in range(3):
drawer.box_gate(layer=0, wires=i, text="RY")
drawer.box_gate(layer=1, wires=i, text="H")
drawer.box_gate(layer=3, wires=i, text="RZ")
drawer.box_gate(layer=4, wires=i, text="RX")
drawer.box_gate(layer=5, wires=i, text="RZ")
# CNOTs are fine as they are
drawer.CNOT(layer=6, wires=(0, 1))
drawer.CNOT(layer=7, wires=(1, 2))
# Use a for loop for these gates too
for i in range(3):
drawer.box_gate(layer=9, wires=i, text="RX")
drawer.box_gate(layer=10, wires=i, text="RZ")
drawer.box_gate(layer=11, wires=i, text="RZ")
# CNOTs and measures are fine
drawer.CNOT(layer=12, wires=(0, 1))
drawer.CNOT(layer=13, wires=(1, 2))
drawer.measure(layer=15, wires=0)
drawer.measure(layer=15, wires=1)
drawer.measure(layer=15, wires=2)
drawer.fig.suptitle('My Circuit', fontsize='xx-large')
It still produces the figure
