BQP
In computational complexity theory, boundederror quantum polynomial time (BQP) is the class of decision problems solvable by a quantum computer in polynomial time, with an error probability of at most 1/3 for all instances.^{[1]} It is the quantum analogue to the complexity class BPP.
A decision problem is a member of BQP if there exists a quantum algorithm (an algorithm that runs on a quantum computer) that solves the decision problem with high probability and is guaranteed to run in polynomial time. A run of the algorithm will correctly solve the decision problem with a probability of at least 2/3.
BQP algorithm (1 run)  

Answer produced Correct
answer 
Yes  No 
Yes  ≥ 2/3  ≤ 1/3 
No  ≤ 1/3  ≥ 2/3 
BQP algorithm (k runs)  
Answer producedCorrect
answer 
Yes  No 
Yes  > 1 − 2^{−ck}  < 2^{−ck} 
No  < 2^{−ck}  > 1 − 2^{−ck} 
for some constant c > 0 
Definition
BQP can be viewed as the languages associated with certain boundederror uniform families of quantum circuits.^{[1]} A language L is in BQP if and only if there exists a polynomialtime uniform family of quantum circuits [math]\displaystyle{ \{Q_n\colon n \in \mathbb{N}\} }[/math], such that
 For all [math]\displaystyle{ n \in \mathbb{N} }[/math], Q_{n} takes n qubits as input and outputs 1 bit
 For all x in L, [math]\displaystyle{ \mathrm{Pr}(Q_{x}(x)=1)\geq \tfrac{2}{3} }[/math]
 For all x not in L, [math]\displaystyle{ \mathrm{Pr}(Q_{x}(x)=0)\geq \tfrac{2}{3} }[/math]
Alternatively, one can define BQP in terms of quantum Turing machines. A language L is in BQP if and only if there exists a polynomial quantum Turing machine that accepts L with an error probability of at most 1/3 for all instances.^{[2]}
Similarly to other "bounded error" probabilistic classes the choice of 1/3 in the definition is arbitrary. We can run the algorithm a constant number of times and take a majority vote to achieve any desired probability of correctness less than 1, using the Chernoff bound. The complexity class is unchanged by allowing error as high as 1/2 − n^{−c} on the one hand, or requiring error as small as 2^{−nc} on the other hand, where c is any positive constant, and n is the length of input.^{[3]}
A complete problem for PromiseBQP
Similar to the notion of NPcompleteness and other complete problems, we can define a complete problem as a problem that is in PromiseBQP and that every problem in PromiseBQP reduces to it in polynomial time.
Here is an intuitive problem that is complete for efficient quantum computation, which stems directly from the definition of PromiseBQP. Note that for technical reasons, completeness proofs focus on the promise problem version of BQP. We show that the problem below is complete for the PromiseBQP complexity class (and not for the total BQP complexity class having a trivial promise, for which no complete problems are known).
APPROXQCIRCUITPROB problem
Given a description of a quantum circuit [math]\displaystyle{ C }[/math] acting on [math]\displaystyle{ n }[/math] qubits with [math]\displaystyle{ m }[/math] gates, where [math]\displaystyle{ m }[/math] is a polynomial in [math]\displaystyle{ n }[/math] and each gate acts on one or two qubits, and two numbers [math]\displaystyle{ \alpha, \beta \in [0,1], \alpha \gt \beta }[/math], distinguish between the following two cases:
 measuring the first qubit of the state [math]\displaystyle{ C0\rangle^{\otimes n} }[/math] yields [math]\displaystyle{ 1\rangle }[/math] with probability [math]\displaystyle{ \geq \alpha }[/math]
 measuring the first qubit of the state [math]\displaystyle{ C0\rangle^{\otimes n} }[/math] yields [math]\displaystyle{ 1\rangle }[/math] with probability [math]\displaystyle{ \leq \beta }[/math]
