2025年10月10日金曜日

量子コンピューティングExpo2025に参加

🟢概況
 量子コンピューティングExpo2025(2025年10月8日〜幕張メッセ)に参加したので、断片的だが、小生のなかに残った事柄を記録したい。例年通り、「AI・人工知能Expo」と同時開催であり、【特設エリア】生成AI Hub, Aiエージェントworldへの出展数と参加者が圧倒的に多い。だが、小生はそれにもかからわず、量子コンピューティングの見聞に徹した。IBMやGoogleという巨大量子コンピュータ企業の出展はないが、富士通や、ベンチャー、従来のIT企業の取り組みなどが見られた。出遅れないようにしたいとの気概も感じられた。

🟢量子コンピュータ(モックアップ)の展示
 今年7月末に大阪で開催されたQuantum Innovation 2025は、専門家向けだったのに比べて、今回のExpoはIT技術者や一般向けである。会場でまず目に入ったのが、産総研の「今後の1000量子ビットコンピュータのモックアップ」である。「撮影OK!」と表示されているので、多くの人が記念撮影していた。従来のコンピュータとは造りがまるで違うなあ、という印象を与えるのに十分である!

🟢会場フリーセミナー(予約不要)に人気
 展示のすぐ傍で随時行われたフリーセミナは予想外に人気があった。初日は、図の通り5件の発表があり、いずれも関心が高かったようである。

 このうち、(株)Quemixという会社の「量子コンピュータの使い所とユースケース」は、とても良かった。材料計算、機械学習などに、従来のスーパーコンと量子コンピュータを連携して取り組む説明だが、これはすでに小生のブログ記事に書いたアルゴリズム(古典・量子ハイブリッド)VQA(Variational Quantum Algorithm)そのものではないのか!だから、素直に頭に入ってきた。さらに、その場合、古典データから量子状態への変換、および量子状態測定結果の取り出しの効率化が課題であるとの説明にも大いに納得できた。

🟢量子機械学習への取り組みの展示
 従来のIT企業、ソフトウェア会社でも、遅れを取らないようにと、機械学習への量子コンピューティングの適用を試みる展示もあった。たとえば、量子SVM(Quantum Support Vector Machine)を展示している会社があった。小生は、これに関してはこのブログ記事にも書いているので、自然にバンバン質問することができた。話しが深まり、「これ以上の説明には社長を呼んできます」というところまで行った。現状では、量子状態シミュレータで検討しており、量子コンピュータ実機では確認できていないとのことであり、これも大いに納得。量子コンピュータ実機でのFeature MappingとQuantum Kernelの計算にはまだまだ課題があるはずだ。

🟢藤井啓祐教授とQuEra北川拓也氏の対談
 これは、予約制のセミナーである。実際の内容は、量子コンピューティング界では誰もが知るお二人の対談(45分)だった。朝10:00開始なのに、およそ400席くらいの会場は満席だった。Webではなく、目の前でリアルに聞くと何かが違う!以下、全く断片的だが、思い出した項目を列挙する。(不正確な点があればご容赦ください。)    

  • 2014年に、量子コンピュータが誕生した。それ以降、超伝導方式が引っ張ってきた。現在は、それを含めて5つの方式が進行中。
  • 現在の「実験科学」は、「計算科学」へ移行する。量子コンピュータ自体が物理実験装置になる。特に化学計算分野。新しい触媒の発見や電池開発に注目。
  • AIが勝手に計算する時代になってくる。
  • 日本は、米国に次いで、ユースケースの発表が多い。また、NEDOでは懸賞付きCHallenge(コンテスト)も開催している。
  • 科学、ビジネスもいいが、これまでにないようなゲームも期待できる。パソコンの黎明期もゲームが引っ張ってきたと言える。それと同じかも。ユーザコミュニティQPARCも作られている。
  • Youtubeの量子コンピューティング解説が従実している。ぜひ、活用すべき。以前は、技術的に疑問符がつくもの多かったが、最近の例えば、ショアの因数分解などで、素晴らしい物がある。そのまま大学の講義になるほどである。
  • IT企業にも、物理系出身の人が意外といるものだ。そういう人を中心に、量子コンピューティング勉強会をやってはどうか。
  • 実際に動く量子コンピュータは100年経ってもできないと言われていたが、10年ですでにここまできている。ここ数年は、100〜200量子ビット構成で止まっているように見える。1000量子ビット機も発表されているが、稼働状況は不明な点が多い。
  • それは誤り訂正技術の進展を待っているためとも思える。
  • 現状では0.1〜1%程度の誤りが発生する。それを緩和する訂正技術も進んでいる。その技術の基本はパリティチェック(多数決で判断)に根ざしているように見える。
  • 30件を超える質問がwebで寄せられており、参考になった:「量子コンピュータの誤作動は、宇宙にコンピュータを置いたら?間違える理由の解消として摩擦、熱、重力とか解決できたりしないの?」、「文系の人でも量子コンピュータについて学ぶには、どのような所から勉強すればよいでしょうか?」、「IBMが野心的なロードマップを出していますが、どのように見られていますか?」、「NISQの範囲で世の中のビジネスにインパクトを与えるものってどんなものがあるのでしょうか?具体的なイメージがわかず、、、」等々。

🟢冷却原子方式(中性原子方式)
 量子コンピュータハードウェアとして、IBMやGoogleは、長らく超伝導方式で実績を重ねてきたが、近年冷却原子方式も台頭している。上記のQuEra(北川拓也氏)は、すでにこの方式の実機を完成させ、研究用に産総研に納めたことで有名である。会場で、この方式に関する説明小冊子が配布されていた。現状と可能性を知るのに有用だ。


---- 会場を歩き回ると疲れてくる -------
Night view near the conference venue (the night after Typhoon 22 passed)

2025年10月3日金曜日

Schrödinger Equation and Quantum Computing

Questions About Quantum Computing

