Skip to content

Bernstein–Vazirani Algorithm

The Bernstein–Vazirani algorithm recovers an unknown nn-bit word ss from a function promised to satisfy fs(x)=s⋅xf_s(x)=s\cdot x, with the dot product evaluated modulo two. A quantum query encodes each bit of ss as the sign of a single-qubit superposition. Hadamards then turn those signs into the readable word ss.

One exact quantum query suffices, while matched classical value queries require nn for worst-case error below 1/21/2. This is a linear query separation in nn; it excludes the cost of constructing and implementing the oracle. The unknown-offset variant s⋅x⊕cs\cdot x\oplus c has the same quantum decoder but a different classical count, derived below.

Helpful background. Phase kickback explains the minus-state answer register. Quantum oracles defines coherent value access, and query complexity distinguishes queries from gates and fixes the error convention.

Fix n≥1n\ge1, write N=2nN=2^n, and let the hidden word be

s=(s1,…,sn)∈{0,1}n.s=(s_1,\ldots,s_n)\in\{0,1\}^n.

The oracle is selected from the family

fs:{0,1}n⟶{0,1},fs(x)=s⋅x=⨁j=1nsjxj.f_s:\{0,1\}^n\longrightarrow\{0,1\}, \qquad f_s(x)=s\cdot x =\bigoplus_{j=1}^n s_jx_j.

The dot is the mod-two inner product, and the required output is the full nn-bit label ss. There are exactly 2n2^n legal functions. Indeed, distinct words give distinct functions because fs(ej)=sjf_s(e_j)=s_j on the jjth standard basis word eje_j.

The intercept is anchored to zero. Linearity is promised by the instance supplier; the algorithm neither tests that promise nor learns an arbitrary NN-entry truth table. The address length nn and truth-table size NN describe different scales, and a comparison stated in one variable must not be silently restated in the other.

The complete supplied oracle acts on the data register followed by an answer qubit:

Os∣x,b⟩=∣x,b⊕(s⋅x)⟩.O_s|x,b\rangle=|x,b\oplus(s\cdot x)\rangle.

Preparing the answer in ∣−⟩|{-}\rangle gives Os∣x⟩∣−⟩=(−1)s⋅x∣x⟩∣−⟩O_s|x\rangle|{-}\rangle=(-1)^{s\cdot x}|x\rangle|{-}\rangle. The target returns unchanged. A rule specified only for target ∣0⟩|0\rangle would not suffice to determine this action on a superposition.

The full sequence is

∣0n⟩∣1⟩→H⊗(n+1)1N∑x∣x⟩∣−⟩→Os1N∑x(−1)s⋅x∣x⟩∣−⟩→H⊗n⊗I∣s⟩∣−⟩.\begin{aligned} |0^n\rangle|1\rangle &\xrightarrow{H^{\otimes(n+1)}}\frac1{\sqrt N}\sum_x|x\rangle|{-}\rangle\\ &\xrightarrow{O_s}\frac1{\sqrt N}\sum_x(-1)^{s\cdot x}|x\rangle|{-}\rangle\\ &\xrightarrow{H^{\otimes n}\otimes I}|s\rangle|{-}\rangle. \end{aligned}

Measure the data qubits to read ss. It is the same gate sequence as the Deutsch–Jozsa circuit, but now every output bit is used, rather than just testing whether all are zero.

The character state immediately after the oracle factors:

1N∑x(−1)s⋅x∣x⟩=⨂j=1n∣0⟩+(−1)sj∣1⟩2.\frac1{\sqrt N}\sum_x(-1)^{s\cdot x}|x\rangle =\bigotimes_{j=1}^n\frac{|0\rangle+(-1)^{s_j}|1\rangle}{\sqrt2}.

For each jj, this factor is ∣+⟩|+\rangle if sj=0s_j=0 and ∣−⟩|{-}\rangle if sj=1s_j=1. Since H∣+⟩=∣0⟩H|+\rangle=|0\rangle and H∣−⟩=∣1⟩H|{-}\rangle=|1\rangle, the final Hadamards read all the signs. This makes the exact decoder especially transparent. Measuring before the Hadamards would instead give uniform random data bits.

For x,y∈{0,1}nx,y\in\{0,1\}^n, the data transform obeys

