Unitary Design of Quantum Spin Networks for Robust Routing, Entanglement Generation, and Phase Sensing

Spin chains can be used to describe a wide range of platforms for quantum computation and quantum information. They enable the understanding, demonstration, and modeling of numerous useful phenomena, such as high fidelity transfer of quantum states, creation and distribution of entanglement, and creation of resources for measurement-based quantum processing. In this paper, a more complex spin system, a 2D spin network (SN) engineered by applying suitable unitaries to two uncoupled spin chains, is studied. Considering only the single-excitation subspace of the SN, it is demonstrated that the system can be operated as a router, directing information through the SN. It is also shown that it can serve to generate maximally entangled states between two sites. Furthermore, it is illustrated that this SN system can be used as a sensor device able to determine an unknown phase applied to a system spin. A detailed modeling investigation of the effects of static disorder in the system shows that this system is robust against different types of disorder.


I. INTRODUCTION
Spin chains provide a generic model for the behaviour of a range of useful tasks in quantum information processing [1]. They can be used to transfer information through the chain [1][2][3] or to create and distribute entanglement [4][5][6][7][8][9]. Unlike gate-based schemes, spin chains do not necessarily require the switching on and off of couplings between qubits. A desirable process may be achieved through exploiting the natural dynamics of the system with a fixed Hamiltonian [10,11]. Furthermore, spin chain systems can describe and be used to model a wide variety of different physical implementations. Examples include quantum dots [3,12,13], trapped ions [14], superconducting qubits [15,16] and coupled optical waveguides [17].
Spin Networks (SN), on the other hand, can have a topology more complex than linear spin chains [18,19] and have applications which include quantum sensing [20][21][22][23]. Simple examples of SN systems can be generated by connecting spin chains. If this is effected via suitably chosen unitary transformations, clearly the spectrum is preserved and so the physical behaviour of the SN can be engineered by design. The SN that we investigate here is designed via the application of a Hadamard-like unitary on two uncoupled spin chains.
In this paper, we show that the SN system we explore can be used as a router that sends quantum information through the network according to an external control. In a perfect SN, the information can be directed through the network to a chosen site with unit fidelity, also known as perfect state transfer (PST). We also demonstrate that * aha555@york.ac.uk † irene.damico@york.ac.uk ‡ mpestarellas@qilimanjaro.tech § timothy.spiller@york.ac.uk the SN system can be used to create a maximally entangled state between two sites. Furthermore, we will introduce a protocol for using our SN as a sensor device that retrieves any unknown phase applied to a particular spin in the system. Finally, in order for our results to be applied to realistic situations, we will investigate in detail the effect of different types of static disorder in the system.

II. THE MODEL
A linear spin chain system with nearest-neighbor interaction can be described by the time-independent XY-Hamiltonian as follows: (1) where N is the total number of sites, J i,i+1 is the nearestneighbor interaction between sites i and i + 1, and σ x i , σ y i , σ z i are Pauli operators that represent the spin components for site i. In the second term, in Eq. (1), each ϵ i represents the on-site energy for an excitation at site i. We will generally consider situations where the onsite energy is independent of the site i and so we can set ϵ i = 0. However, when we investigate the effect of diagonal disorder in the system, ϵ i must be considered.
In a spin chain prepared to have spin down |0⟩ at all sites, a single-excitation at a site i is defined as a spin up |r i ⟩ = |00 . . . 1 i 00 . . .⟩. The number of excitations where I is the relevant identity, is conserved. As N commutes with H xy even in the presence of disorder, the different excitation-number subspaces decouple. In our calculations, we will only consider the single-excitation subspace, as this suffices to achieve the desired phenomena.
To test how well a quantum process is performed, we use fidelity, which calculates the overlap of an evolved initial state |ψ(0)⟩ with a desirable state |ψ des ⟩ at a later time t for the relevant static system Hamiltonian H and with the reduced Plank constant set to be ℏ = 1. For the trimer chain, an example of PST is achieved when the fidelity of an evolved initial state |r 1 ⟩ = |100⟩ against the desirable state |r 3 ⟩ = |001⟩ is equal to 1. This happens at time t m = π/( √ 2J). Since at this time any initial state evolves to its reflection about the mid point of the chain, this is called the mirroring time t m [32]. In the presence of errors, the mirroring time and the fidelity change, depending on the type of error, as will be discussed below.
In order to quantify how much a quantum state is entangled we use the Entanglement of Formation (EOF), which gives the entanglement of any arbitrary pair of qubits A and B independent of whether they are in a pure or mixed state. The EOF is defined as [33] and ε i are the eigenvalues of the matrix ρ AB ρ AB .
Here ρ AB is the reduced density matrix of sites A and B, and ρ AB is the spin-flipped ρ AB , so ρ AB = (σ A y ⊗ σ B y )ρ * AB (σ A y ⊗ σ B y ).

