AI-Driven Discovery of Entanglement Witness in Spin Hamiltonians
Authors: Jiwei Tian, Mouyang Cheng, Mingda Li
Organizations: School of Physics, Peking University, Beijing 100084, China · Center for Computational Science and Engineering, MIT, Cambridge, MA 02139, USA · Department of Materials Science and Engineering, MIT, Cambridge, MA 02139, USA · Department of Nuclear Science and Engineering, MIT, Cambridge, MA 02139, USA
Entanglement is a crucial resource in quantum science and engineering, but detecting it in many-body states from experimentally accessible observables remains challenging. Here we introduce EntNet, an AI-driven framework to discover compact combinations of spin observables that accurately distinguish entangled from fully separable many-body mixed states in one-dimensional spin-1/2 chains governed by short-range Hamiltonians. We construct local-unitary-invariant representations of measurable Pauli correlators up to four-body order, sparsely select 16 candidate invariant feature channels, and learn their spatial structure using a Transformer architecture with rotary positional embeddings. Using only expectation values of these low-order observables, EntNet achieves >98% recall on certified entangled states with near-zero false-positive rates on separable states. Remarkably, it exhibits transferability across system sizes and distinct Hamiltonian families, including frustrated and disordered spin models, with minimal loss of accuracy. Beyond detection, EntNet provides physical insight into entanglement detection by revealing a selective spatial organization of pair correlations, while its finite-temperature decision boundary tracks the excitation gap of Jordan-Wigner quasiparticles. These results establish a transferable and physically interpretable framework for data-driven discovery of entanglement witnesses from local correlation functions.
Figures & tables
Figure 1: Overview of the correlator-based entanglement detection framework. a. Schematic illustration of an XY spin chain under transverse field, where the low-order Pauli correlators are measured and their expectation values are used to construct local-unitary (LU) invariant features. b. Product states and their mixtures provide constructively separable samples, while locally noised random matrix-product states provide candidate entangled states. A hierarchy of two- to four-site PPT/CCNR tests assigns entanglement certificates (E2–E4) or leaves states uncertified. c. The selected K LU-invariant channels and geometry masks form site tokens, which are tokenized and then processed by a four-block Transformer with rotary positional encoding (RoPE). The final CLS representation is used for classification.
Figure 2: Sparse LU-invariant feature selection and generalization of EntNet. a. The 16 selected local-unitary (LU) invariant channels, ordered by their consensus ranking across five independent feature selectors. The consensus score S=118−rˉ , where rˉ is the mean rank among 117 candidate channels, quantifies the preference for each feature. b. Distribution of two-site channels in the consensus ranking (upper) and classification performance as a function of the number of selected channels K (lower). Stars mark the first occurrence of each pair separation, and the vertical dashed line indicates K=16 . Classifiers in the lower panel are independently trained and evaluated on N=16 XY-chain states. c. Generalization to XXZ, frustrated J1 – J2 , and random-local-Hamiltonian systems, none of which are included in training. The horizontal dashed line indicates unity. d–f. Comparison of models using raw correlators, softly constrained LU representations, and exactly LU-invariant features on d. N=16 XY-chain states, e. N=32 XY-chain states, and f. independently constructed N=32 states with diverse entanglement structures. g. True-negative rates on the separable subsets of these benchmarks and an additional independent set of 2,000 constructively separable states. All classifiers are trained only on synthetically generated N=16 separable and E2 states. Here E>2 includes E3 and E4 states. Recall and true-negative rate (TNR) are evaluated at the fixed threshold p=0.5 .
Figure 3: Thermal response and activated reentry in EntNet predictions. a. EntNet predictions p=σ(z) along six finite-temperature trajectories of the N=16 XY chain, using the original trained ensemble. The dashed line marks the classification threshold p=0.5 , and diamonds indicate the common infinite-temperature limit. b. Entanglement certificates along the same trajectories, independently determined from PPT and CCNR tests on two- to four-site reduced density matrices. “Unknown” indicates the absence of an entanglement certificate, rather than separability, while the infinite-temperature state is exactly separable. c. EntNet predictions in the (h,T) plane of the XX chain ( γ=0 ), using an ensemble trained with additional states exhibiting strong distance-two entanglement. For h/J>1 , thermal excitations drive the initially separable ground state into a region classified as entangled, before the predicted probability decreases again at higher temperatures. Black contours mark p=0.5 , while gray bands indicate variations across independently trained models. The temperature axis contains a break separating the low- and high-temperature regions. d. Refined lower boundary T∗(h) of the model-positive region and its fit to the thermally activated form T∗exp[−2(h−1)/T∗]=C∗ , with energies expressed in units of J . The fit uses 19 boundary points over 1.05≤h/J≤1.50 , yielding C∗=1.041×10−3 and Rlog10T∗2=0.9993 . This boundary characterizes the learned classifier and should not be interpreted as a rigorous entanglement threshold or a thermodynamic phase transition.
Appendix figures & tables8 assets
Supplementary material from the paper’s appendix.
Appendix
Dataset
Size
Composition
Role
Primary training
35,000
17,500 Sep + 17,500 E2
classifier training
Feature-selection data
2,812
1,406 Sep/Ent pairs
channel ranking
Distance-two support
1,400
700 Sep/ E2 pairs
training control
N=16 XY
912
432 Sep, 432 Ent, 48 unknown
evaluation
N=32 XY
500
20 Sep, 432 Ent, 48 unknown
size transfer
N=32 synthetic states
2,000
400 Sep, 1,600 Ent
transfer
Appendix
Table 1: Principal datasets used for training, feature selection, and evaluation. Unknown labels are excluded from binary metrics and never treated as separable.
Family
Total
Sep
E2
E3
E4
Unknown
XXZ
343
79
103
52
30
79
J1 – J2
463
30
155
80
30
168
Random local H
626
39
238
87
40
222
Appendix
Table 2: Composition of the independent N=16 Gibbs-state benchmarks from different Hamiltonian families. Adaptive temperature refinement targets regions near the disappearance of the two-site entanglement certificate. No artificial noise is added; unknown states are excluded from performance metrics.
Rank
Order
Support
Tensor / unfolding
Invariant
1
T(3)
contiguous
raw, mode 0
s3
2
T(2)
r=1
raw
s2
3
T(4)
contiguous
raw, 14∣23
s3
4
T(3)
contiguous
raw, mode 1
s3
5
T(4)
contiguous
raw, 13∣24
s2
6
T(4)
contiguous
raw, 13∣24
s3
Appendix
Table 3: The 16 selected LU-invariant channels, ordered by consensus rank. For T(3) , mode a denotes the a∣(bc) unfolding. Four-body partitions refer to the site indices within a contiguous block.
Model
Benchmark
AUROC
E2 recall
E>2 recall
FPR
Raw correlators, T1−4
N=16 XY
0.6944
0.8914
1.0000
1.0000
N=32 XY
0.3931
1.0000
1.0000
1.0000
N=32 synthetic
0.1212
0
0
0.0200
Independent Sep
—
—
—
0.0600
Soft LU, T1−4
N=16 XY
0.5975
0.6326
0.8739
1.0000
N=32 XY
0.6072
0.7468
0.9500
1.0000
Appendix
Table 4: Comparison of input representations using correlations through fourth order. All models are trained on the same primary N=16 training distribution. Predictions are averaged as probabilities across three independently initialized classifiers. Recall and false-positive rate (FPR) use the fixed threshold p=0.5 . For the independent separable benchmark, only FPR is defined.
K
Width
AUROC
E2 recall
E>2 recall
FPR
4
9
0.6667
0.6709
0.1513
0
8
13
0.6968
0.7764
0.1597
0
12
17
0.8981
0.7316
0.7731
0
16
21
1.0000
1.0000
1.0000
0
20
25
0.9606
0.9201
0.9496
0
24
29
0.9954
0.9521
0.9328
0
Appendix
Table 5: Channel-budget comparison on the N=16 XY benchmark. Classifiers use nested prefixes of the same frozen channel ranking and are independently trained on the primary training distribution. Values are computed from three-seed probability-averaged predictions. FPR refers to 432 constructively separable controls.
Family (Sep/ E2 / E3 / E4 )
AUROC
FPR
E2
E3
E4
XXZ (79/103/52/30)
1.0000
0
0.9903
1.0000
1.0000
J1 – J2 (30/155/80/30)
1.0000
0
0.8645
1.0000
1.0000
Random local H (39/238/87/40)
1.0000
0
1.0000
1.0000
1.0000
Appendix
Table 6: Performance of the frozen EntNet ensemble on the N=16 Gibbs-state benchmarks from different Hamiltonian families. Counts in parentheses denote Sep/ E2 / E3 / E4 . Unknown states are excluded from all metrics. Recall and FPR are evaluated at the fixed threshold p=0.5 .
Figure 4: Complementary contributions of pair and higher-order correlations. (a) E4 recall on the synthetic N=32 benchmark using features through third order, after adding two selected four-body channels, and with the complete 16-channel representation. (b) Changes in exact-state AUROC and independent separable-state true-negative rate (TNR) after removing the selected r=4 pair channels or replacing them with additional four-body invariants. (c)–(f) Classifier-score distributions for N=16J1 – J2 Gibbs states before and after replacing selected feature blocks with their training-set means. Three- and four-body channels are replaced in (c,e), while pair channels are replaced in (d,f). Panels (c,d) use the original training distribution; panels (e,f) use the same distribution supplemented with independently generated states exhibiting strong distance-two correlations. Within each state class, the original and modified inputs are shown on the left and right, respectively. Circles indicate medians, vertical segments show interquartile ranges, and the dashed line marks p=0.5 . Because modified inputs need not correspond to physical density matrices, these interventions measure the model’s dependence on feature blocks rather than causal contributions to entanglement.
Training
Class
n
Full
No T(3)/T(4)
No pair
Original
Sep
30
0
30
0
E2
155
134
81
153
E>2
110
110
110
109
Unknown
168
168
168
84
Augmented
Sep
30
0
30
0
E2
155
155
83
155
Appendix
Table 7: Numbers of J1 – J2 states classified as entangled ( p≥0.5 ) before and after replacing a feature block by the corresponding training-set means. The higher-order-certified class contains 80 E3 and 30 E4 states. “Original” denotes training on the primary distribution alone; “Augmented” adds 1,400 independent states with strong distance-two correlation patterns, without changing the selected 16 channels.
Entanglement is a fundamental feature of quantum mechanics, playing a crucial role in quantum information processing. However, classifying entangled states, particularly in the mixed-state regime, remains a challenging problem, especially as system dimensions increase. In this work, we focus on bipartite quantum states and present a data-driven approach to entanglement classification using transformer-based neural networks. Our dataset consists of a diverse set of bipartite states, including pure separable states, Werner entangled states, general entangled states, and maximally entangled states. We pretrain the transformer in an unsupervised fashion by masking elements of vectorized Hermitian matrix representations of quantum states, allowing the model to learn structural properties of quantum density matrices. This approach enables the model to generalize entanglement characteristics across different classes of states. Once trained, our method achieves near-perfect classification accuracy, effectively distinguishing between separable and entangled states. Compared to previous Machine Learning, our method successfully adapts transformers for quantum state analysis, demonstrating their ability to systematically identify entanglement in bipartite systems. These results highlight the potential of modern machine learning techniques in automating entanglement detection and classification, bridging the gap between quantum information theory and artificial intelligence.
Przemysław Sekuła, Michał Romaszewski, Przemysław Głomb +2
Institute of Theoretical and Applied Informatics, Polish Academy of Sciences, Bałtycka 5, 44-100 Gliwice, Poland · University of Maryland, College Park, Department of Civil and Environmental Engineering, MD, USA
Detecting phases of matter in general relies on identifying the correct order parameter - a task that remains notoriously difficult for unknown transitions and traditionally is guided by physical intuition and educated guess. Neural networks have recently offered an alternative route by locating phase transitions in known models without any a priori physical knowledge. Yet these approaches remain black boxes and only identify phases without elucidating their properties. Moreover, they often struggle when confronted with realistic, noisy experimental data, which constitute the ultimate testbed for automated methods in physics. Here, we bridge these perspectives by introducing TetrisCNN, a convolutional architecture with parallel branches of differently shaped filters, reminiscent of Tetris blocks, that learns sparse, interpretable latent representations directly in terms of spin correlators. Applied to experimental snapshots of two-dimensional Ising and XY quantum simulators measured in multiple bases, the network not only detects phase transitions and crossovers but also expresses its latent representation and decision boundaries as symbolic formulas built from experimentally measurable spin correlators. This framework opens the way to integrating interpretable neural networks with quantum simulators to uncover and understand new phases of matter.
Kacper Cybiński, Björn van Zwol, James Enouen +5
Faculty of Physics, University of Warsaw, Pasteura 5, 02-093 Warsaw, Poland · IDEAS Research Institute, Królewska 27, 00-060 Warsaw, Poland · Applied Quantum Algorithms ⟨aQaL⟩, LIACS & LION, Leiden University, The Netherlands +7
Using partial knowledge of a quantum state to control multiqubit entanglement is a largely unexplored paradigm in the emerging field of quantum interactive dynamics with the potential to address outstanding challenges in quantum state preparation and compression, quantum control, and quantum complexity. We present a deep reinforcement learning (RL) approach using an actor-critic algorithm for constructing short disentangling circuits for states with up to 16 qubits. With access to only two-qubit reduced density matrices, our agent decides which pairs of qubits to apply two-qubit gates on; requiring only local information makes it directly applicable on modern NISQ devices, as we demonstrated experimentally on a trapped-ion quantum computer. Utilizing a permutation-equivariant transformer architecture, the agent can autonomously identify qubit permutations within the state, and adjusts the disentangling protocol accordingly. Once trained, it provides circuits from different initial states without further optimization. We demonstrate the agent's ability to identify and exploit the entanglement structure of multi-qubit states. We analyze the disentangling circuits constructed by the agent for 4- and 5-qubit Haar-random states, and observe strong correlations between consecutive gates and among the qubits involved. Through extensive benchmarking, we show the efficacy of the RL approach to find disentangling protocols with minimal gate resources. We explore the resilience of our trained agents to noise, highlighting their potential for real-world quantum computing applications. Analyzing optimal disentangling protocols, we report a general circuit to prepare an arbitrary 4-qubit state using at most 5 two-qubit (10 CNOT) gates.
Pavel Tashev, Stefan Petrov, Matthew T. Diaz +4
Department of Mathematics and Informatics, St. Kliment Ohridski University of Sofia, 5 James Bourchier Blvd, 1164 Sofia, Bulgaria · Joint Quantum Institute and Department of Physics, University of Maryland, College Park, Maryland 20742, USA · National Quantum Laboratory (QLab), University of Maryland, College Park, MD 20742 USA +4