H⊗n∣x⟩=1N∑y(−1)x⋅y∣y⟩.H^{\otimes n}|x\rangle =\frac1{\sqrt N}\sum_y(-1)^{x\cdot y}|y\rangle.

The amplitude of ∣y⟩|y\rangle after the final layer is therefore

As(y)=1N∑x∈{0,1}n(−1)x⋅(s⊕y).A_s(y) =\frac1N\sum_{x\in\{0,1\}^n} (-1)^{x\cdot(s\mathbin\oplus y)}.

The sum factors coordinate by coordinate:

As(y)=∏j=1n[12∑xj=01(−1)xj(sj⊕yj)]=∏j=1nδsj,yj=δy,s.\begin{aligned} A_s(y) &=\prod_{j=1}^n \left[ \frac12\sum_{x_j=0}^1 (-1)^{x_j(s_j\mathbin\oplus y_j)} \right]\\ &=\prod_{j=1}^n\delta_{s_j,y_j} =\delta_{y,s}. \end{aligned}

Each one-bit factor is one when sj=yjs_j=y_j and zero otherwise. Hence the data state is exactly ∣s⟩|s\rangle, its norm is one, and measurement returns the full hidden word with probability one.

No zero-query exact algorithm can distinguish the legal outputs. Under the never-wrong fixed-cap convention, a zero-query procedure cannot name any particular ss without erring on another instance, so it must always declare failure; that violates the allowed inconclusive-probability cap. Consequently, for 0≤ε<1/20\le\varepsilon<1/2,

QE(BVn)=Q0(BVn)=Qε(BVn)=1.Q_E(\mathrm{BV}_n) =Q_0(\mathrm{BV}_n) =Q_\varepsilon(\mathrm{BV}_n) =1.

Across the full bounded-error range, a zero-query output distribution is independent of ss. Its worst-case success is at most 2−n2^{-n}, attained by a uniform guess. Thus Qε=0Q_\varepsilon=0 exactly when 1−ε≤2−n1-\varepsilon\le2^{-n}; otherwise the one-query decoder is necessary and sufficient.

The same circuit has a diagnostic meaning off promise. For an arbitrary Boolean gg,

Pr⁡(Y=y)=∣1N∑x(−1)g(x)+x⋅y∣2.\Pr(Y=y) =\left| \frac1N\sum_x(-1)^{g(x)+x\cdot y} \right|^2.

If gg differs from s⋅x⊕cs\cdot x\mathbin\oplus c at exactly dd truth-table addresses, then the amplitude at ss is (−1)c(1−2d/N)(-1)^c(1-2d/N) and

Pr⁡(Y=s)=(1−2dN)2.\Pr(Y=s)=\left(1-\frac{2d}{N}\right)^2.

This identity diagnoses one Walsh coefficient. It is not a test of linearity, a nearest-codeword theorem, or a guarantee for an unspecified noisy oracle.

Classical queries and the full-word requirement

Section titled “Classical queries and the full-word requirement”

Classically, query the standard basis words in order:

e1=(1,0,…,0),…,en=(0,…,0,1).e_1=(1,0,\ldots,0), \quad \ldots,\quad e_n=(0,\ldots,0,1).

The returned values are

fs(ej)=s⋅ej=sj,f_s(e_j)=s\cdot e_j=s_j,

so nn value queries reconstruct the complete word. If the access model permits parallel calls, all nn addresses can be queried in one round, but the total remains nn queries. Query count and query-round depth are separate resources.

The matching lower bound survives adaptivity. Fix any branch of a deterministic decision tree after q<nq<n queries, and put its queried address rows into a matrix M∈F2q×nM\in\mathbb F_2^{q\times n}. Since rank⁡M≤q<n\operatorname{rank}M\le q<n, there is a nonzero d∈ker⁡Md\in\ker M. The two hidden words ss and s⊕ds\mathbin\oplus d give identical answers to every address on the branch:

xi⋅(s⊕d)=xi⋅s(i=1,…,q).x_i\cdot(s\mathbin\oplus d) =x_i\cdot s \qquad (i=1,\ldots,q).

Inductively they therefore cause the adaptive algorithm to choose the same later addresses and reach the same leaf, yet the leaf cannot output both words. Thus D(BVn)≥nD(\mathrm{BV}_n)\ge n, and the basis schedule attains equality. Thus

D(BVn)=n.D(\mathrm{BV}_n)=n.

