2026年3月30日月曜日

Finding an inscribed rectangle using VQA (Variational Quantum Algorithm) No.2

This article is a continuation of the previous article.

We've created an animation showing how the inscribed rectangle is found. Enjoy!

Initially, it's a quadrilateral with a blue frame, but as it approaches a rectangle, the frame changes to orange. Finally, when it reaches a nearly perfect rectangle, the frame turns red.

この記事は、前回の記事の続編です。内接長方形が見つかるまでのアニメーションを作りました。おたのしみください!最初は青色枠の四辺形ですが、長方形に近づくとオレンジ色の枠になります。そして、最終的にほぼ完璧な長方形に至った場合は、赤色の枠になります。

Initial Guess
In Progress

Final Result

2026年3月29日日曜日

Finding an inscribed rectangle using VQA (Variational Quantum Algorithm)

Finding an inscribed rectangle using VQA (Variational Quantum Algorithm)

量子変分法で閉曲線の内接長方形を見つける

Abstract: For any simple closed curve, it is known that four points on the curve can form (at least one) rectangle. In this article, we numerically searched for such an inscribed rectangle using a Variational Quantum Algorithm (VQA). In many cases, a nearly perfect rectangle was found with only about 50 calls to the Ansatz.

     However, this does not mean that quantum methods are superior to classical methods. In fact, this problem can be solved classically as well, and it is merely an example problem to help understand quantum methods.

【要旨】どんな単純閉曲線においても、その上の4点で(少なくとも一つの)長方形を作れることが分かっている。ここでは、そのような内接長方形を、量子変分法で求めた。多くの場合、Ansatzの呼び出し回数50回程度で、ほぼ完璧な長方形を見つけることができた。だが、これをもって、量子的方法が古典的方法に勝るとは言えない。実際、この問題は、古典的にも十分解けるものであり、量子方法を理解するための例題に過ぎない。

🟢An Intuitive Picture of the Existence Proof

Consider a chord AB on a simple closed curve (identifying AB with BA). As illustrated in Fig.1, each such chord corresponds one-to-one to a point on a Möbius strip (right panel), while the original closed curve corresponds to the boundary of the strip. Next, we construct a surface from these chords. As shown in Fig.2 (upper right), for each chord we take its midpoint and place a point above it whose height equals the length of the chord. Repeating this for all chords produces a surface in three-dimensional space. Points on this surface are again in one-to-one correspondence with points on the Möbius strip.
     Now consider mapping the boundary of the Möbius strip onto the base of this surface (i.e., the original curve). Due to the topology of the Möbius strip, it is unavoidable that two distinct points on the strip coincide under this mapping. Consequently, two points on the constructed surface (for example, the red and blue triangles in the figure) must also coincide somewhere. At such a coincidence, the corresponding four points on the curve form a rectangle.
     Although the full proof requires more rigor, this construction captures the essential idea behind the existence of an inscribed rectangle. The reference [1] and the video[2] were particularly helpful in understanding this argument.

🟢内接長方形が存在することの証明のイメージ
 Fig.1の左図の線分AB(線分BAと同一視する)は、右側のメビウスの帯上の点と1対1に対応づけられる。閉曲線はメビウスの帯の縁に対応する。
 さらに、Fig.2の右上の図は、そのような線分の中点において、その上方向に、高さが線分の長さとなる点を描いている。そのようにしてできる曲面上の点と、メビウスの帯の点がまた1対1に対応する。
 メビウスの縁の線を、この曲面の底辺(すなわち元の曲線)に当てはめる際、メビウス上のどれかの2点はどうしても重なってしまう。すなわち、曲面上の点(赤い三角と青い三角)も、どこかで必ず重なる。その場合に長方形を形成する。詳細は略すが、これが長方形存在証明のポイントである。こちらの資料[1]とこちらのビデオ[2]はとても参考になった。


🟢Finding an Inscribed Rectangle via a Variational Quantum Algorithm

