As the development of quantum computers, which are the dreams of humankind, is accelerating all over the world, ** quantum computer simulators ** occupy an important position alongside actual quantum computers, such as performing preliminary calculations. ** blueqat ** is one of the world's most popular quantum computer simulators as open source software that uses the Python language. Developed and released by blueqat Co., Ltd. (Tokyo) in Japan.
■ blueqat --Open source quantum computing platform https://blueqat.com/?hl=ja
Originally provided as PYPI (Python language library), blueqat was installed and used in the local PC environment using the pip install command, but in August 2020 ** blueqat cloud ** (Bluecat cloud) Cloud) has been released as a cloud service and is now available online.
Of course, you can also install and use it in your local environment with pip install from the PYPI library.
** blueqat cloud is all free and anyone can use it immediately! **
To use blueqat cloud, you need to register for an account on the blueqat cloud system. In this article, I would like to introduce the procedure from registering an account to the blueqat cloud system, building a simple gate circuit, and actually running the simulator.
Also, I would like to briefly describe the difference from the service provided by the paid contract as blueqat pro.
① First, access the following with a browser. https://blueqat.com/?hl=ja
② Click the registration button.
③ Enter your e-mail address and password, check the "Terms of Service", and click the account registration button.
④ Enter the confirmation code sent to the registered email address.
This completes account registration.
For the second and subsequent logins, please log in with your registered email address and password.
The first screen after login is as follows.
To start programming, click on the menu "blue qat" below the notebook list.
You can also change your password by clicking ** Settings ** in the upper right corner.
** ① Create a notebook **
Click the menu "blue qat" below the notebook list.
A project named "blueqat" has been created as shown below.
Click the button "Open Notebook" in the upper right corner.
The status will be displayed as shown below, so wait for a while.
When the notebook screen is displayed, you are ready to go.
The notebook screen is provided by Jupyter Lab. (Container starts for each notebook)
: point_up: ** Supplementary information ** -You can only create one notebook. -The notebook name cannot be changed.
** ② Create a program **
Click below to create a Jupyter Notebook page.
The Jupyter Notebook page will be created as shown below. Rename the file if necessary.
After that, it is the same as how to use Jupyter Notebook normally.
As a test, I tried to display the Python version.
The current Python version is 3.8.4.
** ③ Exit the notebook **
Click "Log Out" from the menu "File" of Jupyter Notebook.
Now that we are ready for quantum programming, let's create and execute a simple gate circuit.
** ① Write a program (gate circuit) with blueqat **
Here, I write a program that prepares one qubit initialized with ** | 0> ** (Ket vector 0), applies the Hadamard transform (H gate), and then measures it. I will try.
Please refer to the official document for the grammar of the program.
■ blueqat official document https://blueqat.readthedocs.io/ja/latest/
myFirstApp.ipynb
#=====================================
#A program that calculates the gate circuit with blueqat
#=====================================
from blueqat import Circuit
shots_num = 100 #Set the number of calculations(100 times)
c = Circuit(1) #Create 1qbits
c.h[0] #Acting Hadamard Gate
res = c.m[0].run(shots=shots_num) #Perform circuit measurements
print(res) #Display calculation result
The schematic I want to execute is below.
Also, add the following program to display the execution result as a graph.
myFirstApp.ipynb
#Display the result calculated above as a graph
import matplotlib.pyplot as plt
fig, ax = plt.subplots()
x = ['0','1']
y = [res['0'] / shots_num, res['1'] / shots_num] #Store calculation results
ax.bar(x, y) #Display as a bar graph
plt.show() #Draw graph
** ② Execute with Jupyter Notebook (operation check) **
Enter the above program in a cell of Jupyter Notebook and execute it.
In the figure below, the execution result is displayed with a red frame.
It was obtained from the simulator calculation results that the qubit becomes a superposition of 0 and 1 by applying the H gate, and the probability is about 50%: 50%.
This is the end of the operation check.
So far, we have introduced the functions that can be used for free with blueqat cloud, but as a higher-level service, a paid blueqat cloud version is available. This service was previously provided under the name ** blueq at pro **. The following additional services are available here, and the system is such that more effective quantum computing solutions can be utilized in business.
For the latest service content, please obtain the latest information from the company's website.
■ Free quantum computing cloud environment, blueqat cloud https://qiita.com/YuichiroMinato/items/3e82c3d44526e0d462f4
■ blueqat official document https://blueqat.readthedocs.io/ja/latest/
■ Simulate a quantum computer with Raspberry PI (blueqat environment construction) https://qiita.com/ttlabo/items/ac098d3ea7cb36013c86
■ Simulate a quantum computer with Raspberry PI (IBM Qiskit environment construction) https://qiita.com/ttlabo/items/64f06b7cdf3a44971c77
If you have any opinions or corrections, please let us know.
Recommended Posts