As you progress in your study of quantum computing, the following questions will likely arise. This article explores these points in more detail.

  1. In most books and resources on quantum computing, the Schrödinger equation—which forms the foundation of quantum mechanics—rarely appears explicitly. Why is that?

  2. In quantum circuits used to implement quantum algorithms, the order in which quantum gates are applied is crucial. But is it really acceptable to ignore the execution time of each quantum gate?

    ---> For more information, please see this pdf file.


Schrödinger方程式と量子Computing

🔴量子コンピューティングに関する疑問


 量子コンピューティングをある程度進めて行くと、以下の疑問が湧くであろう。本稿ではこれを検討する。


  1. 量子コンピューティングの書籍等では、量子力学の基礎を与えるSchrödinger方程式がほとんど表に出てこない。それは何故か?
  2. 量子アルゴリズムを実装する量子回路において、量子ゲートの適用順序は重要だが、各量子ゲートの実行時間は考慮しなくて良いのか?

2025年9月28日日曜日

Do You Really Need Quantum Mechanics to Learn Quantum Computing?

Quantum computing is gaining global attention—not just among physicists, but also among computer scientists, engineers, and even high school students curious about the future of technology. As more people enter the field, one common question arises:

“Do I really need to know quantum mechanics to study quantum computing?”

This is not just a theoretical debate. It matters for educators designing curricula, for students choosing courses, and for professionals wondering whether they can contribute without a physics background. Let me share my own journey and reflections on this important question.

A Question from a Symposium

About six months ago, I gave a short talk on my quantum computing work at a small symposium. During the Q&A, one professor asked me exactly this question. At the time, I answered:

“Quantum computing leans more toward information science, so quantum mechanics isn’t absolutely necessary—but sometimes it becomes important.”

That wasn’t entirely wrong. But after thinking it over, I’ve come to a clearer conclusion.

Quantum Mechanics Is Essential

It’s actually more accurate to say: yes, quantum mechanics is essential.

That doesn’t mean computer science students, for example, must take a full course in quantum mechanics before diving in. Most introductory textbooks on quantum computing already begin with the very basics of quantum mechanics—like the behavior of qubits—because without that foundation, you can’t even start the discussion. In that sense, it’s possible to step into quantum computing directly through these resources.

When a Deeper Foundation Becomes Necessary

As your study progresses, though—especially when working on applications in physics, chemistry (energy-related problems in particular), or optimization—you’ll need at least an undergraduate-level understanding of quantum mechanics.

In my case, I’ve spent most of my career in information technology, but in recent years I’ve been exploring quantum computing as an “amateur researcher.” Feeling the need to revisit the fundamentals, I found a book that turned out to be ideal:

Leonard Susskind & Art Friedman, Quantum Mechanics: The Theoretical Minimum, Penguin Books, 2014 (364 pages).
(A free PDF version is available online.)

Learning from Prof. Susskind

Prof. Leonard Susskind is a world-renowned physicist, and his coauthor Art Friedman is a former student. The book grew out of a ten-lecture series given at Stanford University for Silicon Valley engineers. That origin gives the text both rigor and clarity.

It’s not a breezy read, though. Even though the theory is pared down to the “minimum,” you still need to carefully work through the calculations. It took me about two months to complete a first pass, and I still revisit key sections. But the reward was immense: I rediscovered insights rarely emphasized in standard quantum computing texts, such as:

  • Observables (physical quantities) are represented by linear operators.

  • The time derivative of an expectation value is related to another physical quantity.

These concepts may sound abstract, but they capture the very essence of quantum mechanics.


My Study Approach

🟢 To keep myself motivated, I decorated the book’s cover with bright designs and added sticky notes for each chapter, giving me a quick visual map of its structure. For me, study works best when it feels both serious and fun.

🟢 I also found the YouTube lecture series that corresponds to Chapters 1–10 invaluable. Each session is about two hours long, recorded in an actual Stanford classroom. Watching students ask sharp questions—and hearing Prof. Susskind pause, think, and respond with care—made the material feel alive and approachable.

Final Thoughts

So, is quantum mechanics necessary for learning quantum computing?
Yes—without question.

You don’t need to master quantum mechanics before you start, since most textbooks will guide you through the basics. But if you aim to go further—to tackle real applications, explore research, or simply gain a deeper understanding—you will eventually need the solid grounding that only quantum mechanics can provide.

Fortunately, resources like Susskind’s The Theoretical Minimum make that journey both possible and rewarding. And with the global surge in interest, now is the perfect time to embrace both the physics and the computing sides of this exciting field.

2025年9月27日土曜日

量子コンピューティングの習得に量子力学は必須か

<こちらには、この記事の英語版があります。多少、ニュアンスを変えて翻訳しました>

 半年ほど前の小さなシンポジウムで、小生は、量子コンピューティングの取り組みに関する短い講演を行った。ある先生から、「量子コンピューティングを学ぶにあたって、量子力学は必要なのでしょうか?」という質問があった。「量子コンピューティングは情報科学寄りの側面が強いので、絶対必要というわけではないが、時として必要になると思う」という回答をした記憶がある。特段、誤りとは言えないが、これをもう少し考えてみた。

 むしろ、量子力学は必須である!と言う方が正しいかったと思う。ただし、特に情報系の学生が量子コンピューティングを学ぶ前に、量子力学の授業を別途受けることが必須ということではない。というのも、量子コンピューティングは量子力学の上に築かれているので、一般的な量子コンピューティングの書籍は、(量子ビットの特性など)量子力学の最も基礎から始まるからである。そうしないと、話は始まらないのである。だから、そのような書籍や教科書から入って行けば良いのである。

 それでも、量子コンピューティングがかなり進んできて、(特に、エネルギーに関係する)物理や化学、最適化などの応用に取り組むには、学部レベルの量子力学を習得している必要があるだろう。小生の場合、ずっと、情報系で仕事をしてきたが、ここ数年は独自にアマチュア量子コンピューティングをやってきた。このあたりで、量子力学の基礎を見直したいと考えていたところ、私にとって最適と思われる以下の書籍に出会った。

