Ekert protocol revisited

Recently, I have been working on quantum algorithms that apply various quantum gates. There, the direction in which the quantum is measured is fixed, often by projecting it onto the Z axis. On the other hand, quantum algorithms that change the measurement method, that is, change the orthonormal basis and use it, are also important. For example, there is the Ekert protocol, which is the basis of quantum key distribution. I've already written about Ekert in this article, so I won't go into any further explanation, but I've revised the app that demos it this time. The situation is shown below.

The left side of the figure shows the case where there is no eavesdropping, and the right side shows the case where eavesdropping was detected. An important aspect of the Ekert protocol is the use of Bell's test, or quantum entanglement.

Animation added!
If there is no eavesdropping and Alice and Bob measure in the same orthonormal basis, the result will be 00 or 11. That is, the result is the same. Quantum entanglement is at work. On the other hand, if Eve eavesdrops first, the same thing happens between Eve and Alice. However, since quantum entanglement has already disappeared, there is no such relationship between Alice and Bob. This fact is tied to eavesdropping detection.


Development of scientific calculator-like quantum circuit simulator V2

(This is an English translation of a previous Japanese article)

I have been developing a quantum circuit simulator that is as easy to use as a scientific calculator. As a single smartphone app, you can try out various quantum algorithms and apps within the 3-qubit range. This time, version 2 has been completed. I also added a little bit of play.

If you shake your smartphone lightly, one of five icons will randomly appear. It's a little fun. Of the five images, one was created by me, while the other four were created by ChatGPT.
Of course, this is not the only thing. Added a playback function that applies quantum gates. That is, by recording the steps of an algorithm (which quantum gates were applied to which registers (qubits)) in sequence, and pressing one or two buttons, the algorithm can be played back. I found this to be very useful when showing a demo to someone or when running under different conditions myself. Although details are omitted, three algorithm playback examples recorded in this manner are shown below.

Superdense Coding
In Fig.1, Alice has the top two qubits (q0 and q1), and Bob has q2. Both qubits are in a state of quantum entanglement. Just like that, Bob went away. Alice wants to send any of the classical 3-bit information (000, 001, 010, ..., 111) to Bob. In other words, she wants to send "101" out of eight, for example, in (a). However, there are only two qubits that can be sent. This is not enough!
Nevertheless, with this wonderful Superdense Coding, Bob can always obtain any information from Alice simply by operating a predetermined quantum gate! Fig.1(b) shows this.
Grover's Algorithm
For example, assume that eight pieces of information (000, 001, ..., 111) are arranged randomly. The problem is finding specific information from among them. Fig.2 is an example of searching for "101". First, mark the information in (a). This is achieved by inverting the phase of the corresponding basis vector |101>. This is not a scam! It simply tells you what to look for. Without such information, the search itself is meaningless.
In (b), when the button Amp3step is pressed, the probability amplitude amplification is activated, and only the probability amplitude of the basis vector whose phase was inverted in (a) is amplified, and the desired information "101" is obtained. In this example, we only needed to perform the phase inversion and amplification pair once!
Quantum Fourier Transform
This is an application example of quantum Fourier transform QFT. One of the characteristics of QFT is that it can be applied to states of quantum superposition. In Fig.3(a), we created a superposition of two certain quantum states. Next, in (b), when the button QFT is pressed, the phase waves that are the results of each QFT in both states interfere and appear as separate phase waves. The wave swell can be seen from the phase angle and amplitude (area of the disk filled in red) in the lower part of (b).
Although omitted here, you can restore the original quantum superposition state by pressing the button next to it, IQFT. IQFT is the inverse quantum Fourier transform.





Superdense Coding(超高密度符号化)
 Fig.1において、Aliceは上段の2つのqubit(q0とq1)を持ち、Bobは下段のq2を保有する。両者のqubitは量子もつれの状態にしてある。その後、Bobは遠方へ行ってしまった。もつれは保持されたままである。Aliceは古典3ビット情報(000, 001, 010, ... , 111)のどれかをBobに送りたい。つまり、8個のうちから、例えば、(a)では"101"を送たい。だが、送れるqubitは2つしかない。これでは足りない!
 それにも拘らず、この素晴らしいSuperdense Codingでは、Bobは常に予め決められた量子ゲートを操作するだけで、Aliceからのどの情報でも得られる!(b)はそれを示している。
