From HandWiki

In computational complexity theory, PostBQP is a complexity class consisting of all of the computational problems solvable in polynomial time on a quantum Turing machine with postselection and bounded error (in the sense that the algorithm is correct at least 2/3 of the time on all inputs). Postselection is not considered to be a feature that a realistic computer (even a quantum one) would possess, but nevertheless postselecting machines are interesting from a theoretical perspective.

Removing either one of the two main features (quantumness, postselection) from PostBQP gives the following two complexity classes, both of which are subsets of PostBQP:

  • BQP is the same as PostBQP except without postselection
  • BPPpath is the same as PostBQP except that instead of quantum, the algorithm is a classical randomized algorithm (with postselection)[1]

The addition of postselection seems to make quantum Turing machines much more powerful: Scott Aaronson proved[2][3] PostBQP is equal to PP, a class which is believed to be relatively powerful, whereas BQP is not known even to contain the seemingly smaller class NP. Using similar techniques, Aaronson also proved that small changes to the laws of quantum computing would have significant effects. As specific examples, under either of the two following changes, the "new" version of BQP would equal PP:

  • if we broadened the definition of 'quantum gate' to include not just unitary operations but linear operations, or
  • if the probability of measuring a basis state [math]\displaystyle{ |x\rangle }[/math] was proportional to [math]\displaystyle{ |\alpha_x|^p }[/math] instead of [math]\displaystyle{ |\alpha_x|^2 }[/math] for any even integer p > 2.

Basic properties

In order to describe some of the properties of PostBQP we fix a formal way of describing quantum postselection. Define a quantum algorithm to be a family of quantum circuits (specifically, a uniform circuit family). We designate one qubit as the postselection qubit P and another as the output qubit Q. Then PostBQP is defined by postselecting upon the event that the postselection qubit is [math]\displaystyle{ |1\rangle }[/math]. Explicitly, a language L is in PostBQP if there is a quantum algorithm A so that after running A on input x and measuring the two qubits P and Q,

  • P = 1 with nonzero probability
  • if the input x is in L then Pr[Q = 1|P = 1] ≥ 2/3
  • if the input x is not in L then Pr[Q = 0|P = 1] ≥ 2/3.

One can show that allowing a single postselection step at the end of the algorithm (as described above) or allowing intermediate postselection steps during the algorithm are equivalent.[2][4]

Here are three basic properties of PostBQP (which also hold for BQP via similar proofs):

  1. PostBQP is closed under complement. Given a language L in PostBQP and a corresponding deciding circuit family, create a new circuit family by flipping the output qubit after measurement, then the new circuit family proves the complement of L is in PostBQP.
  2. You can do probability amplification in PostBQP. The definition of PostBQP is not changed if we replace the 2/3 value in its definition by any other constant strictly between 1/2 and 1. As an example, given a PostBQP algorithm A with success probability 2/3, we can construct another algorithm which runs three independent copies of A, outputs a postselection bit equal to the conjunction of the three "inner" ones, and outputs an output bit equal to the majority of the three "inner" ones; the new algorithm will be correct with conditional probability [math]\displaystyle{ (2/3)^3 + 3(1/3)(2/3)^2 = 20/27 }[/math], greater than the original 2/3.
  3. PostBQP is closed under intersection. Suppose we have PostBQP circuit families for two languages [math]\displaystyle{ L_1 }[/math] and [math]\displaystyle{ L_2 }[/math], with respective postselection qubits and output qubits [math]\displaystyle{ P_1, P_2, Q_1, Q_2 }[/math]. We may assume by probability amplification that both circuit families have success probability at least 5/6. Then we create a composite algorithm where the circuits for [math]\displaystyle{ L_1 }[/math] and [math]\displaystyle{ L_2 }[/math] are run independently, and we set P to the conjunction of [math]\displaystyle{ P_1 }[/math] and [math]\displaystyle{ P_2 }[/math], and Q to the conjunction of [math]\displaystyle{ Q_1 }[/math] and [math]\displaystyle{ Q_2 }[/math]. It is not hard to see by a union bound that this composite algorithm correctly decides membership in [math]\displaystyle{ L_1 \cap L_2 }[/math] with (conditional) probability at least 2/3.

More generally, combinations of these ideas show that PostBQP is closed under union and BQP truth-table reductions.

PostBQP = PP

