Quantum Computation Lecture 6: NP-Completeness and Computational Complexity, Study notes of Computer Science

A summary of lecture 6 in a quantum computation course, focusing on the relationship between quantum computation and traditional computer science, specifically discussing np-completeness and computational complexity. The concepts of p and np classes, witnesses, reducibility, and np-completeness, providing examples and explanations.

Typology: Study notes

Pre 2010

Uploaded on 08/09/2009

koofers-user-3fu
koofers-user-3fu 🇺🇸

10 documents

1 / 5

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Quantum Computation
Lecture 6: Quantum Computation and Computer Science II
Notes taken by Kevin Barlett
August 2007
Summary: This continues the discussion of how computation using Quantum means relates to the body
of more traditional Computer Science.
1 Computational Complexity (Cont.)
1.1 Quick Review
As discussed in the previous lecture, there are different classes of problems in traditional Computer Science, and the
two we are most focused on are P and NP. P being the class of all problems such that there is a deterministic algorithm
that can solve a problem in polynomial time in relation to the size of the input. NP is the class of problems such that
there is a non-deterministic algorithm that can solve the problem in polynomial time.
Note: While it is true that PNP since from every deterministic polynomial algorithm a non-
deterministic polynomial algorithm can be created, in common usage when referring to NP we are re-
ferring to those problems known to be in NP but are not known to be in P.
Traditional Computer Science has regarded those problems in P to be considered “easy,” however those problems
in NP are considered “hard” because for most reasonably sized input it is intractable to actually find a solution. While
the problems in class NP are much more difficult to solve they are still very important questions to have solutions to.
Some of those problems are:
1. Traveling Salesman Problem (TSP) Given a graph G=(V,E) where each eEhas a weight associated with it
(w(e)0) the goal is find the shortest cycle such that each vertex (city) is visited atleast once.
2. Satisfiability of 3-Clauses (3SAT) Given clauses of the form (x1x2x3)where each xiis going to be either vj
or vj.These clauses are then joined together to create sequences of the form: (x1x2x3)(x4x5x6)....The
goal of this problem is to find an assignment of the variables used (vj’s) to either True or False, such that the
entire sequence is True (or, that each clause is evaluated to True).
3. Hamiltonian Cycle Given a graph G= (V, E)find a cycle (a path that starts and ends at the same node) such
that each vertex is touched once and only once.
1.2 Witnesses
While problems in NP have no known solving deterministic polynomial time algorithm, we can solve simpler problems
with deterministic polynomial time algorithms.Take for instance the 3SAT problem, if I were to give you an assignment
of the variables it is relatively simple (read: deterministic polynomial time) to see if that assignment is a solution to
Lecture Notes for a course given by Stephen F. Bush at RPI.
1
pf3
pf4
pf5

Partial preview of the text

Download Quantum Computation Lecture 6: NP-Completeness and Computational Complexity and more Study notes Computer Science in PDF only on Docsity!

Quantum Computation

Lecture 6: Quantum Computation and Computer Science II

Notes taken by Kevin Barlett

August 2007

Summary: This continues the discussion of how computation using Quantum means relates to the body of more traditional Computer Science.

1 Computational Complexity (Cont.)

1.1 Quick Review

As discussed in the previous lecture, there are different classes of problems in traditional Computer Science, and the two we are most focused on are P and NP. P being the class of all problems such that there is a deterministic algorithm that can solve a problem in polynomial time in relation to the size of the input. NP is the class of problems such that there is a non-deterministic algorithm that can solve the problem in polynomial time.

Note: While it is true that P ⊆ N P since from every deterministic polynomial algorithm a non- deterministic polynomial algorithm can be created, in common usage when referring to NP we are re- ferring to those problems known to be in NP but are not known to be in P.

