Finding semi-optimal measurements for entanglement detection using Autoencoder Neural Networks
Abstract
Entanglement is one of the key resources of quantum information science which makes identification of entangled states essential to a wide range of quantum technologies and phenomena. This problem is however both computationally and experimentally challenging. Here we use autoencoder neural networks to find semi-optimal set of incomplete measurements that are most informative for the detection of entangled states. We show that it is possible to find high-performance entanglement detectors with as few as three measurements. Also, with the complete information of the state, we develop a neural network that can identify all two-qubits entangled states almost perfectly. This result paves the way for automatic development of efficient entanglement witnesses and entanglement detection using machine learning techniques.
Mathematical structure of quantum mechanics allows for a peculiar kind of correlation, known as ’Entanglement’ that in some aspects, is more powerful than classical correlations Bell (1964). Entanglement is known to be one of the key resources in quantum information theory Cohen (2008) that empowers many quantum technologies such as quantum metrology Giovannetti et al. (2011). This makes entanglement detection uniquely essential for to a variety of quantum applications Gühne and Tóth (2009). In contrast to separable states, Entangled states cannot be written in terms of a convex combination of the product of density matrices. This reduces the entanglement detection to determining if a state is in the convex hull of product states Horodecki (1997). This problem is also known as the ’separability problem’ and is NP-Hard Vedral et al. (1997); Gharibian (2010).
Although exact entanglement identification for the full Hilbert space is challenging, it is possible to construct tools that can identify some but not all entangled states. These are known as ’entanglement witnesses’. Mathematically, a witness provides a sufficient but not necessary condition for entanglement. If the state satisfies this condition, it is entangled, but if it does not, the witness reveals no information with regards to the separability of the state Terhal (2002); Horodecki et al. (2009).
Figure 1(a) gives a schematic picture of how a witness identifies entangled states. It divides the Hilbert space into two partitions, one that only contains entangled states, and an other one that may include of both separable and entangled states.
A variety of approaches have been proposed to provide some entanglement witnesses Horodecki et al. (2001); Wootters (1998); Terhal (2000); Rungta et al. (2001); De Vicente (2007). Also recently, different machine learning techniques have been developed for detection of entanglement. These include forest algorithms Wang (2017), neural networks Lu et al. (2018); Gray et al. (2018); Deng (2018); Levine et al. (2018); Liu et al. (2018); Qiu et al. (2019), reinforcement learning and restricted Boltzmann machinesHarney et al. (2020); Gao et al. (2018); Ma and Yung (2018). Some of these methods require the full description of the state, which in general, might require too many measurements and be infeasible experimentally. Ideally, it is favourable to witness entanglement with as few measurements as possible. This requires finding optimal measurements that are most informative with respect to entanglement of the states. Note that although for the detection a general entangled states, the full density matrix (full tomography) is required, it is still possible to detect subsets of entangled states from incomplete data of a few measurements Horodecki et al. (2009).

In this article, we propose to use autoencoder neural networks to find semi-optimal measurements for entanglement detection and construct new entanglement witnesses that can detect entangled states with incomplete data, e.g. with as few as three measurements. More specifically, our methods takes as input the constraint on the number of measurements and returns both the optimized measurements and the witness which uses the result of those optimized measurements to detect entanglement.
Autoencoders are a type of neural network that are designed to find compressed encodings of the inputs that contain the information relevant to a specific target task. In our case, this task is the detection of entanglement and the autoencoder would find a set of few measurements that are optimized for this task. Naively, for a given number of measurements , we train a neural network with a bottleneck layer of nodes and in the training process, the nodes are optimized such that the full network can, to the best of its ability, detect entangled states. This way, the autoencoder neural network finds the optimal measurements that can be used for detection of entanglement.
Here we apply our method to the two-qubit system, but this method could be generalized for systems with higher Hilbert space dimensions. For the two-qubit system, 15 measurements would provide the full information of the state. With the full information, our method can identify entangled and separable states almost perfectly. As we reduce the number of measurements, the performance of the witness decreases and it can only identify smaller portion of the entangled states. We also consider the situation where the state is cylindrically symmetric and find that symmetry can significantly enhance the performance of the resulting entanglement witness and even with a few measurements, it is possible to find highly accurate entanglement detectors.
The neural network witness takes states as input and indicates whether or not the state is entangled at the output. For the input, we need to find a representation for the state of a two-qubit system. In quantum information theory, the state of a physical system is represented by a density matrix which is a Hermitian, non-negative operator with trace one Michael A. Nielsen (2011). We use the basis of Pauli matrices to express the density matrix and feed this representation for the input of the neural network. Mathematically that is
(1) |
where s are Pauli matrices and denotes the identity operator . s could be found as:
(2) |
The reason we choose this basis is because are the expectation values of measurements on the system. So for two-qubit systems, these 15 measurements (neglecting the trivial resulted from the identity operators) provide a representation of the density matrix Michael A. Nielsen (2011).
The final goal is to use the autoencoder to find fewer measurements that can be used to detect entanglement, at least for a subset of the states.
Since we use supervised learning techniques, the label of the states, i.e. whether or not they are entangled, needs to be determined. We use the Peres-Horodecki criterion (also known as positive partial transpose or PPT criterion). This witness states that if the partial transpose of the density matrix is negative, the state has to be entangled Horodecki et al. (2009). This is because if is separable then its partial transpose with respect to one party () should be non-negative Horodecki et al. (2009). So, if then the state has to be entangled. For the special case of when the dimensions of the subsystems satisfy (where and are the dimensions of the Hilbert spaces of the first and second subsystems respectively) PPT gives a necessary and sufficient condition for separability Horodecki et al. (2009). See figure 1(b)) for a schematic picture of PPT witness. For two-qubit systems, Augusiak et al proposed a simplified form of the PPT criterion Augusiak et al. (2008).
(3) |
This is used to determine the labels of the density matrices. Note that in general, PPT only gives a necessary condition for separability which makes it challenging to extend this approach to higher dimensions.

