- Boxes
- definitions
- Ellipses
- theorems and lemmas
- Blue border
- the statement of this result is ready to be formalized; all prerequisites are done
- Orange border
- the statement of this result is not ready to be formalized; the blueprint needs more work
- Blue background
- the proof of this result is ready to be formalized; all prerequisites are done
- Green border
- the statement of this result is formalized
- Green background
- the proof of this result is formalized
- Dark green background
- the proof of this result and all its ancestors are formalized
- Dark green border
- this is in Mathlib
The adjoint of a finite Kraus family \((K_i)_i\) is \((K_i^\dagger )_i\). The adjoint of a layer of plain gates from \(X\) to \(Y\) is the layer from \(Y\) to \(X\) on the same cells, with the adjoint gates and onsite families. The adjoint of a sequence of layers of plain gates on one system is the sequence of the adjoint layers in reverse order.
A circuit from \(X\) to \(Z\) is either empty, when \(X=Z\), or a layer \(L\) from \(X\) to some system \(Y\) followed, for every outcome \(i\) of \(L\), by a circuit from \(Y\) to \(Z\). The dependence on \(i\) is classical feedback; a circuit in which no continuation depends on the outcome is unbranched. A branch is a choice of an outcome of every layer along a path, and its Kraus operator is the product of the Kraus operators of its layers, the first layer on the right. The map of the circuit is \(\rho \mapsto \sum _pK_p\rho K_p^\dagger \) over all branches \(p\), and its Heisenberg picture is \(A\mapsto \sum _pK_p^\dagger AK_p\), which is the Heisenberg picture of the first layer applied to those of the continuations. A single layer is a circuit, and a finite sequence of layers on one system applied from the first is an unbranched circuit.
- QuantumCircuit.Circuit
- QuantumCircuit.Circuit.Index
- QuantumCircuit.Circuit.kraus
- QuantumCircuit.Circuit.kraus_done
- QuantumCircuit.Circuit.kraus_step
- QuantumCircuit.Circuit.krausFamily
- QuantumCircuit.Circuit.map
- QuantumCircuit.Circuit.dual
- QuantumCircuit.Circuit.dual_step
- QuantumCircuit.Circuit.ofLayer
- QuantumCircuit.Circuit.seq
Let \(V'\) be in bijection with the disjoint union of \(V\) and a finite set \(R\) of idle sites, each \(r\in R\) with a basis \(W_r\), and let \(\iota :V\to V'\) be the inclusion of \(V\). A system \(X\) on \(V\) extends to the system on \(V'\) with basis \(X_s\) at \(\iota (s)\) and \(W_r\) at \(r\). Its configurations are the pairs of a configuration of \(X\) and a configuration of the idle sites, and the configurations of \(\iota (D)\) are those of \(D\).
The sum of two gate families has the gates of both, each with its outcomes, and the interpretations of the two families give an interpretation of the sum. The inclusion of the gates of the first family is a morphism of gate families compatible with the interpretations.
Let \(\iota :V\to V'\) be injective. A morphism of geometries over \(\iota \) is an injective map of cells \(b\mapsto b'\) with \(C_{b'}=\iota (C_b)\); costs are compared separately. The union of the images of a set of cells is the image of their union, and the images of pairwise disjoint cells are pairwise disjoint. The identity of the cells is a morphism of a geometry to itself over the identity of \(V\).
Let \(B\) be a finite set. A call of an oracle on \(B\) on a region \(D\) is given by a bijection between the configurations of \(D\) and \(B\); it has one outcome and does not change the system. A matrix \(V\) on \(\mathbb {C}^B\) interprets the call by the matrix of \(V\) read on the configurations of \(D\) through the bijection. A circuit with oracle calls has gates in the sum of a gate family and the oracle calls; the circuit does not depend on \(V\), only its interpretation does. The number of calls of a circuit is the weight of Definition 45.4.1 that is \(1\) on calls and \(0\) on the other gates. A circuit none of whose layers contains a call makes no calls; so does every circuit of gates of the first family, included in the sum.
The measurement of a basis \(B\) is the Kraus family of the projections \(\lvert b\rangle \langle b\rvert \), \(b\in B\). The measurement of a region \(D\) is the layer with no cells, the measurement of the basis at the sites of \(D\) and the identity elsewhere; its outcomes are the configurations of \(D\). The probability of a branch \(p\) of a circuit on an input \(\rho \) is \(\operatorname {tr}(K_p\rho K_p^\dagger )\); for a state \(\rho \) and a circuit with trace-preserving gates and onsite families these are probabilities. A readout of a circuit is a map \(r\) from its branches to a finite set \(\Omega \), and the probability of a value \(\omega \) is the sum of the probabilities of the branches \(p\) with \(r(p)=\omega \).
Phase estimation [ 121 , Fig. 5.2 and 5.3 ] applies the Hadamard gate to every control qubit; then, for \(j=t-1,\dots ,0\), \(2^{t-1-j}\) calls on the pair of the control qubit \(j\) and the target, each identifying the configurations of the pair with \(\{ 0,1\} \times \{ 1,\dots ,m\} \); then the inverse Fourier transform on the control register; and finally it measures every control qubit in the basis \(\lvert 0\rangle ,\lvert 1\rangle \). The readout of a branch is the integer \(k=\langle x\rangle \) encoded by the measured bits \(x\). The oracle \(U\) on \(\mathbb {C}^m\) interprets every call by the controlled gate of \(U\), so the calls on the qubit \(j\) apply \(U^{2^{t-1-j}}\) controlled by \(j\). The inverse Fourier transform is the adjoint of the circuit of Definition 47.3.1 on the \(t\) qubits, moved to the register with the target idle, its plain gates included among the gates of the register.
- QuantumCircuit.PhaseEstimation.hadamardLayer
- QuantumCircuit.PhaseEstimation.queryLayer
- QuantumCircuit.PhaseEstimation.prepare
- QuantumCircuit.PhaseEstimation.qftInv
- QuantumCircuit.PhaseEstimation.unitary
- QuantumCircuit.PhaseEstimation.measureLayer
- QuantumCircuit.PhaseEstimation.circuit
- QuantumCircuit.PhaseEstimation.measured
- QuantumCircuit.PhaseEstimation.readout
The register has the sites \(0,\dots ,t-1\) of the control register, each with basis \(\{ 0,1\} \), and one target site with basis \(\{ 1,\dots ,m\} \); it is the register of \(t\) qubits extended by the target. Its geometry has a cell of cost \(1\) on every site and on every ordered pair of distinct sites, and the cells of the \(t\) qubits are cells of the register. Its gates are plain gates and calls of an oracle on \(\{ 0,1\} \times \{ 1,\dots ,m\} \). For a vector \(u\in \mathbb {C}^m\) the input is \(\lvert 0\cdots 0\rangle \otimes u\).
Semiclassical phase estimation [ 94 ] replaces the inverse Fourier transform and the measurement by measurements of the control qubits one at a time, in the order \(0,1,\dots ,t-1\). Griffiths and Niu show that the outcomes have the distribution of the coherent circuit for every input; here this is proved for the input of phase estimation, an eigenvector of the oracle on the target [ 158 ] . Before the qubit \(j\) is measured it gets the phase gate \(\operatorname {diag}(1,e^{-2\pi i\theta _j})\) with \(\theta _j=\sum _{i{\lt}j}b_i/2^{j-i+1}\), where \(b_i\) is the outcome of the qubit \(i\), and then the Hadamard gate. The circuit branches: the layer measuring the qubit \(j\) depends on the outcomes of the earlier layers. It is the first circuit of these chapters in which the continuation after a layer depends on its outcome. The readout is the integer whose bit at the site \(t-1-j\) is \(b_j\).
- QuantumCircuit.PhaseEstimation.correction
- QuantumCircuit.PhaseEstimation.correctedMeasure
- QuantumCircuit.PhaseEstimation.measureQubit
- QuantumCircuit.PhaseEstimation.qubitOutcome
- QuantumCircuit.PhaseEstimation.measureFrom
- QuantumCircuit.PhaseEstimation.outcomesFrom
- QuantumCircuit.PhaseEstimation.semiclassical
- QuantumCircuit.PhaseEstimation.semiclassicalReadout
The textbook circuit without swaps applies, for each qudit \(i=0,\dots ,n-1\) in turn, the Fourier gate to \(i\) and then, for \(j=i+1,\dots ,n-1\), the controlled phase of order \(j-i+1\) with control \(j\) and target \(i\), one gate per layer. This order is admissible and contains each Fourier and controlled phase cell once, \(n(n+1)/2\) cells in all. The Fourier circuit is the textbook circuit followed by the swaps, one per layer.
- QuantumCircuit.Qudit.siteCells
- QuantumCircuit.Qudit.seqCells
- QuantumCircuit.Qudit.gateLayers
- QuantumCircuit.Qudit.qftCore
- QuantumCircuit.Qudit.qft
- QuantumCircuit.Qudit.isGateOrder_seqCells
- QuantumCircuit.Qudit.seqCells_nodup
- QuantumCircuit.Qudit.toFinset_seqCells
- QuantumCircuit.Qudit.length_seqCells
- QuantumCircuit.Qubit.gateLayers
- QuantumCircuit.Qubit.qft
The system of \(n\) qudits of dimension \(d\) has the sites \(0,\dots ,n-1\) and the basis \(\{ 0,\dots ,d-1\} \) at every site; qubits are the case \(d=2\). A configuration \(x\) encodes the number \(\langle x\rangle =\sum _ix_id^{n-1-i}\), the site \(0\) most significant; this is a bijection onto \(\{ 0,\dots ,d^n-1\} \). The circuits of this chapter use the geometry of sites and pairs on the \(n\) qudits, every cell of cost \(1\).
The Kraus operators of the adjoint layer are the adjoints of those of the layer. If every Kraus operator of the \(k\)-th layer of a sequence equals \(U_k\), the Kraus operator of the adjoint sequence is \((U_m\cdots U_1)^\dagger \).
On a pure input \(\rho =\psi \psi ^\dagger \) the probability of a branch \(p\) is \(\lVert K_p\psi \rVert ^2\). If a readout \(r\) is a bijection and the probability of every branch \(p\) is \(f(r(p))\), the value \(\omega \) has probability \(f(\omega )\).
Let \(L_1,\dots ,L_m\) be layers on one system, and suppose every Kraus operator of \(L_k\) equals \(U_k\). Then the Kraus operator of the sequence along every branch is \(U_m\cdots U_1\). The sequence is unbranched, and a property holding locally on every layer holds locally on the sequence. If every layer has at least one outcome, the cost of the sequence is the sum of the costs of its layers; in particular a sequence of such layers of gate count \(1\) has the gate count \(m\). More generally the cost of an unbranched circuit with a branch, followed by any circuit, is the sum of the two costs.
The Fourier matrix on \(n\) qudits is unitary, and
The image of an unbranched circuit is unbranched. A local property holding on the image of every layer on which it holds holds on the image of every circuit on which it holds. A cost of layers that does not grow from a layer to its image does not grow from a circuit to its image, and one that does not change from a layer to its image does not change from a circuit to its image. If a map \(\Phi \) of matrices between the configurations of \(X\) and of \(X'\) sends \(1\) to \(1\) and products to products, and every Kraus operator of the image of a layer is \(\Phi \) of the corresponding Kraus operator of the layer, the same holds for circuits. The image of a composition is the composition of the images.
Along a morphism of geometries over the identity of \(V\) and a morphism of gate families, every layer and every circuit has an image on the same systems. With a compatible morphism of gate families the Kraus operators along corresponding branches agree, and a property of Kraus families invariant under relabelling of outcomes holds locally on the image if it holds locally on the circuit. A weight of gates that does not depend on the cell takes on the image of a layer the value of the weight of the images of its gates on the layer.
- QuantumCircuit.Layer.mapGate
- QuantumCircuit.Layer.mapGateIndexEquiv
- QuantumCircuit.Layer.kraus_mapGate
- QuantumCircuit.Layer.forall_mapGate
- QuantumCircuit.LayerMap.ofGate
- QuantumCircuit.Circuit.mapGate
- QuantumCircuit.Layer.cellCost_mapGate
- QuantumCircuit.Circuit.kraus_mapGate
- QuantumCircuit.Circuit.forall_mapGate
Along a morphism of geometries over \(\iota \) and a transport of gates, every circuit from \(X\) to \(Z\) on \(V\) has an image from the extended \(X\) to the extended \(Z\) on \(V'\), carrying the identity at the idle sites. With a compatible transport, along corresponding branches
in the identification of the configurations of \(V'\) with pairs, so the map of the image sends \(\rho \otimes \omega \) to \(\Phi (\rho )\otimes \omega \). A property of Kraus families invariant under relabelling of bases and outcomes, and holding for the identity, holds locally on the image if it holds locally on the circuit. A weight of gates that does not depend on the cell takes on the image of a layer the value of the weight of the transported gates on the layer.
- QuantumCircuit.Layer.mapSites
- QuantumCircuit.Layer.mapSitesIndexEquiv
- QuantumCircuit.Layer.kraus_mapSites
- QuantumCircuit.Layer.forall_mapSites
- QuantumCircuit.LayerMap.ofSites
- QuantumCircuit.Circuit.mapSites
- QuantumCircuit.Layer.cellCost_mapSites
- QuantumCircuit.Circuit.kraus_mapSites
- QuantumCircuit.Circuit.map_mapSites
- QuantumCircuit.Circuit.forall_mapSites
Let \(U\) be an \(m\times m\) matrix and \(u\in \mathbb {C}^m\) a unit vector with \(Uu=e^{2\pi i\varphi }u\), \(\varphi \in \mathbb {R}\). On the input \(\lvert 0\cdots 0\rangle \otimes u\) the readout \(k\) of phase estimation has probability \(\lvert \alpha _k\rvert ^2\), where
[ 121 , eq. (5.24) ] , and \(\sum _k\lvert \alpha _k\rvert ^2=1\). The matrix \(U\) need not be unitary; the circuit is then in general not trace-preserving.
Under the hypotheses of Theorem 48.2.2, that is, on the input \(\lvert 0\cdots 0\rangle \otimes u\) with \(Uu=e^{2\pi i\varphi }u\), the readout \(k\) of semiclassical phase estimation has probability \(\lvert \alpha _k\rvert ^2\). Hence it has the success probability of Theorem 48.2.4, and it calls the oracle \(2^t-1\) times.
Under the hypotheses of Theorem 48.2.2, let \(n\in \mathbb {N}\), \(\varepsilon {\gt}0\) and \(t=n+\lceil \log _2(2+1/(2\varepsilon ))\rceil \). Then phase estimation with \(t\) control qubits returns an integer \(k\) such that \(k/2^t\) lies within \(2^{-n}\) of \(\varphi \) modulo \(1\) with probability at least \(1-\varepsilon \) [ 121 , eq. (5.35) ] .
Along its single branch the textbook circuit without the swaps has the Kraus operator with entry \(F_{\bar yx}\) at \((y,x)\), and the Kraus operator of the Fourier circuit is \(F\). For qubits this is the circuit of [ 121 , Fig. 5.1 ] .