A. Off-Diagonal Disorder
Off-diagonal disorder (also called coupling disorder) affects the system coupling parameters. We investigate the effect of the coupling errors on the system by adding these to the coupling parameters of the Hamiltonian H xy in Eq. (1) where J ′ i,i+1 = Ed i,i+1 ; the parameter E, reported in the figures in units of max{J i,i+1 }, sets the scale of the error; and d i,i+1 is a random number that depends on a particular distribution. Two physically reasonable distributions (uniform and Gaussian distribution) will be considered, each with zero mean value.
The normalised uniform (or flat) distribution of random numbers is chosen to be of unit weight within the window [-0.5 , 0.5]. For zero mean, the normalised Gaussian distribution with a standard deviation of w takes the form f (d) = 1 w √ 2π exp −d 2 /2w 2 . As the standard deviation of our chosen flat distribution is w = 1 2 √ 3 , we use this value of w in the Gaussian distribution to model Gaussian errors equivalent to the flat case. As will be seen, our disorder modelling is then essentially independent of the form of the random distribution used (flat or Gaussian), until the regime of very large disorder is reached. For error regimes of interest for useful devices, no dependence on the form of the error distribution used will be apparent.

B. Diagonal Disorder
The second type of disorder considered here is the diagonal disorder (i.e., on-site energy disorder). Therefore, the second term in Eq. (1) is now present. The sitedependent errors are represented as ϵ i = Ed i , where E and the random d i have the same definitions as before.

III. SPIN NETWORK
Unitary transformations can play a very useful role in designing and engineering new physical SN systems. Such transformations can be used to simplify complex networks, while retaining the spectrum and desirable features of the system dynamics [9]. Correspondingly, here we use such transformations to couple together smaller SNs into larger systems, again retaining or engineering in desirable features. We stress that this unitary transformation approach is a mathematical design stage, so the resultant SN is then the network that should be constructed physically, in order to deliver the desirable dynamics or properties.
In this work, our proposed SN is a 2D system of spins that is realized by connecting two identical spin chains. In fact, in general, multiple spin chains can be connected to form a larger spin network system. However, the applications we study here only require a small SN, realized by connecting just two identical spin chains.

A. Design and Realisation of Our SN
First, we consider two identical uncoupled trimers as illustrated in Fig. 1. Each trimer acts as a separate spin chain and exhibits PST for a single excitation transferring between site 1 and site 3; similarly, for the second chain, PST is achieved between sites 4 and 6.
The Hamiltonian for these two uncoupled chains is given as The two uncoupled spin chains can be connected in order to form a SN by applying an appropriate unitary transformation U to the Hamiltonian H. For the example presented here, we apply a unitary that is a Hadamard transformation between site 3 and site 6: Here, U −1 = U , and therefore the transformed Hamiltonian is given as Using this transformation, we have designed a SN system of six sites (Fig. 2).We stress that it is this coupled SN that should be constructed physically, in order to deliver the various applications. We choose to design the SN via a unitary transformation because we know that the spectrum is unchanged. Therefore U is chosen to produce interesting and useful transformed dynamics. In order to demonstrate this, we require the eigenvectors and eigenvalues (see appendix A) of the Hamiltonian H. The system is first prepared to be in the state |000 . . .⟩ where all sites have spin-down. Then, the dynamics of the system is initialised by the simple injection of a singleexcitation at site 1 at t = 0: where |r 1 ⟩ = |100000⟩. This state is clearly not an eigenstate, so it will evolve in a non-trivial way. The state evolution is then found numerically [34] or analytically by decomposing the initial state Eq. (8) into the eigenvectors of the Hamiltonian H. The excitation will then evolve, through the natural dynamics of the system, to a state that is a superposition between site 3 and site 6 at the mirroring time t m Then it evolves back to site 1 at 2t m and so |ψ Similarly, if at t = 0 we inject the single-excitation at site 4 instead of site 1, then the excitation will evolve at t m to a superposition state between site 3 and site 6 but with a relative phase of −1 Then, it evolves back to site 4 at 2t m . This dynamics is engineered by constructing a Hadamard-based unitary to connect the chains; unitary based on different gates could be used for engineering alternative behaviours/state superpositions.
For demonstration, in what follows, we will use just the case where the single-excitation is injected at site 1.