Grover's Algorithm(グローバーの探索アルゴリズム)
 これは、例えば、8個の情報(000, 001, ... , 111)がランダムに並んでいるとする。その中から特定の情報を探し当てる問題である。Fig.2は、"101"を探す例である。まず、(a)で、その情報に印をつける。それは、対応するbasis vector |101>の位相を反転させることで実現させている。これはイカサマではない!単に、何を探すべきかの情報を与えているだけである。そもそも、そのような情報がなければ、探すこと自体が意味をなさない。
 (b)において、ボタンAmp3stepを押すと、確率振幅増幅が作動して、(a)で位相反転したbasis vectorの確率振幅だけが増幅されて、求める情報"101"が得られた。この例では、位相反転と増幅のペアをただ1回実行するだけで解決した!
Quantum Fourier Transform(量子フーリエ変換)



 前報で、独自のモバイル量子回路シミュレータを用いて、3量子ビットシステムのbasis vector(|000⟩, |001⟩, |010⟩, ... ,|111⟩)それぞれに対して量子フーリエ変換QFTを行った。だが、QFTは、量子重ね合わせ(SuperPosition)に対して適用できる点に大きな特徴があるといえる。そこで、今回、私のシミュレータでのGUIを以下の図に見られるように若干変更して、これを実験してみた。以下の図から、実用上非常に重要なQFTの線形性を確認でき、位相の波の干渉による増幅/減衰(高め合い/弱め合い)の状況が分かる。

つの状態の重ね合わせ |000⟩+|001⟩ に対するQFTの結果を示した。

 もう一例見てみよう。Fig.2は、2つの状態の重ね合わせ |000⟩+|100⟩ に対するQFTの結果を示した。



Running quantum Fourier transform on my mobile simulator

I have developed a 3-qubit quantum circuit simulator that runs on a mobile phone. As shown in the top row of Fig. 1, a large number of basic quantum gates can be used. This time, I was able to demonstrate quantum Fourier transform (QFT) and inverse quantum Fourier transform (IQFT) using these quantum gates. QFT and IQFT each consist of six quantum gates, which are registered to buttons.

In Fig1.(a), when the button QFT is pressed for the quantum bit state |101>, a wave with the phase shown at the bottom is generated. Next, in Fig2.(b), the original qubit state could be restored by pressing the button IQFT. This means that we were able to determine the periodicity of the waves, as shown in Fig.2.

As mentioned above, QFT and IQFT were constructed by combining individual quantum gates, but alternatively, a unitary matrix can be used as shown in Fig. 3. I won't go into details, but these unitary matrices are actually built into my simulator. Note that when using this method, it was necessary to perform swap processing according to the simulator's policy. Swap means reversing the direction in which three qubits are arranged.









 図1では、(a)に示した量子ビット状態|100>を入力としてQFTを実行すると、(b)に示すような位相の波が得られた。すなわち、基底ベクトル|000>、|001>、... |111>の順に、位相が反時計回りに45度づつ変化し、8個の基底ベクトルで1周期の位相の波となる。
 スマホで、電卓みたいな感覚で、簡単な量子回路シミュレータを作ろうとして始めたが、段々膨らんできて、3量子ビットの量子フーリエ変換ができるまでになった。まだまだ、初級レベルに留まるが、ちょっと嬉しくなる。ただ、スマホでは(性能上というよりも、画面設計やコード作成する上で)この位の規模が限界かもしれない。さらに高度なことは、QiskitやIBM Quantumで実行ということになろう。

 本記事内容を何かに生かすとしたら... 簡単なゲームが考えられる。3量子ビットで、何らかの周期性をもつビット列をプレイヤーに与えて、その周期を当ててもらう。あまり面白くないか。でも、量子アプリ作成の練習にはなるだろう。



Yet another mobile quantum circuit simulator

In the previous article, I described the development of a quantum circuit simulator that allocates one qubit to one mobile phone. I also placed emphasis on graphical interfaces, including display on the Bloch sphere. This time, I have developed a new quantum circuit simulator that can run applications using three-qubit on a single mobile phone.

Simulate quantum circuits with a mobile phone that fits in the palm of your hand!
Without internet connection!
It's as fun as using a scientific calculator!

As shown in the figure below, I used this to implement Grover's algorithm. The same results were obtained with the IBM Quantum Computer, which had already been carried out.

In developing this quantum circuit simulator, the explanations and examples in the following reference [1] were very helpful to me.

[1]中山茂、"量子アプリQni量子プログラミング初歩",Gaia教育シリーズ52, 2022.


Happy New Year!

Happy New Year!

Naturally, I also replaced the planner (手帳 in Japanese) I use every year for the new year.

I want to get through this year somehow!

This year is the year of the dragon (辰年)