2023年6月23日金曜日

「量子コンピューティングを学ぶ」をある会誌に寄稿

 量子コンピューティングに関する私のブログ記事は60件を超えました。ここからご覧いただくことができます。
 ところで、情報処理学会誌の最新号に、根本香絵氏による量子コンピューティングに関係する解説(全6ページ)[1]が掲載されています。一般向けの啓蒙、解説記事として、とても分かりやすく、有用だと思います。実は、同じく6ページで、私は同様の独自解説的記事をある機関の会誌に寄稿していました。残念ながら、その会誌は(数千人の会員限定であり)一般には非公開であるため、ここで参照できません。しかし、私の記事の原稿は以下に置いてありますので、よろしければご覧ください。

「量子コンピューティングを学ぶ」

 どちらかというと「量子コンピューティングの基礎をどのように学んだのか」を主に叙述しています。具体的な内容は、参考文献[2]で学んだことに基づいています。上記の物理学者根本氏とは異なる切り口で書いていますので、読み比べて戴くのもよろしいかも知れません。
June flower, hydrangea (紫陽花), Atsugi
Rice planting season (田植え) has come again this year, Atsugi

How did I learn the basics of quantum computation in half a year from zero knowledge? In response, I wrote about my encounter with Prof. Chris Bernhardt's book, which led me to various amazing quantum algorithms, and my experience using the Hitachi CMOS annealing machine and the IBM Quantum machine.

If I were to compare it to the plan to climb Mount Everest, it would be the feeling of finally leaving for base camp. I would appreciate it if you could refer to something. (The article was written in Japanese, but you might use automatic translation if you need it.)

参考文献
[1] 根本香絵,"2022年ノーベル物理学賞に 量子もつれと量子情報科学", 情報処理 Vol.64 No.7 July 2023, pp.320-325
[2] Chris Bernhardt: Quantum Computing for Everyone, The MIT Press, 2020.

2023年6月22日木曜日

愛読書に手製のブックカバーを取り付ける

 何度も繰り返して読んだ(学んだ)量子コンピューティングに関する英語書籍(ペーパーバック装丁)があります。マーキング、線引き、書き込み(消しゴムで取消しも)、メモ用紙の挿入などもしながら、見開きを重ねた結果、綴じ部分のほつれや、表紙の圧着ビニールの剥離が少し出てきました。

 今後も何度も参照するので、今のうちにカバーを取り付けたいと思いAmazonで探しましたが、このサイズに適当なものが見つかりません。文庫本や新書版のブックカバーはたくさんあるのですが。そこで、自作することになりました。厚手の大きめの紙を折り曲げて作るのです。

 ただし、無地では淋しい。納得できるデザインや模様が入っている紙が欲しい。あれこれ選んで決めたのが以下の3種類です。
  1. 通販で見つけたパリの古地図が印刷されたクラフト紙
  2. 贈答用の高級カステラの箱の包装紙
  3. ロンドン市街地図(1987年8月英国出張時に購入、古いがカラーで綺麗)
 ブックカバーをそのまま取り付けると、原書の表紙のデザインが分からなくなります。そこでポイントは、小さな窓をくり抜くこと。その後ろから、webサイトに掲載されている書籍のサムネール画像を貼り付けるのです。さらに、背表紙にもタイトルを切り抜いて貼り付けます。

 3種類も作ったので、その時々の気分で適宜着せ替えれば良い。末長く役立つ愛読書にふさわしいブックカバーができた!

2023年6月21日水曜日

生成AIブロックがMIT App Inventorで使えるようになった(1)

 昨日(2023-06-20)、MIT App Inventor version nb193がリリースされ、新たに生成AI系ブロックが使えるようになった。すなわち、ChatGPTDALL-E2を利用するChatBotImageBotである。早速、簡単な例を考えて試してみた。なかなか素晴らしい!応用はまだまだこれからだろうが。(→続編はこちら)

●私の考えた簡単な質問:
「次の5つの行動からランダムに一つを選んでください:
learn quantum mechanics, lecture in front of students, climb Mt. Fuji, shake your dice, swim in the sea」