Let us now attempt to find such rectangles using quantum computing. At first, one might consider applying Grover’s search. However, constructing a suitable Oracle that detects rectangles within a quantum circuit is currently impractical. Instead, we adopt a Variational Quantum Algorithm (VQA). This method does not evaluate whether a candidate is a solution, as in Grover's algorithm; instead, it guides the quantum state toward the configuration that is closest to a rectangle.
     A necessary and sufficient condition for two chords to form the diagonals of a rectangle is:(1)The two chords have equal length, and (2)Their midpoints coincide.
     We encode these conditions into a cost function and use VQA to minimize it. Some examples of a rectangle obtained via VQA are shown in Fig.3. The optimization method and Ansatz used in the computation are indicated at the top of the figure. Remarkably, with only about 50 Ansatz evaluations, the algorithm finds an almost perfect rectangle. 

🟢量子変分法で内接長方形を見つける
 任意の単純閉曲線において、そのような長方形を、量子コンピューティングで見つけよう。まず最初に、Groverの探索で見つけることを考えた。しかし、そのためのOracleを量子回路で作ることは、現状では困難と判断した。そこで、別の方法として、VQA(Variational Quantum Algoritm)を用いた。この方法は、Groverのように「解であるか否か」を判定するのではなく、「最も長方形に近い状態」に量子状態をガイドする。2つの線分が長方形を成すための必要十分条件は、(1)対角線となる線分の長さが一致し、かつ、(2)対角線の中点同士が重なることである。
 VQAで求めた長方形の例をFig.3に示した。VQAで使う最適化方法や、Ansatzの情報は図の上部に示した。Ansatzの呼び出しは、わずか50回程度で、ほぼ完璧な長方形が見つかった。
The animation showing how the rectangle is found is available here.
長方形が見つかるまでのアニメーションはこちらにあります。

References:

2026年3月19日木曜日

量子コンピューティングの学びに関する短い講演

 神奈川工科大学で「ITを活用した教育研究シンポジウム」(2026-3-18)が開催されました。今回は、第20回という記念すべきイベントとなりました。先進AIに関する、オーガナイズドセッションも設けられました。
中央左は、3Dプリンタによるロゴ(門田和雄教授ご提供)

 ここで、下図のタイトルで短い講演を行いました。量子力学100年、量子コンピューティング40年、量子クラウドサービス10年というこの時代。How Quantum Era Crept Up While You Were Busy Watching AI the Whole Year(年中AIに夢中になっている間に、量子の時代は忍び寄ってきた)という、SNS投稿もありました。私の今回の講演タイトルは、"AI時代に量子コンピューティングを学ぶ"というものです。
 大勢の方々に聴いていただき、ありがとうございました。短い時間ながら、以下のような質疑やコメントもありとても有意地でした。
-----------------------------------------------------------------
ある種のタンパク質に「量子もつれ」の電子対が作られる研究をしている。
数学が得意でない学生は、量子コンピューティングをどのように学ぶか。
初心者は量子コンピュータ実機を使うことに強い関心はあるのか。
量子カーネルによって、こんなにうまく分類できるものなのか。
-----------------------------------------------------------------

 誰かこの講演の写真を撮ってくれたかな、と思ってネットを調べたら、ここにありましたので、以下に引用させていただきます。

 この講演の練習用に作成したパワーポイントビデオは以下にあります。実講演とは若干異なりますが、大筋は変わりません。ご参考までに。

 以下に、いくつかのスライドを抜粋して載せます。




2026年3月14日土曜日

新刊洋書"Quantum Algorithms and Applications"に書評

 本日(2026-03-14)"量子アルゴリズムと応用"と題する分厚い専門書(洋書)が、下記の通り発売になりました。その中に、私のレビュー(書評)を載せていただきました。これだけの大著を完成させた著者のDr. Peter Y. Leeらに大いなる敬意を表したい。

書名:Quantum Algorithms and Applications
著者:Dr. Peter Y. Lee (Ph.D., Princeton University), Dr. Ran Cheng, Dr. Huiwen Ji
出版:Polaris QCI Publishing, March 2026(全630ページ)
販売:Amazon(ここです)

 上記は電子版(Kindle版)です。Kindle版の先頭50ページほどは無料でダウンロードできます。紙版は、分厚くなったためか、Vol.1とVol.2の2分冊になっているので、購入する場合は注意が必要です。
