## Abstract

This research analyzes the adverse impact of white noise on collective quantum measurements and argues that such noise poses a significant obstacle for the otherwise straightforward deployment of collective measurements in quantum communications. Our findings then suggests addressing this issue by correlating outcomes of these measurements with quantum state purity. To test the concept, a support vector machine is employed to boost the performance of several collective entanglement witnesses by incorporating state purity into the classification task of distinguishing entangled states from separable ones. Furthermore, the application of machine learning allows to optimize specificity of entanglement detection given a target value of sensitivity. A response operating characteristic curve is reconstructed based on this optimization and the area under curve calculated to assess the efficacy of the proposed model. Finally, we test the presented approach on an experimental dataset of Werner states.

### Similar content being viewed by others

## Introduction

Collective quantum measurements, which are measurements performed simultaneously on multiple copies of the investigated state, are an invaluable tool in quantum state analysis^{1}. Since the pioneering experimental demonstration in 2005^{2}, collective measurements have been instrumental in practical implementation of a number of entanglement witnesses^{3,4,5,6,7,8,9,10,11} and to infer quantum state purity or fidelity^{12,13}. The key advantage of these measurements lies in the projection of subsystems from different copies of the examined state onto a common entangled state (see nonlocal projection in conceptual diagram in Fig. 1). Thanks to these nonlocal projections, collective measurements outperform ordinary single-copy measurements in terms of sensitivity (e.g. the volume of detected entangled states^{5}) or in the efficiency in achieving set tasks with fewer measurements^{9,10}. Notably, the required number of collective measurements does not grow as prohibitively fast with the size of the Hilbert space as is the case with standard quantum state tomography.

Application-wise, collective measurements hold particular appeal in conjunction with entanglement distribution in quantum networks. Their layout (visualized in Fig. 1) aligns with the topology of entanglement swapping making collective measurements straightforwardly deployable in quantum repeaters^{14}, relays^{15} and in teleportation-based quantum communications networks^{16,17}. For instance, research has demonstrated applicability of collective measurements for a rapid and practical diagnostics of the entanglement swapping protocol^{18}. Moreover, direct measurement of Hilbert-Schmidt distance through collective measurements has been used to speed-up K-means classification algorithm^{12}. Usage of these collective measurements may also prove interesting beyond optical platforms, considering that light can facilitate entanglement detection in other physical system as well^{19,20,21}.

As explained above, the power of collective measurements lies in the nonlocal projections. However, these projections are notably susceptible to white noise, and consequently, utilization of collective measurements in real-world quantum communications necessitates an assessment of their performance in the presence of that noise. In section Methods of this paper, we analyze propagation of the investigated state through noisy channel and document the adverse effect of the channel on collective measurements as the noise accumulates polynomially fast with the power corresponding to the number of copies projected onto a shared entangled state. Hence even a rather weakly perturbing realistic quantum channel can cause the projections to become local (no longer projecting on an entangled state) and, thus, the entire collective measurement looses its power. This effect is exemplified on the incapability of collectibility (a collective entanglement witness) to correctly detect entangled Werner state with a noise level above \(p = 1-\tfrac{\sqrt{3}}{2} \approx 0.13\)^{4}.

Simultaneously, white noise is commonly associated with a reduction in the purity of transmitted quantum states. In this paper, we analyze the correlation between collective entanglement witnesses and purity of the states aiming to mitigate the influence of white noise on collective measurements. Our findings reveal that this way one can considerably enhance sensitivity of collective entanglement witnesses (true positive rate^{22,23} or TPR) at a relatively small cost in decreased specificity (increased false positive rate or FPR). A support vector machine is employed to find the optimal classification boundary between entangled and separable states, maximizing specificity for a given value of sensitivity boost (see Section States generation and classification). Furthermore, targeting several sensitivity values and identifying the corresponding specificity allows us to reconstruct the entire receiver operating characteristic (ROC) curve, evaluating the method’s effectiveness in terms of the area under this curve (AUC). Note that reconstructing the ROC curve would not be possible without the use of machine learning as analytical entanglement witnesses assume perfect specificity (FPR\(=0\)). However, such assumption is unrealistic due to the inevitable technical imperfections in practical conditions, at least such as detection shot noise^{24}. Our analysis of the ROCs contributes to the assessment of practicality of collective entanglement witnesses for near-future quantum communications networks.

## Vulnerability of collective measurements to white noise