Leonard Susskind & Art Friedman, Quantum Mechanics - The Theoretical Minimum, Penguin Books, 2014.(全364頁)(なお、本書のpdf版は無償公開されている)

 著者の一人Prof. Susskindは、著名な物理学者で、もう一人はその弟子である。シリコンバレーで働くIT技術者向けにStanford大学で行われた10回の講義が元になっているとのことである。それだけに精緻でとてもわかりやすい雰囲気だが、スイスイ読める内容ではない。理論は必要最小限にしているとはいえ、大事な計算はきちんとフォローしないとついて行けない。何とかここ2ヶ月ほどで一通り読み終えた。読み返すべき箇所も残っているが。通常の量子コンピューティングの書籍では得られない、量子力学の真髄をいくつか見直すことができた。たとえば、下図に示すような、「物理量(観測可能量)は線形演算子で表わされる」や「その期待値の時間微分は別の物理量と関係する」などである。他にもいくつかある。
🟢難しい内容も、明るく、楽しみながら掴もう!そういう思いを込めて、オリジナルの表紙にたくさんのデコレーションを施した。また、各章毎に付箋をつけたりして、本書の構成をよく掴めるようにする。それが私の読書流儀。

🟢第1章〜第10章に対応したYoutubeビデオもあり重宝する。各回約2時間あるのでじっくり見る。私の場合、本書を読んでから見ると分かりやすいと感じる。スタンフォードの教室での実写であり、受講者からの質問が多いのにも感心する。ちょっと考えながら、丁寧に回答しているSusskind教授の姿に親しみを覚える。
🟢結論として、量子コンピューティングに着手することは、先入観に反して、それほど難しくないと言えよう。難しいのはその数学ではなく、量子そのものの理解であると言われる。これは念頭においた方がいいだろう。

2025年9月16日火曜日

佐藤文隆博士の逝去

In Memory of Dr. Fumitaka Sato

 仁科記念賞の受賞や、アインシュタイン方程式のトミマツ-サトウ解などで著名な物理学者 佐藤文隆博士が逝去されたニュース(2025年9月14日)に接した。私は単に、博士の一つの新書(下図)の読者にすぎないが、その叙述に感銘を受けていた。私は、物理学の素人であるが、ここ数年、量子コンピューティングの基礎的な技術に取り組んできた。その過程で、この書籍から量子論の哲学と言えるものを学ぶことができたように思う。ご冥福をお祈りします。

I was deeply saddened to learn of the passing of Dr. Fumitaka Sato on September 14, 2025.
He was a distinguished physicist, well known for receiving the Nishina Memorial Prize and for his contributions to general relativity, including the Tomimatsu–Sato solution of Einstein’s field equations.

Personally, I am only a humble reader of one of his books (pictured below), yet his writing left a lasting impression on me. Though I am not a professional physicist, in recent years I have been working on the foundations of quantum computing. Along the way, I felt that Dr. Sato’s book allowed me to glimpse something of the philosophy of quantum theory—a perspective that resonated with my own journey of exploration.

May he rest in peace.

🟢以下に、死去の3日前に行われた最後の京大での講演がある。
量子力学の100年 佐藤文隆(京都大学名誉教授)2025年9月11日
(1時間15分に渡る最後の講演、3日後の9月14日に死去)

2025年8月29日金曜日

「変分アルゴリズム設計」でIBMの上級認定資格を取得

 前回、「量子機械学習」で、IBMの認定資格(Intermediate)を取得しました。(→こちらの記事です)今回は、「変分アルゴリズム設計」という認定資格(Advanced)です。下記のとおり、今回のチュートリアルは、量子力学の色彩が少し濃くなっています。分量も多く、難易度も高く感じられましたが、1週間ほど籠って学び受験しました。何とか合格しました!

🟢IBMチュートリアル:変分アルゴリズム設計
 
量子力学を基盤とした理論が中心ですが、シミュレータやIBM Quantum 実機で例題も動かしながら進めます。最後の方の例題(VQE、VQDなど)のいくつかは実機でsessionを使うため、Open Plan(無料)では動かせません。しかし、その部分は説明を理解するだけで十分かと思います。

🟢資格認定バッチと認定証

🔴変分量子アルゴリズム(VQA:Variational Quantum Algorithm)の意義

 先日、理研のスパコン(富岳)とIBMの最新QuantumマシンHeronの連携のニュースがありました。そこでの有力なアルゴリズムの枠組みが、今回のVQAです。化学計算や組み合わせ最適化などを、既存のスパコンと量子コンの連携で解くための実用的な方法とされています。下図は、このニュース記事と今回のチュートリアルをもとに作成した私のオリジナル作品です!なので、©も宣言しています!

 化学の電子構造問題や組み合わせ最適化問題では、それぞれ特有のハミルトニアン(エネルギー演算子)の期待値が最小となる量子状態を探す(=基底状態エネルギーを得る)ことが求められます。これを、スパコンと量子コンの連携で解きます。ワークフローは図の通りですが、要点は、スパコン側は、量子コンが推定したハミルトニアンの期待値を受け取り、目的の基底状態エネルギーへ向けた最適化を図ります。一方、量子コンは、スパコン側が用意したAnsatz(パラメータ化された量子回路)を測定し、ハミルトニアンの期待値を推定することに徹します。

 この構成は、古典ニューラルネットワークを想起させます。スパコン側で設定するAnsatzは、ハミルトニアンに適合したネットワーク層の構成とニューロン数を決めることに相当し、そこに含まれるパラメータは、辺の重みとバイアスに相当すると考えられます。このパラメータは、通常、Ansatzを構成する量子ゲート(回転ゲート)の角度です。

 基底状態エネルギーへ向けた最適化では、コスト関数(=期待値)のパラメータに関する微分が必要なはずですが、量子コン側での微分は負担も大きく、ノイズの影響を受けやすいので、現実的ではないようです。そこで、スパコン側の最適化は、通常、gradient-freeな方法で(つまり、量子コン側に勾配を要求しないで)行われます。なお、スパコン側は、このようなワークフローを、多数のパラメータ初期値を用意して並列に実行(マルチスタート)できます。ただし、量子コン側はどの程度マルチで走れるのかはまだよく分かりませんが。

