2026年8月15日土曜日

円周率近似法「ビュフォンの針」を量子計算の教育的なデモにできるか?

要旨:タイトルに対する回答:大きくYESとは言えないが、ある程度可能、である。教育的観点から、量子コンピューティングを身近な問題に適用してみたいと考えていた。その一例として、1777年に発表された「ビュフォンの針(πの近似計算)」に着目した。たくさん平行線が引かれた紙の上に、多数の針をばらまき、それらが平行線と交わる確率pを求める。すると(平行線の間隔と針の長さが共に1の場合)、π=2/Pとなる!とても不思議に思えるが、それは高校数学で証明できる。そのシミュレーションは、通常モンテカルロ法による。だが、ここでは量子的方法で実行を試みた。結論としては、完全な量子計算にすることは困難だが、量子コンピューティングの重要な側面に触れるという教育的意義はあった。

🟢「ビュフォンの針」の古典版と量子版の概要
 円周率πの近似値を「ビュフォンの針」によって求める。従来のモンテカルロ法と、量子振幅推定(QAE: Quantum Amplitude Estimation)を用いる方法の両方で試した。どちらの方法でも、多数の針に対して、針が平行線と交差するかどうかを、針の中心位置と角度から判定することが必要である。
 モンテカルロ法では、各針について交差の有無を調べ、交差した針の本数を数えて合計し、それを全体の本数で割ることで、交差確率の近似値が得られる。
 一方QAEでは、状態準備回路によって、針の中心位置と角度に対応する量子状態の全てを、量子重ね合わせ状態として準備する。その後、オラクルと呼ばれる量子回路によって交差状態のみに位相反転を与え、量子干渉を利用して交差状態に対応する振幅を増幅させる。さらに、その振幅に対応する回転角(固有位相)を推定することで、交差確率pを直接推定することができる。
 どちらの方法でも交差確率pが求まれば、平行線の間隔と針の長さがともに1の場合、(ビュフォンの針の肝である)p=2/πが成立するので、πを推定することができる。

🟢古典版「ビュフォンの針」の実行
 まず、モンテカルロ法によるシミュレーションのアニメをご覧頂きたい。
 乱数系列に強く依存するので、何とも言えないが、図1の通り、8,900本の針を投入した場合、πの近似値として5桁正解の3.1415まで得られたことに驚いた。


🟢量子版「ビュフォンの針」の実行
 上で述べた本来のオラクルは、sinθの計算と比較演算による交差判定を行い、交差状態にある針を意味する量子状態の位相を反転させる。だが、それを完全な量子回路として実現するには多くの困難を伴う。そのため、ここでは、交差判定は、あらかじめ古典計算で済ませることにした。それに基づく位相反転機能だけをオラクル量子回路に持たせた。
 そのようなオラクルを図2に示した。針の中心位置yと角度θをそれぞれ、分解性能を3量子ビットで表現しているので、それらで決まる8×8=64個の針の量子状態を全て重ねた状態を一度に持つことができる。このオラクルは、そのうちの交差状態に対して最終段の標識量子ビットq6を反転させている。
 例えば、最初のMCX(多制御付きNOT)では、針の量子状態|000000〉が交差と判定された後、標識ビットq6が反転するようになっているので、|000000〉⊗|1〉という状態となる。その後、標識ビットが|1〉の場合は、|000000〉の位相が反転される。
 
 次に、このオラクルを、量子振幅推定器QAEに渡す。QAEは、重要な量子回路ライブラリとして使えるようになっている。QAEは、量子干渉を利用して交差状態に対応する振幅をGrover演算で増幅させ、その振幅に対応する回転角(固有位相)を推定することで、交差確率pを直接推定することができる。
 ともかく、このようにして、量子的ビュフォンをシミュレーションで実行させた。その結果を以下に示す。yとθの解像度と、QAEで使う評価用量子ビット数に強く依存するが、今回はπ=3.12というある程度の精度を得た。上記の6量子ビットと標識用1量子ビットに加えて、AQEで必要な評価用9量子ビットの合計16量子ビットを使っている。

==簡易OracleとQAEによる、量子的「ビュフォンの針」の実行結果==
使用した全量子ビット数           : 16
QAE推定確率 P (交差確率)       : 0.639260
計算された円周率 π (推定値)    : 3.128618
実際の円周率 (理論値)              : 3.141593
誤差                                      : 0.012974
================================================

🟢補 足
 精度の面では、モンテカルロ法では試行回数Nを増やすと推定誤差はO(1/√N)で減少する。したがって精度を10倍向上させるためには、理論上100倍の試行が必要となる。一方、QAEではオラクルの呼び出し回数Nに対して推定誤差がO(1/N)で減少するため、精度を10倍向上させるためには理論上10倍のオラクル呼び出しで済む。この結果、QAEは古典モンテカルロ法に対して二次加速(quadratic speedup)を実現できることが理論的に示されている。
 ただし、ここで用いた回数N意味は両者で異なることに注意が必要である。モンテカルロ法におけるNは試行した針の本数を表すのに対し、QAEにおける回数Nはオラクル(交差判定回路)の呼び出し回数を表す。したがって、この二次加速は実行時間そのものではなく、交差判定へのアクセス回数(クエリ複雑度)の観点での理論的な優位性を意味している。

