# Quantifying Unknown Entanglement by Neural Networks

Xiaodie Lin  Zhenyu Chen  Zhaohui Wei  Email<EMAIL_ADDRESS>Center for
Quantum Information, Institute for Interdisciplinary Information Sciences,
Tsinghua University, Beijing 100084, China

###### Abstract

Quantum entanglement plays a crucial role in quantum information processing
tasks and quantum mechanics, hence quantifying unknown entanglement is a
fundamental task. However, this is also challenging, as entanglement cannot be
measured by any observables directly. In this paper, we train neural networks
to quantify unknown entanglement, where the input features of neural networks
are the outcome statistics data produced by locally measuring target quantum
states, and the training labels are well-chosen quantities. For bipartite
quantum states, this quantity is coherent information, which is a lower bound
for the entanglement of formation and the entanglement of distillation. For
multipartite quantum states, we choose this quantity as the geometric measure
of entanglement. It turns out that the neural networks we train have very good
performance in quantifying unknown quantum states, and can beat previous
approaches like semi-device-independent protocols for this problem easily in
both precision and application range. We also observe a surprising phenomenon
that on quantum states with stronger quantum nonlocality, the neural networks
tend to have better performance, though we do not provide them any knowledge
on quantum nonlocality.

††preprint: APS/123-QED

##  I Introduction

It is well-known that quantum entanglement plays a central role in designing
quantum information processing tasks and understanding quantum mechanics. As a
result, characterizing unknown quantum entanglement is a fundamental problem.
However, as entanglement cannot be measured directly using any physical
observables, this is a very challenging task that has attracted a lot of
attentions.

Two most popular approaches adopted by quantum experimentalists for this
problem are quantum tomography and entanglement witness [1, 2, 3, 4], though
both of them suffer from obvious drawbacks. Indeed, quantum tomography
extracts the full information of target quantum systems, which allows us to
look into the underlying entanglement. However, to achieve this exponential
amount of resources is needed, thus tomography is not a realistic option even
in the realm of noisy, intermediate scale quantum (NISQ) era. On the other
hand, though the idea of entanglement witness is much more efficient, it needs
much nontrivial prior knowledge on target systems, and usually can only
provide an unreliable yes or no answer on whether entanglement exists [4]. In
order to overcome the difficulties of these two approaches, device-independent
protocols have been proposed to certify the existence of entanglement [5, 6,
7, 8, 9, 10, 11], where all conclusions are drawn based only on observed
quantum nonlocality, and thus are reliable.

Meanwhile, as quantum computing becomes more and more important from the
viewpoint of engineering, how to _quantify_ unknown entanglement, an even
harder task than only certifying the existence, has also been an important and
urgent issue. However, the quantification of entanglement is a very
complicated problem when it comes to mixed quantum states and multipartite
quantum states [12], where quite a lot of reasonable measures have been
proposed, and most of them are very hard to calculate even if the full
information of target quantum states is given, not to mention experimentally
quantifying unknown multipartite entanglement.

Among these measures of entanglement, the quantum Rényi entropies and
logarithmic negativity are relatively easier to handle [12, 13, 14], thus have
been extensively studied in recent years. Indeed, some interesting protocols
have been proposed to characterize these two measures by analyzing the data
produced by well-designed measurements [15, 16, 17, 18]. Particularly, machine
learning tools like neural networks have been introduced to quantity
logarithmic negativity, which provides very nice performance [19] (see also
Ref.[20]). However, it should be pointed out that, in addition to the quantum
Rényi entropies and logarithmic negativity, we have many more important
measures of entanglement, say the entanglement of formation and the
entanglement of distillation [12]. Undoubtedly, proposing protocols that are
able to experimentally quantify these widely-used measures of entanglement is
a very important task.

In fact, device-independent protocols have also been utilized to quantify
unknown quantum states [21, 22, 23, 24, 21, 25, 26]. Particularly, by defining
a concept called nondegenrate Bell inequalities, a semi-device-independent
scheme that can lower bound the coherent information for any unknown bipartite
quantum states was found [27]. Note that coherent information is a lower bound
for the entanglement of formation and the entanglement of distillation [28],
implying that this actually provides an approach partially quantifying these
two important measures of entanglement. Later, this approach has been
generalized to quantify multipartite entanglement by the geometric measure and
the relative entropy of entanglement [29].

However, the results provided by device-independent protocols like those in
Refs.[27, 29] are very conservative and weak. In fact, usually these protocols
can provide informative results only when the observed nonlocality is close to
maximal violation, which seriously restricts their applications. As a result,
new schemes that can experimentally quantify these entanglement measures with
better performance and wider application ranges have to be explored, which is
also the main motivation of the current paper.

In this paper, we apply neural networks to quantify unknown quantum
entanglement by several popular entanglement measures. Specifically, to train
the neural networks, we choose the outcome statistics data produced by locally
measuring sample quantum states as features, and choose coherent information
for bipartite quantum states, or the geometric measure of entanglement for
multipartite quantum states, as sample labels or prediction targets. Note that
for bipartite quantum states, coherent information is a lower bound for the
entanglement of formation and the entanglement of distillation, thus our
results can be regarded as partial quantifications of these two important
entanglement measures. By running the trained neural networks on unknown test
states, we show that they have very good performance in quantifying the
involved entanglement. For example, the prediction results beat those of known
device-independent protocols for this problem easily in both precision and
application range, implying the high potential value of neural networks in
quantifying unknown quantum entanglement. Furthermore, we observe interesting
evidences showing that neural networks have better performance on quantum
states with stronger nonlocality, though our training data does not contain
any direct information on quantum nonlocality.

##  II Settings and Entanglement Measures

