Entanglement witnesses in the XY chain: Thermal equilibrium and postquench nonequilibrium states

We use entanglement witnesses to detect entanglement in the XY chain in thermal equilibrium and determine the temperature bound below which the state is detected as entangled. We consider the entanglement witness based on the Hamiltonian. Such a witness detects a state as entangled if its energy is smaller than the energy of separable states. We also consider a family of entanglement witnesses related to the entanglement negativity of the state. We test the witnesses in infinite and finite systems. We study how the temperature bounds obtained are influenced by a quantum phase-transition or a disorder line in the ground state. Very strong finite-size corrections are observed in the ordered phase due to the presence of a quasi-degenerate excitation. We also study the postquench states in the thermodynamic limit after a quench when the parameters of the Hamiltonian are changed suddenly. In the case of the Ising model, we find that the mixed postquench state is detected as entangled by the two methods if the parameters of the Hamiltonian before and after the quench are close to each other. We find that the two witnesses give qualitatively similar results, showing that energy-based entanglement witnesses are efficient in detecting the nearest-neighbor entanglement in spin chains in various circumstances. For other XY models, we find that the negativity based witnesses also detect states in some parameter regions where the energy-based witness does not, in particular, if the quench is performed from the paramagnetic phase to the ferromagnetic phase and vice versa. The domains in parameter space corresponding to postquench states detected as entangled by the energy-based witness have been determined analytically, which stresses further the utility of our method.