In this section, we demonstrate that collective measurements are vulnerable to the presence of noise, in particular white noise. The sensitivity of entanglement swapping towards several kinds of noise has already been studied thoroughly in the literature^{25,26,27,28}. On the other hand, we intend to show particularly the impact of the white noise on the collective entanglement witnesses by deriving explicit formulas. Let us consider a simple scenario illustrated in the Fig. 1 and assume that two copies of a Bell state \(\hat{\rho }_{1} = \hat{\rho }_{2} = \hat{\text {P}}^+=|\phi ^{+} \rangle \langle \phi ^{+}|\) (\(|\phi ^{+}\rangle =\frac{1}{\sqrt{2}} \sum _{i=0}^1 |ii\rangle\)) are subject to the collective measurement.

Imperfections in the procedure are modelled by two channels introducing the noise with probability *p*. There are two equivalent strategies that can be used to incorporate the effect of noise on the outcome of collective measurements. In strategy (a) we add noise to the investigated states \(\hat{\rho }_{1}\), \(\hat{\rho }_{2}\) that are then tested in a perfect collective measurement. In the second strategy (b), both noisy channels are added to the nonlocal measurement projector \(\hat{S}_{\text {B}_{\text {1}}, \text {B}_{\text {2}}}\) turning it into a POVM. In this strategy, perfect Bell states \(\hat{\rho }_{i}\) are measured by means of this POVM.

To prove this, let us first define the probabilities of collective projections, which in the next section will be used as a central quantity in the analyzed nonclassical witnesses. The probabilities of collective projections are given by

and

where \(\hat{\Pi }_{i}\) stands for local projection, \(\hat{S}_{\text {B}_{\text {1}}, \text {B}_{\text {2}}}\) represents the two-qubit collective measurement, and \(\hat{\chi }_{\text {A}_{\text {i}}, \text {B}_{\text {i}}}\) denotes the Bell state \(\hat{\rho }_{i}\) already affected by the noise. Here, indexes \(\text {A}_{i}\) and \(\text {B}_{i}\) are used to denote the first and the second qubit of analyzed state.

Note that by virtue of the Jamiołkowski isomorphism^{29}, the noisy channel \(\hat{\chi }\) can be written as \((\hat{\mathbbm {1}} \otimes \varvec{\Gamma })[\hat{\text {P}}^+]\), with \(\varvec{\Gamma }[\cdot ]:=\sum _k \Gamma ^{(k)} \cdot (\Gamma ^{(k)})^{\dagger }\) a completely positive map (see e.g.^{30}). Then, with straightforward calculations, one can write

Using this equation and the cyclic property of the trace function, one gets

where the noisy collective measurement \(\hat{\Omega }_{\text {B}_{\text {1}}, \text {B}_{\text {2}}}= \sum _{k_1,k_2} \left( \Gamma ^{(k_1)}_{\text {B}_{\text {1}}}\otimes \Gamma ^{(k_2)}_{\text {B}_{\text {2}}}\right) ^{\dagger } \hat{S}_{\text {B}_{\text {1}}, \text {B}_{\text {2}}} \left( \Gamma ^{(k_1)}_{\text {B}_{\text {1}}}\otimes \Gamma ^{(k_2)}_{\text {B}_{\text {2}}}\right)\) is the mathematical representation of the strategy (b). Note that \(\hat{\Omega }_{\text {B}_{\text {1}}, \text {B}_{\text {2}}}\) accumulates noise from both channels. Similar calculations can be made for \(\bar{C} (\hat{\Pi }_{\text {A}_{\text {1}}},\hat{\Pi }_{\text {A}_{\text {2}}})\) showing that this quantity is, however, invariant to noise as \(\varvec{\Gamma }\) is trace-preserving (i.e. \(\sum _k (\Gamma ^{(k)})^{\dagger } \Gamma ^{(k)}=\hat{\mathbbm {1}}\)). Therefore, scenario (a) is equivalent to scenario (b) when \(\{\hat{\chi }_{\text {A}_{\text {1}}, \text {B}_{\text {1}}}, \hat{\chi }_{\text {A}_{\text {2}}, \text {B}_{\text {2}}},\hat{S}_{\text {B}_{\text {1}}, \text {B}_{\text {2}}}\} \leftrightarrow \{\hat{\text {P}}^+_{\text {A}_{\text {1}}, \text {B}_{\text {1}}}, \hat{\text {P}}^+_{\text {A}_{\text {2}}, \text {B}_{\text {2}}},\hat{\Omega }_{\text {B}_{\text {1}}, \text {B}_{\text {2}}}\}\). It is worth mentioning that the above considerations apply to an arbitrary state \(\chi\), not just noisy Bell states.

Let us now consider a particular, yet practical, situation when \(\varvec{\Gamma }\) stands for a depolarizing channel^{31} and \(\hat{S}_{\text {B}_{\text {1}}, \text {B}_{\text {2}}} = \hat{\text {P}}^+_{\text {B}_{\text {1}}, \text {B}_{\text {2}}}\). In this case, the Bell state is transformed into the Werner state with visibility \(v=(1-p)\)