As mentioned above, the data features that neural networks work with are the
measurement outcome statistics produced by local measurements on target
quantum states. Suppose we have a physical system shared by $n$ space-
separated parties, and the state is $\rho$. Each party $i$, where
$i\in\\{1,..,n\\}$, has a set of measurement devices labelled by $X_{i}$ and
the possible measurement outcomes are labelled by $A_{i}$. Assume every party
randomly chooses a measurement $x_{i}\in X_{i}$ to measure their subsystems
and record the corresponding outcomes $a_{i}\in A_{i}$. After repeating the
procedure for many times, they have the joint probability distribution
$p(a_{1}a_{2}...a_{n}|x_{1}x_{2}...x_{n})$, which indicates the probability of
obtaining outcomes $a_{i}\in A_{i}$ when measurements $x_{i}\in X_{i}$ are
chosen. Suppose $M_{x_{i}}^{a_{i}}$ is the measurement operator with outcome
$a_{i}$ for the measurement device $x_{i}$ performed by the party $i$, then it
holds that

$\displaystyle p(a_{1}a_{2}...a_{n}|x_{1}x_{2}...x_{n})={\rm
Tr}\left(\left(\bigotimes_{i=1}^{n}M_{x_{i}}^{a_{i}}\right)\rho\right).$ (1)

Note that although our setting is quite similar with Bell experiments, we will
not talk about nonlocality and Bell inequalities at most time, though like in
Bell experiments we hope that neural networks will reveal us nontrivial
information on the amount of entanglement based only on the data
$p(a_{1}a_{2}...a_{n}|x_{1}x_{2}...x_{n})$.

For this, we have to choose proper entanglement measures for our tasks. Before
doing that, let us first recall briefly how neural networks, a machine
learning model we will utilize in this paper, work. First, we set up a proper
mathematical model for the target problem, which usually contains one input
layer, zero or more hidden layers, and one output layer, and every two
adjacent layers involve a lot of parameters. Then we gather many
representative sample data with correct labels, called training data, and
input them into the model. We hope the outputs of the model are as consistent
as possible with the correct labels, for which we constantly adjust the
parameters by proper optimization methods, and this process is called
training. If we train the model correctly, eventually it will capture crucial
properties of the training dataset, and can even predict the labels very
precisely on an unknown test dataset.

Accordingly, in our task the outputs of neural networks, or the labels of
training dataset, are supposed to be target entanglement measures we are
interested in. As a consequence, in order to prepare sufficient representative
training data with correct labels, we have to make sure that the corresponding
entanglement measures can be computed accurately on all training states. As is
well-known, this is a very challenging task. For example, if we choose the
entanglement of formation and the entanglement of distillation as our target
entanglement measures, this requirement is very hard to satisfy. Therefore, if
we insist on our target entanglement measures, we have to make proper
compromises.

For bipartite quantum states, a possible way to compromise is to quantify
coherent information instead. Coherent information is a fundamental quantity
responsible for the capability of transition of quantum information [30, 31].
For a quantum state $\rho$ acting on a composite Hilbert space
$\mathcal{H}_{A}\otimes\mathcal{H}_{B}$, its coherent information is defined
as

$\displaystyle I_{C}(\rho)=S(\rho_{A})-S(\rho),$ (2)

where $\rho_{A}={\rm Tr}_{B}(\rho)$ is the subsystem in $\mathcal{H}_{A}$ and
$S(\rho)$ is the Von Neumann entropy of $\rho$. It can be seen that the
coherent information is relatively easy to calculate, and most importantly, it
turns out that [28]

$\displaystyle E_{f}(\rho)\geq E_{D}(\rho)\geq I_{C}(\rho),$ (3)

where $E_{f}(\rho)$ is the entanglement of formation of $\rho$ and
$E_{D}(\rho)$ is the distillable entanglement of $\rho$. Therefore, if we
choose the prediction target of neural networks as coherent information, the
training data should be easy to gather, and if the model has good performance,
we can eventually obtain nontrivial information on $E_{f}(\rho)$ and
$E_{D}(\rho)$ for target quantum states.

We now turn to the case of multipartite quantum states. Unfortunately, in this
case very few well-known entanglement measures or quantities related to
entanglement measures can be calculated accurately, which makes it very hard
to prepare representative training data for our neural networks. In this
paper, we choose the geometric measure of entanglement (GME) as our target
entanglement measure. The reason is that by numerical methods, we can barely
manage to calculate the entanglement measure of some pure multipartite quantum
states, which serve as the training data.

Recall that the GME is firstly introduced in the setting of bipartite pure
states [32], and then generalized to the multipartite setting [33]. For a
$n$-partite pure state $|\psi\rangle$, the GME is defined as

$\displaystyle E_{G}(|\psi\rangle)=1-G(|\psi\rangle)^{2},$ (4)

where

$\displaystyle G(|\psi\rangle)=\sup_{|\phi\rangle\in{\rm
sep}_{n}}|\langle\psi|\phi\rangle|,$ (5)

and ${\rm sep}_{n}$ is the set of $n$-partite product pure states. For a mixed
state $\rho$, the GME is defined by convex roof construction, which is

$\displaystyle
E_{G}(\rho)=\min_{\rho=\sum_{i}p_{i}|\psi_{i}\rangle\langle\psi_{i}|}\sum_{i}E_{G}(|\psi_{i}\rangle).$
(6)

##  III Quantifying Bipartite Entanglement

###  III.1 Qutrit-qutrit case

As a warm-up, we first consider quantifying the coherent information of a
special class of qutrit-qutrit quantum states, which have the form

$\displaystyle\rho_{3_{\epsilon}}^{mv}=(1-\epsilon)I_{9}/9+\epsilon|\psi_{3}^{mv}\rangle\langle\psi_{3}^{mv}|,$
(7)