B. Router
Routing is clearly an important function to have in quantum networks. Spin chains have been proposed as routers via time-dependent driving of the chain couplings [35,36] or modulating the on-site energies [37]. In our scheme, the Hamiltonian parameters will instead remain unchanged.
We now explain how our SN can be used as a router, so to control whether the excitation is allowed to return to site 1 or to propagate to site 4. We have seen above that the excitation evolves from site 1 to a superposition of being at site 3 and site 6 and then it evolves back to site 1. For routing, we perform a sudden (on the timescale of the dynamics) operation at the time t m , when the excitation arrives at site 3 and site 6, to force the excitation to evolve to site 4. This is done by applying a local phase flip of (e iπ = −1) at either site 3 or site 6 at t m . For illustration, we choose to apply the phase flip at site 6, such that under the sudden approximation the state at t m becomes: As a result, the evolution of |ψ 1 (t m )⟩ π will transfer the excitation to site 4 at 2t m . Therefore, the system will be operated as a router such that the excitation will not evolve back to site 1, but it will evolve to site 4 instead.
Clearly, by design as it is based on PST, the router will operate perfectly for a perfect SN. However, in anticipation of considering practical systems with disorder present, we use fidelity to asses how well the excitation is transferred to site 4. In order to do so, we should take into account that the evolution changes when a phase factor is applied to the system. Consequently, there are two fidelities to be calculated, (i.e., the fidelity before and after the phase factor is applied to the system). For instance, if the system is initialized with a single-excitation injected at site 1 at t = 0 and we add a phase factor e iθ at site 6 at t m , the fidelity of the excitation being at the desirable site |ψ des ⟩ is calculated as follows: 1. The fidelity for 0 ≤ t < t m is calculated as: with the initial state being |ψ 1 (0)⟩ = |r 1 ⟩.
2. The fidelity for t ≥ t m is calculated as: The desirable state for the routing device is an excitation being at site 4, |ψ des ⟩ = |r 4 ⟩. In Fig. 3, the fidelity of an excitation being at each site is plotted as a function of time, which shows that the excitation is transferred from site 1 to site 4 with PST. The excitation will then keep oscillating between site 4 and a superposition state of site 3 and site 6. If the phase flip is applied repeatedly at site 6, each time the excitation is in a superposition of site 3 and site 6 (i.e., t m , 3t m , 5t m , . . . ), then the excitation will keep oscillating between site 1 and site 4. The protocol for operating the SN as a router is shown in Fig. 4.

Router Robustness
In order to test the robustness of our routing protocol we apply two types of disorder, diagonal and off-diagonal disorder. We then measure the fidelity against |r 4 ⟩ at different times 2t m , 4t m , and 6t m . These are the times where the excitation is found to be at site 4 for the ideal case with no errors. For both types of disorder we have considered a Gaussian and a flat distribution for the random error d i , with error scale E/J. Since the error is random, we consider a large number of realisations so each point in Fig.(5) and Fig.(6) is the average value of 1000 realisations of the fidelity in the presence of disorder.
A very robust behaviour of the fidelity against diagonal disorder can be seen in Fig. 5 where the fidelity remains above 99% at 2t m and > 95% at a later time, 6t m , even with large error scale, E/J = 15%. With significant error scale, E/J = 25%, the fidelity at 2t m , 4t m , and 6t m remains above 98%, 94%, and 88%, respectively. On other hand, the fidelity is not so robust against offdiagonal disorder, as shown in Fig. 6, rapidly decreasing as E/J ≥ 20%. The plots also show that both random number distributions (Gaussian and flat distributions) give results which are indistinguishable on the scale of the plots for error scale up to E/J = 20%, while for E/J > 20% the Gaussian distribution has slightly less impact on the fidelity compared to the flat distribution.
The routing protocol is very robust for both types of disorder when the error scale is up to E/J ≤ 10%. Both figures illustrate that when E/J ≤ 10%, the routing fidelity remains above 97% at three consecutive times (2t m , 4t m , and 6t m ) with diagonal disorder, while it remains above 90% at the same three consecutive times with off-diagonal disorder. It is important to note that in real implementations the error scale could reasonably be expected to be E/J < 10%, and since the robustness of our routing protocol remains high for such error scales, we highlight the potential of our SN for short-distance routing applications.

C. Entanglement Generation
The SN system initialized as |r 1 ⟩ naturally generates the maximally entangled state Eq. (9) between sites 3 and 6 at times nt m with n odd. However, it can also be used to create a maximally entangled state between sites 1 and 4. This is done as follows: We inject a single excitation at site 1 at t = 0 and we then apply a phase shift of e iπ/2 at site 6 at t m . As a result, the state will evolve at 2t m to be The state of the system then keeps oscillating between a superposition state of site 1 and site 4 and a superposition state of site 3 and site 6, such that the state at 3t m will be and the state at 4t m will return to be The state |ψ 1 (2t m )⟩ is a maximally entangled state between site 1 and site 4. We note that as the SN could be engineered from longer spin chains, this is an effective way to entangle distant qubits and can be used as a resource for quantum information processing purposes.

Entanglement Robustness
We now wish to investigate the robustness of our protocol to generate an entangled state against error. This is done by calculating the effect of errors on the EOF of the relevant maximally entangled state between site 1 and site 4 at different times 2t m , 4t m , and 6t m . These are the times where the state of the system, for no error, is found to be maximally entangled. Two types of error have been considered, the presence of on-site energy error  We observe that the generation of the entangled state seems to be very robust against diagonal disorder Fig. 7, with an EOF that remains above 99% at 2t m for error scale up to E/J = 15% and above 95% for a significant error scale of E/J = 25%. Furthermore, the EOF at times up to 6t m remains above 90% with a large error scale of E/J = 10%. In the off-diagonal disorder case, Fig. 8, the EOF remains above 97% and 95% when the error scale is E/J = 10% at 2t m and 4t m , respectively. However, it decreases fast as E/J ≥ 20%, particularly at later times (4t m and 6t m ).
It is clear for the diagonal disorder case that the effects of the random Gaussian and flat distributions are identical at 2t m up to E/J = 40% and very similar at later times. In the case of off-diagonal disorder, results from both random number distributions remain identical at 2t m and 4t m up to E/J = 30% and extremely close at 6t m up to E/J = 30%. Therefore, the EOF behaviour is independent of the form of the random distribution used (Gaussian or flat), until the regime of significant error strength of E/J ≥ 30% is reached. The robustness of our protocol for a significant error scale makes it a promising candidate to generate entangled states in real applications.

D. Phase Sensor Device
Quantum sensors now form a recognised sector within the whole quantum technologies landscape [20][21][22][38][39][40][41][42]. Use of quantum resources for sensing enables the ultimate (Heisenberg-limited) sensitivity to be pursued. In essentially all such applications, the field or effect being sensed is arranged to impart a phase on the quantum resources (qubits) in some chosen interferometric system. Thus measurement of this phase through interference enables sensing of the field or effect that caused it.
In both implementations mentioned above, a chosen phase is applied at site 6 at t m , to perform a specific operation. We now consider the case where the sudden phase factor e iθ applied at site 6 is unknown and arises from an external field or effect, which is to be investigated by the phase it generates. The task is to retrieve this unknown phase θ (modulo 2π), in order to sense the field or effect that produced it. We can derive analytically how an arbitrary phase θ will modify the occupation of sites 1 and 4 at 2t m , see appendix B. From a practical perspective, we assume that the only information we could determine is the fidelity measurement at either sites 1 or site 4 against |r 1 ⟩ or |r 4 ⟩ respectively, at 2t m . In what follows, we will assume we can retrieve the fidelity against When an initial excitation is injected at site 1 at t = 0 and an unknown phase θ is applied suddenly at site 6 at t m , the state of the system at 2t m will be given by Thus, by considering the overlap of the initial state |ψ 1 (0)⟩ = |r 1 ⟩ with the system state at 2t m , Eq. (15), the fidelity against |r 1 ⟩ at 2t m can be written as More details are given in appendix B. Therefore, in the ideal case, the unknown angle can be obtained as θ = cos −1 (2F 1 − 1). It is important to note that this would enable us to retrieve any unknown angle in the range from 0 to π. However, the unknown angle could be in the range from 0 to 2π. Thus, we also need a separate fidelity as a function of sin θ, alongside F 1 , in order to be able to obtain any unknown angle in the range from 0 to 2π.
In order to obtain a fidelity as a function of sin θ, an additional sudden phase factor of ±i should be applied to either site 3 or site 6. For example, a known shift of − π 2 applied to site 6 gives a total sudden phase factor of (exp i(θ − π 2 )). As a result, the fidelity against |r 1 ⟩ at 2t m can now be written as We label the fidelity index here by 2 in order to distinguish between two fidelities. F 1 is the fidelity against |r 1 ⟩ at 2t m when the unknown phase is applied at site 6, whereas F 2 is the fidelity against |r 1 ⟩ at 2t m when the additional shift of − π 2 is added to the unknown phase, Fig. 9.

Phase Sensor Protocol and Its Robustness
Here, we discuss details of the retrieval protocol and results in the presence of imperfections. Both fidelities F 1 and F 2 are needed for this protocol, so the injection of the unknown phase must be repeatable. In practical implementations there will be some disorder, or imperfections, in the system and so we will consider the performance of the phase-sensing protocol in the presence of disorder in the system. Results for the fidelities F 1 and F 2 in the presence of off-diagonal disorder are presented in Fig.(10) and Fig.(11). Results are for a set of unknown phases ranging from 0 to 2π, and are averaged over 1000 realisations. It is apparent that the fidelity is more sensitive to off-diagonal disorder when it is approaching unity, see Fig.(10) and Fig.(11). The diagonal disorder on the other hand has very weak effect on the fidelity, see appendix C.
The phase-sensing protocol given below is designed to account for the more damaging type of disorder, which is the off-diagonal disorder. The distribution of the random number error considered here is the Gaussian distribution.
It is clear from Fig.(10) and Fig.(11) that the fidelities approaching unity are reduced in the presence of error, from the actual unit fidelity in the ideal case. As a result, the angles retrieved from these high fidelities will suffer greater error and deviate more from their actual values. To overcome this problem, we propose a flexible protocol based on the behaviour of F 1 and F 2 for different unknown phases in the presence of error.
Our phase-sensing protocol, that includes errormitigation, can be understood by examining the behaviour of F 1 and F 2 in Fig.(10) and Fig.(11). This shows that, for a given unknown phase, when F 1 is more affected by the error, F 2 is less affected, and vice versa. Therefore, our protocol uses both F 1 and F 2 to obtain two angles θ 1 and θ 2 , respectively. Then, we choose the angle with less standard deviation as the best estimate to the unknown angle.
For a given data set {F 1 ,F 2 } associated to an unknown phase, the protocol works as follows: Then, use F 2 to determine in which range the theta is: if F 2 ≥ 0.5, then 0 ≤ θ 1 ≤ π if F 2 < 0.5, then π ≤ θ 1 ≤ 2π 2. Use F 2 to find θ 2 such that θ 2 = sin −1 (2F 2 − 1) Then, use F 1 to determine in which range the theta is: Step 2 employs the angle range from − π 2 to 3π 2 , because with this range the use of F 1 to determine the range of the F 2 angle then uniquely distinguishes between just two continuous regions of θ 2 . This is necessary in order for the averaging of angles to work, as we now describe.
If for an unknown phase we have a set of 1000 random realisations of data {{F 1 , F 2 } 1 , {F 1 , F 2 } 2 , . . . , {F 1 , F 2 } 1000 } and we use the above protocol for each set of data, we will obtain {{θ 1 , θ 2 } 1 , {θ 1 , θ 2 } 2 , . . . , {θ 1 , θ 2 } 1000 }. We then take the average of all θ 1 as well as the separate average of all θ 2 . Note that for some unknown phases the averaged θ 2 can be negative because of the negative ranges in step 2 and therefore we need to add 2π to the negative angles to shift them to be in the range 3π/2 to 2π. Each averaged angle θ 1 and θ 2 corresponds to the unknown phase angle, but one of these will deviate more from the actual  unknown angle, due to the larger error that affects higher fidelities. Therefore, we use the standard deviations of θ 1 and θ 2 to determine which approach in the protocol (1 or 2) gives a lower standard deviation and so corresponds to the most accurate value of the unknown angle.
The graph generated in Fig.(12) illustrates the performance of our sensing protocol in retrieving unknown error. Still even the standard deviation for ≈ 45 • is just a small fraction of one degree, therefore, our SN system can be used as an accurate phase sensor device, with quantified performance, even when the SN device being used contains significant errors.

