2026年9月21日月曜日

Representing an Analog Clock with a Pure Quantum State

This article is meant to be relaxing—just for fun! The Bloch sphere is one of the first concepts we encounter when learning quantum computing. Each point on its surface corresponds to a pure state of a qubit and can be described by two angles, θ and φ, as shown below.

These two angles can also be mapped onto the hour and minute hands of an ordinary analog clock. If θ represents the hour hand and φ the minute hand, we get something like the illustration below.

Wouldn’t it be wonderful if someone made and sold a spherical clock like this? I doubt one exists, though.


So I created an Android mobile phone app—a “spherical clock” that displays the time on a Bloch sphere. Tap “Current Time,” and the display automatically updates every 30 or 10 seconds. Each time it updates, the yellow dot representing the quantum state briefly contracts. It is quite soothing just to sit and watch! You can also rotate the Bloch sphere and view it freely from any angle.


The current time is 4:54 p.m. Four white dots are visible in the upper-right part of the sphere. Since the clock uses a 12-hour format, they indicate four o’clock. The minute hand is moving along the path from four to five. Naturally, its apparent motion slows dramatically as it approaches the north or south pole. Depending on how you visualize it, reversing the north and south poles might feel more intuitive.

## Additional Note
Some readers may want to add a second hand. One possible approach would be to introduce another variable for the qubit: the length (r) of the line extending from the center of the sphere, where (0 < r < 1). However, points inside the Bloch sphere—rather than on its surface, where (r = 1)—represent mixed states rather than ordinary pure quantum states. This would require a different treatment, and I also find it less appealing aesthetically. So, for now, I have decided not to add this hand.

2026年9月18日金曜日

アナログ時計(長針+短針)を純粋量子状態で表現

 この記事は、癒し系、just fun!です。量子コンピューティングに取り組む最初の段階で、ブロッホ球が出てきます。その球面上の点は、量子ビットの純粋量子状態に対応します。それは、下図の(θ, φ)という2組の角度で表現できます。ですから、それを長針と短針を持つ通常のアナログ時計に対応させることができます。θを短針、φを長針に対応させると以下のような図になるでしょう。

 こんな球体時計、どこかで発売されていないのかなあ!ないですよね。

 そこで、時間をブロッホ球で表示する「球体時計」スマホアプリ(Android版)を作りました。「現在時刻」を押すと、30秒または10秒間隔で自動更新されます。更新時には、量子状態を表す黄色の丸が収縮します。ぼーっと眺めているのに良いです! ブロッホ球を回転させて自由な角度から見られます。


 現在16:54です。右上側に白丸が4個見えます。12時間制ですので、これは短針の4時を示しており、4時から5時に至る軌道を長針が動いてます。当然ですが、北極または南極に近づくほど、動きは急速に遅くなります。
 場合によっては、北極と南極を逆転させた方がイメージに合うかもしれません。

【補足】
 これにさらに秒針を加えたいと考える人もいるでしょう。その場合は、量子ビットを表すもう一つの変数として、球の中心から伸びる直線の長さr (0<r<1)を採用することになるでしょう。しかし、このようなブロッホ球の(r=1の表面ではない)内部の点は、通常の純粋な量子状態ではなく、「混合状態」に対応します。そのため、取り扱いが変わる上、美しさの観点からも好ましいとは思えませんので止めておきます。

2026年9月16日水曜日

量子ビット間の相関関係を設定してみる

 多数の人間の何らかの判断に関する相関関係を量子的に表せないか?以前、「社会的ジレンマ」問題の支援ツールを作ったことがあります。今回の話題は、それに少し関係します。というよりも、その問題を量子コンピューティングで扱うための部品かも知れません。(ただし、現時点では、適切な量子コンピューティングの問題にできる見通しはないのですが...)

 ここに、四人の学生(q0, q1, q2, q3)がいるとします。各学生は、次々と流れてくる動物のイラストに、好き(符号1)か、嫌い(符号0)かを与えます。ここで、学生の判定には以下のような相関関係があります。