🔴VQAが量子コンピューティングの全てではない
 
この枠組みは、"Quantum-Centric Supercomputing"と呼ばれています。しかし、上の図を眺めていると、「頭脳は従来のスーパンコンで、量子コンはこれまでにない驚異の物理実験装置」のように見えます。一方、量子コンピューティングの他の分野、例えば、量子暗号通信や量子機械学習などの発展も大いに期待されています。このような情報科学寄りの問題では、ハミルトニアンとは直接関係しない技法(確率振幅の増幅や位相推定など)が使われます。真に量子コンピュータに向いた問題は何なのかが、だんだん見えてくるのかも知れないです。

2025年8月20日水曜日

A Minimal Collection of LaTeX Examples for Mac Pages

 LaTeXにあまり慣れていない(私のような)人が、量子コンピューティングで資料を作る必要に迫られて作った忘備録です。これだけ頭に入れておけば、大体足りそうな、mini例題集です。なお、私は、LaTeXに関しては、WordよりもMac Pagesの方が、使いやすいように思います。

For other platforms, you may be able to write simpler LaTeX code, but here I have used a format that works reliably on Mac pages.

 この例題の全体は、こちらのpdfファイルにあります。

2025年8月19日火曜日

量子機械学習でIBM認定資格を取得

 IT分野では、資格認定が色々あります。量子コンピューティングの世界もそうなってきました。今回、量子機械学習(QML : Quantum Machine Learning)の基礎に関するIBM認定資格を取得しました。下図はそのデジタルバッチと認定証です。勉強や探求を続けるには、このようなマイルストーンがあるといいですね。

Earned IBM Certification in Quantum Machine Learning
In the IT field, there are many different kinds of professional certifications. Now, the world of quantum computing is beginning to follow the same path. This time, I obtained an IBM certification on the fundamentals of Quantum Machine Learning (QML). The image below shows the digital badge and certificate. Having milestones like this is a great motivation to keep studying and exploring further.

(→こちらに、その後取得した「量子変分アルゴリズム」認定資格があります。)

🔴IBM認定資格の意味
 IBMでは量子コンピューティング分野のいくつかの資格認定を、Foundational、Intermediate、Advancedに分けています。今回の資格(Intermediate)認定バッチは、例えて言うならば、「量子機械学習」という山岳への入山許可証みたいなものかと思います。道は険しく、まだまだこれからです。デジタルバッチの右下にある、登りかけの階段が象徴的です!

🔴IBMの量子コンピューティング関係チュートリアル
 量子機械学習関係の書籍はまだあまり多くないです。そんななか、IBMが提供している様々な量子計算チュートリアルの一つ、「量子機械学習」は非常に充実した内容になっています。以下のURLをご覧ください。

⭐️量子コンピューティングチュートリアル全体
    https://quantum.cloud.ibm.com/learning/en

⭐️量子機械学習チュートリアル
    https://quantum.cloud.ibm.com/learning/en/courses/quantum-machine-learning

 従来からの公開内容が、2025-07-01の開発環境の一新に伴い、大幅に改訂されています。(1)古典機械学習との関係、(2)古典データの量子化のためのEncoding、(3)Fidelityと量子カーネル、(4)QVC(量子変分回路分類器)とQNN(量子ニューラルネットワーク)などで構成されています。

 このチュートリアル全体の学習には、(経験による個人差が大きいですが)標準的には10時間程度。何ヶ所かに、そのセクションを要約した短いビデオがあり、大いに助かりました。また、理論と計算法の説明に加えて、シミュレータおよび量子コンピュータ実機で動かす例題もあり、コードを実行させながら理解を深められます。

 この講座全体を終えた後、1時間ほどのオンライン試験を受けます。守秘義務のため試験内容等は書けませんが、合格ラインは80点/100満点です。不合格になっても、一定期間後には、再挑戦できる教育的配慮もなされています。

 ただし、前提条件として、量子ビットと量子ゲートの基礎(重ね合わせ、確率振幅、相対位相、テンソル積、ユニタリ変換、エルミート行列、量子もつれ、観測量、測定など)、および、量子計算プログラム開発環境にも、ある程度馴染んでいる必要があります。そうでない場合は、下記の講座からスタートするのが良いと思います。
 ⭐️量子情報の基礎
    https://quantum.cloud.ibm.com/learning/en/courses/basics-of-quantum-information

🔴情報工学科ではどうする
 
世の中の関心も高いので、情報系学科では、量子コンピューティング基礎科目を設置するところが増えています。現時点では実用的でなくても、このような先進分野の魅力を教えてこそ大学、という見方もあるでしょう。一方、そんな時間があるのなら、急成長の生成AIやAIエージェント技術をうんと教えて、就職させた方いい、と言えるかもしれない。0か1かではないこの状況が、まさに量子力学的であリます!

2025年8月11日月曜日

量子状態の内積と量子回路の測定

⭕️はじめに

 ベクトルの内積は高校数学でも習います。機械学習などにおいても、2つのベクトルの類似度の計算としてよく出てきます。量子の世界、つまり量子状態ベクトル(以降、簡単のために単に量子状態と呼ぶ)についても内積は極めて重要です。ここでは、量子状態の内積に関する基本事項を復習します。具体的に手計算してみます。


⭕️量子状態の内積を回路の測定から推定(Swap Test)


 二つの量子状態|ψ>と|φ>について、以下の式が成り立つことを示すことが狙いです。左辺は、内積の絶対値の2乗であり、右辺のP(0)は、下図に示す量子回路において、ancilla(補助)ビットを測定した場合の|0>の確率です。