🟢感 想
 「ビュフォンの針」による円周率近似において、簡易的、部分的にではあるが、オラクルという量子回路を設定し、それをQAE(量子振幅推定)に繋げて結果を出すことができた。古典的にはモンテカルロ法で求める交差確率を、個々の試行での加算を行わずに、振幅増幅によって直接読み出すという、量子コンピューティングの重要な側面に触れることはできた。ただし、本来の(本物の)オラクル回路にはなっていない点は明確にしておきたい。
 この問題は、従来のモンテカルロの方が圧倒的に容易に計算できるので、(こんなに複雑な)量子の出番はないとも言える。量子の得意分野は他にある。それでもなお、今後、教育的により適切な量子計算の例題を探求していきたい。

2026年8月9日日曜日

量子振幅推定QAE (Quantum Amplitude Estimation)の性能

 量子振幅推定QAE (Quantum Amplitude Estimation)は、量子的方法が古典的方法よりも優位である可能性を示す一例です。金融のリスク評価など、実用的にも非常に重要とされています。標準的なQAEでは、理論通り、求める確率のエラーが、オラクル呼び出し回数Nに対して、1/Nに(1/√Nではなく)減少することをシミュレーションで確認しました。ノイズに強い改良型のQAEを用いた、量子コンピュータ実機での実行は今後の課題ですが。

🟢どのような問題?
 具体例を図1に示します。中央のブロッホ球面に一つ量子状態が示されています。これは、北極状態に対して、右側に示すように、2つの量子ゲートRy(60°)とRz(15°)を適用した結果です。そのため、これを測定した場合、|0>になる確率は0.75、|1>になる確率は0.25と算出できます。では、この量子状態がどのように設定されたかが不明な場合、|1>となる確率を求めたい、という問題です。以下の2つの方法を比較します。

🟢Standard Sampling(モンテカルロ法)
 これは通常の方法です。多数回のサンプリングによって確率を求めます。誤差をε以下にするには、1/ε回のサンプリングが必要なことが分かっています。例えば、ε=0.01以下にしたい場合、10000回サンプリングが必要です。

🟢QAE (Quantum Amplitude Estimation )
 上記モンテカルロ法よりも、圧倒的に少ない測定回数で精度よく振幅推定する方法です。QAEは、Groverの探索と同様の構成と量子位相推定(QPE)を組み合わせた方法であり、内部で、「位相の増幅」を含むモジュール(ここではこれをOracleと呼ぶ)を呼び出します。誤差をε以下にするには、1/ε回のOracleの呼び出しで済みます。例えば、ε=0.01なら、100回となります。なお、Oracleの呼び出し回数は、QAE内部の評価量子ビットの個数に応じて最適に決められます。

🟢シミュレーションによる両者の性能の比較
 図2に、両者の誤差減少の模様をプロットしました。ここで、横軸に注意いただきたい。Standard Samplingの場合は、回数Nは、サンプリング(shot)回数です。一方、QAEの場合は、回数Nは上記に述べたOracleの呼び出し回数です。両者とも、回数Nの増加に対する誤差の減少は、理論値とかなりよく合致することがわかりました。QAEの優れた特性が確認できました。

 実時間の比較で、どちらの方法が短時間で正答できるかを言うことは困難です。つまり、QAEの実装回路を実行する量子コンピュータ実機の性能、特にノイズによるエラーの影響を考慮する必要があるからです。そこで、理論的な性能指標として、Oracleの呼び出し回数を用いるのが通例です。今回もそれを用いた次第です。今回はシミュレーションでの比較でした。量子コンピュータ実機での比較は今後の課題です。現在、ノイズに強い改良型QAEの研究開発も進められていますので。

2026年7月12日日曜日

ピタゴラスの定理のアニメーション

 多くの人に馴染みがあるピタゴラスの定理(中学校では3平方の定理と呼ぶらしい)の証明は多数あります。ここでは、「ペリガルの分解」を使います。3辺のうち、2番目に長い辺bで作られる正方形の中心pを求め、それを通る直線を2本引く。1本目は、斜辺cと並行に。2本目は斜辺cと垂直になるように。それで決まる4個の四角形と辺aで作られる正方形からなる5個のピースを、並行移動により、斜辺cで作られる正方形に埋め込む。これだけですが、以下のアニメーションは不思議さが残り、楽しめるでしょう!
 東京理科大学の数学体験館には、ピタゴラスの定理を視覚的に示す動く模型があります。秋山仁教授も解説しています。上記とは少し方法は異なるようですが、似ています。
 なお、下図のようなGarfield(第20代米国大統領になった人)の方法もあります。上記のアニメーションの方法よりも(少し計算が必要ですが)直感的ですね。右側の台形の面積を2通りに計算してそれが等しいことを使ったものです。上記のペリガル分解では、図形の並行移動しか使っていませんが、このGarfieldは、図形の複製、回転、移動を使っている点が異なります。

    情報工学や量子コンピューティングでも、このような常設展示室を作って、触って、動かして理解できるようにすれば良いのではないかなあ。私自身は既に現職ではないので、作るとしたら"バーチャル体験館"になりますが、これまでの作品を見直して再構築も。ただし、何時になるは分かりませんが。例えば、以下のような過去記事などが候補です。


