2025年3月26日水曜日

Introduction to two books on quantum computing

The number of books on quantum computing has been steadily increasing. Here, I’d like to briefly introduce two books I recently purchased, both of which I found to be excellent.

🔴Peter Y. Lee, Huiwen Ji, Ran Cheng: Quantum Computing and Information, Polaris QCI Pub., 2nd edition, Feb. 2025

First off, I was excited to see the publication date listed as 2025—and the book certainly lives up to that excitement! With 502 pages, its thickness alone hints at the density of its content. The material ranges from beginner to intermediate levels and is presented with numerous illustrations, making it a great choice for those who want to study carefully and in depth.

Published in February 2025, 502 pages total, chapter titles provided by me

The book begins by explaining the basic concept of quantum bits using photon polarization. It then progresses through topics such as quantum superposition, measurement, quantum gates, and quantum circuits. At this stage, it derives BB84, one of the foundational protocols for quantum key distribution.

Next, it devotes around 80 pages to a detailed discussion of quantum entanglement, including a thorough explanation of Bell's inequality. It also covers E91 (Ekert’s protocol), another important technique in quantum key distribution, as well as quantum teleportation—with clear examples using IBM Qiskit code.

Impressively, the book also ventures into applications from the NISQ era, including hybrid algorithms such as the Variational Quantum Eigensolver (VQE) and Adiabatic Quantum Computation (AQC), as well as quantum error correction techniques like the Bit-Flip, Phase-Flip, and Shor Code.

On the other hand, since it does not cover the Quantum Fourier Transform (QFT) or Shor’s algorithm for prime factorization, it may be a bit lacking for intermediate to advanced readers. That said, the co-authors are reportedly preparing a follow-up book focusing on more advanced applications, to be published by the same publisher. I’m very much looking forward to that release as well.

One important point worth mentioning: in many newer books, the example programs often contain errors or fail to run in readers’ environments, largely due to frequent updates in quantum computing platforms. However, the code provided in this book is carefully updated to match the latest Qiskit environment, and every example worked flawlessly in my local setup! This is incredibly important, as it motivates deeper exploration of the book’s contents.
Qiskit quantum app worked perfectly on my local environment

🔴Jack D. Hidary: Quantum Computing - An Applied Approach, 2nd edition, Springer, Aug. 2021

This second book is also a thick, full-color hardcover with a total of 422 pages, targeting beginners to intermediate learners. The latter 170 pages provide a detailed introduction to the basics under the section titled Mathematical Tools for Quantum Computing, so it may be a good idea to review this part first.

The quantum algorithm section in the first half overlaps somewhat with the content of the aforementioned book by Lee et al., but I was happy to see that it includes QFT (Quantum Fourier Transform) and Shor’s Algorithm, which were not covered in that book. For instance, it walks through the entire process (quantum + classical parts) of factoring the small integer 15 (= 3×5), which greatly enhances reader's understanding of the Shor algorithm. Moreover, the second edition includes new content related to Quantum Machine Learning, which is a big plus.

(Note) Factoring a slightly larger integer like 184573 (= 487×379) is considered difficult in simulations due to memory limitations, and on current quantum computers due to limitations in qubit count and error rates. However, simulation is still possible by replacing "quantum order finding" with "classical order finding."

Published in August 2021, 422 pages total

By the way, when you open this book, the Schrödinger equation appears right at the beginning—in other words, the wave function and the Hamiltonian. Since most books on quantum computing are computer science–oriented, this equation is rarely mentioned, which is a bit surprising. However, this is actually a very good thing, because both the quantum gate model and the quantum annealing method are said to originate from the time-dependent Schrödinger equation. Though the explanation spans only four pages, it clearly demonstrates, with a few equations, that “to understand the time evolution of a wave function, one must consider the total energy of the system.” Specifically, it derives the case of a harmonic oscillator potential, as shown below.

Schrödinger Equation – Harmonic Oscillator Potential

