Switching and Swapping of Quantum Information: Entropy and Entanglement Level

Information switching and swapping seem to be fundamental elements of quantum communication protocols. Another crucial issue is the presence of entanglement and its level in inspected quantum systems. In this article, a formal definition of the operation of the swapping local quantum information and its existence proof, together with some elementary properties analysed through the prism of the concept of the entropy, are presented. As an example of the local information swapping usage, we demonstrate a certain realisation of the quantum switch. Entanglement levels, during the work of the switch, are calculated with the Negativity measure and a separability criterion based on the von Neumann entropy, spectral decomposition and Schmidt decomposition. Results of numerical experiments, during which the entanglement levels are estimated for systems under consideration with and without distortions, are presented. The noise is generated by the Dzyaloshinskii-Moriya interaction and the intrinsic decoherence is modelled by the Milburn equation. This work contains a switch realisation in a circuit form—built out of elementary quantum gates, and a scheme of the circuit which estimates levels of entanglement during the switch’s operating.


Introduction
The constant development of quantum computing manifests itself in a great number of works concerning the physical implementations of quantum computers and networks, but also a wide range of algorithms (e.g., in quantum machine learning) is still evolving. One of the most important fields in quantum computing is analysing and detecting quantum entanglement [1][2][3], which is a characteristic feature of quantum systems. The entanglement [4][5][6], called by Einstein "spooky action at a distance", plays a significant role in quantum communication protocols. In this article, we present an analysis of entropy and entanglement level during the operation of switching and swapping of two quantum states. We utilise simulation techniques to trace the entanglement in a circuit of known quantum gates, which performs a controlled swapping operation. It should be mentioned that, the results presented in this article on entanglement changes, produced by the switch gate, provide another example of different entanglement levels generated by quantum gates. This phenomenon was also studied in the context of controlled negation gates in [7].
The simplest SWAP is a two-qubit operation, which exchanges the states of two input qubits. We can also encounter the variations of this quantum gate such as controlled SWAP (Fredkin gate) and the square root of SWAP-these gates were proposed in the twentieth century and the basic information concerning them may be found in textbooks raising the subject of quantum computing, for example, [8]. However, the interest in the SWAP gate is still vivid.

Preliminaries
In this part of the text, we define the necessary notions and definitions used in our paper. For the convenience of the reader, all used symbols are collected in Table 1.
where I H means the unity operator in H, and in the case of dim(H) = ∞, the sum is strongly convergent.
(ii) orthogonality: where δ αβ , with lower indices, stands for the corresponding Kronecker symbol, (iii) orthogonality of operators pairs product: (iv) completeness relation in operator algebra: where L 2 (H) stands for the Hilbert-Schmidt operators acting on H.
and similarly for E A (α) and E B (γ). From Equation (3) it follows: In particular, taking some |ψ ∈ H A ⊗ H B , we can write: The swapping operator Sw is defined as: from which It is obvious that: where • represents operator composition. From this, it stems that the operator norm of Sw is equal to one which means that Sw is an isometric operator (in fact it is a unitary map). (ii) if |Ψ is separable: |Ψ = |ψ ⊗ |θ , then Let |Ψ ∈ H A ⊗ H B with || |Ψ || = 1. Then, applying the Schmidt decomposition (see, e.g. [23,24]) for the dim(H) = ∞ case: where the Schmidt coefficients τ λ ≥ 0 and ∑ ∞ λ=1 τ 2 λ = 1, and the systems (|ω A λ ) and (|ω B λ ) form cons (complete orthonormal system) in H A , resp. in H B .
From the very definition Equations (10) and (11), it results that Sw is an isometric operation, therefore its operator norm is equal to one. As the Schmidt decomposition, Equation (14) is convergent in the norm, it follows that, for an arbitrary |Ψ ∈ H A ⊗ H B , the action of Sw on |Ψ is given by and resp.
is an invariant under the action of the Sw operator and In particular: and for some unitary map U.
(II) If min(dim H A , dim H B ) = ∞ then the same facts, as in point (I), are valid for the renormalised von Neumann entropies defined as and similarly for Q B .
Proof. If the Schmidt decomposition of the vector |Ψ ∈ H A ⊗ H B is given by Equation (14), then the corresponding density matrices are given by the formulas: and, therefore, and similarly and therefore S(Q B (Ψ)) = S(Q A (Ψ)).
Thus, we have presented the validity of (I).
The corresponding Schmidt decomposition theorem in the infinite dimension case is well known, see for example [23]. The corresponding reduced density operators and Q A and Q B do exist and belong to the trace class for any pure state, and their spectrums are identical if we restrict ourselves to the non-zero Schmidt numbers. However, in many cases (see the Remark 1 below) the use of the standard notion of the von Neumann entropy leads to the infinite values. It is due to the fact that the trace of the unit operator is infinite. It is why the concept of the renormalisation of the standard definition of the von Neumann entropy has been introduced by one of us [25], in order to deal with such a situation. For a given reduced density matrix, the corresponding, renormalised entropy is given by the formula: which is equal to Equation (21).
The absolute convergence of the series Equation (21) follows from the estimate The rest of the proof is obvious then.