●ChatBotとImageBotの答え:
質問に答えて、どれかを(例えばshake your dice)選んで、そのイメージを図示してくれます!

 普通のアプリでは、行動リストの中からランダムに選ぶコードも書きます。しかし、ここでは、そのコードは書かずに、ChatGPTが指図を理解して選択しています。ここにも、生成AIの片鱗を窺えるのです。

 こんな風に楽しんでいると、なんと、OpenAIの無料枠API利用回数限度に達して使えなくなってしまった。だが、24時間後にはリセットされて、1日あたり数十回はリクエストできるようだ。それを超える場合は、有料プランの契約が必要。

[追加]他にもなかなかの結果がありますので、追加します。
 "harvest cabbage(キャベツを収穫)"と、"teach math(数学を教える)"です。それらしい雰囲気が出ています。Very goodですね。
 もう2つ行きます。2つの行動を同時に選んで、そのイメージを描いてもらいました!
"climb Mt. Fuji, teach math"(富士山にのぼり、数学を教える)と"swim in the sea and harvest cabbage" (海で泳ぎ、キャベツを収穫する)です。なかなか創作力ありますわ。

MIT App Inventor version nb193:
https://community.appinventor.mit.edu/t/mit-app-inventor-version-nb193/87279

2023年6月16日金曜日

A mobile app that simulates the Ekert protocol for quantum key distribution

Abstract: In my previous article, I theoretically described how the quantum key distribution protocol Ekert, which uses streams of entangled qubit pairs, works, referring to [1]. This time, for each individual qubit, an orthonormal basis is randomly chosen and the measurements are simulated. As a result, confirm that the same conclusion (probability value) as the theory is obtained. A mobile application for this purpose was developed using MIT App Inventor. By creating such an app, we can deepen our understanding of measurements involving quantum entanglement.

What can you do with the mobile app?
The app logo, shown in Fig. 1, highlights the features of this mobile app. Now the pair of qubits possessed by Alice and Bob are in an entangled state, and they measure each other on different orthonormal bases (hereafter simply called bases). There are three types of bases that can be selected. Without eavesdropping, the probability that both measurements agree is 1/4. If there is eavesdropping, the probability increases to 3/8. This app can verify these theoretical values for a large number of entangled quantum pairs (eg, 3000 pairs).

Run the mobile app to validate the Ekert protocol
Fig.2 shows an execution example of this application. (a) is the case without wiretapping. First Alice makes the measurements, then Bob makes the measurements. Since the qubit pairs are in entangled states, Bob's measurement depends on Alice's measurement. The theoretical value of the matching probability between the two measurement results is 1/4 (=0.250), but the execution result of this application was 0.254. I'd say it's an almost perfect match.

On the other hand, in the case of eavesdropping, the situation is as shown in Fig.2(b). Suppose Eve has eavesdropped (namely measured) a qubit before Alice and Bob. Alice then measures. It depends on Eve's measurements. After that, when Bob measures, it depends on Eve's, but not on Alice's. This is because the entangled states between qubits have disappeared when Eve measures them. The matching probability between Alice and Bob's measurement results is theoretically 3/8 (0.375), but the application execution result is 0.374. This was also an almost perfect match.

From the above observations, we can say that this app simulates the Ekert protocol correctly. If it is confirmed that there is no eavesdropping as in FIg.2(a), the measurement results of 1001 pairs, which is about one-third of the 3000 pairs, can be shared as a secure quantum key. A great advantage is that there is no need to exchange the key between the two, that is, there is no need to send it to each other. In fact, in this case, ["a",1]["b",1]["b",1]["b",0]["a",0]["c",0]["b",1]["a",1]["a",1]["c",0]["a",1]["a",0] ... match both, so the classical bit string "111000111010..." can be an encryption key.

Mechanism of the mobile app
The most important parts of this mobile app are shown in Fig.3. This deals with the cases where the results of measuring  qubits by the base ① are the classical bits shown in ②. The probability ④ that results in "|0>" when measuring such a qubit with a newly selected basis ③ is stored in the table on the right side of the figure. From such information, we can obtain the result (classical bit) of measuring the qubit by the basis of ③.

Note that this measuring block that uses the photon transit probability can also be constructed as shown in the figure below, without using a table:

