Quantum Computing Asked by A. Jahin on October 7, 2020
I’m using Qiskit to demonstrate some circuits, and I want to change the position of some gates for better representation.
For example, look at this circuit:
I’d like for the last $R_x(frac{-pi}{2})$ to align with the last Hadamard gate. Is there a way to do this without using barriers?
The justify=
parameter might help.
qc.draw('mpl', reverse_bits=True, justify='right')
Other option is to add the barrier
and then remove them from the plot (though that will skip all the barriers)
...
qc.barrier(range(4))
qc.h(3)
qc.rx(-pi/2, 0)
qc.draw('mpl', reverse_bits=True, plot_barriers=False)
Correct answer by luciano on October 7, 2020
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP