Engineering unsteerable quantum states with active feedback

We propose active steering protocols for quantum state preparation in quantum circuits where each system qubit is connected to a single detector qubit, employing a simple coupling selected from a small set of steering operators. The decision is made such that the expected cost-function gain in one time step is maximized. We apply these protocols to several many-qubit models. Our results are underlined by three remarkable insights. First, we show that the standard fidelity does not give a useful cost function; instead, successful steering is achieved by including local fidelity terms. Second, although the steering dynamics acts on each system qubit separately, entanglement in the generated target state is introduced, and can be tuned at will, by performing Bell measurements on detector qubit pairs after every time step. This implements a weak-measurement variant of entanglement swapping. Third, numerical simulations suggest that the active steering protocol can reach arbitrarily designated target states, including passively unsteerable states such as the $N$-qubit W state.


I. INTRODUCTION
Solving complex tasks by means of control and feedback circuits is of ubiquitous importance in the modern world.A famous example is the Apollo space mission where optimal control enabled a spaceship to smoothly land on the moon with vanishing target velocity.Can one design a similar strategy where one "steers" a quantum system at will towards a predesignated target state?In the quantum case, exerting "control" over the system requires the ability to perform quantum measurements while "feedback" may arise from unitary Hamiltonian dynamics and from measurement backaction [1,2].While the analogy to the classical case sounds appealing, quantum mechanics imposes several fundamental differences.In particular, the probabilistic outcome of quantum measurements implies that the state dynamics will resemble a random walk where quantum jumps can cause large state changes.The present work explores the potential of such approaches in the context of quantum state preparation for a system of N qubits.Our ideas may be tested in different platforms of current interest [3][4][5][6][7][8][9][10][11][12][13], including superconducting qubit arrays, trapped ion setups, photonic circuits, and ultracold atom lattices.
Quantum state preparation in general represents a complex challenge [1,2].One possible avenue is to employ deterministic schemes, without feedback from measurements over the course of the protocol.For sufficiently small N , applying a sequence of single-and twoqubit unitary gates (that is, a quantum circuit) is an option.However, with increasing N , a deterministic gate sequence leading from a given initial state |Ψ(0)⟩ to a predesignated and possibly highly entangled final target state |Ψ f ⟩ is generally difficult to identify and requires an exponential overhead of additional ancilla qubits [14].If |Ψ f ⟩ represents a non-degenerate ground state of a gapped local Hamiltonian, one can resort to analog quan-tum simulations and/or quantum annealing or cooling methods [15], where the corresponding Hamiltonian is implemented in a controlled and tunable way, e.g., using lattices of trapped ions or ultracold atoms weakly coupled to a thermal environment.For very low temperature, the quantum state then dynamically evolves towards the ground state |Ψ f ⟩.However, such approaches may become impractical if the Hamiltonian is gapless.Moreover, a certain class of states cannot be expressed as ground states of a "parent Hamiltonian," the latter being the sum of local Hamiltonians.Examples are exotic highly entangled N -qubit states such as the Green-Horne-Zeilinger (GHZ) state and the W state [1,16].Written in the standard basis defined by Pauli-Z operators (σ z |0⟩ = |0⟩ and σ z |1⟩ = −|1⟩ for the respective qubit), represent two state classes with different types of high multipartite entanglement for N > 2 qubits [16], where |GHZ⟩ (resp., |W⟩) is a superposition of two (resp., N ) product states.
In this work, we instead study measurement-based strategies where the protocol is designed to autonomously find a desired target state of arbitrary form.It is widely recognized that quantum measurements offer great freedom in shaping and controlling the dynamics of quantum many-body systems, far beyond the possibilities offered by the unitary Hamiltonian dynamics of closed systems or the dissipative dynamics of driven open systems [1,2,[17][18][19][20].For instance, the interplay of projective measurements of stochastically selected qubits with the unitary dynamics due to local two-qubit random gates causes nontrivial entanglement phase transitions in ran-dom quantum circuits, see Ref. [21] for a recent review.By allowing for projective measurements on detector qubits weakly coupled to the system qubits, weak measurement protocols can be designed for "steering" the system state |Ψ(t)⟩ towards a desired target state |Ψ f ⟩.As customary in the recent literature [22][23][24][25][26][27][28], we here use the term "steering" as a proxy for "guiding" (or "piloting" [29]) the system state by a sequence of measurement processes.We emphasize that this meaning is distinct from the notion of "quantum steering" in quantum information theory [30][31][32][33].In fact, we avoid the term "quantum steering" throughout.
One possibility is to employ passive steering, where measurement outcomes are simply discarded [22,25,[34][35][36].One may distinguish "blind passive" from "nonblind passive" steering, where in the latter case the measurement readout is used to stop the protocol if it corresponds to a "success" [28].However, the protocol is still passive since the steering operator is selected before the protocol started.Following Ref. [23], we refer to active steering only if a decision is made after each time step of the protocol.This decision depends on the history of previous measurement outcomes.For many-body systems, non-blind passive protocols with local systemdetector couplings are basically impossible since one cannot terminate the protocol based on the result of a single local measurement.While termination could be based on a long sequence of readouts, such a sequence may only be a probabilistic indicator of success.In addition, such approaches typically suffer from the postselection problem (exponentially small chance of success) [21].
Importantly, there are major obstacles which can prevent the success of passive steering.First, while a state may in principle be passively steerable, the required steering operators can be so complicated that they are not available for the hardware at hand.Second, more fundamentally, it is impossible to passively steer certain state classes by any set of local steering operators.This is the case if the state cannot be represented as a ground state of a non-frustrated parent Hamiltonian [37].The active steering protocols detailed in this work can overcome the no-go theorem of passive steering in Ref. [37] for two reasons: (i) In an active protocol, one follows the time evolution of the state and takes the decision (which steering operator is applied during the next time step) based on the history of previous measurement outcomes.(ii) Unlike with standard passive protocols, an important part of the state dynamics now comprises manipulations or measurements of the detector qubits.In our implementation, we introduce a weak-measurement variant of entanglement swapping (for details, see below).
It is worth emphasizing that previous applications of active decision making to the problem of steering, cf.Ref. [23], have only used sets of "passive" measurement operators, i.e., operators which allow one to passively steer the system at long times.The goal was to accelerate steering by properly choosing -based on the current system state -one of the available operators at each step of the protocol.In the present work, a much more challenging question is addressed and solved: Is it possible to actively steer the system using a set of local measurement operators that would never yield the desired target state without active decisions?
Important examples for passively unsteerable (by local1 steering) N -qubit states are given by the GHZ and W states, see Eq. (1).While tracing over a single qubit implies an only classically correlated reduced density matrix (RDM) for the remaining qubits for the GHZ state, the W state is more robust against entanglement loss.Highly entangled states such as those in Eq. ( 1) can be used as a resource [38], e.g., for increasing the sensitivity of quantum detectors [39][40][41].We note that the GHZ state is a stabilizer state which can be prepared by projective measurements of a set of commuting products of Pauli operators (stabilizers) augmented by Clifford operations or postselection if one measures "wrong" stabilizer eigenvalues [1,42].Previous measurement-based state preparation experiments, see, e.g., Refs.[43][44][45][46], have typically been limited to stabilizer states.Related ideas for preparing topologically ordered states in the large-N limit have been described in recent works [12,22,[47][48][49][50][51][52][53][54][55][56][57].However, the underlying strategies apply only in special cases where, for instance, all measurement operators commute with all unitary gates.
In this work, we show that passively unsteerable states, including non-stabilizer states such as the W state, can be prepared by active steering protocols using only a limited, and usually available, set of simple steering operators.Even if |Ψ f ⟩ is passively steerable, active steering will usually result in significantly faster protocols.In general, active steering protocols involve decision making strategies where (a part of) the history of measurement outcomes is taken into account in the subsequent time evolution [5,23,24,[58][59][60][61][62][63][64].In our protocol, we consider N system qubits each of which is allowed to couple only to its own detector qubit partner, see Fig. 1(a) for a schematic illustration.The respective system-detector coupling ("steering operator") is chosen from a small set of Pauli operators, where the choice is determined by an active decision making strategy.We emphasize that direct couplings between system qubits are not needed and only a single steering operator (not superpositions thereof) is applied during a given time step of duration δt.One cycle then corresponds to a sequence of the following operations, see Fig. 1  1.One prepares the detector qubits in a simple product state.
2. The chosen steering operators (see below for our active decision making policy) are switched on and unitary time evolution sets in.
3. After the time δt has elapsed, the steering operators are switched off again.One now performs projective Bell measurements on neighboring detector qubit pairs.The measurement outcomes are used for selecting the steering operators in the next cycle.
Since steering operators associated with different system qubits commute by construction, and measurement operators for distinct (non-overlapping) qubit pairs commute as well, one can simultaneously steer [N/2] pairs in a given time step, cf.(a) Schematic illustration of entanglement generation during one time step of the protocol.We use a weak-measurement variant of entanglement swapping [65][66][67][68][69][70][71][72], where one steers the neighboring system qubits (n, n + 1) indicated by squares.Circles depict the corresponding detector qubits as in The above Bell measurements realize weak measurements on the system qubits and provide an efficient way to systematically generate entanglement in |Ψ⟩ by means of a weak-measurement version of entanglement swapping [65][66][67][68][69][70][71][72], where entanglement is incrementally teleported from the detector qubits to the system qubits.(We simply refer to "entanglement swapping" in what follows.)We illustrate the basic mechanism in Fig. 2, where |σ n,n+1 ⟩ (|σ n,n+1 ⟩ d ) with σ = 0, 1 refer to basis states of the respective system (detector) qubits n and n + 1.In panels (a)-(c), we consider the first cycle of the protocol, starting at the initial time t = 0: (a) One starts from the simple product state (b) Switching on the selected steering operators during a time step of duration δt, each system and detector qubit pair are entangled by the unitary time evolution.(c) The subsequent projective Bell measurement of the detector qubits then disentangles the system and detector qubits but at the same time generates entanglement among the system qubits by means of entanglement swapping.We provide a detailed discussion of this step in Appendix A. Next, in panels (d)-(f) we illustrate what happens during the next cycles of the protocol: (d) As a result of the last step, some entanglement may now be present in the system state |Ψ(δt)⟩, before one applies the steering operators for the next step.(e) After the unitary time step, each system-detector qubit pair becomes entangled.(f) One performs again a Bell measurement, which typically increases the entanglement in the resulting state |Ψ(2δt)⟩.Finally, we provide a quantum circuit representation of this entanglement swapping protocol [1] in Fig. 2(g).A detailed discussion of our entanglement swapping protocol can be found in Sec.II A and in Appendix A.
We emphasize that the re-initialization of detector qubits after the measurements is possible in our scheme, see also Refs.[13,28].Without such a property, the number of detector qubits would proliferate for large circuit depth.Moreover, since the implementation of such measurements only requires two-qubit interactions, we expect that entanglement swapping is easier to realize experimentally than, for instance, the generation of entanglement through measurements done on single detector qubits coupled to two or more system qubits.In fact, one can show that in the latter setup, with a fixed set of Pauli steering operators, it is not possible to reach arbitrary target states |Ψ f ⟩, not even for N = 2.We provide a discussion of this point in Appendix B. As shown below, entanglement swapping does not suffer from this problem.Measuring a pair of qubits in their Bell basis also is a standard procedure in many platforms of current interest.More generally, we find that an arbitrary state obtainable by consecutively entangling pairs of qubits, say, by applying two-qubit gates, can also be engineered by means of active steering based on entanglement swapping.In principle, this includes highly entangled states with volume-law growth of the entanglement entropy.
In order to make progress, we consider an idealized situation free from external noise or other imperfections [25].In particular, we assume that the parameters characterizing allowed steering operators are known from prior calibration runs.If the initial pure state |Ψ(0)⟩ (e.g., an easily accessible product state) and the measurement outcomes are known, one can then track the state trajectory |Ψ(t)⟩ at later times t = mδt (integer m) by a classical calculation.(For a given measurement record, |Ψ(t)⟩ always remains pure.By averaging over measurement outcomes, one may obtain a mixed state.) For moderate values of N , those assumptions may be justified to reasonable accuracy on time scales below the respective qubit dephasing time.This case is also of practical interest if parts of the system can be steered locally and the whole system is then composed of small-N blocks, see Ref. [57] for related work.A different perspective is to run our protocol on a fault-tolerant circuit with quantum error correction [1,42,[73][74][75][76][77][78][79][80], where all system and detector qubits are encoded logical qubits.Errors related to external noise can thereby be detected and actively corrected.We note that recent experimental works managed to beat the break-even point for fault tolerance of a logical qubit [81,82].In Sec.IV C, potential extensions of our protocol to noisy quantum circuits will be discussed, see also Ref. [25].While we show numerical simulation results based on the present formulation of our active steering protocol only for N ≤ 6 system qubits in Sec.III, we expect that large values of N can be reached using closely related protocols, see Sec.IV B. Our work represents a proof of concept that active steering protocols can reach passively unsteerable target states.
A central element of our approach is active feedback: based on the measurement outcomes recorded after a given time step, the steering operators used in the next time step are determined by optimizing a non-negative cost function C(t).Convergence, i.e., |Ψ⟩ = e iγ |Ψ f ⟩ with arbitrary global phase γ, is reached only for C = 0, such that one has to minimize C(t).In practice, for each steering parameter configuration K, we compute the expected cost function change in the next time step, where the overbar indicates an average over measurement outcomes.The steering operator K is then chosen to maximize the cost function gain |dC(K)| with dC(K) ≤ 0. For a proper cost function, and assuming a sufficiently large ("universal") steering operator set, dC(K) < 0 is required for at least one K unless one has already reached convergence.An obvious cost function candidate is related to the fidelity F [1], However, Eq. ( 3) is not sufficient for our active steering protocol.For instance, consider steering from Flipping single (or a few) qubits, |0⟩ → |1⟩, evidently brings one closer to the target state yet the resulting state remains orthogonal, F = 0, unless one flips all N qubits simultaneously.In essence, we encounter a situation reminiscent of Anderson's orthogonality catastrophe [83] with similarities to the barren plateau problem in machine learning [84].In any case, when using Eq.(3) as cost function, active steering will generally fail.This failure already affects the minimal case N = 2, see Sec.II C for details, and becomes more severe with increasing N .We show below that by incorporating "local" fidelity cost function terms, this problem can fortunately be resolved.("Locality" is here meant in the sense of operator locality.)For all possible RDMs for r < N qubits built from |Ψ(t)⟩, those terms minimize a suitable operator distance measure between the RDM and the respective RDM constructed from |Ψ f ⟩.We address convergence properties of the resulting active steering protocols in Sec.II D. The structure of the remainder of this paper is as follows.In Sec.II, we discuss the detailed quantum state dynamics of the actively monitored circuit described above.In Sec.III, we present numerical simulation results to illustrate the performance of the active steering protocol.We then discuss implementation aspects and summarize possible perspectives for future work in Sec.IV.Technical details can be found in the Appendix.Throughout, we use units with ℏ = 1.

II. ACTIVE STEERING PROTOCOL
We now turn to a quantitative description of the active steering protocol.The measurement-conditioned dynamics of the quantum circuit in Fig. 1 is analyzed in detail in Sec.II A. For concreteness, we study a chain of N system qubits with periodic boundary conditions, where each system qubit can be coupled to an detector qubit.However, our protocol can easily be adapted to other circuit geometries.In Sec.II B, we summarize the Bloch tensor state representation which considerably simplifies the subsequent steps.We proceed with an analysis of the active decision making strategy in Sec.II C, which crucially depends on the construction of a cost function employed in the optimization process.Utilization of a global fidelity cost function introduces "weak values" [85] into the ensuing stochastic evolution equation.Using these weak values, we show that successful active steering is only possible if local fidelity terms are added to the cost function.Finally, we discuss convergence aspects in Sec.II D. Additional details can be found in Appendix C.

A. Stochastic Schrödinger equation
In what follows, system qubits are described by the operators σ µ n , where n = 1, . . ., N labels the qubits, µ = 0 corresponds to the identity, and for µ = α ∈ {1, 2, 3} = {x, y, z}, we have standard Pauli matrices.Similarly, detector qubits correspond to the operators τ µ n .For clarity, we assume below that all states of the uncoupled system qubits and, separately, all states of the detector qubits are degenerate, assigning to them zero energy.In other words, we assume no intrinsic Hamiltonian of the system and detector qubits.During a unitary time evolution step, a steering operator H n,Kn can couple the system qubit σ n with the corresponding detector qubit τ n , where K n is chosen from a set of allowed steering parameters.We here consider Pauli steering operators, Let us now consider a specific nearest-neighbor qubit pair (n, n + 1) as illustrated in Fig. 2. Before each unitary time evolution step, the corresponding detector qubits are initialized in a simple product state, say, |00⟩ d .(The index d distinguishes the detector Hilbert space from system space.)Subsequently, the steering operator H K = H n,Kn + H n+1,Kn+1 is switched on for suitably chosen steering parameters K = (K n , K n+1 ), and unitary time evolution of the full system sets in.After the time step δt with J n/n+1 δt ≪ 1, the steering operator H K is switched off again, and one projectively measures the detector pair in its Bell basis [1], where symmetric (η = +1) and antisymmetric (η = −1) Bell states have either even (ξ = 0) or odd (ξ = 1) parity.
Here "symmetry" refers to the behavior of the state under exchange of the two qubits, while even (odd) "parity" means that it is built from the basis states Since the initial state |00⟩ d obviously has even parity, we refer to measurement outcomes with ξ = 1 as "quantum jumps".By means of entanglement swapping [65][66][67][68][69][70][71][72], see Fig. 2 and Appendix A, one can then generate entanglement in the system state |Ψ⟩, where the binary stochastic variables ξ and η encode the measurement outcomes.Their probabilistic nature is a fundamental consequence of quantum mechanics.We emphasize that the above Bell measurements are local in the sense that only nearest-neighbor detector pairs are probed.In practice, they can be implemented by simultaneously measuring two commuting Pauli operators for detector qubit pairs [1], Indeed, one easily checks that A projective measurement of the Bell state |Φ ξ,η ⟩ d thus implies that one measures the eigenvalues for the observables in Eq. ( 6).Finally, we note that for the quantum circuit in Fig. 2(g), in the computational basis of the two detector qubits, the measurement has the possible outcomes | 1−η 2 , ξ⟩ d .For measurement outcome (ξ, η) after a completed time step, the state of the full system is given by |Ψ(t + δt)⟩ ⊗ |Φ ξ,η ⟩ d , where the system state |Ψ(t + δt)⟩ depends on (ξ, η) because of entanglement swapping, see Fig. 2 and Appendix A. In our protocol, since direct couplings between system qubits are absent, entanglement is solely generated (or removed) through the above Bell measurements.Upon re-initializing the detector pair, the full state is prepared for the next time step as |Ψ(t + δt)⟩ ⊗ |00⟩ d .Since all measurement operators Ôx,z for non-overlapping pairs commute, and also the corresponding steering operators H K commute, one can simultaneously steer and measure [N/2] distinct pairs in one time step.For instance, for N = 4 qubits, we could steer the qubit pairs (1, 2) and (3,4) in the first cycle, and then the pairs (2, 3) and (4, 1) in the second cycle.We do not allow for next-nearest-neighbor couplings within our notion of locality, i.e., only adjacent detector qubit pairs are subject to Bell measurements.Hence direct pairsteering of (1, 3) and (2,4) is not taken into account.In general, for subsequent time steps, one can choose either a random pattern or an alternating pattern of measurement pairs; the latter case is shown in Fig. 1(b).We find that a randomized pair assignment gives slightly superior convergence properties, but both schemes work well in practice.
Given the above remarks, it suffices to analyze the state change in one time step when steering and measuring only a single pair (n, n + 1).For the measurement outcome (ξ, η), the state |Ψ(t + δt)⟩ after the measurement is given by [1,2,17] with the Kraus operators A ξ,η = d ⟨Φ ξ,η |e −iδtH K |00⟩ d and the outcome probabilities In the weak-measurement limit [2], the couplings J n and the time step δt are adjusted such that the rates are effectively independent of δt and satisfy J n δt = √ Γ n δt ≪ 1.We assume this limit throughout.
Expanding the Kraus operators to lowest nontrivial order in δt, we then obtain where the effective Hamiltonian H η and the jump operators c η act on the system Hilbert space.These quantities apply to a given time step and for the chosen qubit pair (n, n + 1).We note that H η only appears in Eq. ( 11) if one measures the same (even, ξ = 0) parity of |Φ ξ,η ⟩ d as for the initial detector state |00⟩ d .With the Kronecker symbol δ β,α (α = x, y, z), we obtain where the term ∝ η arises from a Lamb shift contribution.
In addition, for β m ̸ = z, quantum jumps -transitions from |00⟩ d into the odd-parity sector signaled by ξ = 1 -are possible, with the respective jump rates given by Eq. (10).With the compact notation the jump operators take the form (η = ±) From Eq. ( 11), the outcome probabilities ( 9) can be written as From Eq. ( 14), we obtain with the correlation function The average of the binary quantum jump variable ξ ∈ {0, 1} then has a state-independent form, Since ξ ∝ δt, terms ∝ ξδt are beyond the accuracy of the lowest-order expansion in δt and will be neglected throughout.However, the identity ξ 2 = ξ implies that terms involving products of ξ are of order δt and must be retained [2,17].From Eqs. ( 8) and ( 11), we find that the state change after one time step, |dΨ⟩ = |Ψ(t + δt)⟩ − |Ψ(t)⟩, follows from a jump-type nonlinear stochastic Schrödinger equation [2,17,86,87], Unless noted otherwise, we assume an easily accessible pure product initial state, say, |Ψ(0)⟩ = |00 • • • 0⟩.For given measurement record, the state |Ψ(t)⟩ then always remains pure and follows from Eq. ( 19).Depending on the choice of the steering operators, the quantum state dynamics in Eq. ( 19) includes single-and two-qubit unitary Hamiltonian terms (from H η ), single-qubit Pauli gates (due to quantum jumps for ξ = 1), and two-qubit unitary terms (from the last term which represents state diffusion [17]).In principle, given the set of steering operators in Eq. ( 4) which in turn determine the jump operators c η and the Hamiltonian H η , all operations needed for accessing a target state of arbitrary form are therefore contained in Eq. ( 19) [1,[88][89][90].We discuss convergence properties of our protocol in Sec.II D.
Averaging Eq. ( 20) over measurement outcomes using the probabilities (15) will usually result in a mixed state.The averaged state change, dρ = ξ,η dρ ξ,η P ξ,η with dρ ξ,η in Eq. ( 20), is governed by a Lindblad master equation [2,86], with L[σ αm m ]ρ = σ αm m ρσ αm m − ρ.Equation ( 21) corresponds to the time evolution under a blind steering protocol, where measurement outcomes are simply discarded.Since only uncorrelated contributions from qubits n and n + 1 appear in Eq. ( 21), the averaged state dynamics by itself is not capable of detecting entanglement structures built up in measurement-conditioned state trajectories.

B. Bloch tensor representation
Given the Pauli form of the steering operators (4), it is convenient to employ the rank-N Bloch tensor R S for representing states.(In quantum information theory, R S is usually referred to as N -qubit Bloch vector.)To that end, we first define Pauli string operators of length N , (We synonymously use the notations µ j = x, y, z and µ j = 1, 2, 3.) An arbitrary N -qubit state ρ can be written in the form where the 4 N Bloch tensor coefficients R S = R µ1,...,µ N are real-valued (because of ρ = ρ † ) and satisfy R 0,...,0 = 1 (because of state normalization).Using a standard tensor product representation in the computational basis (σ j = 0, 1), a pure state is parametrized by 2 N complex numbers C σ1,...,σ N subject to normalization, where the Bloch tensor follows as For instance, for The stochastic master equation (20) then determines the measurement-conditioned change of the Bloch tensor in one time step, see Eq. (C1) for an explicit expression.Averaging over measurement outcomes, the Lindbladian form of Eq. ( 21) gives with the standard Levi-Civita symbol ε.By taking a partial trace over the Hilbert space pertaining to one (or several) qubits, one obtains the RDM describing the state of the remaining qubits [1,48].In many cases, this state is mixed.For the RDM ρ  22) but keeping only operators σ µj j with j ∈ M, i.e., operators for traced-out qubits are left out when constructing the length-r string operator S M from the original length-N string operator S. Since Pauli matrices are traceless, Eq. ( 23) then yields where the rank-r Bloch tensor R (r) S M follows from the Bloch tensor R S for the pure state ρ = |Ψ⟩⟨Ψ| by simply putting µ j = 0 for all traced-out qubits (j ∈ M c ).

C. Active feedback and cost function
We next discuss the active decision making part of the protocol, where the steering parameters K = (K n , K n+1 ) used in the next time step are selected.In our protocol, this decision is based on optimizing the expected (i.e., averaged over measurement outcomes) change of a cost function, dC(K), with respect to the steering parameters, see Eq. ( 2).If several K form a set with the same optimal average cost function gain, we choose K according to a uniform random distribution from this set.
We note in passing that interesting variants of our protocol could be based on other strategies.For instance, one could optimize an entanglement measure such as the entanglement entropy in order to steer states towards a class of highly entangled target states.Grouping N qubits into two subsets A and B, and defining the RDM ρ A = Tr B ρ(t), the entanglement entropy is given by [1]

S(t) = −Tr
The measurement-conditioned change, dS = S(t + δt) − S(t) = −Tr A (dρ A ln ρ A ), then has a nonlinear dependence on ρ.While the use of entanglement measures for active feedback protocols is beyond the scope of this work, we show results for S(t) in Sec.III in order to illustrate how entanglement is generated (or removed) in the active steering process.
For state preparation, one cost function candidate is the fidelity-based cost function C N = 1 − Tr(ρρ f ) in Eq. ( 3).For a given steering parameter choice K, the expected cost function change is given by with dρ in Eq. ( 21) and dR S in Eq. ( 27).Interestingly, the same quantity can equivalently be expressed in terms of weak values [85].

Weak Value representation
The weak value representation of Eq. ( 30) follows by writing dC N (K) = −⟨Ψ f |dρ|Ψ f ⟩ and using Eq. ( 21).Assuming that the time-evolving state |Ψ⟩ is not orthogonal to the target state |Ψ f ⟩ (i.e., C N < 1), we find with complex-valued weak values [85] pertaining to single-qubit Pauli operators, If the target state has been reached, |Ψ⟩ = e iγ |Ψ f ⟩, all W m,αm are real-valued (because σ αm m is Hermitian) and satisfy |W m,αm | ≤ 1. Evidently, Eq. ( 31) then tells us that one cannot find steering parameters that could further improve the average cost function, precisely as expected at convergence.If convergence has not yet been reached, however, successful steering requires that at least one steering configuration K exists such that the cost function can still be improved on average, dC N (K) < 0. According to Eq. ( 31), if Im(W m,αm ) ̸ = 0 holds for at least one choice of (m, α m ), one can satisfy dC N (K) < 0 for the global fidelity cost function by choosing β m = z and s m = sgn[Im(W m,αm )].Since for nearly orthogonal states |Ψ⟩ and |Ψ f ⟩, weak value matrix elements tend to be large ("weak value amplification" [85]), Eq. ( 31) suggests that a particularly large improvement of the cost function can arise in this case.
However, it may happen that all possible weak values in Eq. ( 32) are real-valued with |W m,αm | ≤ 1 before convergence has been reached, i.e., for C N > 0. Equation (31) then predicts dC N (K) ≥ 0 for all possible K, and the state trajectory gets stuck in a state where the average cost function cannot be lowered anymore by any steering operator.In what follows, we refer to such states as "trapped states."Active steering protocols based on the global fidelity cost function C N then encounter a prohibitive roadblock.Remarkably, trapped states are abundant already for just N = 2 qubits, and they tend to proliferate with increasing N .For instance, consider a specific N = 2 Bell target state where we can easily show that |Ψ⟩ = |00⟩ is a trapped state.Indeed, for this example, we find C 2 = 1/2 and the weak values (32) are given by W m,αm = δ αm,z .Hence Eq. ( 31) implies dC 2 (K) ≥ 0 for all K.
In general, trapped states form a manifold in Hilbert space whose dimensionality depends on the target state.Let us briefly illustrate this point for a two-parameter class of even-parity target states for N = 2, with real parameters u ∈ [0, 1] and θ ∈ [0, 2π).Computing the weak values in Eq. ( 32), we find from Eq. ( 31) that for u ̸ = 1 √ 2 , the states with arbitrary v ∈ [0, 1] span a one-dimensional trappedstate manifold.For u = 1 √ 2 , the dimensionality of the manifold can further increase because trapped states may now also receive contributions from the odd-parity sector.
We conclude that the weak values in Eq. ( 32), evaluated along the time-evolving state trajectory, can provide useful hints about steering protocols.In particular, they are able to diagnose trapped-state manifolds which arise when all accessible weak values are real-valued with |W m,αm | ≤ 1.
We note that there is another mechanism which can also invalidate active steering based on the global fidelity cost function.This mechanism arises from the orthogonality catastrophe problem discussed in Sec.I.In fact, for orthogonal states |Ψ⟩ and |Ψ f ⟩, the weak value matrix elements in Eq. ( 32) are ill-defined.However, dC N (K) in Eq. ( 31) can then be written in the form If all matrix elements ⟨Ψ f |σ αm m |Ψ⟩ of single Pauli operators vanish, we have dC N (K) = 0 and the steering protocol gets stuck, i.e., |Ψ⟩ is a trapped state.This case is typically encountered for orthogonal many-qubit states.
The above discussion shows that the averaged fidelitybased cost function ( 3) is not able to guarantee the success of active steering protocols because of the presence of trapped states.Such states are either diagnosed by weak values or arise because of the orthogonality catastrophe problem.In addition, the separation of dC N (K) into single-qubit weak values, see Eq. ( 31), indicates that entanglement structures are not captured.This separation is a consequence of the linearity of C N in ρ and of the uncorrelated Lindblad dynamics of dρ in Eq. ( 21).We will now describe how one can resolve this apparent roadblock.

Local cost function terms
In order to enable successful steering under protocols with active feedback, we next include local fidelity contributions in the cost function.To that end, we introduce basis-independent terms which enforce that all RDMs formed from the state ρ(t) will approach the respective RDMs for ρ f .This strategy is able to resolve the trapped-state problem.
To that end, let us define a local cost function term, C r (t), for r-qubit RDMs with r < N .This term includes contributions from all ordered subsets M which can be constructed for r qubits, see Sec.II B. The number of such subsets is given by a binomial coefficient, . Using the squared Frobenius norm (aka relative purity) [1] to quantify the distance between the RDM and the corresponding target RDM, we arrive at This cost function penalizes r-qubit RDMs which deviate from the respective r-qubit RDM of the target state.We observe that for r = N , Eq. ( 37) reduces to C N (t) in Eq. ( 3).Using the Bloch tensor representation (28), we obtain where we recall that the Bloch tensors R S M (t) for RDMs follow from the Bloch tensor R S (t) for the pure state ρ(t) = |Ψ(t)⟩⟨Ψ(t)| by setting µ j = 0 for all traced-out qubits, see Sec.II B. Given the time-evolving Bloch tensor R S (t), it is then straightforward to determine the cost functions C r (t).It is worth mentioning that one could employ other distance measures instead of the squared Frobenius norm in Eq. ( 37), e.g., the max norm, the trace norm, or a Schatten p-norm [92].However, we expect that the corresponding active steering protocols perform with similar efficiency.
Importantly, all cost function terms C r (t) with r = 1, . . ., N are non-negative and simultaneously minimized by C r = 0 when the time-evolving state converges to the target state.This scenario is reminiscent of the parent Hamiltonian construction in Ref. [37], where passive steerability of a state was shown to be equivalent to the simultaneous minimization of all local contributions of a parent Hamiltonian.However, our cost-function based approach is more general and does not suffer from the restrictions on steerability discussed in Ref. [37].
We here employ the weighted-sum method [93], that is, we use a single cost function C(t) which takes into account the r-qubit contribution C r (t) with probability weight p r , This function is minimized, with C = 0, by the converged state, |Ψ⟩ = e iγ |Ψ f ⟩.The expected cost function change in one time step, dC(K) = r p r dC r (K), see Eq. ( 2), then follows from S M follows from Eq. ( 27).We note that for r = N , Eq. ( 40) reduces to Eq. (30).The term dR (r) 2 S M is due to the nonlinear state dependence of the cost functions in Eq. (37).We provide its explicit form in Eq. (C5).In fact, dC r<N (K) has a nonlinear dependence on dρ because Tr(ρ (r) 2 M ) ≤ 1 is possible for RDMs.(For a pure state, Tr(ρ 2 ) = 1 instead implies that the cost function change is linear in dρ.) Thanks to this nonlinearity, the disentangling character of the averaged Lindblad dynamics in Eq. ( 31) can be avoided.
In practice, the efficiency of the active steering protocol depends on the choice of the probability weights p r in Eq. ( 39) [93].Unfortunately, we have not found a simple strategy for determining the optimal weights.Our heuristic choices are described in Sec.III, but future work may be able to achieve a better understanding of this important issue.

D. Convergence properties
We here address the convergence properties of the protocol discussed above.Even though we do not have a mathematically rigorous proof valid for arbitrary number N of system qubits, the numerical simulation results for N ≤ 6 in Sec.III suggest that the protocol does converge for general N .In fact, in our simulations, we never encountered a case where a predesignated target state was out of reach.In addition, the arguments in Sec.II A suggest that the scheme does converge since one can in principle realize arbitrary sequences of single-and two-qubit gates.In this section, for the case N = 2, we provide analytical arguments indicating that our active steering protocol converges to a predesignated target state of arbitrary form.For the Bell state, these arguments are rigorous.The results below also illustrate how the inclusion of local cost functions resolves the trapped-states problem.
For N = 2, it suffices to take into account only steering operators with β ∈ {x, z} in Eq. ( 4).We use the Bloch vectors R 1,2 , with components R α 1 = R α,0 and R α 2 = R 0,α , see Sec.II B, in order to parameterize the timeevolving system state.Similarly, R f 1,2 with components R α f m describes the target state.The average local cost function change (40) for N = 2 can be written as where we used Q α1,α2 1,2 = R α1,α2 , see Eq. (17).Instead of the weak value representation (31), it is here more convenient to express the average global fidelity change dC 2 in terms of Bloch tensors as well.From Eqs. (30) and (27), we then obtain the equivalent representation For given m ∈ {1, 2} and α ′ ∈ {x, y, z}, the vector S m;α ′ is here defined by the components S α m=1;α ′ = R α,α ′ and With the probability weight p 1 in Eq. ( 39), the average total cost function change follows as dC = p 1 dC 1 + (1 − p 1 )dC 2 .
Let us first study |Ψ f ⟩ = |Bell⟩ as target state, see Eq. (33), where the Bloch vectors vanish, R f 1,2 = 0. (Analogous arguments can be given for the other Bell states.)For p 1 = 0 in Eq. ( 39), i.e., without the local fidelity term, a subclass of trapped states is then given by Eq. ( 35) with θ = 0.This class is parametrized by 0 Importantly, it is always possible to identify at least one steering operator such that dC 1 < 0 for these states.As a consequence, the active steering protocol will converge to the Bell state by allowing for a finite weight p 1 > 0. To see this, we note that R f 1,2 = 0 implies that only the X α1,α2 -term in Eq. ( 41) can contribute to dC 1 .Accordingly, one has to choose β 1 = β 2 = x, where we can specify at least one steering parameter set (α 1 , α 2 ) such that X α1,α2 > 0. Indeed, for the states in Eq. ( 35), we find R αm m = (2v 2 − 1)δ αm,z and R α1,α2 = δ α1,α2 Qα1 , with Qx = − Qy = 2v √ 1 − v 2 and Qz = 1.From Eq. ( 41), we thus obtain X α1,α2 = 0 for α 1 = z or α 2 = z, but X α,α = (2v 2 − 1) 4 for α ̸ = z and X x,y = X y,x = (2v 2 − 1) 2 .One can therefore always lower the total cost function (39) until convergence has been achieved.This convergence proof for the Bell state also illustrates how the inclusion of local cost functions resolves the trapped-states problem and thereby allows for successful active steering.
We observe numerically that the protocol also converges to a predesignated target state |Ψ f ⟩ of arbitrary form, with non-vanishing Bloch vectors R f m .In order to rationalize this observation, we first observe that the terms ∼ s m J m in Eqs.(41) and (42) imply that one can always lower the cost function by choosing β m = z and a suitable sign s m unless the Bloch vectors R m are parallel (or antiparallel) to R f m , respectively.Similarly, the cost function in Eq. ( 42) can be lowered by β m = z terms until the vectors S α ≡ S 2;α satisfy the relations α S α × S f α = 0 (43) and (for all pairs α < α ′ ) In addition, purity of the state, i.e., Tr(ρ where we write R m = a m R f m .We can express the solution to Eqs. ( 43) and (44) as where the real coefficients (b f , b × , b xy , b xz , b yz ) must satisfy Eq. ( 44) and S α has to be of pure-state form [91].We then examine the effects of β m = x steering operators.From the terms aside the X-term in Eq. ( 41), convergence requires a m ≥ 0 and for α ∈ {x, y, z} the relations The X-term is important since it is the only term coupling the Bloch vectors and the vectors S α .A sufficient condition for successful steering arises if the only solution for the above relations is given by a m = 1 and b The requirement that S α must be of the pure-state form (46), together with all the above restrictions, suggests that there is essentially no freedom for other solutions besides S α = S f α .While the above argument is not a convergence proof, it gives further evidence for the fact that our steering protocol does converge for all possible N = 2 target states.

III. SIMULATION RESULTS
In order to test the active steering protocol introduced above, we have performed numerical simulations of the stochastic Schrödinger equation (19).We provide general remarks on our numerical approach in Sec.III A, followed by a presentation of numerical results for the simplest case N = 2 in Sec.III B. We here mainly focus on the Bell state in Eq. (33).In Sec.III C, we turn to the highly entangled GHZ and W states for N qubits in Eq. (1).We begin with the case N = 3, and then turn to larger values of N .

A. General remarks
All cost function terms in Eq. ( 39) as well as the expectation values for the corresponding changes in Eq. ( 40) can be computed from the time-evolving Bloch tensor R S (t) which in turn follows from Eq. ( 25).For every time step, [N/2] non-overlapping pairs of adjacent qubits are steered, where we scan through all possible steering parameters K for each pair in order to identify the optimal choice giving the largest expectation value of the cost function gain.The steering parameters are taken from the Pauli operators (4).Unless noted otherwise, the numerical results shown below were obtained by excluding detector operators of Pauli type β n = y in Eq. ( 4).(However, such terms are helpful when preparing the W state or for product states.)Once the optimal steering parameters have been identified, the quantum measurement is simulated by stochastically determining the measurement outcome (ξ, η) according to the probabilities P ξ,η in Eq. (15).Subsequently, the quantum state is updated using Eq. ( 19) and the respective detector qubit pair is re-initialized in the product state |00⟩ d before the next iteration step is launched.
For a given state trajectory, starting from the initial state |Ψ(0)⟩ = |00 • • • 0⟩, the steering protocol is terminated once the fidelity F (t) in Eq. ( 3) exceeds a predefined threshold value F * above which the state is considered converged.The corresponding time t defines the number of time steps n t = t/δt needed for reaching convergence.Of course, this number varies for different measurement-resolved state trajectories.By collecting a histogram from M ≫ 1 trajectory realizations, we can obtain a numerical estimate for the probability distribution of the step number n t .This distribution depends on the chosen fidelity threshold F * .As shown below, we find that the distribution is quite different from a Gaussian distribution and of a typical asymmetric shape.(We have tried to fit our numerical results to commonly used distributions but did not find satisfactory agreement.)For a qualitative description of the simulation results, we characterize the distribution by three indicators, namely (i) the median N s , (ii) the mode N m corresponding to the maximum, and (iii) the half-width ∆N defined as the width of the histogram at half-maximum height.All three numbers depend on the fidelity threshold F * .
Apart from the statistics of the number of iteration cycles needed for achieving convergence, we also show results for the time dependence of the fidelity cost function C N (t) = 1 − F 2 (t), see Eq. ( 3), both on the level of individual state trajectories and for averages taken over many realizations.Similarly, we monitor the time dependence of the total cost function C(t) in Eq. (39).Since no steering operations are applied anymore once the fidelity threshold has been passed, the averaged cost functions C r (t) can depend on the chosen value of F * at long times.
Throughout, we assume identical system-detector couplings, J n = 1, and choose δt = 0.2 as elementary time step such that Γ n = 0.2.We have checked that weak asymmetries in the J n -couplings and/or moderate changes of δt do not cause qualitative changes.

B. Bell state
We start with the simplest case of N = 2 qubits and study the active steering protocol for the target state |Ψ f ⟩ = |Bell⟩ in Eq. (33).Let us recall that all entangled N = 2 states are equivalent under local operations and classical communication (LOCC) to |Bell⟩ [94].In fact, we have numerically tested for many examples that other N = 2 target states can be reached with similar efficiency by our protocol.For several measurementresolved state trajectories and for an average taken over M = 10 4 runs of the protocol, Fig. 3(a) shows the time evolution of C 2 (t) = 1 − F 2 (t).Similarly, Fig. 3(b) shows the total cost function C(t) in Eq. (39).We here used the probability weights p 1 = 0.9 and p 2 = 0.1 for the For the shown data, our simulations were modified to tolerate a tiny increase in dC2(K) in order to still allow for active decision making.Nonetheless, the fidelity threshold is only passed by very few state trajectories, while the great majority of trajectories fails to converge.r-qubit cost function terms in Eq. ( 39), but simulation results are qualitatively similar for all p 1 ≳ 0.5 (with p 2 = 1 − p 1 ).While the analytical argument given at the end of Sec.II C suggests that the trapped-states problem can be resolved for any p 1 > 0, we find that in practice, for small p 1 , the protocol becomes inefficient.
We observe that the individual state trajectories in Fig. 3  quantum-jump-induced steps in the global fidelity F (t).Typically, the steering protocol |Ψ(0)⟩ → |Ψ f ⟩ does not result in a monotonically increasing time dependence of the fidelity at the level of individual trajectories.Figure 3(a) shows that the protocol instead first steers the system into one of the other Bell states, which is orthogonal to the target state (F = 0), but then just one additional quantum jump is enough to bring the system to the target state.By allowing for a decrease of the global fidelity F (t) at intermediate times, the protocol is thereby able to allow for fast and efficient active steering.Such state trajectories are easily found and implemented by our protocol because of the presence of the local cost function C 1 (t), see Sec.II C. It is worth emphasizing that, in our case, most state trajectories reach the target state with almost perfect fidelity, well above the fidelity threshold F * used in Fig. 3.We note in passing that the active decision framework of Ref. [23] is consistent with this scenario.However, a crucial difference is that Ref. [23] considers steering operators pertaining to passive steering protocols, where the active-decision policy only accelerates the steering.In the present protocol, active steering based on global and local cost functions instead allows one to "steer the unsteerable", i.e., to engineer passively unsteerable target states.At the same time, the total cost function C(t) is observed to monotonically decrease at the level of individual trajectories, see Fig. 3(b), even though C(t) could in principle increase after an "unfavorable" measurement outcome.In fact, our protocol only enforces a decrease of the average cost function C(t), which must be a monotonically decreasing function for M → ∞.Similarly, af-ter an initial transient behavior, the averaged squared global fidelity, F 2 (t) = 1−C 2 (t), increases monotonically, where we find an approximately exponential time dependence for approaching the target state, see Fig. 3(a).Interestingly, the slope d dt F 2 (t) is larger for short-tointermediate times than in the long-time limit: states that are nearly orthogonal to the target state tend to be "corrected" more rapidly.This observation is consistent with the weak value amplification mechanism discussed in Sec.II C.
Next, Fig. 3(c) shows the corresponding results obtained from the active steering protocol with p 1 = 0, where only the global fidelity cost function is used.In that case, steering is not successful because of the emergence of trapped states, see Sec.II C. In such cases, state trajectories get stuck before convergence has been reached, and the averaged cost function saturates at some value above the target fidelity threshold.While very few trajectories are still able to pass the fidelity threshold, the scheme is inefficient and fails to converge.
For the fidelity threshold F * = 99% and using M = 10 4 realizations, Fig. 4 shows a histogram of the number of time steps n t needed for achieving convergence.Evidently, the corresponding distribution function of n t is asymmetric, quite broad, and rather different from a Gaussian distribution.This fact is particularly evident from the inset of Fig. 4, where we use a linear scale for the vertical axis.Using the quantities introduced in Sec.III A to characterize the distribution, we find the maximum (mode) N m = 10, the median N s = 22, and the half-width ∆N = 28.Importantly, there are many trajectories which end up in the target state after just a few cycles.On the other hand, we also encounter rare trajectories which require an exceptionally large number of iterations for convergence.
In Fig. 5, we study the time evolution of the global fidelity cost function C 2 (t) (main panel) and of the total cost function C(t) (inset) if the protocol is run in the opposite direction: we here start from |Ψ(0)⟩ = |Bell⟩ and steer towards |Ψ f ⟩ = |00⟩.This seemingly trivial task, where entanglement needs to be removed from the system, is much more difficult to realize than the case in Fig. 3 using the present formulation of the protocol.In fact, entanglement swapping as employed in our protocol gives efficient ways to inject entanglement into the system, but the removal of entanglement is harder to achieve.Even though we target only the relatively poor fidelity F * = 90% in Fig. 5, convergence times are now much longer.
From the main panel in Fig. 5, we observe that different measurement-resolved trajectories surpass the fidelity threshold at widely different times, but they typically do not reach the target state with (almost) perfect fidelity as in Fig. 3.One of the shown trajectories passes the fidelity threshold after just 49 steps.Since a finite fraction of all trajectories show such a behavior, we obtain a step-like initial decrease of the averaged fidelity cost function C 2 (t) and of the averaged total cost function C(t) at very short times.While individual trajectories sometimes show a sudden increase of C(t) due to unfavorable measurement outcomes, the average C(t) decreases monotonically except for a shallow minimum at short times.This minimum is possible because of the finite number M of runs used in computing the average.Since one here typically ends up in states with imperfect fidelity, F * < F (t) < 1, where no steering operations are applied after the corresponding time anymore, C(t) and C 2 (t) show a significant dependence on F * at long times.The measurement-resolved trajectories in Fig. 5 show that an improvement in the global fidelity is often reversed again in the next step due to unfavorable measurement outcomes.Such a behavior indicates that it is a nontrivial task for our protocol to remove entanglement from the system.However, this task could easily be made highly efficient by adding occasional rounds of single-detector qubit measurements to the active steering protocol.Since our main interest is in the preparation of exotic highly entangled states, however, we do not pursue this extension here.We conclude that, even though less efficient, the protocol is also able to actively steer in the backward direction.
The time evolution of the entanglement entropy S(t) in Eq. ( 29) during the above N = 2 steering protocols is shown in Fig. 6.For the direction |00⟩ → |Bell⟩, the main panel of Fig. 6 shows S(t) for the same trajectories as in Fig. 3(a).We observe that entanglement is quickly built up and one approaches (at long times) the maximal Inset: Same but for the reversed protocol in Fig. 5, where the low fidelity F * = 90% implies that S(t) saturates at a relatively large value instead of approaching zero.
value S = ln 2 expected for |Bell⟩, see Refs.[19,95] for related results.In fact, since the trajectory typically cycles through other Bell states before reaching the final target state |Bell⟩, see Fig. 3(a), the convergence of S(t) toward S = ln 2 at long times is faster than the corresponding convergence of the fidelity cost function C 2 (t) shown in Fig. 3(a).In the inset of Fig. 6, using the trajectories in Fig. 5 for the reversed steering direction |Bell⟩ → |00⟩, we illustrate that entanglement can also be removed from the system.
In Fig. 7, for several target states with N = 2 and N = 3, we show the mode N m , the median N s , and the half-width ∆N as functions of the target fidelity F * .These three numbers characterize the distribution function of the step number n t , see Sec.III A, which in turn is estimated by collecting a histogram.Figure 7 indicates that the F * -dependence of N m and N s is very weak for the |Bell⟩ and |GHZ⟩ states, while it is approximately exponential for |W⟩.We note that a steeper increase in N s (F * ) is observed for the N = 3 states in Fig. 7 in the limit F * → 1.This increase can be rationalized by recalling that our termination policy, where one ceases to apply steering operations once a fluctuating state trajectory has passed the fidelity threshold, also affects the long-time limit of averaged cost functions.As a result, an exceptionally large number of steps is needed on average for convergence if the target fidelity is very close to F * = 1.Note the logarithmic scale for the vertical axis.Dashed lines are a guide to the eye only.For the W state, steering operators with β = y in Eq. ( 4) have been included.

C. W and GHZ states
We next turn to the case N = 3, where we consider active steering from |Ψ(0 (1).These two states represent different types of maximal tripartite entanglement [16].However, we have numerically checked that the steering protocol performs with similar efficiency for many other N = 3 target states, e.g., with additional phase factors in Eq. (1).For all N = 3 results shown here, we have used the probability weights p 1 = 0.9, p 2 = 0.09, and p 3 = 1 − p 1 − p 2 = 0.01 for the total cost function in Eq. (39).Our protocol is then capable of finding both target states, but one needs a larger number of steps than for N = 2.
Results for the time evolution of the cost functions are shown in Fig. 8 for the W state, and in Fig. 9 for the GHZ state.In both cases, the fidelity threshold is F * = 97.5%.For these states, the dependence of the mode N m , of the median N s , and of the half-width ∆N on the target fidelity F * are shown in Fig. 7. Figure 7 indicates that reaching the |W⟩ state requires more steps than for the |GHZ⟩ state, especially when asking for high target fidelity F * .This observation is consistent with the fact that almost all N = 3 states with genuine tripartite entanglement are LOCC-related to |GHZ⟩ [16].Preparing the much more elusive |W⟩ state thus is expected to be a challenging task.By comparing the results in Figures 8 and 9, we observe that the individual trajectories are of different character for both target states.For the GHZ state in Fig. 9, we find similar trajectories as for the Bell state in Fig. 3: the trajectory cycles through highly entangled intermediate states different from the target state, but then one quantum jump is enough to reach the final target state.For the W state, on the other hand, Fig. 8 shows that the fluctuating trajectories are qualitatively different.Typically, jumps to the almost perfect target state (as found for the GHZ state) are much less likely.This difference is also manifest in a different dependence of N m and N s on the target fidelity F * as shown in Fig. 7.While the dependence of N m and N s on F * is exponential for both states, the rate governing the growth of N m (F * ) and N s (F * ) is very small for the GHZ state but of significant magnitude for the W state.Similarly, for the target fidelity F * = 97.5%, the histograms in Fig. 10 yield N m = 206 for the W state (blue histogram) but N m = 35 for the GHZ state (green histogram).The GHZ state is therefore much easier to realize.The distribution functions are again found to be broad, asymmetric, with a non-Gaussian shape as observed for the Bell state in Fig. 4.
We next apply our active steering protocol to systems with qubit number N > 3. The weights p r in Eq. ( 39) have empirically been chosen as p r+1 = 0.1p r for 1 < r < N − 1, with p 1 = 0.9 and p N = 1 − r<N p r , but the protocol could probably be made more efficient by a smarter choice for these weights.Since the computational effort for numerical simulations using the present formulation of the protocol scales exponentially in N , we here limit ourselves to N ≤ 6 qubits and moderate target fidelities F * .We refer to Sec.IV B for a discussion of variants of our protocol which should be able to reach large values of N .First, in Fig. 11, choosing a rather poor but fixed fidelity threshold F * = 80%, we explore how N m , N s , and ∆N scale with the qubit number N for the highly entangled N -qubit states |GHZ⟩ and |W⟩ in Eq. (1).We recall that, on general grounds, such states cannot be prepared by physically realizable passive steering protocols [37], see Sec.I.Moreover, while the N -qubit GHZ state could be prepared in a simpler way by projective measurements of suitable stabilizer operators, such a route is not available for the non-stabilizer W state. Figure 11 shows that upon increasing N with fixed fidelity threshold, the values of N m and N s also increase.Similar to our observations in Fig. 7 for the F * -dependence of these numbers at fixed N , the requirements needed for preparing the W state are more demanding than for the GHZ state.
In Fig. 12, we next show the steering dynamics for the N = 4 state, again for selected measurement-resolved trajectories and for the averaged cost functions.The corresponding histogram is shown in Fig. 13.On a qualitative level, the steering protocol gives similar results as for the N = 3 W state in Figs. 8 and 10.However, even for the modest fidelity threshold F * = 90% used in Figs. 12 and 13, the mode N m and median N s of the distribution are about one order of magnitude larger than what we found for the N = 3 W state with F * = 97.5%,see Figs. 8 and 10.Finally, in Fig. 14, we show the steering dynamics and the corresponding histogram for the N = 5 GHZ state.The typical trajectories again feature jump-like steps as for N = 3, see Figs. 9 and 10.   1) with target fidelity F * = 90%, using the total cost function (39) with p1 = 0.9, p2 = 0.09, p3 = 0.009, and p4 = 1 − p1 − p2 − p3.We included β = y steering operators.Main panel: Global fidelity cost function C4(t) = 1 − F 2 (t) vs number of time steps nt = t/δt.The dashed colored curves show three measurementresolved trajectories, the solid black curve is an average over M = 10 4 runs.The dotted horizontal line corresponds the fidelity threshold.Inset: Corresponding results for the total cost function C(t).

IV. DISCUSSION AND OUTLOOK
In this section, we summarize our active steering protocol and discuss open points that, in our opinion, deserve to be studied by future work.We begin in Sec.IV A with several comments on implementation aspects.We then continue in Sec.IV B with a discussion of the scaling of the protocol with the number N of system qubits.A summary of our key results can be found in Sec.IV C along with perspectives for future research.

A. Implementation aspects
While the active steering protocol laid out in Sec.II is formulated in a platform-independent way, experimental success will depend on the concrete circuit realization.We here discuss several salient points of applied importance for our approach.
First, a key element of our protocol is the ability to efficiently perform Bell measurements of detector qubit pairs.In many platforms, these measurements can be routinely performed by measuring the eigenvalues (syndromes) O x,z = ±1 of the detector two-qubit Pauli operators in Eq. ( 6).However, it is still a challenge to perform Bell measurements in some platforms, e.g., in photonic circuits [41,96].On the other hand, it is comparatively easy to provide detector qubits in the desired initial state for the photonic platform.We note that one may in gen-  eral use different physical detector qubits during different cycles of the protocol.
It is also important to keep in mind that these projective measurements take a finite time τ meas .In fact, ideal projective measurements (with τ meas → 0) come with infinite resource costs [97].Unless a fault-tolerant platform is available, τ meas should be short compared to the decoherence time of the circuit, as well as to the time scales characterizing the intra-system Hamiltonian evolution.Similar remarks apply to the initial preparation of the detector state |00⟩ d before every steering cycle.Fast readout and qubit reset techniques (with time scales of order 100 ns) have been reported for superconducting qubit platforms [81,98].In addition, for a given physical setup, one may also need to take into account the finite time needed for ramping up (and switching off) the steering operators.However, in a related recent experimental work using superconducting qubits [13], the respective time scales were found to be short compared to τ meas .
Second, let us discuss the basic time scale δt for one iteration cycle of the protocol.On the one hand, δt should not be too short since otherwise the protocol becomes inefficient.On the other hand, δt should be small enough to validate the weak measurement limit and the small-δt expansion of the Kraus operators, see Sec.II A. Choosing the gate couplings of similar magnitude, J n ≈ J, we expect that Jδt ∼ 0.2 should work well, cf.Sec.III.Third, apart from the time scales τ meas and δt, one also needs to account for the finite time τ calc required for the classical calculation performed in parallel to the experimental protocol.In these calculations, dC(K) is computed for all steering parameter configuations in order to determine the best steering parameter K, and the state |Ψ(t)⟩ is updated after each measurement.For the values of N studied in Sec.III, we find that τ calc is much shorter than the expected values for τ meas .The classical computation time is thus not to impose restrictions.
Fourth, the probably most important practical restriction for our protocol at present comes from our assumption of having a platform free from external noise and/or static errors [25].In the near future, error-corrected circuits harboring several (say, a dozen) fault-tolerant logical qubits are expected to come into reach [73][74][75][76][77][78][79][80][81][82].Such platforms will represent an ideal playground for our protocols.Without quantum error correction, almost noisefree platforms are available in trapped ion systems [8].In addition, novel types of noise-protected superconducting qubits [99,100] may soon realize circuits with strongly reduced noise levels.Similarly, once Majorana qubits become available, very low noise levels are expected due to topological protection mechanisms [101][102][103][104].
Finally, for any implementation, one should verify the ultimate success of the protocol.Such a benchmarking could be performed by using quantum state tomography methods such as shadow tomography [105][106][107].

B. Scalability of active decision protocols
In Sec.III, we show explicit numerical simulation results for relatively small qubit number N ≤ 6 only.Nonetheless, these results constitute a proof of concept that active steering protocols allow for the engineering of passively unsteerable states.Moreover, already for moderate N ≲ 10, the preparation of exotic highly entangled states is a very nontrivial task for which active steering provides a fresh perspective.In fact, current experimental efforts on state engineering typically consider quantum hardware with up to ten entangled qubits (rather than large-scale systems), which suffices for typical applications in quantum communication, quantum sensing, or quantum foundational experiments.Our proposal can be readily realized for such systems.
As remarked before, it is not feasible to exactly represent and numerically simulate the time-evolving quantum state trajectories in our active steering protocol on a classical computer for large-scale systems.Since the numerical demands grow exponentially with increasing N , further advances are needed to improve the performance of the protocol for significantly larger N .For instance, with an optimized choice for the probabilities p r in Eq. ( 39), one may be able to significantly speed up the protocol.Moreover, with suitable modifications, our active feedback strategies could be used for simpler quantum tasks than state preparation.Important examples include adiabatic and non-adiabatic state manipulation, and the realization of entanglement transitions in actively monitored circuits.For such tasks, the protocol becomes much simpler and may enable a study of the large-N limit.
One of the possible routes to scalability of the protocol is multi-block engineering: By employing a variant of our protocol, inspired by Ref. [57], one may consider the local steering of small parts of the system, where one subsequently builds up the full system state by merging different small-N blocks.Since our approach is efficient in actively steering small-N blocks, one may be able to scale to larger system sizes in this manner.While this idea is speculative at present, it could eventually obviate the need for expensive classical simulations of a large quantum system.
Furthermore, we expect that the cost functions used in the active decision policy need not be computed exactly in order to achieve state preparation with high fidelity.Indeed, the cost functions in our approach provide (i) an overall "driving bias" for the steering landscape and (ii) a local "potential" to avoid trapped states.Both these main ingredients can, in principle, be simulated approximately.As a consequence, numerical methods for approximately solving quantum problems on classical hardware can be applied, e.g., tensornetwork approaches, quantum Monte Carlo simulations, machine learning, or shadow tomography [105,106].Such methods often remain efficient for large-scale systems.Adapting them to our protocols and studying the resilience to those approximations are interesting topics for future research.

C. Summary and perspectives
We have proposed and tested active steering protocols for quantum state preparation in monitored quantum circuits.In our approach, entanglement is generated in the time-evolving system state |Ψ(t)⟩ by a weakmeasurement version of entanglement swapping using Bell measurements of detector qubit pairs.Active decision making strategies then determine the optimal steering operators applied in the next time step.We find that in practice, a limited and realizable set of simple Pauli steering operators is sufficient to warrant convergence of the active steering protocol.We emphasize that we have used a rather restrictive notion of locality in our formulation of the active steering protocol since only Bell measurements between adjacent detector qubits are allowed.Interesting extensions of our protocols could permit a larger spatial coupling range.
A key finding of our analysis is that the standard fidelity is not a useful cost function for active steering to many-body target states.A detailed discussion of this issue can be found in Sec.II C, where we show that a useful cost function must be able to monitor local substructures of the many-body state.In many cases, those local structures can be efficiently diagnosed by monitoring weak values (which are relatively easy to compute).In other cases, the failure of the fidelity cost function is reminiscent of Anderson's orthogonality catastrophe.We have demonstrated that active steering is possible in practice when including local fidelity terms which monitor the r-body reduced density matrices (built from the time-evolving state) in comparison to the corresponding reduced density matrices for the target state.In our present formulation, we constrain all possible local fidelity terms with 1 ≤ r ≤ N .
Our numerical simulations reveal that the distribution of the number of time steps n t needed to reach convergence towards a desired target state is typically far from a Gaussian distribution.(Here distribution refers to an average taken over many different measurement-resolved trajectories.)The distribution instead is found to be skewed, with a maximum (mode) N m reached after an only moderate number of steps for small N .We have also characterized the distribution by the median N s and the half-width ∆N ; for a detailed discussion, see Sec.III.
Let us then conclude by describing some perspectives for future research.
State manifolds.-Canactive steering protocols converge toward state manifolds instead of a single target state?For example, such a protocol can utilize a cost function maximizing the entanglement entropy (29) or other entanglement measures instead of C(t) in Eq. (39).The active steering protocol is then expected to target a manifold of maximally entangled states.An interesting open question is to what extent such state manifolds resemble the "dark manifolds" obtained from passive steering [108], where the dark space is a degenerate Lindbladian subspace with eigenvalue zero and the final state depends on the initial state |Ψ(0)⟩.For the active steering case, a different scenario may be that the protocol will continue cycling through all reachable states in the manifold as long as it is evolving in time, independent of the initial state.
We expect that state manifolds may already appear for the cost functions used above.Let us describe three scenarios how this can happen: (i) One may reduce the set of possible steering operators or the number of measurements.In such cases, it is generally not possible anymore to steer towards an arbitrary target state, and the protocol is likely to reach a state manifold.Because of the drastic simplifications offered by this route, it should also be possible to tackle larger systems.(ii) A similar situation arises if one omits some cost function terms in Eq. (39).For instance, by omitting all local fidelity terms with r < N , one reaches the trapped-state manifold discussed in Sec.II C. (iii) One may simultaneously steer towards two non-orthogonal target states |Ψ f ⟩ by adding the respective cost functions weighted with probabilities w 1 and w 2 = 1 − w 1 .In that case, by varying w 1 , we expect that one obtains a manifold of states interpolating between both target states.Since one can systematically study effects of mismatch in the target state, such a protocol could also give useful insights about the impact of errors [25].
State purification.-Withinour protocol, if one starts with a pure initial state, the time-evolving state remains pure at all times.With suitable modifications, our protocol could be used for state purification.For instance, one may start from a maximally mixed (infinite temperature) initial state and use the active steering protocol to steer towards an arbitrary, possibly pure, target state.In order to implement this program, one needs to adapt the present formulation of the protocol in order to allow for mixed initial states.
Multipartite entanglement.-Onecan monitor the increase of multipartite entanglement measures [1] during the protocol.Entanglement structures can be built up very quickly in active steering protocols of the type considered here since limitations imposed by the Lieb-Robinson bound for unitary evolution are absent, see also Ref. [95].In the present work, we have only studied the entanglement entropy, and we have only considered it for the simplest case of N = 2 system qubits.
Memory effects.-Anotherinteresting generalization is to study active steering protocols where instead of the re-initialization of the detector qubit pair in the state |00⟩ d in each step, one simply takes the previously measured Bell state as new initial state.This scheme is simpler to implement since one avoids the reset of the detector qubits.However, it also introduces memory effects for the state dynamics [109].At present it is unclear how this change will affect convergence properties.
Geometrically local fidelity cost functions.-Inthe present version of the active steering protocol, we take into account all ordered subsets M of r < N qubits when computing the local cost function C r (t) in Eq. (37).If one truncates the sum over M in Eq. ( 37) to include only geometrically local sets of nearby qubits, significant simplifications are possible and one is able to study larger system sizes, i.e., larger N .Alternatively, it is also worthwhile to explore whether it suffices to include just the r = 1 and r = 2 cost function terms on top of the global fidelity term.
Connections to machine learning.-Itmay be feasible to significantly improve our active steering protocol by employing quantum machine learning methods [110][111][112].Let us briefly speculate about different possibilities.First, machine learning may be useful for optimizing the probability weights p r appearing in the total cost function (39).In the present work, we have simply chosen empirical values for these weights.Second, instead of the exact classical computation of quantum states and the associated cost functions in each step (as done here), machine learning could offer alternative strategies where such calculations are replaced by faster yet still accurate schemes.Third, in our approach, we start with a known state.In principle, machine learning may be employed in active protocols where the information on the initial state is incomplete.Feeding a neural network with sequences of consecutive readouts, one can perform a partial tomography "on the fly" such that the missing information is reconstructed and the proper cost function can be estimated.
From weak to strong measurements.-Throughoutthe present work, we have assumed the weak measurement limit, where Kraus operators can be Taylor expanded in J n δt ≪ 1.On the other hand, for strong systemdetector couplings J n and/or long time steps δt such that J n δt ∼ 1, one can realize the limit of strong (projective) measurements [1,2].Understanding the crossover between the weak and strong measurement regimes in the context of active steering protocols raises an interesting topic for future research.Since the stochastic Schrödinger equation (19) does not apply anymore outside the weak measurement limit, one needs to resort to Eq. ( 8) without using the small-δt form of Kraus operators.As suggested by the results of Ref. [26], one may accelerate the convergence of our active steering protocol by allowing for larger values of δt.However, we leave this extension to future work.
Noise-resilient schemes.-Ideally,one would like to have active steering protocols that can also tolerate the presence of external noise without requiring a faulttolerant platform.In the present cost-function based approach, it is difficult to accomodate such effects since state tracking along the time-evolving trajectory is assumed.A conceptually different approach is to target suitable measurement operators and base the active deci-sion making strategy directly on measurement outcomes instead of the evaluation of fidelity cost functions.Such a strategy would be capable of overcoming noise effects since the feedback now directly relies on physically measurable observables.In addition, this approach can in principle allow for studying systems in the large-N limit.At present, it is unclear whether such strategies are useful for quantum state preparation, but they certainly can be expected to find other interesting applications.
We note that all data underlying the figures presented in this work can be retrieved at the zenodo website https://zenodo.org/records/10605186.overall coupling J is considered fixed and known.In each time step of the protocol, one then has a unitary evolution under H K .Note that in general, the two pieces in Eq. (B1) do not commute, which implies that we have a "frustrated steering" protocol [22].In the most general case, we assume that the detector qubit is initialized before each time step in the state with fixed and known angles (η, ψ).The total systemplus-detector state after the measurement outcome ξ is then given by |Ψ ξ (t + δt)⟩ ⊗ | Φξ ⟩ d , where the index ξ on the system state emphasizes its outcome dependence.One may naively expect that it is now possible to engineer arbitrary target states by such an approach.However, this is not possible, even when allowing for arbitrary δt in Eq. (8).By evaluating the Kraus operators, we find (b):

6 tFIG. 1 .
FIG.1.Cartoon of the active steering protocol.(a) N system qubits (orange squares, here shown for N = 3) are coupled to the respective detector qubit (blue circles) by selected Pauli steering operators (here denoted by H1 and H2), see Eq. (4) below.After a unitary time step, projective Bell measurements of neighboring detector qubit pairs (in this example for qubits 1 and 2, with qubit 3 not being measured) implement weak local Bell measurements for the state |Ψ⟩ of the system qubits (entanglement swapping, see Fig.2for details).(b) Time evolution of the monitored quantum circuit with active feedback, shown for three time steps of a chain of N = 6 qubits with periodic boundary conditions.A possible scheme for Bell measurements of neighboring detector qubit pairs in subsequent cycles is indicated.For details, see main text.

Fig. 1 .
FIG. 2.Schematic illustration of entanglement generation during one time step of the protocol.We use a weak-measurement variant of entanglement swapping[65][66][67][68][69][70][71][72], where one steers the neighboring system qubits (n, n + 1) indicated by squares.Circles depict the corresponding detector qubits as in Fig. 1.(a) Configuration at initial time t = 0, where all qubits are decoupled from each other.(b) At time δt (after one time step), each system-detector qubit pair is entangled (green vertical arrows) due to unitary time evolution under the chosen steering operators.(c) After a projective Bell measurement of the detector pair, system and detector qubits disentangle and, depending on the measurement outcome, entanglement between the system qubits (red horizontal arrow) builds up.Panels (d)-(f) show the corresponding steps during the subsequent time step of the protocol, where entanglement generated in the previous time step is already present.Typically, entanglement increases after the Bell measurement (thicker red horizontal arrow).(g) Quantum circuit representation of entanglement swapping.The Pauli rotations (R) depend on the chosen steering operators (see Sec. II A for details) and act on system and detector qubits, with a subsequent measurement of the detector qubits in the Bell basis.System (detector) qubit states are here denoted by |σ1,2⟩ (|σ1,2⟩ d ).The Bell basis measurement is achieved by CNOT and Hadamard gates.
(r)M , one selects an ordered subset of r < N qubits, M = {j 1 , j 2 , . . ., j r } with 1≤ j 1 < • • • < j r ≤ N ,and partially traces over the N − r remaining other qubits.With the complementary set M c corresponding to the traced-out qubits, we have ρ (r) M = Tr Mc ρ.To proceed, we again use Pauli string operators S M as in Eq. (

2 .
encode the Bloch vectors R 1 and R 2 , while R (2) α1,α2 = Q α1,α2 1,In what follows, the Bloch tensor representation of the target state ρ f = |Ψ f ⟩⟨Ψ f | is denoted by R f S , which also determines the Bloch tensors R (r)f S M for the corresponding r-qubit RDMs ρ (r)f M .

FIG. 3 .
FIG. 3.Active steering protocol for N = 2 qubits and the target state |Ψ f ⟩ = |Bell⟩ in Eq. (33), using the total cost function C(t) in Eq. (39) with p1 = 1 − p2 = 0.9 and target fidelity F * = 99%.(a) Time evolution of the global fidelity cost function C2(t) = 1 − F 2 (t) vs number of time steps nt = t/δt.The colored dashed lines show three measurementresolved trajectories, the solid black curve is an average over M = 10 4 runs.The dotted horizontal line indicates the fidelity threshold value.(b) Corresponding results for the total cost function C(t).(c) Corresponding results for p1 = 0, where C(t) = C2(t) includes only the global fidelity cost function.For the shown data, our simulations were modified to tolerate a tiny increase in dC2(K) in order to still allow for active decision making.Nonetheless, the fidelity threshold is only passed by very few state trajectories, while the great majority of trajectories fails to converge.

FIG. 4 .
FIG. 4. Histogram of the number of trajectories that have reached fidelity F * = 99% in nt = t/δt time steps, obtained from M = 10 4 realizations of the N = 2 protocol with |Ψ f ⟩ = |Bell⟩, see Fig. 3.Note the logarithmic scale for the vertical axis.The solid vertical line (horizontal bar) indicates mode Nm (half-width ∆N ), the dashed vertical line shows the median Ns.Inset: Same results but with a linear scale for the vertical axis.

FIG. 6 .
FIG.6.Time evolution of the entanglement entropy S(t) for N = 2, see Eq.(29).Main panel: S(t) vs nt = t/δt for |Ψ f ⟩ = |Bell⟩ for the same measurement-resolved trajectories as in Fig.3(a).The solid black curve is an average over M = 10 4 runs.The dotted horizontal line indicates Smax = ln 2. Inset: Same but for the reversed protocol in Fig.5, where the low fidelity F * = 90% implies that S(t) saturates at a relatively large value instead of approaching zero.

FIG. 7 .
FIG. 7. Mode Nm (filled symbols), median Ns (open symbols), and half-width (vertical bars) vs target state fidelity F * for active steering to the N = 2 target state |Bell⟩ and for the maximally entangled N = 3 states |GHZ⟩ and The shown results have been obtained from M = 10 4 trajectories.Note the logarithmic scale for the vertical axis.Dashed lines are a guide to the eye only.For the W state, steering operators with β = y in Eq. (4) have been included.

FIG. 9 .
FIG.9.Same as Fig.8but for the target state |GHZ⟩, again for F * = 97.5% and with the same weights pr.Main panel: Global fidelity cost function C3(t) = 1 − F 2 (t) vs nt = t/δt, where dashed colored curves correspond to individual trajectories and the black curve is an average over M = 10 4 runs.The dotted horizontal line corresponds to the fidelity threshold.Inset: Corresponding results for the total cost function C(t).

FIG. 10 .
FIG.10.Histogram of the number of trajectories that have reached fidelity F * = 97.5% in nt = t/δt time steps for the N = 3 target states |W⟩ (blue, see Fig.8) and |GHZ⟩ (green, see Fig.9).Using a total of M = 10 4 runs, each bin shows the corresponding trajectory number accumulated over 25 subsequent time steps.Note the logarithmic scale for the vertical axis.Solid vertical lines (horizontal bars) indicate the respective mode Nm (half-width ∆N ), and dashed vertical lines show the median Ns.For the W state, β = y steering operators have been included.

FIG. 11 .FIG. 12 .
FIG. 11.Mode Nm (filled symbols), median Ns (open symbols), and half-width (vertical bars) vs qubit number N for active steering to the N -qubit states |W⟩ and |GHZ⟩ in Eq. (1).Note the logarithmic scale for the vertical axis.For each case, the respective target fidelity is F * = 80% and results have been obtained from M = 10 4 (M = 10 3 for N = 6) trajectories.Dashed lines are guides to the eye only.The weights pr in Eq. (39) have been chosen as pr+1 = 0.1pr for 1 < r < N − 1, with p1 = 0.9 and pN = 1 − r<N pr.For the W state, β = y steering operators have been included.For N = 2, |Bell⟩ is identical to |GHZ⟩ in Eq. (1).

FIG. 13 .
FIG. 13.Histogram of the number of trajectories that have reached fidelity F * = 90% in nt = t/δt time steps from M = 10 4 runs for the N = 4 target state |W⟩, see Fig.12.Each bin shows the trajectory number accumulated over 200 subsequent time steps, with a logarithmic scale for the vertical axis.The solid vertical line (horizontal bar) indicates the mode Nm (half-width ∆N ), the dashed vertical line shows the median Ns.

2 FIG. 14 .
FIG. 14. Active steering protocol for N = 5 qubits and target state |Ψ f ⟩ = |GHZ⟩ in Eq. (1) with target fidelity F * = 90%, using the total cost function (39) with p1 = 0.9, p2 = 0.09, p3 = 0.009, p4 = 0.0009, and p5 = 1 − p1 − p2 − p3 − p4.Main panel: Global fidelity cost function C5(t) = 1 − F 2 (t) vs number of time steps nt = t/δt.The dashed colored curves show three measurement-resolved trajectories, the solid black curve is an average over M = 10 4 runs.The dotted horizontal line corresponds to the fidelity threshold.Inset: Corresponding histogram of the number of time steps needed for reaching convergence.Each bin shows the trajectory number accumulated over 100 subsequent time steps, with a logarithmic scale for the vertical axis.The solid vertical line (horizontal bar) indicates the mode Nm (half-width ∆N ), the dashed vertical line shows the median Ns.