$$|⟨ψ∣ϕ⟩|^2=2P(0)−1$$

| <ψ |φ> |= 2P(0) -1


 ancillaは最上段の1量子ビットです。また、|ψ>と|φ>の量子ビット数は任意ですが(swapするため)両者で同一である必要があります。


(1)量子状態を計算する 


---これ以降は、こちらのpdfファイルでご覧ください。(Bloggerでは、LaTex数式の取り扱いが少し面倒なため)---



2025年7月19日土曜日

量子風鈴?で涼しさを

 猛暑に風鈴はいいものだ。ただし、チリンチリンと、時に耳障りになることもある。そこで、音は出ないが、量子ビットの不思議な世界を想起させる「量子風鈴」なるものを私の研究部屋に吊るしてみた。

熊本城天守閣から吊り下げられたかのような量子風鈴

「量子風鈴」のある研究室風景
 熊本城のカレンダーの前に、透明プラスチック球体が3個吊るされている。これらの球体については何度かこのブログの記事にしてきたので詳細は略します。中央とその下にある2個はBloch Sphereであり、単一量子ビットの状態とそれに対する基本的な量子論理ゲートを射影演算子で表現している。一番上の球体は、4量子ビットのもつれた状態をQ-Sphereで可視化している。

 扇風機の風に乗ってゆらつらするので、少しは涼しげな気分になる。だが実は、それ以上に、量子コンピューティングの世界を探求して行く意欲を持続させるための"おまじない"でもある!

生成AIの判断が、人間の感覚に近かった一つの例

 Webに掲載されたある記事のタイトルが以下のようになっていました。
 (句読点や文章中の空白は原文のままです。)

住宅地でヒグマ駆除、ハンターがライフル銃で 死者出た北海道福島町
 このタイトルを読んだ人は、撃たれたのはヒグマなのか、人間なのか、直ぐにわかるでしょうか?私の第一印象は、「おやっ、何かおかしなタイトルだなあ」ということでした。そこで、生成AIにも判断してもらいました。結論として、現代の生成AIは、(少なくとも本例に関しては)人間の感覚と近いところに来ているということでした。

🟢[生成AI - a]の回答
 非常に曖昧で、文を読んだだけでは「誰が撃たれて死亡したのか」が明確に伝わりません。「ヒグマ駆除」という言葉から、「ヒグマが撃たれた」とは読み取れます。しかし「死者出た」という語句が続くため、人間の死者が出たのか、ヒグマのことを指しているのかが不明瞭です。特に「ヒグマ駆除」と「死者出た」が同列で並べられているため、「駆除の過程で人が撃たれて死亡した可能性」まで想起させてしまいます。

🟢[生成AI - b]の回答
 このタイトルだけでは、撃たれたのがヒグマなのか、人なのかは分かりません。「死者出た北海道福島町」という部分が、撃たれた結果亡くなったのがヒグマなのか、あるいは別の要因で人が亡くなったのか(例えば、ヒグマに襲われて亡くなった、または駆除作業中に事故で亡くなったなど)が不明瞭だからです。文脈として「ヒグマ駆除」とあるので、ヒグマが死んだことは示唆されますが、「死者出た」が誰を指すのかが明確でないため、このタイトルだけでは判断できません。記事本文を読む必要があります。

2025年7月16日水曜日

稲作について生成AIに聞いてみた

 お米の値段、流通が話題になっています。近所を散歩していて、すっかり少なくなった水田ですが、まだ7月中旬だというのに、写真の通り、水田に水が全く無い!ひび割れしているじゃないですか!これじゃ不作になって、米の値段がさらに高騰するのではないか?

「中干し」でひび割れした水田(厚木市 2025-7-15)

 違いました!これは、梅雨明け前後に行われる、稲の生育を調整する手法で「中干し」と呼ばれるものでした。水を一時的に抜くことで、田んぼの表面を乾かし、酸素を取り込める様にして根の健全な発達を促す効果があるとのこと。田んぼをひび割れさせることで、土中に溜まった有害なメタンガスなどを排出させる、また、病害虫を防ぐ効果もある。水をなくすことで、稲に適度なストレスを与えて、育成を調整することにもなるらしい。

 いつ頃からこのような手法が取られていたのか?生成AIからの回答によれば、江戸時代中期にはすでに行われていた。つまり、水の管理の基本として、灌漑と排水が行われていた。17世紀末に書かれた「農業全書」(宮崎安貞著)には、「中干し」を指すと思われる以下の叙述があるという:

「分げつ過多の稲は倒れやすし、時に水を抜きてこれを止むるべし」

🟢感想
 私は、普段、量子コンピューティングやPythonプログラム開発に生成AIを使っている。だが、今回の様な調べ物にも、とても有用だと分かる。時代は変わってきた。今後はさらに、AIエージェントが、人に変わって勝手に?調べ物もしてくれるらしい。昨日、ソフトバンクからその事業化の発表もあった。小学生の夏の自由研究なども様変わりするだろう。ああ!

2025年7月4日金曜日

IBM Quantum Composer - 惜しまれてsunset

----重大な修正------- Composerはsunsetではなかった!2025-07-08 JST確認したところ、New Platformへ移行した後も、Composerは従来通りOpen Planで利用できることが分かった!(ただし、ファイルはローカルに保存するように変更された。それをアップロードすることはできる。)こちらのポストが参考になる。これは力強い!
--------------------------

(元記事はこのままにしておきます。)

【要旨】
量子コンピューティング教育上の優れたプラットフォームIBM Quantum Classic Platformが、2025年7月1日をもって終了(sunset)となった。数ヶ月前から予告があり、完全に new platformへ移行した。小生も準備済みだったので特に問題はないのだが、こんな素晴らしい開発環境、特にその中のComposer(作曲家)という機能を惜しんで、以下に記録しておきたい。