Scott Aaronson showed[5] that the complexity classes [math]\displaystyle{ \mathsf{PostBQP} }[/math] (postselected bounded error quantum polynomial time) and PP (probabilistic polynomial time) are equal. The result was significant because this quantum computation reformulation of [math]\displaystyle{ \mathsf{PP} }[/math] gave new insight and simpler proofs of properties of [math]\displaystyle{ \mathsf{PP} }[/math].

The usual definition of a [math]\displaystyle{ \mathsf{PostBQP} }[/math] circuit family is one with two outbit qubits P (postselection) and Q (output) with a single measurement of P and Q at the end such that the probability of measuring P = 1 has nonzero probability, the conditional probability Pr[Q = 1|P = 1] ≥ 2/3 if the input x is in the language, and Pr[Q = 0|P = 1] ≥ 2/3 if the input x is not in the language. For technical reasons we tweak the definition of [math]\displaystyle{ \mathsf{PostBQP} }[/math] as follows: we require that Pr[P = 1] ≥ 2nc for some constant c depending on the circuit family. Note this choice does not affect the basic properties of [math]\displaystyle{ \mathsf{PostBQP} }[/math], and also it can be shown that any computation consisting of typical gates (e.g. Hadamard, Toffoli) has this property whenever Pr[P = 1] > 0.

Proving PostBQPPP

Suppose we are given a [math]\displaystyle{ \mathsf{PostBQP} }[/math] family of circuits to decide a language L. We assume without loss of generality (e.g. see the inessential properties of quantum computers) that all gates have transition matrices that are represented with real numbers, at the expense of adding one more qubit.

Let Ψ denote the final quantum state of the circuit before the postselecting measurement is made. The overall goal of the proof is to construct a [math]\displaystyle{ \mathsf{PP} }[/math] algorithm to decide L. More specifically it suffices to have L correctly compare the squared amplitude of Ψ in the states with Q = 1, P = 1 to the squared amplitude of Ψ in the states with Q = 0, P = 1 to determine which is bigger. The key insight is that the comparison of these amplitudes can be transformed into comparing the acceptance probability of a [math]\displaystyle{ \mathsf{PP} }[/math] machine with 1/2.

Matrix view of PostBQP algorithms

Let n denote the input size, B = B(n) denote the total number of qubits in the circuit (inputs, ancillary, output and postselection qubits), and G = G(n) denote the total number of gates. Represent the ith gate by its transition matrix Ai (a real unitary [math]\displaystyle{ 2^B \times 2^B }[/math] matrix) and let the initial state be [math]\displaystyle{ |x\rangle }[/math] (padded with zeroes). Then [math]\displaystyle{ \Psi = A^G A^{G-1}\dotsb A^2 A^1 |x\rangle }[/math]. Define S1 (resp. S0) to be the set of basis states corresponding to P = 1, Q = 1 (resp. P = 1, Q = 0) and define the probabilities

[math]\displaystyle{ \pi_1 := \text{Pr}[P=1,Q=1]=\sum_{\omega \in S_1} \Psi^2_\omega }[/math]
[math]\displaystyle{ \pi_0 := \text{Pr}[P=1,Q=0]=\sum_{\omega \in S_0} \Psi^2_\omega. }[/math]

The definition of [math]\displaystyle{ \mathsf{PostBQP} }[/math] ensures that either [math]\displaystyle{ \pi_{1} \ge 2\pi_0 }[/math] or [math]\displaystyle{ \pi_0 \ge 2\pi_1 }[/math] according to whether x is in L or not.

Our [math]\displaystyle{ \mathsf{PP} }[/math] machine will compare [math]\displaystyle{ \pi_{1} }[/math] and [math]\displaystyle{ \pi_{0} }[/math]. In order to do this, we expand the definition of matrix multiplication:

[math]\displaystyle{ \Psi_\omega = \sum_{\alpha_1, \ldots, \alpha_{G}}A^{G}_{\omega,\alpha_{G}}A^{G-1}_{\alpha_G,\alpha_{G-1}}\dotsb A^2_{\alpha_3,\alpha_2} A^1_{\alpha_2,\alpha_1} x_{\alpha_1} }[/math]