Remark 1.
In finite dimensions, the von Neumann entropy is a non-negative, concave, lower semi-continuous, and also L 1 -norm continuous function defined on the set of all quantum states. However, in the infinite dimensional setting, the conventionally defined von Neumann entropy takes the value +∞ on a dense subset of the space of quantum states of the system under consideration [26]. Nevertheless, the von Neumann entropy, defined in a standard way, has continuous and bounded restrictions to some special (selected by some physically motivated arguments) subsets of quantum states. For example, the set of states of the quantum oscillators system with bounded mean energy forms a set of states with finite entropy [26].
Very roughly, the reason for the infinite value of the von Neumann entropy effect in the infinitedimensional setting is that in infinite dimensions there are many (too many!) sequences (λ n ) such that: for all n, λ n ≥ 0 and ∑ n λ n = 1, but ∑ n log(λ n )λ n = −∞. In other words, the sets of states for which the values of the von Neumann entropy are (in)finite have no internal points and this fact causes serious problems in practice. The use of the Fredholm determinant technique [27,28], as described and proved in [25], leads to significant improvements in this field. In particular, the notion of the renormalised von Neumann entropy formula, as given in Equation (21), does arise in a natural way and leads to L 1 -continuous functions Equation (31), which possess a lot of relevant properties, as expected for a good, infinite dimensional substitute for the standard von Neumann entropy.
The detailed, mathematical proofs of the results mentioned are under preparation for publication in a separate paper by one of the authors of the present paper [25].

Remark 2.
The kernels of the corresponding Equation (14) Schmidt expansions of the reduced density matrices Q A (Ψ) and Q B (Ψ) do not contribute to the corresponding entropies' values. From this, it follows that the ambiguity, connected to the non-triviality of the kernels, is not essential in the process of reconstructing the state |Ψ from a given Q A and Q B (see also the well known marginal problem [29]).