2026年7月1日水曜日

Experimental Quantum State Tomography Using SIC-POVM

 AbstractQuantum state tomography is a technique for determining an unknown quantum state. One approach to implementing it is through a Positive Operator-Valued Measure (POVM). In this method, many identical copies of an unknown quantum state are prepared and measured to reconstruct the state. A POVM provides a more general framework for quantum measurement than the standard projective measurement on an orthonormal basis. In this article, we implement a SIC-POVM, one particular class of POVMs, for a single qubit on an IBM Quantum processor (ibm_kingston). The experimental results demonstrate that several unknown quantum states can be reconstructed with high accuracy.

🟢 Overview of SIC-POVM
SIC-POVM stands for "Symmetric Informationally Complete Positive Operator-Valued Measure". The general theory of POVMs is described in References [1], [2], and [3], while Reference [3] provides a detailed discussion of SIC-POVMs. For a quantum system of dimension d, a SIC-POVM consists of d2 projection operators,  
        E= |ψi><ψi|/d
and  satisfies the following formula:
        |<ψij>|= 1/(d+1)   (i ≠ j)
Here, |ψi> represents a pure quantum state on the Bloch sphere.

For a single qubit (d = 2), the SIC-POVM consists of four state vectors. The squared inner product between any pair of distinct vectors is therefore 1/3. A specific example is shown in Fig.1. For convenience, it is customary to choose the first state as |ψ1> = |0>, and the four vertices corresponding to these state vectors form a geometrically elegant regular tetrahedron inscribed in the Bloch sphere.


🟢 Implementing Quantum State Tomography
An unknown quantum state cannot be reconstructed using only the conventional Z-basis measurement. For example, if measurements along the Z axis yield |0> and |1> with equal probabilities of 50%, multiple quantum states are consistent with those results. Additional measurements along the X and Y axes are therefore required.

A SIC-POVM, in contrast, can be regarded as a special measurement device with four output channels. When a large number of identical copies of an unknown qubit are sent into this device, each output channel records a certain number of detection events. The relative frequencies (probability distribution) represent the overlap between the unknown quantum state and each of the four SIC-POVM state vectors. If the state corresponding to the i-th SIC-POVM element is denoted by |ψi>, the measurement probability becomes as follows:
        P= (1/2)|<ψi|Unknown state >|2

A particularly attractive feature of SIC-POVM tomography is that these four probabilities directly determine the Cartesian coordinates (X,Y,Z) of the unknown state on the Bloch sphere through the following equations:
X = √2(2P2 - P3 - P4)
Y = √6(P3 - P4)
Z = 4P1 - 1

🟢 Performing SIC-POVM Measurements on an IBM Quantum 
If a known quantum state is simply treated as an unknown one, reconstructing it using the SIC-POVM formulas presents no theoretical difficulty. Implementing the procedure on an actual quantum computer or a quantum circuit simulator, however, requires some additional consideration.

On a real quantum processor, the probability is not obtained by directly calculating the inner product between the state vector and a measurement vector. Instead, many identical copies of the quantum state are prepared and measured repeatedly. The measurement probabilities are then estimated from the observed frequencies according to Born's rule.

Most quantum computers, however, can perform only projective measurements in the computational (Z) basis. As shown in Fig. 1, three of the four SIC-POVM measurement directions point diagonally toward the southern hemisphere of the Bloch sphere rather than along the Z axis.

To overcome this limitation, an appropriate unitary rotation is applied immediately before measurement so that the desired SIC-POVM measurement direction is mapped onto the Z axis. A standard Z-basis measurement is then performed, yielding the measurement probability corresponding to that SIC-POVM element. The present experiment follows exactly this procedure.

🟢 Two Quantum States Treated as Unknown
In our experiment, the two known quantum states shown in Fig. 2 were deliberately treated as if they were unknown. Both are pure states located on the surface of the Bloch sphere. In Case 1, the state lies on the equator with a phase angle of 0. In Case 2, the state is located in the southern hemisphere with a phase angle of π/3. We expected that the state in Case 1 would be easier to reconstruct than that in Case 2.

It should be emphasized that the parameters used to define these "unknown" states (θ and φ) were not used anywhere in the reconstruction process. Only the four SIC-POVM measurement directions were used. Consequently, the same procedure would work equally well for a genuinely unknown input quantum state.

🟢 Reconstruction Results
Table1 summarizes the results obtained for both cases using the Qiskit simulator and the IBM Quantum processor (ibm_kingston). The table lists the Cartesian coordinates (X,Y,Z) of the original quantum states treated as unknown, together with the measured probabilities (P1, P2, P3, P4) obtained from both the simulator and the real quantum hardware.