I. INTRODUCTION
Entanglement lies at the heart of quantum mechanics and also plays an important role in quantum information theory (QIT) [1][2][3]. For pure states it is equivalent to correlations, while for mixed states the two notions differ. A quantum state is entangled, if its density matrix cannot be written as a mixture of product states. Based on this definition, several sufficient conditions have been developed. In special cases, e.g. for 2 × 2 (two-qubit) and 2 × 3 bipartite systems [4,5] and for multi-mode Gaussian states [6] even necessary and sufficient conditions are known.
However, in an experimental situation usually only limited information about the quantum state is available. This is true even for theoretical calculations for very large systems. Only those approaches for entanglement detection can be applied that require the measurement of a few observables. One of such approaches is using entanglement witnesses. They are observables that have a positive expectation value for all separable states. Thus, a negative expectation value signals the presence of entanglement. The theory of entanglement witnesses has recently been rapidly developing [7][8][9]. It has been shown how to construct entanglement witnesses that detect entanglement close to a given quantum state, even if it is mixed or a bound entangled state [10]. It is also known how to optimize a witness operator in order to detect the most entangled states [9].
Apart from determining optimal entanglement witnesses, it is also important to find witnesses that are easy to measure in an experiment or possible to evaluate in a theoretical calculation. From both point of views, witnesses based on spin chain Hamiltonians attracted considerable attention [11][12][13][14][15][16][17]. There have been already calculations for infinite chains [11,16,17]. It has been shown that the optimal witness for the thermal state of the chain is not necessarily the Hamiltonian [17]. Besides entanglement in general, witnesses based on energy can be used to detect multiparticle entanglement [13,14]. Note that even a direct relationship between entanglement measures and the energy of the thermal state has been observed in isotropic Heisenberg chains [18]. The energy-based witnesses have been used in various physical systems such as nanotubular systems [19], in molecular nanomagnets [20], in heterometallic wheels [21], and also for theoretical calculations in theoretical spin models [22][23][24].
In this paper, we extend the approach to the XY model. This model is exactly solvable and several entanglement based properties have been studied recently [25][26][27][28][29]. We also consider another approach, based on a family of witnesses that detect entanglement whenever the entanglement negativity of the nearest-neighbor twospin density matrix is nonzero [30], i.e., when the state violates the entanglement criterion based on the positivity of the partial transpose (PPT) [4,5]. We consider finite and infinite systems in thermal equilibrium and compare the temperature bounds for separability obtained from the energy-based witness and from the negativity-based witnesses.
Then, we test the entanglement witnesses in mixed states based on the following idea. We place the system in the ground state of a given XY Hamiltonian. Then, considering a quench, we change the parameters of the Hamiltonian [31][32][33][34][35]. Since the state is not an eigenstate of the new Hamiltonian, dynamics start. In the infinite time limit, the system approaches a stationary state, which is some mixture of the states appearing during the dynamics. If the Hamiltonian is non-integrable, the system is expected to be thermalized and the stationary state is described by a Gibbs ensemble with an effective temperature [36][37][38][39][40][41][42][43][44][45][46], see however Refs. [47][48][49][50]. For integrable systems, such as the XY chain, the stationary state is assumed to be described by a so-called Generalized Gibbs Ensemble (GGE) [51][52][53][54][55][56][57][58][59], for which different effective temperatures are assigned to each conserved quantities. This type of description has been exactly calculated for the quantum Ising chain [60], and a similar formalism is conjectured for the XY chain [61].
In this article, we show for the XY model that the postquench state can still be handled efficiently for large systems and the expectation value of the witness operators mentioned above can also be computed. We analyze, in which cases the mixed state is detected by the energybased witness and by the witnesses based on entanglement negativity. We find that the energy-based witness is efficient in detecting entanglement in these systems.
Our paper is organized as follows. In Sec. II, we introduce the XY model, present its free-fermion representation, calculate thermal averages and present its conjectured GGE after a global quench. In Sec. III, the entanglement witnesses are described. In Sec. IV, the temperature bounds are calculated both by the energyand the entanglement negativity-methods and also finitesize corrections are studied. In Sec. V, the bounds for postquench states are calculated. In Secs. VI and VII, we close our paper with a discussion and conclusions, respectively. In the Appendix, we present the calculation of the thermal average of the energy in finite periodic chains. < l a t e x i t s h a 1 _ b a s e 6 4 = " P 1 q 7 P f V 6 G l D C 1 b x M D Q t L 3 A 7 e Q V E = " > A A A B 7 X i c b V D L S g N B E O y N r x h f U Y 9 e B o P g K e x K U I 8 B L z l G M A 9 I l j A 7 m U 3 G z G O Z m R X C k n / w 4 k E R r / 6 P N / / G S b I H T S x o K K q 6 6 e 6 K E s 6 M 9 f 1 v r 7 C x u b W 9 U 9 w t 7 e 0 f H B 6 V j 0 / a R q W a 0 B Z R X O l u h A 3 l T N K W Z Z b T b q I p F h G n n W h y N / c 7 T 1 Q b p u S D n S Y 0 F H g k W c w I t k 5 q 9 0 d Y C D w o V / y q v w B a J 0 F O K p C j O S h / 9 Y e K p I J K S z g 2 p h f 4 i Q 0 z r C 0 j n M 5 K / d T Q B J M J H t G e o x I L a s J s c e 0 M X T h l i G K l X U m L F u r v i Q w L Y 6 Y i c p 0 C 2 7 F Z 9 e b i f 1 4 v t f F t m D G Z p J Z K s l w U p x x Z h e a v o y H T l F g + d Q Q T z d y t i I y x x s S 6 g E o u h G D 1 5 X X S v q o G 1 9 X a f a 1 S b + R x F O E M z u E S A r i B O j S g C S 0 g 8 A j P 8 A p v n v J e v H f v Y 9 l a 8 P K Z U / g D 7 / M H i 6 e P J A = = < / l a t e x i t > < l a t e x i t s h a 1 _ b a s e 6 4 = " M J c D A B b S S a P a Y X t X Y 0 C H J 5 y d q R A = " > A A A B 6 H i c b V B N S 8 N A E J 3 U r 1 q / q h 6 9 L B b B U 0 l E 1 G P B S 4 8 t 2 A 9 o Q 9 l s J + 3 a z S b s b o Q S + g u 8 e F D E q z / J m / / G b Z u D t j 4 Y e L w 3 w 8 y 8 I B F c G 9 f 9 d g o b m 1 v b O 8 X d 0 t 7 + w e F R + f i k r e N U M W y x W M S q G 1 C N g k t s G W 4 E d h O F N A o E d o L J / d z v P K H S P J Y P Z p q g H 9 G R 5 C F n 1 F i p O R 6 U K 2 7 V X Y C s E y 8 n F c j R G J S / + s O Y p R F K w w T V u u e 5 i f E z q g x n A m e l f q o x o W x C R 9 i z V N I I t Z 8 t D p 2 R C 6 s M S R g r W 9 K Q h f p 7 I q O R 1 t M o s J 0 R N W O 9 6 s 3 F / 7 x e a s I 7 P + M y S Q 1 K t l w U p o K Y m M y / J k O u k B k x t Y Q y x e 2 t h I 2 p o s z Y b E o 2 B G / 1 5 X X S v q p 6 N 9 X r 5 n W l V s / j K M I Z n M M l e H A L N a h D A 1 r A A O E Z X u H N e X R e n H f n Y 9 l a c P K Z U / g D 5 / M H 0 r W M + w = = < / l a t e x i t > h < l a t e x i t s h a 1 _ b a s e 6 4 = " F n 3 Y V U G 0 0 F K t J X j 0 / M 5 U I k n b a 9 A = " > A A A B 6 H i c b V B N S 8 N A E J 3 U r 1 q / q h 6 9 L B b B U 0 l E 1 G P B S 4 8 t 2 A 9 o Q 9 l s J + 3 a z S b s b o Q S + g u 8 e F D E q z / J m / / G b Z u D t j 4 Y e L w 3 w 8 y 8 I B F c G 9 f 9 d g o b m 1 v b O 8 X d 0 t 7 + w e F R + f i k r e N U M W y x W M S q G 1 C N g k t s G W 4 E d h O F N A o E d o L J / d z v P K H S P J Y P Z p q g H 9 G R 5 C F n 1 F i p 6 Q 3 K F b f q L k D W i Z e T C u R o D M p f / W H M 0 g i l Y Y J q 3 f P c x P g Z V Y Y z g b N S P 9 W Y U D a h I + x Z K m m E 2 s 8 W h 8 7 I h V W G J I y V L W n I Q v 0 9 k d F I 6 2 k U 2 M 6 I m r F e 9 e b i f 1 4 v N e G d n 3 G Z p A Y l W y 4 K U 0 F M T O Z f k y F X y I y Y W k K Z 4 v Z W w s Z U U W Z s N i U b g r f 6 8 j p p X 1 W 9 m + p 1 8 7 p S q + d x F O E M z u E S P L i F G t S h A S 1 g g P A M r / D m P D o v z r v z s W w t O P n M K f y B 8 / k D f 1 m M x A = = < / l a t e x i t > 1 < l a t e x i t s h a 1 _ b a s e 6 4 = " F n 3 Y V U G 0 0 F K t J X j 0 / M 5 U I k n b a 9 A = " > A A A B 6 H i c b V B N S 8 N A E J 3 U r 1 q / q h 6 9 L B b B U 0 l E 1 G P B S 4 8 t 2 A 9 o Q 9 l s J + 3 a z S b s b o Q S + g u 8 e F D E q z / J m / / G b Z u D t j 4 Y e L w 3 w 8  transverse Ising chain < l a t e x i t s h a 1 _ b a s e 6 4 = " 2 p 2 Q A n A I 6 g 6 p W U Z 8 o X 6 x a t M n o K Y = " > A A A B 8 X i c b V D L S g N B E O y N r x h f U Y 9 e F o M Q L 2 F X g n o R A l 4 8 R j A P T J b Q O 5 l N h s z M L j O z Q g j 5 C y 8 e F P H q 3 3 j z b 5 w k e 9 D E g o a i q p v u r j D h T B v P + 3 Z y a + s b m 1 v 5 7 c L O 7 t 7 + Q f H w q K n j V B H a I D G P V T t E T T m T t G G Y 4 b S d K I o i 5 L Q V j m 5 n f u u J K s 1 i + W D G C Q 0 E D i S L G E F j p c d y d 4 B C 4 I 1 / 3 i u W v I o 3 h 7 t K / I y U I E O 9 V / z q 9 m O S C i o N 4 a h 1 x / c S E 0 x Q G U Y 4 n R a 6 q a Y J k h E O a M d S i Y L q Y D K / e O q e W a X v R r G y J Y 0 7 V 3 9 P T F B o P R a h 7 R R o h n r Z m 4 n / e Z 3 U R N f B h M k k N V S S x a I o 5 a 6 J 3 d n 7 b p 8 p S g w f W 4 J E M X u r S 4 a o k B g b U s G G 4 C + / v E q a F x X / s l K 9 r 5 Z q t S y O P J z A K Z T B h y u o w R 3 U o Q E E J D z D K 7 w 5 2 n l x 3 p 2 P R W v O y W a O 4 Q + c z x 9 H z Z A D < / l a t e x i t > ( = 1)

