I am a professor emeritus of CS at Kanagawa Institute of Technology, Japan. Originally my specialty was parallel and distributed systems. My current interests include machine learning, natural language processing, creating mobile apps with MIT App Inventor, and quantum computing. In the web version of this blog, clicking the icon on the right (a plastic sphere) will take you to the "List of Quantum Computing Articles". - Fujio Yamamoto (for e-mail, add "@ieee.org" after "yamamotof")
2026年8月15日土曜日
円周率近似法「ビュフォンの針」を量子計算の教育的なデモにできるか?
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/ε2 回のサンプリングが必要なことが分かっています。例えば、ε=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日日曜日
ピタゴラスの定理のアニメーション
2026年7月1日水曜日
Experimental Quantum State Tomography Using SIC-POVM
【Abstract】Quantum 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.
|<ψi|ψj>|2 = 1/(d+1) (i ≠ j)
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.
https://quantum.cloud.ibm.com/learning/en/courses/general-formulation-of-quantum-information/general-measurements/introduction
2026年6月30日火曜日
SIC-POVMによる量子状態トモグラフィに関する実験
なお、以下の測定では、”未知の量子状態"として設定した情報(θとφ)は全く使用していない。SIC-POVMの4つの測定方向だけを使っている。従って、"真の未知状態"が入力された場合も同様に特定できる。
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コードでプログラミングしたり、量子ゲートを使って量子コンピュータ実機で動かす、などの「息抜き」もできないので、尚更である。しかし、これまで知らなかった知識を得たり、曖昧だった考え方が明確になるなど、得られたものはとても大きいと感じた。
でも、ビジュアルにして楽しめる事項もあった。その一つを以下の図に示す。量子コンピューティングでは、量子状態はブロッホ球の表面に示される「純粋状態」の他に、ブロッホ球の内部の点に対応する「混合状態」がある。そこに密度行列が登場する。
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の教室アカウントの取得が可能に!
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ゲートを使って、以下の図のような結果を得ることができる。
🟢結 論
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


