where the sum is taken over all lists of G basis vectors [math]\displaystyle{ \alpha_i }[/math]. Now [math]\displaystyle{ \pi_1 }[/math] and [math]\displaystyle{ \pi_0 }[/math] can be expressed as a sum of pairwise products of these terms. Intuitively, we want to design a machine whose acceptance probability is something like [math]\displaystyle{ \tfrac{1}{2}(1+\pi_1-\pi_0) }[/math], since then [math]\displaystyle{ x \in L }[/math] would imply that the acceptance probability is [math]\displaystyle{ \tfrac{1}{2}(1+\pi_{1}-\pi_{0})\gt \tfrac 1 2 }[/math], while [math]\displaystyle{ x \not\in L }[/math] would imply that the acceptance probability is [math]\displaystyle{ \tfrac{1}{2}(1+\pi_1-\pi_0)\lt \tfrac 1 2 }[/math].

Technicality: we may assume entries of the transition matrices Ai are rationals with denominator 2f(n) for some polynomial f(n).

The definition of [math]\displaystyle{ \mathsf{PostBQP} }[/math] tells us that [math]\displaystyle{ \pi_{1} \ge \tfrac{2}{3}(\pi_0+\pi_1) }[/math] if x is in L, and that otherwise [math]\displaystyle{ \pi_{0} \ge \tfrac{2}{3}(\pi_0+\pi_1) }[/math]. Let us replace all entries of A by the nearest fraction with denominator [math]\displaystyle{ 2^{f(n)} }[/math] for a large polynomial [math]\displaystyle{ f(n) }[/math] that we presently describe. What will be used later is that the new π values satisfy [math]\displaystyle{ \pi_1 \gt \tfrac{1}{2}(\pi_0+\pi_1) }[/math] if x is in L, and [math]\displaystyle{ \pi_0 \gt \tfrac{1}{2}(\pi_0+\pi_1) }[/math] if x is not in L. Using the earlier technical assumption and by analyzing how the 1-norm of the computational state changes, this is seen to be satisfied if [math]\displaystyle{ (1+2^{-f(n)}2^{B})^{G}-1 \lt \tfrac{1}{6}2^{-n^c}, }[/math] thus clearly there is a large enough f that is polynomial in n.

Constructing the PP machine

Now we provide the detailed implementation of our [math]\displaystyle{ \mathsf{PP} }[/math] machine. Let α denote the sequence [math]\displaystyle{ \{\alpha_i\}_{i=1}^G }[/math] and define the shorthand notation

[math]\displaystyle{ \Pi(A, \omega, \alpha, x) := A^{G}_{\omega,\alpha_{G}}A^{G-1}_{\alpha_{G},\alpha_{G-1}}\dotsb A^2_{\alpha_3,\alpha_2} A^1_{\alpha_2,\alpha_1} x_{\alpha_1} }[/math],


[math]\displaystyle{ \pi_1 - \pi_0 = \sum_{\omega \in S_1} \sum_{\alpha,\alpha'} \Pi(A, \omega, \alpha, x)\Pi(A, \omega, \alpha', x) - \sum_{\omega \in S_0} \sum_{\alpha,\alpha'} \Pi(A, \omega, \alpha, x)\Pi(A, \omega, \alpha', x). }[/math]