Additional information
This app uses random numbers, so the results will vary slightly each time you run it. However, I would like to confirm that this is not an obstacle in determining the presence or absence of eavesdropping. FIG. 4 shows the results of 25 runs of the 3000-pair entangled quanta measurements shown above. Fig. 4(a) shows the probability that Alice's and Bob's measurement results agree with each other (when they choose different orthonormal bases) both with and without eavesdropping. Both probabilities were found to be in good agreement with the theoretical values (0.375 and 0.250). On the other hand, Fig. 4(b) shows that the quantum key length that can be used when it turns out that there is no eavesdropping agrees well with the theoretical value (here, 1,000).
In the above, the length of the quantum pair is assumed to be 3,000. Fig.5 shows the results when this length is changed to 150 and 30,000. With a length of 150, it is difficult to determine the presence or absence of eavesdropping. On the other hand, when the length is set to 30,000, it was found that the presence/absence of eavesdropping can be determined more clearly than in the case of Fig.4.

----------------------------------------------------------------------------------
My recent quantum computing related mobile apps : Polarization, the BB84, and the Ekert. Both were developed based on Reference[1].
----------------------------------------------------------------------------------

Reference
[1] Chris Bernhardt: Quantum Computing for Everyone, The MIT Press, 2020.

2023年6月12日月曜日

Detecting eavesdropping in Ekert protocol for quantum key distribution

Abstract: The Ekert protocol is a secure key distribution protocol that utilizes a stream of two qubit pairs in an entangled state. Alice and Bob each measure the received quanta using a randomly chosen orthonormal basis. The degree of matching between the classical bit strings of the two as a result indicates the presence or absence of eavesdropping. This is explained in the last section of chapter 8 "Bell's Inequality" of reference [1]. There, the calculation of the match probability in the absence of eavesdropping is clearly explained. However, details of how to calculate the matching probability (=3/8) in the case of eavesdropping are not shown. This blog post tracked that calculation.

Primitive cryptographic key distribution using quantum entanglement
Quantum entanglement makes it possible to share cryptographic keys without having to create them in advance and send them to each other. However, as shown in Fig.1, in practice, such a method cannot be used easily. This is because, if eavesdropped, it cannot be detected.


Ekert protocol (E91) for quantum key distribution
The solution is the Ekert protocol. Send a stream of entangled pairs of qubits (of length 3n) to Alice and Bob. They receive the qubits one by one from the pair. Each time, they both randomly select one of the three orthonormal bases to measure one's qubit. The results of the measurements are recorded along with the basis of choice. Finally, both sides exchange selected bases information (not measurements) in normal communication. Of these, approximately n bases should be the same in both, and the remaining 2n should be different in both.

For bases (2n of their own) that do not agree between them, they exchange their measurement results. It can be done by normal communication without encryption. When calculating the probability that the measurement results match, the value becomes 1/4, if there is no eavesdropping by a third party (that is, if the third party does not measure the qubits). Details of the calculation are given in reference [1]. If the value can be confirmed, the measurement results for the remaining n bases that agree with each other can be used as  an encryption key. That is, both parties can share the encryption key without sending it to each other. See Fig.2(1).

However, if a third party Eve eavesdrops on the qubits before Alice's and Bob's measurements, the matching probability of Alice's and Bob's measurements changes to a value of 3/8. See Fig.2(2). But how is this value calculated? I will clarify that next.

Comparison of Alice's and Bob's measurement results when eavesdropped
Fig.3 shows the calculation of the match probability (3/8) mentioned above. See diagram for details. There are nine combinations of bases that Alice and Bob can choose from, but we are only interested in the cases that their bases are different. The match probability for the six combinations is shown in red. In this example, Eve chose Standard basis, but she would have chosen anything else.

Fig. 4 shows in more detail the calculations for cases (a) and (b) among the six combinations. Eve's results are measured by Alice and Bob on the basis of their choice. The probability amplitude at that time is used in the calculation.


From the above, the Ekert protocol mechanism for generating cryptographic keys and detecting eavesdropping by a third party has been completely clarified.

Special Acknowledgment
I have forwarded this blog post to Prof. Chris Bernhardt, the author of reference [1]. He sent me an email confirming that this calculation is correct. Below is the last two lines of his answer. I would like to thank him. (2023-06-12)
Reference
[1] Chris Bernhardt: Quantum Computing for Everyone, The MIT Press, 2020.
https://www.chrisbernhardt.info/