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.

🟢 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でコーディングして組み込んでいる。

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

(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流かの違いである。

🟢結 論
 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

2026年5月24日日曜日

量子鍵配送プロトコルBB84での混合状態

Mixed States in the BB84 Quantum Key Distribution Protocol

At first glance, it may seem that if a perfectly noise-tolerant quantum computer existed, quantum computations would remain in pure states from beginning to end, making mixed states unnecessary. However, this is a misconception. Even in such an ideal quantum computer, mixed states can play an important and practical role.

I came to understand this through the BB84 quantum key distribution (QKD) protocol. Using the dynamic-circuit functionality available in Qiskit, I was able to verify this behavior experimentally on an IBM Quantum processor, ibm_kingston.

Specifically, when an eavesdropper is present, the BB84 protocol predicts a theoretical error-detection rate of 25%. Running the protocol on the quantum computer yielded an observed error rate of 25.9%, in close agreement with the theoretical expectation.

This experiment demonstrates that mixed states are not merely artifacts of noise or imperfections. Rather, they are an essential and useful concept in quantum information processing, even when quantum operations themselves are ideally coherent.

【要旨】これまで、密度行列に関する記事を2つ(こちらこちらに)書いた。それによれば、もしも、完璧なノイズ耐性量子コンピュータがあれば、量子計算は最初から最後まで、純粋状態を保たれるので、混合状態は考える必要がないように思われた。しかし、それは誤りであり、たとえ、そのような量子コンピュータであっても、混合状態は有効に利用されるのである。そのことを、量子鍵配送プロトコルBB84を例として理解した。Qiskitに装備されている動的量子回路機能を用いて、IBM Quantum実機で確かめることもできた。


→Dr. Peter Lee, Dr. M.S. Qureshiからのこちらのコメントもここにあります。


🟢量子鍵配送プロトコルBB84の仕組み

 すでに、過去の記事(こちらこちら)で詳細を述べたが、短く言えば以下のようになるだろう。


-----「Aliceは、古典ビット(01)と、使用する基底(2種)をそれぞれランダムに選んで決定する。そして、選択した基底における、古典ビットに対応する状態ベクトルをBobへ送る。

 Bobは、Aliceとは全く独立に選んだ基底で、受信した量子状態を測定する。もしもAliceBobの選んだ基底が一致していれば、両者は同一の古典ビットを得ることになる。

 しかし、ここでEveが盗聴を試みる場合、Eveは自身がランダムに選んだ基底でAliceの量子状態を測定してしまう。そして、Eveは盗聴を隠蔽するため、自身の測定結果に応じて量子状態を再度生成してBobへ送らざるを得ない。これは、量子状態複製不可定理による。しかし、Eveの選んだ基底がAliceのものと異なる場合(1/2の確率)、BobへはAliceが送ったものとは異なる(変質した)量子状態が届くことになる。

 その結果、後線でAliceBobが互いの基底を照合し、『基底が一致していたケース』のみを抽出したとしても、そのうち1/425%の確率で二人の古典ビットが不一致を起こす。 AliceBobはこのエラー率を検出することで、Eveの盗聴を確実に察知できる。」-----


 たとえば、Aliceが連続して多数回、量子ビットを送信した場合の動きの例を以下に示す。盗聴がない場合と、盗聴がある場合について、その先頭部分を示す。


=== 1. 盗聴がない場合 (Eve: NO) ===

試行 1: Alice基底=X(0), Bob基底=X -> Bob測定=0 | 一致 (鍵採用)

試行 2: Alice基底=X(0), Bob基底=X -> Bob測定=0 | 一致 (鍵採用)

試行 3: Alice基底=X(0), Bob基底=Z -> Bob測定=0 | 不一致 (廃棄)

試行 4: Alice基底=X(0), Bob基底=X -> Bob測定=0 | 一致 (鍵採用)

試行 5: Alice基底=X(0), Bob基底=Z -> Bob測定=1 | 不一致 (廃棄)

試行 6: Alice基底=Z(1), Bob基底=X -> Bob測定=0 | 不一致 (廃棄)

試行 7: Alice基底=X(1), Bob基底=Z -> Bob測定=1 | 不一致 (廃棄)

試行 8: Alice基底=Z(1), Bob基底=X -> Bob測定=0 | 不一致 (廃棄)

試行 9: Alice基底=Z(0), Bob基底=X -> Bob測定=1 | 不一致 (廃棄)

試行 10: Alice基底=X(1), Bob基底=Z -> Bob測定=0 | 不一致 (廃棄)

. . . . . . . . . .

【結果】Aliceの鍵 : 0000101000111110110111100000101011011001110100111111

【結果】Bobの 鍵 : 0000101000111110110111100000101011011001110100111111

エラー率: 0.0%


=== 2. 盗聴がある場合 (Eve: YES) ===

試行 1: Alice基底=Z(0), Bob基底=X -> Bob測定=1 | 不一致 (廃棄)

試行 2: Alice基底=Z(1), Bob基底=X -> Bob測定=1 | 不一致 (廃棄)

試行 3: Alice基底=X(1), Bob基底=X -> Bob測定=0 | 一致 (鍵採用)

試行 4: Alice基底=X(0), Bob基底=X -> Bob測定=0 | 一致 (鍵採用)

試行 5: Alice基底=X(0), Bob基底=Z -> Bob測定=1 | 不一致 (廃棄)

試行 6: Alice基底=X(0), Bob基底=Z -> Bob測定=1 | 不一致 (廃棄)

試行 7: Alice基底=X(0), Bob基底=X -> Bob測定=1 | 一致 (鍵採用)

試行 8: Alice基底=X(1), Bob基底=X -> Bob測定=1 | 一致 (鍵採用)

試行 9: Alice基底=X(1), Bob基底=X -> Bob測定=0 | 一致 (鍵採用)

試行 10: Alice基底=X(0), Bob基底=Z -> Bob測定=0 | 不一致 (廃棄)

. . . . . . . . . .

【結果】Aliceの鍵 : 10011101100010110010001110110010011100110100

【結果】Bobの 鍵 : 00110101100011110010101111010111001100110000

エラー率: 25.0%


🟢混合状態はどこに現れ、利用されるか

 Aliceは「基底 Z= {|0>, |1>} または基底 X = {|+>, |->}」と「古典ビット(0または1)」をそれぞれ全くランダムに選び、以下に示す可能な4つの状態のいずれか1つを送信することになる。


 すなわち、送信される側のBobや、途中で盗聴を試みるEveの視点では、彼らはAliceがどの基底を使ったかを事前には知らない。したがって、彼らにとって届く量子状態は、4つの純粋状態が等確率(各 25%)で混ざり合った最大混合状態(Maximal Mixed State)になる。それを密度行列ρで表すと以下のようになる。


ρ = (|0><0| + |1><1| + |+><+| + |-><-| ) /4 = (1/2)I (Iは単位行列)


 このことは、Alice2つの基底をランダムに行き来することで、「基底情報を知らないEveが、その量子ビットから正しくビット情報を取り出すことはできない」ことを意味する。あるいは、

Eveがどの基底で待ち伏せしても、見つからず盗聴することは不可能」であることを示している。これが混合状態の正体であると言える。


🟢Qikitの動的量子回路機能でBB84を構成する

 以前は、量子回路は「測定」して得られた古典ビット情報に依存して、その後の量子回路を動的に変更や追加することができなかった。しかし、現在のQiskitではそれが可能なので、上に述べた混合状態を含む量子回路を、一つのジョブとして実行することができ、非常に便利である。その回路図は以下の通りである。

 

 Alice, Eve, およびBobがそれぞれ、どの基底を採用したか、また、測定結果はどうだったを見るため、量子回路の途中で、それぞれ2回づつ測定を行っている。それらの結果を6個の古典レジスタに格納し、その値に応じて、必要な量子ゲートを動的に追加している。


🟢IBM Quantumマシン実機(ibm_kingston)による実行結果

 以上の量子回路を、Open Planで利用可能なIBM 量子コンピュータ実機で実行した結果を以下に示す。盗聴なし、盗聴ありの両ケースとも、ノイズによる若干の影響がみられたが、ほぼ、理論値通りの結果が得られた。


==================================================

  Eveによる盗聴なしIBM Quantum ibm_kingston usage = 2s

==================================================

  採用鍵の長さ: 504 / 1000 shots

  AliceBobの選択基底が合致した先頭30個について:

   Aliceの鍵 : [1 1 0 1 0 1 0 1 0 0 1 0 1 0 0 0 1 1 1 1 1 1 0 0 1 0 1 0 1 0]

   Bobの鍵  : [0 1 0 1 0 0 0 1 0 0 1 0 1 0 0 0 1 1 1 1 0 1 0 0 1 0 1 0 1 0]

  実機エラー率: 1.4% (理論値: 0% + 実機ノイズ)

==================================================


==================================================

  Eveによる盗聴ありIBM Quantum ibm_kingston usage = 2s

==================================================

  採用鍵の長さ: 455 / 1000 shots

  AliceBobの選択基底が合致した先頭30個について:

   Aliceの鍵 : [0 1 1 1 1 0 0 1 1 1 1 1 0 0 0 1 1 1 1 0 1 1 1 1 0 0 1 1 1 0]

   Bobの鍵  : [1 1 1 0 1 0 0 0 1 1 1 1 0 0 0 0 1 0 0 0 1 1 0 1 0 0 1 1 1 0]

  実機エラー率: 25.9% (理論値: 25% + 実機ノイズ)

==================================================


2026年5月18日月曜日

物理量の期待値(Expectation Value of an Observable)の計算

【要旨】前報の続編である。量子状態\( | \psi \rangle\)におけるObservable Aの期待値と\(| \psi \rangle \)の密度行列\(\rho\)との関係を、\(\rho \)の固有値を用いて示す。理解を深める練習のため、その計算過程の詳細を追ってみよう。

-notice-スマホのブラウザの"モバイルバージョン"では数式が見えない場合があります。"ウエブバージョン"でご覧ください。

🟢期待値を密度行列の固有値を用いて表す
 量子状態\( | \psi \rangle\)におけるObservable Aの期待値\(\langle A \rangle \)と、この\( | \psi \rangle\)の密度行列\(\rho_\psi \)は以下の通りである。

\( \langle A \rangle = \langle \psi | A | \psi\rangle\) …….① 
\( \rho_\psi = |\psi\rangle\langle\psi|\) ………….② 

密度行列はエルミート行列なので、次のように固有値分解できる。 
\( \rho_\psi = \sum_{k} \lambda_k |\psi_k\rangle\langle\psi_k|\) ……….③ 

以上のことから、次の式が導かれる。詳細は後述する。 
\(\langle A \rangle = \text{Tr}(\rho_\psi A) \) ……………….④ 
\(\langle A \rangle= \sum_{k} \lambda_k \langle \psi_k | A | \psi_k \rangle \) ……….⑤ 

この結果から以下のことが言える。
「Aの期待値は、各固有状態\(| \psi_k \rangle \)での期待値\(\langle \psi_k | A | \psi_k \rangle \)を密度行列の固有値\( \lambda_k\)で重み付け平均したものである。」

状態が純粋状態か混合状態かの違いが、固有値に現れる。
【1】量子状態が純粋状態ならば、固有値1の状態だけがAの期待値に寄与する。
【2】量子状態が混合状態ならば、複数の固有値がAの期待値に寄与する。例えば、密度行列\( \rho = \frac{1}{2}|0\rangle\langle 0| +\frac{1}{2}|1\rangle\langle 1| \)の場合は、2つの固有値\( \lambda_1=\lambda_2=\frac{1}{2}\)が期待値に寄与する。

🟢上記の2式④と⑤の導出
 ここまで、途中計算を省略した部分があるので、それをここで補う。

【④の式 \(\langle A \rangle = \text{Tr}(\rho_\psi A) \)の導出】

記述を簡単にするため、添え字\( \psi\)は省略する。 

\(\rho= |\psi\rangle\langle\psi| \), \( \langle A \rangle = \langle \psi | A | \psi\rangle\)であること、さらに、トレースの巡回性\(\text{Tr}(XYZ)=\text{Tr}(ZXY) \)により、 
$$ \text{Tr}(\rho A) =\text{Tr}( |\psi\rangle\langle\psi|A)=\text{Tr}( \langle\psi|A|\psi\rangle)$$ 
ここで、\( \langle\psi|A|\psi\rangle\)はスカラ(1行1列の)である。そのトレースは自分自身なので、 \( \text{Tr}( \langle\psi|A|\psi\rangle)=\langle\psi|A|\psi\rangle=\langle A \rangle\)となり、④が成立する。

【⑤の式 \( \langle A \rangle= \sum_{k} \lambda_k \langle \psi_k | A | \psi_k \rangle \)の導出】

記述を簡単にするため、添え字\(\psi \)は省略する。①〜④を使うと、
$$ \langle A \rangle=\operatorname{Tr}(\rho A) = \operatorname{Tr}\left[ \left( \sum_k \lambda_k |\psi_k\rangle \langle \psi_k| \right) A \right]$$
\(= \operatorname{Tr}\left[\sum_k \lambda_k |\psi_k\rangle \langle \psi_k| A \right] \) (分配則)

\( = \sum_k \lambda_k \operatorname{Tr}\left( |\psi_k\rangle \langle \psi_k| A \right)\)(トレースの線形性)

\( = \sum_k \lambda_k \operatorname{Tr}\left( \langle \psi_k| A |\psi_k\rangle \right)\)(④と同様、トレースの巡回性)

\( = \sum_k \lambda_k \langle \psi_k| A |\psi_k\rangle \)(④と同様、スカラのトレースは自分自身)

2026年5月11日月曜日

密度行列における部分トレースと部分系の純粋性

【要旨】量子ビットの状態は、環境の影響を受けることにより、複数の状態が(古典的な)統計的に混じり合った混合状態になる。例えば、|0>と|1>が50%づつ混じった状態などである。これは、量子的な重ね合わせ(superposition)ではない。このような混合状態は、|0>や|1>、および(|0>+|1>)/√2 等の純粋状態とは別物である。しかし、通常のZ基底による測定結果の統計分析だけでは、測定前が、混合状態であったのか、純粋状態であったのかは、一般に区別できない。一方、混合状態と純粋状態を統一的に扱う密度行列というものがある。これを利用すると、興味深いことに、全体が純粋状態であった場合でも、部分系は混合状態であることがある。その状況を、4量子ビットのシステムの例について、手計算で確かめてみた。

-notice-スマホのブラウザの"モバイルバージョン"では数式が見えない場合があります。"ウエブバージョン"でご覧ください。

🟢4-qubit(a,b,c,d)の2種類の純粋状態について考える
 以下の2つの場合について考察する。① もつれのない純粋状態と、② 完全にもつれた純粋状態、である。

① 量子もつれのない純粋状態
 各 qubit が独立な状態として、例えば次のような状態\(|\psi\rangle\)を考える。 $$
|\psi\rangle = |0\rangle_a \otimes |1\rangle_b \otimes |0\rangle_c \otimes |1\rangle_d
$$ 全体密度行列は、 $$\rho_{abcd} = |\psi\rangle \langle \psi| =|0101\rangle \langle 0101|$$である。 この状態は積状態(product state)であり、qubit a は他の qubit と全くもつれていない。
部分トレースを行う。システムbcd(aを除いた)をトレースアウトすると、$$\rho_a = \mathrm{Tr}_{bcd}(\rho_{abcd}) $$ $$ =
\sum_{x=000}^{111}
{}_{bcd}\langle x|
\left(
|0\rangle\langle0|_a
\otimes
|101\rangle\langle101|_{bcd}
\right)
|x\rangle_{bcd}
 $$ この結果、部分系 a の密度行列は以下の通りとなる。 $$\rho_a = |0\rangle \langle 0| = \begin{pmatrix}1 & 0 \\ 0 & 0\end{pmatrix}$$ 純粋状態か混合状態かを調べる。純粋状態である条件は以下の通りであり、実際それは成立する。 $$ \rho_a^2 =\rho_a $$ したがって、部分系 a は純粋状態である。

② 完全にもつれた純粋状態
 以下の4 qubit の GHZ 状態を考える。これは、4 qubit全体で完全にもつれた純粋状態である。 $$
|\psi\rangle = \frac{1}{\sqrt{2}}\left(|0000\rangle + |1111\rangle\right)
$$ 
全体系の密度行列\(\rho_{abcd}\)は以下の通りとなる。 $$\rho_{abcd} = |\psi\rangle \langle \psi| $$ $$
 =\frac{1}{2}\Big(|0000\rangle\langle0000| + |0000\rangle\langle1111| + |1111\rangle\langle0000| + |1111\rangle\langle1111|\Big) 
$$ ここで、上記の①の場合と同様に、bcdを部分トレースし、以下のようにaに関する部分密度行列\(\rho_a\)を計算する。 $$\rho_a = \mathrm{Tr}_{bcd}(\rho_{abcd}) $$ この部分トレースを行うと以下の交差項は消える。 $$ |0000\rangle\langle1111|, |1111\rangle\langle0000|$$ その結果、aに関する部分密度行列は以下のようになる。 $$\rho_a = \frac{1}{2}\left(|0\rangle\langle0| + |1\rangle\langle1|\right) = \frac{1}{2}\begin{pmatrix}1 & 0 \\ 0 & 1\end{pmatrix}$$ 純粋状態か混合状態かであるが、この部分密度行列については、以下のように、純粋状態の条件を満たさない。すなわち、 $$ \rho_a^2 = \left(\frac{1}{2}\begin{pmatrix}1 & 0 \\ 0 & 1\end{pmatrix}\right)^2 = \frac{1}{4}\begin{pmatrix}1 & 0 \\ 0 & 1\end{pmatrix} \neq \rho_a $$ したがって、部分系 a は混合状態である。

🟢結論(純粋状態か混合状態か)
 量子もつれのない積状態では部分系も純粋状態となる。一方、もつれた純粋状態では、全体系は純粋状態であっても、部分系は混合状態となる。これは量子もつれの本質的特徴の一つであり、「全体系の情報は完全でも、部分系だけを見ると統計的混合に見える」という現象を示している。これは興味深いことである。

🟢補足(テンソル積関係の公式)
 上に述べた、全体の密度行列を、トレースアウトして、部分密度行列を算出する手順は省略したが、実はこの計算は、テンソル積、外積、内積が絡み合っているので戸惑った。しかし、以下の公式を思い出すことによって、計算することができた。特に、最後の公式は見逃しやすく、とても重要と思うので掲載しておきたい。
$$ \begin{align} (A\otimes B)(|x\rangle\otimes|y\rangle)=(A|x\rangle)\otimes(B|y\rangle)\\ (\langle a|\otimes\langle b|)(|c\rangle\otimes|d\rangle)=\langle a|c\rangle\langle b|d\rangle \\ (|a\rangle\langle c|)\otimes(|b\rangle\langle d|)=|ab\rangle\langle cd|\\ \sum_i |i\rangle\langle i|=I\\ {}_{\mathbf{Y}}\langle \psi|(|a\rangle_\mathbf{X}\otimes |b\rangle_\mathbf{Y})=|a\rangle_\mathbf{X} \,{}_{\mathbf{Y}}\langle \psi |b\rangle_\mathbf{Y}\\ \end{align} $$  最後の公式は、部分系Yに属するブラは、その部分系Yのケットにだけ作用することを意味する。また、以下のようにみなすと、最後の公式は、上から2番目の公式の特別の場合であることが分かる。 $$ {}_{\mathbf{Y}}\langle \psi| =I_\mathbf{X}\otimes {}_{\mathbf{Y}}\langle \psi| $$

🟢純度(purity)と量子もつれの強さ
 上記に、「①もつれのない純粋状態」と「②完全にもつれた純粋状態」について述べたので、「純粋状態の程度を示す純度(purity)」と「もつれの強さ」との関係を確認しておきたい。本来、この両者は物理的には異なる概念のようである。しかし、次のような関係がある。

「全体系が純粋状態である場合、部分系のpurityは、その部分系とそれ以外の残り(環境系)との間のもつれの強さの指標となる。部分系のpurityが1よりかなり小さい場合、その部分系とそれ以外の部分との量子もつれはかなり強いと言える。上記②はその一例である。」

🟢密度行列の固有値
 ここまでは、密度行列の固有値に関しては触れなかったが、これは重要なので追記する。
 (少し長くなってしまったので、→こちらに書きました。

🟢参考資料
 密度行列と部分トレースに関して、以下の資料を参考にさせていただいた。

[1] Leonard Susskind & Art Friedman, Quantum Mechanics - the Theoretical Minimum, Penguin Books, 2014, (mainly)Lecture 7.
[2] 嶋田義皓, 量子コンピューティング, オーム社, 2023, pp.51-52.
[3] 西村治道, 基礎から学ぶ量子計算, オーム社, 2022, pp.87-97.
[4] ChatGPTおよびGoogle Geminiを介しての調査結果