Training deep quantum neural networks
Paper · 2020 · Kerstin Beer, Dmytro Bondarenko, Terry Farrelly et al.
Summary
Suppose a quantum device performs an operation you want to reproduce, and you can prepare inputs and collect the corresponding outputs. Can a network learn the operation from those examples while keeping the data quantum throughout? Beer and colleagues build a feed-forward quantum neural network for this task. Its basic element, the quantum perceptron, is a trainable gate that acts jointly on incoming qubits and fresh output qubits. After the gates in a layer have run, the network keeps the new layer and discards the old one. The retained qubits can carry quantum information onward, including correlations that a measurement in a fixed basis would lose.
The authors train the gates by comparing each predicted output with the desired quantum state. The comparison uses fidelity, which in these experiments measures how much of a predicted state lies along a pure target state. A forward pass carries the input through the network. A backward calculation carries the effect of the final fidelity comparison towards earlier layers. Where those calculations meet, they determine how a gate should change. This organization lets the forward circuit and the local calculations work with neighboring layers. The number of qubits that must be held coherently can therefore scale with the width of the network as layers are added. Estimating the training signal on a quantum device still requires repeated circuit runs and fresh copies of the examples.
In classical simulations on small quantum registers, the authors ask the network to learn randomly chosen unitary operations, the reversible transformations of closed quantum systems. Across the tested training-set sizes, fidelity on fresh inputs tracked a theoretical estimate of what a unitary learner could achieve with the available examples. The authors also replaced some training pairs with unrelated random states and found that the networks continued to give useful predictions for clean pairs. Random initialization produced usable update signals in the networks studied, and the authors observed no exponential suppression of those signals in their simulations.
The paper establishes that suitably arranged perceptrons can implement universal quantum computation and describes both classical and quantum procedures for training them. Its numerical evidence concerns small, classically simulated networks. The strongest resource claim concerns the qubits needed at a given moment. Reproducing an unknown operation still depends on what the examples reveal, and learning it on hardware also depends on how accurately the repeated measurements can estimate the objective and its derivatives.
Deep dive: Training deep quantum neural networks
How deep quantum neural networks learn an unknown quantum operation from examples, and why their training can reuse qubits across layers. · about 36 minutes to read
The problem and its context
Learning a transformation from quantum examples
A device that acts on quantum information can be characterized at several levels. One can ask how it responds to a particular input, or one can ask for a reusable transformation that predicts its response to a new state. The paper studies the latter problem in a setting where the learner receives examples of the operation. For a chosen example, it can request a quantum input state and the corresponding quantum output state. Both may be unknown to the learner. The device is useful as a source of examples even when its internal circuit is unavailable.
The authors distinguish learning problems according to where quantum information enters. Classical methods can help solve problems in quantum physics, such as simulating a many-body system or choosing how to carry out an adaptive experiment. Quantum algorithms can also work on classical data, with the aim of accelerating parts of a classical learning procedure. Here the examples themselves are quantum states, and the goal is a quantum operation that accepts and produces states of that kind. This is the setting the authors select within the wider field of machine learning.
For the main benchmark, the source device performs an unknown unitary. A unitary maps pure states to pure states, preserves their inner products and is reversible on the space where it acts. The learning task is to reproduce its action on inputs beyond the ones used for training. Knowing that the source is unitary gives a learner some structure to exploit. The action on observed states constrains the action on their linear combinations, provided the relative phases are compatible. But a collection of examples spanning only part of the input space leaves room for different unitaries that fit those examples and act differently elsewhere. That distinction is part of the problem the paper sets up, and it determines how the reported test scores should be read.
The data access assumption is also part of the task. A measurement of a quantum state yields an outcome drawn from a distribution. To estimate a quantity such as fidelity from those outcomes, the procedure may need many fresh preparations under the same conditions. The authors therefore assume they can ask for more copies of a particular pair. A device that can repeatedly prepare inputs and apply the same unknown operation offers that kind of access. The examples can remain quantum because the training procedure compares states through circuits and measurements.
What a quantum perceptron has to preserve
Classical neural networks gave the authors a pattern to follow. A feed-forward architecture builds a transformation in stages, and back-propagation uses the composition of those stages to calculate how earlier parameters affect a final score. Transferring that pattern to quantum states requires a choice of elementary operation. An architecture intended for fully quantum tasks must transmit coherence, the phase relationships that let different components of a state interfere. It must also allow output qubits to become entangled, so that their joint state can contain relationships beyond those specified by their individual states.
The authors describe earlier qubit-circuit proposals, including ones designed to act on classical inputs. They point out that those approaches made more specific choices about gates and connectivity. They also discuss continuous-variable approaches, in which the elementary systems can be modes of light. In the examples they describe, inclusion of a non-Gaussian gate makes universal continuous-variable computation possible. Continuous variables also fit naturally with learning tasks whose classical inputs are real-valued vectors. For the task closest to their own, the authors single out work by Verdon, Pye and Broughton on coherent learning of parameterized unitary operations.
A particular earlier choice receives a mathematical comparison. In a controlled-unitary perceptron, an input basis label determines which gate acts on the output. The control register may initially be in a superposition. Once that register is discarded, however, the output depends only on the input’s probabilities in the control basis. The resulting map acts as if it measured the input in that basis and then prepared the corresponding output state. In the specific architecture the appendix analyzes, the conditional operations on the new layer are products of gates on individual output qubits. With a separable starting state for the output layer, the resulting mixture stays separable. A separable state is a mixture of product states, so this particular layer construction cannot create entanglement among its output qubits.
The authors allow a general joint gate on the incoming register and the perceptron’s output register. The wider choice lets a gate move quantum information into a fresh register and lets successive gates create correlations in that register through their shared inputs. It also poses a design problem. Gates that share qubits can affect each other’s action, and the optimizer needs to account for their order. The paper’s answer is to preserve the order inside each layer while exploiting the fact that the network moves information only from one layer to the next.
Why the size of the active register matters
Adding stages to a network can make it possible to build a long transformation from simpler pieces. For a quantum computer, a separate coherent register for every stage would make that design expensive in qubits. Each layer in the proposed architecture interacts only with its predecessor. After their interaction, the older layer has finished its role, and the circuit can move on with the newer register. The training calculation has an analogous local structure. To see why, it helps to distinguish what the network passes forward from what the optimizer needs to pass backward.
The forward quantity is the quantum state at a layer. The backward quantity represents the contribution that a state at that layer would make to the final fidelity. An optimizer can calculate the effect of changing a gate by bringing these quantities together around that gate. This is the relationship between the architecture and the training rule. The choice to arrange gates into successive quantum channels gives the authors a way to calculate the objective and its derivative without treating every layer as part of a single active register.
The method, step by step
Build a layer from ordered gates
The simplest way to follow the architecture is to picture an incoming register and an empty register that will hold the next layer. The incoming register contains the state produced by the preceding layer, or the original input if processing has just begun. The new register starts in a product of zero states. Each perceptron acts jointly on some incoming qubits and its designated output qubits. The main derivation uses perceptrons with a single output qubit, while the general definition allows several outputs and also allows qudits, whose elementary state spaces can have more levels than a qubit.
A quantum state on a register is represented by a density operator. This representation covers both a pure state and a mixed state, in which a single state vector is insufficient. A system can have a mixed state because it is correlated with another system that has been discarded. This can happen at every layer. Applying gates to both registers preserves the purity of their joint state if they started pure, but the new register on its own can still be mixed. The network therefore needs the density-operator description even in a benchmark whose inputs and targets are pure.
A general perceptron acts with a unitary on the joint register. The unitary is the trainable operation, and its matrix contains the analogue of the adjustable parameters in a classical neuron. With a qubit input register and a qubit output register, the authors give the parameter count after discarding an overall phase, which has no effect on the resulting density operator.
p = (2^(m + n))² − 1
Here p is the number of independent real parameters, m is the number of input qubits to the perceptron, and n is the number of its output qubits. The power of 2 gives the dimension of the joint state space. Squaring the dimension gives the count before removing the overall phase. The subtraction removes that phase degree of freedom. Later, when the authors compute a gradient in a basis of operators, they retain the identity direction in that basis. It can be included in the coordinates even though a shift along that direction alone changes only the phase of the gate.
Within one layer, the perceptrons act on the two adjacent registers. Several can share incoming qubits. The order can therefore change the output. The product below represents the order in which the paper applies the gates.
Uˡ = Uₘₗˡ ⋯ U₂ˡ U₁ˡ
The symbol Uˡ denotes the complete gate sequence for the transition into layer l. The symbol Uⱼˡ denotes gate j in that sequence, and mₗ is the number of perceptrons in the layer. The product acts from right to left, so the gate indexed by 1 acts first. Each perceptron is understood to act as the identity on the qubits outside its support. The ellipsis stands for the intervening gates in the same order.
After the gate sequence, the circuit discards the incoming register. Mathematically, it takes the partial trace, which gives the density operator of the retained register and preserves every measurement prediction on that register. The resulting map is a quantum channel. In particular, it is trace preserving and completely positive. Complete positivity means that the transformation still sends valid states to valid states when the incoming register is part of a larger, possibly entangled system.
Eˡ(X) = trₗ₋₁[Uˡ (X ⊗ Zˡ) (Uˡ)†]
Here Eˡ is the channel into layer l, X is an operator on the preceding register, and Zˡ is the projector onto the all-zero product state of the new register. The tensor product ⊗ places the two operators on separate registers. The dagger † denotes the conjugate transpose. The symbol trₗ₋₁ denotes the partial trace over the previous register. For a density operator X, the result is the state supplied to the next stage. The same expression defines the action of the channel on general operators, which is useful when deriving the gradient.
If all the registers were allocated at once, the circuit could run all the layer gates and discard the input and hidden registers at the end. Each discarded register has ceased to interact with the rest by the time the next transition begins. Taking its partial trace earlier therefore gives the same prediction on the final register. That equivalence lets the authors express the entire network as a composition of channels.
ρᵒᵘᵗ = Eᵒᵘᵗ ∘ Eᴸ ∘ ⋯ ∘ E¹(ρⁱⁿ)
Here ρⁱⁿ and ρᵒᵘᵗ are the input and output density operators, L is the number of hidden layers, and Eᵒᵘᵗ is the channel into the output layer. The composition symbol ∘ means that channels act in sequence from the one next to the input outward. The ellipsis covers the intervening hidden-layer channels. At each boundary, the state on the current register contains the information available to all later stages.
Check what the architecture can express
The paper’s universality construction gives a concrete example of how these channels can carry out a coherent computation. A neuron in that construction holds two qubits, which are initially fresh. A perceptron exchanges selected qubits from the preceding layer with the fresh qubits, using SWAP operations that transfer their states. It then applies a unitary to the qubits now held by the neuron. The connections route qubits into different pairings as the computation proceeds, so the architecture can reproduce a circuit of two-qubit gates. Two qubits in this construction can be treated as a single 4-level qudit.
The swaps in a given layer are assigned to disjoint qubit pairs. Gates can therefore commute within the layer in the construction while the pattern of pairings between layers still permits universal computation. The simulations use qubit perceptrons whose order within a layer matters. Universality here is a claim about the operations representable by a suitably arranged network. It does not require the optimizer to find the gates of the construction during training.
The paper also considers the full class of channels that a sufficiently general perceptron can implement. A desired channel can be represented by a unitary acting on a system and a suitably initialized auxiliary register, followed by discarding part of that joint system. This is the dilation argument used by the authors. A swap can place the surviving state on the newly allocated layer, which is where the network expects it. This argument establishes expressivity for a general unitary with adequate auxiliary space. For practical circuits the authors favor gates acting on fewer qubits. How much channel expressivity survives a particular restriction on those gates is a separate question.
Define the examples and the training score
Each training example has an index, a reproducible input state and a reproducible target state. The target is the state produced by applying the unknown unitary to that input. The unitary itself is not supplied. In a simulation it serves to generate the pairs and later to supply the correct answers on test inputs. In the envisioned device setting it could be the operation of a physical system whose behavior the learner wants to reproduce.
|φₓᵒᵘᵗ⟩ = V |φₓⁱⁿ⟩
Here x identifies the example, the ket |φₓⁱⁿ⟩ denotes its pure input state, and |φₓᵒᵘᵗ⟩ denotes its pure target state. V is the unknown unitary. A ket is the notation for a state vector. The equality describes how the target is generated. The learner uses the pair of states, and the training rule does not need the entries of V.
The prediction for the example is the network’s output density operator. The authors compare it with the target using the probability that the output would pass a projection onto the target state. This number is the fidelity used in the benchmark. The training objective is the average over the training pairs.
C = (1/N) ∑ₓ₌₁ᴺ ⟨φₓᵒᵘᵗ| ρₓᵒᵘᵗ |φₓᵒᵘᵗ⟩
Here C is the mean fidelity, N is the number of training pairs, and the sum runs over their indices x. The operator ρₓᵒᵘᵗ is the network prediction for input x. The bra ⟨φₓᵒᵘᵗ| is the conjugate transpose of the target ket. The expression between the sum and the end of the line is the fidelity for that pair. A value of 0 means that the prediction gives zero probability to the target projection. A value of 1 means that the prediction is the target state. Although the paper calls C a cost function, training seeks to increase it.
The pure target makes this objective linear in the predicted density operator. Equivalently, the individual score is the trace of the output state multiplied by the target projector. That form is important because it allows the target projector to be carried backward through the network as an observable. The paper also gives the fidelity for mixed target states.
F(ρ, σ) = [tr √(ρ¹⁄² σ ρ¹⁄²)]²
Here F is fidelity in the paper’s squared convention, and ρ and σ are density operators. The power ¹⁄² and the radical √ both denote the positive matrix square root of the operator to which they apply. The trace tr sums the diagonal entries of the square-root operator, and the outer square acts on that scalar. The benchmark uses the pure-target case above. The mixed-state expression makes clear why learning a channel that produces mixed targets would require revisiting the objective and its differentiation.
Send the state forward and the score backward
Training starts from randomly chosen perceptron gates. For each pair, the forward pass prepares the input and computes the state at every layer in order. At a specific transition, the state arriving from the previous layer is the complete input to the calculation. The classical simulation can store each intermediate density operator for reuse during differentiation. On a quantum device the forward state can instead be generated through a circuit execution when it is needed.
The backward calculation starts with the projector onto the target at the output layer. It asks how that projector would score a state before the last channel acts. The answer is an operator on the preceding layer obtained by applying the adjoint of the channel. A channel and its adjoint encode the same trace pairing from opposite sides. The channel pushes density operators forward. Its adjoint pulls the observable used to score them backward. The backward quantity represents a target-dependent measurement effect, so it need not be a density operator with unit trace.
tr[Y Eˡ(X)] = tr[Fˡ(Y) X]
Here X acts on layer l − 1, Y acts on layer l, Eˡ is the forward channel, and Fˡ is its adjoint. The two occurrences of tr denote the full trace on the register appropriate to their arguments. The identity says that evolving the state and then evaluating the observable gives the same scalar as evaluating the transported observable on the earlier state.
The appendix gives an explicit form of the adjoint. A channel can be written using a collection of matrices that take vectors from the old register to the new register. These are its Kraus operators. For the layer in this paper, each one comes from placing the new register in the zero state, applying the layer unitary, and taking a component in a basis of the discarded register.
Eˡ(X) = ∑ₐ Aₐ X Aₐ†
Here Aₐ is a Kraus operator for layer l, and a indexes the basis components of the discarded register. The sum accounts for all those components because the layer keeps no record of which component was taken. X is the input operator, and † denotes the conjugate transpose.
Fˡ(Y) = ∑ₐ Aₐ† Y Aₐ
Here Fˡ acts on an operator Y on the new register, and the same Aₐ and their conjugate transposes now appear the other way around Y. Each term maps the observable to the old register. Moving the matrices around inside the trace gives the adjoint identity. This is an algebraic operation for evaluating a derivative. It does not require recovering a discarded state or reversing an irreversible channel on hardware.
For an example x, the forward procedure saves the state entering the layer of interest. The backward procedure pulls the target projector through all channels after that layer. For the output layer, there are no later channels, and the backward operator is simply the target projector. For the earlier layers, it incorporates the gates and discards the state will encounter on its way to the output. In this way the local gradient can distinguish a change that survives to the prediction from a change erased by subsequent processing.
One training round for the quantum network
The steps in order.
Turn the local calculation into a gate update
The authors change each unitary by multiplying it by a small unitary generated by a Hermitian matrix. A Hermitian matrix is equal to its conjugate transpose. Multiplying it by the imaginary unit in the exponential gives a unitary factor, so a step of this form keeps the perceptron valid throughout training. The choice of generator controls the direction of the change.
Uⱼˡ(s + ε) = exp[i ε Kⱼˡ(s)] Uⱼˡ(s)
Here Uⱼˡ is perceptron j in layer l, s indexes progress through training, and ε is the step size. The matrix Kⱼˡ is the Hermitian generator evaluated at the current step. The letter i is the imaginary unit, and exp denotes the matrix exponential. The new factor appears on the left, so in a forward pass the perturbation is applied immediately after the original gate.
At first order, the effect of changing the gates can be evaluated by considering one perturbed layer at a time. Changes in two layers can interact, but products of their perturbations enter at higher order in the step. The first derivative therefore adds contributions over the layers and averages over examples. In each contribution, the changed layer acts on the ordinary forward state, and the ordinary backward observable scores its change in output.
dC/ds = (1/N) ∑ₓ₌₁ᴺ ∑ₗ₌₁ᴸ⁺¹ tr[σₓˡ Dˡ(ρₓˡ⁻¹)]
Here dC/ds is the derivative of average fidelity along the proposed training step, and N and x denote the training-set size and example index. The layer index l runs from the first transition to L + 1, with L hidden layers and the last transition leading to the output. The state ρₓˡ⁻¹ is the forward state before the transition, σₓˡ is the target observable pulled back to its output side, and Dˡ is the derivative of the channel Eˡ with respect to s. The trace tr evaluates the effect on fidelity. To first order, multiplying this derivative by ε gives the change in the objective.
To see the contribution of one perceptron, consider the moment just after that gate in the ordinary layer sequence. One operator describes the joint state of the two registers at that moment. It comes from attaching the new zero register and applying the layer’s gates up to and including the selected gate. A second operator describes how the target scores a state at the same moment. To construct it, first extend the backward observable by the identity on the preceding register, which will be discarded at the end of the transition. Then conjugate this joint observable by the adjoints of the gates that still have to act in the layer. Both operators now refer to the same point in the circuit.
Mₓ,ⱼˡ = [Aₓ,ⱼˡ, Bₓ,ⱼˡ]
Here Mₓ,ⱼˡ is the commutator of the forward joint state Aₓ,ⱼˡ and the backward joint observable Bₓ,ⱼˡ for instance x, gate j and layer l. These uses of A and B refer to the joint state and observable, separate from the Kraus operators above. The commutator [A, B] means AB − BA. It appears because the infinitesimal gate change acts on both sides of the density operator, with opposite signs on the two sides. If the joint state and the backward observable commute, the first-order contribution from this example to the gate’s update vanishes.
The linear response alone would favor making any beneficial generator arbitrarily large, which would defeat the small-step calculation. The authors therefore write the generator in a basis of tensor products of Pauli matrices and the identity and penalize the sum of squared coefficients. Pauli matrices and the identity form an operator basis on an individual qubit. Taking their tensor products gives a basis on the qubits the gate acts on. In this basis the response is linear in the coefficients and the penalty is quadratic. The resulting maximization picks an update in the direction of the local gradient, with its scale set by the learning rate.
Kⱼˡ = (i η 2^(q − 1)/N) ∑ₓ₌₁ᴺ trᵣₑₛₜ(Mₓ,ⱼˡ)
Here η is the learning rate, the reciprocal of the positive penalty multiplier in the derivation. The symbol q denotes the number of qubits supported by gate j in layer l. In the paper’s usual example those are the previous layer’s input qubits and one output qubit. The factor involving q comes from the normalization of the tensor products of Pauli matrices and the quadratic penalty. The partial trace trᵣₑₛₜ removes all qubits in the two registers outside that gate’s support. The summation averages their commutators over N training examples, and multiplication by i converts the resulting anti-Hermitian operator into a Hermitian generator.
The partial trace in this update has a direct interpretation. A gate can be changed only on the qubits it controls. In the first-order expression, its generator is tensored with identities on all other qubits. When that expression is put under a trace, those identities make it possible to collapse the unused qubits out of the calculation. Earlier and later layers still matter through the forward state and backward observable. Their influence enters before the update is reduced to the gate’s support.
The appendix illustrates the calculation on a network of four qubits with no hidden layer. A pair of ordered perceptrons acts between the input and output registers, and each perceptron occupies three qubits. For the first perceptron, the forward state has passed through that gate and the target observable must be pulled back through the second gate. For the second perceptron, both gates have already acted on the forward state, and the observable is the target projector extended over the input register. The two updates trace away different qubits because their supports differ. The example shows how even a network with a single transition can require attention to a gate’s position in the layer.
Evaluate the score and gradients on a quantum computer
The quantum procedure uses the same layer circuit for predictions. It appends the zero-state register, runs the gates for that transition and releases the older register. Registers can be reused once they cease to carry data needed by the remaining circuit. The paper assumes the ability to initialize, discard and measure qubits in the computational basis, and to implement perceptrons using ordinary gates such as controlled-NOT, T and Hadamard. These operations describe the hardware interface assumed by the proposal.
To score a prediction, the circuit holds the prediction in one register and a fresh copy of its target in another. A control qubit is prepared in a superposition. It controls an exchange of the two registers, then undergoes another Hadamard gate and is measured. The resulting interference makes the probability of measuring zero depend on the overlap of the two registers. This procedure is called the SWAP test. It compares physical preparations of the states, without specifying their amplitudes in classical memory.
p₀ = 1/2 + (1/2) F(|φ⟩, ρ)
Here p₀ is the probability of measuring the control qubit in state 0, |φ⟩ is the pure target state, and ρ is the output density operator being tested. The symbol F is their fidelity. The first term is the probability offset and the second is the fidelity contribution. For the training objective, the prediction register is prepared by running the network on the paired input, and the reference register is prepared in that pair’s target state.
The circuit estimates p₀ from counts. Each run produces a single outcome and consumes preparations of the prediction and target. Repetition reduces the fluctuations in the estimated proportion. The paper distinguishes the repetitions used to estimate fidelity for a chosen pair from the averaging used to estimate the objective over pairs. It also distinguishes the active register needed to evaluate a layer from the extra target register and control qubit needed for the comparison. The register exchange has a gate cost that depends on connectivity. This is one place where a width bound on qubits and an execution cost answer different resource questions.
For derivatives on hardware, the appendix describes perturbing the coordinates of a perceptron and re-estimating the objective. A three-qubit perceptron is written using 64 coefficients in the tensor-product operator basis. The procedure changes one coordinate at a time while leaving the others at their current values. It uses the unperturbed score as a reference, and the difference divided by the perturbation approximates the corresponding partial derivative.
∂C/∂xₐ ≈ [C(x + ε eₐ) − C(x)] / ε
Here x denotes the whole vector of gate coordinates in this equation, xₐ is its coordinate indexed by a, and eₐ is the vector selecting that coordinate with unit magnitude. The symbol ε is the finite perturbation, C is the fidelity objective, and ≈ indicates a finite-difference approximation. This use of x as a parameter vector is separate from its use as an example index. The coordinate derivatives give a gradient ascent direction. The appendix’s argument for an increase in fidelity uses a first-order approximation, and hardware evaluations of either score carry sampling error.
The classical calculation and the quantum procedure exploit the same layered prediction circuit in different ways. The classical calculation can represent the layer state and the backward observable as matrices and obtain the local commutator directly. The quantum procedure estimates changes in the scalar objective through repeated forward runs. This keeps the coherent workspace tied to the active part of the network, while moving a substantial part of the workload into state preparation and repeated measurement.
Experiments and results
Generalization from a limited set of states
The numerical task is to learn a randomly chosen unitary on a small quantum register. The authors report pilot simulations for input and output registers of 2 and 3 qubits. They used MATLAB and Mathematica and identify their accompanying implementation as DeepQNN. The examples were generated for the experiments. For each clean pair, an input state and its image under the chosen unitary supply the two halves. The authors assess fidelity against images of inputs drawn for evaluation as well as tracking the training objective in some runs.
The generalization experiment varies the number of paired examples the network receives. The regime of interest is where the examples give only partial coverage of the input Hilbert space, the vector space in which pure quantum states live. In the main comparison the plotted training-set sizes run from 1 through 8 pairs. At each size, the network trains for 1000 rounds with step size ε = 0.1 and learning rate η = 2/3. The reported numerical points are based on evaluations with 10 test pairs and averages over 20 runs. The score is average fidelity with the correct output states, so a score rewards close quantum predictions across the evaluation pairs.
The experimental comparison is against an analytic estimate for a unitary learner that uses the information supplied by the training pairs. It is not a contest against another trained architecture. To build the reference, the authors first ask what an ideal unitary fit can learn on the subspace spanned by the examples. Then they ask how that same learner would do when evaluated on random states that generally have components outside the span. This makes the baseline sensitive to the number and kind of inputs a learner sees.
A particularly important detail is whether the observed input states are orthogonal. State vectors that are orthogonal have zero inner product. A comparison of output states by fidelity cannot detect the overall phase of each individual state vector. If the training inputs are orthogonal, a unitary can attach different phases to their images and still achieve perfect fidelity on all those examples. On a superposition of those same inputs, the relative phases can affect the predicted state. With generic random input states that have non-zero overlaps, preservation of the overlaps constrains the phases. The authors handle those two training conditions separately in the analytic calculation.
The theoretical reference assumes that the learner fits the observed action on the part of the space it can identify and guesses the compatible unitary action on the remaining part. The paper averages over uniformly distributed pure inputs, using the Haar measure, which is invariant under changes of basis. Under a fixed pair of unitaries the expected fidelity on a fresh random state is expressed in terms of their trace overlap.
E[f] = (D + |tr(V† W)|²) / [D(D + 1)]
Here f is the fidelity between the images of a fresh pure input under the target V and the candidate W. The symbol E denotes expectation over that input, and D is the input-space dimension. The trace tr is taken over the full space, † is conjugate transpose, and the bars denote complex modulus. The calculation reduces the random-input average to a quantity determined by the two unitaries.
The appendix derives its reported reference for a collection of N pairs in which the first n are used for fitting and all N are scored. In that derivation, the fitted pairs contribute perfect fidelity, while the other pairs contribute the expected fidelity of a compatible guess. For generic random training inputs, the resulting estimate is as follows.
C̄ ∼ n/N + [(N − n)/N] [D + min{n² + 1, D²}] / [D(D + 1)]
Here C̄ is the estimated mean over the whole collection in that derivation, n is the number of fitted examples, N is the total number scored, and D is the Hilbert-space dimension. The sign ∼ marks the expression as an estimate. The function min chooses the smaller argument. The contribution n/N comes from perfect fits to the observed examples, and the second term is the expected contribution of the other examples. The experiment captions describe the plotted evaluations in terms of test pairs. The distinction matters when using the formula. Its whole-collection expression includes credit for examples already seen, while the expected fresh-input fidelity is the second term’s fidelity factor before the weighting by the fraction of fresh pairs.
The authors report that the network’s generalization points track the theoretical estimate. Thus the test result is most informative in relation to the examples available at each setting. The agreement indicates that the simulated networks recover much of the information that the analytic unitary learner can use. The points do not establish that a small training set always identifies the target. In the regime where part of the space remains unseen, the estimate itself reflects the ambiguity of extending the fit to that part.
The appendix gives further comparisons under different architectures and training settings. One series uses η = 1 and ε = 0.1, trains for 2000 rounds per run, and averages the cost over 20 runs with 10 test pairs. Another uses η = 2/3 and ε = 0.1, trains for 1000 rounds and also averages across 20 runs with 10 test pairs. The plotted comparison in each case is between numerical fidelity and the theoretical reference. The paper presents individual fidelities as points in the plots. Its stated settings and qualitative comparison support a reading of the trend, with no exact per-setting fidelity values quoted in the discussion.
Clean performance under corrupted supervision
The robustness experiment changes the quality of supervision. It starts with clean pairs from the target operation, then randomly chooses which pairs to replace. Each replacement comprises random quantum states. A replacement pair therefore asks the learner to reproduce a correspondence unrelated to the target it is supposed to infer. The variable of interest is the number of replacements at a fixed training-set size. The score is evaluated on clean pairs, so success means retaining the intended unitary behavior in the presence of conflicting examples.
The main experiment uses 100 training pairs and a step size of ε = 0.1 with learning rate η = 1. It trains for 300 rounds. The appendix shows related corruption experiments with different networks, including one run for 500 rounds at the same training-set size, step size, and learning rate. The chart compares the training budgets for the reported robustness settings. Its values are round counts. The fidelity outcomes are shown as curves in the paper, so a lower budget here means fewer optimization rounds for that setting and carries no ranking of prediction quality.
Training rounds for robustness simulations on random-unitary data
The main robustness setting uses the shorter training budget.
The numbers
| System or setting | training rounds |
|---|---|
| Appendix robustness setting | 500 |
| Main robustness setting (this paper) | 300 |
The authors find that clean-pair fidelity remains substantial as random replacements are introduced. The plotted scores eventually fall as the corruption becomes extensive. The useful comparison is between fitting the contaminated training set and recovering the clean transformation. A procedure could improve its fit to some unrelated pairs while making its clean predictions worse. Evaluating on clean pairs gives the experiment a way to detect that outcome. The results show tolerance of the specified replacement process under the networks and settings tested.
Training trajectories for deep networks
The appendix also presents training curves for deep examples using a set of 5 training pairs. Each example is trained for 1000 rounds with ε = 0.1. One uses η = 1/3 and the other uses η = 1/4. The curves plot the cost as training proceeds and show that fidelity can rise in the deeper circuits used in the simulation. Here the measured quantity is the training objective. These trajectories check that the update can optimize the gates in deeper examples, while the generalization experiment separately checks whether a trained circuit predicts the target on test inputs.
The authors also report that, across their randomly initialized simulations, the matrices that determine gate updates showed no exponential reduction of the kind associated with a barren plateau. A barren plateau is a regime in which gradients become so small that parameter changes are difficult to select from measurements of the objective. The authors offer a structural explanation. Each stage brings in ancillary qubits in a clean state, and discarding registers allows the state within the network to evolve dissipatively. The combination differs from keeping a single large quantum state under a succession of generic unitary operations. The result is a qualitative observation about the runs, accompanied by a proposed explanation for the behavior of the gradients.
What the ablations show
Changing the number and kind of examples
The paper’s controlled comparisons chiefly vary the supervision and the optimization settings. In the generalization experiment, the number of pairs controls how much of the input space is directly constrained. Holding the kind of task fixed and varying the number of observations gives the analytic estimate and the network the same progression of information. Their agreement is evidence that the learned circuit can use a significant portion of the information available in the samples. A rising test curve alone would show improvement with more examples. The comparison with an information-based reference gives that improvement a scale tied to what the task permits.
The orthogonal-input calculation isolates a different variable. The number of observed input vectors can be held fixed while their overlaps change. For orthogonal inputs, a successful fit can leave phases on separate basis directions unresolved. For generic nonorthogonal inputs, their overlaps link those phases. The appendix gives a separate estimated cost for the orthogonal case.
C̄ ∼ n/N + [(N − n)/N] [D + min{n + 1, D}] / [D(D + 1)]
Here C̄ is the estimated average over the full collection, n counts the examples used for fitting, N counts the evaluated collection, and D is the space dimension. The sign ∼ denotes an estimate, and min selects the smaller argument. In this case the unresolved relative phases are averaged along with the unknown action on the complementary subspace. That averaging changes the term inside the fidelity factor. The comparison explains why the same count of observed states can give different constraints on a unitary.
This phase comparison is analytic. It follows from the pure-state fidelity objective and the preservation of inner products by a unitary. The authors use it to show how sample geometry affects identifiability. Orthogonal examples can certify the target’s action on each observed state to the precision of the overlap test while leaving room for different predictions on their coherent superpositions. The relationship is particularly important when the intended output of training will act on general quantum inputs.
Replacing valid pairs with unrelated pairs
In the corruption experiment the authors keep the total number of training pairs fixed and vary how many come from the target. Randomizing which pairs get replaced ties the manipulation to the amount of corruption, instead of choosing a particular set of states to damage. The clean evaluation then asks whether the remaining examples exert enough influence for the optimizer to recover useful behavior. The reported tolerance shows that an exactly clean objective is unnecessary in these simulations.
This experiment changes the number of valid associations as well as the number of misleading ones. Consequently it studies the combined problem the learner faces when a fixed training set becomes less reliable. The paper’s results do not isolate how much of the change in fidelity is attributable to fewer clean examples and how much is attributable to optimizing against the unrelated examples. A clean-only experiment at matched valid-pair counts would address that distinction. The controlled variable here is the replacement count.
The appendix repeats the corruption procedure with different settings. Its curves offer examples of similar behavior under those configurations. Because the networks and training budgets can change together across the reported runs, differences between those curves cannot establish the effect of a single architectural choice. They do extend the observations beyond the main configuration.
Learning rate, circuit depth and gate restrictions
The small illustrative network is used for a direct comparison of learning rates. The figure for that comparison uses 10 randomly generated training pairs and ε = 0.1. It plots the objective through training for η = 2, η = 1 and η = 0.5. The compared curves show how the speed of optimization depends on the size of the update under that fixed step-size setting. This follows the role predicted by the derivation, where η scales the generator. The experiment studies progress on the training objective. It gives no measured relation between those learning rates and out-of-sample fidelity.
The deep training curves serve a related purpose. They show working optimization in the demonstrated multilayer settings. They do not form a matched depth sweep with a common learning rate and a common architecture apart from the added layers. Similarly, the observation about update magnitudes is descriptive. The paper does not report a controlled intervention in which fresh ancillas are removed or changed while the other features of the network are held fixed. Its explanation for the observed gradients rests on the circuit structure and on the behavior seen in the simulations.
There is a separate controlled comparison at the level of representational form. By analyzing the controlled-unitary alternative after tracing out its input, the authors can identify the precise loss of quantum information: only the input probabilities in the control basis reach the next layer. With product output initializations and conditional gates acting separately on those outputs, the appendix derives a separable result. This comparison establishes a restriction on that architecture without training a competing circuit. It supports the decision to allow general joint perceptrons for coherent quantum tasks. The universality construction then shows that commutation within a layer, considered by itself, is compatible with coherent universal computation when the gates and routing have the right form.
Limitations
Limits the authors state
The numerical evidence comes from classical simulation, and the authors say that the growth of the Hilbert space restricts them to small widths. Their width result addresses the size of the register or matrix needed at a given stage. A density operator for a wide qubit register still grows rapidly with the width. The classical procedure can store intermediate matrices for reuse, and its total storage can depend on how many such matrices it retains. The hardware proposal can release quantum registers as it advances. These are distinct resource statements about the active quantum workspace, the size of an individual classical calculation, and the total memory used by a particular implementation.
The authors explicitly identify repeated execution as the price of using fewer coherent qubits. A SWAP test estimates a probability, and one run yields one sample from that probability. Gradient estimation on a device can require scores for many perturbations and many copies of each tested pair. The proposal assumes the ability to obtain those copies and to initialize fresh auxiliary qubits between layers. The authors argue that some near-term hardware can repeat circuits readily, making the tradeoff attractive. The reported experiments do not run the full training procedure on such hardware.
The implementation of general channels also comes with a qualification. A sufficiently large unrestricted unitary together with auxiliary qubits gives the expressivity result, but the authors would prefer perceptrons acting on a few qubits in realistic implementations. They leave open which channels a restricted family of gates can efficiently realize. They also name open questions about overfitting, optimized implementation on near-term devices, and extensions of the perceptron description to account for decoherence more directly. The identity between layers and channels supplies a framework for these questions, with the practical choices still to be investigated.
Limits that follow from the setup
The clean data are generated by a unitary and use pure target states. The corresponding objective is linear in the network prediction and easy to express with a target projector. A source producing mixed outputs, such as a general noisy channel, would call for a fidelity suited to mixed states and for a way to obtain its training signal. The general expressivity proof says that the architecture has room for channels of that kind. The benchmark establishes performance on the unknown-unitary task with the pure-state objective.
The data-access requirement may also matter more in other settings. The learner can repeatedly request copies of the same indexed pair. A source that supplies only individual states with no way to recreate them falls outside that assumption. The quantum procedure also has to perform the fidelity comparison using its own gates. In a physical implementation, imperfections in preparing the reference states, applying the perceptrons or carrying out the controlled exchange would affect the measured objective. The random replacement experiment gives evidence about contaminated examples. Its corruption is at the level of whole pairs, whereas errors inside the circuit may affect every preparation, every gate, or every measurement in a different way.
The benchmark metric averages fidelity over a particular collection of inputs. A close match to the theoretical reference certifies performance of the simulated learner on that comparison. It leaves open how the learned operation behaves on a particular difficult input, or on a state drawn from a distribution other than the one used for evaluation. The analytic argument gives a reason to expect such a distinction. An operation can fit the observed span well and still differ in how it extends to a complementary subspace. Any error there can matter if later uses concentrate inputs in that part of the space.
The ideal unitary reference assumes that the learner can fit the available action and then regards compatible extensions as guesses. It is a reference for the specified random-data scenario. It does not provide a guarantee about a particular run of gradient ascent, and the analytic derivation’s convention for scoring already-seen pairs should be kept separate from claims about held-out behavior. The simulated network can in general implement a channel, so the class represented by the network is also broader than the class of unitary guesses used to construct the reference. Agreement is an experimental observation in the reported setting instead of a proof that their scores must coincide under other choices of data or gates.
The local update rule follows from a first-order derivative and a quadratic bound on the step direction. An update that increases fidelity to first order can behave differently at a finite step, especially when the direction is estimated from repeated measurements. A small finite difference can also make two measured scores hard to distinguish. The procedure therefore trades coherent space for repeated executions, classical calculations and accuracy requirements on those estimates. The paper supplies the operations needed to set up the tradeoff. It does not establish an end-to-end runtime improvement or a resource advantage across tasks and hardware.
Finally, the gradient observations cover the simulated configurations. The authors’ explanation involving clean ancillary qubits and discarded registers suggests how the architecture could influence the training landscape. The simulations do not establish how gradients scale over all widths, depths, gate arrangements or initializations. Expressivity, active qubit count and ease of optimization are separate properties. The paper demonstrates expressive constructions and derives a width-based workspace argument, with numerical evidence for trainability in the circuits it could simulate.
What came after
A later survey cites Beer and colleagues in work whose scope is quantum algorithm applications and end-to-end complexity. For this paper, that scope connects directly to the distinction between the qubits needed simultaneously and the work required to complete training. The width-based register bound describes one part of the computation. An end-to-end account would also track the preparation of paired states, the forward executions needed for the fidelity estimates, the perturbations used for derivatives and the implementation of the layer gates. These costs enter at different points in the proposed procedure, and the register bound alone does not determine them. Quantum algorithms: A survey of applications and end-to-end complexities.
The documented connection is a citation in a survey. It establishes that the work entered a broader treatment of quantum algorithms. A specific extension of the perceptron, a new training result or a complexity bound for this architecture cannot be attributed to the survey from that connection alone.
Cite
Cite as Kerstin Beer, Dmytro Bondarenko, Terry Farrelly, Tobias J. Osborne, Robert Salzmann, Daniel Scheiermann and Ramona Wolf. 2020. Training deep quantum neural networks. Nature Communications.
@inproceedings{beer2020training,
title = {{Training deep quantum neural networks}},
author = {Kerstin Beer, Dmytro Bondarenko, Terry Farrelly, Tobias J. Osborne, Robert Salzmann, Daniel Scheiermann and Ramona Wolf},
booktitle = {Nature Communications},
year = {2020},
doi = {10.1038/s41467-020-14454-2},
eprint = {1902.10445},
archivePrefix = {arXiv},
url = {https://doi.org/10.1038/s41467-020-14454-2}
}This page in Markdown https://md.research.elamur.ai/free/en/papers/beer-2020-training-deep-quantum-neural-networks/