The reconstructed Cartesian coordinates (X, Y, Z) deserve particular attention. As expected, the quantum state in Case 1 was reproduced almost perfectly by the IBM Quantum processor. The state in Case 2 was also reconstructed with a high degree of accuracy, demonstrating that SIC-POVM-based quantum state tomography can successfully identify unknown single-qubit states even on present-day quantum hardware.

【References on POVM】
[1] Peter Y. Lee, Huiwen Ji, Ran Cheng, "Quantum Computing and Information", 2nd Edition, Polaris QCI Publishing, 2025.
(especially, 3.5 Application to Quantum State Tomography, and Chapter12(Density Operators and Quantum Channels))

[2] Michael A. Nielsen and Isaac L. Chuang, "Quantum Computation and Quantum Information", Version 13, Cambridge University Press, 2023.
(2.2.6 POVM measurements)

[3] John Watrous, "General formulation of quantum information" in IBM Quantum Platform Learning.
https://quantum.cloud.ibm.com/learning/en/courses/general-formulation-of-quantum-information/general-measurements/introduction

2026年6月30日火曜日

SIC-POVMによる量子状態トモグラフィに関する実験

【要旨】量子状態トモグラフィは、未知の量子ビットの量子状態を突き止めるための概念である。その実現方法の一つとして、POVMがある。それは、同一の未知の量子状態を多数用意し、それらを測定することでその量子状態を明らかにする。POVMは、通常の正規直交基底への射影測定よりも広い、量子測定の一般的な枠組みである。ここではその一種であるSIC-POVMと呼ばれる測定を、1-qubitについて、IBM Quantum Computer実機で実施した。その結果、かなり高い精度で未知の量子状態を特定できることが分かった。

🟢 SIC-POVMの概要
 これは、長い名称「Symmetric Informationally Complete - Positive Operator-Valued Measure」の略称である。POVMの一般的な理論は、参考文献[1][2][3]などに示されている。特に、[3]にはSIC-POVMの詳細な説明がある。d次元の量子系では、SIC-POVMはd2個の射影演算子 Ei=|ψi><ψi|/d で構成され、次式が成立するように作られている。以下の|ψi>は、ブロッホ球上の純粋状態を表す状態ベクトルである。
|<ψij>|2=1/(d+1)   (i ≠ j)

 1-qubitの場合は、d=2なので、SIC-POVMは4個の状態ベクトルで構成され、そのどの2つのベクトル同士の内積の2乗も全て1/3となる。その具体例をFig.1に示す。計算を簡単にするため、4つの状態ベクトルのうち、1番目を|ψ1>=|0>とするのが通例である。これら4つの状態ベクトルの頂点は、幾何学的に美しい、内接正4面体を構成している。

🟢 量子状態トモグラフィの実現
 未知の量子状態を突き止めるトモグラフィは、通常のZ軸測定だけでは実現できない。例えば、Z軸測定で|0>が50%、|1>が50%の確率で得られた場合、複数の候補が考えられるので、さらに、X軸測定とY軸測定を行う必要がある。
 これに対して、SIC-POVMは、4つの出力チャネルを持つ特別な測定器と考えられる。この測定器に、同一の未知の量子ビットを大量に投入すると、結果として、4つの出力に出現カウントが得られる。それらのカウントの比率(確率分布)が、"未知状態ベクトルとSIC-POVMの各頂点に対応する状態ベクトルとの重なりの度合い"を示す。すなわち、SIC-POVMの頂点iに対応する状態を|ψi>とすると、測定結果としての確率Piは以下のような内積計算になる。
Pi=(1/2)|<ψi|未知状態>|2
 そして、この確率を用いて、未知状態のブロッホ球のデカルト座標(X, Y, Z)は以下の公式で求められるのが注目すべき点である。
X=√2(2P- P- P4)
Y=√6(P- P4)
Z=4P- 1

🟢 Quantum Computer実機を使ったSIC-POVM測定
 特定の既知の量子状態を、未知の状態だと見做した場合、SIC-POVM測定によって、その量子状態を特定する(復元する)理論的計算は、特に問題がないであろう。しかし、それを、量子コンピュータ実機、または量子回路シミュレータで行うには少し工夫がいる。実機では、ある状態ベクトルと測定ベクトルとの内積を直接計算して確率を求めるわけではない。多数の同一の量子状態を繰り返し測定すると、各測定結果の出現頻度から、ボルンの法則により、測定確率を推定できる。
 しかしながら、一般的な量子コンピュータでは、ハードウェアが直接行える測定は計算基底(Z基底)での射影測定である。一方、SIC-POVMの4つの測定方向のうち3つは、Fig.1に示したとおり、ブロッホ球上で南半球へ向かう斜め方向にある。そこで、SIC-POVMの各測定方向がZ軸に一致するように、測定直前に適切なユニタリ演算(回転)を施す。その後に通常のZ基底測定を行うことで、そのSIC-POVM要素に対応する測定確率を得る。今回も、これに従って測定を行った。