Traditional Computer Science has regarded those problems in P to be considered “easy,” however those problems in NP are considered “hard” because for most reasonably sized input it is intractable to actually find a solution. While the problems in class NP are much more difficult to solve they are still very important questions to have solutions to. Some of those problems are:

  1. Traveling Salesman Problem (TSP) Given a graph G=(V,E) where each e ∈ E has a weight associated with it (w(e) ≥ 0 ) the goal is find the shortest cycle such that each vertex (city) is visited atleast once.
  2. Satisfiability of 3-Clauses (3SAT) Given clauses of the form (x 1 ∨x 2 ∨x 3 ) where each xi is going to be either vj or vj .These clauses are then joined together to create sequences of the form: (x 1 ∨x 2 ∨x 3 )∧(x 4 ∨x 5 ∨x 6 )∧....The goal of this problem is to find an assignment of the variables used (vj ’s) to either True or False, such that the entire sequence is True (or, that each clause is evaluated to True).
  3. Hamiltonian Cycle Given a graph G = (V, E) find a cycle (a path that starts and ends at the same node) such that each vertex is touched once and only once.

1.2 Witnesses

While problems in NP have no known solving deterministic polynomial time algorithm, we can solve simpler problems with deterministic polynomial time algorithms.Take for instance the 3SAT problem, if I were to give you an assignment of the variables it is relatively simple (read: deterministic polynomial time) to see if that assignment is a solution to

∗ (^) Lecture Notes for a course given by Stephen F. Bush at RPI.

this 3SAT sequence or not. We just check each of the clauses to see if it evaluates to true and if any doesn’t then we know it isn’t a valid solution to 3SAT. We can consider this simpler deterministic polynomial time algorithm to be a “witness” for the 3SAT problem.Similarly a witness for the Hamiltonial Cycle Problem would take the cycle and confirm that it is indeed a cycle and that every vertex is touched exactly once.

Definition 1. For each of the problems in NP there exists atleast one witness that will confirm a solution is a valid solution.

1.3 P = N P?

As discussed earlier is is easy to show that every problem in P is also in NP, however there is a question that remains.Are those problems in NP that aren’t known to be in P that way because there isn’t a deterministic polynomial time algorithm that solves them, or have we just not found a deterministic polynomial time algorithm yet and one does exist? Put another way, we know P ⊆ N P and we don’t known if N P ⊆ P. Is is expected that it will be discovered P 6 = N P but this has not been proven.This intuition is largely based upon the fact that many very intelligent people have spent quite a bit of time attempting to find deterministic polynomial time algorithms for various problems in NP and none of them have had significant success. However lack of a determinisic polynomial time algorithm is not a proof that one does no exist, and so the search continues for either a deterministic polynomial time algorithm or a proof that one does not exist.

1.4 Reducibility

Reducibility allows the complexity of one problem to be tied to another by saying “If we can solve problem A in deterministic polynomial time, then we know we can also solve problem B in deterministic polynomial time.” The proccess works by creating the following procedure:

  1. Take Input for problem B
  2. Convert Input for problem B into an input for problem A This must be done in deterministic polynomial time.
  3. Solve problem A
  4. Convert solution from problem A into a solution for problem B This must be done in deterministic polyno- mial time.
  5. Return solution for problem B

By using this setup we have guaranteed that if B is not in P, this can only happen if there is no deterministic polynomial time algorithm solving A, and similarly if there is not a deterministic polynomial time algorithm solving A there is no deterministic polynomial time algorithm solving B.

1.5 NP-Completeness

Definition 2. A problem A is said to be NP-Complete if the following requirements are met:

  1. A ∈ NP
  2. ∀ n ∈ NP, A <p n (every problem in NP can be reduced to A)

The existance of some problems being NP-Complete was first shown by Cook and Levin when they proved that 3SAT was NP-Complete. Now many other problems are known to be NP-Complete.

  1. Ancilla are used to give wires preprepared values.
  2. Fanout which allows the value of one wire to me split into many wires carrying the same information.

Note: Recall that quantum computation works differently than normal computation, so each of the pieces in traditional circuitry may or may not have an analogue in quantum circuitry.

In traditional computation we can not create a circuit to run a non-deterministic algorithm, however we can create a circuit to run a deterministic algorithm. Similarly the number of elements in the circuit can be considered as the complexity of the circuit, so that if a circuit exists such that it has a number of elements that has a polynomial relation to the size of the input, we can say that there exists a deterministic polynomial time algorithm that solves the given problem. This direct relation, polynomial number of components vs polynomial number of operations, can be quite convenient when considering the complexity of a problem.

3 Maxwell’s Demon, Entropy, and the Reversibility of Circuits