On the other hand, in the second strategy (b) one gets

i.e. a POVM described by the Werner state with visibility \(v = (1-p)^{2}\).

Consider that the Werner state becomes separable for \(v \le \tfrac{1}{3}\) and that projecting on a separable state removes the advantage of collective measurements as such measurement can be decoupled into a series of local single-state copy measurements. The threshold \(v = \tfrac{1}{3}\) is reached if the channel introduces noise with probability \(p = 1-\sqrt{\tfrac{1}{3}} \approx 0.42\). As a consequence, entanglement witnesses based on collective measurement thus rather quickly lose their detection power when white noise is introduced. Note that for instance one of these witnesses, the collectibility, does not even detect all Bell nonlocal Werner states given by \(v_C > \tfrac{1}{\sqrt{2}} \approx 0.71\)^{32}. Collectibility only detects nonlocal correlations for Werner states with \(v_W > \tfrac{\sqrt{3}}{2} \approx 0.87\)^{4} while the entropic witness is limited by \(v_E >\frac{1}{\sqrt{3}}\).

## Methods

As demonstrated in the previous section, white noise has a negative effect on sensitivity of collective entanglement witnesses. Simultaneously, white noise also causes purity of examined quantum states to decrease. This leads us to propose the idea of restoring the performance of collective witnesses by correlating their values with purity of the examined states. To test this idea, the following three steps were implemented: (i) generation of random two-qubit states with uniform distribution in purity, (ii) estimation of three collective entanglement witnesses and purity of the state, (iii) classification of the states via machine learning.

### States generation

First, we have generated random two-qubit states following the method described in Ref.^{9,33,34} and also explained in detail in the Supplementary Material. This method is based on the preparation of a diagonal matrix with uniformly distributed eigenvalues which is then subjected to a random two-qubit unitary evolution. The appropriate SU(4) unitary matrices are generated according to a procedure described in Ref.^{35}. Although such approach provides a uniform distribution of states with respect to the Haar measure, it does not provide a uniform distribution of state purity. There are also other methods for random state generation proposed in literature each leading to a different sampling of the states hence a different distribution of their purities^{36,37}. To asses the distribution of sampled states using various algorithms, we have calculated histograms of Hilbert-Schmidt distances among all combinations of 10 000 random states sampled using four different algorithms^{36,37}. The results of our analysis are depicted in Supplementary Fig. 1 of the Supplementary Material allowing to identify that the selected method based on generation of a random diagonal matrix subjected afterwards to a random global rotation^{9,33} leads to the highest spread of the Hilbert-Schmidt distance values. This indicates that this method provides states with the best coverage of the Hilbert space minimizing thus a potential bias of any machine learning on these states.

To even further tackle the issue of a relatively small contribution of quasi-pure states in the samples, we have decided to post-select from the generated states a subset of 2 million states with uniform distribution of purity. We consider this subset useful for benchmarking as it has considerably increased the presence of pure and quasi-pure states with respect to all tested vanilla random state generation algorithms. As a result, it favours entanglement detection based solely on the entanglement witnesses *without* correlating them with purity and hence the improvement obtained by incorporating purity into the decision is rather underestimated and certainly not overestimated.

### Entanglement witnesses and purity

With the random states generated, we have calculated values of three typical collective entanglement witnesses that can be measured in the entanglement swapping geometry: (a) the collectibility, (b) the CHSH witness, and (c) the entropic witness. The Collectibility as used in this article is defined as

where

and

with \(i, j \in \{0, 1, +, -\}\) denote logical and Hadamard basis states^{4}. Moreover, with the correlation matrix defined as^{38}

where \(\sigma _{{m}}\) and \(\sigma _{{n}}\) are Pauli operators, one can calculate the entropic witness^{2,6} as

and also the CHSH witness in the form^{39,40}

Purity of each state was also calculated. Note that purity can be directly measured using collective measurement on two copies of the investigated state using either the approach involving \(n = 2\) nonlocal projections^{2,41}

or in the entanglement swapping geometry following the idea to decompose nonlocal projection into a series of local measurements

described in Ref.^{38}.

### Classification of states

In the third step, each collective witness is paired with purity to obtain sets of feature vectors of length 2 to be then used for classification via machine learning (one set per witness). True labels for training were provided by the PPT criterion which is, for two-qubit states, a sufficient and necessary condition for entanglement. Note that in practical conditions the PPT criterion requires complete quantum state tomography to be performed and hence also the number of measurements quadratically growing with the size of the Hilbert space^{42}. Furthermore, negativity cannot be measured in a collective measurement on two copies of the investigated state^{5}. Distribution of the feature vectors for all three witnesses colored based on their true label is visualized in Fig. 2a–c. Classification decision based solely on the analytical formulae of the three witnesses is visualized in these figures by dashed horizontal lines. Similarly, the states with purities \(< 1/3\) that cannot be entangled are delimited by a vertical dashed line^{4}.

