\def\bra#1{\mathinner{\left\langle{#1}\right|}}
\def\ket#1{\mathinner{\left|{#1}\right\rangle}}
\def\braket#1#2{\mathinner{\left\langle{#1}\middle|#2\right\rangle}}
A brief summary of "mathematical handling of qubits", which is the basis of learning quantum computers. This time, we will not focus on the quantum gate, but only on the mathematical system of qubits.
1 qubit uses bracket symbol,
Also, since $ \ ket {0} and \ ket {1} $ are independent states, it is convenient to describe them as orthonormal bases when describing them as state vectors.
This time, for the sake of simplicity, let us consider the case of 2 qubits.
For classical bits, the combination of data stored in 2 bits is 00, 01, 10, 11 ($ \ ket {00}, \ ket {01}, \ ket {10}, \ ket {11} $ ) 4 patterns. As before, the general quantum state can be described by superposition, so the state of 2 qubits is
As you can see from the results, the tensor product of an orthonormal basis creates an orthonormal basis. The 3 qubits and the 4 qubits will be expanded in the same manner as the 2 qubits. Well, it feels like a linear number (´ 艸 `)
Considering the state of a quantum computer that can solve a realistic problem, the dimension of the matrix will be ugly ... (; ^ ω ^)
I actually reviewed the explanation so far using Blueqat. For a detailed explanation of Blueqat itself, please refer to the Tutorial published by MDR.
#Library import
from blueqat import Circuit
#Define a 1-qubit circuit
c = Circuit(1)
c.m[:].run()
This is a program that displays a state vector when no gate operation is performed on one qubit. In Blueqat, the initial state of the qubit is "0", so the state vector of (1,0) should be displayed. The execution result is as follows.
array([1.+0.j, 0.+0.j])
Consistent with the previous explanation.
Next, the program when the status is "1" is output.
#Library import
from blueqat import Circuit
#Define a 1-qubit circuit
c = Circuit(1)
c.x[0].m[:].run()
This is the one with the X gate acting on it. The X gate has the effect of reversing the quantum state. Therefore, the state vector of (0,1) should be displayed. The execution result is as follows.
array([0.+0.j, 1.+0.j])
This was also consistent with the previous explanation.
As with 1 qubit, we will look at the state vectors for $ \ ket {00}, \ ket {01}, \ ket {10}, and \ ket {11} $.
-** For $ \ ket {00} $ **
program
#Library import
from blueqat import Circuit
#2 Define qubit circuit
c = Circuit(2)
c.m[:].run()
Execution result
array([1.+0.j, 0.+0.j, 0.+0.j, 0.+0.j])
-** For $ \ ket {01} $ **
program
#Library import
from blueqat import Circuit
#2 Define qubit circuit
c = Circuit(2)
c.x[0].m[:].run()
Execution result
array([0.+0.j, 1.+0.j, 0.+0.j, 0.+0.j])
-** For $ \ ket {10} $ **
program
#Library import
from blueqat import Circuit
#2 Define qubit circuit
c = Circuit(2)
c.x[1].m[:].run()
Execution result
array([0.+0.j, 0.+0.j, 1.+0.j, 0.+0.j])
-** For $ \ ket {11} $ **
program
#Library import
from blueqat import Circuit
#Define a 1-qubit circuit
c = Circuit(2)
c.x[0].x[1].m[:].run()
Execution result
array([0.+0.j, 0.+0.j, 0.+0.j, 1.+0.j])
All were in agreement with the previous explanation.
Next time, I would like to explain the mathematical system of quantum gates based on simulations. See you in the next post!
Recommended Posts