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 (golden quantum image) will take you to the "List of Quantum Computing Articles". - Fujio Yamamoto (for e-mail, add "@ieee.org" after "yamamotof")
2023年12月1日金曜日
Developing the most basic app to understand Qubit state (3)
2023年11月27日月曜日
Developing the most basic app to understand Qubit state (2)
Sometimes we need to go back to basics!
This is a major update to the previous app. The aim was to help students become familiar with the most basic elements of quantum computing using only their smartphones. The example below shows the results of (1) starting from the initial state, (2) applying the Pauli X gate, (3) then applying the Hadamard gate, and (4) applying the Hadamard gate again.
The probability amplitude, probability, and relative phase of each basis |0>, |1> are shown numerically and on a disk. Additionally, the values of θ and φ can be set using text boxes and sliders, making it easy to understand the position of the quantum bit on the Bloch sphere.
2023年11月25日土曜日
Developing the most basic app to understand Qubit state (1)
Sometimes we need to go back to basics!
As I have already written several times, I was able to almost completely understand the basic concepts and ideas of quantum computing by reading the book [1]. Although this book does not explain the Bloch sphere or phases in detail, I would not have been able to write this article without the knowledge I gained from the book.
I developed an app to understand the state of qubits on the Bloch sphere. As shown in the figure below, set the two angular parameters θ and φ using the sliders for a single qubit on the Bloch sphere. This app uses it to calculate the probability amplitude and probability for each of the two basis (|0> and |1>). Probability and phase are also illustrated in the two disks at the top right. Note that since the global phase can be ignored, the phase of |0> is set to 0, and the phase of |1> is expressed as a relative phase to that.
References
[1] Chris Bernhardt: Quantum Computing for Everyone, The MIT Press, 2020.
https://www.chrisbernhardt.info/
2023年11月1日水曜日
Try solving 3-SAT using Qiskit's Quantum Algorithms Module
2023年10月24日火曜日
Oracle and Amplitude Amplifier in Grover's Quantum Algorithm
2023年10月23日月曜日
Groverの量子アルゴリズムにおけるOracleとAmplitude Amplifier
2023年10月6日金曜日
Simonの量子アルゴリズムとHadamard行列のKronecker積
【要旨】量子コンピューティングでの重要な行列(ゲート機能)の一つに、アダマール行列があります。複数の量子ビットシステム(テンソル積)の各量子ビットにアダマール変換を施すための行列が、Kronecker Products of Hadamard Matrices(アダマール行列のクロネッカー積) です。記念碑的解法として有名なSimonの量子アルゴリズムにも有効に使われています。それは、参考文献[1]で丁寧に説明されているのですが、時間が経つと忘れてしまうので、私自身の理解をメモとして残して置きます。
■Simon's Algorithm
まず、ここで解くべき問題については既に本ブログ(2022-12-11の記事)に書いたので、以下に極く簡単に記す:
長さnのbinary string x(0か1から成る文字列)を入力とし、出力も長さnのbinary stringとなる2対1関数fがあるとする。ここで、ある長さnの秘密のbinary string s があり、y=x or y=x⊕s の時に限りf(x)=f(y) である。ただし、sの全ての文字が0であることは無いとする。記号⊕は、bitwise addition of strings modulo 2を意味する。入力xに対する関数値f(x)を問い合わせることはできるが、関数fの定義は与えられていない。解くべきことは、秘密のsを特定することである。
そのために、関数fを何回評価する必要があるかを問題とする。古典的アルゴリズムでは、最悪の場合、2のn乗のオーダーの関数呼び出し回数となるが、Simonの量子アルゴリズムではnの多項式オーダーとなる。しかし、この言い方はあまり正確ではない。計算量に関する、BQP(Bounded-error Quantum Polynomial-time)などの議論を、Prof. Bernhardtの書籍[1]のChapter 8 (pp.166-170)等でご覧いただく必要がある。
■Simon's Algorithmを実装する量子回路
Simonの問題は、上記の関数fと秘密のsを知っている人が作成した問題を解く、いわばリバースエンジニアリングである。実用的な問題ではないにも拘らず、これに対するSimonの解法は、量子アルゴリズムの威力を示すものとして広く認められている。そのための量子回路を、n=2とn=3の場合について検討するが、その方法は一般のnについても自然に当てはめることができる。この量子回路の出力であるいくつかのbinary string(長さn)から、秘密のsを特定するための連立一次方程式を作ることができる。なぜかと言うと、出力されたbinary string bと秘密のsとのdot product(後述)が0になるからである。以下に、このようなdot productがなぜ0になるかを中心に、図を使って詳しく述べる。
Fig.1は、n=2とn=3の場合のSimonのアルゴリズムを実装した量子回路である。上述の通り、関数fに対するOracleが設定されている。すなわち、関数fの定義と秘密のsがこのように決められているのだが、回答する人はそれを知らずにsを特定するのである。

この質問の回答を、以下で検討する。Fig.4は、Fig.1 case(a)でのψaのフェーズ(2回目のHadamard変換後で測定を行う直前)の4量子ビットシステムの状態ベクトルである。いくつかの計算を経ているが、ここに示されているのは、4qubitsのうちの上段の2qubitsに着目して式を整理した結果である。
Prof. Bernhardtは [1]の中で、このSimon's algorithmにダブルスター⭐️⭐️(かなり難しい)を付している。確かにその通りだが、何度か読み返して検討して、上記のように理解できた。確率振幅の増幅と減衰に関しては、Groverのアルゴリズムではその操作を明示的に行なってるが、Simonでは「知らぬ間にそうなっている」感がある。ともかく、以下の文言を言えれば、Simonアルゴリズムは一応理解できたことになるのではないか。Fig.7参照。
2023年9月20日水曜日
生成AIに関するMIT App Inventor Workshopが神奈川工科大学で開催
![]() |
MIT App Inventor Generative AI workshop at 神奈川工科大学 |
2023年9月8日金曜日
量子ビットの反転エラーの訂正(Quantum Bit-Flip Correction)
![]() |
bit-flipイメージ(Bing) |
2023年9月3日日曜日
量子テレポーテーションをQiskitでもやってみる
地球と月の間の量子テレポーテーション |