II. MODEL AND METHODS
In this section, we describe the model, present the XY spin-chain Hamiltonian and show how to calculate important quantities for it in a free-fermion representation, including averages for finite temperatures. Finally, we discuss how to handle nonequilibrium stationary states after a quench.

A. The XY chain
The XY chain is defined by the Hamiltonian where σ x l , σ y l , and σ z l are Pauli spin operators acting on the spin at site l, and σ α L+1 ≡ σ α 1 for α = x, y, z. We consider chains with periodic boundary conditions and generally calculate quantities in the thermodynamic limit, L → ∞. In a few cases we study also finite chains up to L = 12 through numerical techniques. The parameters 0 ≤ γ ≤ 1 and h ≥ 0 denote the strength of the anisotropy and the transverse field, respectively. The special case γ = 1 represents the transverse Ising model, and for h = 0, γ = 0 the Hamiltonian reduces to the XX chain. The equilibrium phase diagram is shown in Fig. 1.

B. Free-fermion representation
Using standard techniques [62,63], the Hamiltonian in Eq. (1) is expressed in terms of fermion creation and annihilation operators η † p and η p as where the sum runs over L quasi-momenta, which are equidistant in [−π, π] for periodic boundary conditions and almost equidistant in [0, π] for free boundary conditions and a finite L, but again equidistant in the limit L → ∞. The energy of the modes is given by [31,32,61] ε (p) = 2 γ 2 sin 2 p + (h − cos p) 2 (3) and the Bogoliubov angle Θ p diagonalizing the Hamiltonian is given by The energy of the ground state equals since the state is the fermionic vacuum.

Disorder line
The disorder line, also shown in Fig. 1, is given by Alternatively, we can express the h values as a function of γ corresponding to the disorder line as As we will see, h d will turn out to be a central quantity in our paper. The system has a special behavior at the disorder line given by Eq. (6). Here the energy of modes has the simple form and the ground-state energy density in the thermodynamic limit is given by Below the disorder line holds and the long-range two-point correlation functions have an oscillatory behavior, whereas at the disorder line they are constant [31,32]. Above the disorder line we have and the two-point correlation functions do not have an oscillatory behavior.
C. Averages at finite temperature Next, we summarize results for the thermodynamic limit, L → ∞, used in the article. Calculations of the energy for finite periodic chains are presented in the Appendix A.