The deterministic rank argument establishes exact recovery. A complete bounded-error comparison follows from the number of distinguishable transcripts.

Choose ss uniformly from its 2n2^n possibilities and fix a deterministic classical tree with query cap qq. It has at most 2q2^q answer transcripts and can name at most one hidden word correctly at each leaf. Its average success is therefore at most 2q/2n2^q/2^n. By Yao’s minimax principle, no randomized algorithm can have larger worst-case success.

The bound is attainable for every 0≤q≤n0\le q\le n. Query qq independent standard-basis directions, record those qq bits of ss, and guess the remaining n−qn-q bits uniformly. Every hidden word is then recovered with probability 2−(n−q)2^{-(n-q)}. Hence the exact minimax curve is

Sn,q∗=2q−n,en,q∗=1−2q−n,0≤q≤n.S^*_{n,q}=2^{q-n}, \qquad e^*_{n,q}=1-2^{q-n}, \qquad 0\le q\le n.

For every 0≤ε<1/20\le\varepsilon<1/2, a cap of n−1n-1 queries has optimal error 1/21/2 and therefore fails the strict requirement. Thus

Rε(BVn)=n,0≤ε<12,R_\varepsilon(\mathrm{BV}_n)=n, \qquad 0\le\varepsilon<\frac12,

while n−1n-1 queries suffice at the excluded boundary ε=1/2\varepsilon=1/2. In particular,

QE=1versusD=R1/3=n.Q_E=1 \quad\text{versus}\quad D=R_{1/3}=n.

This is a factor-nn, or linear, query separation in hidden-word length. Since n=log⁡2Nn=\log_2N, it is logarithmic rather than exponential in truth-table size. The theorem says nothing by itself about gate count, total runtime, energy, physical error correction, or a separation of uniform complexity classes.

Now define a separate family with an unknown intercept,

fs,c(x)=s⋅x⊕c,c∈{0,1},f_{s,c}(x)=s\cdot x\mathbin\oplus c, \qquad c\in\{0,1\},

while continuing to ask only for ss. Kickback adds the common sign (−1)c(-1)^c, so the modern circuit ends in

(−1)c∣s⟩∣−⟩.(-1)^c|s\rangle|{-}\rangle.

Measurement still returns ss exactly after one query. The intercept is an unobservable global sign in this circuit and is not part of the reported output.

The matched classical problem has changed. Querying 0n0^n reveals cc, after which nn standard-basis queries reveal ss, for an upper bound of n+1n+1. Equivalently, qq value equations contain at most q−1q-1 independent differences that eliminate the common nuisance intercept.

With no query, exact recovery is plainly impossible. For a deterministic lower bound with 1≤q<n+11\le q<n+1, augment each queried address row to (xi,1)∈F2n+1(x_i,1)\in\mathbb F_2^{n+1}. The resulting matrix has a nonzero kernel vector (d,δ)(d,\delta). Its word component must satisfy d≠0d\ne0, because every augmented query row has inner product one with (0,1)(0,1), so (0,1)(0,1) is not in the kernel. The parameter pairs (s,c)(s,c) and (s⊕d,c⊕δ)(s\mathbin\oplus d,c\mathbin\oplus\delta) then follow the same adaptive transcript but require different word outputs. Therefore exact recovery needs n+1n+1 calls.

The full randomized curve exposes the extra query. With no answers, uniformly guessing ss succeeds with probability 2−n2^{-n}. For q≥1q\ge1, pad every early-stopping branch of a deterministic capped tree with arbitrary queries; this preserves its output and success while giving a nonempty transcript at every leaf. The resulting tree has at most 2q2^q leaves, and at a fixed transcript a proposed word determines at most one consistent intercept, hence at most one parameter pair (s,c)(s,c). Under the uniform distribution on the 2n+12^{n+1} pairs, average success is at most 2q−n−12^{q-n-1}. Querying 0n0^n, learning q−1q-1 independent bits of ss, and guessing the rest attains that bound. Thus

Sn,0∗,aff=2−n,S^{*,\mathrm{aff}}_{n,0}=2^{-n},

and

Sn,q∗,aff=2q−n−1,1≤q≤n+1.S^{*,\mathrm{aff}}_{n,q}=2^{q-n-1}, \qquad 1\le q\le n+1.

Consequently,