IV. CONCLUSION
We have demonstrated the possibility of using ad-hoc unitary transformations to design multifunctional spinnetworks starting from uncoupled components of known properties, in our case two short PST chains. The simple spin network system we obtained can deliver useful tasks for quantum communication, quantum information, and quantum sensing. It can be used as a router device for short-distance quantum communication or to create a maximally entangled state between two chosen network sites, preparing a resource that could be used in quantum information processing. Furthermore, we have demonstrated that the spin network we constructed can be used as a phase sensor device, that determines with quantified accuracy an unknown phase applied to a site within the system.
Our modelling investigations of disorder in the system shows that all these applications function with very high fidelity, even in the presence of significant (∼10-20%) fabrication or slowly varying imperfections. In more detail, modelling investigations of the effect of off-diagonal disorder (the most damaging type of disorder) demonstrate that our SN system retains EOF of 90% or higher for errors up to E/J = 20% and E/J = 10% when the maximally entangled state is collected when it first forms and at 4t m , respectively. In the phase sensing protocol, it suffers a maximum error of a fraction of a degree for imperfections up to E/J = 20%. High quality devices might be expected to have errors with E/J < 10% or lower, therefore the robustness observed in our SN system suggests this device could support various tasks in the practical application of quantum technology.
In general, off-diagonal disorder is somewhat more damaging than diagonal disorder, so reduction of offdiagonal disorder would be the highest experimental priority. However, the system demonstrates significant robustness against all practical levels of disorder, as detailed above. In the analysis, we have considered two types of error distributions, Gaussian and flat distribution. We conclude that the flat distribution is slightly more damaging than the Gaussian distribution for very large errors, but else essentially no dependence on the form of the error distribution is exhibited.
We have demonstrated that by using ad hoc unitaries to link building blocks with special properties new behaviors emerge in the network, which can be exploited for a variety of quantum information tasks. The application of this method can be extended well beyond the examples given in this paper. The simplest case would be to consider longer PST chains, which would lead, for example, to longer-distance router or entanglement distributors. Also, here we only considered the single-excitation subspace of the SN. However, multiple excitation subspaces extend the range of possible applications of SN systems, one example being the possibility of engineering unitaries for quantum gates using the zero-, one-, and two-excitation subspaces. Furthermore, the method we propose-the engineering of coupled networks via appropriate unitaries applied to uncoupled spin chains-is also applicable to higher-excitation subspaces. We plan to explore this in future work.

V. ACKNOWLEDGMENT
AHA acknowledges support from the WW Smith Fund at the University of York.