Incorporating purity into the classification of the states and simultaneously tuning the required sensitivity and specificity is a task that can not be tackled by means of analytical calculations. We thus resort to a machine learning-based approach. For all three witnesses, the set of feature vectors was split into two halves, one used to train support vector machine classifiers (SVC) and the other to test their performance. After experimenting with the hyper-parameters, we have decided to use the radial basis function (RBF) kernels with \(\gamma =1\). To speed-up the training, final classification of the test set is based on 11 hard-voting SVCs each trained on 1/11 of the training instances. To observe complete ROC curves, SVC were trained with 12 different class-based penalties^{43} for misclassification of entangled states \(w_\text{e}\) ranging from \(10^{0.75}\) to \(10^{-1.15}\). Penalty for misclassification of separable states \(w_\text{s}\) was adjusted always so that \(w_\text{s} w_\text{e} = 1\) to maintain regularization constant. Specific values of these penalties are presented in the Supplementary Material. Their choice affects the sensitivity and specificity of the SVC. We have tuned their values so that the entire ROC curves are homogeneously covered allowing also for a good estimate of the areas under curves. It should be emphasized that the penalties are parameters that users of our method can freely tune (and subsequently retrain the models) to suit their particular needs. To benchmark sensitivity, we have calculated the APR (analytical positive rate), i.e. the percentage of entangled states that a given witness is capable of identifying solely based on the analytical threshold without the usage of purity. Sensitivity of each SVC is then characterized by its TPR (true positive rate) and the resulting improvement factor (IF)

Specificity, on the other hand, is directly described by the false positive rate (FPR). Note that decisions based solely on the analytical formulae of the witnesses (without the SVC) have \(\text{FPR}=0\). Complete programming code in Python 3 using the ThunderSVM library^{44} is available as Digital Supplement^{45}.

## Results

### Classification of general two-qubit states and the resulting ROC curves

For all combinations of the three witnesses and the 12 values of the class-based penalties \(w_\text{e}\), the SVC learned an optimal boundary between separable and entangled states in the feature space. Selection of these boundaries is depicted in Fig. 2a–c together with the corresponding improvement factors IF.

Subsequently, we have obtained the confusion matrices for all these SVCs based on their decision on the test set (independent on the training set). TPR and FPR are then directly calculated from these matrices and plotted in Fig. 3. By splitting the test set into 50 batches and evaluating them independently, we were able to estimate standard deviation of all the presented quantities. As a result we obtain complete ROC curves for the idea of purity-enhanced classifications. Areas under curve (AUC) for all three witnesses are numerically calculated to evaluate the performance of this method (see Table 1). We have found out, that using this approach, one can improve the TPR typically by a factor of 1.3 by only sacrificing less than 1‰ of specificity (FPR < 0.001). Experimental imperfections and detection noise will inevitably cause even theoretically perfect witnesses to become imperfect. Considering that we believe that the price of a quite small specificity drop is worth the tangibly increased sensitivity. Moreover, we have demonstrated that sensitivity can further be improved to near TPR close to 1 at the expense of decreased specificity. This is well visible in the presented ROC curves whose AUC is, for all tested witnesses, greater than 0.9. For all numerical results see Supplementary Tables 2–4 in the Supplementary Material. The amount of specificity that one is willing to sacrifice to boost the TPR is strongly application-dependent. While there does not exist any general optimal point, it is reasonable to assume that decreased specificity can be tolerated at least to such extent where it results in comparable amount of misclassifications as induced by other imperfections of the specific application (such as detection noise due to finite acquisition time or imprecision in the measurement setting). Improving TPR at the expense of specificity beyond this point is to be considered by the users based on the their particular goals. One can for instance significantly boost TPR in order to intelligently pre-select potentially entangled states that are subsequently tested by another procedure.

### Results on experimental Werner states