D(BVnaff)=Rε(BVnaff)=n+1,0≤ε<12.D(\mathrm{BV}^{\mathrm{aff}}_n) =R_\varepsilon(\mathrm{BV}^{\mathrm{aff}}_n) =n+1, \qquad 0\le\varepsilon<\frac12.

The primary anchored problem has classical cost nn; this affine variant has cost n+1n+1 under the complete value-query convention. Combining the affine promise with the anchored classical bound would compare different tasks.

Take s=1011s=1011 and c=1c=1. In lexicographic address order 0000 through 1111, the affine truth table is 1001100101100110. The post-query data state is

−∣−⟩∣+⟩∣−⟩∣−⟩,-|{-}\rangle|+\rangle|{-}\rangle|{-}\rangle,

so the final Hadamards give −∣1011⟩-|1011\rangle. The common minus sign changes no outcome probability. Equivalently, its unnormalized Walsh coefficients vanish except for W(1011)=−16W(1011)=-16.

For comparison, the optimal classical success probabilities are:

Query cap Known zero intercept Unknown intercept
00 1/161/16 1/161/16
11 1/81/8 1/161/16
22 1/41/4 1/81/8
33 1/21/2 1/41/4
44 11 1/21/2
55 11 11

At cap five, the known-intercept procedure can simply stop after four calls. One quantum query succeeds with probability one in either column. Changing whether cc is known changes the classical information obtainable from an answer; it does not change the required output word.

The ideal circuit uses n+1n+1 visible qubits and 2n+12n+1 Hadamards if the answer starts in ∣1⟩|1\rangle. An all-zero initialization adds one XX. Any oracle workspace, oracle gates and output-reading cost must be included in an implementation. Parallel Hadamard layers do not make the entire calculation constant-time.

The displayed data and answer states are products throughout the algorithm’s gate-layer boundaries. This example therefore does not require entangled boundary states. A particular oracle decomposition may create intermediate entanglement; the result makes no general claim about entanglement in quantum computing.

A transparent realization of an affine oracle is

XBc∏j:sj=1CNOT⁡Xj→B.X_B^c\prod_{j:s_j=1}\operatorname{CNOT}_{X_j\to B}.

It uses wt⁡(s)\operatorname{wt}(s) CNOTs and, when c=1c=1, one target XX. With this minus-state target, every CNOT acts as a local sign change on its control at the gate boundaries. The wiring itself displays the bits of ss, so a prepared demonstration tests the coherent decoder rather than discovering a secret inaccessible to the circuit designer.

Bernstein and Vazirani introduced the construction in their 1993 complexity work, expanded in 1997. Cleve and collaborators’ 1997 preprint, published in 1998, gives the familiar one-XOR-query refinement. Their broader recursive Fourier-sampling setting must be distinguished from the elementary one-versus-nn problem here. See quantum complexity classes for the role of oracle separations.

Finally, the transform here is Fourier analysis over (Z2)n(\mathbb Z_2)^n, namely H⊗nH^{\otimes n}. It is not the cyclic transform F2nF_{2^n} from the quantum Fourier transform page. The groups have different characters even though their Hilbert spaces have the same dimension.

Count the anchored linear functions and the affine parameter pairs. Prove that their parameters are unique, and explain which family defines the primary problem.

Solution

Each s∈{0,1}ns\in\{0,1\}^n defines one anchored function fs(x)=s⋅xf_s(x)=s\cdot x. If fs=ftf_s=f_t, evaluating on every eje_j gives sj=tjs_j=t_j, so s=ts=t. There are therefore 2n2^n distinct anchored functions.

For the affine family, fs,c(0n)=cf_{s,c}(0^n)=c determines the intercept, and then

fs,c(ej)⊕fs,c(0n)=sjf_{s,c}(e_j)\mathbin\oplus f_{s,c}(0^n)=s_j

determines every word bit. Thus all 2n+12^{n+1} pairs (s,c)(s,c) define distinct functions. The primary Bernstein–Vazirani problem uses only the 2n2^n functions with c=0c=0; the unknown-intercept family is a separate query problem.

Give the classical basis-query schedule, prove that it recovers ss, and distinguish total query count from parallel query rounds.

Solution

For j=1,…,nj=1,\ldots,n, query eje_j. The answer is

fs(ej)=⨁k=1nsk(ej)k=sj.f_s(e_j)=\bigoplus_{k=1}^n s_k(e_j)_k=s_j.