Energy
At finite temperature, T > 0, the partition function is expressed as and the average value of the energy is given by with the definition setting k B = 1.

Correlation functions
The correlation functions of the XY model are calculated in Refs. [31,32] and the nearest-neighbor correlations can be expressed as where we define the sums We stress once more that the relations above are valid in the thermodynamic limit, L → ∞. One can easily check that holds with σ z l T = g 0 , which further supports the correctness of our calculations. In particular, it helps to verify that constant factors have been taken into account correctly.

D. Nonequilibrium stationary states after a quench
We consider global quenches at zero temperature, which suddenly change the parameters of the Hamiltonian from γ 0 , h 0 for t < 0 to γ, h for t > 0. For t < 0 the system is assumed to be in equilibrium, i.e., in the ground state |Φ 0 of the Hamiltonian H 0 with parameters γ 0 and h 0 . After the quench, for t > 0, the state evolves coherently according to the new Hamiltonian H as Correspondingly, the time evolution of an operator in the Heisenberg picture is The energy of the system after the quench is given as where the occupation probability of mode p in the initial state |Φ 0 is given as For the XY model it is expressed through the difference ∆ p = Θ 0 p − Θ p of the Bogoliubov angles as with the cosine of the difference ∆ p given as where the index 0 refers to quantities before the quench [61]. In the thermodynamic limit, Eq. (20) can be rewritten as After large enough time and in the thermodynamic limit the system is expected to reach a stationary state, for which the energy equals the energy of the initial state Similarly, for an observable O the stationary value is given by Tr(ρ q O).
In the stationary state, due to conserved symmetries, averages of correlations are described by a Generalized Gibbs Ensemble (GGE) [51][52][53][54][56][57][58][59]. In this case to each fermionic mode an effective temperature, T eff (p) is attributed through the relation [61] tanh This follows by comparing the relations in Eqs. (13), (14) and (20). In this way the nearest-neighbor correlations in the stationary state can be obtained as in section II C, In particular, we have to apply Eq. (28) for the correlation functions in Eqs. (15) and (16).

III. ENTANGLEMENT WITNESSES
Generally an operator W is called an entanglement witness, if its expectation value, W satisfies the following requirements [64,65].
(i) For all separable states holds.
A single entanglement witness cannot detect all entangled states. On the other hand, if for some states ρ k we have for all k, k , then for any mixture of such states the expectation value of the witness remains the same, i.e., holds for all k. Thus, if ρ k are detected as entangled, ρ given in Eq. (32) is also detected as entangled, even if ρ is highly mixed. Let us consider now the case, in which the ρ k family is obtained via a unitary dynamics from an initial state. If for a state ρ we have W ρ then for any state given as we have the same expectation value if K commutes with W as It is easy to see that the expectation value is equal to W ρ even for an arbitrary mixture [like in Eq. (32)] of the states given in Eq. (34). Thus, if ρ is detected as entangled by the witness W, an arbitrary mixture of the states given in Eq. (34) is also detected. Based on these, we can see that entanglement witnesses might be especially useful in detecting entanglement in a mixture of states obtained from a unitary dynamics with a Hamiltonian that commutes with the witness. In general, an entanglement witness that is conserved during the quench, might be especially useful in detecting entanglement.
In this section, we present the energy-based witness [11], which is constructed with the Hamiltonian and thus, based on the arguments above, it is especially suited for entanglement detection in a postquench state given in Eq. (26). We also present the negativity-based witnesses [17] what we will use to analyze the entanglement properties of the XY chain.