We use autoencoder neural network Baldi (2012) to detect entangled states. The autoencoder architecture is shown in figure 2, the number of nodes starts to decrease first and then it starts to increase before it gets to the final node. It is common to refer to the first part of the network as the ’encoder’ and the last part as the ’decoder’. Also the layer with the fewest nodes is referred to as the ’code’. This layer, acts as a bottleneck for the flow of information. It means that if the full network can effectively detect entangled states (or a subset of them), then the information relevant to the entanglement of the states has to be coded in the code layer.
In our case, the network is starting with the full density matrix and the encoding can be seen as finding the optimal measurement that contains the information relevant to the entanglement.
The idea is that we train this neural network and the full network gives an entanglement witness that works with complete information. But the network does more. It also finds an encoding of the state that would keep only the information relevant to the entanglement. In other words, we can use the encoder to find the few measurements that are most informative with regards to the entanglement and directly measure them.
We trained a model with the architecture shown in figure 2 and achieved an accuracy of 98%. The confusion matrix of the model has been demonstrated in table 1.
The nodes in the code layer of this model are a non-linear function of the 15 features of the full state. This corresponds to a set of non-linear measurements on the system. With some tuning, one may even recover the PPT criterion. But it is not really helpful because non-linear measurements are usually challenging to implement experimentally. So we redesign the model and look for linear measurements. That is, we want the nodes in the code layer to be linear functions of the input layer which gives the model in figure 3. In this architecture, the first layer consists of only (desired number of measurements) nodes without any activation function. So the network is forced to choose linear combination of these 15 features. Each linear combination corresponds to a linear measurement. To minimize the loss, the network changes the weights of the first layer and therefore it finds semi-optimal linear measurements which can be used to detect entanglement.

The model has been trained for different values of and the results are shown in figure 4(a). Also by modifying the threshold for the classification of the data to reach the precision of 100%, an entanglement witness has been created, and the percentage of the entangled quantum states that these witness can detect from all of the entangled states (recall) are shown in figure 4(b)

For example, this model achieves an accuracy of about 80% using only three linear measurements. These three semi-optimal measurements can be expressed in terms of the input layer, i.e. Pauli measurements. These weights are depicted in figure 5.