Case1:
q0とq1:強いの相関(好き嫌いが逆転する傾向が非常に強い)
q1とq2:弱いの相関(好き嫌いが逆転する傾向がある程度ある)
q2とq3:弱いの相関(好き嫌いが一致する傾向がある程度ある)

Case2:
q0とq1:強いの相関(好き嫌いが一致する傾向が非常に強い)
q0とq3:弱いの相関(好き嫌いが一致する傾向がある程度ある)
q1とq2:強いの相関(好き嫌いが逆転する傾向が非常に強い)
q2とq3:弱いの相関(好き嫌いが逆転する傾向がある程度ある)

 このような相関関係は、量子ビットと量子もつれを利用すると、Fig.1やFig.2の左下図のような量子回路で簡潔に表現できるでしょう。"傾向"の強さは、RYゲートの回転角で調整できます。右側にあるヒートマップは、この量子回路を1,000回測定(1,000ショット)した結果を示しており、意図した相関関係を確認することができます。



 
 なお、多数回のshotsによるヒートマップの他に、basisベクタの出現確率からも確認できます。下図は、私のモバイル回路シミュレータによる結果です。例えば、q0とq1の測定結果が同じになるのは、|0011>, |0100>, |0111>, |1011>, |1111>の5ケースであり、その確率の合計は0.955であり、ヒートマップのstrong positiveと合致します。


【詳細説明】
🔹Case1
・q0とq1(強い負の相関): 制御RY回転ゲート(CRY)を適用し、一方のビットが 1 のときにもう一方を高確率で 0 に反転させて強い負の相関を作る。
・q1とq2(弱い負の相関): 小さな回転角度を設定したCRYゲートで緩やかな反転関係を作る。
・q2とq3(弱い正の相関): 小さな回転角度のCRYゲート+Xゲートで、緩やかな同調関係(1になりやすくする)を作る。
・q0とq3(ほぼ無相関): 間接的な干渉を抑えることで無相関を維持する。

🔹Case2
・q0: 重ね合わせ状態(H)を生成する基点とする。
・q0→q1(強い正相関): q0から q1 に大きな角度(例: 0.85π)のCRYゲートを作用させる。q0=1のときに q1も1になりやすいため、強い正の相関が生まれる。
・q0→q3(弱い正相関): q0から q3に小さな角度(例: 0.35π)のCRYゲートを作用させ、弱い正の相関を作る。
・q1→q2(強い負相関): q2をあらかじめ Xゲートで |1> に初期化し、q1 から q2へ大きめのCRYゲートを作用させる。これにより ・q1=1 のときにq2 が 0へ倒れ、強い負の相関になる。
・q2→q3(弱い負相関): q1→q2 の負の相関と、q0→q3 の正の相関の副産物として自然に q2とq3の間にも弱い負の相関が形成される。
・q0とq2: 直接の結合を作らず、かつ q1を介した間接影響により相関が相殺される設計にすることで無相関(ほぼ0)を維持する。

2026年9月12日土曜日

世界の数学者25人が緊急声明:AIで企業が数学の難問を解く行為を非難

 本日、2026-09-12、この声明が出されたとのニュースがあった。こちらにもこちらにも。

 AIはここまで来てしまったか、との思いが真っ先に来ました。現代の数学の巨人たちが出した声明なので、それだけ重みはある。彼らは、AI企業を非難している。数学の理解や独創、人材育成などの面から、科学や数学界に有害だと断言しているようでもある。

 だが、多くの人たちは、「それは止められない。数学に限らず、日常生活から学問や教育にまで、すでに深く浸透しているAIを止めることはできないのではないか」と。私も同感である。だが、従来の数学を含めた教育全般に大きな影響を与えることは確かであろう。すでにそうなっている部分もある。それに備えた改革が必要になることは、もっと強調されてもいいだろう。

 これに関して思い出したことがある。仁科記念賞を受賞した故佐藤文隆博士の量子論に関する啓蒙書に次の一節があった。