謝辞にも神奈川工科大学名を載せていただきました
書評を掲載していただきました
[小生の書評]
This book begins with a review of the fundamental concepts of quantum algorithms, followed by detailed explanations of key techniques such as the Quantum Fourier Transform (QFT) and Quantum Phase Estimation (QPE). It then bridges these foundations to Shor’s factoring algorithm. After demonstrating Shor’s algorithm through concrete examples, the discussion expands into the more general framework of Hidden Subgroup Problems.

The book also highlights the importance of Hamiltonian simulation, explaining time evolution as governed by the Schrödinger equation. And Variational algorithms based on Ansatz are treated with a rigor and depth that is particularly commendable.

Unlike many CS-oriented books, this book devotes substantial space to simulations in physics and chemistry. The Hamiltonian introduced earlier plays a central role here as well. In doing so, the book provides a concrete and efficient approach to simulating nature, staying true to the vision originally envisioned by Feynman.

In addition, readers can explore modern applications such as quantum optimization and quantum machine learning. Together with the other two volumes in the Scaffolding series, this book is likely to become a definitive reference in quantum computing for researchers, engineers, and students alike.

- Yamamoto Fujio
   Professor Emeritus, Kanagawa Institute of Technology, Japan

---------  和文 ---------
 本書は、先頭部分で、量子アルゴリズムの基本概念を復習し、続けて、量子フーリエ変換(QFT)や量子位相l推定(QPE)などの重要なアルゴリズムを詳しく説明している。それらを、Shorの因数分解アルゴリズムにつなげている。Shorのアルゴリズムについては、具体例を使って詳しく説明した後、それをさらに一般化する隠れ部分群問題(Hidden Subgroup problems)にまで言及している。

 また、ハミルトニアン(Hamiltonian simulation)の重要性を示し、シュレディンガー方程式に則って、それを時間発展させる説明が含まれる。Ansatz(パラメータ付き仮説量子回路)を使った変分アルゴリズム(Variational Algorithms)も丁寧に扱われているのは素晴らしい。

 他のコンピュータサイエンス寄りのテキストにはあまり出てこないような、物理と化学のシミュレーションにも多くのページを費やしている。その前に説明されていたハミルトニアンが、ここでも、うまく機能している。これは、まさに、ファインマン(Feynman)が当初構想したような自然界のシミュレーションを効率的に実現する具体的な方法を与えてくれる。

 これ以外に、量子最適化(Quantum Optimization)や量子機械学習(Quantum Machine Learning)など、最新の応用を知ることができる。この本を含む、Scaffoldingシリーズの3冊は、研究者、技術者、学生にとって、量子コンピューティングにおける新たなバイブルとなるであろう。

Fujio Yamamoto
Professor Emeritus, Kanagawa Institute of Technology, Japan
------------------------

2026年2月20日金曜日

App Inventorで鼻炎スプレイ噴射間隔管理アプリ

 本日(2026-2-20)以降、花粉飛散が増加するとのニュース。耳鼻科にかかっているが、あまり良くならない。そこで、どうしても、市販の即効性点鼻スプレイ(第2類医薬品)に頼る。しかし、常用は、組織を傷める傾向なので良くないと医者に言われた。実際、説明書にも、3時間以上間隔を空けて使用のこと、と記されている。

 でも、いつ噴射したか忘れてしまう。これまでは、ノートに書いて間隔を管理していたが、面倒になった。それなら、スマホアプリを作ればいいじゃないの?

 そうです、それに答えてくれのが、MT App Inventorです。今までの作成経験もあり、サクッとすぐに作れた。デザインにも少し気を配った。単機能だが、私にとって、これぞ実用アプリだ!
🔵簡単だが、以下の項目も含むので、初級演習課題、体験学習に向いているかも?

・電源を切っても、前回日時を保存するためのTinyDB
・2つの日時の間隔、x時間後の日時の計算のためのブロック
・噴射可能時間になった時に初めて[噴射]ボタンが表示される
・不用意に[噴射]ボタンが押されないように、long clickを活用
・WebViewerでリアルタイム花粉情報を表示(ウエザーニュース)
・初期設定をどうする
・拡張として:噴射経過をリストで表示するのも有用