In the next step, we evaluate the performance of the SVCs on real experimental data. For this purpose, we consider the scenario already described in Section Vulnerability of collective measurements to white noise, namely, we deal with two copies of the Bell state \(\hat{\text {P}}^+\) affected by the depolarising channel. As a result, each output state is described by \(\rho _W(v) = v~\hat{\text {P}}^+ + (1-v) \hat{\mathbbm {1}}/4\), where the parameter \(1-v\) quantifies a noise level (c.f. Eq. (2)). We test the SVC procedure on a set of the experimental Werner states \(\rho _W\) with increasing amounts of noise (decreasing *v*). It shall be stressed out that we deploy the SVC models trained solely on numerical data as explained in the previous subsection. We have not resorted to any retraining of the models using experimental data, hence the training of the models does not consume any experimental resources at all. As we show in this subsection, models trained purely on numerical states perform quite well when classifying real-experiment measurement outcomes. Werner states were generated and subjected to the collective measurements in our previously published experimental setup^{46}. The experiment was implemented on the platform of linear optics using polarization degree of freedom of two pairs of photons (for more details on the experimental setup and measurement procedure see Section III and IV in Ref.^{46}). The performed polarization projections and counting of four-fold detection events allowed us to acquire the values of \(C (\hat{\Pi }_{\text {A}_{\text {1}}},\hat{\Pi }_{\text {A}_{\text {2}}})\) and \(\bar{C} (\hat{\Pi }_{\text {A}_{\text {1}}},\hat{\Pi }_{\text {A}_{\text {2}}})\) for Werner states of given visibilities and subsequently to calculate the values of all the three witnesses presented in this paper. The state purity is determined from the collective measurements as well.

The inclusion of estimated purity in the SVC enables decreasing the threshold value for a minimum visibility that leads to correct classification of entangled Werner states. Our results are presented in Fig. 4, where the empty markers depict minimum visibility for the analytical witnesses and the filled markers and lines depict minimum visibility of experimental (\(v_\text{ex}\)) and ideal (\(v_\text{th}\)) Werner states classified as entangled as functions of the FPR and TPR of the SVC. There exists a trade-off between the minimum visibility of correctly classified entangled Werner state and the specificity of the classifier expressed in terms of the FPR. For example, the SVC using the CHSH witness and purity classifies correctly Werner states with \(v\ge 0.61\) at the expense of only FPR=0.39 %. Note that the analytical CHSH witness has the detection threshold at \(v_C=\frac{1}{\sqrt{2}}\approx 0.71\). For all numerical results see Supplementary Tables 2–4 in the Supplementary Material.

Analysis of the results depicted in the Fig. 4 clearly indicates that one can adjust the penalties \(w_e\) and \(w_s\) so that Werner states of visibility \(v\ge v_{\text{th}}\) are positively identified as entangled (\(v_{\text{th}}\) being an arbitrary detection visibility threshold). It may be tempting to set \(v_{\text{th}} = v_S = 1/3\) so that all entangled Werner states are detected and no separable entangled state get misclassified. Such approach would, however, result in a rather large FPR for all other states (see values of FPR in Fig. 4a for visibilities *v* approaching \(v_S\)).

This example clearly demonstrates the suitability of our method for detecting entangled states even in the presence of relatively strong noise. Let us note, however, that the entanglement detection method described above cannot be freely extended to other types of quantum correlations, e.g. Bell’s nonlocality. In this case, \(v_C\) cannot be exceeded as such a result has no physical meaning. Nonetheless, our findings open the door for further studies in this direction.

## Discussion

We have demonstrated that white noise significantly impairs the performance of collective entanglement witnesses. This effect was documented on the example of Collectibility loosing the capability to detect entangled Werner states when noise level exceeds 13 %. To mitigate this shortcoming, we have proposed to correlate the values of the collective witnesses with the state purity. Achieving this task analytically proves to be impractical, especially considering the need to tune detection specificity. The solution lies in employing machine learning.

The theoretical result on the sensitivity of collective measurement to white noise that is mathematically expressed in the form of Eq. (3) and the distribution of entangled states in Fig. 2 are in mutual agreement. Considering that insertion of white noise typically reduces purity, the entangled states have a tendency to distribute along the diagonal in the Fig. 2 documenting a corelation between purity (insertion of white noise) and the values of the three collective witnesses. This effect is perhaps the best visible in the case of the CHSH witness (Fig. 2b) or in the Supplementary Figs. 5–7 in the Supplementary Material. It becomes evident that the corelation between purity and the values of collective witnesses can be explored to boost the TPR of entanglement detection. The specific shape of the dispersion of entangled states in the space spanned by purity and the collective witness is, however, nontrivial and warrants application of machine learning to find optimal solutions, i.e. maximum sensitivity for a given detection specificity. Reaching perfect specificity is no longer possible, because at some point the entangled states with reduced purity enter the region where separable states already start appearing. We, thus, resort to parametrization of the increased sensitivity either by the TPR or the improvement factor (IF), i.e. the improvement factor over classification based solely on the collective witnesses without correlating with purity. Similarly we parametrize the decreased specificity by the FPR and finally reconstruct the ROC curves of the entire procedure.