Writing the returned bits in coordinate order therefore gives ss after exactly nn queries. In a sequential model this takes nn query rounds. If independent simultaneous oracle calls are available, the addresses can be submitted in one round, but the algorithm still consumes nn calls and nn returned bits. Parallel depth does not change total query complexity.

Apply the complete XOR oracle to ∣−⟩|{-}\rangle, prove target return and factorization for a data superposition, and determine the effect of an affine intercept.

Solution

For one basis address,

Os∣x⟩∣−⟩=∣x,s⋅x⟩−∣x,1⊕s⋅x⟩2=(−1)s⋅x∣x⟩∣−⟩.\begin{aligned} O_s|x\rangle|{-}\rangle &=\frac{|x,s\cdot x\rangle-|x,1\oplus s\cdot x\rangle}{\sqrt2}\\ &=(-1)^{s\cdot x}|x\rangle|{-}\rangle. \end{aligned}

Linearity gives

Os(∑xαx∣x⟩)∣−⟩=(∑xαx(−1)s⋅x∣x⟩)∣−⟩.O_s\left(\sum_x\alpha_x|x\rangle\right)|{-}\rangle =\left(\sum_x\alpha_x(-1)^{s\cdot x}|x\rangle\right)|{-}\rangle.

The same answer state factors from every term. Replacing the function by s⋅x⊕cs\cdot x\oplus c multiplies the entire data factor by (−1)c(-1)^c, so the target still returns and the intercept becomes one unobservable global sign.

Derive the coordinate product for As(y)A_s(y), prove normalization and exact decoding, and connect the qubitwise factorization to Tensor Products as the general product-space construction.

Solution

Substituting the Hadamard matrix elements gives

As(y)=1N∑x(−1)x⋅(s⊕y).A_s(y)=\frac1N\sum_x(-1)^{x\cdot(s\oplus y)}.

Because both the sum and exponent separate by coordinate,

As(y)=∏j=1n12∑xj=01(−1)xj(sj⊕yj)=∏j=1nδsj,yj=δs,y.\begin{aligned} A_s(y) &=\prod_{j=1}^n \frac12\sum_{x_j=0}^1(-1)^{x_j(s_j\oplus y_j)}\\ &=\prod_{j=1}^n\delta_{s_j,y_j} =\delta_{s,y}. \end{aligned}

Hence ∑y∣As(y)∣2=1\sum_y|A_s(y)|^2=1 and Pr⁡(Y=s)=1\Pr(Y=s)=1. The same calculation at the state level is

1N∑x(−1)s⋅x∣x⟩=⨂j=1n∣0⟩+(−1)sj∣1⟩2.\frac1{\sqrt N}\sum_x(-1)^{s\cdot x}|x\rangle =\bigotimes_{j=1}^n \frac{|0\rangle+(-1)^{s_j}|1\rangle}{\sqrt2}.

The tensor product constructs the joint space and distributes the coordinate factors; it does not assert that arbitrary multipartite states factor this way.

Use rank and a nonzero nullspace word to construct indistinguishable secrets after every adaptive transcript of length q<nq<n.

Solution

Fix the addresses x1,…,xqx_1,\ldots,x_q selected along one actual decision-tree branch and form the matrix MM with these rows. Since rank⁡M≤q<n\operatorname{rank}M\le q<n, choose d≠0d\ne0 with Md=0Md=0.

For every query already made,

xi⋅(s⊕d)=xi⋅s⊕xi⋅d=xi⋅s.x_i\cdot(s\oplus d) =x_i\cdot s\oplus x_i\cdot d =x_i\cdot s.

The equal answers force the deterministic algorithm to choose the same next address on both secrets, so induction preserves the common branch. The leaf then sees one transcript for the two distinct required outputs ss and s⊕ds\oplus d and must fail on at least one. No exact deterministic tree of depth below nn exists; combined with basis queries, D=nD=n.

Prove matching upper and lower bounds for Sn,q∗S^*_{n,q}, reproduce the n=4n=4 sequence, and obtain Rε=nR_\varepsilon=n for ε<1/2\varepsilon<1/2.

Solution