2026年2月16日月曜日

量子カーネル(SVC法)ってどうなの?

【要旨】古典/量子カーネル(+SVC)の基本的な理解を深めるため、両者のクラス分け(分類)性能を比較した。現状では、多くの場合、古典カーネルが高い精度を示す。しかし、特殊なAd-hocデータに対しては、古典カーネルは対応できない反面、量子カーネルは完璧な分類結果を示した。ここに、量子カーネルの可能性を見ることができる。

🟢量子カーネルの概要
 まず、量子カーネルの概要を図1に示す。量子特性(重ね合せ、もつれ、位相、干渉)を生かしたFeature Mapと呼ばれる量子回路を用いることが特徴である。これによって、元の2次元データの座標を、高次元(この例では4次元)の量子状態ベクトルへ変換する。そして、その空間でのデータ間類似度を計算する。これも、量子回路で実行される。その情報とラベル情報を使って、古典的なSVC学習器を学習させる。

 Feature Mapにはいくつか種類があるが、ここでは、有名なZZFeature Mapというものを使う。その狙いは、一言で言えば、「古典的には表現困難な非線形の相関を捉える」ことである。従来の古典的な類似度の計算では、座標データが使われるが、このマッピングでは、座標データは量子の位相情報も埋め込んだ情報に変換されるので、位相の近似性も反映した学習となるはずである。
図1 量子カーネルの概要

🟢 実データ(金融 default)の分類
 金融defaultに関する実データ(Javier Mancilla Montero, PhDによる)の分類を試みる。ここに、1,000人の顧客の情報がある。各人には20個の調査項目の値とdefault(債務不履行)か否かのラベルが付いている。この生データは、20次元データなので、主成分分析により次元削減を行う。この例では2次元とした。Feature Mapでは、項目(特徴量)ごとに量子ビットが必要なため、そのようにするのが通例である。

 図2右上は、分類にかける状態である。その下に、古典カーネルによる分離結果を示した。精度0.94で、defaultか否かの境界線が引かれている。一方、その左に、量子カーネルによる結果がある。境界線はやや異なるが、量子カーネルの場合も同様に高い性能を示した。
図2 金融defaultの実データ1,000件の分類
 
 これ以外の実データセットとして(詳細は略すが)、腫瘍(特徴量30個)のサンプル569件がある。その良性 (Benign) /悪性 (Malignant) 分類問題でも、古典カーネル、量子カーネルとも精度0.90を超える結果出している。これらの分類問題では、長年の実績を持つ古典カーネルを使えば十分のように見える。しかし、全く新しい方法である量子カーネルも、実問題に対して同程度の分類性能を示したことは、注目すべきではないか。

🟢人工的なデータセット(Ad-hocデータ)の分類
 次に、量子カーネル(特に、ZZFeature Map)を評価するために作られたAd-hocデータセット(こちらを参照)で試みる。図3右上をご覧いただきたい。赤と青の点が、合計720個ランダムに散在している。だが、何か規則性もあるようだ。実際、データ点数を増やして行くと、赤青の市松模様に近づく。

 まず、これを古典カーネルで分類した。図3右下の通り、このような単純な境界線しか引くことができなかった。これでは、精度は50%台にとどまる。SVCのいくつかのパラメータを変更しても、ほとんどこれと変わらない。
図3 Ad-hocデータセットの古典カーネルによる分類

 次に、量子カーネルを適用した。その結果が図4である。図4右下の通り、正解率100%となる完璧な境界線が引かれた。その左側の図は、この境界線が引かれた時の、境界関数の山と谷の等高線をカラーで示したものである。
図4 Ad-hocデータセットの量子カーネルによる分類

 このデータセットは、ad-hocという名の通り、量子の空間(ヒルベルト空間)で綺麗に分離できるデータを、通常の2次元平面に写像して作ったものなので、当然、量子カーネルで完全に分離できたのである。

 そうであっても、この結果は、量子重ね合せ、位相、もつれを巧みに利用したZZFeature Mapの効果なのだと言える。特殊なデータセットではあるが、古典カーネルでは困難な、新たな領域を探求できる量子カーネルの可能性を示しているようだ!

2026年1月25日日曜日