Swapping Local Quantum Information (Slqi)
Let us consider two-partite system A and B, consisting of a d-dimensional qudits. The corresponding space of states of the system under consideration will be denoted as With the qudits A and B, we associate the corresponding observers which, for a given global quantum state Q, have at their disposal only information contained on the corresponding reduced density matrices (termed RDMs) defined usually as for observer O A and for observer O B .
Definition 1. An operation Sw: will be called a swapping local information operation for a given Q ∈ E(H A ⊗ H B ) if the following equalities are true: Remark 3. Let us emphasise once more that swapping operations (as depicted in Figure 1) play a very important role in the constructions of the so-called quantum repeaters, which seems to be one of the important ingredients of long-distance quantum networks for quantum key distributions protocols realisation. Figure 1. A graphical representation of the SWAP operation. Local information exchange is performed on the initial state Q (the final state, after the operation, is Sw(Q)). One can observe the swapping of subsystems A and B what may be calculated by the operation of partial trace.
The first question appearing is whether the set of SLQI for a given Q is non-empty. In order to mathematically construct such an operation (protocol), we proceed in the following way.
For a given Q ∈ E(C d ⊗ C d ), let the corresponding spectral decomposition of Q be where λ j ≥ 0, ∑ λ j = 1 are the corresponding eigenvalues and the operators E j = |ψ j ψ j | form the complete ∑ E j = I H A ⊗H B and orthogonal system of projectors, that is, we can use the canonical Schmidt's decompositions of the eigenstates |ψ j : and the systems |ϕ α j ∈ H A , |θ α j ∈ H B of vectors form a complete orthonormal system of vectors in the corresponding Hilbert spaces.
Using Equation (39), we can obtain the formulas: and Now, for each j = 1 : d 2 , we define the unitary operators: for α = 1 : d.
Then we define local unitaries: and for α = 1 : d.
From the very definition, we have: For shorthand, we define: and let E j be the orthogonal projector onto the eigenvector |ψ j . Then: Let us observe that defining the vectors: which means that the formula gives the spectral decomposition of the operator Sw(Q) which is still non-negative and of trace equal to one. Now, from Equation (51), it follows, easily (see Equations (40) and (41)) that Similarly, we can prove that Thus, we have proved the following theorem: there exists a quantum operation Sw such that Proof. It follows from Equation (48).
The corresponding to the operators Q A(B) j (in the formulas Equations (40) and (41)) values of the von Neumann entropies are easy to calculate: In the case of mixed states, the entropies of the corresponding reduced density matrices Q A and Q B are different in general: where ∆

A(B) k
are the corresponding eigenvalues of the reduced density matrix Q A , resp. Q B .
From the concavity of the von Neumann entropy, it results And similarly for part B: The following estimate is derived from the obvious estimate: sup From the sub-additivity of the von Neumann entropy, we obtain: Proof. Let sp(Q), sp * (Q A ) and sp * (Q B ) stand for (the ordered in the non-increasing order) lists of the corresponding eigenvalues. The sp * means that the corresponding lists are completed with an appropriate number of zeros (in fact d 2 − d zeros ). From the Nielsen-Kempe theorem [30], it follows that, for Q being separable, the majorization relations are valid: where ≺ is the standard majorization relation, see for example, [8]. From the fact that the von Neumann entropy is a γ-monotone function, the following inequality emerges: Using the decomposition Equations (40) and (41) together with concavity Equation (59), we obtain the above result.

Remark 4.
The obtained separability criterion in the case of pure states is exact. However, in the general case of mixed states, its domain of effective action is rather weak compared with many other separability versus non-separability criteria known in the literature. The advantage of the inequality Equation (62) is that it refers only to the basic, spectral data of a state under consideration. Some applications of the obtained separability test are included in the next section of the paper.