Under uniform ss, a deterministic depth-qq tree has at most 2q2^q leaves. Each leaf announces one word and can be correct for at most that one member of the 2n2^n-word family, so its average success is at most 2q−n2^{q-n}. Yao’s principle transfers this bound to the worst-case success of randomized algorithms.

Querying qq independent basis directions and guessing the remaining bits uniformly attains success 2−(n−q)2^{-(n-q)} on every ss. Therefore

Sn,q∗=2q−n,en,q∗=1−2q−n.S^*_{n,q}=2^{q-n}, \qquad e^*_{n,q}=1-2^{q-n}.

For n=4n=4 and q=0,1,2,3,4q=0,1,2,3,4, the successes are

116,18,14,12,1.\frac1{16},\quad\frac18,\quad\frac14,\quad\frac12,\quad1.

Every cap below four has error at least 1/21/2, whereas four queries give zero error. Hence Rε(BV4)=4R_\varepsilon(\mathrm{BV}_4)=4 for ε<1/2\varepsilon<1/2, and the same argument gives Rε(BVn)=nR_\varepsilon(\mathrm{BV}_n)=n generally.

Derive the n+1n+1 classical schedule and exact affine success curve. Explain why the quantum output is unchanged and why the anchored nn-query equality no longer applies.

Solution

Query 0n0^n to obtain cc, then query every eje_j and compute

sj=fs,c(ej)⊕c.s_j=f_{s,c}(e_j)\oplus c.

This uses n+1n+1 calls. With no query, uniform guessing of ss succeeds with probability 2−n2^{-n}. For q≥1q\ge1, pad early-stopping branches with arbitrary queries so every leaf has a nonempty transcript. There are then at most 2q2^q leaves, and a fixed transcript plus proposed word determines at most one intercept, so it can be correct for at most one parameter pair. The upper bound 2q−n−12^{q-n-1} is attained by learning cc, then q−1q-1 word bits, and guessing the rest. Thus

Sn,0∗,aff=2−n,Sn,q∗,aff=2q−n−1(1≤q≤n+1).S^{*,\mathrm{aff}}_{n,0}=2^{-n}, \qquad S^{*,\mathrm{aff}}_{n,q}=2^{q-n-1} \quad(1\le q\le n+1).

The quantum character acquires only (−1)c(-1)^c and still decodes to ss in one query. The classical oracle returns ordinary values, so it must eliminate the unknown intercept; the anchored equality D=nD=n is therefore inapplicable.

For n=4n=4, change one value of fs(x)=s⋅xf_s(x)=s\cdot x at address x0x_0. Calculate the probability of decoding ss and the probability of each other word. Explain why repeated sampling still does not by itself certify linearity.

Solution

Changing one sign changes every Walsh amplitude by a term of magnitude 2/162/16. More explicitly,

Ag(y)=δy,s−18(−1)x0⋅(s⊕y).A_g(y)=\delta_{y,s}-\frac18(-1)^{x_0\cdot(s\oplus y)}.

Thus Ag(s)=7/8A_g(s)=7/8 and every other amplitude has magnitude 1/81/8. The correct-word probability is 49/6449/64, with probability 1/641/64 on each of the other fifteen words; the probabilities sum to one. This is a fixed coherent Boolean-function change, not an independent random bit flip on each invocation. Observing ss repeatedly can be likely for both this imperfect function and the exact linear one. A statistical test needs a specified alternative, number of trials and tolerated error.

  • E. Bernstein and U. Vazirani, “Quantum Complexity Theory,” in Proceedings of the Twenty-Fifth Annual ACM Symposium on Theory of Computing, 11–20 (1993), doi:10.1145/167088.167097.
  • E. Bernstein and U. Vazirani, “Quantum Complexity Theory,” SIAM Journal on Computing 26, 1411–1473 (1997), doi:10.1137/S0097539796300921.
  • R. Cleve, A. Ekert, C. Macchiavello, and M. Mosca, “Quantum Algorithms Revisited,” Proceedings of the Royal Society A 454, 339–354 (1998), doi:10.1098/rspa.1998.0164.
  • D. A. Meyer, “Sophisticated Quantum Search without Entanglement,” Physical Review Letters 85, 2014–2017 (2000), doi:10.1103/PhysRevLett.85.2014.
  • M. A. Nielsen and I. L. Chuang, Quantum Computation and Quantum Information, 10th Anniversary Edition, Cambridge University Press (2010), doi:10.1017/CBO9780511976667.