A. Energy-based witness
In this section, we review the idea of detecting entanglement with energy measurement [11,15,16].
First we calculate the minimum of H for product states of the form with the single particle states where k labels the site in the real space. The energy per site for the state given in Eqs. (37) and (38) is which has a minimum at θ ↑ = θ ↓ and for Thus, the minimum energy per site for product states is given by Then, we consider separable states given as [77] where ρ (k) m are single particle pure states. The bound given in Eq. (41) is also the bound for mixed separable quantum states, since the expectation value H = Tr(ρH) (43) is linear in ρ, and the set of separable states is convex. Then we can simply write the witness detecting entanglement based on the energy as We will compute W E for thermal states [see in Eq.
The ground state is a product state of the form given in Eqs. (37) and (38) for θ ↑ = θ ↓ and φ fulfilling Eq. (40). Note that based on the bound for separable states given in Eq. (41) we have which means that there is a separable state with energy E sep . However, since E 0 = E sep and the ground state is non-degenerate, there is only a single pure state having this energy and it must be a product state. Thus, only by knowing E 0 and E sep , and the fact that the ground state is non-degenerate, we can conclude that the ground state must be a product state along the disorder line.

B. Negativity-based witnesses
In this section, we summarize the method presented in Ref. [17] and show how to apply it to the XY chain. It suggests to use not the Hamiltonian but another operator as an entanglement witness for spin chains in thermal equilibrium, which is shown to be connected to partial transpose of the density matrix [4,5], and to entanglement negativity [30].
Deciding whether a quantum state is entangled is a hard task in general. However, there are some necessary conditions for separability, that are easy to test. If these conditions are violated then the state is entangled. One of the most important conditions of this type is the PPT condition [4,5]. For a bipartite density matrix given as ρ = kl,mn ρ kl,mn |k l| ⊗ |m n| (47) the partial transpose according to first subsystem is defined by exchanging subscripts k and l as It has been shown that for separable quantum states [4,7] ρ T A ≥ 0 (49) holds. Thus, if ρ T A has a negative eigenvalue then the quantum state is entangled. For 2 × 2 and 2 × 3 systems, the PPT condition detects all entangled states [7]. For systems of size 3 × 3 and larger, there are PPT entangled states [5,78]. One can even use the partial transpose to tell how much a quantum state is entangled. The entanglement negativity [30] is defined as where µ ν are the eigenvalues of the partial transpose ρ T A . Let us turn now to XY chains. Let us consider the nearest-neighbor reduced density matrix, ρ, which will be defined in the σ z basis given by | ↑ and | ↓ . We use the convention Due to the symmetries of the problem, ρ is a direct sum of two 2 × 2 matrices living in the space spanned by the states |1 , |4 and |2 , |3 , respectively. Consequently, it is represented as where we indicated the elements that are necessarily zero explicitly. The matrix is real and symmetric, hence ρ 14 = ρ 41 and ρ 23 = ρ 32 hold, furthermore we have the constraint due to unit trace, ρ 11 + ρ 22 + ρ 33 + ρ 44 = 1. Due to the permutational symmetry of the problem we also have Due to Eqs. (15) and (16), ρ 14 = −2g s , and holds if γ ≥ 0. In Appendix B we also show that holds.
For the partially transposed density matrix, by indicating the zero elements explicitly we obtain The lowest eigenvalue of ρ T A , denoted by µ min is nonnegative if and only if the state is separable [4,7]. According to Eq. (55), the minimal eigenvalues of the 2 × 2 submatrices are and the minimal eigenvalue is just min ).
Then, we obtain the eigenvalue as In order to proceed, we need to know that the partial transposition of a two-qubit state has at most one negative eigenvalue and all the eigenvalues lie in [−1/2, 1] [79,80]. Thus, only one of the µ  can be negative, and when they are equal to each other, they must be non-negative and the state must be separable.
Let us now examine the relation between the eigenvalues µ (1) min and µ (2) min , and the parameters h and γ. At the disorder line where Eq. (6) is satisfied, we have µ (1) min = µ (2) min and here the state is separable even at T = 0, which is consistent with what we mentioned about the eigenvalues of the partial transpose. We have checked numerically in finite systems, that in the oscillatory region where h 2 + γ 2 ≤ 1, the relation µ (1) min ≤ µ (2) min (64) holds. On the other hand, if h 2 + γ 2 > 1 then we have Let us now show that a simple entanglement witness can be obtained based on the expression for µ (2) min given in Eq. (61). In particular, we can define the operator and hence its expectation value gives one of the eigenvalues of the partial transpose of the two-qubit density matrix which also implies that W N is an entanglement witness. It is instructive to rewrite the witness given in Eq. (66) as where The form in Eq. (68) expresses the fact that the witness W N detects entangled states in the vicinity of the state given in Eq. (69). If µ min > µ (2) min holds then W N is an entanglement witness and its expectation value even gives us the minimal eigenvalue of the partial transpose of the nearest-neighbor two-qubit density matrix. The minimum of the expectation value of the witness is W N = −1/2 for the maximally entangled state given in Eq. (69). If µ we can derive an entanglement witness It is instructive to rewrite the witness given in Eq. (71) as where the state is defined as If the condition in Eq. (70) holds, then However, in general, holds and the witness W N is not sufficient to detect all entangled states, if Eq. (65) does not hold. We will show that a one-parameter family of entanglement witnesses is sufficient. Let us define the entanglement witness [1,2] where the state is given as Since for ρ 23 the relation Eq. (54) holds, the two coefficients have an opposite sign. Based on the general relation we can write that which is an approach somewhat different from that of Ref. [17], which presented a nonlinear witness operator. Note that W N is member of the family In summary, the witness W N given in Eq. (66) can be used to detect entanglement in the nearest-neighbor state of an XY system in thermal equilibrium if h 2 + γ 2 > 1 holds. Otherwise, W N given in Eq. (71) will detect many entangled states. However, all entangled states are detected by the family of witnesses given in Eq. (76).
In the case of a quench the parameters of the Hamiltonian are changed suddenly, as described in Sec. II D. Using the quench protocol (h 0 , γ) → (h, γ) we noticed numerically, that the condition Eq. (65) (7).