「アインシュタインのような巨匠たちに思考の深さにおいては及ばない我々凡人でも、手にした技術のおかげて彼らよりもはるかに高い境地にいるのである。」

この"手にした技術のおかげ"とは、現時点では、"AIのおかげ"ではないだろうか。AIを肯定的に捉える立場もある...

 さらに浮かんでくることがある。望月新一教授の「ABC問題の証明」を検証するために、定理証明ツールが使われ始めたこと。これは許されるが、AI自体が証明を試みることは禁止するのか、その境界は明確ではない。レベルは違うかもしれないが、電卓が出現し始めた頃、米国などでは、その利用は、算数数学教育に有害だとの反対運動も起こった。

 今回の緊急声明から、数学者たちが抱く、人類の根源的な思考を阻害するという危機感は伝わってくる。だが、数学の研究や教育は、著名な数学者たちの集団によって決められるものであり、その方針に合わないやり方は許されないと宣言しているようにも見える。この緊急声明の真意を素直に理解することは、我々庶民にはできそうにない。

 実際の戦場へ[AI兵士]が送り込まれるのと同様に、数学界に[AI数学者]が出現することは人類にとって脅威であり有害なのか。


2026年9月9日水曜日

Quantum Teleportation Using a Mobile Quantum Circuit Simulator

This article provides additional information about “Lab 16: Quantum Teleportation,” one of the examples introduced in the previous article.

IBM’s Qiskit supports dynamic circuits, allowing a quantum teleportation demonstration to be performed without any manual intervention during execution. Mobile quantum circuit simulators, on the other hand, do not support this feature. Therefore, the required quantum gates must be manually added to Bob’s circuit according to Alice’s measurement results. The procedure is straightforward, however, and produces the same results as Qiskit.

The procedures for both methods are described below. In this example, Alice transfers to Bob the state obtained by applying RY(π/3) followed by RZ(π/6) to the initial state |0>.

🔵 Quantum Teleportation in Qiskit Using Dynamic Circuits
See Fig. 1. Once the dynamic circuit has applied a Z gate, an X gate, or both to Bob’s qubit q2, depending on Alice’s measurement results, q2 is in the state teleported from Alice’s qubit q0.

To verify that the teleportation was successful, the inverse rotations RZ(-π/6)  and RY(-π/3) are then applied to the teleported state, returning it to |0>.


🔵 Quantum Teleportation Using a Mobile Quantum Circuit Simulator
Fig. 2(a) shows the operations performed on Alice’s side using the mobile simulator. These operations produce the measurement result for q1q0.


Fig. 2(b) shows how the appropriate quantum gates are manually added on Bob’s side according to Alice’s measurement result. Further details are provided in the figure.

2026年9月2日水曜日

Learning Quantum Computing with a Mobile Simulator


Prof. Aleksandar Radovanovic has also featured this app here.

[Note] Regarding Lab 16: Quantum Teleportation
In Example Lab16, we use "GoAfterMeas," a special measurement button. Please refer to the detailed explanation for this.

🔴 Using a Mobile Simulator to Learn Quantum Computing

Professor Aleksandar Radovanovic of the University of the Western Cape has published the following book as a resource for learning the fundamentals of quantum computing:

Quantum Computing: Problems and Solutions—Exercises with Detailed Solutions for Students and Educators (October 2025)

Qiskit code is available for 23 of the book’s key exercises and can be run using IBM’s Qiskit simulator. I have confirmed that many of these exercises can also be run on the mobile quantum circuit simulator I developed with MIT App Inventor. Although support for some of them is still a work in progress, I would like to introduce one example here. The images below show the book and the mobile simulator.