Specifically we have implemented SVC models to optimize the decision boundary between entangled and separable states in the feature space spanned by the values of the entanglement witness and the states’ purities. Our findings indicate that the range of detected entangled states can be expanded by a significant percentage at a minimal cost in specificity. To further promote the strength of our method, we have included classification of experimental Werner states. We have demonstrated that a considerable increase in the range of correctly classified Werner states can be accomplished at a relatively small cost in specificity of the classifiers. Consequently, we believe that the idea of correlating entanglement witnesses with purity holds promise for practical near-future quantum communications, particularly in the context of entanglement swapping as showcased in this paper. It can be interesting to investigate the decision-making using SVC trained in spaces of other quantum state quantifiers besides purity and the selected collective witnesses. Perhaps additional improvement can be reached when multiple witnesses are used as coordinates of the decision space. Similarly interesting might be the transition to a higher dimension or to a multipartite system^{47,48,49}, where entanglement detection becomes significantly more challenging. The question of whether the presented method can benefit other technologies beyond quantum communications is also pertinent. Although these are definitely inspiring propositions, they are already out of the scope of this paper.

## Data availibility

The Supplementary Material referenced in the text is available at the publisher’s website. The datasets and source codes generated and/or analysed during the current study are available in the Figshare repository, http://dx.doi.org/10.6084/m9.figshare.25604676

## References

Rico, A. & Huber, F. Entanglement detection with trace polynomials.

*Phys. Rev. Lett.***132**, 070202. https://doi.org/10.1103/PhysRevLett.132.070202 (2024).Bovino, F. A.

*et al.*Direct measurement of nonlinear properties of bipartite quantum states.*Phys. Rev. Lett.***95**, 240407. https://doi.org/10.1103/PhysRevLett.95.240407 (2005).Rudnicki, L., Horodecki, P. & Życzkowski, K. Collective uncertainty entanglement test.

*Phys. Rev. Lett.***107**, 150502. https://doi.org/10.1103/PhysRevLett.107.150502 (2011).Rudnicki, L., Puchała, Z., Horodecki, P. & Życzkowski, K. Collectibility for mixed quantum states.

*Phys. Rev. A***86**, 062329. https://doi.org/10.1103/PhysRevA.86.062329 (2012).Bartkiewicz, K., Chimczak, G. & Lemr, K. Direct method for measuring and witnessing quantum entanglement of arbitrary two-qubit states through Hong-Ou-Mandel interference.

*Phys. Rev. A***95**, 022331. https://doi.org/10.1103/PhysRevA.95.022331 (2017).Bartkiewicz, K., Lemr, K., Černoch, A. & Miranowicz, A. Bell nonlocality and fully entangled fraction measured in an entanglement-swapping device without quantum state tomography.

*Phys. Rev. A***95**, 030102. https://doi.org/10.1103/PhysRevA.95.030102 (2017).Bartkiewicz, K. & Chimczak, G. Two methods for measuring Bell nonlocality via local unitary invariants of two-qubit systems in Hong-Ou-Mandel interferometers.

*Phys. Rev. A***97**, 012107. https://doi.org/10.1103/PhysRevA.97.012107 (2018).Trávníček, V., Bartkiewicz, K., Černoch, A. & Lemr, K. Experimental measurement of a nonlinear entanglement witness by hyperentangling two-qubit states.

*Phys. Rev. A***98**, 032307. https://doi.org/10.1103/PhysRevA.98.032307 (2018).Roik, J., Bartkiewicz, K., Černoch, A. & Lemr, K. Accuracy of entanglement detection via artificial neural networks and human-designed entanglement witnesses.

*Phys. Rev. Appl.***15**, 054006. https://doi.org/10.1103/PhysRevApplied.15.054006 (2021).Roik, J., Bartkiewicz, K., Cernoch, A. & Lemr, K. Entanglement quantification from collective measurements processed by machine learning.

*Phys. Lett. A***446**, 128270. https://doi.org/10.1016/j.physleta.2022.128270 (2022).Sheng, Y.-B., Guo, R., Pan, J., Zhou, L. & Wang, X.-F. Two-step measurement of the concurrence for hyperentangled state.

*Quantum Inf. Process.***14**, 963–978. https://doi.org/10.1007/s11128-015-0916-1 (2015).Trávníček, V., Bartkiewicz, K., Černoch, A. & Lemr, K. Experimental measurement of the Hilbert–Schmidt distance between two-qubit states as a means for reducing the complexity of machine learning.

*Phys. Rev. Lett.***123**, 260501. https://doi.org/10.1103/PhysRevLett.123.260501 (2019).Bartkiewicz, K., Trávníček, V. & Lemr, K. Measuring distances in Hilbert space by many-particle interference.

*Phys. Rev. A***99**, 032336. https://doi.org/10.1103/PhysRevA.99.032336 (2019).Briegel, H.-J., Dür, W., Cirac, J. I. & Zoller, P. Quantum repeaters: The role of imperfect local operations in quantum communication.

