ラベル Bloch sphere の投稿を表示しています。 すべての投稿を表示
ラベル Bloch sphere の投稿を表示しています。 すべての投稿を表示

2023年12月5日火曜日

Final version of my single-qubit apps

I recently completed the final versions of two apps for single-qubit manipulation!

These apps were developed in a short period of time using MIT App Inventor. Although many existing blocks could be used effectively, some ingenuity was required to represent the qubit states on the Bloch sphere. The problem was to project 3D coordinate data (x, y, z) onto a 2-dimensional plane, and I was able to solve this problem by using the isometric projection method.

(1) Displaying the results of successive application of quantum gates
Five types of quantum gates (Z, X, Y, H, T) can be used. The figure below (b) shows the result of successively applying H, T, and H to the quantum bit |0>. The final qubit state is shown as a big red dot on the Bloch sphere on the left. Small disks are also shown to the right. The area of the filled disk indicates the probability of each basis (|0>, |1>). A straight line coming out from the center of the circle indicates the phase. At the bottom of the Bloch sphere, some numerical values indicating quantum states are also shown.

(2) Conversion to make the phase of α 0 in qubit α|0>+β|1>
In order to represent a quantum bit on a Bloch sphere, the phase of α needs to be 0, and the phase of β needs to be the relative phase (φ) to it. The app shown below achieves this functionality. This is also a transformation that makes the imaginary part of the complex number α 0. Figure (b) below confirms that this conversion function is working correctly.

2023年12月2日土曜日

Dynamic representation of qubit for arbitrary θ and Φ

The static Bloch sphere model image is good, but it would be even better if we could dynamically represent the quantum bit state for arbitrary θ and Φ values !

I made this possible with a smartphone app! 

Generally speaking, it is somewhat difficult to create a 3D representation using MIT App Inventor, but it was relatively easy to map points on a Bloch sphere with a radius of 1 onto a 2D plane using Isometric projection.
Also check out the short video in action below.


2023年12月1日金曜日

Developing the most basic app to understand Qubit state (3)

Sometimes we need to go back to basics!
In the third article in this series, I'll compare my app's results with that of IBM Quantum Composer to confirm that it's working correctly. In my app I can use quantum gates Z, X, Y, T, H.  The T is a quantum gate that adds the phase of e^iφ to the qubit |1>. By default, φ=π/4. Also, H is a Hadamard gate. Here, as an example, H, T, and H are successively applied in this order to the quantum bit initial state |0>.

Fig.1 shows (a) the execution results of my app and (b) the execution results of IBM Quantum. In (a), the probability (area of the colored disk) and phase (the angle of the straight line coming out from the center of the circle) are shown for |0> and |1>. On the other hand, in (b), the results are displayed only for |1>. Although the way the disks are displayed is slightly different, it can be seen that the probabilities and phases of both are the same. However, the values of probability amplitude (amplitude in (a) and Output state in (b)) seem to be different. This will be explained in Fig.2.
Fig.2 explains that although the expressions of the probability amplitudes of the two are different, they are the same quantum state. In my app, the phase with respect to |0> is zero, and the phase of |1> is the relative phase to it. This does not seem to be the case with IBM Quantum. In fact, when I input IBM's probability amplitude numbers into my app's function state2relphase, the results I got matched my app's representation of probability amplitudes. This result confirms that my app is working perfectly correctly, at least for this example.

2023年11月27日月曜日

Developing the most basic app to understand Qubit state (2)

 Sometimes we need to go back to basics!

This is a major update to the previous app. The aim was to help students become familiar with the most basic elements of quantum computing using only their smartphones. The example below shows the results of (1) starting from the initial state, (2) applying the Pauli X gate, (3) then applying the Hadamard gate, and (4) applying the Hadamard gate again. 

The probability amplitude, probability, and relative phase of each basis |0>, |1> are shown numerically and on a disk. Additionally, the values of θ and φ can be set using text boxes and sliders, making it easy to understand the position of the quantum bit on the Bloch sphere.




2023年11月25日土曜日

Developing the most basic app to understand Qubit state (1)

Sometimes we need to go back to basics!

As I have already written several times, I was able to almost completely understand the basic concepts and ideas of quantum computing by reading the book [1]. Although this book does not explain the Bloch sphere or phases in detail, I would not have been able to write this article without the knowledge I gained from the book.

I developed an app to understand the state of qubits on the Bloch sphere. As shown in the figure below, set the two angular parameters θ and φ using the sliders for a single qubit on the Bloch sphere. This app uses it to calculate the probability amplitude and probability for each of the two basis (|0> and |1>). Probability and phase are also illustrated in the two disks at the top right. Note that since the global phase can be ignored, the phase of |0> is set to 0, and the phase of |1> is expressed as a relative phase to that.

As you can see, the current app specifies θ and φ manually. In the next version, it will also be possible to apply basic quantum gates (X, Y, Z, H, etc.).

References
[1] Chris Bernhardt: Quantum Computing for Everyone, The MIT Press, 2020.
https://www.chrisbernhardt.info/

2022年9月10日土曜日

Learning fundamental single qubit quantum gates

Various quantum gates exist for a single qubit. They are integral to the quantum circuits that make up quantum applications. There are many manuals, but I created my own material that lists the functions of basic quantum gates. This will be of great help when creating the necessary quantum circuits. This material was created with reference to the quantum simulator Qni [1], which has an excellent GUI.

First, Fig. 1 is a compact summary of the basic quantum gate functionality. This figure is a collection of descriptions of quantum gates in Qni. The results of applying quantum gates to qubit initial vectors "|0>" and "|1>" are shown. In other words, it shows what kind of super-positioning state is created by "|0>" and "|1>". 
Next, Fig.2 is a hand-made model of Bloch sphere. Using φ and θ corresponding to the state vector of the qubit shown in this figure, Fig.3 and Fig.4 show the working of the quantum gate in more detail. These figures display the complex coefficients (ie, probability magnitude and phase) that indicate the quantum superposition after application of quantum gates.
 
There is something worth noting here. For example, for the quantum state vector "|0>", both Pauli X and Pauli Y gates result in "|1>" with 100% probability. However, their amplitudes and phases are different. The phase is zero for Pauli X, but π/2 for Pauli Y. Such a phase difference is important later in causing wave interference. Moreover, the application result of the Hadamard gate is characterized by being "|0>" or "|1>" with a probability of 50% each. The probability (in this case 50%) is proportional to square of amplitude.

Reference
[1] Qni Tutorial: https://qniapp.net

2022年9月2日金曜日

Bloch sphere model for understanding quantum computers

To learn the basics of quantum computers, it is necessary to understand qubits and quantum logic gates. At first, it is a little difficult to envision their properties and actions.

A qubit is a vector in three-dimensional space, but that vector actually connects the origin and the spherical surface of a sphere with a radius of 1. A spherical surface is a two-dimensional space. Therefore, the state vector of a qubit is represented by two variables, amplitude θ and phase φ.

It would be nice to display it with computer graphics and understand it, but it is still easier to understand by creating a physical sphere and touching it.

Now we have created four Bloch sphere models to represent the state vector of the qubit. It is shown in the figure below. The functions of Pauli X gate and Hadamard gate can also be imagined.