🔴 Running an Exercise on the Mobile Quantum Circuit Simulator

Let us take a look at an example. The image on the left below shows some brief documentation. From the list of exercises on the right, I selected “Lab 13—Grover Search Algorithm.”


The image on the left below shows the quantum circuit description for Grover’s search algorithm, the corresponding circuit diagram, and an example run. The circuit description can, of course, be edited.

The image on the right shows the result after running only the first Oracle–Diffusion iteration. Even at this stage, the result suggests that the target state, “1101,” can already be found with high probability.


🔴 Why Use a Mobile Simulator?

As noted above, all these exercises can be run successfully using IBM’s Qiskit simulator. My simulator, however, offers a different kind of value: you can take your mobile device out of your pocket and start using it anytime and anywhere, without an internet connection or any environment setup.

I believe that being able to read the textbook and immediately test its concepts on a mobile device makes quantum computing more approachable and helps deepen the reader’s understanding.

At the same time, a mobile simulator of this kind has its limitations. My simulator performs one shot per button press, so it is not well suited to collecting statistics from a large number of measurement shots. However, because it theoretically calculates the probabilities of all computational basis states, this is unlikely to be a serious limitation in most cases.

The simulator also cannot integrate with classical optimization modules, which are required for applications such as quantum machine learning. For those tasks, platforms such as IBM Qiskit are the better choice.

量子計算のテキストとモバイル量子回路シミュレータ

【注】Lab16-Quantum Teleportationについて
 例題Lab16では、特殊な測定用ボタンである"GoAfterMeas"を使います。こちらの詳細説明をご覧ください。

🔴モバイルシミュレータを量子コンピューティングの学びに活用
 量子コンピューティングの基礎を学ぶためのテキストとして、Prof. Aleksandar Radovanovic (University of the Western Cape)は以下の書籍を出版しています。

QUantum Computing: Problems and Solutions - Exercises with Detailed Solutions for Students and Educators, October 2025.

 この中にある主要な23個の例題に対しては、IBM Qiskitシミュレータで動くコードが公開されています。その多くは、私の開発したモバイル量子回路シミュレータで動かせることを確認できました。一部はまだ未完成ですが、そのうちの一例をご紹介します。以下の図はその本とモバイルシミュレータです。

🔴モバイル量子回路シミュレータでの実行
 ではさっそく、一例をご紹介します。下図の左側は簡単なドキュメンテーションです。右側の例題一覧から、ここでは、"Lab13- Grover Search Algorithm"を選択しました。

 以下の左側の図に、このGrover Searchの量子回路記述と回路図、および、実行例が示されています。もちろん、回路記述を編集することもできます。右側の図は、"Oracle & Diffusion"の繰り返しのうち、最初の1回だけを実行した結果です。この時点で、ターゲットである"1101"が、すでに高い確率で見つかることを示唆しています。

🔴なぜモバイルシミュレータを使うのか?
 これらの例題は、上記のとおり、IBM Qiskitシミュレータで完全に実行できます。しかし、私のシミュレータは、いつでも、どこでも、ポケットからモバイル端末を取り出し、インテーネット接続も環境設定も不要で、すぐに使えます。そこに存在価値があります。テキストを読んで、モバイル端末ですぐに内容を確認することで、親しみやすく、理解が深まると信じます。

 一方、このようなモバイルシミュレータの限界もあります。このミュレータは、"1ショット/1ボタンプッシュ"ですので、多数回の測定(ショット)によって統計値を得ることは苦手です。でも、全ての基底状態の出現確率は理論的に算出されるので、多くの場合あまり困らない筈です。さらに、量子機械学習などで必要な、古典最適化モジュールとの連携もできません。それらは、IBM Qiskitなどでやれば良いのです。

[参考情報]
 アフリカのAfrica Quantum Consortiumのロゴが美しいので掲載させていただきます。

2026年8月26日水曜日