*Phys. Rev. Lett.***81**, 5932–5935. https://doi.org/10.1103/PhysRevLett.81.5932 (1998).Jacobs, B. C., Pittman, T. B. & Franson, J. D. Quantum relays and noise suppression using linear optics.

*Phys. Rev. A***66**, 052307. https://doi.org/10.1103/PhysRevA.66.052307 (2002).Yonezawa, H., Aoki, T. & Furusawa, A. Demonstration of a quantum teleportation network for continuous variables.

*Nature***431**, 430–433. https://doi.org/10.1038/nature02858 (2004).Barasiński, A., Černoch, A. & Lemr, K. Demonstration of controlled quantum teleportation for discrete variables on linear optical devices.

*Phys. Rev. Lett.***122**, 170501. https://doi.org/10.1103/PhysRevLett.122.170501 (2019).Trávníček, V., Bartkiewicz, K., Černoch, A. & Lemr, K. Experimental diagnostics of entanglement swapping by a collective entanglement test.

*Phys. Rev. Appl.***14**, 064071. https://doi.org/10.1103/PhysRevApplied.14.064071 (2020).Zhou, L. & Sheng, Y.-B. Detection of nonlocal atomic entanglement assisted by single photons.

*Phys. Rev. A***90**, 024301. https://doi.org/10.1103/PhysRevA.90.024301 (2014).Zhou, L. & Sheng, Y.-B. Concurrence measurement for the two-qubit optical and atomic states.

*Entropy***17**, 4293–4322. https://doi.org/10.3390/e17064293 (2015).Feng, S., He, Y. & Trivedi, N. Detection of long-range entanglement in gapped quantum spin liquids by local measurements.

*Phys. Rev. A***106**, 042417. https://doi.org/10.1103/PhysRevA.106.042417 (2022).Sheskin, D. J.

*Handbook of Parametric and Nonparametric Statistical Procedures*3rd edn. (Chapman and Hall/CRC, 2003).Dekking, M., Frederik, Kraaikamp, C., Lopuhaä, H. P. & Meester, L. E.

*A Modern Introduction to Probability and Statistics: Understanding Why and How*(Springer London, 2005).Peřina, J.

*Quantum Statistics of Linear and Nonlinear Optical Phenomena*2nd edn. (Springer, 1991).Dotsenko, I. S. & Korobka, R. Entanglement swapping in the presence of white and color noise.

*Commun. Theor. Phys.***69**, 143. https://doi.org/10.1088/0253-6102/69/2/143 (2018).Ye, T.-Y. Robust quantum dialogue based on the entanglement swapping between any two logical bell states and the shared auxiliary logical bell state.

*Quantum Inf. Process.***14**, 1469–1486. https://doi.org/10.1007/s11128-015-0934-z (2015).Lin, J. & Hwang, T. Bell state entanglement swappings over collective noises and their applications on quantum cryptography.

*Quantum Inf. Process.***12**, 1089–1107. https://doi.org/10.1007/s11128-012-0456-x (2013).Bej, P., Ghosal, A., Das, D., Roy, A. & Bandyopadhyay, S. Information-disturbance trade-off in generalized entanglement swapping.

*Phys. Rev. A***102**, 052416. https://doi.org/10.1103/PhysRevA.102.052416 (2020).Jamiolkowski, A. Linear transformations which preserve trace and positive semidefiniteness of operators.

*Rep. Math. Phys.***3**, 275–278. https://doi.org/10.1016/0034-4877(72)90011-0 (1972).Badziag, P., Horodecki, M., Horodecki, P. & Horodecki, R. Local environment can enhance fidelity of quantum teleportation.

*Phys. Rev. A***62**, 012311. https://doi.org/10.1103/PhysRevA.62.012311 (2000).Nielsen, M. A. & Chuang, I. L.

*Quantum Computation and Quantum Information*(Cambridge University Press, 2000).Jiráková, K., Černoch, A., Lemr, K., Bartkiewicz, K. & Miranowicz, A. Experimental hierarchy and optimal robustness of quantum correlations of two-qubit states with controllable white noise.

*Phys. Rev. A***104**, 062436. https://doi.org/10.1103/PhysRevA.104.062436 (2021).Maziero, J. Random sampling of quantum states: A survey of methods.

*Braz. J. Phys.***45**, 575–583. https://doi.org/10.1007/s13538-015-0367-2 (2015).Li, C.-K., Roberts, R. & Yin, X. Decomposition of unitary matrices and quantum gates.

*Int. J. Quantum Inf.***11**, 1350015. https://doi.org/10.1142/S0219749913500159 (2013).Pozniak, M., Zyczkowski, K. & Kus, M. Composed ensembles of random unitary matrices.

*J. Phys. A***31**, 1059. https://doi.org/10.1088/0305-4470/31/3/016 (1998).Johansson, J., Nation, P. & Nori, F. Qutip 2: A Python framework for the dynamics of open quantum systems.