where $\epsilon\in[0,1]$ and
$|\psi_{3}^{mv}\rangle=\gamma(|00\rangle+|22\rangle)+\sqrt{1-2\gamma^{2}}|11\rangle$
with $\gamma\approx 0.617$. Note that $|\psi_{3}^{mv}\rangle$ is the quantum
state that violates the Collins-Gisin-Linden-Massar-Popescu (CGLMP) inequality
maximally [34, 35, 36, 37]. The reason why we choose this class of states as
our first target is that their coherent information can also been quantified
using the semi-device-independent approach proposed in Ref.[27], which
provides us a nice chance to compare the performance of these two different
approaches.

As mentioned above, the sample features for the neural networks we choose are
the outcome statistics data produced by locally measuring the involved quantum
states. Here the local measurements we choose are the ones that maximize the
violation of the CGLMP inequality, which can be described by observables
$A_{a}$ and $B_{b}$ with the eigenvectors

$\displaystyle|i\rangle_{A,a}=\frac{1}{\sqrt{d}}\sum_{k=0}^{d-1}{\rm
exp}\left({\mathbf{i}}\frac{2\pi}{d}k(i+\alpha_{a})\right)|k\rangle_{A}$ (8)

and

$\displaystyle|j\rangle_{B,b}=\frac{1}{\sqrt{d}}\sum_{l=0}^{d-1}{\rm
exp}\left({\mathbf{i}}\frac{2\pi}{d}l(-j+\beta_{b})\right)|l\rangle_{B}$ (9)

respectively [34, 38], where $a,b\in\\{1,2\\}$, $i,j\in\\{0,1,...,d-1\\}$,
${\mathbf{i}}=\sqrt{-1}$ is the imaginary number, and the phases read
$\alpha_{1}=0,\alpha_{2}=1/2,\beta_{1}=1/4$ and $\beta_{2}=-1/4$. In this
subsection, we let $d=3$.

To generate the training dataset, a number of bipartite quantum states of form
$(1-\epsilon)I_{9}/9+\epsilon\rho_{0}$ are sampled. Here we select $\epsilon$
from 0.2 to 1 at intervals 0.025 and $\rho_{0}$ as arbitrary quantum state in
$\mathcal{H}^{3}\otimes\mathcal{H}^{3}$. For each $\epsilon$ not larger than
0.75, 1,000 states are randomly sampled, while for the other values of
$\epsilon$, we increase the number of samples to 2,000. Then, the
corresponding outcome statistics data are recorded when measuring $A_{a}$ and
$B_{b}$ locally on the sampled states. Together with the corresponding
coherent information as the labels, 43,000 instances as training dataset are
fed to a 4-hidden-layer fully connected neural network with 400, 200, 100, 50
neurons in each layer, respectively.

Figure 1: The neural network predictions for the coherent information of
$\rho_{3_{\epsilon}}^{mv}$. The blue line and the orange line represent the
prediction values and the exact values, respectively, where the MSE of these
prediction values is 0.0040. In addition, the green line shows the lower bound
for the coherent information provided by the semi-device-independent (semi-DI)
approach in Ref.[27], which has a much narrower application range.

After training, we apply our model to predict the coherent information of
$\rho_{3_{\epsilon}}^{mv}$ and the test dataset is generated by selecting
$\epsilon$ from 0 to 1 at intervals 0.005. We evaluate the performance of the
model with mean squared error (MSE), which is defined as

$\displaystyle{\rm MSE}=\frac{1}{N}\sum_{i=1}^{N}(Y_{i}-\hat{Y}_{i})^{2},$
(10)

where $Y_{i}$ is the exact value of coherent information, $\hat{Y}_{i}$ is the
predicted value, and $N$ is the size of the test dataset. The prediction
results are shown in Fig.1, in which the blue line and the orange line
represent the prediction and the exact values of coherent information,
respectively. It can be seen that our model behaves very well in this task,
whose MSE is 0.0040.

As a comparison, the above setting can also be handled by the semi-device-
independent approach given by Ref.[27]. As illustrated by the green line in
Fig.1, the method in Ref.[27] can provide nontrivial lower bound for the
coherent information only when $\epsilon$ ranges from 0.8610 to 1, and the
performance is also much worse. Therefore, in this case the neural network
approach beats the approach in Ref.[27] easily.

Figure 2: The neural network predictions for the coherent information of
qutrit-qutrit quantum states. Each boxplot indicates the degree of dispersion
and skewness in the squared errors for each case. (a) Boxplots of NMR pure
states (blue) and NMR mixed states (orange), where the corresponding MSEs are
0.0137 and 0.0281 respectively. (b) Boxplots of general pure states (green)
and general mixed states (red), where the corresponding MSEs are 0.0161 and
0.0407 respectively.

We now apply neural networks to quantify the coherent information for more
general qutrit-qutrit quantum states. For this, we consider the following four
different classes of quantum states.

  * •

$(1-\epsilon)I_{9}/9+\epsilon|\psi\rangle\langle\psi|$, where $|\psi\rangle$
is an arbitrary pure state (called _NMR pure states_).

  * •

$(1-\epsilon)I_{9}/9+\epsilon\rho_{0}$, where $\rho_{0}$ is an arbitrary mixed
state (called _NMR mixed states_).

  * •

$|\psi\rangle\langle\psi|$, where $|\psi\rangle$ is an arbitrary pure state
(called _general pure states_).

  * •

$\rho_{0}$, where $\rho_{0}$ is an arbitrary mixed states (called _general
mixed states_).

In order to make the training data as representative as possible, we will
generate them by picking up sample states from all the four classes. After the
training stage is finished, we then test the performance of our neural network
for each class separately. The neural network we choose has the same structure
as before, whose 4 hidden layers has 400, 200, 100, 50 neurons, respectively.