🟢 未知量子状態と見做した2つの量子状態
 今回の実験では、Fig.2に示す2つの既知の量子状態を未知状態と見做して測定した。いずれも、ブロッホ球面にある純粋状態である。Case1では、それは赤道上にあり、位相角は0である。Case2では、南半球上にあり、位相角はπ/3である。Case1の方が、Case2よりも量子状態の特定は容易であろうと予想された。

 なお、以下の測定では、”未知の量子状態"として設定した情報(θとφ)は全く使用していない。SIC-POVMの4つの測定方向だけを使っている。従って、"真の未知状態"が入力された場合も同様に特定できる。

🟢 SIC-POVM測定による未知量子状態の復元結果
 これら2つのケースについて、QiskitシミュレータとIBM Quatnum実機(ibm_kingston)による測定結果をTable1に示す。未知状態に設定した状態のデカルト座標(X,Y,Z)が示されている。また、シミュレータと実機の測定に基づく確率が、(P1, P2, P3, P4)として示されている。それに基づいて復元したデカルト座標に注目していただきたい。実機では、予想通り、Case1の未知状態がほぼ完璧に復元できている。また、Case2の未知状態も、かなり高い精度で特定された。

【POVMに関する参考文献】
[1] Peter Y. Lee, Huiwen Ji, Ran Cheng, "Quantum Computing and Information", 2nd Edition, Polaris QCI Publishing, 2025.
(especially, 3.5 Application to Quantum State Tomography, and Chapter12(Density Operators and Quantum Channels))

[2] Michael A. Nielsen and Isaac L. Chuang, "Quantum Computation and Quantum Information", Version 13, Cambridge University Press, 2023.
(2.2.6 POVM measurements)

[3] John Watrous, "General formulation of quantum information" in IBM Quantum Platform Learning.
https://quantum.cloud.ibm.com/learning/en/courses/general-formulation-of-quantum-information/general-measurements/introduction

2026年6月17日水曜日

IBM Quantumの上級認定資格を取得(3個目)

 量子コンピューティングを探求するにあたって、理論的バックグラウンドが不足していると感じる場面が時々出てくるので、基礎を見直すことにした。その一つのテーマが「量子状態の密度行列」である。これに関する詳細なチュートリアルがIBM Quantumのwebサイトにある。"General Formulation of Quantum Information" (量子情報の一般的定式化)である。今回、そのチュートリアルを学んだ後に、認定資格(Advanced)試験を受けて合格し、認定バッチと認定証を得た。

密度行列を使う動機は以下のようなことである。

(1)従来の量子状態ベクトルよりも幅広い種類の量子状態を表現できる。これには、ノイズの影響を受ける量子系の状態や、量子状態の古典的な確率によるランダムな選択の状態も含まれる。

(2)無視したい別の系と量子もつれにある系の状態など、孤立した系の状態の記述は、従来の量子状態ベクトルでは簡単にできないが、密度行列によればそれは明快になる。

(3)古典情報と量子情報を単一の数学的枠組みで記述できる。このことから、古典情報は本質的に量子情報の特別なケースであることが見えてくる。

 このチュートリアルは、このような動機を支える理論を詳しく展開しており、若干難しい内容になっている。Qiskitコードでプログラミングしたり、量子ゲートを使って量子コンピュータ実機で動かす、などの「息抜き」もできないので、尚更である。しかし、これまで知らなかった知識を得たり、曖昧だった考え方が明確になるなど、得られたものはとても大きいと感じた。

 でも、ビジュアルにして楽しめる事項もあった。その一つを以下の図に示す。量子コンピューティングでは、量子状態はブロッホ球の表面に示される「純粋状態」の他に、ブロッホ球の内部の点に対応する「混合状態」がある。そこに密度行列が登場する。

 もう一例ある。これまでの基本的な測定は、正規直交系から決まる射影測定が使われたが、より一般的な測定もある。それは、SIC-POVM(Symmetric Informationally Complete Positive Operator-Valued Measure)と呼ばるれる。下図は1-qubitにおけるSIC-POVMに対応するものである。詳細は別として、正4面体(regular tetrahedron)が、Bloch球に内接しているのが美しい。4つの頂点は、ブロッホ球面の純粋状態を表している。化学でのメタン分子の4つの水素原子も、これと同じ正4面体の頂点に配置されている。
【補足】上に述べた通り、このチュートリアルは少し(or かなり)難しい。そこで、下記の西村治道教授の書籍[1]の3.4(混合状態)、3.5(POVM)、3.6(発展的な概念)を一通り学んだ後に取り組めば、ぐんと理解が進むのではないかと思われる。
{1] 西村治道、"基礎から学ぶ量子計算"、オーム社、2022年11月.

2026年6月2日火曜日

フィボナッチ数列に基づく植物の葉の模型