Here, there is a promise on the inputs as the problem does not specify the behavior if an instance is not covered by these two cases.
Claim. Any BQP problem reduces to APPROXQCIRCUITPROB.
Proof. Suppose we have an algorithm [math]\displaystyle{ A }[/math] that solves APPROXQCIRCUITPROB, i.e., given a quantum circuit [math]\displaystyle{ C }[/math] acting on [math]\displaystyle{ n }[/math] qubits, and two numbers [math]\displaystyle{ \alpha, \beta \in [0,1], \alpha \gt \beta }[/math], [math]\displaystyle{ A }[/math] distinguishes between the above two cases. We can solve any problem in BQP with this oracle, by setting [math]\displaystyle{ \alpha = 2/3, \beta = 1/3 }[/math].
For any [math]\displaystyle{ L \in \mathrm{BQP} }[/math], there exists family of quantum circuits [math]\displaystyle{ \{Q_n\colon n \in \mathbb{N}\} }[/math] such that for all [math]\displaystyle{ n \in \mathbb{N} }[/math], a state [math]\displaystyle{ x\rangle }[/math] of [math]\displaystyle{ n }[/math] qubits, if [math]\displaystyle{ x \in L, Pr(Q_n(x\rangle)=1) \geq 2/3 }[/math]; else if [math]\displaystyle{ x \notin L, Pr(Q_n(x\rangle)=0) \geq 2/3 }[/math]. Fix an input [math]\displaystyle{ x\rangle }[/math] of [math]\displaystyle{ n }[/math] qubits, and the corresponding quantum circuit [math]\displaystyle{ Q_n }[/math]. We can first construct a circuit [math]\displaystyle{ C_x }[/math] such that [math]\displaystyle{ C_x0\rangle^{\otimes n} = x\rangle }[/math]. This can be done easily by hardwiring [math]\displaystyle{ x\rangle }[/math] and apply a sequence of CNOT gates to flip the qubits. Then we can combine two circuits to get [math]\displaystyle{ C' = Q_nC_x }[/math], and now [math]\displaystyle{ C'0\rangle^{\otimes n} = Q_nx\rangle }[/math]. And finally, necessarily the results of [math]\displaystyle{ Q_n }[/math] is obtained by measuring several qubits and apply some (classical) logic gates to them. We can always defer the measurement^{[4]}^{[5]} and reroute the circuits so that by measuring the first qubit of [math]\displaystyle{ C'0\rangle^{\otimes n} = Q_nx\rangle }[/math], we get the output. This will be our circuit [math]\displaystyle{ C }[/math], and we decide the membership of [math]\displaystyle{ x }[/math] in [math]\displaystyle{ L }[/math] by running [math]\displaystyle{ A(C) }[/math] with [math]\displaystyle{ \alpha = 2/3, \beta = 1/3 }[/math]. By definition of BQP, we will either fall into the first case (acceptance), or the second case (rejection), so [math]\displaystyle{ L \in \mathrm{BQP} }[/math] reduces to APPROXQCIRCUITPROB.
APPROXQCIRCUITPROB comes handy when we try to prove the relationships between some wellknown complexity classes and BQP.
Relationship to other complexity classes
Unsolved problem in computer science: What is the relationship between [math]\displaystyle{ \mathsf{BQP} }[/math] and [math]\displaystyle{ \mathsf{NP} }[/math]? (more unsolved problems in computer science)

BQP is defined for quantum computers; the corresponding complexity class for classical computers (or more formally for probabilistic Turing machines) is BPP. Just like P and BPP, BQP is low for itself, which means BQP^{BQP} = BQP.^{[2]} Informally, this is true because polynomial time algorithms are closed under composition. If a polynomial time algorithm calls polynomial time algorithms as subroutines, the resulting algorithm is still polynomial time.
BQP contains P and BPP and is contained in AWPP,^{[6]} PP^{[7]} and PSPACE.^{[2]} In fact, BQP is low for PP, meaning that a PP machine achieves no benefit from being able to solve BQP problems instantly, an indication of the possible difference in power between these similar classes. The known relationships with classic complexity classes are:
 [math]\displaystyle{ \mathsf{P \subseteq BPP \subseteq BQP\subseteq AWPP \subseteq PP \subseteq PSPACE\subseteq EXP} }[/math]
As the problem of P ≟ PSPACE has not yet been solved, the proof of inequality between BQP and classes mentioned above is supposed to be difficult.^{[2]} The relation between BQP and NP is not known. In May 2018, computer scientists Ran Raz of Princeton University and Avishay Tal of Stanford University published a paper^{[8]} which showed that, relative to an oracle, BQP was not contained in PH. It can be proven that there exists an oracle A such that BQP^{A} [math]\displaystyle{ \nsubseteq }[/math] PH^{A}.^{[9]} In an extremely informal sense, this can be thought of as giving PH and BQP an identical, but additional, capability and verifying that BQP with the oracle (BQP^{A}) can do things PH^{A} cannot. While an oracle separation has been proven, the fact that BQP is not contained in PH has not been proven. An oracle separation does not prove whether or not complexity classes are the same. The oracle separation gives intuition that BQP may not be contained in PH.
It has been suspected for many years that Fourier Sampling is a problem that exists within BQP, but not within the polynomial hierarchy. Recent conjectures have provided evidence that a similar problem, Fourier Checking, also exists in the class BQP without being contained in the polynomial hierarchy. This conjecture is especially notable because it suggests that problems existing in BQP could be classified as harder than NPComplete problems. Paired with the fact that many practical BQP problems are suspected to exist outside of P (it is suspected and not verified because there is no proof that P ≠ NP), this illustrates the potential power of quantum computing in relation to classical computing.^{[9]}
Adding postselection to BQP results in the complexity class PostBQP which is equal to PP.^{[10]}^{[11]}
We will prove or discuss some of these results below.
BQP and EXP
We begin with an easier containment. To show that [math]\displaystyle{ \mathsf{BQP} \subseteq \mathsf{EXP} }[/math], it suffices to show that APPROXQCIRCUITPROB is in EXP since APPROXQCIRCUITPROB is BQPcomplete.
Claim — [math]\displaystyle{ \text{APPROXQCIRCUITPROB} \in \mathsf{EXP} }[/math]
The idea is simple. Since we have exponential power, given a quantum circuit C, we can use classical computer to stimulate each gate in C to get the final state.
More formally, let C be a polynomial sized quantum circuit on n qubits and m gates, where m is polynomial in n. Let [math]\displaystyle{ \psi_0\rangle = 0\rangle^{\otimes n} }[/math] and [math]\displaystyle{ \psi_i\rangle }[/math] be the state after the ith gate in the circuit is applied to [math]\displaystyle{ \psi_{i1}\rangle }[/math]. Each state [math]\displaystyle{ \psi_i \rangle }[/math] can be represented in a classical computer as a unit vector in [math]\displaystyle{ \mathbb C^{2^n} }[/math]. Furthermore, each gate can be represented by a matrix in [math]\displaystyle{ \mathbb C^{2^n \times 2^n} }[/math]. Hence, the final state [math]\displaystyle{ \psi_m \rangle }[/math] can be computed in [math]\displaystyle{ O(m2^{2n}) }[/math] time, and therefore all together, we have an [math]\displaystyle{ 2^{O(n)} }[/math] time algorithm for calculating the final state, and thus the probability that the first qubit is measured to be one. This implies that [math]\displaystyle{ \text{APPROXQCIRCUITPROB} \in \mathsf{EXP} }[/math].
Note that this algorithm also requires [math]\displaystyle{ 2^{O(n)} }[/math] space to store the vectors and the matrices. We will show in the following section that we can improve upon the space complexity.
BQP and PSPACE
To prove [math]\displaystyle{ \mathsf{BQP} \subseteq \mathsf{PSPACE} }[/math], we first introduce a technique called the sum of histories.
Sum of Histories
Source:^{[12]}
Sum of histories is a technique introduced by physicist Richard Feynman for path integral formulation. We apply this technique to quantum computing to solve APPROXQCIRCUITPROB.
Consider a quantum circuit C, which consists of t gates, [math]\displaystyle{ g_1, g_2, \cdots, g_m }[/math], where each [math]\displaystyle{ g_j }[/math] comes from a universal gate set and acts on at most two qubits. To understand what the sum of histories is, we visualize the evolution of a quantum state given a quantum circuit as a tree. The root is the input [math]\displaystyle{ 0\rangle^{\otimes n} }[/math], and each node in the tree has [math]\displaystyle{ 2^n }[/math] children, each representing a state in [math]\displaystyle{ \mathbb C^n }[/math]. The weight on a tree edge from a node in jth level representing a state [math]\displaystyle{ x\rangle }[/math] to a node in [math]\displaystyle{ j+1 }[/math]th level representing a state [math]\displaystyle{ y\rangle }[/math] is [math]\displaystyle{ \langle yg_{j+1}x\rangle }[/math], the amplitude of [math]\displaystyle{ y\rangle }[/math] after applying [math]\displaystyle{ g_{j+1} }[/math] on [math]\displaystyle{ x\rangle }[/math]. The transition amplitude of a roottoleaf path is the product of all the weights on the edges along the path. To get the probability of the final state being [math]\displaystyle{ \psi\rangle }[/math], we sum up the amplitudes of all roottoleave paths that ends at a node representing [math]\displaystyle{ \psi\rangle }[/math].
More formally, for the quantum circuit C, its sum over histories tree is a tree of depth m, with one level for each gate [math]\displaystyle{ g_i }[/math] in addition to the root, and with branching factor [math]\displaystyle{ 2^n }[/math].
Define — A history is a path in the sum of histories tree. We will denote a history by a sequence [math]\displaystyle{ (u_0 =0\rangle^{\otimes n} \rightarrow u_1 \rightarrow \cdots \rightarrow u_{m1}\rightarrow u_m = x) }[/math] for some final state x.
Define — Let [math]\displaystyle{ u, v \in \{0,1\}^n }[/math]. Let amplitude of the edge [math]\displaystyle{ (u\rangle, v\rangle) }[/math] in the jth level of the sum over histories tree be [math]\displaystyle{ \alpha_j (u \rightarrow v) = \langle vg_j u\rangle }[/math]. For any history [math]\displaystyle{ h = (u_0 \rightarrow u_1 \rightarrow \cdots \rightarrow u_{m1}\rightarrow u_m) }[/math], the transition amplitude of the history is the product [math]\displaystyle{ \alpha_h = \alpha_1(0\rangle^{\otimes n} \rightarrow u_1 )\alpha_2 (u_1 \rightarrow u_2 ) \cdots \alpha_m(u_{m1}\rightarrow x) }[/math].
Claim — For a history [math]\displaystyle{ (u_0 \rightarrow \cdots \rightarrow u_m) }[/math] . The transition amplitude of the history is computable in polynomial time.
Each gate [math]\displaystyle{ g_j }[/math] can be decomposed into [math]\displaystyle{ g_j = I \otimes \tilde{g}_j }[/math] for some unitary operator [math]\displaystyle{ \tilde{g}_j }[/math] acting on two qubits, which without loss of generality can be taken to be the first two. Hence, [math]\displaystyle{ \langle vg_j u\rangle = \langle v_1 , v_2 \tilde{g}_j u_1 , u_2 \rangle \langle v_3, \cdots, v_n  u_3, \cdots, u_n\rangle }[/math] which can be computed in polynomial time in n. Since m is polynomial in n, the transition amplitude of the history can be computed in polynomial time.
Claim — Let [math]\displaystyle{ C0\rangle^{\otimes n} = \sum_{x \in \{0,1\}^n} \alpha_x x\rangle }[/math] be the final state of the quantum circuit. For some [math]\displaystyle{ x \in \{0,1\}^n }[/math], the amplitude [math]\displaystyle{ \alpha_x }[/math] can be computed by [math]\displaystyle{ \alpha_x = \sum_{h= (0\rangle^{\otimes n} \rightarrow u_1 \rightarrow \cdots \rightarrow u_{t1} \rightarrow x\rangle)} \alpha_h }[/math].
We have [math]\displaystyle{ \alpha_x = \langle xC0\rangle ^{\otimes n} =\langle x g_tg_{t1}\cdots g_{1} C0\rangle ^{\otimes n} }[/math]. The result comes directly by inserting [math]\displaystyle{ I = \sum_{x \in \{0,1\}^n}  x \rangle \langle x }[/math] between [math]\displaystyle{ g_1, g_2 }[/math], and [math]\displaystyle{ g_2, g_3 }[/math], and so on, and then expand out the equation. Then each term corresponds to a [math]\displaystyle{ \alpha_h }[/math], where [math]\displaystyle{ h= (0\rangle^{\otimes n} \rightarrow u_1 \rightarrow \cdots \rightarrow u_{t1} \rightarrow x\rangle) }[/math]
Claim — [math]\displaystyle{ \text{APPROXQCIRCUITPROB} \in \mathsf{PSPACE} }[/math]
Notice in the sum over histories algorithm to compute some amplitude [math]\displaystyle{ \alpha_x }[/math], only one history is stored at any point in the computation. Hence, the sum over histories algorithm uses [math]\displaystyle{ O(nm) }[/math] space to compute [math]\displaystyle{ \alpha_x }[/math] for any x since [math]\displaystyle{ O(nm) }[/math] bits are needed to store the histories in addition to some workspace variables.
Therefore, in polynomial space, we may compute [math]\displaystyle{ \sum_x \alpha_x^2 }[/math] over all x with the first qubit being 1, which is the probability that the first qubit is measured to be 1 by the end of the circuit.
Notice that compared with the simulation given for the proof that [math]\displaystyle{ \mathsf{BQP} \subseteq \mathsf{EXP} }[/math], our algorithm here takes far less space but far more time instead. In fact it takes [math]\displaystyle{ O(m2^{mn} ) }[/math] time to calculate a single amplitude!
BQP and PP
A similar sumoverhistories argument can be used to show that [math]\displaystyle{ \mathsf{BQP} \subseteq \mathsf{PP} }[/math]. ^{[13]}
P and BQP
We know [math]\displaystyle{ \mathsf{P} \subseteq \mathsf{BQP} }[/math], since every classical circuit can be simulated by a quantum circuit. ^{[14]}
It is conjectured that BQP solves hard problems outside of P, specifically, problems in NP. The claim is indefinite because we don't know if P=NP, so we don't know if those problems are actually in P. Below are some evidence of the conjecture:
 Integer factorization (see Shor's algorithm)^{[15]}
 Discrete logarithm^{[15]}
 Simulation of quantum systems (see universal quantum simulator)
 Approximating the Jones polynomial at certain roots of unity
 HarrowHassidimLloyd (HHL) algorithm
See also
 Hidden subgroup problem
 Polynomial hierarchy (PH)
 Quantum complexity theory
 QMA, the quantum equivalent to NP.
 QIP, the quantum equivalent to IP.
References
 ↑ ^{1.0} ^{1.1} ^{1.2} Michael Nielsen and Isaac Chuang (2000). Quantum Computation and Quantum Information. Cambridge: Cambridge University Press. ISBN 0521635039.
 ↑ ^{2.0} ^{2.1} ^{2.2} ^{2.3} Bernstein, Ethan; Vazirani, Umesh (October 1997). "Quantum Complexity Theory". SIAM Journal on Computing 26 (5): 1411–1473. doi:10.1137/S0097539796300921.
 ↑ Barak, Sanjeev Arora, Boaz (2009). Computational Complexity: A Modern Approach / Sanjeev Arora and Boaz Barak. Cambridge. p. 122. https://www.cs.princeton.edu/theory/complexity/. Retrieved 24 July 2018.
 ↑ Michael A. Nielsen; Isaac L. Chuang (9 December 2010). Quantum Computation and Quantum Information: 10th Anniversary Edition. Cambridge University Press. p. 186. ISBN 9781139495486. https://books.google.com/books?id=s4DEy7oa0C.
 ↑ Odel A. Cross (5 November 2012). Topics in Quantum Computing. O. A. Cross. p. 348. ISBN 9781480027497. https://books.google.com/books?id=b_D9flK2h8QC&pg=PA348.
 ↑ Fortnow, Lance; Rogers, John (1999). "Complexity limitations on Quantum computation". J. Comput. Syst. Sci. 59 (2): 240–252. doi:10.1006/jcss.1999.1651. ISSN 00220000. http://people.cs.uchicago.edu/~fortnow/papers/quantum.pdf.
 ↑ L. Adleman, J. DeMarrais, and M.D. Huang. Quantum computability. SIAM J. Comput., 26(5):1524–1540, 1997.
 ↑ George, Michael Goderbauer, Stefan. "ECCC  TR18107" (in en). https://eccc.weizmann.ac.il/report/2018/107/.
 ↑ ^{9.0} ^{9.1} Aaronson, Scott (2010). "BQP and the Polynomial Hierarchy". Proceedings of ACM STOC 2010. https://www.scottaaronson.com/papers/bqpph.pdf.
 ↑ Aaronson, Scott (2005). "Quantum computing, postselection, and probabilistic polynomialtime". Proceedings of the Royal Society A 461 (2063): 3473–3482. doi:10.1098/rspa.2005.1546. Bibcode: 2005RSPSA.461.3473A.. Preprint available at [1]
 ↑ Aaronson, Scott (20040111). "Complexity Class of the Week: PP". Computational Complexity Weblog. http://weblog.fortnow.com/2004/01/complexityclassofweekppbyguest.html.
 ↑ E. Bernstein and U. Vazirani. Quantum complexity theory, SIAM Journal on Computing, 26(5):14111473, 1997.
 ↑ L. Adleman, J. DeMarrais, and M. Huang. Quantum computability, SIAM Journal on Comput ing 26:15241540, 1997.
 ↑ Nielsen, Michael A.; Chuang, Isaac L. (2000), Quantum Computation and Quantum Information, Cambridge: Cambridge University Press, ISBN 0521632358, MR 1796805.
 ↑ ^{15.0} ^{15.1} arXiv:quantph/9508027v2 PolynomialTime Algorithms for Prime Factorization and Discrete Logarithms on a Quantum Computer, Peter W. Shor
External links
Original source: https://en.wikipedia.org/wiki/BQP.
Read more 