ビジュアル観察:機械学習カーネル法と代数多様体の特異点解消

 少し大袈裟なタイトルかも知れない。「機械学習SVCにおけるカーネル法」と「代数多様体の特異点解消」の考え方に共通点があるように思われたので、ごく簡単な一例でその関係性をビジュアルに観察した。

🟢一般向け数学講座ビデオ
 きっかけは、石井志保子東大名誉教授による一般向け数学講座「代数多様体の爆発(Blow up)」 (こちらのYoutubeビデオ)を見たことである。易しく、とても分かりやすく、素晴らしいと感じた。この講座には、当然ながら、機械学習の話は出てこない。だが、小生が感じたことを以下に記したい。

🟢機械学習SVC(Support Vector Classifier)のカーネル法
 まず、Fig.1は、よく知られたSVCを利用する簡単な適用例である。Fig.1(a)は、ある曲線に載った2Dデータで、赤青にラベル付されている。ご覧の通り交差した配置なので、ここで、線形に"スパッ"と赤青にクラス分けすることはできない。しかし、カーネル法という方法で、2Dデータを高次元(この場合は3D)に持ち上げ、そこで学習させると、Fig.1(b)に示した緑色の平面で線形分離できるようになる。

🟢1次元代数多様体の特異点をBlowupで解消させる
 ここからは、上記の解説ビデオに基づく話になる。ただし、Fig.2とFig.3は小生が独自に作成したものである。
 簡単な1次元代数多様体をFig.2(a)に示した。原点が特異点になっていることに注意されたい。ここでは、機械学習のような分類問題ではなく、この特異点を解消して滑らかな曲線にしたい。そこで、Fig.2(b)に示すように、blowup(爆発)という方法で、曲線を2Dから3Dへ持ち上げる。すると、赤い点の特異点が青い点2つに分離されて、滑らかな曲線となる。
 このBlowupという方法をFig.3に示した。xy平面において、原点を通るあらゆる直線について、平面での傾きをZ軸の高さとして、そのまま持ち上げる方法である。
🟢カーネル法とBlowupの共通点
 上記に述べた2つは、データ分類のためのカーネル法と、特異点を解消するためのBlowupである。両者の目的は異なるが、「2Dデータを高次元へ持ち上げて問題を解決する」という共通のアイディアがあるように思われる。
 別の見方をすれば、(このビデオで言及されていたことだが)元々はある空間において、「明確に分類されていた」、あるいは「特異点のない滑らかな曲線であった」のだが、2Dへ写像したために、データのクラスが混在したり、どこかが潰れて特異点ができた。それを、元の空間へ戻して、本来の姿を復元させるという共通点があるのではないか。

🟢感 想 
 機械学習や量子コンピューティングは、数学の分野(多様体論や圏論など)とまだまだ深い関係がありそうだ。少しづつ馴染んで行きたいものである。
 また、別の話だが、Fig.1〜Fig.3を描くプログラムコードは、生成AI(GeminiやChatGPT)の助けを借りて、ほとんど自動的に素早く作ることができた。時代は変わったとつくづく思う次第である。

2026年1月14日水曜日

How precise is Quantum Teleportation?

 Quantum Teleportation Demo Using Dynamic Circuits

(末尾に日本語版があります)

In the past, performing a quantum teleportation demo—transferring a quantum state from Alice to Bob on real hardware—required the process to be split. Alice would measure her qubits, the job would terminate, and Bob would then have to initiate a new quantum circuit based on those measurement results.

However, with the recent introduction of Qiskit’s Dynamic Circuit capabilities, this entire process can now be completed in a single job submission. This functionality makes it significantly easier to verify the transfer in real-time. Our experiments on the IBM Quantum Heron r2 hardware demonstrated that teleportation can be executed with remarkably high precision.

🟢 Teleportation via Dynamic Circuits

Figure 1 illustrates quantum teleportation utilizing dynamic circuits. Suppose Alice wants to transfer a quantum state created by applying an Ry(pi/3) gate to qubit q0. Note how the dynamic circuit uses Alice's measurement results to conditionally apply X and Z gates to Bob’s qubit via "if" statements.