A Model of Plant Leaves Based on the Fibonacci Sequence
One of the most beautiful and widely appreciated concepts in mathematics is the Fibonacci sequence. It appears in the forms and growth patterns of plants, seashells, and many other natural objects. More recently, it has even found applications in Topological Quantum Computation through the concept of the Fibonacci anyon.
    Recently, I happened to discover an item called the “Fibonacci Tree” being sold online as a desk ornament or educational toy. Although the product itself does not seem to come with a mathematical explanation, it appears to be an object whose beauty can be appreciated simply by displaying it on a desk.
    With that in mind, I would like to give a brief introduction to it below.

 古くからある、誰にも親しまれる美しい数学の一つにフィボナッチ数列がある。植物や貝類などの形態に現れる他、最近では、トポロジカル量子計算(Topological Quantum Computation)における「フィボナッチ・アニオン(Fibonacci Anyon)」にも利用されるようである。
 最近、偶然だが、ネット上で「フィボナッチツリー」なるものが、文具かおもちゃとして発売されているのを知った。数学的な説明などはないが、机上において美しさを味わうことができるように思う。そこで、以下の通り、簡単にご紹介します。

 ところで、この黄金角の元になっている黄金比が、調味料の配合にも!
下図の通り、2種類の唐辛子の割合が黄金比だと謳っている!ラベルの色も黄金!



2026年5月29日金曜日

IBM Quantumの教室アカウントの取得が可能に!

New Classroom Accounts expand quantum access for educators

 IBM Quantumは、大学や高校での量子コンピューティングを後押しするため、教室で、IBM量子コンピュータ実機へのアクセスを容易にするサービスの提供を始めた。これは素晴らしい!申請する教授や教員が次第に増えてくるのではないか!

詳細は下記にあります。
さらに、具体的に学ぶための機会やリソースも提供しています!

🟢IBM Quantum Education Day(量子コンピューティング教育の日)

🟢Qiskit Global Summer School(量子コンピューティング夏の学校)

2026年5月26日火曜日

Standalone Quantum Circuit Simulators Running on Mobile Phones

Abstract
Full-featured quantum circuit simulators such as Qiskit and Cirq are widely used in the quantum computing community. However, I wanted a quantum circuit simulator that could be used like a pocket calculator—something I could quickly pull out anytime and anywhere, without requiring an internet connection. Several years ago, I developed the app described in [2] for this purpose. Using it, I was able to experiment with many of the basic examples commonly found in introductory quantum computing textbooks, and I still find it extremely useful today.

Recently, I discovered that a similar simulator is also available: the product developed by Codexus Technologies [1]. In this article, I briefly compare the two simulators through several example problems, focusing on usability and design philosophy. Exploring the ideas behind each simulator is both interesting and enjoyable.

🟢 Standalone Quantum Circuit Simulators
Both simulators run entirely on an Android smartphone without requiring any user configuration or internet connection. Like using a calculator, users can immediately experiment with basic quantum circuits whenever they wish. Their main features are summarized below.

• Codexus Technologies App [1]
The app features an attractive and polished user interface. A wide range of fundamental quantum gates is available, and circuits of up to five qubits can be simulated. Users build circuits graphically by placing gates through the GUI, so no text-based programming is required. 

Simulation results are obtained from 1,024 measurement shots and displayed both as a histogram and as a textual state vector (probability amplitudes). The development environment used to create the application is not publicly known.

• Fujio Yamamoto's App [2]
This simulator consists of two versions: a single-qubit simulator and an n-qubit simulator. In the single-qubit version, users can apply quantum gates interactively through a graphical interface, and the state vector is visualized on a three-dimensional Bloch sphere. The n-qubit version accepts circuits in a text-based format similar to IBM's QASM language. 

Simulation results are displayed both graphically (using a disk representation) and in textual form as state vectors. Created circuits can be saved with a button press and later reloaded for further editing. The application was developed efficiently using MIT App Inventor, although much of the complex-number arithmetic is implemented in embedded JavaScript code.

🟢 Comparing Usability Through Example Problems
The purpose of this comparison is not to determine which simulator is superior. Rather, it is to explore the design philosophy behind each application and understand how their creators approached the challenge of building a quantum circuit simulator. Examining these differences is both informative and enjoyable. Let us try the following three examples on each simulator.

(1) Applying X and H Gates Sequentially to a Single Qubit
In the Codexus app, as shown below, the interface is highly polished and intuitive. Users simply place quantum gates one after another. Pressing the "Simulate" button automatically performs 1,024 measurement shots and displays both the state vector and histogram, making the results easy to understand.

The Fujio app also applies quantum gates through a graphical user interface. Its most distinctive feature is the visualization of the state vector on a 3D Bloch sphere. The probability amplitudes are additionally displayed as complex numbers in the lower section of the screen.

(2) Creating a GHZ State with Three Qubits
In the Codexus app, the configuration of CNOT gates is particularly well designed. First, the user selects the control qubit. The simulator then highlights the candidate qubits where the target NOT gate can be placed, allowing the user to complete the operation simply by tapping the desired qubit. The simulation output correctly shows that only the states 000 and 111 occur, confirming the presence of quantum entanglement.

