Training what the next quantum model receives
Exposed reduced states as a compositional training criterion in Shim
This post documents recent work of mine on composability of quantum machine learning models and how different model inferfaces changes what a model later in a sequence can reproduce. It is a good deal more verbose than a paper to be easier to get into by a more general reader.
Quantum models often train against a scalar expectation value. This is enough when a scalar is the final output of a model. It is not enough when one quantum model will process the state that follows another. Replacement at such a boundary can be defined by the reduced state on the exposed subsystem. Equality of exposed reduced states is sufficient for substitution under every downstream channel, and necessary if the substitution must hold for all of them, while agreement on one expectation value is neither. That argument is elementary; its content is the identification rather than the proof, because the object an upstream model must preserve is the state on the exposed wires and not the parameters that produced it. Trace distance gives the corresponding bound when the states are only close. The criterion is then tested as a training loss in Shim, by varying four factors against one apparatus: a Ry-CNOT circuit trained from six distinct parameter initializations for each of five generated states, scored by the largest pairwise trace distance between independently trained exposed states. Varying the loss function, squared error in the exposed expectation value leaves a median 99-fold greater maximum pairwise distance than squared Hilbert-Schmidt distance to the whole exposed state, and training on trace distance directly leaves the models further apart than the Hilbert-Schmidt surrogate does on every state, by 6.4-fold in the worst case over states. Varying the epoch budget, four of five generated states fall below the prespecified 0.01 threshold at 4,000 epochs and all five at 40,000, with every limit-stopped run still descending. Varying the exposed width with the circuit held fixed, the worst pairwise distance rises from 0.000175 at one exposed qubit to 0.211 at three, where the exposed state first asks for more free parameters than the circuit has. Varying the measurement class, models matched on every single-qubit marginal are invisible to single-qubit readout, yet a product measurement applying no entangling gate between output wires separates them by 0.655 against a ceiling of 0.751. The criterion holds throughout; what the experiments bound is the range over which it can be trained.
1. The output of one model as the input of another
Consider two quantum models connected in sequence. The first model prepares a quantum state. It is called the upstream model here, because it runs before the other; the term generalizes to any chain of models. The second model, the downstream model, receives part of that state and performs the next computation.
The first model and the second model meet at an interface. On one side, that interface is the upstream model’s output. On the other, it is the downstream model’s input. This shared interface is called the composition boundary, because it is where the two models join into one larger computation. It is not an additional circuit operation. It is defined by the quantum wires passed from one model to the other. The upstream model may produce more quantum information than the downstream model receives, so the boundary must specify which output wires cross it and which do not.
In this experiment, the upstream model is a parameterized circuit that ends with four output qubits. A circuit diagram represents each qubit with a wire. The ordered collection of these four qubits is the circuit’s output register. The register is a bookkeeping device: it names the qubits together and describes their joint quantum state.
A subsystem is a selected part of a larger quantum system. In this circuit, a subsystem is specified by selecting output wires. The four-qubit output register partitions into two subsystems:
\[ V_{\mathrm{up}} = q_0 \otimes q_1, \qquad H = q_2 \otimes q_3. \]
Both \(V_{\mathrm{up}}\) and \(H\) are therefore subsystems of the same four-qubit output register.
The subscripts distinguish the two sides of the connection. \(V_{\mathrm{up}}\) is the part of the upstream output visible to the downstream model: qubits 0 and 1. The same two wires form the downstream input register \(V_{\mathrm{down}}\). Because the wires connect directly, the interface identifies these two systems:
\[ V_{\mathrm{up}} \equiv V_{\mathrm{down}}. \]
The symbol \(\equiv\) marks a wire-by-wire identification. The labels distinguish the output role from the input role. \(H\) is the hidden part of the upstream output: qubits 2 and 3. Together, the four upstream output qubits form
\[
V_{\mathrm{up}} \otimes H
= q_0 \otimes q_1 \otimes q_2 \otimes q_3.
\]
Before the boundary, the density operator \(\rho_{V_{\mathrm{up}}H}\) describes all four qubits, including correlations between \(V_{\mathrm{up}}\) and \(H\). State preparation and discard are two separate maps:
\[ \begin{aligned} A_\theta &: \text{no quantum input} \longrightarrow V_{\mathrm{up}} \otimes H, \\ \operatorname{Tr}_H &: V_{\mathrm{up}} \otimes H \longrightarrow V_{\mathrm{up}}. \end{aligned} \]
The first line says that \(A_\theta\) is a state-preparation map: it has no quantum input and produces the four-qubit system \(V_{\mathrm{up}}\otimes H\). The letter \(A\) stands for the ansatz, the fixed circuit shape that training adjusts, and the subscript \(\theta\) collects its adjustable parameters. The partial trace \(\operatorname{Tr}_H\) leaves \(V_{\mathrm{up}}\) unchanged and discards \(H\). Shim applies it to the prepared state:
\[ \rho_{V_{\mathrm{up}}} = \operatorname{Tr}_H(\rho_{V_{\mathrm{up}}H}). \]
One requirement fixes the partial trace. Any measurement that touches only \(V_{\mathrm{up}}\) must give the same outcome probabilities whether those probabilities are calculated from the two-qubit operator \(\rho_{V_{\mathrm{up}}}\) or from the four-qubit operator \(\rho_{V_{\mathrm{up}}H}\). Discarding \(H\) must not change what an experimenter holding only qubits 0 and 1 can observe, because that experimenter never had access to \(H\) in the first place. Exactly one linear map from four-qubit operators to two-qubit operators has this property, and \(\operatorname{Tr}_H\) is that map. The rest of this section writes the requirement down and checks it.
Writing it down needs a way to denote a single measurement outcome. A measurement on \(V_{\mathrm{up}}\) has a set of possible outcomes, and quantum theory represents each outcome by an operator on \(V_{\mathrm{up}}\). Write \(E\) for the operator belonging to one outcome. It must be positive and no larger than the identity,
\[ 0\le E\le I_{V_{\mathrm{up}}}, \]
and the operators for all outcomes of the same measurement must sum to \(I_{V_{\mathrm{up}}}\), which is what makes their probabilities add to one. A set of operators with these two properties is a positive operator-valued measure, abbreviated POVM, and each operator in the set is a POVM element. Categorical quantum theory calls the same object an effect, and this article uses both names. For a state \(\rho_{V_{\mathrm{up}}}\), the Born rule assigns the outcome \(E\) the probability \(\operatorname{Tr}(E\rho_{V_{\mathrm{up}}})\).
The same outcome probability can be calculated from the four-qubit state:
\[ \operatorname{Tr}(E\rho_{V_{\mathrm{up}}}) = \operatorname{Tr}\!\left[(E\otimes I_H)\rho_{V_{\mathrm{up}}H}\right]. \]
On the right, \(I_H\) is the identity operator on \(H\), so \(E\otimes I_H\) represents the outcome \(E\) on \(V_{\mathrm{up}}\) together with no action at all on \(H\). The equality is the requirement stated above, now written out: the two-qubit operator reproduces every probability that the four-qubit operator assigns to a measurement confined to \(V_{\mathrm{up}}\).
No operation acts between the upstream output and the downstream input. The density operator that describes \(V_{\mathrm{up}}\) is therefore the same density operator that describes \(V_{\mathrm{down}}\). The subscript changes on the receiving side to record a change of role, from output to input, and not a change of state:
\[ \rho_{V_{\mathrm{down}}} = \rho_{V_{\mathrm{up}}}. \]
The downstream model therefore receives only \(\rho_{V_{\mathrm{down}}}\), a two-qubit density operator. It cannot measure \(H\) or access correlations with \(H\) that the discard removes. That two-qubit operator \(\rho_{V_{\mathrm{down}}}\) can be mixed even when the four-qubit operator \(\rho_{V_{\mathrm{up}}H}\) is pure.
If the model ends here, a scalar training criterion such as
\[ p = \operatorname{Tr}(E\rho_{V_{\mathrm{up}}}) \]
may be all that matters. If the upstream model feeds a downstream process, written \(K:V_{\mathrm{down}}\to Y\) with \(K\) the usual symbol for a quantum channel, the whole state \(\rho_{V_{\mathrm{down}}}\) becomes the input to \(K\). Matching one value of \(p\) does not guarantee that two states give the same probabilities for other measurement outcomes after \(K\) processes them.
The smallest counterexample uses one qubit. The states \(|+\rangle\) and \(|-\rangle\) both give probability \(1/2\) for the POVM element \(|0\rangle\!\langle0|\). A downstream Hadamard sends them to \(|0\rangle\) and \(|1\rangle\). The same measurement outcome then has probabilities 1 and 0. Agreement on the upstream scalar is therefore not preserved by postcomposition.
The problem lies in the single measurement quantity chosen by the training loss. Suppose the downstream channel \(K:V_{\mathrm{down}}\to Y\) is followed by a measurement outcome represented by the POVM element \(F\) on \(Y\). Its probability is
\[ \operatorname{Tr}\!\left[F K(\rho_{V_{\mathrm{down}}})\right] = \operatorname{Tr}\!\left[K^*(F)\rho_{V_{\mathrm{down}}}\right]. \]
The operator \(K^*(F)\) describes, on \(V_{\mathrm{down}}\), the combined test performed later by \(K\) and \(F\). Through the direct identification with \(V_{\mathrm{up}}\), the same operator tests the state produced by the upstream model. This rewriting is called pulling \(F\) back through \(K\) [2]. If upstream states are tested against only a chosen family of POVM elements, that family guarantees substitution through the allowed downstream channels only when it also contains every operator \(K^*(F)\) that those channels and later measurements can produce. Otherwise two upstream states can pass every chosen test and still give different probabilities after downstream processing.
2. The categorical boundary
A categorical approach to model interfaces records which quantum system is present at each boundary and which maps connect those systems. Its objects are finite-dimensional quantum systems. Its morphisms are completely positive trace-preserving maps, or quantum channels. The tensor product combines two systems into one composite system. For channels, the tensor product \(K_1\otimes K_2\) describes applying \(K_1\) to one system and \(K_2\) to a second, separate system. Neither channel acts on the other’s system, and neither takes the other’s output as its input. That independence is what parallel means here. Composition instead connects the output of one channel to the input of the next, so the second channel does act on what the first produced.
After \(H\) is discarded, each upstream model has \(V_{\mathrm{up}}\) as its output system. The next model accepts \(V_{\mathrm{down}}\). The direct connection identifies these two systems. Two upstream models are interchangeable at this interface when no downstream channel and final measurement can tell which upstream model was used.
Suppose the two upstream models produce exposed states \(\rho_{V_{\mathrm{up}}}\) and \(\sigma_{V_{\mathrm{up}}}\). The downstream model receives the same density operators under its own input label:
\[ \rho_{V_{\mathrm{down}}}:=\rho_{V_{\mathrm{up}}}, \qquad \sigma_{V_{\mathrm{down}}}:=\sigma_{V_{\mathrm{up}}}. \]
If
\[ \rho_{V_{\mathrm{up}}}=\sigma_{V_{\mathrm{up}}}, \]
then \(\rho_{V_{\mathrm{down}}}=\sigma_{V_{\mathrm{down}}}\). Any downstream channel \(K:V_{\mathrm{down}}\to Y\) therefore receives the same density operator from either model. Applying the same map to the same input gives the same output:
\[ K(\rho_{V_{\mathrm{down}}}) = K(\sigma_{V_{\mathrm{down}}}). \]
No later measurement can distinguish equal output states. This proves that equality of the exposed states is sufficient for replacement. The internal circuit parameters and the discarded system \(H\) do not enter the argument because neither is available to \(K\).
Trace distance shows both why equality is necessary and what happens when the states are only close. For density operators \(\rho\) and \(\sigma\), let
\[ D(\rho,\sigma)=\frac{1}{2}\lVert\rho-\sigma\rVert_1. \]
Trace distance can then be defined as:
\[ D(\rho_{V_{\mathrm{down}}},\sigma_{V_{\mathrm{down}}}) = \max_{0\le E\le I_{V_{\mathrm{down}}}} \left|\operatorname{Tr}\!\left[ E(\rho_{V_{\mathrm{down}}}-\sigma_{V_{\mathrm{down}}}) \right]\right|. \]
The maximum ranges over every possible POVM element \(E\) on \(V_{\mathrm{down}}\). It is the largest difference in probability that one measurement outcome can reveal between the two states. If \(\rho_{V_{\mathrm{down}}}\ne\sigma_{V_{\mathrm{down}}}\), then their trace distance is positive, so some measurement can distinguish them without further processing. The identity channel is itself an allowed downstream channel. Exact equality is therefore necessary when replacement must work for every possible downstream use.
A quantum channel cannot increase trace distance [1]:
\[ D(K(\rho_{V_{\mathrm{down}}}),K(\sigma_{V_{\mathrm{down}}})) \le D(\rho_{V_{\mathrm{down}}},\sigma_{V_{\mathrm{down}}}). \]
Now let \(0\le F\le I_Y\) represent any final measurement outcome on \(Y\). Its probability difference satisfies
\[ \left|\operatorname{Tr}[F K(\rho_{V_{\mathrm{down}}})]- \operatorname{Tr}[F K(\sigma_{V_{\mathrm{down}}})]\right| \le D(K(\rho_{V_{\mathrm{down}}}),K(\sigma_{V_{\mathrm{down}}})) \le D(\rho_{V_{\mathrm{down}}},\sigma_{V_{\mathrm{down}}}). \]
The first inequality says that no single measurement outcome can reveal a larger probability difference than the output trace distance. The second is the data-processing inequality: physical downstream processing cannot make two states more distinguishable. Together, the inequalities give the final probability bound. If \(D(\rho_{V_{\mathrm{down}}},\sigma_{V_{\mathrm{down}}})\le\varepsilon\) at the interface, every later measurement-probability difference is also at most \(\varepsilon\).
Why the boundary discards anything
A reader may reasonably ask why the upstream model produces four qubits and throws two away. Two qubits, both passed on, would be a simpler design.
A circuit with nothing to discard hands over a pure state. The ansatz is unitary, and a unitary maps a pure state to a pure state, so starting from \(|00\rangle\) and passing on both qubits gives an exposed state of purity exactly 1 every time. The only way to produce a mixed state on \(V_{\mathrm{up}}\) is to entangle it with something and then discard that something. That is what \(H\) is for.
Pure states are a small subset of the states a system can be in. A pure state of dimension \(d\) carries \(2d-2\) real parameters, a complex vector less its norm and its global phase, while a general state carries \(d^2-1\).
| exposed qubits | pure states | all states | pure as a fraction |
|---|---|---|---|
| 1 | 2 | 3 | 67% |
| 2 | 6 | 15 | 40% |
| 3 | 14 | 63 | 22% |
| 4 | 30 | 255 | 12% |
Table 1 shows the pure subset shrinking as the register grows. The criterion of Section 2 is stated for every state that can appear at the boundary. An experiment confined to pure interfaces would therefore test it only on the fraction in the last column, and that fraction falls as the register grows. The five states generated for the experiment of Section 3 have purities between 0.36 and 0.53, where 1 is pure and 0.25 is the most mixed a two-qubit state can be.
The second reason is stronger: on a pure interface the criterion carries no content beyond equality of state vectors. Two pure states with the same reduced state are the same state up to a global phase. On a pure interface, “the two models agree at the boundary” therefore collapses into “the two models produce the same state vector”, and the claim of Section 2 disappears.
That claim is that an upstream model need not reproduce another’s computation, only what crosses the wire. It requires many upstream states to share one exposed state, and the discard is what creates that freedom. Take any four-qubit state and apply a unitary to the two internal wires alone. The exposed state is unchanged, because the partial trace over \(H\) is invariant under any unitary on \(H\). The two four-qubit states need not resemble each other. Across 200 random draws of a state and an internal unitary, the exposed state was unchanged every time, while the overlap between the two four-qubit states had median 0.14, with four fifths of the draws between 0.03 and 0.34. An overlap of 0.14 leaves the two global states easy to distinguish by a measurement on all four qubits, yet they present one identical interface, and the downstream model cannot tell them apart because nothing distinguishing them ever crosses the boundary.
There is a plain practical argument as well. Any upstream model with ancillas, working registers, or uncomputed scratch qubits hands over a mixed state.
The discard has a cost, and it is the cost this article runs into later. A pure interface takes \(2d-2\) numbers to match and a mixed one takes \(d^2-1\). The scaling limit measured in Section 4 is a direct consequence of the interface being mixed. One property carries both consequences. The interface is mixed, which is what gives the criterion content beyond equality of state vectors and what raises the number of matched parameters from \(2d-2\) to \(d^2-1\). Section 4 measures that cost.
3. Experimental design
Shim was used to construct the parameterized circuit, simulate density operators, discard subsystems, apply downstream channels, and evaluate measurement probabilities. Every run uses exact state simulation, which isolates training behaviour from shot noise and hardware noise.
The two loss functions written out
Write \(\rho(\theta)\) for the exposed reduced state the circuit produces at parameters \(\theta\), and \(\tau\) for the generated state. The reduced-state loss is the squared Hilbert–Schmidt distance between them,
\[ L_{\mathrm{state}}(\theta)=\sum_{i,j}\bigl(\rho(\theta)_{ij}-\tau_{ij}\bigr)^{2}, \]
and the scalar loss is the squared error in one expectation value,
\[ L_{\mathrm{scalar}}(\theta)=\bigl(z(\theta)-z(\tau)\bigr)^{2}, \qquad z(\rho)=\operatorname{Tr}\!\left[(Z\otimes I)\,\rho\right]. \]
The generated value \(z(\tau)\) is calculated from \(\tau\) itself, so both losses aim at the same state and differ only in how much of it they compare. Written out in the computational basis, that expectation value is a sum over the diagonal:
\[ z=\rho_{00}+\rho_{11}-\rho_{22}-\rho_{33}. \]
Table 1 counts 15 free real parameters in a general two-qubit state. Ry and CNOT have real matrices, so every state in this experiment is real symmetric, and those form a 9-parameter subset of the 15. The scalar loss fixes one linear combination of four diagonal entries and leaves the other eight free; no off-diagonal entry appears in it at all. The reduced-state loss fixes all nine. The scalar loss is therefore not a coarser version of the reduced-state loss. It is a projection onto a single axis, blind to the other eight.
The four factors
Four factors are varied against that apparatus, listed in Table 2. Everything not named in a row is held at the value in the row above it.
| Factor | Levels | Register | Budget | Gradient |
|---|---|---|---|---|
| Loss function | Hilbert–Schmidt, squared trace distance, trace distance, scalar \(\langle Z_0\rangle\) | Narrow | 4,000 | Finite difference |
| Epoch budget | 4,000 and 40,000 epochs | Narrow | varied | Finite difference |
| Exposed width | 1, 2 and 3 of 6 qubits exposed | Wide | 40,000 | Exact |
| Measurement class | Whole exposed state against single-qubit marginals, each scored by three classes of measurement | Wide, 3 exposed | 40,000 | Exact |
Two acceptance criteria were fixed before any run. The largest pairwise trace distance under the reduced-state loss should be no greater than 0.01 for at least four of the five generated states, and the median ratio between the scalar-loss and reduced-state-loss maxima should exceed 10.
Counting the runs at the narrow register
The loss-function and budget factors both run on the narrow register with five generated states, two of the four loss levels, and six starts, which is \(5\times2\times6=60\) final exposed states. Each state and loss level gives fifteen pairs, so \(5\times2\times15=150\) pairs. The same 150 pairs carry the downstream-channel check below.
Generated state 0 shows the procedure end to end. Six reduced-state runs start from six different parameter settings, each adjusting twelve angles to reproduce one two-qubit density operator. The six final exposed states form fifteen pairs, and the largest trace distance among them is 0.00794. Six scalar-loss runs repeat the procedure against the generated value of \(\langle Z_0\rangle\) alone and give a fifteen-pair maximum of 0.458. Dividing the second by the first gives the ratio 57.7. The other four generated states follow the same procedure.
Checks on the apparatus
Three checks establish that the apparatus does what it claims. None of them reports a finding about the criterion.
The gradient is accurate. A rotation satisfies \(\mathrm{d}R_y(\theta)/\mathrm{d}\theta = R_y(\theta+\pi)/2\), so the exact derivative of the prepared state is the same circuit with one angle advanced by \(\pi\), and no step size enters. Repeating the narrow-register sweep with that gradient moves nothing: all thirty runs stop on the same epoch as the finite-difference runs, and the largest pairwise distance changes by \(5.1\times10^{-10}\).
The training metric tracks the evaluation metric. Training minimizes squared Hilbert–Schmidt distance while the evaluation reports trace distance. Dividing each run’s trace distance from its generated state by the square root of its final training loss gives a ratio that theory confines to \([1/2, 1]\) for a two-qubit system. Across the thirty runs it spans 0.777 to 0.997, a factor of 1.28, so the two metrics rank these runs alike.
The simulator respects the data-processing inequality. For each of the 150 pairs, the trace distance between the two exposed states was measured first. Both states then passed through the same downstream channel, and two quantities were checked: the trace distance between the channel outputs, and the difference between their final measurement probabilities. Neither quantity was ever larger than the original exposed-state trace distance, and the largest amount by which either exceeded that bound was zero at the precision stored in the result set. This confirms that the numerical results obey a theorem that holds for all quantum channels; it does not prove the theorem.
4. Results
The four factors are reported in turn. The first two vary the narrow register of Section 2; the last two vary the wide register, and a note marks where the change happens. Numbers from the two registers are not comparable.
Loss function
Four loss functions were trained against the same five generated states at the narrow register, with a 4,000-epoch budget.
| Loss function | Worst pairwise trace distance |
|---|---|
| Squared Hilbert–Schmidt distance | 0.0162 |
| Squared trace distance | 0.0530 |
| Trace distance | 0.1031 |
| Squared error in \(\langle Z_0\rangle\) | 0.7513 |
No alternative in Table 3 beat squared Hilbert–Schmidt distance on any of the five generated states. The first and last levels are the two the compositional claim contrasts, the whole exposed state against one expectation value read off it, and Table 4 gives those per generated state.
| Generated state | Reduced-state loss | Scalar loss | Ratio | Reduced-state threshold |
|---|---|---|---|---|
| 0 | 0.00794 | 0.458 | 57.7 | met |
| 1 | 0.00738 | 0.731 | 99.0 | met |
| 2 | 0.00462 | 0.746 | 161.6 | met |
| 3 | 0.01619 | 0.751 | 46.4 | not met |
| 4 | 0.00142 | 0.611 | 428.8 | met |
Section 2 defines trace distance as the largest probability difference any single measurement can reveal between two states. For generated state 0, the scalar-loss maximum of 0.458 means that two runs whose trained \(\langle Z_0\rangle\) values differ by less than \(2\times10^{-4}\) still produce exposed states that some measurement separates by a probability difference of 0.458. The reduced-state maximum holds that difference below 0.008. A quantum channel cannot increase trace distance, so each entry also bounds the probability difference available to any measurement made after the downstream model runs.
All thirty scalar-loss runs did fit their generated values. Their largest absolute error in exposed \(\langle Z_0\rangle\) was \(8.67\times10^{-5}\). The state variation is therefore present despite success on the trained quantity, not because those runs failed to learn it.
The scalar loss left large exposed-state variation for all five generated states, from 0.458 to 0.751 in trace distance. The reduced-state loss lowered that range to 0.00142–0.01619. The median ratio was 99.0, above the required factor of 10. Four of the five generated states met the 0.01 criterion; state 3 reached 0.01619.
Run length separates the two loss functions sharply. The thirty scalar-loss runs stopped between 7 and 111 epochs. The thirty reduced-state runs ran between 474 and 4,000, and thirteen reached the limit. A scalar run reaches its generated value within about a hundred epochs and stops, because a squared error at its minimum gives no further gradient. Whatever that single value does not fix about the exposed state is left as the initialization produced it. The reduced-state loss keeps a gradient until the entire density operator matches.
Training on the operational metric directly leaves the trained models further apart than the Hilbert–Schmidt surrogate does. This holds on each of the five generated states separately, and in the worst case over states it is a factor of 6.4 for plain trace distance and 3.3 for its square (Table 3). Plain trace distance is V-shaped at its minimum, so a fixed step size bounces there instead of settling, and all thirty of its runs reach the epoch limit. Squaring it restores the smooth shape the Hilbert–Schmidt loss has, which separates the metric from the shape. The squared form then stops sooner than Hilbert–Schmidt, at a median of 1,804 epochs against 3,384, and still lands three times further apart, so it is not short of budget. What makes it settle early and settle wrong is not established here. Trace distance is a sum of absolute eigenvalues, so it has corners exactly where the eigenvalues of the difference cross zero, which is exactly where the optimum sits, and a finite difference taken across a corner returns a poor gradient. Nothing here tests that explanation: no run varied the step size or measured the gradient error near the optimum. It is a conjecture, not a finding.
Among the reduced-state pairs, the largest trace distance between two channel outputs was 0.00741, and the largest difference between two final measurement probabilities was 0.00482.
Epoch budget
Thirteen reduced-state runs stopped at the 4,000-epoch limit, including three of the six runs on state 3 and both members of its worst pair. A run can stop at a limit for two reasons: it is still improving and runs out of budget, or it has flattened out and is going nowhere. All thirteen were still descending. The slowest fell at \(1.05\times10^{-9}\) per epoch, about a thousand times faster than the \(10^{-12}\) rate that would count as flat. None was stuck.
At 40,000 epochs, with nothing else changed, all five generated states meet the 0.01 criterion. State 3 falls from 0.01619 to 0.00543, and no run reaches the limit.
The gap between the two loss functions widens with budget rather than closing. The median ratio goes from 99 to 294, and the smallest across the five states from 46 to 138. A squared error sitting at its minimum leaves no gradient, so the scalar runs stop near a hundred epochs and ten times the budget buys them nothing. Only the reduced-state runs can spend it.
Exposed width
The remaining two factors move to the wide register: six qubits in three layers, eighteen parameters, five generated states from that same family, six starts, 40,000 epochs and the exact gradient. Their numbers are not comparable with Table 4.
Only the boundary moves. One, two or three of the six qubits are exposed and the rest are discarded. The exposed state carries \(4^n-1\) free real parameters at \(n\) exposed qubits, so 3, 15 and 63, while the circuit has eighteen throughout.
The worst pairwise distance climbs from 0.000175 at one exposed qubit through 0.00902 at two to 0.211 at three. No run at any width reaches the epoch limit, so none of this is budget. The two steps multiply the worst distance by 51.7 and then by 23.4, so the rise is spread across both added qubits rather than concentrated in one of them. It crosses the 0.01 criterion between two and three exposed qubits, which is where the exposed state first carries more free real parameters than the circuit has: 63 against 18, where at two exposed qubits it carried 15.
Two checks come with it. The three-qubit case reproduces a separate 40,000-epoch run exactly. The two-qubit case is the narrow-register setting with a larger discarded register, four internal wires rather than two, and the loss-function result above holds there.
The criterion itself is unaffected. What the boundary must preserve does not depend on whether an optimizer can reach it. What changes is the practical claim: this circuit and this optimizer meet the criterion while the exposed state carries fewer free real parameters than the circuit has, 3 and 15 against 18, and miss it when the exposed state carries 63.
Measurement class
The obvious economy is to match local marginals instead of the whole reduced state, for a weaker guarantee. At three exposed qubits that means matching nine numbers rather than sixty-three.
Models trained on the single-qubit marginals fit that objective: the worst final loss across thirty runs is \(8.95\times10^{-8}\), and no marginal run exhausts its budget. Every pair of trained models was then scored by three classes of measurement. The first measures one exposed wire and ignores the rest. The second measures all three wires, each in a chosen Pauli basis, and reads the joint outcome distribution; there are \(3^3=27\) such settings, and the best is reported. The third is trace distance, which by Section 2 is the best any measurement can do.
| Measurement class | Marginal-trained | State-trained |
|---|---|---|
| One exposed wire alone | 0.000343 | 0.108 |
| All three wires, one Pauli basis each | 0.655 | 0.129 |
| Any measurement at all | 0.751 | 0.211 |
The first row of Table 5 is the control, and it holds: the marginal objective is invisible to the class of measurement it was built from. The second row is the result. A product measurement applies no entangling gate between output wires: each wire is measured in its own Pauli basis and the joint outcome pattern is recorded. That is the native readout of a gate-based quantum processor rather than an added capability. It recovers 0.60 of the trace-distance separation at the median pair and 0.87 at the widest.
Table 5 reports runs at 40,000 epochs, where neither objective stops at the limit. A replicate at 4,000 epochs tests whether that budget decides the outcome. At the smaller budget the marginal runs still converge, between 103 and 1,160 epochs with none reaching the limit, while 16 of the 30 state runs are cut off. The state objective nonetheless leaves the trained models closer than the marginal objective on all five generated states, by a factor between 2.70 and 5.51 with a median of 3.59. The ordering therefore does not depend on the state objective having been given enough budget, because it holds in the regime where it demonstrably was not. The worst pair under each objective is the same at both budgets to the precision stored, although individual state runs continue past 4,000 epochs when allowed, the longest to 16,125.
The reason is that matching each qubit alone constrains nothing about how the qubits are correlated. Three classical bits make the same point without any quantum mechanics. Draw uniformly from \(\{000, 011, 101, 110\}\), the strings with an even number of ones. Draw uniformly from all eight strings. In both sources each bit alone is an unbiased coin, so a one-bit test cannot separate them. Look at all three bits and they are half a unit apart in total variation.
The same example warns against the obvious next step. In the even-parity source any two bits are also independent and unbiased, because the third bit is determined by them. So the two sources agree on every pair as well, and only the three-way correlation tells them apart. Matching every pair is a stronger criterion than matching every qubit alone, but it is not a criterion the same argument saves.
This could have gone the other way. There exist state pairs whose trace distance approaches 1 while the separation available to a restricted family of measurements approaches 0, which is the data-hiding regime studied by Matthews, Wehner and Winter [3]. Had the marginal-trained models landed there, a restricted boundary metric would have been a fair trade: weaker as a guarantee, yet indistinguishable in outcome for the measurements a downstream model would perform. They did not. Of the 0.751 trace distance the marginal objective leaves free, a product measurement already exposes 0.655.
5. Discussion
The results separate two claims that should stay distinct. The exposed reduced state defines what an upstream model must preserve in order to replace another. Whether a particular circuit and optimizer can preserve it is a separate, empirical question, and the answer depends on the budget and on how wide the boundary is. A threshold missed at one budget and met at ten times that budget says something about this optimizer. It says nothing about the criterion.
For someone building a modular quantum model, the practical content is an evaluation method rather than a result. Declare which quantum wires pass to the next model. Train the state carried by those wires, not a scalar read off it. Compare independent runs at that interface rather than reporting the best one. Verify that downstream processing respects the resulting bound. Each of those four steps is what one of the four factors above tests.
The cost of the method is the part to plan around. Matching a whole reduced density operator asks for \(4^n-1\) real numbers at \(n\) exposed qubits, and the width result marks where that count outgrows a fixed circuit. The cheaper alternative, matching each exposed qubit on its own at \(3n\) numbers instead of \(4^n-1\), fails against a product measurement, which needs no entangling gate between output wires. Any restricted boundary metric must be stated together with the class of downstream computations it is meant to support, and that class must be stated honestly.
7. Limits
Everything here is a deterministic exact-simulator study of one small circuit family. The states were constructed, not sampled from a broader population. The six initial parameter settings are likewise fixed by formula rather than drawn at random, so every reported spread is the spread across those six points and not an estimate of the spread across an initialization distribution. Nothing tests shot noise, device noise, or hardware compilation. Those remain the largest untested assumptions.
Two limits that a reader might expect do not apply. The choice of Hilbert–Schmidt distance for training is measured rather than assumed, and the finite-difference gradient is accurate enough that it does not constrain the result. Both checks are in Section 4.
The scaling limit is not closed, and it constrains the method rather than this run of it. This circuit and this optimizer stop meeting the criterion once the exposed subsystem carries more free real parameters than the circuit has. Whether adding circuit parameters moves that crossing point is untested here, because the natural way to add them is depth, and simulation cost grows as the square of the depth.
The width and measurement-class factors use a wider register than the other two, six qubits rather than four, so their numbers are not directly comparable with Table 4. Its two-exposed-qubit case is the closest bridge between them.
Single-qubit marginals are one restriction of the boundary metric, and their failure does not rule out others. Any family of measurements whose elements span the Hermitian operators on the system induces its own norm on states, and the trace norm is the case where every measurement is allowed [3]. Single-qubit marginals span only the weight-one part of that space and fail. The untested middle ground is to match every pair, or every group of \(k\), of exposed qubits, which grows polynomially where the whole state grows exponentially. Nothing here says whether that is enough, and the three-bit example of Section 4 shows that matching every pair does not settle the question either: two sources can agree on every pair and differ in the three-way correlation alone.
Any restricted boundary metric must still be stated together with the class of downstream computations it is meant to support. The measurement-class result adds that the class must be stated honestly. Single-qubit marginals support single-qubit readout and nothing beyond it, and that excludes product measurements, which need no entangling gate between output wires.
8. Conclusion
One part of this article is proved and the rest is measured. Keeping them apart is the point.
What is proved is the criterion. If an upstream model may feed any compatible downstream quantum channel, what it must preserve is the exposed reduced state. Two upstream models producing the same \(\rho_{V_{\mathrm{up}}}\) hand the downstream model the same \(\rho_{V_{\mathrm{down}}}\), so every downstream channel \(K\) produces the same output. The one-qubit counterexample shows that matching a single expectation value gives no such guarantee. Trace distance carries the approximate form, because no channel can increase it.
What is measured is whether a particular circuit and optimizer can reach that state, and four factors bound the answer.
The loss function decides how much of the boundary is constrained. Squared error in one expectation value fixes one of the nine free numbers in these states and leaves eight free, and the trained models scatter accordingly: a median factor of 99 further apart than under reduced-state training. Every scalar run fit its generated value, so this is not failed training.
The epoch budget decides whether the reduced-state loss converges. Four of five generated states met the 0.01 criterion at 4,000 epochs and all five at 40,000. Every run that stopped at a limit was still descending.
The exposed width decides whether the criterion remains learnable. Holding the circuit fixed and exposing one, two, then three qubits raises the worst pairwise distance from 0.000175 to 0.211, with no run out of budget. The exposed state carries 3, 15 and 63 free real parameters against the circuit’s 18, and training meets the criterion at 3 and 15 and misses it by more than twentyfold at 63.
The measurement class decides whether a cheaper criterion can stand in. It cannot, at least not this one. Models trained to agree on every single-qubit marginal are invisible to any single-qubit measurement and 0.655 apart under a product measurement that applies no entangling gate between output wires, against a ceiling of 0.751.
The criterion is unchanged by any of these. What they mark is the exposed width at which training to it stops meeting the threshold, and the smaller width at which the cheaper substitute already fails. Not established here: that reduced-state training converges or beats scalar training in every circuit family, and whether the middle ground between matching each qubit alone and matching the whole state is enough.
Reproducibility
The experiment source records the circuit, loss functions, and state generator. The result set has SHA-256 digest 743b210594b4044906cef71bc9812b0d7e31e47d6758528893511598d1ace9b8. The sweep check verifies its schema, configuration, pair summaries, thresholds, and digest. A second check verifies the scalar fit.
Each factor of Section 4 has its own result sets, each with its own check in the same directory.
| Experiment | Result set | SHA-256 |
|---|---|---|
| Descent at the epoch limit | reduced-state-descent-v1.json |
70dd660f… |
| The 40,000-epoch sweep | reduced-state-target-sweep-v2.json |
086bdb2c… |
| Four loss functions compared | reduced-state-objective-comparison-v1.json |
32d64a62… |
| Exact gradient against finite difference | reduced-state-analytic-sweep-v1.json |
d5e43322… |
| Widening the boundary | exposed-state-width-sweep-v1.json |
a966043c… |
| The wide-register budget control | exposed-state-wide-budget-v1.json |
c7cd40f9… |
| Three classes of measurement | exposed-restricted-measurement-v1.json |
b29e4ae7… |
| The measurement-class budget control | exposed-marginal-comparison-v1.json |
03a8c9b6… |
The wide-register budget control is the separate 40,000-epoch run that the three-qubit width case reproduces. The measurement-class budget control repeats that comparison at 4,000 epochs. The last result set stores the trained states themselves, so a different class of measurement can be scored against them without training anything again.
Every result figure is generated in this repository, beside the article. The script figures/plot_sweep_figures.py reads data/reduced-state-target-sweep-v1.json, a byte-for-byte copy of the first result set, checks its digest and schema, and writes Figure 6, Figure 7, Figure 5 and Figure 8. The script figures/plot_followup_figures.py does the same for Figure 9, Figure 10 and Figure 11. Both draw nothing if a digest does not match, so no figure here can disagree with the result set it cites. The copied files keep their original names and their internal field names, which use “target” where this article says “state”; renaming either would change the digest.
The research ledger stores the evidence graph. It includes executable proofs, citations, run outputs, superseded claims, and the hypothesis that all five generated states would meet the 0.01 criterion at 4,000 epochs, which they do not.
References
- S. T. Flammia and A. W. Harrow, “Counterexamples to Kalai’s Conjecture C,” arXiv:1204.3404 (2012). Used here for the trace-distance data-processing inequality for completely positive trace-preserving maps.
- E. D’Hondt and P. Panangaden, “Quantum Weakest Preconditions,” Mathematical Structures in Computer Science 16(3) (2006); arXiv:quant-ph/0501157.
- W. Matthews, S. Wehner and A. Winter, “Distinguishability of quantum states under restricted families of measurements with an application to quantum data hiding,” Communications in Mathematical Physics 291:813 (2009); arXiv:0810.2327. Every sufficiently rich set of measurements defines its own norm on states, and the trace norm is the case where every measurement is allowed. The boundary criterion of Section 2 is the top of that family, and Section 4 measures one of its weaker members with an optimizer attached.
- D. Amaro, C. Modica, M. Rosenkranz, M. Fiorentini, M. Benedetti and M. Lubasch, “Filtering variational quantum algorithms for combinatorial optimization,” Quantum Science and Technology (2022). Cited for the causal cone: only the qubits and gates that reach an observable affect its expectation value, and gates outside that cone cancel with their adjoints.
- M. Ying, Y. Feng, R. Duan and Z. Ji, “An Algebra of Quantum Processes,” arXiv:0707.0330 (2007). Adjacent work: a bisimulation distance between quantum processes that survives the process constructors. It measures super-operators in the diamond norm rather than two states at a declared cut, and its congruence makes bisimilarity sufficient for substitution rather than necessary, so it is not the criterion used here.