More concretely, when generating training data from the classes of NMR pure
and NMR mixed states, the way we pick up sample states is similar to the
previous experiment. That is, we select $\epsilon$ at intervals 0.025 and
randomly generate 2,000 states for each $\epsilon$ from 0.2 to 0.75, and 4,000
states for each $\epsilon$ from 0.775 to 0.975, where 82,000 sample states are
picked up for each class. When generating training data from the classes of
general pure and general mixed states, whose coherent information considered
for training dataset ranges from 0 to $\log_{2}3$ and from $-\log_{2}3$ to 1.5
respectively, we sample states according to coherent information, and choose
4,000 states randomly in each interval of size 0.1. Here the only exception is
for general mixed states with coherent information larger than 1.5. Due to the
low sampling efficiency, we do not insist on the number of states produced in
this case, and just collect all such states during the sampling process.
Eventually, 64,000 general pure states, 124,211 general mixed states, and
164,000 NMR pure and mixed states are chosen as training states. Performing
the same local measurements as the previous experiment on them and recording
the outcome statistics data for each state as the features, together with the
corresponding coherent information as the label, we obtain the whole training
dataset, which has 352,211 sample states.

After training the model, we now test its performance on the above four
classes of quantum states separately. That is to say, for each class we
generate a test dataset by sampling around 2,000 random states uniformly
according to coherent information. Similarly, we use the MSE to measure the
prediction performance of our model. The results are listed in Fig.2. For
convenience, we represent the experimental results in the form of boxplot,
where each boxplot displays a dataset based on a five-number summary: the
lowest data point excluding any outliers (minimum), the median of the lower
half of the dataset (first quartile), the median of the dataset, the median of
the upper half of the dataset (third quartile) and the largest data point
excluding any outliers (maximum).

As we can see in Fig.2(a), when predicting the coherent information of NMR
pure and mixed states, the MSEs are 0.0137 and 0.0281 respectively. Here the
distribution of the squared error for NMR pure states is very narrow,
indicating the very high quality predictions. Fig.2(b) shows the results for
general pure states and general mixed states, where the corresponding MSEs are
0.0161 and 0.0407 respectively. Overall, it can be said that even for the most
general case of qutrit-qutrit quantum states, the neural network model still
enjoys decent performance in predicting coherent information.

###  III.2 Higher-dimensional cases

Table 1: The structure and configuration details of the convolutional neural network (see Refs. [39, 40] for introductions to convolutional neural networks). Layers | Type | Neurons | Filters | Kernel size | Strides | Pool size
---|---|---|---|---|---|---
0-1 | Convolution2D | (None, 9, 9, 32) | 32 |  2$\times 2$ | $1\times 1$ | -
1-2 | Max-pooling2D | (None, 8, 8, 32) | - | - | $1\times 1$ |  2$\times 2$
2-3 | Convolution2D | (None, 7, 7, 64) | 64 |  2$\times 2$ | $1\times 1$ | -
3-4 | Max-pooling2D | (None, 6, 6, 64) | - | - | $1\times 1$ |  2$\times 2$
4-5 | Convolution2D | (None, 5, 5, 64) | 64 |  2$\times 2$ | $1\times 1$ | -
5-6 | Fully-connected | (None, 32) | - | - | - | -
6-7 | Fully-connected | (None, 1) | - | - | - | -

We now utilize neural networks to predict the coherent information of
bipartite quantum states in higher-dimensional Hilbert space
$\mathcal{H}^{d}\otimes\mathcal{H}^{d}$. In this case, the task of picking up
proper training dataset is more challenging. In order to make the sample
states for training as representative as possible, we consider a class of
quantum states of the form

$\displaystyle\rho_{d}=\alpha\rho_{0}+\beta
I_{d^{2}}/{d^{2}}+\gamma|\psi^{me}_{d}\rangle\langle\psi^{me}_{d}|,$ (11)

where $\alpha,\beta,\gamma\geq 0$, $\alpha+\beta+\gamma=1$, $\rho_{0}$ is an
arbitrary quantum state in $\mathcal{H}^{d}\otimes\mathcal{H}^{d}$,
$I_{d^{2}}/{d^{2}}$ is the bipartite maximally mixed state, and
$|\psi^{me}_{d}\rangle=\sum_{i=0}^{d-1}|ii\rangle/\sqrt{d}$ is the maximally
entangled state. In other words, $\rho_{d}$ is a linear combination of three
completely different types of quantum states.

To demonstrate how to generate training dataset for this case, let us take
$d=5$ as an example. The training states will be composed by two parts.
Firstly, we generate the first part of the training states by sampling
$\rho_{5}$ in Eq.(11), where about 170,000 states are chosen. More concretely,
when $\alpha$ is no less than 0.4, $\alpha$ and $\beta$ are varied at
intervals 0.02, and for each choices of the coefficients, 200 random
$\rho_{5}$ are produced by sampling $\rho_{0}$. When $\alpha$ is smaller than
0.4, we vary $\alpha,\beta$ at intervals 0.04 and sample 100 $\rho_{5}$ states
similarly for each choices of the coefficients. The second part of the
training states will be produced in a similar way with the qutrit-qutrit case.
That is, we separately sample 82,000 NMR pure states, 130,000 NMR mixed
states, 40,000 general pure states, and 84,000 general mixed states in such a
way that their coherent information is distributed evenly. Here, when sampling
general pure states, we find that it is hard to sample states with coherent
information less than 0.8. In order to have a relatively complete coherent
information distribution, we generate general pure states by

$\displaystyle|\psi_{5}\rangle=\alpha|\psi_{5}^{\prime}\rangle+(1-\alpha)|\psi_{5}^{sep}\rangle,$
(12)