In the Fujio app, quantum gates are specified using a text-based description. Because the circuit can be edited directly, the approach offers a high degree of flexibility. In addition, several example circuits are built into the application, allowing users to load and execute them immediately with a single button press. Simulation results are displayed on a disk diagram showing both probabilities and phases, providing an intuitive and user-friendly representation.

(3) The Mermin–Peres Magic Square Using Four Qubits
This example is somewhat more sophisticated than the previous two. It demonstrates a remarkable form of quantum "magic" that makes clever use of entanglement. Readers interested in the details are referred to [3].

In the Codexus app, circuits containing many gates can still be configured conveniently by scrolling horizontally across the screen. The output correctly shows that only eight of the sixteen possible four-qubit basis states appear, each with approximately equal probability.

At this point, I do have one feature request: for circuits of this length, it would be very useful to save the circuit and reload it later for further editing. I hope this capability will be added in a future version.

As with the previous examples, the Fujio app represents the circuit textually. The simulation results are displayed on the right side of the figure, where the probability and phase associated with each basis state are shown graphically on a disk diagram. The results are easy to interpret and match those produced by the Codexus simulator exactly.

Some readers may notice a small difference. For example, Codexus reports an amplitude of −0.354 for 0001, whereas Fujio reports −0.354 for 1000. This discrepancy is simply due to a different ordering convention for qubit indices. In other words, it reflects the difference between the conventions commonly used by Google Cirq and IBM Quantum.

(4) Calculation of 7k mod 15 (where k=8)
This example appears as part of quantum phase estimation (QPE). Here, we have a simple example of "7k mod 15". We have confirmed that the answer is 11 when k=8.

In Codexus, this is implemented using swap gates. The simulation result shows that the probability amplitude of |1101> is 1.0. This means that the answer is 1011 in classical binary and 11 in decimal. The bit order is as explained in example (3).


Fujio's result needs no explanation.


(5) 4-qubit QFT without swap
This example is a quantum Fourier transform (QFT) using 4 qubits. Unfortunately, it seems that Control Phase, Control S, and Control T are not available in the Codexus app. Therefore, it was not possible to create a quantum circuit for the QFT.

On the other hand, in the Fujio app, the following result can be obtained using the Control Phase gate.

Subsequently, applying the inverse quantum Fourier transform IQFTx (lowercase x means no swap) was confirmed to return to the state before applying QFTx, |1111>, as shown in the following figure.

🟢 Conclusion
Both the Codexus app and the Fujio app have their own strengths and distinctive features. They are enjoyable, convenient, and easy to use. As standalone quantum circuit simulators that run directly on Android mobile phones, they provide an accessible way to explore the fundamentals of quantum computing.

Such tools could serve as valuable educational resources for introductory quantum computing courses at both the high school and university levels.

References
[1]Quantum Circuit Simulator by Codexus Technologies (Sri Lanka)
https://play.google.com/store/apps/details?id=com.codexustechnologies.quantumcircuitsimulator&hl=en-US

[2] Redesigned Mobile Quantum Circuit Simulators by Fujio Yamamoto
https://sparse-dense.blogspot.com/2024/08/redesigned-mobile-quantum-circuit.html

[3] Mermin-Peres Magic
Exploring Quantum Entanglement through Visualization
https://sparse-dense.blogspot.com/2025/05/exploring-quantum-entanglement-through.html

スマホで動くスタンドアロン型量子回路シミュレータ

【要旨】本格的な量子回路シミュレータとして、IBM QiskitやGoogle Cirqなど広く使われている。しかし、電卓のように、いつでもどこででも、さーっと取り出して、web接続も不要な量子回路シミュレータが欲しくて、数年前、[2]に示すアプリを自作した。これを使って、一般的な量子コンピューティングのテキストブックに出てくる基本的な例題の多くを試すことができた。今でも、重宝している。一方、最近になって、同様のシミュレータが他にもあることを知った。Codexus Technologiesの製品[1]である。今回、これら両者を、いくつかの例題を通して、使い勝手などを簡単に比較してみた。両者の設計思想を探るのは楽しいことである。

🟢スタンドアロン量子回路シミュレータ
 
いずれも、Androidモバイルフォン単体で動作するのである。ユーザによる環境設定や、Web接続は全く必要としないので、電卓を使うような感覚で、基本的な量子回路を動かすことができる。それぞれの特徴を簡単にあげる。

・Codexus Technologies のアプリ[1]
 デザインが美しく、綺麗な画面である。基本的な量子ゲートの多くを使うことができる。量子回路の規模は5量子ビットまで。GUIでゲートを置いていく形式であり、テキストでのプログラミングは不要である。1024ショットのシミュレーションの結果を、ヒストグラムと state vector(確率振幅)をテキストで得ることができる。どのような開発環境で作成されたかは不明である。