Also, please note that the quantum algorithm programs provided in the book are written in Google’s Cirq, not IBM’s Qiskit as mentioned earlier. These programs were created in an older Cirq environment than mine, and I encountered various errors when trying to run them. However, the official Google Cirq site provides examples very similar to those in the book, and I was able to run them perfectly in my Cirq setup! Using those as a reference, you should be able to run the remaining examples in the book as needed.

Examples from Google Cirq

🔴Note the differences between IBM and Google machines

Lastly, there's something important to keep in mind: the bit order in quantum registers is reversed in IBM Qiskit (Little Endian) and Google Cirq (Big Endian)! This is an easy mistake to make and can cause all sorts of confusion. For example, if the initial state of three qubits is |000⟩, applying X gates to q1 and q2 results in q0q1q2 → 011 in Cirq, but q2q1q0 → 110 in Qiskit. For more details, please refer to my earlier article, Testing My Mobile Quantum Circuit Simulator.


tinyurl-------   https://tinyurl.com/eaacxan2   -------


2025年3月24日月曜日

Quantum Computing書籍を新たに2冊購入

 量子コンピューティング関係書籍(特に洋書)の出版が増加している。なかには買ってみて残念な本もあったのだが、今回の以下の2冊はとても優れていると感じたので簡単に紹介したい。

🔴Peter Y. Lee, Huiwen Ji, Ran Cheng: Quantum Computing and Information, Polaris QCI Pub., 2nd edition, Feb. 2025

 まず、2025年出版という新しさに期待した。十分それに応えてくれるものだった!全502ページの厚みに内容の濃さが窺えるだろう。初級〜中級程度の内容が、豊富な図版とともに詳述されていて、じっくり学ぶのに適している。

2025年2月出版、全502ページ、章タイトルを記入してみた
 冒頭で、光子(Photon)の偏光を用いて、量子ビットの基本的な考え方を示している。そこから重ね合わせや測定、量子ゲート、量子回路へと繋げている。この段階で、量子鍵配送の基本の一つであるBB84を導く。次に、量子もつれに関しては、約80ページを費やして精緻に叙述している。この中には、もちろんBellの不等式なども含まれる。さらに、量子鍵配送の別の重要技術であるE91(Ekert)や量子Teleportationが、Qiskitコード例とともに良く説明されている。応用として、NISQ時代のハイブリッドアルゴリズム(VQE: Variational Quantum Eigensolver, AQC: Adiabatic Quantum Computation)や、誤り訂正(Bit-Flip, Phase-Flip, Shor Codeなど)の基本を含めるなど意欲的である。

 一方、QFT(量子フーリエ変換)やShor's Algorithm(素因数分解)が含まれていないので、中級以上の読者には少し物足りないかも知れない。実は、この共著者らは別途、さらに高度なアプリケーンを扱う別の書籍の出版を準備中であると、この出版社のWebサイトでアナウンスされているのでそれにも期待したい。

 特筆すべきことがある。比較的新しい書籍でも、そこに公開されている例題プログムを実行しようとしても種々のエラーが出て動かいないことが多い。量子計算プラットフォームの更新が頻繁なことがその主な要因である。だが、本書の場合は、Qiskitの最新環境によく追随したコードが提供されおり、全てが、私のローカルQiskit環境で完全に動いた!これはとても重要だ。それなら、中身をもっと詳しく探究しようという意欲が湧くからである。

ローカル環境で完全作動したQiskit量子アプリ

🔴Jack D. Hidary: Quantum Computing - An Applied Approach, 2nd edition, Springer, Aug. 2021

 この書籍も初級〜中級向けの全422ページの厚みのある、カラー版ハードカバーである。後半の約170ページは、Mathematical Tools for Quantum Computingという、初心者向けの基礎事項の詳しい解説になっているので、先にこちらを復習するのも良いだろう。前半の量子アルゴリズム関係は、上記のLee本と重なる部分も多いが、そこには無かったQFT(QUantum Fourier Transform)Shor's Algorithmが含まれていて安心する。たとえば、例題として、小さな整数15(=3x5)の素因数分解の過程(量子部+古典部)を全部追跡するのだから、Shorアルゴリズの理解は大いに深まるだろう。また、第二版になって、Quantum Machine Learning関係が追加されたのも大きい。

