Basic Quantum Computing
Basic Quantum Computing with Least Physics PossiblePermalink
Classical Probability BitPermalink
We will start by talking about classical probability bit. Here is the one bit representation p0p0, p1p1 are the probability of being 00, 11 respectively.
(p0p1)s.t. p0+p1=1, p0,p1∈R, 0≤p0,p1≤1And here is the n-bits representation
(p0⋯00p0⋯01p0⋯10⋮p1⋯11)∈R2ns.t. ∑px=1, px∈[0,1]∈R, x∈{0,1}nSo we can do some transformation to the bit:
(p0p1)I→(p0p1) (p0p1)NOT→(p1p0)Or if we have two bits
(p0p1),(p0p1)and want to do an XOR with two dependent bits
(p00p01p10p11)XOR→(p000p1)But it is not possible (physically) to do something like this, which kind of does XOR with two independent bits:
(p00p01p10p11)XOR′→(p0⋅p0p0⋅p1p1⋅p0p1⋅p1)In other words, physically, in our universe, we can only do l1 norm linear tranformation.
Quantum Bit (qubit)Permalink
For qubit, we are able to do l2 norm. A single qubit is difine as follows:
(αβ)∈C2s.t. |α|2+|β|2=1, |α|:=√α⋅¯αProb[m=0]=|α|2=(10)Prob[m=1]=|β|2=(01)Certainly we can do transformation to one qubit. In this case, the transformation we have is T∈C2×2. Before talking about transformations, we first introduce k-qubits as follows
(α0⋯00α0⋯01α0⋯10⋮α1⋯11)∈C2ks.t. ∑x∈{0,1}k|αx|2=1and our transformation becomes T∈C2k×2k
Some NotationsPermalink
v=(α1α2⋮αd)∈Cdv†=(¯α1,⋯,¯αd)<v,w>=v†⋅w=¯<w,v>=<v|w>v⊥w⇔v†w=0‖v‖=√d∑i=1αi¯αi=v†vT=(T11⋯T1d⋮⋱⋮Td1⋯Tdd)ˉT=(¯T11⋯¯Td1⋮⋱⋮¯T1d⋯¯Tdd)(α0α1)⊗(α0α1)=(α0β0α0β1α1β0α1β1)Ck⊗Cl=Cklif |˜Φ>=U|Φ>,|˜Ψ>=U|Ψ>,then <Φ|Ψ>=<˜Φ|˜Ψ>and <˜Φ|=<Φ|U†|0>:=(10)|1>:=(01)|+>:=(1/√21/√2)=1/√2(|0>+|1>)|−>:=(1/√2−1/√2)=1/√2(|0>−|1>)H:=1/√2(111−1)H|0>=|+>H|1>=|−>H|+>=|0>H|−>=|1>|X,Y>:=|X>⊗|Y>if f:{0,1}k→{0,1},then |X,Z>Uf→|X,Z+f(X)>Quantum TransformationsPermalink
T is a quantum transformation iff
- T is linear: T∈Cd×d
- T is norm preserving ⇔∀v∈Cd,‖v‖2=‖Tv‖2⇒T⋅T†=I
Basic Quantum Gates (Between 2/3 qubits)Permalink
SWAP:=(1000001001000001)i.e. (X,Y)SWAP→(Y,X)CNOT:=(1000010000010010)i.e. (X,0/1)CNOT→{(X,0/1)ifX=0(X,1/0)ifX=1CCNOT:=(1000000001000000001000000001000000001000000001000000000100000010)i.e. (X,Y,Z)CCNOT→(X,Y,Z⊕X∧Y)(X,Y,0)CCNOT→(X,Y,X∧Y)Note: all transformations are inversible. Specifically, for the above 3 trans., the inverse of them are themselves. Namely, apply it twice and we will be back to the original position.
To implement some classical function f, we need the input bits as well as some extra bits for input to have extra space to work with.
One Small Quantum Algorithm ExamplePermalink
Here we will talk about a small example of quantum algorithms, just to get a feel of how quantum gates works and why it is sometimes more efficient than classical algorithms.
Deutsch Problem
Given f{0,1}→{0,1}, we ask if f(0)=f(1). Classically we have to evaluate twice: both f(0) and f(1). Quantumly we can solve it with one transformation and evaluate it.
input:|0,1>
- |0,1>H→|+,−>
- |+,−>Uf→???
So
|b,−>Uf→⋯→|(−1)f(b)b,−>And|+,−>Uf→1/√2((−1)f(0)⋅|0>+(−1)f(1)⋅|1>)⊗|−>→{±|+>iff(0)=f(1)±|−>iff(0)≠f(1)So if we measure the result, we will see ”0” iff f(0)=f(1), and ”1” iff f(0)≠f(1)
Comments