aa r X i v : . [ m a t h . HO ] A ug Linear algebra and quantum algorithm ∗ BongJu Kim
Abstract
We introduce quantum algorithm and the mathematical structure of quantumcomputer. Quantum algorithm is expressed by linear algebra on a finite dimen-sional complex inner product space. The mathematical formulations of quantummechanics had been established in around 1930, by von Neumann. The formulationuses functional analysis, linear algebra and probability theory. The knowledge ofmathematical formulations of QM is enough quantum mechanical knowledge for ap-proaching to quantum algorithm and it might be efficient way for mathematiciansthat starting with the mathematical formulations of QM. We explain the mathe-matical formulations of quantum mechanics briefly, quantum bits, quantum gates,quantum discrete Fourier transformation, Deutsch’s algorithm and Shor’s algorithm.
As quantum computer hardware production, which seemed a long way off, has madesome progresses recently, much attention is also being paid to the study of quantumalgorithm. The class of decision problems which solvable by a quantum computer inpolynomial time is called BQP(bounded error quantum polynomial time). AlthoughBQP is not perfectly identified yet, It was proved that many important and harddecision problems belong to BQP. Cryptologists also regard quantum computingas a realizable threat. For example, Shor’s algorithm can broke a cypher whichrelying on the difficulty of the discrete logarithm such as RSA or ECC(elliptic curvecryptography). Cryptologists are preparing for the quantum computing era. Thisresearch field called post-quantum cryptography.Quantum algorithm is expressed by linear algebra on a finite dimensional complexinner product space. The part that need to know about QM is just the mathematicalformulation of quantum mechanics which is formulated by probability theory, linearalgebra and functional analysis. So, quantum algorithm is just a mathematicalproblem. In fact, many mathematicians, such as Peter Shor , Michael Freedman ,research quantum algorithm.This paper is the lecture note that I wrote for the (about) six-hour lecture thatI spoke in Quantum algorithm seminar during 2019 spring semester. I don’t know ∗ This paper wirtten by the finantial support of Brain Korea 21 His prime factorization quantum algorithm made a sensational impact and triggered many researchesabout quantum computing and financial investments because it can broke a strong cryptography system. A fields medal winner mathematician. He works in Microsoft Quantum – Santa Barbara. bout and unfamiliar with physics , but it did not take long time to approachquantum algorithm. I expect that the readers will be able to understand it easily. Before quantum mechanics, one of the main purpose in physics was to find “ thetrajectory of a particle”, x : ( a, b ) → R mathematically, from initial location andmomentum of the particle and mechanical principles which are mathematically for-mulated mainly in a system of partial differential equations. This way had beenestablished after 17 century-the birth of physics. It was believed that the initiallocations and momentums of a physical system determines perfectly the future ofthe physical system. There was also an extreme argument, in this way, known as“Laplace’s demon” by a French mathematician Pierre Simon Laplace. In this di-rection, Newtonian mechanics, Lagrangian mechanics, Hamiltonian mechanics andthe theory of relativity were very successful in the description of the macroscopicphysical world.However, in atomic scale (about 10 − m) physics, finding “ the trajectory of aparticle” is an unattainable purpose according to quantum physics. In atomic scalephysics, one can’t know what physical event will be happened but only can sayabout the “distribution of probability”. Also, “ the trajectory of a particle” doesnot make sense in this scale.Suppose that you want to know about the momentum of a particle with mass m in a specific potential environment described as the real-valued function V ( x, t ).Then you solve the Schrodinger’s equation i ~ ∂∂t ψ ( x, t ) = − ~ m ∂ ∂x ψ ( x, t ) + V ( x, t ) ψ ( x, t ) to find “the wave function of the particle” ψ ( x, t ) which have all quantum mechan-ical information about the physical system. A wave function is a complex valuedfunction and an element of a complex Hilbert space H (complete inner product spaceover C , L space usually). As you know, any constant multiple of a solution of thelinear partial differential equation is also a solution , we take the solution with unitnorm. Now, operate “the momentum operator”ˆ p := ~ i ∂∂x which is an Hermitian on the wave equation ψ ( x, t ) and compute the inner productof ψ ( x, t ) and ˆ pψ ( x, t ): Z ψ ( x, t )(ˆ pψ ( x, t )) dx = Z ψ ( x, t ) ~ i ∂ψ ( x, t ) ∂x dx. I do not interested in sciences but because of Shor’s algorithm, I had become interested in themathematical formulations of quantum mechanics. Fortunately, However, Lagrangian mechanics and Hamiltonian mechanics seems like prepare quantum mechanicsand quantum field theory. Let’s consider 1-dimensional case. where ~ is the Dirac’s constant 1 . × − J · s However, the zero function do not fit to describe a physical system. So, we consider only non-zerocomplex functions. hen this value means that the expectation value of the momentum of the particle.Because any constant multiple of a solution of the linear partial differential equationis also a solution, we give a equivalence relation on H \ { } :For any φ, ψ ∈ H \ { } , φ ∼ ψ iff ∃ c ∈ C s.t. φ = cψ. Generally, quantum mechanics can be mathematically formulated as follows:1. A quantum mechanical system associated with a separable complex Hilbertspace H . A quantum sate is described by a 1-dimensional subspace of H . Especially.the zero element in H is do not fit and a quantum sate is exactly associated with anelement of complex projective Hilbert space ( H \ { } ) / ∼ . Therefore, we can take aelement with unit norm as a representative.2. Let H , H describe two quantum mechanical systems respectably. Then, theHilbert space which describes the composition of two quantum mechanical systemsis H ⊗ H .3. Physical observables are described by Hermitian operators on H .4. The expectation value of an observable ˆ A of a quantum mechanical system inthe state represented by the unit element ψ ∈ H is the inner product of ψ and ˆ Aψ .5. Physical symmetries in qunatum mechanics are represented by unitary oranti-unitary operators.
6. Let an observable represented by ˆ A in a quantum mechanical system has adiscrete spectrum { λ i | i = 1 , , . . . } . Then, the result of the experimental measure-ment is one of the eigenvalues λ i and the probability that we get the result λ i is theinner product of ψ and ˆ P i ψ where ˆ P i is the projection operator corresponding to λ i . A quantum bit(qubit) is the unit of information in quantum computing, and one ofthe unit elements of 2-dimensional complex Hilbert space H with the inner product( · , · ) : H × H −→ C . As a bit can be physically implemented by two different voltage or power on-off,Quantum bit can be physically implemented by any two-state quantum mechanicalsystem such as two states of spin of an electron or two states of polarization of aphoton.1-qubit with an orthonormal basis { b , b } represented by u = c b + c b ∈ H where ( u, u ) = c ¯ c + c ¯ c = | c | + | c | = 1and u = c b + c b = c (cid:20) (cid:21) + c (cid:20) (cid:21) = (cid:20) c c (cid:21) . An inner product space is trivially a normed linear space(Banach space). If a Banach space is notseparable, then there is no Schauder basis. If S is a Schauder basis of a Banach space X , Span S is densesubset of X . For example, position, momentum, energy, spin, etc. Due to Wigner’s theorem. , b means the bit 0 and 1. The measurement of qubit is probabilistic. The samplespace of 1-qubit measurement is { b , b } and the probability of event b i is | c i | . n -qubit system associated with H ⊗ n so that represented by a unit element ofa 2 n -dimensional complex Hilbert space with an orthonormal basis { b i | i =0 , , . . . , n − } : v = n X i =1 c i b i ∈ H ⊗ n where n X i =1 | c i | = 1 . Here, the 2 n -dimensional complex projective Hilbert space is the stage for quan-tum algorithms are performed. It is easy to see that b i → i denotes all possible bitfrom 0 to 2 n − { b i | i = 0 , , . . . , n − } is the sample space of then-qubit measurement and P ( b i ) = c i ¯ c i = | c i | .Trivially, there is an element u in H ⊗ H such that u is not a Kronecker product a ⊗ b where a, b ∈ H . It is the mathematical formulation of quantum entanglement.For example, 2-qubit system is generally c ( b ⊗ b ) + c ( b ⊗ b ) + c ( b ⊗ b ) + c ( b ⊗ b ) = c c c c and the Kronecker product of u = u b + u b and v = v b + v b is u ⊗ v = u v ( b ⊗ b ) + u v ( b ⊗ b ) + u v ( b ⊗ b ) + u v ( b ⊗ b ) = u v u v u v u v . Therefore, there are many element which is not a Kronecker product of two elementsin H such as w = 1 √ b ⊗ b ) + 1 √ b ⊗ b ) = 1 √ .w is not a a Kronecker product of two elements in H since C has no zero divisor.In quantum algorithm, two qubits can be entangled as a result of a quantum gateoperation. A quantum gate on n -qubit is a unitary linear map U on 2 n -dimensional complexHilbert space H ⊗ n and represented by 2 n × n unitary matrix . Since a unitarymap preserves the norm of elements, the result U v is also unit. A quantum gatechanges the probability distribution on the basis. Suppose that there is a problemand we prepared enough qubits to express the answer of the problem. This meansthat the set basis B of H ⊗ n contains the answer. Now, a quantum algorithm to Trivially, any higher m -dimensional complex Hilbert space and m n -dimensional complex Hilbertspace are also possible. Recall that if a matrix U satisfies UU ∗ = U ∗ U = I , U is unitary olve the problem is a sequence of quantum gates which makes the probability of theanswer of the problem, denoted by a basis element b ∗ ∈ B , higher enough so that wecan get the answer quickly by iterating performance of the quantum algorithm. Forexample, suppose that a quantum algorithm have the probability of the answer is1 / / ≈ .
03. Trivially, since the result of quantum algorithm is probabilistic,we should verify whether the result is really the answer or not. We can use a classicalcomputer to check it.Since quantum gate is unitary, it’s invertible. Therefore, a quantum computationcan be traced back from the result, and it preserves all informations. this is onepoint that quantum computations differ from classical computations.Following matrices(quantum gates) act on a single qubit. The Hadamard ma-trix(gate) is H := 1 √ (cid:20) − (cid:21) . Observe that Hu = 1 √ (cid:20) − (cid:21) (cid:20) c c (cid:21) = 1 √ (cid:20) c + c c − c (cid:21) and it makes a superposition if u is a basis bit b or b . The X -gate is X := (cid:20) (cid:21) . It changes the coefficients of a qubit: Xu = (cid:20) (cid:21) (cid:20) c c (cid:21) = (cid:20) c c (cid:21) . It is analogous to the classical NOT gate since it flips the bit when it acts on a basisbit. The twist gates T ( α ) := (cid:20) e iα (cid:21) do not change the probability distribution but change the argument of a coefficient: T ( α ) u = (cid:20) e iα (cid:21) (cid:20) c c (cid:21) = (cid:20) c e iα c (cid:21) . There are many matrices(quantum gates) act on two qubit. But here, we presenta very important quantum gate which involves a quantum entanglement. The quan-tum gate is CNOT(controlled-not) gate ∧ ( X ) := . It acts as identity gate for the first qubit and as X-gate(which is analogous to theclassical NOT gate). Observe that ∧ ( X ) v := v v v v = v v v v . specially, ∧ ( X )( b ⊗ b ) = b ⊗ b , ∧ ( X )( b ⊗ b ) = b ⊗ b , ∧ ( X )( b ⊗ b ) = b ⊗ b , ∧ ( X )( b ⊗ b ) = b ⊗ b . i.e. ∧ ( X )( b j ⊗ b i ) = b j ⊕ i ⊗ b i . where ⊕ is the addition in Z . It is showed that CNOT gate is enough for anyquantum circuit involving a quantum entanglement and we do not need any otherquantum entanglement-involving gates. Quantum discrete Fourier transformation is an important transformation in manyquantum algorithms. This is just discrete Fourier transformationˆ f ( k ) = 1 √ N N − X j =0 e πijk/N f ( j )on qubits. For a basis element b k of H ⊗ n , the quantum discrete Fourier transforma-tion F n on n -qubit is F n ( b k ) = 1 √ n n − X j =0 e πijk/ n b j . As you know, if N | k , then 1 √ N N − X j =0 e πijk/N = 1and it is 0 if N not divide k . Quantum discrete Fourier transformation is due to amathematician and a cryptographer Don Coppersmith. Let us denote e πi/ n by ζ n . Quantum discrete Fourier transformation on n -qubit represented by the unitary matrix F n = · · · ζ n ζ n · · · ζ n − n ζ n ζ n · · · ζ n − n ζ n ζ n · · · ζ n − n ... ... ... ...1 ζ n − n ζ n − n · · · ζ (2 n − n . Coppersmith, D. An approximate Fourier transform useful in quantum factoring. Technical ReportRC19642, IBM. 1994 or 1-qubit, F = 1 √ (cid:20) ζ (cid:21) = 1 √ (cid:20) e πi (cid:21) = 1 √ (cid:20) − (cid:21) = H. i.e. the Hadamard gate is the quantum discrete Fourier transformation on 1-qubit.Quantum discrete Fourier transformation F n can be performed by Hadamardgates and CNOT gates. Deutsch’s algorithm is a simple example of quantum algorithm that shows compu-tational profit of quantum algorithm. It solves the following problem .Let f : { , } −→ { , } . If we want to know f is a constant function or notby calculation, we need to calculate f (0) and f (1) classically. However, assuming aquantum gate U f ( b j ⊗ b i ) := b j ⊗ b f ( j ) ⊕ i . Then,( H ⊗ I ) U f ( H ⊗ H )( I ⊗ X )( b ⊗ b ) = 12 [(1 + ( − f (0) ⊕ f (1) ) b + (1 − ( − f (0) ⊕ f (1) ) b ] . If f is constant, then f (0) ⊕ f (1) = 0 i.e. P ( b ) = 1. Otherwise, f (0) ⊕ f (1) = 1 i.e. P ( b ) = 1. In this algorithm, we used U f only once. RSA is one of the most popular public-key crypto-system. The security of RSArelies on the difficulty of prime factorization. It uses very large two primes p, q . Theproduct pq is announced to public and any one who want to sent cryptogram uses pq to encrypt the message. To Decrypt the cryptogram, one should know what is p and q . Since prime factorization is very difficult, one can not find p and q from pq .However, a mathematician Peter Shor published his paper ”Algorithms for quan-tum computation: discrete logarithms and factoring” in 1994 which shows that primefactorization can be obtained fast by his quantum algorithm .Let N be the product of two or more odd primes. If we found an element g ∈ Z ∗ N with the order | g | is even, N divides ( g r/ − g r/ + 1) since g r − ≡ ( g r/ − g r/ + 1) ≡ N. Then gcd ( g r/ − , N ) and gcd ( g r/ +1 , N ) are non trivial divisor of N . The Euclideanalgorithm finding gcd is very fast. Deutsch, D. Quantum Theory, the Church-Turing Principle and the Universal Quantum Computer.Proceedings of the Royal Society of London A. 400 (1818): 97–117. 1985 Shor, P.W. Algorithms for quantum computation: discrete logarithms and factoring. Proceedings35th Annual Symposium on Foundations of Computer Science. IEEE Comput. Soc. Press: 124–134.1994 It is proved that there is enough number of element with even order in Z ∗ N . e set two parts of qubit: one part is u which is n -qubit system where N ≤ n < N . the other part is m -qubit system where m = ⌈ ln N/ ln 2 ⌉ . We operateShor’s algorithm on the ( n + m )-qubit system v ⊗ u as follows.1. H acts on each qubit in n -qubit system u :( H ⊗ n ⊗ I ⊗ m ) v ⊗ u = 1 √ n n − X j =0 v j ⊗ u .
2. Let U x ( v j ⊗ u t ) := v j ⊗ u t + x j mod N for x ∈ Z ∗ N . U x acts on the ( n + m )-qubitsystem: U x (cid:2) √ n n − X j =0 v j ⊗ u (cid:3) = 1 √ n n − X j =0 v j ⊗ u x j mod N . F n acts on the n -qubit system: F ⊗ I ⊗ m (cid:2) √ n n − X j =0 v j ⊗ u x j mod N (cid:3) = 12 n n − X j =0 (cid:0) n − X c =0 e πijc/ n v c (cid:1) ⊗ u x j mod N .
4. Carry out the measurement of result(
F ⊗ I ⊗ m ) U x ( H ⊗ n ⊗ I ⊗ m )( v ⊗ u ) . The value of the measurement means the order of x .5. Factorize N using the order of x .Let the order of x be r and j = j + rk . j ≡ j mod r . P ( v c ⊗ v x j ) is12 n (cid:12)(cid:12)(cid:12)(cid:12) e πij o c/ n ⌊ n /r ⌋ + δ X k =0 e πirkc/ n (cid:12)(cid:12)(cid:12)(cid:12) where δ = 0 ot 1.If r | n , P ( v c ⊗ v x j ) > n /r | c and P ( v c ⊗ v x j ) = 0 otherwise. Therefore,the only possible result of measurement is v t n /r ⊗ v x j for t ∈ Z . So, one can findeasily the order of x .If r does not divide 2 n , one should take a little different process. But the abovealgorithm still needed. [1] D. Coppersmith, An approximate Fourier transform useful in quantum fac-toring. Technical Report RC19642, IBM. 1994.[2] D. Deutsch, Quantum Theory, the Church-Turing Principle and the UniversalQuantum Computer. Proceedings of the Royal Society of London A. 400 (1818):97–117. 1985.[1] G. Mackey, Mathematical Foundations of Quantum Mechanics, W. A. Ben-jamin, 1963.
2] J. von Neumann, Mathematical Foundations of Quantum Mechanics, 1932.[3] P. W. Shor, Introduction to quantum algorithms, arXiv:quant-ph/0005003v2,2001.[4] P.W. Shor, Algorithms for quantum computation: discrete logarithms andfactoring. Proceedings 35th Annual Symposium on Foundations of Computer Sci-ence. IEEE Comput. Soc. Press: 124–134. 1994[5] H. Weyl, The Theory of Groups and Quantum Mechanics, Dover Publications,1950.2] J. von Neumann, Mathematical Foundations of Quantum Mechanics, 1932.[3] P. W. Shor, Introduction to quantum algorithms, arXiv:quant-ph/0005003v2,2001.[4] P.W. Shor, Algorithms for quantum computation: discrete logarithms andfactoring. Proceedings 35th Annual Symposium on Foundations of Computer Sci-ence. IEEE Comput. Soc. Press: 124–134. 1994[5] H. Weyl, The Theory of Groups and Quantum Mechanics, Dover Publications,1950.