Quantum Computing
Lecture 8
Quantum Automata and Complexity
Maris Ozols
Computational models and complexity
Shor’s algorithm solves, in polynomial time, a problem for which no
classical polynomial time algorithm is known.
What class of problems are solvable by quantum machines in polynomial
time?
How does the model of quantum computing compare to other models,
such as ones with randomness or non-determinism?
How does the quantum model of computation affect our understanding
of computational complexity?
This lecture:
1. finite-state automata
2. computational complexity
Finite-state automata
A finite-state automaton (FSA) consists of
• a finite set of states Q
• a finite input alphabet Σ
• an initial state and some accepting states A ⊆ Q
• transitions between states
Example:
a a • states: Q = {q0 , q1 }
b • alphabet: Σ = {a, b}
q0 q1 • initial state: q0 ,
accepting states: A = {q1 }
a b
b • transitions: q0 → q0 , q0 → q1 , . . .
It accepts the set of all strings over {a, b} that contain at least one b.
Its operation can be described by a pair of transition matrices:
1 0 |q0 i 0 0 |q0 i
Ma = Mb =
0 1 |q1 i 1 1 |q1 i
That is, Ma |qi i = |qi i and Mb |qi i = |q1 i for all i ∈ {0, 1}. After reading
the string abb, the transitions between states are described by Mb Mb Ma .
Different flavours of FSA
An n-state automaton with alphabet Σ is described by a collection of
n × n matrices {Ma : a ∈ Σ}, i.e., one matrix for each symbol a ∈ Σ.
Depending on allowed M , we get different flavours of automata:
• Deterministic: M is a 0/1 matrix and each column of M has
exactly one entry 1
• Reversible: M is a 0/1 matrix and each row and column of M has
exactly one entry 1, i.e., M is a permutation matrix
• Non-deterministic: M is an arbitrary 0/1 matrix
• Probabilistic: all entries of M are in [0, 1] and each column sums
up to 1, i.e., M is a stochastic matrix
• Quantum: M is unitary
Example: Here are different types of transitions matrices:
1 1 0 1 1 0 1/2 0 1 0
0 0 1 0 1 0 1/2 1 0 i
deterministic reversible non-deterministic probabilistic quantum
Intermediate states
Depending on the type of automata, we get different types of
intermediate states:
• Deterministic: it is a standard basis vector |qi for some q ∈ Q
• Reversible: same as above; moreover, given the last input symbol
we can also recover the previous state by applying M T
P
q∈Q cq |qi where cq ∈ {0, 1, 2, . . .}
• Non-deterministic:
P P
q∈Q cq |qi where cq ∈ [0, 1] and
• Probabilistic: q∈Q cq = 1;
equivalently, it is a probability distribution over Q
P P 2
• Quantum: q∈Q qc |qi where c q ∈ C and q∈Q |cq | = 1;
equivalently, it is a quantum state that is a superposition over Q
Note: For non-deterministic automata, cq ∈ N counts the number of
different paths from the initial state to q using transitions given by the
input string. Normally one cares only about the existence of a path, so
P all cq ≥ 1 by 1 so that cq ∈ {0, 1} and the state is always
we can replace
of the form q∈S |qi for some subset S ⊆ Q.
Acceptance
Let A ⊆ Q denote the set of allPaccepting states. Then we accept the
input word if the current state q∈Q cq |qi satisfies:
• Deterministic: the state is |qi for some q ∈ A
• Reversible: same as above
P
• Non-deterministic: q∈A cq ≥ 1, i.e., at least one accepting state
P
q∈A cq ≥ 2/3
• Probabilistic:
P 2
q∈A |cq | ≥ 2/3
• Quantum:
Note: The threshold 2/3 is arbitrary (any fixed constant > 1/2).
The language accepted or recognized by a finite automaton consists of all
finite strings over Σ that are accepted: L ⊆ Σ∗ .
Some remarks
Deterministic, non-deterministic, and probabilistic automata accept
exactly the class of regular languages.
Automaton’s complexity is |Q|, its number of states. Different models
may require different number of states to solve the same problem.
Reversible and quantum automata are weaker because of reversibility.
Possible fix: we can allow intermediate measurements in the quantum
case. Then we can simulate randomness by measuring |+i. This makes
quantum automata at least as powerful as probabilistic ones.
Turing machines are much more interesting than finite automata. . .
Turing machine
Turing machine (TM) consists of a finite automaton attached to an
infinite read-write tape. The tape is initially blank and contains only a
finite-length input.
TM is determined by an alphabet Σ, a finite set of states Q, and a
transition function δ which, for each symbol and state, gives:
• next state,
• new replacement symbol to write on the tape,
• direction in which to move the tape head.
TM has infinitely many possible configurations (reserving the word
“state” for elements of Q). Each configuration c is determined by a
state, the contents of the tape (a finite string), and the head’s position.
Acceptance
Let c0 denote the starting configuration of a TM: the automaton is in its
initial state, the tape contains the input w ∈ Σ∗ , and the tape head is at
the left end of the string.
The input w is accepted if the computation c0 → c1 → · · · → ct
eventually reaches an accepting state, where t denotes the amount of
time the computation takes.
The action of the TM can equivalently be described as a linear operator
on an infinite-dimensional space, where the set of configurations form a
basis for the space.
This operation should be reversible/unitary for reversible/quantum
Turing machines. Such description is very hard to work with, so that’s
why we instead use quantum circuits (recall Lecture 4).
Computational resources and models
Models of computation: Resources:
• deterministic • time
• non-deterministic • space
• probabilistic
• quantum
Randomness supplied upfront: Randomized computation can
implemented by a deterministic Turing machine that has a supply of
random bits written on the tape.
Computation vs verification: Non-deterministic computation can be
thought of as verification. If we make all the non-deterministic choices
upfront, this corresponds to guessing the answer and then verifying that
it is indeed correct.
Randomness from quantumness: Quantum computer can obtain
random bits by measuring |+i.
Basic complexity classes
Promise problem: A = (Ayes , Ano ) where Ayes , Ano ⊆ Σ∗ such that
Ayes ∩ Ano = ∅. We promise not to give inputs Σ∗ − (Ayes ∪ Ano ).
Example (cat videos): Ayes ∪ Ano is the set of all possible videos where
Ayes contains cats but Ano does not. Σ∗ − (Ayes ∪ Ano ) are not videos.
Complexity classes: Given A = (Ayes , Ano ), let M be a deterministic
poly-time Turing machine that receives x ∈ Ayes ∪ Ano . Then
• A ∈ P = (deterministic) Polynomial-time: if M accepts all
x ∈ Ayes and rejects all x ∈ Ano
• A ∈ PP = Probabilistic Polynomial-time: if M can access random
bits and accepts/rejects with probability > 1/2
• A ∈ BPP = Bounded-error Probabilistic Polynomial-time: if M
can access random bits and accepts/rejects with probability ≥ 2/3
• A ∈ BQP = Bounded-error Quantum Polynomial-time: if M
produces a poly-time quantum circuit that accepts/rejects with
probability ≥ 2/3
Verification complexity
King Arthur asks an all-powerful Wizard Merlin to convince him that x is
a correct solution. But he is afraid to get fooled by Merlin!
Arthur has x, Merlin provides a proof y
Given A = (Ayes , Ano ), let M be a deterministic poly-time Turing
machine (Arthur) that receives x ∈ Ayes ∪ Ano . Moreover:
• for every x ∈ Ayes there is a proof y such that M accepts (x, y)
• for every x ∈ Ano there is no proof y such that M accepts (x, y)
Verification complexity classes
Complexity classes:
• A ∈ NP = Non-deterministic Polynomial-time:
Arthur is a deterministic poly-time P algorithm
• A ∈ MA = Merlin–Arthur:
Arthur is probabilistic, BPP; accepts/rejects with probability ≥ 2/3
• A ∈ QMA = Quantum Merlin–Arthur:
Arthur is quantum, BQP; Merlin supplies him with a quantum state
as a proof and Arthur accepts/rejects with probability ≥ 2/3
Summary of complexity classes
Finding Verifying
solution solution
Deterministic P NP
Probabilistic BPP MA
Quantum BQP QMA
Some more classes:
• PP = like BPP but unbounded error
• EXP = like P but exponential-time
• PSPACE = like P but polynomial-space (and any time)
• NP-complete = “the hardest” problems in NP
See https://complexityzoo.uwaterloo.ca/ for even more!
Inclusions
EXP Trivial inclusions:
• randomness at least as good as
determinism: P ⊆ BPP, NP ⊆ MA
PSPACE
• quantumness at least as good as
randomness: BPP ⊆ BQP,
MA ⊆ QMA
PP
• verifying a solution cannot be harder
than finding one: P ⊆ NP,
QMA BPP ⊆ MA, BQP ⊆ QMA
• poly space can store at most exp
number of different strings:
BQP MA PSPACE ⊆ EXP
Non-trivial inclusions:
• GapP functions: BQP ⊆ PP
BPP NP
• guess a random proof: QMA ⊆ PP
• try all strings and count solutions:
P PP ⊆ PSPACE
Separations?
EXP
Non-trivial separations:
• Time hierarchy theorem: P ( EXP
PSPACE
Major open problems:
• P vs NP – is finding a solution
PP really harder than verifying one?
(you can get $106 for solving this)
• P vs BPP – does randomness help?
QMA
• BPP vs BQP – are quantum
computers more powerful that
BQP (probabilistic) classical ones?
MA
E.g., is factoring hard classically
(cannot be done in poly time)?
BPP NP • P vs PSPACE – we have no clue
even on how to show that these to
classes are different. . .
P
Problems of interest
QMA
NP-complete
NP
NP-intermediate graph isomorphism
BQP
factoring
BPP
P
primality testing
Most problems in NP are either complete or in P. The outliers are called
NP-inermediate = NP − (NP-complete ∪ P)
Ladner’s Theorem: P = NP if and only if NP-inermediate is empty.
Technology cannot make
the world a better place,
people can.
Thank you!