*Comput. Phys. Commun.***184**, 1234–1240. https://doi.org/10.1016/j.cpc.2012.11.019 (2013).Qiskit contributors.

*Qiskit: An Open-source Framework for Quantum Computing*. https://doi.org/10.5281/zenodo.2573505 (2023).Bartkiewicz, K., Horst, B., Lemr, K. & Miranowicz, A. Entanglement estimation from Bell inequality violation.

*Phys. Rev. A***88**, 052105. https://doi.org/10.1103/PhysRevA.88.052105 (2013).Miranowicz, A. Violation of Bell inequality and entanglement of decaying Werner states.

*Phys. Lett. A***327**, 272–283. https://doi.org/10.1016/j.physleta.2004.05.001 (2004).Horodecki, R., Horodecki, P. & Horodecki, M. Violating Bell inequality by mixed spin-\(\tfrac{1}{2}\) states: Necessary and sufficient condition.

*Phys. Lett. A***200**, 340–344. https://doi.org/10.1016/0375-9601(95)00214-N (1995).Bartkiewicz, K., Lemr, K. & Miranowicz, A. Direct method for measuring of purity, superfidelity, and subfidelity of photonic two-qubit mixed states.

*Phys. Rev. A***88**, 052104. https://doi.org/10.1103/PhysRevA.88.052104 (2013).Quek, Y., Fort, S. & Ng, H. K. Adaptive quantum state tomography with neural networks.

*NPJ Quantum Inf.*https://doi.org/10.1038/s41534-021-00436-9 (2021).Fernández, A.

*et al.**Learning from Imbalanced Data Sets*(2018).Wen, Z., Shi, J., Li, Q., He, B. & Chen, J. ThunderSVM: A fast SVM library on GPUs and CPUs.

*J. Mach. Learn. Res.***19**, 797–801 (2018).Jiráková, K., Cernoch, A., Barasinski, A. & Lemr, K. Digital supplement containing programming source code and data is accessible at the web pages.

*Figshare*https://doi.org/10.6084/m9.figshare.25604676 (2023).Lemr, K., Bartkiewicz, K. & Černoch, A. Experimental measurement of collective nonlinear entanglement witness for two qubits.

*Phys. Rev. A***94**, 052334. https://doi.org/10.1103/PhysRevA.94.052334 (2016).Morelli, S., Huber, M. & Tavakoli, A. Resource-efficient high-dimensional entanglement detection via symmetric projections.

*Phys. Rev. Lett.***131**, 170201. https://doi.org/10.1103/PhysRevLett.131.170201 (2023).Ren, L.-H., Shi, Y.-H., Chen, J.-J. & Fan, H. Multipartite entanglement detection based on the generalized state-dependent entropic uncertainty relation for multiple measurements.

*Phys. Rev. A***107**, 052617. https://doi.org/10.1103/PhysRevA.107.052617 (2023).Aggarwal, S., Adhikari, S. & Majumdar, A. S. Entanglement detection in arbitrary-dimensional bipartite quantum systems through partial realigned moments.

*Phys. Rev. A***109**, 012404. https://doi.org/10.1103/PhysRevA.109.012404 (2024).

## Acknowledgements

The authors thank Karol Bartkiewicz and Jára Cimrman for a useful discussion. The authors also acknowledge CESNET for data management services. AČ and KL acknowledge support by the project OP JAC CZ.02.01.01/00/22_008/0004596 of the Ministry of Education, Youth, and Sports of the Czech Republic and EU.

## Author information

### Authors and Affiliations

### Contributions

K.J., K.L. and A.B. performed calculations, A.Č. and K.L. ran the machine learning and analysed results. The paper was written by all authors who also participated in the preparation of the manuscript and discussed the results. Figures were created by A.Č., K.L. and K.J. The corresponding author is K.L. (e-mail: k.lemr@upol.cz).

### Corresponding author

## Ethics declarations

### Competing interests

The authors declare no competing interests.

## Additional information

### Publisher's note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

## Supplementary Information

## Rights and permissions

**Open Access** This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article’s Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article’s Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecommons.org/licenses/by/4.0/.

## About this article

### Cite this article

Jiráková, K., Černoch, A., Barasiński, A. *et al.* Enhancing collective entanglement witnesses through correlation with state purity.
*Sci Rep* **14**, 16374 (2024). https://doi.org/10.1038/s41598-024-65385-7

Received:

Accepted:

Published:

DOI: https://doi.org/10.1038/s41598-024-65385-7

## Comments

By submitting a comment you agree to abide by our Terms and Community Guidelines. If you find something abusive or that does not comply with our terms or guidelines please flag it as inappropriate.