ペリガルの分解(ピタゴラスの定理)のアニメアプリ

 先の記事で、ピタゴラスの定理に関して書きました。その美しい証明であるペリガルの分割が頭に残っていて、そのアニメをMIT App Inventorでも作ってしまいました。

 スマホで、ビジュアルを楽しめます。

 オブジェクトを任意の位置へ移動させることはImage Spriteで簡単にできますが、問題は部品オブジェクトの形状やその中心位置の設定です。それを精密にしないと当然、ズレが生じます。

If you are interested in this app and would like to try it out, please contact me. I will provide the Android version (APK file).

2026年8月22日土曜日

これまでの量子関係ブログ記事170件をAIに纏めてもらう

 2022年春頃から、これまでに、約170件の量子コンピューティング関連記事を、「Sparse-Dense Blog」に書いてきました。ここにその記事のタイトル一覧(記事へのリンク付き)があります。それをAIに渡して、それらの内容を1枚の紙にイラスト風に纏めてもらいました。3者(ChatGPT、Google Gemini、365Copilot)にお願いしてみました。一番良かったのが以下のイラストです。誰がベストかは伏せておきます。


 結論として、かなり優秀な出来栄えだと思います。ただし、一部正確さに欠けたり、書いて欲しい点が抜けていたり、私が言っていないことまで追加されていたり、と減点せざるを得ないところもありました。しかし、全体としては85点の合格点をつけたいと思います。(文字が小さいので拡大してご覧ください。)

2026年8月17日月曜日

A Needle-Dropping Game to Approximate π as 3.14

I created a game app based on the “Buffon’s Needle” experiment from my previous post. What makes it interesting is the seemingly mysterious fact that you can approximate π simply by dropping needles onto parallel lines—without drawing a circle anywhere! This could also make a fun app-development exercise for junior high and high school students. So, let’s take a look at the app I created. For this kind of project, I usually use MIT App Inventor. In this case, the ImageSprite feature was especially useful, allowing me to implement the needle-dropping action quite nicely.

πの近似値3.14が得られるまで針を投げるゲームアプリ
 これはゲームアプリの作成です。前報の「ビュフォンの針」に基づいていますが、少し仕様は異なります。でも、円周も描かないのに、平行線に針を投げるだけで、πの近似値が求められる不思議さを味わえます。中高生向けのアプリ開発例題にできるかもしれません。早速、作成したアプリを以下に示します。この種のアプリを作る場合、私はMIT App Inventorを使います。今回は、特にImageSpriteの機能を使って、針の投入をうまく書くことができました。

A quick note before going any further. Buffon’s needle experiment was originally designed to estimate π by tossing a large number of needles. This app, however, keeps tossing needles until it obtains 3.14—that is, π correct to two decimal places. Still, there may be some educational value in building the app yourself and experiencing the curious fact described above: π emerges simply by tossing needles onto parallel lines.

I have also added a small trick. Since the result depends on the sequence of random numbers, it is possible that the estimate may take quite a while to reach 3.14. So, somewhat secretly, I set the initial state as if 100 needles had already been tossed, with 64 of them crossing one of the red parallel lines. This gives a crossing probability of 0.64, corresponding to π = 3.125, which is already a fairly good estimate. So, in most cases, tossing just a few dozen more needles should be enough. In the example shown above, the estimate reached 3.14 after a total of 110 needle tosses.

For reference, let the distance between the parallel lines be D and the needle length be L. When D=L=1, as explained in the Doc above, π can be estimated as follows:

m=total number of needles tossed
n=number of needles crossing a parallel line
π≈2m/n

The best (m,n) pair I have found so far using this app is (m,n)=(8900,5666),which gives π≈2×8900/5666=3.1415, correct to four decimal places. With the help of AI, it would probably be easy to find many more such pairs—but that might take some of the fun out of it.

If you are interested in this app and would like to try it out, please contact me. I will provide the Android version (APK file).