Title: Complexity Theory: Classical
1Complexity TheoryClassical Quantum
- A brief overview
- Debabrata Ghoshal
2Definition of Language
- Language is a set of strings over some
alphabet - L s e S s has a property P
- here s is a set of strings and S is the set
of all strings over an alphabet S, including the
empty string. - Example S0,1
- P Max length of the string is 2 s has
0,1,01 etc. - L empty, 0, 1, 00,01,10,11
-
- NOTE L is the complement set of L
3Decision Problem and Language
- Set of languages form a class
- If all YES answers of a decision problem form a
class D, then we say all NO answers form a
class Co-D. - Here Co-D is not D
4Language recognition generation
- Algorithm which is designed to recognize a
string that belongs to a particular language is
called Language recognition device. - Algorithm which is designed to generate
strings that belongs to a particular language is
called Language generator.
5Models of Computation
- Deterministic Turing Machine
- Non-deterministic Turing Machine
- Oracle Turing Machine
- Probabilistic Turing Machine
- Quantum Turing Machine
6Turing Machine
a
a
a
q0,q1 h
7Turing Machine
- T ( Q, S, ?, q0, F)
- H (L,N,R) Q (q0, q1) and S (
a, ) - q a ?(q,
a,h) - q0 a
(q1,,R) - q0 (F
,N) - q1 a
(q0,a,R) - q1
(q0,,R)
8Transition function (Classical)
- Deterministic Turing Machine
- ? Q X S n X S n - 1 X Q X L,N,Rn n Tapes
- Non-deterministic Turing Machine
- ? Q X S n ? Power set (S n -1 X Q X
L,N,Rn) - Oracle Turing Machine
- Probabilistic Turing Machine (transition
probability) - ? Q X S n x S n -1 X Q X L,N,Rn ? 0,1
??1
9Church-Turing Thesis Universal Turing Machine
- Turing machines can simulate all reasonable
computation model or device - A language L is Turing decidable if for all x,
the machine always halts and output Yes if x e
L, and if x not e L the output is No. - Universal Turing machine simulates all Turing
machines.
10Halting Problem
-
NO - YES
-
- Halting problem is undecidable problem
-
Halt?
Halt
Start x
11Quantum Turing Machine
- Transition amplitude function
- ? Q X Sn X Sn -1 X Q X L,N,Rn ? C
- also ? ? 2 1
- and ? x yi , x and y are rational
- Transformation should be unitary and
- reversible.
12Scheme of Reversible Machine
I N P U T O U T P U T
C O M P
I N P U T 0 0 0
P M O C
I N P U T 0 0 0
C O P Y
From The Feynman Processor By Gerald J. Milburn
O U T P U T
0 0 0
O U T P U T
13Complexity Expression
- Complexity is expressed as the relation of the
length of the input x and the amount of the
resources required to answer if x e L - Complexity is related to the model of Computation
- Deterministic Turing Machine (DTM) is one of the
models. - Quantum Turing Machine (QTM) is another.
14Rate of growth, Order of MagnitudeAsymptotic
Notation
- Big-O O f(n) and g(n) such that f(n) lt c.g(n)
for cgt 0, Ngt 0 - and n gt N we say f(n) O(g(n)).
-
- Big-Omega O f(n) and g(n) such that f(n) gt
c.g(n) for cgt 0, Ngt 0 - and n gt N we say f(n) O(g(n)). If fO(g)
then g O(f) - Little-o o When f O(g) but f ? O(g), f(n)
grows strictly slower g(n) we say f(n) o(g(n) - Little-Omega ? When f O(g) but f ? O(g), f(n)
grows strictly faster g(n) we have f(n) ?g(n) - Big Theta ? When fO(g) and f O(g) we say
f(n) ?(n) i.e. upper bound is equal to lower
bound
15Some examples
- Matrix Multiplication is O(n3)
- Using Strassens algorithm the complexity is
- T(n log27) T(n 2.807)
- Complexity of Eigenproblem
- O(n 3 (n log 2 n) log b) where Err. Bound 2-b
- http//citeseer.nj.nec.com/pan98complexity.html
16Time and Space Complexity
- The number of steps required to solve a problem
is called the Time Complexity of the problem. - The number of tapes required to solve a problem
is called the Space Complexity of the problem.
17Classical Time Complexity class P
- P L L L(T), some Turing machine T in
-
Polynomial time - If x is the input and the size of input is
described by - x, then the class of problems solved by some
- algorithm within a number of steps bounded by
- F(x), where F is some fixed polynomial
function, is - in P.
18Classical Time Complexity class NP
- NP L L L(NT), some Non-deterministic
- Turing machine NT in Polynomial time
- 1. Guess a solution (certificate)
- 2. Verify the solution in Polynomial time
19Classical Time Complexity class NP-Hard
- At least as hard as any NP problem
- Solving a problem in polynomial time by an
algorithm can translate to solve any other
problem in NP. - In other words, if every problem in NP can be
polynomial time reducible to a language L, then L
is in NP-hard
20Classical Time Complexity class NP-Complete
- Languages which are NP-hard and also NP are
called NP-Complete. - In NP-Complete problems, one problem can be
restated to the problem of other. - The solution of the other problem can be
translated back to the solution of the first
problem.
21Examples of NP-Complete problems 1
- Traveling Salesman Problem
- Given undirected weighted graph
- Find The minimum-cost path, starting from a
- vertex, visiting all other vertices
once - and ending at the starting vertex.
- Another form vertices are cities, path between
- Vertices are roads, weights are the distances.
22Examples of NP-Complete problems 2
- Hamiltonian Cycle Problem
- A simplified version of Traveling Salesman
Problem. Here the undirected graph has no
weights. -
- This problem is about finding if the graph
contains a hamiltonian cycle or not.
23Examples of NP-Complete problems 3
- Subset sum problem
- Given A set of integer and a target number.
-
- Find A subset of these integers adds up to
- target number
24Examples of NP-Complete problems 4
- 3-SAT boolean satisfiability problem
- Example (x1 or x2 or x4) and (x2 or x3 or x1)
and ( x2 or x4 or x3) Three clauses with
litererals ( variables or their negations form a
3-CNF expression. Assigning True or False to each
variables is it possible to test the expression
is satisfied or not ( True or False ) - Cook-Levin Theorem
25Classical Space Complexity classes
- L (logarithmic), NL ( non-deterministic L), L2
(Square log), PSPACE and NSPACE are different
classes of Space Complexity - Savitchs Theorem shows that
- PSPACE NSPACE
- Immerman-Szelepscenyi Theorem provides the
corollary NSPACE (r) Co-NSPACE(r)
26Classical Complexity Classes
-
-
-
-
-
- ZPP
- TRACTABLE RP I N T
R A C T A B L E -
Co-RP -
-
PP BPP NP Co-NP
P/N SPACE
P
EXP
NEXP
27Classical Complexity Classes
- P Polynomial PP Probabilistic Polynomial
- BPP Bounded Probabilistic Polynomial
- ZPP ZERO-ERROR Bounded PP
- NP Non-deterministic Polynomial
- Co-NP Complement of NP
- EXP Exponential NEXP Non-determ. Exp.
- RP Randomized Polynomial Co-RP Comp.
28Million Dollar Question ?
- The PNP? problem asks whether types P and NP
are (despite all appearances to the contrary) the
same. The expected answer is 'no'. However, if
any NP-complete problem turns out to be of type
P--- to have a polynomial time solution--- than
NP must equal P. We therefore expect all
NP-complete problems to be non-P, but no one can
yet prove this. - http//www.claymath.org/Popular_Lectures/Mines
weeper/
29Primality Testing ( BPP,ZPP)
- Miller-Rabin Test ( Ref. 4)
- 1. If n is even (n ? 2) then n is composite.
Stop - 2. Let n-12x m, m is odd and x gt 0
- 3. Choose random r e (1,n-1)
- 4. Compute rm, r2m, r4mr2xm rn-1 mod n
- 5. If rn-1 ? 1 then n is composite
- else If r2i m ? 1 and r(2 i1)m 1 for
some i gt 0, - then n is composite
- else n is prime
- end.
- IF n is prime, probability is 1, if composite
the prob. ½ at least
30Primality Testing in P. (2002)
- Input integer n gt 1.
- 1. If (n ab for a e N and b gt 1), output
COMPOSITE. - 2. Find the smallest r such that or (n) gt 4 log2
n. - 3. If 1 lt (a, n) lt n for some a r, output
COMPOSITE - 4. If n r, output PRIME.
- 5. For a 1 to ? 2vf(r) log n ? do
- if ((X a)n ? Xn a (mod Xr - 1, n)),
output -
COMPOSITE - 6. Output PRIME
- http//www.cse.iitk.ac.in/news/primality_v3.pdf
31Quantum AlgorithmComplexity of Shors algorithm
- Input Odd number n size of n is n
- Output A nontrivial factor of n
- 1. Choose arbitrary a e 1, 2, ,n-1
- 2. f gcd(a,n) by Euclid algorithm. If fgt1
output f stop - 3. Find the period r by quantum Algorithm
- if r is odd or ar -1(mod n) or ar 1(mod
n) output failure and stop - 4. Compute f gcd(n,ar/2 1) by Euclids
algorithm. Output f and stop
32Quantum AlgorithmComplexity of Shors algorithm
(cont.)
- Step 2 has complexity O(n3).
- Step 3 has several steps with the highest
complexity O(n3). - Step 4 has complexity O(n3).
-
- Overall complexity is O(n3) but the success
probability is - guaranteed to be at least O(1/logn).
-
- Running Shors algorithm O(logn) times we get
the required - factor of n in time O((n3)logn) with high
probability. -
- See Reference 1
33Quantum AlgorithmGrovers Search Algorithm
- Input A blackbox function f
- Output Any q e f such that f(q) 1 if it
exists - Step 1. Select random r with uniform
distribution. - If f(r) 1 exists then stop
- Step 2. Let m v2n 1 and let integer i e
o,m-1 - Step 3. Using Hadamard Transform and Grovers
- Operator G, i times, prepare the
initial - Superposition (1/ v2n ) S rgt
- Step 4. Observe to get some q e f
34Quantum Algorithm (Cont.)Complexity of Grovers
algorithm
- The task of finding an element q e f by Grovers
method with non-vanishing probability by using
O(v2n) queries. - Grovers quantum searching algorithm is optimal
- By Christof Zalka
- http//arxiv.org/PS_cache/quantph/pdf/9711
- /9711070.pdf
- See Reference 1
35Classical Circuit Complexity (P) Ref. see link
3 Lecture notes.
- X1
- X2
0/1 -
- Xn PRIMES
e P - runs
in O(log n) - C O(poly(n)) C computed in poly(n) on
some Turing Machine.
C
36Classical Circuit Complexity (BPP) Ref. see link
3 Lecture notes.
- random r
- bits
0/1 - X
- if N e PRIMES, C(N) 1 prob. ½ ?
- if N e PRIMES, C(N) 0 prob. ½ ?
C
37Quantum Circuit Complexity (BQP) Ref. see link
3 Lecture notes.
C
38 P BQP see ref. 4 link 3 Lecture
notes.
- If it is found that something is computed in
- Polynomial time, then it can be also computed
- by quantum polynomial time.
- This can be demonstrated by using Fredkin
- gate with three classical input bit. We can
- simulate NOT and AND gates (Universal
- family).
39BPP BQP see ref. 4 link 3 Lecture
notes.
- In BPP, random qubits are used in the circuit.
- So we have to get random qubits out of 0gt of
- the BQP circuits. If we apply Hadamard gate
- we will gate 0gt? (½)(0gt 1gt). But we have
- to measure it for every 0gt. If we attach a
- control-NOT to every output qubit we can
- avoid that and this is called Principle of
- Deferred Measurement.
40Quantum Circuit Lower Bound See ref. 1 and link
2.
- From Grovers algorithm it is already found that
the lower bound for queries from the black-box
function is O(2n) for quantum algorithm. - There are other techniques to find the quantum
lower bound. The adversary technique gives the
lower bound O(2n/2)
41Quantum NP BQNP, BQNP-Complete Ref. see link 2.
- BQNP is the probabilistic analogue of NP.
- If a e L, then there is a string b, b poly
a such that C(a,b) 1. If a e L then with
similar b as above, C(a,b) 0. Here C is the
checker. - Kitaev recently proved QSAT (quantum analogue of
3-SAT) is Complete for BQNP. - To find other examples is open question.
42Complexity Theorist
- A mathematician is a device for converting
- coffee into theorems
- - Paul Erdos
- Is Complexity Theorist a Turing Device ?
43References
- Quantum Computing Mika Hirvensalo
- Quantum Computation and Quantum Information
Michael A. Nielsen and Isaac L.Chuang - Elements of the Theory of Computation Harry
R.Lewis and Christos H. Papadimitriou - Classical and Quantum Computation A. Yu.
Kitaev, A. H. Shen, M.N. VYalyi
44Links
- 1.http//www.cs.jhu.edu/scheideler/courses/600.47
1 S03/lecture_10.pdf - 2.http//www.csee.umbc.edu/lomonaco/ams/lecture
notes/Vazirani.pdf - 3.http//www.cs.berkeley.edu/vazirani/f02quantum.
html - 4.http//www.cs.berkeley.edu/aaronson/glossary.ht
ml