At first glance, it might appear that Bob is not performing any measurements. If Bob were to perform an explicit measurement, we could determine the probability of the state being |0>, but the state would collapse, preventing further detailed analysis. To solve this, we utilize Qiskit’s StateTomography tool. Although not explicitly shown in the high-level circuit diagram, it performs internal measurements to reconstruct the density matrix, allowing us to calculate the exact fidelity of the transfer.

🟢 Verifying Transfer Fidelity via Density Matrices

The results of our fidelity analysis are shown in Figure 2. We conducted these experiments using ibm_torino (Heron r1) and ibm_marrakesh (Heron r2), both available under the IBM Quantum Open Plan.

Notably, on ibm_marrakesh, we achieved a fidelity of 0.97 between the state sent by Alice and the state received by Bob. This represents an extremely high level of agreement—one could say the teleportation was nearly perfect! 


Moving forward, we plan to experiment with a wider variety of quantum states and explore the teleportation of multi-qubit systems.

==========================================
【日本語版】
動的回路を用いた量子テレポーテーションのデモ
- 量子状態転送の精度のテスト-
==========================================

 AliceからBobへ量子状態を転送する量子テレポーテーションのデモを実機で行う場合、これまでは、Aliceが量子ビットを測定した時点で、実機の処理を終える必要があった。そして、その後、Bobはその測定結果に基づいて、新たに量子回路を操作する必要があった。しかし、最近のQiskitのDynamic Circuit機能を使えば、実機へのジョブ投入が1回で済むようになった。この方法により、転送の状況を検査するのが容易になる。IBM Quantumの実機Hereon r2で実験したところ、非常に高い精度で量子テレポーテーションが実行されることが分かった。

🟢動的回路を使った量子テレポーテーションのデモ
 Fig.1に、動的回路を使った量子テレポーテーションを示す。Aliceは、量子ビットq0にRy(π/3)を施した状態を作り、それをBobへ転送したいとする。Aliceの測定結果を利用して、動的回路(if文の制御によるXゲートやZゲート)がBobの量子ビットに適用されていることに注意する。

一方、Bobは何も測定していないように見える。もしも、Bobが明示的に測定を行うと、転送された量子状態の|0>の確率は分かるが、そこでcollapseしてしまうので、それ以上の詳しい解析ができない。そこで、この回路図には現れていないが、QiskitのStateTomography というツールで内部的に測定させる。その結果から、密度行列を作り、それに基づいて転送の精度を調べることができる。

🟢密度行列に基づく転送の精度の検査
 このようにして検査した転送の精度をFig.2に示す。使用した量子コンピュータは、IBM QuantumのOpen Planで提供される、ibm_torino (Heron r1)とibm_marrakesh (Heron r2)である。特に、ibm_marrakeshの場合、Aliceが送った量子状態と、Bobが得た量子状態とのFidelityは0.97という、極めて高い一致度を得た。ほぼ、完璧に転送が行われたと言えるだろう!今後、他の量子状態も試したり、複数の量子ビットの状態の転送なども調べたい。

------ private notes --------------------------------
IBM_New...2025_07_01の環境/forQiskit2x/
Teleportation_動的回路A.ipynb
Teleportation_動的回路B.ipynb
-----------------------------------------------

2025年12月31日水曜日

コマドリは渡りに「量子もつれ」を使っているらしい(簡略版)

 本日は大晦日です。今年最後の記事は、前回のこちらの記事の縮小バージョンとしました。

 ある説によれば(科学的に十分な解明はなされていないが)、「こまどり」は、ある条件下で、「量子もつれ」という状態の量子(ここでは電子)のペアをたくさん作ります。2種類あります。一つは[1]singletと呼ばれる、スピンの向きが逆のペアであり、もう一つはスピンの向きが揃った状態の[2]tripletです。この2種の状態は、相互に行ったり来たり遷移します。

 驚くべきことに、コマドリは、全体に占める[1]singletの割合から、地磁気との角度θを認識しているとのことです!例えば、[1][2]が同じ比率ならば、地磁気と垂直な方向に向かっており、[1]の割合が増えると地磁気の向きに近づいいる、という具合です。
 この状況は、図の下段に示すように、量子回路でシミュレーションで再現できます。例えば、シータが30度ならば、[1]singletの割合は0.93となります。このことから、コマドリは、量子コンピューティングを利用していると言える(かも知れません)!?