We define our [math]\displaystyle{ \mathsf{PP} }[/math] machine to

  • pick a basis state ω uniformly at random
  • if [math]\displaystyle{ \omega \not\in S_0 \cup S_1 }[/math] then STOP and accept with probability 1/2, reject with probability 1/2
  • pick two sequences [math]\displaystyle{ \alpha,\alpha' }[/math] of G basis states uniformly at random
  • compute [math]\displaystyle{ X = \Pi(A, \omega, \alpha, x)\Pi(A, \omega, \alpha', x) }[/math] (which is a fraction with denominator [math]\displaystyle{ 2^{2f(n)G(n)} }[/math] such that [math]\displaystyle{ -1 \le X \le 1 }[/math])
  • if [math]\displaystyle{ \omega \in S_1 }[/math] then accept with probability [math]\displaystyle{ \tfrac{1+X}{2} }[/math] and reject with probability [math]\displaystyle{ \tfrac{1-X}{2} }[/math] (which takes at most [math]\displaystyle{ 2f(n)G(n)+1 }[/math] coin flips)
  • otherwise (then [math]\displaystyle{ \omega \in S_0 }[/math]) accept with probability [math]\displaystyle{ \tfrac{1-X}{2} }[/math] and reject with probability [math]\displaystyle{ \tfrac{1+X}{2} }[/math] (which again takes at most [math]\displaystyle{ 2f(n)G(n)+1 }[/math] coin flips)

Then it is straightforward to compute that this machine accepts with probability [math]\displaystyle{ \frac{1}{2}+\frac{\pi_{1}-\pi_{0}}{2^{1+B(n)+2B(n)G(n)}}, }[/math] so this is a [math]\displaystyle{ \mathsf{PP} }[/math] machine for the language L, as needed.

Proving PPPostBQP

Suppose we have a [math]\displaystyle{ \mathsf{PP} }[/math] machine with time complexity [math]\displaystyle{ T:=T(n) }[/math] on input x of length [math]\displaystyle{ n := |x| }[/math]. Thus the machine flips a coin at most T times during the computation. We can thus view the machine as a deterministic function f (implemented, e.g. by a classical circuit) which takes two inputs (x, r) where r, a binary string of length T, represents the results of the random coin flips that are performed by the computation, and the output of f is 1 (accept) or 0 (reject). The definition of [math]\displaystyle{ \mathsf{PP} }[/math] tells us that

[math]\displaystyle{ x \in L \Leftrightarrow \#\{r \in \{0,1\}^T\mid f(x, r)=1\} \gt 2^{T-1} }[/math]

Thus, we want a [math]\displaystyle{ \mathsf{PostBQP} }[/math] algorithm that can determine whether the above statement is true.

Define s to be the number of random strings which lead to acceptance,

[math]\displaystyle{ s := \#\{r \in \{0,1\}^T\mid f(x, r)=1\} }[/math]

and so [math]\displaystyle{ 2^T-s }[/math] is the number of rejected strings. It is straightforward to argue that without loss of generality, [math]\displaystyle{ s \not\in \{0, 2^T/2, 2^T\} }[/math]; for details, see a similar without loss of generality assumption in the proof that [math]\displaystyle{ \mathsf{PP} }[/math] is closed under complementation.

Aaronson's algorithm

Aaronson's algorithm for solving this problem is as follows. For simplicity, we will write all quantum states as unnormalized. First, we prepare the state [math]\displaystyle{ |x \rangle \otimes \sum_{r \in \{0,1\}^T} |r \rangle |f(x,r) \rangle }[/math]. Second, we apply Hadamard gates to the second register (each of the first T qubits), measure the second register and postselect on it being the all-zero string. It is easy to verify that this leaves the last register (the last qubit) in the residual state

[math]\displaystyle{ |\psi \rangle := (2^T-s)|0 \rangle + s|1 \rangle. }[/math]

Where H denotes the Hadamard gate, we compute the state

[math]\displaystyle{ H |\psi\rangle = (2^T |0\rangle + (2^T - 2s)|1 \rangle)/\sqrt{2} }[/math].

Where [math]\displaystyle{ \alpha, \beta }[/math] are positive real numbers to be chosen later with [math]\displaystyle{ \alpha^2+\beta^2=1 }[/math], we compute the state [math]\displaystyle{ \alpha |0\rangle|\psi\rangle+\beta |1\rangle|H\psi\rangle }[/math] and measure the second qubit, postselecting on its value being equal to 1, which leaves the first qubit in a residual state depending on [math]\displaystyle{ \beta/\alpha }[/math] which we denote

[math]\displaystyle{ | \phi_{\beta/\alpha} \rangle := \alpha s |0\rangle + \frac{\beta}{\sqrt{2}}(2^T-2s)|1\rangle }[/math].

Visualizing the possible states of a qubit as a circle, we see that if [math]\displaystyle{ s \gt 2^{T-1} }[/math], (i.e. if [math]\displaystyle{ x \in L }[/math]) then [math]\displaystyle{ \phi_{\beta/\alpha} }[/math] lies in the open quadrant [math]\displaystyle{ Q_{acc} := (-|1\rangle, |0\rangle) }[/math] while if [math]\displaystyle{ s \lt 2^{T-1} }[/math], (i.e. if [math]\displaystyle{ x \not\in L }[/math]) then [math]\displaystyle{ \phi_{\beta/\alpha} }[/math] lies in the open quadrant [math]\displaystyle{ Q_{rej} := (|0\rangle,|1\rangle) }[/math]. In fact for any fixed x (and its corresponding s), as we vary the ratio [math]\displaystyle{ \beta/\alpha }[/math] in [math]\displaystyle{ (0, \infty) }[/math], note that the image of [math]\displaystyle{ |\phi_{\beta/\alpha}\rangle }[/math] is precisely the corresponding open quadrant. In the rest of the proof, we make precise the idea that we can distinguish between these two quadrants.


Let [math]\displaystyle{ |+\rangle = (|1\rangle+|0\rangle)/\sqrt{2} }[/math], which is the center of [math]\displaystyle{ Q_{rej} }[/math], and let [math]\displaystyle{ |-\rangle }[/math] be orthogonal to [math]\displaystyle{ |+\rangle }[/math]. Any qubit in [math]\displaystyle{ Q_{acc} }[/math], when measured in the basis [math]\displaystyle{ \{|+\rangle, |-\rangle\} }[/math], gives the value [math]\displaystyle{ |+\rangle }[/math] less than 1/2 of the time. On the other hand, if [math]\displaystyle{ x \not\in L }[/math] and we had picked [math]\displaystyle{ \beta/\alpha = r^* := \sqrt{2}s / (2^T-2s) }[/math] then measuring [math]\displaystyle{ | \phi_{\beta/\alpha} \rangle }[/math] in the basis [math]\displaystyle{ \{|+\rangle, |-\rangle\} }[/math] would give the value [math]\displaystyle{ |+\rangle }[/math] all of the time. Since we don't know s we also don't know the precise value of r*, but we can try several (polynomially many) different values for [math]\displaystyle{ \beta/\alpha }[/math] in hopes of getting one that is "near" r*.

Specifically, note [math]\displaystyle{ 2^{-T} \lt r* \lt 2^T }[/math] and let us successively set [math]\displaystyle{ \beta/\alpha }[/math] to every value of the form [math]\displaystyle{ 2^i }[/math] for [math]\displaystyle{ -T \leq i \leq T }[/math]. Then elementary calculations show that for one of these values of i, the probability that the measurement of [math]\displaystyle{ | \phi_{2^i} \rangle }[/math] in the basis [math]\displaystyle{ \{|+\rangle, |-\rangle\} }[/math] yields [math]\displaystyle{ |+\rangle }[/math] is at least [math]\displaystyle{ (3+2\sqrt{2})/6 \approx 0.971. }[/math]

Overall, the [math]\displaystyle{ \mathsf{PostBQP} }[/math] algorithm is as follows. Let k be any constant strictly between 1/2 and [math]\displaystyle{ (3+2\sqrt{2})/6 }[/math]. We do the following experiment for each [math]\displaystyle{ -T \leq i \leq T }[/math]: construct and measure [math]\displaystyle{ | \phi_{2^i} \rangle }[/math] in the basis [math]\displaystyle{ \{|+\rangle, |-\rangle\} }[/math] a total of [math]\displaystyle{ C \log T }[/math] times where C is a constant. If the proportion of [math]\displaystyle{ |+\rangle }[/math] measurements is greater than k, then reject. If we don't reject for any i, accept. Chernoff bounds then show that for a sufficiently large universal constant C, we correctly classify x with probability at least 2/3.

Note that this algorithm satisfies the technical assumption that the overall postselection probability is not too small: each individual measurement of [math]\displaystyle{ | \phi_{2^i} \rangle }[/math] has postselection probability [math]\displaystyle{ 1/2^{O(T)} }[/math] and so the overall probability is [math]\displaystyle{ 1/2^{O(T^2 \log T)} }[/math].



  1. Y. Han and Hemaspaandra, L. and Thierauf, T. (1997). "Threshold computation and cryptographic security". SIAM Journal on Computing 26: 59–78. doi:10.1137/S0097539792240467. 
  2. 2.0 2.1 Aaronson, Scott (2005). "Quantum computing, postselection, and probabilistic polynomial-time". Proceedings of the Royal Society A 461 (2063): 3473–3482. doi:10.1098/rspa.2005.1546. Bibcode2005RSPSA.461.3473A. . Preprint available at [1]
  3. Aaronson, Scott (2004-01-11). "Complexity Class of the Week: PP". Computational Complexity Weblog. 
  4. Ethan Bernstein; Umesh Vazirani (1997). "Quantum Complexity Theory". SIAM Journal on Computing 26 (5): 11–20. doi:10.1137/s0097539796300921. 
  5. Aaronson, Scott (2005). "Quantum computing, postselection, and probabilistic polynomial-time". Proceedings of the Royal Society A 461 (2063): 3473–3482. doi:10.1098/rspa.2005.1546. Bibcode2005RSPSA.461.3473A.