3.1 Maxwell’s Demon and Entropy

James Maxwell created a thought experiment during the 1860’s that went as follows. Assume we have a system consisting of a rectangular box and a uniform gas inside. Assume also a partion exists dividing the box into two halves, and let there be a door in this partion that can be opened and closed by some “demon.” Now as the gas exists in the system some of the particles will be more exicited than others and will have more energy. Let us say that the demon attempts to (and succeeds) in opening and closing the door allowing all of the highly energetic molecules to move to one side of the parition and stay there, and keeping all of the non-energetic particles on the other side. This would seem to be a system where the second law of thermodynamics (which states that the entropy of any system not in equillibrium will increase over time) is violated. This demon perplexed some physicists as they attemptted to find a flaw in this senario. One of the general objec- tions was that given that the system is closed and since the system is at thermal equilibrium the only “light” will be the result of thermal noise and the noise is random to the point where it wouldn’t be enough to allow the demon to know when to open the door and which particles to let through. A different objection was raised by Leo Szilard, who argued that the demon would expend energy in obtaining the information necessary to decide if the door should be opened at a particular time or not. And since the demon is impacting the system, the demon itself is inside the system and so in the end any entropy lossed by the gas in the box will be equivalent to (or less than) the entropy gained by the demon.

3.2 Reversibility of Circuits

In general, the second law of thermodynamics states that the entropy of a closed system can never decrease. So, if we consider a quantum circuit, if we ever decrease the possible number of logical states of a computation then we would be decreasing the entropy of the system, this can not be and so the entropy that is lost must be given off in some other form, such as heat. A good measure of if the number of logical states are decreasing is if the circuit can be reversed and given the output be able to obtain the exact input that was given. Consider an OR-gate, if the output of an OR-Gate was 1, there is no way to determine if the two inputs were (0, 1) or (1, 0) or (1, 1) and so an OR-gate is not reversible, and so would be accompanied by the release of energy in some form or another.

3.3 C-Not and Toffoli gates

A Controlled-Not gate (or C-Not for short) works as follows, it takes two inputs, say (a, b) and returns (a, b′) where

b′^ =

b if a = 1 b if a = 0

In this way we get the following relation:

Input Output of C-Not (0, 0) (0, 0) (0, 1) (0, 1) (1, 0) (1, 1) (1, 1) (1, 0) A Toffoli gate is similar to a C-Not gate, except that it takes 3 inputs, two control bits and one target bit. In this case the target bit is flipped only when both control bits are 1. It is relatively easy to see that in both the case of C-Not and Toffoli gates they are their own inverse, in the sense that given (a, b) and applying a C-Not gate twice results in (a,b) every time and similarly for Toffoli gates. In this way both C-Not and Toffoli gates are reversible, which is what we want. In traditional computer circuits, every desired circuit can be made with the basic building blocks of wires, ansilla, fanouts, and NAND gates. NAND gates however are irreversible (try it for yourself if you disagree) and so we would prefer to avoid using them in our quantum circuits. However, instead of using NAND gates we can use C-Not and Toffoli gates and have the same effect, being able to build any circuit with these building blocks.

3.4 Reversibility of Circuits Revisited

The way we can provide reversibility when we did not before was to have a function output more than just the desired value. Take for instance the OR gate considered earlier, if we were to modify it so that it output both the inputs as well as the output, then we could create a reversible OR gate. But notice, to accomplish this there are extra outputs that need to be remembered that aren’t used except for the reversibility, this is generally known as garbage and refered to as g(x). Take for example the diagram in Figure 2. In this case we can obtain the output of a function F on some input x while still reversing the function F by using a C-Not gate. Notice how there will perhaps be some garbage out and also notice that the values of the ansila at the end will be what they started with, as well as the value of x will remain unchanged.

Figure 2: How to obtain the output of a reversible Circuit

4 Measurement

Originally the concept of measurement in a Quantum system would be described by a Hermitian operator acting on some system state space. So then this begs the question, can every observable be measured? Or put another way, can every Hermitian operator acting on a state space be measured. If so then we have some hope at using a quantum computer to measuring an observable corresponding to the halting problem of a Turing Machine. Which would be very useful.