2025年12月27日土曜日

Robins May Use “Quantum Entanglement” for Migration

Summary:
The European robin, a migratory bird, is said to sense the direction of Earth’s magnetic field by using quantum entanglement, helping it navigate toward its destination. Although the mechanism has not yet been fully explained scientifically, I used this idea as a simple example for quantum computing and explored the question, “Why is quantum entanglement necessary?”

→日本語版はこちら

🟢Robins may sense Earth’s magnetism using quantum entanglement

A short article in the Japanese science magazine Newton (May 2022) suggested that migratory birds might make use of quantum effects. According to the article, when a robin’s eye receives blue light, a protein in the retina called cryptochrome produces many pairs of electrons in a quantum-entangled state. These pairs come in two types:

[1] singlet, where the spins point in opposite directions, and
[2] triplet, where the spins are aligned.

It is said that by comparing the proportions of these two states, the bird can sense the angle of Earth’s magnetic field.

Here, we assume that the bird is trying to fly roughly in the direction of the Earth's magnetic field. As illustrated below, if all pairs are in the singlet state, the bird perceives itself as facing parallel to the magnetic field and flies in that direction. If singlet and triplet appear in equal amounts, it perceives itself as perpendicular to the field and will look for another direction.

🟢Checking the idea with my own quantum-circuit simulator

The article itself was only a brief overview. Rather than stopping there, I decided to reproduce the situation using my own quantum-circuit simulator. Since the robin is thought to judge direction from the proportion of singlet states, I modeled this behavior for quantum computing and ran simulations.

To summarize the results: when the singlet proportion was 0.5, the corresponding angle was 90°, so the bird could not proceed. After “trying again,” the bird found a case where the singlet proportion became 0.93. The corresponding angle was 30°, which seems suitable for flight — so the bird could continue in that direction.

This is exactly a practical use of quantum computing. As an exercise for beginners, it is a very good learning problem.

In the circuit I created, two qubits are first flipped with X gates, then passed through a Bell circuit to generate a singlet. After that, I simply apply a rotation gate RY(θ) to the first qubit. By changing θ, the proportion of singlet states increases or decreases, representing different angles between the bird and Earth’s magnetic field.

🟢Testing on IBM’s real quantum computer

Up to this point, everything was done in my simulator. However, when I ran the same circuit on IBM’s real quantum hardware, I obtained nearly the same results, as shown below.

🟢Why is quantum entanglement necessary?

The discussion so far is already complete in one sense — but why do we need quantum entanglement at all? In fact, if we remove the Bell circuit from the circuit above, it still seems possible to change the proportion of singlet and triplet states. That is a very good question, and my answer is as follows.

However, because entangled states are more fragile than tensor-product (separable) states, it may not necessarily turn out exactly as described below.

In short, I believe entanglement is required in order to follow “the rules of the quantum world.” Although I did not explain it earlier, in the first diagram I wrote the words “cancellation” near the singlet and “amplification” near the triplet. These words actually matter.

First, it would be extremely difficult, considering environmental disturbances, to prepare many pairs of electrons whose spins are perfectly anti-aligned from the beginning. On the other hand, if the electron pairs are entangled, it becomes possible to maintain a stable situation in which “the total spin is zero.” This is what I meant by “cancellation.”

Next, Earth’s magnetic field is very weak. When electron pairs are in an entangled state, it becomes easier for them to transition between singlet and triplet with only a very small amount of energy. For example, when moving to the triplet state, the electrons do not respond to the magnetic field one by one. Instead, they respond as an entangled pair, so their sensitivity can be amplified. That is the meaning of the term “amplification” in the triplet diagram.

In summary, if we were only changing the proportions of singlet and triplet states in a purely logical or statistical sense, quantum entanglement would not seem necessary. However, when we take into account the actual “behavior of quantum systems inside living organisms,” the story changes. What happens inside the eye of the European robin is not just a simple chemical reaction, but rather a highly refined form of “quantum computing” shaped by nature over tens of millions of years.