where $\alpha\in[0,1]$, $|\psi_{5}^{\prime}\rangle$ and
$|\psi_{5}^{sep}\rangle$ are an arbitrary pure state and an arbitrary
separable pure state in $\mathcal{H}^{5}\otimes\mathcal{H}^{5}$, respectively.
After picking up the states for training, we measure them by the local
measurements given in Eqs.(8) and (9), and generate the measurement outcome
statistics data as the features for the neural network. As training dataset,
we compute the coherent information for each sample state as the corresponding
label.

Compared with fully connected neural networks, in higher-dimensional cases we
find that convolutional neural networks have better performance in quantifying
entanglement (see Refs. [39, 40] for introductions to convolutional neural
networks). The structure of the convolutional neural network we choose is
listed in Table 1. Again, we test the performance of the trained neural
network by utilizing it to separately predict the coherent information of four
classes of quantum states, say NMR pure states, NMR mixed states, general pure
states and general mixed states.

Figure 3: The neural network predictions for the coherent information of
higher-dimensional quantum states, where $d=5$. Each boxplot indicates the
degree of dispersion and skewness in the squared errors for each case. (a)
Boxplots of NMR pure states (blue) and NMR mixed states (orange), where the
corresponding MSEs are 0.0123 and 0.0356 respectively. (b) Boxplots of general
pure states (green) and general mixed states (red), where the corresponding
MSEs are 0.0275 and 0.0436 respectively.

For each class of test states, we fix the number of instances to be 2,000, and
the experimental results are presented in Fig.3. It can be seen that the
overall performance is similar to the qutrit-qutrit case, and the MSEs are
0.0123, 0.0356, 0.0275 and 0.0436, respectively.

In addition to the boxplots, to further describe the degree of dispersion of
the prediction results, we also compute the relative error of predictions for
test states. For the class of general mixed states, which is the hardest to
predict, the mean relative error is smaller than $15\%$ $(10\%)$ for test
states whose absolute values of the exact coherent information are larger than
0.5 (1.0).

To examine the performance of neural networks better, we now increase the
dimension of target quantum states even further, and use a convolutional
neural network similar to the one in Table 1 to predict coherent information,
where the only difference is that we increase the kernel size and pool size
from $2\times 2$ to $3\times 3$. Note that when quantum dimension goes up, it
is very challenging to handle the sharply-increasing amount of data.
Therefore, from now on we only do the following two experiments: (1) both the
training states and the test states are sampled from general mixed states; (2)
both the training states and the test states are sampled from general pure
states. In each case, the number of training samples is around 40,000, and the
number of test samples is over 2,000. Similar to before, we try to pick up
these samples evenly according to their coherent information.

We run the model for quantum states with dimensions from 5 to 10, and the
results are listed in Table 2. Compared with Fig.3(b), the prediction MSEs for
general pure states and general mixed states are improved from 0.0275 to
0.0135 and from 0.0436 to 0.0347 respectively, showing that utilizing prior
knowledge on target quantum states can improve the performance. Furthermore, a
very surprising fact is that, unlike fully connected neural networks, when the
quantum dimension goes up, the convolutional neural network model behaves even
better, confirming the claim that convolutional neural network is a more
suitable choice for higher-dimensional cases. Combining all the results
together, we can see that neural networks still enjoy a very decent
performance in quantifying entanglement even for high-dimensional quantum
systems.

Table 2: The MSEs of predicting coherent information for different dimensions. Each case is trained with around 40,000 samples and tested with over 2,000 samples. Dimension | $d=5$ | $d=6$ | $d=7$ | $d=8$ | $d=9$ | $d=10$
---|---|---|---|---|---|---
Pure | 0.0135 | 0.0110 | 0.0107 | 0.0090 | 0.0093 | 0.0086
Mixed | 0.0347 | 0.0321 | 0.0255 | 0.0217 | 0.0171 | 0.0149

##  IV Quantifying Multipartite Entanglement

Compared with bipartite entanglement, multipartite entanglement has much more
complicated mathematical structures. Many different measures have been defined
to quantify multipartite entanglement, and almost all of them are hard to
calculate. As mentioned before, in order to apply neural network models to
quantify unknown multipartite entanglement, we have to make sure that correct
labels, which is some entanglement measure here, of training states are
computationally tractable. For this, we choose the geometric measure of
entanglement as our target entanglement measure, as it is relatively easy to
handle among well-known multipartite entanglement measures, especially for the
case of pure states. Therefore, in this section we will only train and test
our neural networks using three-qubit pure states.

To prepare training data, for every three-qubit pure state
$|\psi\rangle\in\mathcal{H}^{2}\otimes\mathcal{H}^{2}\otimes\mathcal{H}^{2}$
we measure each qubit by observables Pauli $\sigma_{x}$ and $\sigma_{y}$, and
record the outcome statistics data as the corresponding features. As the label
of the above features, we compute the value of $E_{G}(|\psi\rangle)$ in Eq.(4)
by numerical calculations. The whole training dataset is generated by sampling
states according to their GME. Concretely, when the value of GME is from 0 to
0.7, we sample 5,000 three-qubit pure states for each interval of size 0.1.
When the GME is larger than 0.7, we do not insist on the number of samples
obtained, and just collect all the qualified states we sample. In addition, we
also sample 5,000 separable states as part of the training states, and the
involved local measurements are the same as before. Combining the above two
parts, we get the training dataset with 40,342 instances. Then we use the
training data to train a 4-hidden-layer fully connected neural network, where
each layer has 50, 20, 10, 5 neurons, respectively.

We now turn to the sampling of test states. Recall that there are only two
classes of genuinely tripartite entanglement which are inequivalent under
local operations and classical communication(LOCC) [41]. One class is
represented by the Greenberger-Horne-Zeilinger (GHZ) state [42],