IV. TEMPERATURE BOUNDS FOR EQUILIBRIUM THERMAL STATES
In this section, we consider thermal states, which are generally entangled at low temperature, but at a sufficiently high temperature they are separable. Using the energy-based witness given in Eq. (44) and the negativity-based witnesses given in Eqs. (66) and (76), we calculate temperature bounds below which the state is detected as entangled. We note that at specific points there have been calculations for infinite chains [11,16,17]. Here we consider several parts of the phase diagram and also study the finite size corrections that turn out to be very important in the ordered phase.

A. Energy-based witness
The energy-based witness W E described in Sec. III A detects a state as entangled if H < E sep . For thermal states, there is a corresponding temperature bound T E such that the state is detected as entangled by the witness if T < T E . We will study thermal states in the XY chain based on these ideas. The Hamiltonian H is given in Eq. (1), and the minimal energy for separable states is given in Eq. (41). Note the different scales in the x axis.

Thermodynamic limit
First, we consider the thermodynamic limit. In Fig. 2, we show T E as a function of h, for different values of the anisotropy. We can make the following observations. Let us start with the paramagnetic phase where h > 1, as shown in Fig. 1. At a fixed h value, T E monotonously decreases with γ, and we even have T E → 0 as γ → 0. At a fixed 0 < γ ≤ 1, T E also decreases with decreasing h and passing through the critical point at h = 1 in the ordered phase approaches zero at the disorder point h = h d , where h d is given in Eq. (7). Decreasing h further at the other side of the disorder point, the temperature bound starts to increase monotonously. In Fig. 2, when going from bottom to top, the order of the T E (h) curves at h = 0 is the opposite of that at h > 1. That is, if γ 1 > γ 2 then we have if h > 1. On the other hand, we have at h = 0. Finally, at the disorder point h = h d , there is a singularity If γ = 0 then we have the XX-model and it has a polarized ground state if h ≥ 1, which is separable. Consequently, T E = 0 in this region.

Finite-size corrections
We have repeated the calculation of the temperature bound on finite transverse Ising chains working in the Ising spin basis up to L = 12. Results are shown in the main panel of Fig. 3. The corrections are relatively small in the paramagnetic phase, while in the ordered phase they are quite large. To see more precisely the finitesize dependence of the correction term we repeated the calculation in the free-fermion basis as described in the Appendix A.
We have studied the finite-size dependence of the correction term at different points of the phase diagram. We considered several values of h corresponding to the ordered phase and to the paramagnetic phase, as well as to the critical point. Using lin-log scale in the figures the curves are asymptotically linear, and thus the size dependence is well described by the form where the power-law correction term is relevant for short chains, L < L 0 . In the paramagnetic phase and at the critical point L 0 is just a few lattice spacings (L 0 ≈ 2.6 and 6.2, for h = 1.25 and 1.0, respectively), while in the ferromagnetic phase it is much longer (L 0 ≈ 52, 610 and 5800, for h = 0.75, 0.5 and 0.25, respectively) and tends to infinity at h → 0. (In the ferromagnetic phase the exponent a is h-dependent, it is approximately 0.25 and 0.42, for h = 0.25 and 0.5, respectively.) The slow finitesize convergence of the results is due to the presence of an exponentially small gap in the ordered phase, which has a large correction.

B. Negativity-based witnesses
The negativity-based witnesses W N and W N,p described in Sec. III B detect a state as entangled if its negativity is nonzero. For thermal states, there is a corresponding temperature bound T N such that the state is detected as entangled by the witness if T < T N . We will study thermal states in the XY chain based on these ideas.
Results for the transverse Ising chain are in the main panel of Fig. 4. We carried out calculations for the finite chain in the Ising spin bases. We also made calculations in the thermodynamic limit using the formula with the nearest-neighbor correlations given in Eq. (61). We find that the temperature bounds obtained using the entanglement negativity witness given in Eq. (66) are considerably higher than those obtained using the energybased witness; the difference is around a factor of two for h ≈ 0, while the difference is less for h > 1. The finite-size corrections appear almost negligible in the paramagnetic phase (h > 1), but are much larger in the ferromagnetic phase (h < 1). The finite-size corrections observed for the negativity-based entanglement witness have the same origin, as those for the energy witness. Indeed, both the entanglement negativity [given via the minimum of the values in Eqs. (61) and (63)] and the energy [given in Eq. (17)] can be obtained via nearest-neighbor correlation functions.
We have repeated the calculation for two values fulfilling 0 < γ < 1, and the results are shown in the insets in Fig. 4. The results are calculated using the negativity-based witness given in Eq. (66) for h > h d and the family of negativity-based witnesses in Eq. (76) for h < h d . Equivalently, we used the formula giving the smallest eigenvalue of the partial transpose of the twoqubit state. In particular, we used the formula for µ (2) min in Eq. (61) for h > h d , and the formula for µ (1) min in Eq. (63) for h < h d . If the smallest eigenvalue is negative, then the two-qubit state is entangled. In these cases too, the convergence to the thermodynamic limit is very fast in the paramagnetic phase, while in the ferromagnetic phase the convergence is much slower. We find that the temperature bounds obtained using the entanglement negativity witness are considerably higher than those obtained using the energy-based witness.

