It seems that you can now write gate books with blueqat

There was a tweet that felt like drawing a quantum gate with blueqat, so I tried to verify it.

Environmental preparation

To prepare the environment, just type the following command.

pip install blueqat obaq

I actually moved it

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. obaq-sample1.JPG

Oh, it's done! It looks cute.

Finally

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

It seems that you can now write gate books with blueqat
You can now display slides with nbviewer! [Jupyter]
If you write TinderBot in Python, she can do it
Don't write Python if you want to speed it up with Python
Cosine similarity matrix? You can get it right away with NumPy
Kalman filter that you can understand
If you try to start the jupyter notebook installed with pip and it says "command not found", it seems that you can go through the PATH.
Python | What you can do with Python
Did you know that you can port forward with ssh for IP aliases?
You can do it with Python! Structural analysis of two-dimensional colloidal crystals
[Feature-length poem] I don't understand functional languages You can understand it with Python: Part 1 Functions that receive functions are convenient.
It seems that cancelall childorders can be used to cancel all parent orders (special orders) with the bitflyer API