$\displaystyle|{\rm
GHZ}\rangle=\left(|000\rangle+|111\rangle\right)/\sqrt{2},$ (13)

and the other class is represented by the W state [41],

$\displaystyle|{\rm
W}\rangle=\left(|001\rangle+|010\rangle+|100\rangle\right)/\sqrt{3}.$ (14)

Therefore, we are interested in the behavior of our model on these two states.
For this, we consider the following two classes of states,

$\displaystyle|\varphi_{p}\rangle=\sqrt{p}|{\rm
W}\rangle+\sqrt{1-p}|{\rm\overline{W}}\rangle,$ (15)

and

$|\varphi^{\prime}_{p}\rangle=\sqrt{p}|{\rm
GHZ}\rangle+\sqrt{(1-p)/2}\left(|{\rm
W}\rangle+|{\rm\overline{W}}\rangle\right),$ (16)

where $p\in[0,1]$ and
$|{\rm\overline{W}}\rangle=\left(|110\rangle+|101\rangle+|011\rangle\right)/\sqrt{3}$.

Figure 4: The neural network predictions for the GME of three-qubit pure
states. The blue line and the orange line represent the prediction values and
the exact values, respectively. (a) The results for the state
$|\varphi_{p}\rangle$, where the MSE of the prediction values is $1.26\times
10^{-5}$. (b) The results for the state $|\varphi^{\prime}_{p}\rangle$, where
the MSE of the prediction values is $7.72\times 10^{-5}$.

We sample states within $|\varphi_{p}\rangle$ and
$|\varphi^{\prime}_{p}\rangle$ to serve as our test samples, where $p$ is
chosen from 0 to 1 at intervals 0.005. The prediction results are illustrated
in Fig.4, in which (a) is for the state $|\varphi_{p}\rangle$ and (b) is for
the state $|\varphi^{\prime}_{p}\rangle$. As we can see, the prediction values
fit the exact values very well in both cases, whose MSEs are $1.26\times
10^{-5}$ and $7.72\times 10^{-5}$, respectively.

In addition, we also test the performance of a properly trained neural network
on another test dataset composed by around 2,000 random three-qubit pure
states, whose GME ranges from 0 to 0.7 evenly. Again, the performance is
excellent and the MSE is only 0.0043. These high quality predictions strongly
imply that neural networks can have satisfactory performance in quantifying
unknown multipartite entanglement.

##  V Neural Networks can feel Nonlocality

In our neural network models, the features are chosen as statistics data of
the outcomes when local measurements are performed on samples. Actually this
kind of statistics data is exactly what people utilize in studying
nonlocality, though as stressed before, quantum nonlocality is not considered
in the training and testing of our neural networks at all. However, due to
this similarity, we may wonder, does quantum nonlocality play any role in the
workings of our neural networks? Interestingly, we observe strong evidences
suggesting that the answer to this question is positive.

For this, let us go back to the neural network we have trained for state
$\rho^{mv}_{3_{\epsilon}}$ in Sec III. A. We now run that well-trained neural
network on the following special class of quantum states,

$\displaystyle\rho_{{p,\gamma}}=(1-p)I_{9}/9+p|\phi_{{\gamma}}\rangle\langle\phi_{{\gamma}}|,$
(17)

where

$\displaystyle|\phi_{{\gamma}}\rangle=\gamma(|00\rangle+|11\rangle)+\sqrt{1-2\gamma^{2}}|22\rangle,$
(18)

$\gamma\in[0.6,\sqrt{2}/2]$ and $p$ is chosen such that the coherent
information of $\rho_{{p,\gamma}}$ is positive. Again, for any test state in
the $\rho_{{p,\gamma}}$ class, we measure it with obsevables $A_{a}$ and
$B_{b}$ given by Eqs.(8) and (9) to generate the features for the neural
network. Meanwhile, the violation of this test state to the CGLMP inequality
is also computed, which as usual is used to measure quantum nonlocality. Then,
after running the neural network on these test samples, we have the chance to
examine whether the performance of prediction has anything to do with quantum
nonlocality.

Figure 5: The relations between coherent information, nonlocality, and squared
error. Each blue dot represents a fixed parameter pair $(p,\gamma)$ for
$\rho_{{p,\gamma}}$. (a) The relation between squared error and coherent
information, where the PCC is 0.0010. (b) The relation between squared error
and violation, where the PCC is -0.6041.

The results are listed in Fig.5. Here every pair of $(p,\gamma)$, which
corresponds to a test quantum state, is represented by a blue dot. Along the
$x$-axis, in Fig.5(a) we record the coherent information, and in Fig.5(b) we
record the violation. It can be seen clearly that when a test state has
stronger quantum nonlocality, the neural network tends to predict its coherent
information more accurately.

To further analyze the statistical connections between nonlocality, coherent
information, and squared error, we utilize the Pearson correlation coefficient
(PCC) to analyze the data, which is a measure of linear correlation between
the paired data $\\{(x_{1},y_{1}),...,(x_{n},y_{n})\\}$ defined as

$\displaystyle
r_{xy}=\frac{\sum_{i=1}^{n}(x_{i}-\bar{x})(y_{i}-\bar{y})}{\sqrt{\sum_{i=1}^{n}(x_{i}-\bar{x})^{2}}\sqrt{\sum_{i=1}^{n}(y_{i}-\bar{y})^{2}}},$
(19)

where $\bar{x}=\frac{1}{n}\sum_{i=1}^{n}x_{i}$ and analogously for $\bar{y}$.
We find that the PCC between squared error and coherent information is 0.0010,
implying that almost no linear correlation exists between them. As a sharp
difference, the PCC between squared error and violation is -0.6041, confirming
that a strong correlation exists between them.