V. ENTANGLEMENT IN NONEQUILIBRIUM POSTQUENCH STATES
In this section, we consider global quenches in the system, as described in Sec. II D and study the entanglement properties of nonequilibrium stationary states, which are obtained in the large-time limit after the quench. To calculate averages we use the GGE protocol and assign different effective temperatures to each fermionic modes, as described in Eqs. (27) and (28). First we apply the energy-based witness in Eq. (44) and then the entanglement negativity-based witnesses in Eqs. (66) and (76).

A. Energy-based witness
The energy-based witness detects the postquench state as entangled if holds, where H is the Hamiltonian after the quench. In the following, for simplicity we consider the case when γ 0 = γ holds and study the area in the (h 0 , h) plane corresponding to quenches in which entanglement has been detected.
We will now obtain the boundaries analytically using the bound E sep given in Eq. (41). We have to consider two cases.
(i) Let us consider first the case when holds. Then, from Eq. (87), we obtain the relation The right-hand side of Eq. (89) corresponds to the top line in the equation defining the bound for separable states in Eq. (41). The left-hand side is equal to the energy of the state after quench given in Eq. (24). The integrals are defined as −h 0 cos p + cos 2 p + γ 2 sin 2 p γ 2 sin 2 p + (h 0 − cos p) 2 dp. (90) The left-hand side and the right-hand side of Eq. (89) are up to second-oder in h. Thus, the condition given in Eq. (89) holds if where the lower and upper bounds are defined as Note that h − and h + depend on h 0 . Note also that we assumed that the condition given in Eq. (88)  holds. Then, from Eq. (87), we obtain the relation The right-hand side of Eq. (94) where the upper bound is defined as and it depends on h 0 . Note that we assumed that the condition given in Eq. (93) and if the postquench state is detected as entangled, then h must fulfill Eq. (91). Let us increase h 0 . We arrive at a point when Increasing h 0 further, we find that If the postquench state is detected as entangled, then h must fulfill the relation Based on these, for a given h 0 and h, the postquench state is entangled if where h + and h − are given in Eq. (92), andh + is given in Eq. (96). We stress that we obtained the boundaries analytically.  7). The blue and the gray filled areas overlap with the yellow area such that all yellow-filled area is part of the blue and the gray filled areas. Thus, all postquench states detected by the energy-based witness are also detected by the negativity-based witness. In panel (d) the limit γ → 0 + is considered, which is different from the case when γ = 0, see text.
In Fig. 5, the region in which the postquench states are detected as entangled by the energy-based witness are indicated with a yellow filled area. In Fig. 5(a), we consider the case with γ = 1 and hence we have a quantum Ising chain. The region corresponding to postquench states detected as entangled consists of a single connected part. In Fig. 5(b), (c), and (d), we have γ = 0.8, γ = 0.6 and γ → 0 + , respectively. The region corresponding to postquench states detected as entangled consists of two connected parts, which touch each other at where h d is given in Eq. (7). The point given by Eq. (102) corresponds to a quench in which the system is at the disorder line before and after the quench, and due to h = h 0 the parameter h does not change. Thus, the thermal state is separable, as discussed in Sec. III A.
If the initial state is in the ferromagnetic domain, h 0 < 1, the region of postquench states detected as entangled is rather narrow, the values of h corresponding to an entangled entangled postquench states are close to h 0 . Starting the quench from the paramagnetic phase, h 0 > 1, the the domain of postquench states detected as entangled is relatively wider.
Starting the quench just at the critical point, h 0 = 1, the boundaries exhibit a singularity since holds.

B. Negativity-based witnesses
We have calculated the region of postquench states detected as entangled by the entanglement negativity-based witness. In Fig. 5, the results are shown indicating that the postquench states are detected as entangled with blue (gray) filled areas, if the calculation is used µ (1) min given in Eq. (63) (µ (2) min given in Eq. (61)). In other words, the blue (gray) area denotes states that are detected by the family of negativity-based witnesses in Eq. (76) (by the negativity-based witness given in Eq. (66)). All postquench states that are detected by the energy-based witness are also detected by the negativity-based methods.
In Fig. 5(a), we consider the case with γ = 1 and hence we have a quantum Ising chain. In this case, the negativity-based witness with µ (2) min is applicable in the whole phase diagram. In Fig. 5(b), (c), and (d), we have γ < 1, and the condition µ (1) min < µ (2) min is fulfilled in a part of the phase diagram. Thus, entangled postquench states are also detected based on µ (1) min . In Fig. 5(d) the limit γ → 0 + is considered, which is however not identical to the γ = 0 case, which corresponds to the XX-model. In the latter model, for all h 0 and h we have hence this case needs a special treatment. If the system is ideally isolated, than according to Eq.(18) the system remains in its original state, |Φ 0 (t) = exp(−iẼ 0 t)|Φ 0 , withẼ 0 = Φ 0 |H|Φ 0 . In this state the the correlations in Eqs. (15) and (16) are given by: Thus, the postquench state is separable for h 0 ≥ 1 and entangled for h 0 < 1, independently of the value of the postquench parameter h. We note, that |Φ 0 (t) is generally not the ground state of H, since the modes for p 1 < p < p 2 are occupied, where p 1 = min[arccos(h 0 ), arccos(h)] and p 2 = max[arccos(h 0 ), arccos(h)]. This follows from Eqs. (22) and (23). In the limit γ → 0 + , the system can be considered not ideally isolated, which means that an arbitrarily small, but non-zero interaction is present with the environment. Then the system for sufficiently long time will decay to its ground state, having no occupied modes. This is formally equivalent to the condition in Eq. (27), which for having | cos ∆ p | = 1 predicts T eff (p) = 0 for each modes. As a consequence the correlations in Eqs. (15) and (16) are the same as in the ground state of the postquench Hamiltonian, and the postquench state is separable for h ≥ 1 and entangled for h < 1, independently of the value of the initial parameter h 0 .
We can see that the entangled region detected by the negativity method is larger, than that detected by the energy-based witness. Even if the initial state is separable, corresponding to h 0 = h d , the postquench state can be detected as entangled by the negativity-based witness, if h = h d . In this case, the entanglement is obtained due to the entangling dynamics of the Hamiltonian H.
Note that the border of the entangled domain is singular at h 0 = 1, which corresponds to the case when the system is critical before the quench. Note also that for γ < 1 the border of the entangled domain is horizontal where the two disconnected parts meet at the point given in Eq. (102).