🟢IBM Quantum Platformからの通知(2025-07-01)
 下図の通りである。量子コンピュータハードウェア開発競争の激化が背後にあるようだ。初心者向けの環境から、よりプロフェッショナルな利用のサポートにシフトしたように思われる。ともかく、このPlatformでのOpen Plan(無償)はもはや使えないことが分かる。私は、2年間ほど愛用してきた。図にある通り、これまでに865件のジョブを投入した。小さな量子回路ではあるが(基本的な量子アルゴリズムである、BB84、Ekrt、Grover、Superdense Coding、Teleportation、Simon、Phase Kickback、Phase Estimation, QFT等々)を探求した。その利用経験から得られた知見は、現在とても役立っている!!!その後の、Quantum Machine Learningへの取り組みにも繋がった。大いに感謝したい。
IBM Quantum Classic Platformのサービス終了

🟢量子コンピューティングの全ての操作を一括提供のComposer
 このClassic Platformにおいて、特に使いやすく有用であったComposer機能を振り返り、記憶に留めたい。ログインすると、その場で、以下の項目を一気に実施することができたのである!

(1)ビジュアルに量子回路を編集し、シミュレートする
(2)その量子回路の状態の表示(Q-Sphere、Probability、StateVector)
(3)OpenQSAM(手動量子回路編集)との連携
(4)IBM Quantumマシン実機での実行と結果の取得

量子回路の編集と量子状態表示(Q-Sphere, Probability, StateVector)
OpenQASM(右側)との連携

🟢新しいプラットフォーム(IBM Quantum New Platform)
 新しいプラットフォームでは、上記の様なWebサービスは終了となった。それらと同等のことは、各自がローカルにQiskit環境を設定して行うことになった。しかし、(詳細は略すが)新しい様々な機能が新たに使えるようになった。特に、これまでOpen Planでは使えなかった新鋭の実機 ibm_torino(Heronプロセッサ)が利用可能となったことは大きい!

2025年6月23日月曜日

Comparison of Kernel PCA on Gaussian and Quantum kernel

Auto-translated from Japanese.

[Abstract]
The ad_hoc_data dataset is commonly used in research exploring quantum methods for data classification. An example of applying the KPCA (Kernel Principal Component Analysis) method to this dataset is provided in the IBM tutorial "Qiskit Machine Learning 0.8.3". In the tutorial, a comparison is made between a Gaussian kernel (the classical RBF kernel) and a quantum kernel (based on the ZZFeatureMap). The results demonstrated an example of quantum advantage. This article revisits and reaffirms those findings.

🔴 Characteristics of the Input Dataset: ad_hoc_data
This is an artificial dataset designed to make linear separation (classification) difficult for classical methods but easier for quantum techniques. Although it lacks practical applications, it is often used in studies of quantum advantage. Specifically, the dataset is constructed so that classification is challenging with classical kernels (e.g., Gaussian RBF), but effective with quantum kernels based on quantum feature maps such as ZZFeatureMap. It is primarily a binary classification dataset (labels 0 and 1), split into training and test sets.

    A key parameter, gap, controls how easily the classes can be separated. Larger values generally make the separation easier. Figure 1 shows the sample distribution. The samples for classes 0 and 1 are grouped into small clusters, making linear separation appear difficult.


🔴 Mechanism of KPCA (Kernel Principal Component Analysis) and Classification
KPCA is an extension of traditional PCA using the kernel trick, allowing it to effectively handle datasets with nonlinear structures. First, the input data is implicitly mapped into a high-dimensional feature space using a kernel function. In that space, similarities between samples are calculated, forming a kernel matrix (see Fig. 2). The kernel can be either a classical kernel (e.g., Gaussian RBF) or a quantum kernel (e.g., using a quantum feature map).

    Next, PCA is applied to this kernel matrix to project the data onto the principal components (or, reduce dimensionality).

    At this stage, we are only preparing for classification — no label information is used yet. Interestingly, when constructing a kernel matrix based on fidelity (similarity) using the ZZFeatureMap, a class-like structure (similar to clustering) can emerge even without using labels, particularly in datasets favorable to quantum kernels such as ad_hoc_data. That is, a block-like structure becomes visible in the heatmap of the kernel matrix.

    Figure 2(a) demonstrates this clearly. Most of the data pairs with label 0 (indices 0–49) form a high-similarity block (dark green), as do those with label 1 (indices 50–99). By contrast, in the classical Gaussian kernel case (Fig. 2(b)), this block structure is much less evident.


    After this stage, we proceed to supervised learning by incorporating label information. While Support Vector Classification (SVC) could be used, we opted for Logistic Regression due to its simplicity and compatibility with quantum kernels such as ZZFeatureMap-based.

    The classification results are shown in Fig. 3. They appear to reflect the structure seen in the kernel matrix of Fig. 2. Indeed, the test accuracy was 0.95 using the quantum kernel (Fig. 3(a)) and 0.6 with the classical kernel (Fig. 3(b)). This provides an illustrative example of the potential benefits of quantum kernels.

🔴Reference [Qiskit Machine Learning 0.8.3]

カーネルPCA法における古典カーネルと量子カーネルの比較

[要旨]データのクラス分けに関する量子的手法の研究用として、ad_hoc_datasetがある。これに、KPCA法 (Kernel Principal Component Analysis)を適用する例が、IBMのチュートリアル "Qiskit Machine Learning 0.8.3"にある。その中で、Gaussianカーネル(古典rbfカーネル)と量子カーネル(ZZFeatureMapに基づく)を適用した場合の比較がある。結果として、量子優越性を示す例となっていた。本記事では、これを再確認した。

