There was a tweet that felt like drawing a quantum gate with blueqat, so I tried to verify it.
To prepare the environment, just type the following command.
pip install blueqat obaq
The code is below.
#Library import
import obaq
from blueqat import Circuit
#Quantum gate definition
c = Circuit(1).h[0].m[:]
#Quantum gate drawing
c.run(backend="obaq", returns="draw")
This time, I prepared one qubit and made a circuit to observe by operating the Hadamard gate. The execution result is as follows.
Oh, it's done! It looks cute.
Looking at the execution result, I thought, but I am a little worried that the measurement does not appear in the figure. Since the measurement is the last, there may be no problem, but I felt that the information was slightly missing.
See you in the next post!
Recommended Posts