・Fujio Yamamoto のアプリ[2]
 1-qubit用とn-qubit用の2種類がある。1-qubit用は、GUIで各種の量子ゲートを連続的に適用でき、State vectorは、3Dブロッホ球に表示できる。n-qubit用は、IBMのQASMに近いテキスト形式で与える。シミュレーション結果は円盤形式とテキスト形式の両方で、State vectorとして示す。作成した回路は、ボタン操作で格納でき、あとで取り出して再編集できる。このアプリは、MIT App Inventorで効率良く作成されたものである。ただし、複素数演算の多くは、 JavaScriptでコーディングして組み込んでいる。

🟢例題による使い勝手の比較
 この比較は、両者の優劣を論じるものではない。それぞれのアプリの作者がどのような設計思想を抱いて、そのシミュレータを作り上げたのかを探るのが主な目的である。それを調べることは楽しいことである。以下の5つの例題を、それぞれのシミュレータで実行してみよう!

(1)量子ゲートXとHを連続して1-qubitへ適用
 Codexus
アプリは、下図の通り、洗練されたデザインで、ポンポンと量子ゲートを並べれば良い。”simulate"ボタンを押すと、1024回ショットが自動的に実行され、State VectorとHistogramが表示され、わかりやすい。

 Fujioアプリも、同様にGUIで量子ゲートを適用する。最大の特徴は、3Dブロッホ球にState vectorを表示することある。下部には、確率振幅も複素数で表示される。

(2)3-qubitを使ったGHZ
 Codexus
アプリでは、CNOTゲートの設定に工夫が見られる。まず、コントローラをどのqubitにするかを決める。すると、NOTゲートを置けるqubitの候補が示されるので、適当なqubitをクリックすれば良い。シミュレーション結果は、000と111だけが表示され、量子もつれを確認することができる。

 Fujioアプリでは、量子ゲートの配置をテキストで与える。それを編集できるので、自由度は高い。また、いくつかの例題がすでに組み込まれているので、ボタンを押して、その量子回路をすぐに使える。シミュレーションの結果は、円盤に、確率と位相が表示されるので、親しみやすい。

(3)4-qubitを使ったMermin-Peres Magic
 
この例題は、ここまでの2つよりも若干複雑であり、量子もつれを巧みに利用したマジックである。詳細は[3]を参照されたい。

 Codexusでは、画面を横方向にスクロールすることで、ゲート数が多くなってもうまく設定できる。出力は、4量子ビットのすべての組み合わせ16個のうちの、8個だけがほぼ同数出現するという正しい結果を示している。
 ここで、一つ要望事項がある!このくらい長い回路になると、この結果をsaveして、後でそれを取り出して編集したい!次回のバージョンではそれを追加してほしい!

 Fujioアプリでは、他の2つの例題と同じく、テキストで量子ゲートを配置している。右側のシミュレーション結果には、基底ごとの出現確率と位相が円盤に示されるので、分かりやすい。Codexusと全く同じ結果が得られている。

 しかし、ちょっと違うことに気づく人もいるだろう!たとえば、Codexusでは、"0001のamplitudeが-0.354"となっているのに対して、Fujioでは、"1000のamplitudeが-0.354"となっている。これは単に、ビットの並べ順が異なるだけである。つまり、Google Cirq流かIBM Quantum流かの違いである。

(4)7k mod 15 (where k=8)の計算
 
この例題は、量子位相推定(QPE)の一部として出てくる。ここでは、"7k mod 15"という簡単な例である。k= 8の場合、答えは11であることを確認している。

 Codexusでは、swapゲートでこれを実現している。シミュレーション結果は、|1101>の確率振幅が1.0となる。これは、答えが、古典2進で1011、10進で11であることを意味する。ビットの並び順に関しては、例題(3)で説明した通りである。

 Fujioの結果については、説明は不要であろう。

(5)4-qubit QFT without swap
 
この例題は、4-qubitを使う量子フーリエ変換(QFT)である。残念ながら、Codexus appでは、Control Phaseや、Control S、Control Tが使えないようである。したがって、QFTの量子回路を作ることはできなかった。
 一方、Fujio appでは、Control Phaseゲートを使って、以下の図のような結果を得ることができる。

 この後、引き続いて、逆量子フーリエ変換IQFTx(小文字のxはno swapを意味する)を適用すると、以下の図の通り、QFTxを適用する前の状態 |1111>へ戻ることが確認された。

🟢結 論
 Codexusアプリも、Fujioアプリもそれぞれ特徴があり、楽しく、気軽に使える。高校、あるいは大学ででも、入門的な量子コンピューティングに活用できるのではないだろうか!

References
[1]Quantum Circuit Simulator by Codexus Technologies (Sri Lanka)
https://play.google.com/store/apps/details?id=com.codexustechnologies.quantumcircuitsimulator&hl=en-US

[2] Redesigned Mobile Quantum Circuit Simulators by Fujio Yamamoto
https://sparse-dense.blogspot.com/2024/08/redesigned-mobile-quantum-circuit.html

[3] Mermin-Peres Magic
Exploring Quantum Entanglement through Visualization
https://sparse-dense.blogspot.com/2025/05/exploring-quantum-entanglement-through.html