VI. DISCUSSION
Entanglement in mixed quantum states is a difficult problem, in particular when the degrees of freedom is large and we approach the thermodynamic limit. The possible systems of investigation are usually quantum spin systems, most often quantum spin chains. Such type of quantum spin chains could have experimental realizations in condensed matter systems [81] or they could be engineered artificially through ultracold atomic gases in an optical lattice. Recently, this latter type of technique is very well developed and different intriguing questions could be studied experimentally [82][83][84][85][86][87][88][89][90].
In this paper we consider the XY chain, which is integrable through free-fermionic techniques and several exact results are available, mainly in the ground state but there are some known results even at finite temperature [31,32]. We consider the entanglement properties of mixed states of the XY chain. To detect entanglement we use different entanglement witnesses: an energybased witness and a family of witnesses that detect states with a nonzero bipartite entanglement negativity. Using the former is technically simpler, but it does not detect all states that have nearest-neighbor entanglement. In contrast, the witnesses based on entanglement negativity can detect all states that have nearest-neighbor entanglement, but it is generally more complicated to calculate their expectation value.
First we considered thermal states, for which some previous calculations are available at specific points for infinite chains [11,16,17]. Here we performed the entanglement detection both for finite chains and in the thermodynamic limit. In the ordered phase of the system very strong finite-size corrections are detected, which are due to the presence of a quasidegenerate first excited state and the corresponding gap is exponentially small with the length of the chain.
One of the main novelties of the present paper is that we considered also mixed states which are due to a quench, when parameters of the Hamiltonian of the system are changed abruptly and the time evolution of the system is governed by the new Hamiltonian. After a sufficiently long time the system will approach a nonequilibrium stationary state, the properties of which are of vital importance. The postquench state is a mixed quantum state. For general, non-integrable systems it is expected to be a thermal state, which is described by an appropriate Gibbs ensemble. For integrable systems, for which examples are the XXZ or the XY chains, the postquench state is described by a so-called Generalized Gibbs Ensemble. We observed, that the postquench state has an entangled two-qubit reduced state for the nearest neighbors, if the parameters involved during the quench (in our case the transverse fields h and h 0 ) are sufficiently close to each others. If the parameters change significantly, then the nearest-neighbor two-qubit reduced state for the nonequilibrium stationary state becomes non-entangled. We expect that the latter statement is generally valid in various systems for the entanglement of nonequilibrium postquench states, at least for the entanglement of few-particle blocks. Additionally, in the XY models different from the Ising model, we found entanglement if the quench is performed from the paramagnetic phase (h 0 > 1) to the ferromagnetic phase (h < 1) and vice versa. These cases are relevant especially for small γ. It would be interesting to check the entanglement properties of postquench states of other (Bethe-Ansatz) integrable models.
While we studied the nearest-neighbor entanglement of the postquench state, other properties uncovering hidden criticality of the initial system not detectable by local quantities have recently been considered [91]. The method has been based on efficient lower bounds on the negativity in XY chains [92,93]. We have shown that the criticality of the initial state can still be seen in the boundaries of the regions with nearest-neighbor entanglement.

VII. CONCLUSIONS
We used energy-based entanglement witnesses to detect entanglement in the thermal states of the infinite and finite XY chain, as well as in the mixed states arising after quench. We compared their performance to the negativity-based entanglement witness. We find that they efficiently detect entanglement in the systems we considered.
For periodic chains in the fermionic representation there are two sectors, depending on the parity of the number of fermions [94,95].
The partition function of the system is given as where Z (±) are the partition functions calculated with even and odd number of fermions, respectively. The even partition function for L = 2 sites is given as