Quantum Switch as Unitary Local Information Swapping
The work [31] presents the idea of a quantum switch as a three-qubit controlled swap gate. Let us describe an initial state of this quantum system as: where the first qubit |A and the second one |B are unknown quantum qubit states, and we assume that the states |A and |B are presented as: where α 0 , β 0 , α 1 , β 1 ∈ C and |α 0 | 2 + |β 0 | 2 = 1, |α 1 | 2 + |β 1 | 2 = 1. The third qubit |C is also called a controlling qubit and it accepts only one of two states |0 or |1 . In general, the quantum switch can be regarded as a controlled SWAP gate. The mentioned gate swaps the states |A and |B according to a state of the qubit |C .
The way of operating for the quantum switch may be described by two cases. The first case takes place when the state of the qubit |C is |0 : The quantum switch does not swap the states of input qubits. The operation of swapping is connected with the second case when the state of the qubit |C is |1 : as it can be seen in Equation (68), the states of qubits |A and |B were swapped. A unitary operation corresponding to such behaviour needs to use only three quantum gates, that is, two controlled negation gates and the Toffoli gate (suitable definition of mentioned quantum gates can be found in [8]). Figure 2 depicts the quantum circuit realising operations performed by the quantum switch. Naturally, for a given matrix, forms of utilised gates, the unitary operation U qs (characterising the quantum switch) may be calculated directly. A definition of the unitary operator (in a permutation form) is as follows: (69) Although the operation U qs captures the complete working of the switch, the evaluation of the entanglement level needs a Hamiltonian for a simpler presentation of system's evolution. In this work, we define a simplified Hamiltonian's form, because we can directly take advantage of the fact that the switch realises a swap operation only if the third qubit is in the state |1 . That leads to the basic direct form of the Hamiltonian, describing the dynamics of the operation performed by the switch, where we reuse the Pauli X and Z operators applied in a subspace of the first and the second qubit with two additional couplings equal 1 2 : The Hamiltonian H qs , together with a time variable t, allows us to express the dynamics of the switch as a unitary time evolution operator: and i represents the imaginary unit value. A matrix form of the operator, for real values of t variable, is: where t ∈ 0, 1 , and for t = 1 the switch correctly realises the swap operation for input states. If the unitary operation Equation (72) is used, then the system's state (with the control qubit in the state |0 ) may be expressed as: One can notice that there is no swapping of states. The gate U qs (t) does not perform any action on the quantum state. The action is performed when the state of the control qubit is |1 : where t ∈ 0, 1 and Λ ± (t) = 1 ± e iπt . A density matrix, for the above pure state, is defined as:

Quantum Circuit for U Qs (T) Operation
The Hamiltonian H qs (Equation 70) allows us to receive the unitary operator U qs (t). This operator has to be decomposed to the elementary gates set, to be implemented as a quantum circuit. Naturally, we can apply an approach based on the permutation operator Equation (69) of the switch but it would depict the whole process in one step. The U qs (t) decomposition to the set of elementary gates allows the construction of a circuit in which we can evaluate the entanglement level after each operation performed by a consequent gate. An exemplary circuit of quantum gates realising the switch is presented in Section 4.4.
Recently developed qiskit software [32] may be utilised for unsupervised decomposition of the operator U qs (t), preserving an influence of the parameter t ∈ 0, 1 . For example, if t = 1 4 then the circuit realises only quarter of the switch operating (in this case, the circuit's realisation has to be repeated four times to perform the whole operation). Figure 3 shows an exemplary decomposition realised in qiskit. One can notice that it enables conversion of the switch to the set of basic gates automatically. In the proposed decomposition, only CNOT and U3 gates are utilised. The source code containing this decomposition is placed in the code repository dedicated for this article [33].

The Level of Entanglement for Switch
The main task of the switch is to transfer the information from the qubit A to the qubit B, which is enclosed in Equation (68). Tracing the process of information exchange between A and B is naturally connected through examining the entanglement level between these qubits. Of course, the entanglement may also be analysed for other pairs of qubits in the switch because introduced distortions may affect other parts of this system. Figure 4 depicts the pairs of qubits in the switch. In this article, we examine the entanglement between qubits A and B when C is in state |1 for the case without and with a noise presence. To do this, we utilise the Negativity criterion for the two-qubit ρ state: where ρ T A represents a state after the partial transposition with respect to the first subsystem. The trace norm ||X|| 1 of operator X can be expressed as: |ψ |ψ |ϕ |ϕ

Remark 5.
It should be added that a sum of singular values (obtained after the singular value decomposition) of X operator can be also used to compute a value of the trace norm. Remark 6. However, the most popular way to obtain the Negativity measure value is to calculate the absolute value of the sum of all negative eigenvalues λ i of the operator ρ T A : The above equation also shows that the negative eigenvalues may be gained as the difference between the absolute and relative value of the successive λ i (the range of values for i was omitted-the Negativity measure is used for a system of two qubits, so there are only four eigenvalues).
According to Equation (76), it is necessary to calculate the following state: where ρ qs (t) symbolises a density matrix calculated as a partial trace operation, which erases |C = |1 from the system (the density matrix describes only qubit states A and B). We also use the substitutions: The mentioned Negativity criterion allows us to formulate the following theorem: Theorem 2. Let t be a real number and t ∈ 0, 1 (closed interval). The quantum switch, expressed as the unitary operation Equation (71) for the input state |AB1 , introduces entanglement between qubits |A and |B for t ∈ (0, 1) and there is no entanglement in moments t = 0 and t = 1.

Proof.
The presence of an entanglement may be stated with the use of the Negativity measure. The vector state of the switch system is affected by the operator given in Equation (72) for particular t. Then, it is transformed to the density matrix (Equation (79)) where the partial trace operation to eliminate the qubit |C (state of this qubit during the switch operating is |1 ) was performed. Next, the partial transposition according to the qubit |A must be done, and the density matrix takes form: the marking ρ T A B tells us that the system A is partially transposed, and the system B remains unchanged. We again use the following substitutions Naturally, such a matrix has four eigenvalues, but only two of them (labelled as n 1 and n 2 ) may be negative numbers: After further algebraic transformations, the value of the Negativity measure may be expressed as: The above equation shows that the value of the Negativity measure is time-dependent.
Equation (83) clearly shows that the values of amplitudes are constant. It is also easy to point out in which moments the entanglement vanishes, because of the basic properties of the sin function, for t = 0 and t = 1 the value of the Negativity measure equals zero.

Corollary 1.
For the initial state |AA1 , that is, states of the first two qubits are the same, Equation (83) illustrates that there is no entanglement in the system, because expression a 1 b 0 − a 0 b 1 takes the form a 0 b 0 − a 0 b 0 , and equals zero.

Remark 7.
It should be emphasised that the level of entanglement is calculated for the system without distortions. The highest entanglement level, according to time t, is: After the analysis of the algebraic form of the Negativity value, we obtain that its maximum value appears in the moment t = 1 2 , which results from the basic properties of the sin function. Figure 5 presents the changes in values of the Negativity measure during the switch operating, without any distortions. The first case concerns a specified state, and the second refers to arbitrary states produced by the pseudo random number generators. Equation (62) also allows us to evaluate an entanglement level in the switch for pure states, which is shown in Figure 6. The values from the chart (A) for EL(t) were calculated for Q = ρ qs1 (t): The additional noise may be introduced as the maximally mixed state: where p ∈ 0, 1 and I is the identity matrix sized 8 × 8. Unfortunately, when the extra noise is present, the criterion described in Equation (62) does not detect the entanglement properly. However, the left-hand side of the equation still indicates the changes in Entropy values because the switch is working (naturally, the value of Negativity measure points out the lack of entanglement for p ≤ 1 2 ). The chart (B) in Figure 6 shows changes in values of Negativity and Entropy EL(t) depending on parameter p.

The Level of Entanglement for Switch with Noise Presence
The switch during its operating is distorted by the Dzyaloshinskii-Moriya interaction (DMI) [34,35]. The applied interaction is described as: The marking σ (i) X tells us that the qubits, indexed as i and i + 1, may be affected by one of the Pauli operators: X or Y. We introduce an additional real-valued parameter D s ∈ 0, 1 , which describes the strength of the interaction. The mentioned parameter may be utilised directly: To examine the DMI influence on the switch, we need a new Hamiltonian H TOT , which represents the dynamics of these two joined systems: where t stands for the time and D s for the DMI strength. Thus, we can construct a unitary operator U DM qs which is equivalent of H TOT : It should be stressed that for D s = 0, we obtain the operator describing only the switch's operating. Just as before, the time variable t accepts values from the interval 0, 1 . However, the influence of DMI is modelled by the following relation, which describes the intrinsic decoherence effect, where the state in a moment t is given by the Milburn Equation [36]: where µ m , µ n stand for eigenvalues and Ξ m , Ξ n for eigenvectors of H TOT Hamiltonian. The symbol γ refers to the intrinsic decoherence rate. Eigenvalues of the Hamiltonian H TOT take the form: and its eigenvectors are: Figure 7 depicts the behaviour of the switch for some chosen values of γ and D s . As we can see, distortions have a significant impact on the switch's operating. Values of the entanglement are changed, and EL(t) values, based on the criterion Equation (62), point out that the density matrix is characteristic for a mixed state, if the intrinsic decoherence noise is added.
Values of the Negativity measure were calculated with respect to qubits A and B. EL(t) values were computed for the whole 3-qubit state of the switch. It should be emphasised that both Negativity and EL(t) can be applied to the tracking of entanglement level, if the quantum state of the system is pure.
If a state of the switch is mixed, then the Negativity measure correctly expresses a decrease in entanglement level, even in the presence of distortions. In the case of EL(t), its value does not point the entanglement but a mixed state, so we may say that the proposed criterion allows evaluation of whether the switch works properly, because for the operator U DMI qs , the whole state of the register should be pure.   Figure 8 depicts the general circuit's scheme, which may be utilised to the entanglement estimation between qubits A and B in the switch. Black elements of the circuit are responsible for the entanglement level estimation, while gray components symbolise elements which implement the switch. In general, the whole test is based on the approach of the SWAP-test [17] and properties discussed in [37]. The test is performed twice, that is, in moments when we want to estimate the entanglement's values. A measurement of ancilla qubits is performed and the difference between the probabilities of measuring state |0 may be utilised for the Evaluation of Entanglement's level (EE):

Quantum Circuit for Estimating the Level of Entanglement
where q 4 , q 5 are the additional ancilla qubits and p 0 stands for the probability of measuring state |0 . It should be noted that the estimation is carried out without distortions and, naturally, it has a different scale than the Negativity measure but the mile stones of the entanglement level at the beginning, acme (t = 1/2), and the end of the process, are properly imitated. It is worth remembering that the entanglement estimating circuit allows us to observe its level only at one point. In addition, at least two extra qubits have to be used and, finally, the experiment has to be repeated to estimate the probability distribution properly. The val-ues shown in Figure 8 are calculated by the black part of the circuit. However, the switch is implemented as the unitary operator decomposition U qs (obtained from the Hamiltonian H qs ), which is implemented as the circuit of elementary quantum gates and performs 1/12 of the whole switch operation. More details about the circuit's implementation are captured in repositories of the source code for examples mentioned in Remark 8.

Remark 8.
The values of entanglement, shown in this article, are calculated by the suitable Python scripts which may be downloaded from the Github repository [33].

Conclusions
In this article, we have presented the quantum information transfer with the use of SWAP operation and its practical application as a circuit realising the quantum switch. A theoretical definition of the SWAP operation shows the exchange of quantum states in the system's subspaces. Schmidt decomposition of quantum states allowed us to formulate the additional criterion, referring to Entropy, which may be utilized to evaluate the entanglement level during the switch's operation.
We have described the realisation of the switch and analysed the level of entanglement during its work with the use of the Negativity measure and the proposed entropy-based criterion. The implementation of the switch is enabled owing to the presented Hamiltonian. The switch may be decomposed to a circuit of elementary quantum gates and we have shown how the SWAP-test may be utilised to evaluate the level of entanglement in a chosen point of the circuit.
Levels of entanglement in the switch were analysed in two cases: with and without distortions. Distortions are modelled in three ways: with the help of maximally mixed states matrix, as Dzyaloshinskii-Moriya interaction, and as the intrinsic decoherence effect described by the Milburn equation. One can see that the generated noise has an impact on the switch operating.
Values of the proposed criterion, for estimating the entanglement's level, act similarly to values computed by the Negativity measure when there are no distortions caused by the intrinsic decoherence. If the intrinsic decoherence is present, we can still observe that a transition from EL(t) values to Negativity could be possible (e.g., multiplying EL(t) by (−1) causes curves to become more similar). It seems interesting to analyse transformations of EL(t), which could lead to Negativity values, and also to extract other needed transitions characteristic of other kinds of noise, which we postpone for future work in this area.