🔴入力データセット ad_hoc_dataの特徴
 これは、古典的な方法では線形分離(クラス分け)が難しいが、量子的手法ではそれが容易になるように設計された人工的データセットである。実用性はないが、量子優位性(quantum advantage)の研究などで利用される。すなわち、古典的なカーネル(GaussianカーネルRBF等)では分類が難しいが、量子特徴マップ(ZZFeatureMap等)に基づく量子カーネルではうまく分類できるように構成されている。主にバイナリ分類用のデータセット(ラベル 0 と 1)であり、トレーニングセットとテストセットに分けられる。

 このデータセットの生成用のパラメータの一つであるgapは、クラスの分離性を決める。この値が大きいほど、クラス分けは容易になる傾向となる。Fig.1にそのデータサンプルの分布を示す。クラス0とクラス1のデータがそれぞれ小さなグループとなって散在しており、線形分離は困難のように見える。

🔴KPCA(Kernel Principal Component Analysis)の仕組みとクラス分け
 KPCAは、"非線形構造データ"の分類に有効なように、通常の主成分分析PCAをKernel Tickによって拡張したものである。すなわち、まず、カーネルを使って、入力データを暗黙的に高次元空間に写像し、その空間での特徴表現(データサンプル間の類似度の計算)を行う。結果としてFig.2に示すようなカーネル行列が得られる。カーネルとしては、古典カーネル(Gaussianカーネルrbf等)や量子カーネル(Quantum Feature mapに基づく)を使うことができる。これに続けて、主成分分析PCAの手法を適用して、その空間での主成分への射影(または次元削減)を行う。

 ここまでは、クラス分類のための準備であり、分類学習はしていない。クラスを示すラベル情報も全く使っていない。しかし驚くべきことに、ad hoc datasetのような量子カーネル向きのデータセットに対して、ZZFeatureMap を用いた fidelity(類似度) に基づくカーネル行列を構成すると、クラス構造(クラスタリング的な構造)が浮かび上がる場合がある。つまり、ラベル情報がなくても、カーネル行列のヒートマップを見ると、ブロック構造(クラスタ)が現れる。

 Fig.2(a)は、まさにそれを示している!すなわち、ラベル0のデータ(番号0〜49)のペアは、ほとんどが高い類似度(濃い緑色)を示すブロックになっている。ラベル1(番号50〜99)についても同様である。しかし、これに反して古典Gaussianカーネルの場合(FIg.2(b))は、そのようなブロック構造が明瞭でない。
 さて、この後、カーネル行列に加えて、ラベル情報を用いた教師付き学習を行う。その際の分類学習器としてSVCを使っても良いのだが、ここでは、より軽量でZZFeatureMapとの相性も良いとされるLogistic Regression(ロジスティック回帰)を使った。

 Fig.3にその結果を示す。この結果は、Fig.2に示したカーネル行列の構造がそのまま反映されているように見える!つまり、テストデータに対する分類精度は、量子カーネルの場合0.95(Fig.3(a))、古典カーネルの場合0.6(Fig.3(b))であった。量子カーネルの可能性を示唆する一例となった!

🔴参考資料 [Qiskit Machine Learning 0.8.3]

2025年6月11日水曜日

Enjoy Observing Classical and Quantum Kernels in SVC

[Abstract]
The Support Vector Classifier (SVC) is a well-known and effective method for classification. One of its key strengths is the kernel trick, which implicitly maps complex, intertwined data into a higher-dimensional space using a kernel function—allowing for linear separation in that space. In this article, we’ll visually explore and enjoy the differences between classical and quantum kernels!

🟢 Input Dataset: Gaussian Parity
Classical SVC is highly powerful and often outperforms current quantum methods. However, quantum techniques offer novel capabilities that classical approaches cannot, which is why research in this area is gaining momentum.In this article, we use a dataset known as Gaussian Parity, which is considered well-suited for quantum methods.

     As shown in Fig. 1, this dataset consists of 80 samples (56 for training and 24 for testing) and two class labels. The data points from each class are interleaved in a diagonally crossed pattern, making linear separation difficult without transformation. This is where the kernel function—mentioned in the abstract—comes into play.

🟢 SVC Results with Classical and Quantum Kernels
Let’s start with the conclusion. Figure 2 shows classification results using SVC trained with (a) a classical kernel (RBF) and (b) a quantum kernel (a kernel matrix based on the ZZFeatureMap). On the test set, classification accuracy was 0.58 for (a) and 0.93 for (b).

     Of course, these results can vary depending on parameter settings. However, in this instance, the quantum kernel significantly outperformed the classical one. Also, the direction of the decision boundary differs considerably between (a) and (b).

🟢 Exploring the Classical Kernel (RBF)
Let’s take a closer look at the classical case. The RBF kernel is not used directly, but rather called internally during SVC training. It implicitly maps the input data into a higher-dimensional space.
Based on the learned model, we can use Principal Component Analysis (PCA) to project this high-dimensional space into three dimensions and visualize the decision function in 3D.

     The top two images in Fig. 3 show this 3D decision function. You can observe two peaks and two valleys. If we slice this 3D surface at the decision function value = 0, the resulting plane gives us the decision boundary.

🟢 Exploring the Quantum Kernel Matrix
Now let’s examine the quantum case. As shown in Fig. 4, the decision function exhibits a more complex pattern, with more peaks and valleys than in the classical case.
When we slice the surface at decision function = 0, we obtain a decision boundary that achieves a classification accuracy of 0.93.

     This example suggests that the quantum method is exploring and learning within a feature space that classical methods cannot access. This may open the door to entirely new possibilities!


2025年6月6日金曜日

初夏の散歩道-厚木市郊外

 6月に入りまだ梅雨前ですが、初夏らしい日が続いています。散歩道(厚木市郊外)で写した数枚の写真をご覧ください。 2025年6月6日午前の散歩にて。

 かっての同僚の先生から、「もうトウモロコシが実っているのですか?北海道の感覚では、もっと後ですよね。そういえば、大通公園のとうきび売りの露店は本当に少なくなりました。」とのコメントをいただきました。そうなんですね。北海道では、「トウモロコシ」とは言わずに、「とうきび」と呼びます。でも、東京近辺に長年住んでいるとそれに合わせてしまったことに気が付く。懐かしい響き。