Often the quantum states prepared in the lab have some symmetries. These symmetries generally pose some constraints on the density matrix and as a result, could simplify entanglement detection.
One of the common symmetries in state preparation is the cylindrical symmetry, i.e. rotations around the z-axis does not change state. Here, we repeat our idea with the cylindrical symmetry for the two-qubit systems. The results for symmetric states are shown in figure 4. The model can achieve high accuracy with a few number of linear measurements in the case of cylindrical symmetry. For example, with even three measurements, it reaches 94% of accuracy.
In conclusion, we proposed to use autoencoder neural networks to find optimal measurements for entanglement detection and constructed entanglement detectors that, with as few as three measurements, could achieve accuracies as high as over all density matrices.
On a fundamental level, our work provides a way to find a few, optimized measurements that can be most informative with respect to the entanglement detection. On a practical level, this technique can build upon existing theoretical entanglement criterion (like the PPT for two qubits) and construct entanglement witnesses that can work with significantly fewer measurements and reduce the experimental cost.
As a side result, we found an entanglement detector that with the full information of the state, can identify all entangled and separable states almost perfectly. For symmetric states, the performance of this technique would significantly improve.
Our models present a proof of concept for the idea of using autoencoders for finding optimized measurement for entanglement detection. This work was limited by our computational resources and the models can potentially be further improved by further training and by better tuning the hyper-parameters like the depth of the networks. It remains open to see how far the performance of this idea can be pushed and what its limitations are.
The idea of using autoencoders for optimization of measurements can be extended beyond two-qubit.
It would be interesting to apply our method to higher dimensional systems (beyond ). Further, this approach can be extended to other applications in quantum information Zhou (2020); Zhou et al. (2019a, b). The technical details and the codes for this work is publicly available at git (2020).
Acknowledgements.
This work was supported by the research grant system of Sharif University of Technology (G960219).References
- Bell (1964) J. S. Bell, Physics Physique Fizika 1, 195 (1964).
- Cohen (2008) S. M. Cohen, Physical Review A - Atomic, Molecular, and Optical Physics 77, 1 (2008).
- Giovannetti et al. (2011) V. Giovannetti, S. Lloyd, and L. Maccone, Nature photonics 5, 222 (2011).
- Gühne and Tóth (2009) O. Gühne and G. Tóth, Physics Reports 474, 1 (2009).
- Horodecki (1997) P. Horodecki, Physics Letters A 232, 333 (1997).
- Vedral et al. (1997) V. Vedral, M. B. Plenio, M. A. Rippin, and P. L. Knight, Physical Review Letters 78, 2275 (1997), arXiv:9702027 [quant-ph] .
- Gharibian (2010) S. Gharibian, Quantum Info. Comput. 10, 343–360 (2010).
- Terhal (2002) B. M. Terhal, Theoretical Computer Science 287, 313 (2002), arXiv:0101032 [quant-ph] .
- Horodecki et al. (2009) R. Horodecki, P. Horodecki, M. Horodecki, and K. Horodecki, Rev. Mod. Phys. 81, 865 (2009).
- Horodecki et al. (2001) M. Horodecki, P. Horodecki, and R. Horodecki, Physics Letters A 283, 1 (2001).
- Wootters (1998) W. K. Wootters, Foundations of Physics Letters 80, 199 (1998), arXiv:0009063 [quant-ph] .
- Terhal (2000) B. M. Terhal, Physics Letters, Section A: General, Atomic and Solid State Physics 271, 319 (2000), arXiv:9911057 [quant-ph] .
- Rungta et al. (2001) P. Rungta, V. Bužek, C. M. Caves, M. Hillery, and G. J. Milburn, Physical Review A. Atomic, Molecular, and Optical Physics 64, 423151 (2001), arXiv:0102040 [quant-ph] .
- De Vicente (2007) J. I. De Vicente, Physical Review A - Atomic, Molecular, and Optical Physics 75, 1 (2007).
- Wang (2017) B. Wang, arXiv preprint arXiv:1709.03617 (2017).
- Lu et al. (2018) S. Lu, S. Huang, K. Li, J. Li, J. Chen, D. Lu, Z. Ji, Y. Shen, D. Zhou, and B. Zeng, Physical Review A 98, 1 (2018), arXiv:1705.01523 .
- Gray et al. (2018) J. Gray, L. Banchi, A. Bayat, and S. Bose, Physical Review Letters 121, 150503 (2018), arXiv:1709.04923 .
- Deng (2018) D. L. Deng, Physical Review Letters 120, 240402 (2018), arXiv:1710.04226 .
- Levine et al. (2018) Y. Levine, D. Yakira, N. Cohen, and A. Shashua, Deep learning and quantum entanglement: Fundamental connections with implications to network design (2018), arXiv:1704.01552 .
- Liu et al. (2018) Y. Liu, X. Zhang, M. Lewenstein, and S.-J. Ran, sth - sdf (2018), arXiv:1803.09111 .
- Qiu et al. (2019) P. H. Qiu, X. G. Chen, and Y. W. Shi, IEEE Access 7, 94310 (2019).
- Harney et al. (2020) C. Harney, S. Pirandola, A. Ferraro, and M. Paternostro, New Journal of Physics 22, 045001 (2020).
- Gao et al. (2018) J. Gao, L. F. Qiao, Z. Q. Jiao, Y. C. Ma, C. Q. Hu, R. J. Ren, A. L. Yang, H. Tang, M. H. Yung, and X. M. Jin, Physical Review Letters 120, 240501 (2018), arXiv:1712.00456 .
- Ma and Yung (2018) Y. C. Ma and M. H. Yung, npj Quantum Information 4, 1 (2018), arXiv:1705.00813 .
- Michael A. Nielsen (2011) I. L. C. Michael A. Nielsen, Quantum Computation and Quantum Information: 10th Anniversary Edition, 10th ed. (Cambridge University Press, 2011).
- Augusiak et al. (2008) R. Augusiak, M. Demianowicz, and P. Horodecki, Physical Review A - Atomic, Molecular, and Optical Physics 77, 1 (2008).
- Baldi (2012) P. Baldi, ICML Unsupervised and Transfer Learning , 37 (2012), arXiv:0500581 .
- Zhou (2020) Y. Zhou, Phys. Rev. A 101, 012301 (2020).
- Zhou et al. (2019a) Y. Zhou, Q. Zhao, X. Yuan, and X. Ma, npj Quantum Information 5, 83 (2019a).
- Zhou et al. (2019b) Y. Zhou, C. Guo, and X. Ma, Phys. Rev. A 99, 052324 (2019b).
- git (2020) https://gitlab.com/quantum-machine-learning/autoencoder-entanglement-detection-optimizer (2020).