# High-Accuracy Entanglement Detection via a Convolutional Neural Network with Noise Resistance
## 2 Methods  
### Basic Idea  
In quantum physics, a pure state system is considered separable if it can be expressed as the tensor product of the states of two subsystems. This description can be extended to the framework of density matrices to handle mixed states. Mixed states need to be expressed as a convex combination of separable states [29; 30]. In contrast, a composite system in an entangled state indicates a nonclassical, strong correlation between its two subsystems. When systems A and B are entangled, measurements on A inevitably affect B, causing quantum state collapse. To ensure the reliability of classification, the training CNN model follows the main principle outlined below:  
The input data for the training set consist of probabilities, which are computed using [PERSON]'s rule applied to a specified set of known density matrices \(\rho\) and operators \(\{\mathbf{O}_{k}\}\). These probabilities reflect the likelihoods of the corresponding measurement outcomes. In short, the model learns from these probability distributions to identify the properties of quantum states, particularly distinguishing separable states from entangled states.  
In addressing the discrimination in two-qubit systems, we adopt the positive partial transpose (PPT) criterion [31; 32] as a rigorous standard to segregate quantum states into entangled and separable categories. The density matrix \(\rho\) is deemed to represent an entangled state if its partial transpose matrix possesses at least one negative eigenvalue. On the contrary, if no negative eigenvalues are encountered in the partial transpose, \(\rho\) is classified as a separable state. Once the PPT criterion has been applied to assign categorical labels, we establish a mathematical convention of representing separable states with '1' and entangled states with '2', as illustrated in Figure 1. After rigorous training, the neural network processes measurement frequencies of unknown quantum states and outputs their classification as entangled or separable. Reliability depends on network architecture, training rigor, and dataset quality.  
To facilitate this classification, we randomly generate multiple sets of predefined density matrices \(\rho\), and calculate the probability \(P=Tr(\rho\mathbf{O}_{k})\) with distinct measurement operators \(\{\mathbf{O}_{k}\}\) as the input dataset. Subsequently, we apply the PPT criterion to these inputs, generating the corresponding labels as our output dataset, which serve as the foundation for training our model.  
For binary classification, according to the estimated results and true labels, there are four situations in total: true positive (TP), false positive (FP), true negative (TN), and false negative (FN). The results can be evaluated by accuracy, precision, and recall as follows:  
\[Accuracy=\frac{TP+TN}{TP+TN+FP+FN}, \tag{1}\]  
\[Precision=\frac{TP}{TP+FP}, \tag{2}\]  
Figure 1: The basic idea of using deep neural networks to implement entanglement detection.  
\[Recall=\frac{TP}{TP+FN}. \tag{3}\]  
The accuracy represents the proportion of correctly classified samples out of all samples, while the precision measures the proportion of true positive examples among all samples classified as positive. A higher precision indicates a lower likelihood of mis-classifying negative examples as positive. On the other hand, the recall is the ratio of successful detections among all true positives. A higher recall rate implies fewer missed positive examples.