2025年5月22日木曜日

Holding the Quantum State of the Mermin-Peres Magic in the Palm of Your Hand

In my previous posts [here] and [here], I introduced the Mermin-Peres Magic Square. While there’s nothing particularly new in this post, I wanted to explore what it feels like to literally hold a quantum state in the palm of my hand. It’s just a plastic sphere I made as a hobby, but it gives me a more tangible sense of what a 4-qubit quantum state might be like.
Quantum state in the palm of my hand

For the corresponding quantum circuit and a detailed explanation, please see [here]. There’s no need to explain Figure 1—if you hold this ball in your hand, you’ll understand the depth of it...

From the initial state, through the generation of entanglement, to the final quantum state—it’s all captured inside this sphere! At first, I thought the 3D rendering from Qiskit’s QSphere would be enough. But once I actually built this physical model and held it in my hand, I realized it offered a somewhat different experience.
Fig.1 Quantum state of Mermin-Peres Magic (4-qubit)


2025年5月17日土曜日

Exploring Quantum Entanglement through Visualization

[Abstract]
The Mermin-Peres Magic Square is a well-known example that illustrates quantum entanglement. I have written related articles in the past (in Japanese, available [here]). This time, I aimed to deepen my understanding by visualizing the phenomenon, using four different methods:
(1)Display of a disk shape using my own simulator, (2)3D Qsphere representation with Qiskit, (3)Pauli correlation analysis, and (4)Measurement on IBM Quantum real hardware.

🔴Example: Tiny Mermin-Peres Magic

An explanation of this example is provided [here]. As shown in Fig. 1, Alice and Bob each possess two qubits. In the first half, their qubit pairs are prepared in an entangled quantum state, ǀψ₁⟩. After that, there is no further interaction between them. Nevertheless, when the final state ǀψ₂⟩ is measured, a strong correlation is observed between their outcomes (as shown later in Fig. 2 and Fig. 3). Specifically, the number of "1"s in the 2-bit classical measurement results is always even for one party and odd for the other. This reveals a strong inverse (or anti-) correlation.

🔴Confirmation Using a Homemade Quantum Circuit Simulator

Figure 2 shows the results of verifying the behavior of this example using a homemade quantum circuit simulator. The probability and phase of each basis state are displayed on a disk. In addition, numerical lists of the probability amplitudes, probabilities, and phases are provided.

For example, in the quantum state ǀψ₁⟩, if Alice's qubits are in the state ǀ00⟩, Bob's qubits will definitely be in the state ǀ11⟩. In the final state ǀψ₂⟩, if Alice is in the state ǀ00⟩, Bob's state will be either ǀ01⟩ or ǀ10⟩. It is also possible to confirm whether the total number of "1"s in the measured classical bitstrings is even or odd, as described earlier. In other words, this disk representation allows us to visually understand the quantum entangled state shared between Alice and Bob.

🔴3D display of quantum states using Qiskit's Qsphere

Quantum entanglement cannot be separated into individual qubit states, so quantum states cannot be displayed individually on a Bloch sphere. However, by using Qiskit's Qsphere, it is possible to simultaneously display all possible basis states on a sphere, as shown in Fig. 3. Here, the size of the circle at the tip of the quantum state vector is the probability value, and the color indicates the phase. It matches well with the disk display in Fig. 2.


🔴Indication of the strength of quantum entanglement by Pauli correlation

One way to investigate the quantum entangled state in more detail is the Pauli correlation measurement. This is based on the fact that, for example, the expectation value when the quantum state ǀψ⟩ is measured on the Z axis is calculated as follows: ⟨ZZ⟩ = ⟨ψǀ Z⊗Z ǀψ⟩

As an example, for the Bell state ǀψ⟩ = (ǀ00⟩+ǀ11⟩)/√2, calculations show that ⟨ZZ⟩ = 1, which means that the Z measurements of the two qubits are correlated in exactly the same direction. On the other hand, for the simple tensor product ǀψ⟩ = ǀ01⟩, ⟨ZZ⟩ = -1, which shows a strong correlation in the opposite direction but is not entangled.

In Fig. 4, in addition to the Z measurement, X and Y measurements are also performed. Although the above Pauli measurements can calculate correlations, they do not necessarily fully reflect the "quantum entanglement". Therefore, in some cases, measurements other than the Z measurement may be performed.
In Fig. 4, ZZ(q2,q3) on the horizontal axis is the ⟨ZZ⟩ calculation for Bob's quantum bit, and ZZ(q0,q1) on the vertical axis is the ⟨ZZ⟩ calculation for Alice's quantum bit. The color of the square at the intersection represents the product of their values ​​(expectation values). The darker the red, the closer it is to +1.

In the state ǀψ1⟩, if the Z measurement results of Alice's two qubits are in the same direction, then the Z measurement results of Bob's two qubits will also be in the same direction. If, on the other hand, the Z measurement results of Alice's two qubits are in opposite directions, then the Z measurement results of Bob's two qubits will also be in opposite directions. Such a strong correlation is also observed in ⟨XX⟩ and ⟨YY⟩, so they can be said to be in a fully entangled state.

On the other hand, in the state ǀψ2⟩, the Z measurement of the two qubits will have the same direction for either Alice or Bob, but different directions for the other. Therefore, it makes sense that the squares in the right panel of Fig. 4 are dark blue (the product of the expectations is -1).
 
🔴Measurement results on an actual IBM Quantum computer

Finally, Fig. 5 shows the measurement results on an actual IBM Quantum computer. This is the result of 10,000 shots performed on one of the most advanced machines, ibm_torino (Heron r1). Although there are some errors (likely due to noise) in both the measurements for the quantum states ǀψ1⟩ and ǀψ2⟩, the results well support the calculation results shown in Fig. 2, Fig. 3, and Fig. 4. It is once again amazing how far quantum computers have progressed!