2023年7月22日土曜日

量子コンピューティングの新刊和書2冊

 最近、新たに2冊の量子コンピューティング関係の書籍を買ってしまった。紙の本は狭い部屋を圧迫するので極力買わない方針なのだが、魅力に惹かれてしまうのである。

 まだ数年〜十数年は、今のコンピュータで済むだろうから、と(気にしながらも)放っている大学の先生も多いだろう。だが、(よく言われる通り)かって、体育館くらいのスペースを占めていたスーパーコンの性能を凌駕するスマホを、今や誰もが当たり前のように使っている。量子コンピュータも、いずれそのようになるはずである。それがどのくらい急速に進むかは誰にも予測は難しい。そういう状況であるから、この分野において、大学等での取り組みが本格化し始めているのは自然である。
 量子コンピューティングの洋書は非常に増えている。一方、優れた和書も幾つか出版されているのだが、(一般向け啓蒙書を除くと)入門と専門の中間くらいの難易度のものが多く、(専門家としてのプライドなのか)厳密性を過度に維持したり、読者の知りたい「途中計算」を自明なこととしてカットしているものも見かける。

 そんななか、束野仁政著「量子コンピュータの頭の中」は、かなり丁寧にコツコツと量子コンピューティングを理解できるように書かれた、とても好感の持てる書である。基本事項から、かなり高度なアルゴリズムまでを非常にわかりやすく解説している。さらに、IBM Quantum実機を動かして理解を深められる。待望の入門向け和書である!

 もう一冊は、中山茂著「対話的量子プログラミング入門」である。これは、表紙に「VSCode x ChatGPT」と書いてある通り、ChatGPTに自然言語で問い合わせて、Qiskitなど、IBM Quantum実機で動くコード等を自動生成させる方法を書いたものである。小生自身も、すでにそのようにしてQiskitコードの一部を生成させていた。だが、気に入らないコードが生成された場合、対話で修正しようとしているうちに、的が外れて発散してしまうケースも経験している。本書ではそういう場合に対するヒントも得られそうである。

2023年7月12日水曜日

Continuously measure quantum states with different orthonormal bases

Quantum entanglement plays an important role in Bell's theorem and the quantum key distribution protocol Ekert. But there is one more important thing. It is to successively measure the quantum state with different orthonormal bases. Both Fig.1 and Fig.2 give information about it, but isn't the graphical Fig.1 clearer than the mathematical representation of Fig.2?
Suppose we apply the following replacement rules:
|0> ⇒ 0,  |1> ⇒ 1
The probability that the measurement result by the current Basis becomes |0> can be get by the function below. This function is equivalent to Fig.1.


2023年7月3日月曜日

Demonstrating app for the Billiard-ball Fredkin gate

This app was developed based on the description in Prof. Chris Bernhardt's book "Quantum Computing for Everyone". This Fredkin gate F(x,y,z) is equipped with several mirrors so that the billiard ball can be properly oriented. Also, appropriate delays are added to the paths so that the ball will collide when it should, and not when it does not. Here we can see the behavior of the two most complicated cases F(1,1,0) and F(1,1,1).

For more information, please see this article.



Acknowledgments
This app seems to work, but I'm not sure on some points.
First, for F(1,1,1), unlike F(1,1,0), I gave a delay to the start of ball 3 (input z). That's to make it properly collide with ball 2 within the switch gate.
Second, in the case of F(1,1,1), unlike the other cases, I gave a delay to the path of ball 1 (input x) outside the switch gate. This is to avoid collision with ball 2.

So, my question is:
As mentioned above, the delay is not the same for all input patterns. Is it acceptable to change the delay depending on the combination of inputs?

I would like to thank Prof. Chris Bernhardt for his good advice (2023-07-06).

2023年7月2日日曜日

Illustrating Fredkin gate in action with billiard balls

[Abstract] Prof. Chris Bernhardt's book [1] on quantum computing, Chapter 6, describes how to realize a Fredkin gate using virtual billiard balls. Fredkin's original idea is reminiscent of quantum (atomic, molecular) collisions, and is said to have influenced the view of quantum computers of the famous physicist Feynman. This article illustrates such a Fredkin gate. (This is a revised version of the previous report in Japanese.)

What is Fredkin's gate? 
This is a 3-input (x, y, z) 3-output logic gate announced by Edward Fredkin in 1982, and can be simply expressed as a logic function as follows:
F(0, y, z )=(0, y, z),  F(1, y, z) = (1, z, y)

The first x is a control bit, so it appears as is at the first output. If x = 0, y and z are output as they are, and if x = 1, y and z are output after being exchanged. A simple calculation shows that it has the following characteristics:
  1. It is a reversible logic gate. That is, the input can be reached from the output.
  2. It is a universal logic gate. In other words, NOT, AND, and fan-out (input duplication function) can be created only with this Fredkin gate.
  3. The number of 1s (True) in input and output is always equal. This corresponds to the fact that the number of billiard balls, which will be described later, is always equal between the input side and the output side.
The originality of making a Fredkin gate with billiard balls
Fredkin showed how to create this gate using billiard balls. It uses ball-to-ball collision and reflection when it hits a corner mirror. However, assuming perfect elastic collision (no energy loss) and perfect matching of multiple balls in size, mass, speed, and injection timing, it is difficult to manufacture realistically, so this is conceptual, It is a logical logical model. However, this method is said to have been surprisingly original and impressed even the eminent physicist Feynman. Collisions of balls are reminiscent of atomic collisions, and are said to have influenced Feynman's ideas about quantum computers.

Make a switch gate with billiard balls
First, make a switch gate out of billiard balls to construct the Fredkin gate. As shown in Fig.1, it has two inputs and three outputs. Balls are thrown in from In1 and In2. Those balls are output to Out1, Out2a, Out2b after elastic collision and reflection by the mirrors installed in the upper right and lower left corners. If neither input is given, there is no output. If the ball enters only In1, it will obviously come out only in Out1. Also, if the ball enters only In2, there is output only in Out2a. For both input and output, if the presence of the ball is set to 1 and the absence of the ball is set to 0, the logical value table will be as shown on the right side of the figure.
It should be noted here that this gate is a reversible gate. In fact, as shown in the lower part of the figure, the fact can be seen by reversing the arrows (3 inputs and 2 outputs) while leaving the input and output labels (logical formula) as they are.

Now, it's a little more complicated when the ball is thrown into both In1 and In2. The movement is shown in Fig.2. It doesn't matter which of the two balls appears at which output. It suffices to say that both the input side and the output side are 1 if the ball appears, and 0 if the ball does not appear.
 In addition, I made a simple animation (smartphone app that reflects collision and reflection), so the gif image is shown below.

Make a Fredkin gate out of billiard-ball switch gates
Using four switch gates shown above, the Fredkin gate can be created. These four are all the same switch gates, although they are arranged differently. Fig.3-1 to Fig.3-4 show the behavior for all combinations of inputs of the constructed Fredin gate.
In conclusion, even if we can make the switch gate itself, we need a transcendental skill to combine them to form a Fredkin gate. First, the mirrors must be properly placed to reflect the balls flowing between the switch gates. In addition, it is necessary to properly delay the path so that it collides when it should and does not collide when it should not. If it can be realized, the Fredkin gate works as a 3-input, 3-output logical gate.

 Reference
 [1] Chris Bernhardt: Quantum Computing for Everyone, The MIT Press, 2020.