We stress again that when training the neural networks, we do not provide any
knowledge of quantum nonlocality. However, the above evidences show that in
our neural networks, stronger nonlocality in test samples tends to result in
better prediction quality, which is quite surprising.

##  VI Discussions

In this paper, we have showed strong evidences implying that neural networks
can be used to quantify unknown quantum entanglement after being properly
trained, where the performance is very decent, and can be much better than
that of some previous approaches like semi-device-independent protocols.

It should be pointed out that, when training neural networks, we only need to
measure sample quantum states locally and then collect the outcome statistics
data as the corresponding features, which is actually quite experiment-
friendly, as we do not have to take care of the experimental loophole issues
like in Bell experiments studying quantum nonlocality [43, 44, 45].
Furthermore, to obtain the data needed by neural networks with sufficient
precision, the required number of measurements is reasonable. Therefore, with
the rise of quantum engineering in recent years, it is very realistic to
consider applying neural networks widely in quantum engineering problems where
a rough quantification of underlying entanglement is helpful. Because of this,
it will be interesting to improve the performance of current neural networks
further, and try to utilize neural networks to quantify more measures of
quantum entanglement.

###### Acknowledgements.

This work was supported by the National Key R&D Program of China, Grant No.
2018YFA0306703, the National Natural Science Foundation of China, Grant No.
20181311604, and the start-up funds of Tsinghua University, Grant No.
53330100118. This work was also supported in part by the Zhongguancun Haihua
Institute for Frontier Information Technology.