(注) 例えば、少し大きな整数184573(=487x379)の素因数分解は、シミュレーションではメモリ量の制約により、また、現状の量子コンピュータ実機では、搭載量子ビット数の制約とエラー発生などにより困難な状況と思われる。ただし、シミュレーションでは、「古典的な位数発見」を代用すれば実行は可能である。

2021年8月出版、全422ページ

 ところで、この本を開くと、冒頭にSchrödinger equation(シュレディンガー方程式)が出てくる。つまり、波動関数とハミルトニアンだ。通常、量子コンピューティングの本は(コンピュータサイエンス寄りなので)そういうことがなく、ちょっと驚く。だが、これはとても良いことだ。量子ゲート方式も、量子アニーリング方式も、その理論の源流は、ともに、時間依存シュレディンガー方程式にあるとのことだから。4ページだけの簡単な説明だが、「波動関数の時間変化を知るにはシステムの全エネルギーを見る必要がある」ことを少しの数式で示している。具体的には、以下のような調和振動子ポテンシャルの場合を導出して見せている。

シュレディンガー方程式(調和振動子ポテンシャル)

 さて、公開されている量子アルゴリズムのプログラムであるが、これは(上記のようなIBM Qiskitではなく)、GoogleCirqで書かれていることに注意する。当方の現在のCirq環境とは異なる環境のプログラムであるためか、いろいろなエラーが出て動かすことができなかった。しかし、これには救いがあった。GoogleのCirq公式サイトには、本書の例題にそっくりなものも載っていて、それらは、当方のCirq環境で完全に動いた!それを頼りに、本書の残りの例題も、必要に応じて動かすことができるだろう。

Google Cirqの例題の一部

🔴IBMとGoogleのマシンの相違に注意

 最後にもう一つ重要なことがある。IBM Qiskit (Little Endian)とGoogle Cirq (Big Endian)では、レジスタでのビットの並び順が逆になっている!これは間違いやすく、色々と影響がある場合が多い。例えば、3量子ビットの初期状態が|000⟩である場合、q1q2にXゲートを適用して測定した結果は、Cirqでは、q0q1q2→011となり、Qiskitでは、q2q1q0→110となる。これに関しては過去の記事Testing my mobile quantum circuit simulatorの中でも説明しているので参照願いたい。


2025年3月1日土曜日

量子物理学(量子力学)誕生100周年

 今年は、量子物理学(量子力学)誕生100周年とのことである。それを記念して、国連は、2025年を「国際量子科学技術年」と定めた。その中核となるのはやはり、量子コンピュータの実用化であろう。今年は特に、色々な動きがあると思う。

 2025年2月に、NEDO(国立研究開発法人新エネルギー・産業技術総合開発機構)は、「量子コンピューターユースケース事例集」という、150ページに渡る詳細な報告書を公開した。最新の56のユースケースを含む、製造、金融、エネルギー、創薬などの分野での効果や課題がよく分析されていて非常に参考になった。素晴らしい資料である。

 産総研では、G-QuATと呼ばれる、3方式の量子コンピュータとGPUスーパーコンピュータを融合させて研究開発、実用化を促進させるためのセンターを2025年春に発足させる。

 また、大阪大学では、2025年7月末から「Quantum Innovation 2025」の開催を予定している。5日間に渡る大規模なイベントとなりそうである。

 ささやかならがら、小生も神奈川工科大学が開催する「ITを活用した教育研究シンポジウム2024」で、以下のような短い講演を行うことになった。