## References

  * Chuang and Nielsen [1997] I. L. Chuang and M. A. Nielsen, Prescription for experimental determination of the dynamics of a quantum black box, Journal of Modern Optics 44, 2455 (1997).
  * Poyatos  _et al._ [1997] J. Poyatos, J. I. Cirac, and P. Zoller, Complete characterization of a quantum process: the two-bit quantum gate, Physical Review Letters 78, 390 (1997).
  * Gühne and Tóth [2009] O. Gühne and G. Tóth, Entanglement detection, Physics Reports 474, 1 (2009).
  * Rosset  _et al._ [2012] D. Rosset, R. Ferretti-Schöbitz, J.-D. Bancal, N. Gisin, and Y.-C. Liang, Imperfect measurement settings: Implications for quantum state tomography and entanglement witnesses, Physical Review A 86, 062325 (2012).
  * Collins  _et al._ [2002a] D. Collins, N. Gisin, S. Popescu, D. Roberts, and V. Scarani, Bell-type inequalities to detect true n-body nonseparability, Physical Review Letters 88, 170405 (2002a).
  * Bancal  _et al._ [2011] J.-D. Bancal, N. Gisin, Y.-C. Liang, and S. Pironio, Device-independent witnesses of genuine multipartite entanglement, Physical Review Letters 106, 250404 (2011).
  * Pál and Vértesi [2011] K. F. Pál and T. Vértesi, Multisetting bell-type inequalities for detecting genuine multipartite entanglement, Physical Review A 83, 062123 (2011).
  * Murta  _et al._ [2016] G. Murta, R. Ramanathan, N. Móller, and M. T. Cunha, Quantum bounds on multiplayer linear games and device-independent witness of genuine tripartite entanglement, Physical Review A 93, 022305 (2016).
  * Baccari  _et al._ [2017] F. Baccari, D. Cavalcanti, P. Wittek, and A. Acín, Efficient device-independent entanglement detection for multipartite systems, Physical Review X 7, 021042 (2017).
  * Tavakoli  _et al._ [2018] A. Tavakoli, A. A. Abbott, M.-O. Renou, N. Gisin, and N. Brunner, Semi-device-independent characterization of multipartite entanglement of states and measurements, Physical Review A 98, 052333 (2018).
  * Zwerger  _et al._ [2019] M. Zwerger, W. Dür, J.-D. Bancal, and P. Sekatski, Device-independent detection of genuine multipartite entanglement for all pure states, Physical Review Letters 122, 060502 (2019).
  * Horodecki  _et al._ [2009] R. Horodecki, P. Horodecki, M. Horodecki, and K. Horodecki, Quantum entanglement, Reviews of modern physics 81, 865 (2009).
  * Życzkowski  _et al._ [1998] K. Życzkowski, P. Horodecki, A. Sanpera, and M. Lewenstein, Volume of the set of separable states, Physical Review A 58, 883 (1998).
  * Eisert and Plenio [1999] J. Eisert and M. B. Plenio, A comparison of entanglement measures, Journal of Modern Optics 46, 145 (1999).
  * Daley  _et al._ [2012] A. Daley, H. Pichler, J. Schachenmayer, and P. Zoller, Measuring entanglement growth in quench dynamics of bosons in an optical lattice, Physical Review Letters 109, 020505 (2012).
  * Abanin and Demler [2012] D. A. Abanin and E. Demler, Measuring entanglement entropy of a generic many-body system with a quantum switch, Physical Review Letters 109, 020504 (2012).
  * Brydges  _et al._ [2019] T. Brydges, A. Elben, P. Jurcevic, B. Vermersch, C. Maier, B. P. Lanyon, P. Zoller, R. Blatt, and C. F. Roos, Probing rényi entanglement entropy via randomized measurements, Science 364, 260 (2019).
  * Zhou  _et al._ [2020] Y. Zhou, P. Zeng, and Z. Liu, Single-copies estimation of entanglement negativity, Physical Review Letters 125, 200502 (2020).
  * Gray  _et al._ [2018] J. Gray, L. Banchi, A. Bayat, and S. Bose, Machine-learning-assisted many-body entanglement measurement, Physical Review Letters 121, 150503 (2018).
  * Berkovits [2018] R. Berkovits, Extracting many-particle entanglement entropy from observables using supervised machine learning, Physical Review B 98, 241411 (2018).
  * Shahandeh  _et al._ [2017] F. Shahandeh, M. J. Hall, and T. C. Ralph, Measurement-device-independent approach to entanglement measures, Physical Review Letters 118, 150505 (2017).
  * Rosset  _et al._ [2018] D. Rosset, A. Martin, E. Verbanis, C. C. W. Lim, and R. Thew, Practical measurement-device-independent entanglement quantification, Physical Review A 98, 052332 (2018).
  * Guo  _et al._ [2020] Y. Guo, B.-C. Yu, X.-M. Hu, B.-H. Liu, Y.-C. Wu, Y.-F. Huang, C.-F. Li, and G.-C. Guo, Measurement-device-independent quantification of irreducible high-dimensional entanglement, npj Quantum Information 6, 1 (2020).
  * Moroder  _et al._ [2013] T. Moroder, J.-D. Bancal, Y.-C. Liang, M. Hofmann, and O. Gühne, Device-independent entanglement quantification and related applications, Physical Review Letters 111, 030501 (2013).
  * Bardyn  _et al._ [2009] C.-E. Bardyn, T. C. Liew, S. Massar, M. McKague, and V. Scarani, Device-independent state estimation based on bell’s inequalities, Physical Review A 80, 062327 (2009).
  * Kaniewski [2016] J. Kaniewski, Analytic and nearly optimal self-testing bounds for the clauser-horne-shimony-holt and mermin inequalities, Physical Review Letters 117, 070402 (2016).
  * Wei and Lin [2021] Z. Wei and L. Lin, Analytic semi-device-independent entanglement quantification for bipartite quantum states, Physical Review A 103, 032215 (2021).
  * Cornelio  _et al._ [2011] M. F. Cornelio, M. C. de Oliveira, and F. F. Fanchini, Entanglement irreversibility from quantum discord and quantum deficit, Physical Review Letters 107, 020502 (2011).
  * Lin and Wei [2020] L. Lin and Z. Wei, Quantifying multipartite quantum entanglement by nondegenerate bell inequalities, arXiv preprint arXiv:2008.12064 (2020).
  * Schumacher and Nielsen [1996] B. Schumacher and M. A. Nielsen, Quantum data processing and error correction, Physical Review A 54, 2629 (1996).
  * Lloyd [1997] S. Lloyd, Capacity of the noisy quantum channel, Physical Review A 55, 1613 (1997).
  * Shimony [1995] A. Shimony, Degree of entanglement a, Annals of the New York Academy of Sciences 755, 675 (1995).
  * Barnum and Linden [2001] H. Barnum and N. Linden, Monotones and invariants for multi-particle quantum states, Journal of Physics A: Mathematical and General 34, 6787 (2001).
  * Collins  _et al._ [2002b] D. Collins, N. Gisin, N. Linden, S. Massar, and S. Popescu, Bell inequalities for arbitrarily high-dimensional systems, Physical Review Letters 88, 040404 (2002b).
  * Acin  _et al._ [2002] A. Acin, T. Durt, N. Gisin, and J. I. Latorre, Quantum nonlocality in two three-level systems, Physical Review A 65, 052325 (2002).
  * Chen  _et al._ [2006] J.-L. Chen, C. Wu, L. C. Kwek, C. H. Oh, and M.-L. Ge, Violating bell inequalities maximally for two d-dimensional systems, Physical Review A 74, 032106 (2006).
  * Zohren and Gill [2008] S. Zohren and R. D. Gill, Maximal violation of the collins-gisin-linden-massar-popescu inequality for infinite dimensional states, Physical Review Letters 100, 120406 (2008).
  * Barrett  _et al._ [2006] J. Barrett, A. Kent, and S. Pironio, Maximally nonlocal and monogamous quantum correlations, Physical Review Letters 97, 170409 (2006).
  * LeCun  _et al._ [1998] Y. LeCun, L. Bottou, Y. Bengio, and P. Haffner, Gradient-based learning applied to document recognition, Proceedings of the IEEE 86, 2278 (1998).
  * Albawi  _et al._ [2017] S. Albawi, T. A. Mohammed, and S. Al-Zawi, Understanding of a convolutional neural network, in  _2017 International Conference on Engineering and Technology (ICET)_ (Ieee, 2017) pp. 1–6.
  * Dür  _et al._ [2000] W. Dür, G. Vidal, and J. I. Cirac, Three qubits can be entangled in two inequivalent ways, Physical Review A 62, 062314 (2000).
  * Greenberger  _et al._ [1989] D. M. Greenberger, M. A. Horne, and A. Zeilinger, Going beyond bell’s theorem, in  _Bell’s theorem, quantum theory and conceptions of the universe_ (Springer, 1989) pp. 69–72.
  * Hensen  _et al._ [2015] B. Hensen, H. Bernien, A. E. Dréau, A. Reiserer, N. Kalb, M. S. Blok, J. Ruitenberg, R. F. Vermeulen, R. N. Schouten, C. Abellán, _et al._ , Loophole-free bell inequality violation using electron spins separated by 1.3 kilometres, Nature 526, 682 (2015).
  * Giustina  _et al._ [2015] M. Giustina, M. A. Versteegh, S. Wengerowsky, J. Handsteiner, A. Hochrainer, K. Phelan, F. Steinlechner, J. Kofler, J.-Å. Larsson, C. Abellán, _et al._ , Significant-loophole-free test of bell’s theorem with entangled photons, Physical Review Letters 115, 250401 (2015).
  * Shalm  _et al._ [2015] L. K. Shalm, E. Meyer-Scott, B. G. Christensen, P. Bierhorst, M. A. Wayne, M. J. Stevens, T. Gerrits, S. Glancy, D. R. Hamel, M. S. Allman, _et al._ , Strong loophole-free test of local realism, Physical Review Letters 115, 250402 (2015).