Year: 2018

Abstract:
Quantum mechanics fundamentally forbids deterministic discrimination of quantum states and processes. However, the ability to optimally distinguish various classes of quantum data is an important primitive in quantum information science. In this work, we trained near-term quantum circuits to classify data represented by quantum states using the Adam stochastic optimization algorithm. This is achieved by iterative interactions of a classical device with a quantum processor to discover the parameters of an unknown non-unitary quantum circuit. This circuit learns to simulate the unknown structure of a generalized quantum measurement, or positive-operator valued measure (POVM), that is required to optimally distinguish possible distributions of quantum inputs. Notably we used universal circuit topologies, with a theoretically motivated circuit design which guaranteed that our circuits can perform arbitrary input-output mappings. Our numerical simulations showed that quantum circuits could be trained to discriminate among various pure and mixed quantum states, exhibiting a trade-off between minimizing erroneous and inconclusive outcomes with comparable performance to theoretically optimal POVMs. We trained the circuit on different classes of quantum data and evaluated the generalization error on unseen quantum data. This generalization power hence distinguishes our work from standard circuit optimization and provides an example of quantum machine learning for a task that has inherently no classical analogue.

text: Quantum mechanics fundamentally forbids deterministic discrimination of quantum states and processes. However, the ability to optimally distinguish various classes of quantum data is an important primitive in quantum information science. In this work, we trained near-term quantum circuits to classify data represented by quantum states using the Adam stochastic optimization algorithm. This is achieved by iterative interactions of a classical device with a quantum processor to discover the parameters of an unknown non-unitary quantum circuit. This circuit learns to simulate the unknown structure of a generalized quantum measurement, or positive-operator valued measure (POVM), that is required to optimally distinguish possible distributions of quantum inputs. Notably we used universal circuit topologies, with a theoretically motivated circuit design which guaranteed that our circuits can perform arbitrary input-output mappings. Our numerical simulations showed that quantum circuits could be trained to discriminate among various pure and mixed quantum states, exhibiting a trade-off between minimizing erroneous and inconclusive outcomes with comparable performance to theoretically optimal POVMs. We trained the circuit on different classes of quantum data and evaluated the generalization error on unseen quantum data. This generalization power hence distinguishes our work from standard circuit optimization and provides an example of quantum machine learning for a task that has inherently no classical analogue.

heading: 1 INTRODUCTION
text: Quantum computation are known to provide speedups in several applications over classical computation. Besides the famous Shor’s algorithm for prime number factorization, quantum computers can also produce statistical patterns that are hard for a classical computer to produce. This raises the possibility that quantum computers can also recognize patterns that are hard to recognize for classical computers, or, in general, that quantum computers can help solve classical machine learning problems more efficiently. Recently, this joint field of quantum computation and machine learning has received a considerable amount of attention. Using the circuit model of computation, several quantum algorithms have been designed that provide quadratic to exponential speedups on classical data (Biamonte et al. (2017); Ciliberto et al. (2018)).
A related and interesting area is to develop novel machine learning methods on quantum data. In general, any collection of quantum states which carry certain meaningful information can be considered as quantum data. To motivate this direction, we want to emphasize that using quantum states as a storage medium for information processing have shown to provide advantages in several aspects. Researches have shown that by coupling a quantum state with another target system, one could obtain information about the target system through this quantum state but with a better sensitivity. For example, quantum meteorology allows for a quadratic improvement over classical methods in terms of the scaling of statistical errors, i.e. the scaling of the standard deviations in estimated values in repeated measurements. Another example is quantum sensing, which provide much higher sensitivity in tasks like target detections in microwaves, i.e. quantum radar (Barzanjeh et al. (2015)), and in general, sensing electric or magnetic fields (Degen et al. (2017)). Further, it is proposed that by storing certain information of a picture on a quantum state, pattern recognition can be achieved with
much fewer damage done to this picture if it is very sensitive to the exposure of light (Schaller & Schützhold (2006)).
Certain types of quantum data are special in that they are inherently quantum mechanical. They could be produced from materials fabricated in certain exotic quantum state or could be the result of quantum information processing procedures. Here we could conjecture the inherent advantage of using quantum computers to recognize and classify these natural quantum data. For example, topological materials made in the exotic topological phase have non-classical electronic properties and are promising materials to build fault-tolerant quantum computers (Qi & Zhang (2011); Karzig et al. (2017)). However, predicting the phase of topological materials has been a very challenging problem, but recently it was shown that quantum neural networks could be used to recognize the phase of a quantum state (Cong et al. (2018)). In addition, the promised security of quantum communication protocols and a surge of ideas in quantum communication networks (Kimble (2008); Ren et al. (2017)) further stimulates the research into the topic of quantum data.
In this work, we explored the general problem of classifying quantum data. This problem could be considered as an extension of the well-researched field quantum state discrimination, which identifies a quantum state among a set of possible candidates of which one has complete knowledge a priori. Quantum state discrimination already found applications in many fields such as quantum key distribution (Bennett (1992a)) and cryptography (Barnett & Croke (2009); Bergou (2007)). A key challenge for the discrimination of quantum states is that a deterministic discrimination is impossible when the complex vectors representing the candidate states are not orthogonal, i.e. when their overlaps are non-zero. Therefore, the central task of quantum state discrimination is to find the optimal discriminative measurement that one should perform for those states.
However, it is not possible to directly apply quantum state discrimination to classify the quantum data. Firstly, it is inappropriate to assume that one possesses the complete knowledge of the data a priori, which are often only samples generated from the data collection process. Also, even with all the quantum data available, obtaining the complete knowledge of them (i.e. the density matrices describing them) are very expensive. In addition, quantum state discrimination often fails to give the optimal discriminative measurement in an analytically closed form, unless the quantum states are already orthogonal or possess certain symmetry properties (Barnett & Croke (2009)). In cases it fails, one may use numerical optimization algorithms to find the optimal measurement. However, the exponential increase of the dimension of the density matrices renders the numerical optimization inefficient.
Due to the limitations of quantum state discrimination, it is then a natural question whether we can use a quantum computer to help with the optimization procedure. Here we utilize a hybrid quantumclassical approach to directly learn the design of a shallow quantum circuit for the classification of quantum data. In this hybrid scheme, a classical computer is used to interactively change a quantum circuit and optimize the output of the quantum computer. Recently a string of works focusing on this hybrid scheme for training quantum circuits for a wide range of tasks have been proposed (Banchi et al. (2016); Wan et al. (2017); Innocenti et al. (2018); Romero et al. (2017); Mitarai et al. (2018); Farhi & Neven (2018); Verdon et al. (2017); Li & Benjamin (2017); Grant et al. (2018); Schuld et al. (2018)), with major players in quantum computing hardware releasing software toolkits for hybrid quantum-classical models. This makes the hybrid scheme a promising area in quantum computation.
Our approach described here is novel in two perspectives. First, we used a quantum circuit ansatz that is motivated for implementation on near-term devices. This ansatz is shallow in depths but possess the full power of quantum computation, i.e. it can perform any unitary transformation allowed in quantum mechanics. It comprises gates from a universal gate set consisting of C-NOT and single-qubit gates, motivated by the fact that their implementations are known for the currently most used experimental architectures. It is nearly optimal in terms of the number of C-NOT gates it has, which is also an important feature for an implementation on near-term devices. Second, unlike previous works on quantum state discrimination, we focused on the generalization ability of our circuit, i.e., we trained the circuit on a specific range of the parameters with the goal of maximizing its generalization performance, hence considering a learning framework. This distinguishes our work from the pure optimization problem for the state discrimination task, which is optimizing the circuit to distinguish only a concrete set of states. We showed that this universal quantum circuit can be trained as a discriminator for classification of non-orthogonal quantum data sampled from
various different probability distributions. Our discriminator can achieve a near-zero error rate by producing inconclusive signals.

heading: 2 DATASET AND OUR APPROACH
text: In this work, we propose a novel approach to train a universal quantum circuit to classify quantum data, which are stored in qubits. In this section, we first explain the mathematical descriptions of quantum states, operations and measurements on these states. We then specify the quantum data we used in this work for classification. Next, we outline the approach we took to optimize a universal quantum circuit which was used to classify the quantum data. We defer the detailed decomposition of this quantum circuit in Appendix A.
Mathematical descriptions Quantum states are described by density matrices, which are Hermitian, positive semi-definite complex matrices of unit trace, and commonly denoted by the symbol ρ. For the quantum states which stores certain useful information, we may assume that they could be parameterized by certain parameters which follow certain probability distributions specific to the information they carried. For classification, we are normally presented with an unknown quantum state, belonging to families of quantum states, each described mathematically by:
ρi(ai), ai ∼ αi, (2.1)
where i is the label for different families, ρi(ai) is the density matrix describing a quantum datum in the family i, parametrized by ai. The parameters ai are assumed to follow the probability distribution αi. When training a quantum circuit for classification, ai are samples drawn according to the distribution αi.
Transformations on quantum states are described by a complex unitary matrix U , which transforms a quantum state ρ according to the rule:
ρ→ UρU†. (2.2)
A measurement on the quantum state ρ is described by a set of matrices {Mj}, which are Hermitian, positive semi-definite and sum to the identity matrix, i.e. ∑ j Mj = 1. Here j labels the possible measurement outcomes, and the probability pj that this particular measurement outcome is detected is,
pj = Tr(Mjρ), (2.3)
where Tr is the trace operator. Such a collection of matrices Mj is commonly called a positiveoperator valued measure (POVM). A common example of POVM is a projection-valued measure (PVM). In the case of a PVM, each Mj is a projector into some linear subspace and different Mj are orthogonal to each other, i.e. MjMi = δijMj . Any POVM could be realized by a quantum circuit, which consists of a series of unitary matrices (transformations) and measurements in the computational basis. Conversely, a quantum circuit which is parameterized by some parameters and has measurements could also represent many different POVMs. There exists a quantum circuit which could represent any POVM with a fixed number of possible measurement outcomes. Such a circuit is called a universal discriminator in this paper, and a specific one which we used is discussed in Appendix A.
Our Dataset For this work, we restricted our attention to the classification of two families of quantum states stored in 2 qubits. Our first family consists of pure states, parametrized by a real number a ∈ [0, 1]:
ψ1(a) = (√ 1− a2, 0, a, 0 ) , ρ1 = |ψ1(a)〉〈ψ1(a)| . (2.4)
The second family consists of mixed states ρ2(b) where b ∈ [0, 1]. Specifically,
ψ2/3 = ( 0,± √ 1− b2, b, 0 ) , ρ2 = 1
2 |ψ2〉〈ψ2|+
1 2 |ψ3〉〈ψ3| . (2.5)
The overlap between ψ1 and ψ2/3 is ab, and hence our data in two families are non-orthogonal. In the case when a is a fixed value, and b = 1√
2 , the maximal success rate for unambiguously
discriminating between ρ1 and ρ2 has been theoretically studied, and an experimental demonstration is available (Mohseni et al. (2004)). The specific distribution we have tested in our experiments are summarized in Table 1. To generate the data for the training, validation, and testing of our circuits, we randomly sampled points from the corresponding distributions.
Approach. Overall, there are two major strategies to cope with our inherent inability to perform deterministic discrimination of quantum states: (a) Minimum-error discrimination: In this strategy, the task is to minimize the probability that the inevitable errors occur in the classification. (b) Unambiguous discrimination: In this strategy, the discriminator has one more output prediction than the number of classes it tries to classify: an inconclusive outcome. The task is to eliminate the error rate of the discriminator while minimizing the probability of this inevitable inconclusive outcome. A pure unambiguous discrimination with strictly zero error rate is not guaranteed to be possible for arbitrary quantum data. From the perspective of numerical optimization, one needs to allow for some small but non-zero errors to happen.
In this work, we used the machine learning approach to train a universal quantum circuit capable of giving any quantum measurements with four possible measurement outcomes mi2i1 , where i1, i2 ∈ {0, 1} are the measurement outcomes of the first and the second qubit respectively. The parameterization of this circuit is discussed in Appendix A. By assuming that input ρ1(a) produces the outputm00 orm10, input ρ2 produces the outputm01, and assuming thatm11 is the inconclusive output, this circuit acts as a discriminator. Therefore, we could trivially define various probabilities (success probability Psuc, error probability Perr, and inconclusive probability Pinc) with respect to an input training data with known class label. For example, when ρ1 is the input, the probability of detectingm01 is the Perr, the probability of detectingm11 is the Pinc. In this work, we performed experiments on simulated quantum computers, where these probabilities were available. We note that on real quantum computers, these probabilities can be estimated through repeated measurements on replicated data, up to some precision.
To train the circuit, we used a heuristically motivated loss function defined in Eq. 2.6, which is the averaged absolute difference between the desired probabilities and the measured probabilities. It contains hyperparameters αerr and αinc to balance between the erroneous outcomes and the inconclusive outcomes:
J = ∑ i 1 |Si| ∑ ai∈Si |Psuc(ρi(ai))− 1|
+ αerr ∑ i 1 |Si| ∑ ai∈Si |Perr(ρi(ai))− 0|
+ αinc ∑ i 1 |Si| ∑ ai∈Si |Pinc(ρi(ai))− 0| . (2.6)
Here we assumed that for each family of quantum states, we had been supplied with a set Si of training samples, where each class was labeled by i. Then |Si| denotes the number of samples in the training sets Si, αerr is the penalty for making errors, and αinc is the penalty for giving inconclusive outcomes. Psuc(ψ)/Perr(ψ)/Pinc(ψ) are the probabilities of giving a correct/erroneous/inconclusive measurement outcome for the specific input quantum data ρi. This loss function measures the performance of our quantum circuit as a minimal-error discriminator (when αerr < αinc) or as an unambiguous discriminator (when αerr > αinc).
To train this circuit, we used the Adam optimization algorithm (Kingma & Ba (2014)), and the gradients were calculated by the forward difference formula.
For our specific problem of classifying ρ1 and ρ2 as defined in Eq. 2.4 and Eq. 2.5, we defined an extra set of success/erroneous/inconclusive rates in Eq. 2.7 to summarize and compare the performance of different trainings:
Ps = 1
3 Ps(ρ1)avg +
2 3 Ps(ρ2)avg
= 1
3 Ps(ψ1)avg +
1 3 Ps(ψ2)avg + 1 3 Ps(ψ3)avg (2.7)
where s stands for suc (successful), err (erroneous) or inc (inconclusive). The subscript avg means that the probabilities are calculated as the value averaged in all samples available in either the training set, or the test set (but not both). The choice of weights ( 13and 2 3 ) in the Eq. 2.7 was made to be consistent with the paper Mohseni et al. (2004).

heading: 3 THEORETICAL ANALYSIS
text: Here we describe a theoretical result to which we will compare our numerical results. First, we mention a general result. Assume we have a family of quantum data ρ(a), each one is parameterized by a and occur with a probability P (a). Assume in addition that we have a quantum measurement described by a POVM with elements {Πi}i∈N, where i labels different measurement outcomes. Then, the probability of detecting measurement outcome i, averaged over any possible quantum data ρ(a), is,
∫ Tr(Πiρ(a))P (a)da = Tr [∫ Πiρ(a)P (a)da ] = Tr [ Πi ∫ ρ(a)P (a)da ] = Tr[Πiρ], (3.1)
where ρ ≡ ∫ ρ(a)P (a)da, and the integration of the matrix is done in an element-wise fashion.
Therefore, if Tr(Πiρ) = 0 for some i, then ∫ D
Tr(Πiρ(a))P (a) = 0 for any subset D with nonzero measure in the whole parameter space of a. This is due to the fact that Tr[Πiρ(a)]P (a) ≥ 0 for any parameter a.
Applied to the problem of unambiguous discrimination, it is obvious that the problem of unambiguously discriminating ρ1 = ∫ a ρ1(a)P1(a)da and ρ2 = ∫ a ρ2(a)P2(a)db, is equivalent to the problem of unambiguously discriminating the family ρ1(a),∀a, from the family ρ2(b),∀b, where P1(a)/P2(b) is the probability of occurrence of ρ1(a)/ρ2(b). That is, if {Π1,Π2,Π?} is a POVM that unambiguously classifies all members of the two families ρ1(a) and ρ2(b), for all possible parameters, i.e. Π? corresponds to the inconclusive outcome with,
Tr(Π2ρ1(a)) = 0, ∀a, Tr(Π1ρ2(b)) = 0, ∀b,
then Tr(Π1ρ2) = Tr(Π2ρ1) = 0, and vice versa. Using this formalism, we theoretically analyzed the different cases we described in Table 1 based on the works of Raynal et al. (2003) and Barnett & Croke (2009), and the results are displayed in Table 2. Note that these are average case success probabilities.

heading: 4 NUMERICAL RESULTS ON SIMULATED QUANTUM COMPUTERS
text: In this work, we aim to train a universal discriminator to discriminate different families of quantum data. Here, we presented the results of training the universal discriminator to discriminate different distributions summarized in Table 1 on a simulated quantum computer. To balance between eliminating the error rate (Perr) while minimizing the inconclusive rate (Pinc), we used a specific training strategy described in the following. We first prioritized a smaller inconclusive rate by starting with a zero penalty for erroneous outcomes (αinc > αerr = 0), and then increased the αerr in a stepwise manner until a certain objective error rate is achieved. Similar optimization procedures have been used in the context of variational auto-encoders both in classical machine learning (Sønderby et al. (2016)), and in quantum machine learning applications (Rocchetto et al. (2017)). Using this scheme, we trained our circuit to unambiguously discriminate the two families of quantum states and observed a convergence towards the theoretical success rates obtained in Section 3 with increasing amount of data used to train the discriminator . Notably, we did not observe any signs of overfitting despite the varying size of the training dataset (Figure 1 a).

heading: 4.1 TRADE-OFF BETWEEN THE ERROR RATE AND THE INCONCLUSIVE RATE
text: In another test, we showed that our model is able to obtain a much higher success rate (Psuc) if we allow a slightly higher error rate compared with previous results during the trainings. This hints at a trade-off between the error rate (Perr) and the inconclusive rate (Pinc) which can be utilized in real-world applications.
Specifically, for the dataset “Case 4” in Table 1 we fixed the two penalties, αerr and αinc, during the training and observed a gradual transition from unambiguous-like classification (characterized by a near-zero error probability) to minimal-error-like classification (characterized by the near-zero inconclusiveness) when we used varying penalties (Figure 2 a-c) throughout the different trainings. Allowing a small error rate resulted in a much higher success rate, which has not been predicted theoretically. We note that introducing the penalty terms αerr and αinc made the training process also more stable (Figure 2 a). Therefore, the hyperparameters αerr and αinc acted as a form of regularization and could be adjusted to give a higher success probability or a lower inconclusiveness rate for the final model (Figure 2).
For all the datasets in Table 1, we achieved a much higher success rate than the theoretical case of an exactly zero error rate, with the required error rate tolerance smaller than 0.01 (Figure 3).

heading: 5 LEARNING CONVERGENCE FROM ENSEMBLE MEASUREMENTS
text: Although we trained our circuit using probabilities which are not available on an actual quantum device, we can estimate these probabilities from repeated measurements on this quantum device. We found that when using probabilities estimated from repeated measurements of quantum states, the training process still converged in all cases. In practice, the noise introduced by the inferred probabilities could be effectively countered by increasing the number of repeated measurements, using a lowered error rate, and adjusting the step size for gradient calculation using the forward difference formula. Overall, a combination of a step size of 0.01, 105 repeated measurements, and a learning rate of 10−3 well approximated the result obtained using exact probabilities. Therefore, our study here is feasible for actual quantum devices. We leave open the actual implementation as future projects. Further discussions are deferred in Appendix B.

heading: 6 CONCLUSIONS
text: We have developed a universal quantum circuit learning approach for the classification of quantum data. In particular, we have designed a theoretically motivated loss function and used the stochastic optimization algorithm Adam in a quantum-classical hybrid scheme to train a circuit to perform quantum state discrimination. This training process generalized well for the discrimination task on new data, i.e., states from the parameter range which have not been seen during the training process. This in particular distinguishes our work from previous results on quantum circuit learning, in particular the very recent study in Fanizza et al. (2018), which only optimizes circuits for specific inputs. Note that this prior work hence does not consider the generalization ability and hence does not treat the actual learning problem, which aims at optimization as well as generalization.
In our work, we observed a trade-off between the error rates and the inconclusive rates when we penalized them differently in the loss function. Although this experiment was done on simulated quantum computers where exact measurement probabilities are available, we showed that this optimization could be experimentally performed with repeated measurements of the quantum states. Finally, we note that the recent quantum methods for estimating the analytical gradient via variations in the unitaries (Mitarai et al. (2018)) can be directly applied to training our circuits and therefore one can perform the optimization efficiently on near-term quantum devices.
With the progress on technologies for preservation and transportation of quantum states, we can expect many applications of a trained discriminative quantum circuits introduced here. Quantum state discrimination by itself plays a key role in quantum information processing protocols and is used in quantum cryptography (Bennett (1992b)), quantum cloning (Duan & Guo (1998)), quantum state separation, and entanglement concentration (Chefles (2000)). Our work can provide improvements on these traditional areas by producing a classifier that is resilient to the statistical noise found in the actual communication. For example, we can consider an improved version of the B92 quantum key distribution protocol (Bennett (1992a)) by including the noise-induced randomness in its two quantum keys and classify them with our discriminative circuit. Furthermore, we can consider training a discriminative quantum circuit used to construct quantum repeaters and state purification units within quantum communication networks. The training can take quantum data that have noise specific to the communication networks and therefore produces a discriminator that can recognize and filter those noise to provide better performance. Our discriminator can also be used to verify the output of other generative models, such as the quantum version of Boltzmann machines (Amin et al. (2018)), or generative artificial neural networks (Goodfellow et al. (2014); Lloyd & Weedbrook (2018)).

heading: A QUANTUM CIRCUITS FOR POVM
text: This section describes the parametrization of the circuit capable of performing any quantum measurement on 2 qubit inputs with 4 possible measurement outcomes. This circuit could be represented by the following circuit diagram:
|0〉 /2 V
M |ψ〉 /2 (A.1)
A.1 COSINE-SINE DECOMPOSITION
Here we mention the cosine-sine decomposition of unitary matrices, which will be frequently used in the following sections. For every unitary matrix U ∈ C2n×2n , it can be decomposed as:
Un = ( A0 0 0 A1 )( C −S S C )( B0 0 0 B1 ) (A.2)
where A0, A1, B0, B1 are unitary matrices of size 2n−1 × 2n−1, C and S are real diagonal matrices of size 2n−1 × 2n−1 satisfying C2 + S2 = 1. It can be written in the following circuit equivalence diagram:
Un Ry n−1 \ = \ Un−1 Un−1 (A.3)
Here a box represents the control part of a uniformly controlled gate, see section IV of Iten et al. (2015) for details. In the circuit in Fig. A.1, the first qubit is initiated to be |0〉, so we have:
|0〉 Un
Ry n−1 \ = Un−1 Un−1 (A.4)
A.2 DECOMPOSITION OF CIRCUIT IN FIG. A.1
For a general measurement giving at most 4 measurement outcomes, we have the following circuit representation:
|0〉
V
M1
|0〉 M2 |φ〉 |ψ〉
(A.5)
The first V could be decomposed using the circuit equivalence on page 5 of Iten et al. (2016) into:
|0〉
R
M1
|0〉
V ′
M2
|φ〉 |ψ〉
where the R gate does not act on the second qubit. Applying the cosine-sine decomposition gives:
|0〉 Ry M1
|0〉
V ′
M2
|φ〉 U U |ψ〉
The uniformly controlled V ′ and U can be merged and put after the measurement of M1 as:
|0〉 Ry M1
|0〉
V ′′
M2
|φ〉 U |ψ〉
The first line of the circuit could be merged with the second line as follows:
•
|0〉 Ry M1
V ′′
M2
|φ〉 U |ψ〉
(A.6)
And then we can apply the cosine-sine decomposition to V ′′. Throwing away the last gate on the third and the fourth qubits, we obtain:
•
|0〉 Ry M1 Ry M2
|φ〉 U U |ψ〉
(A.7)
The uniformly-controlled rotations and the remaining two-qubit unitary gates could be easily parametrised by CNOTs and single qubit rotations. For example, see Shende et al. (2006) and Shende et al. (2004).

heading: B LEARNING CONVERGENCE FROM ENSEMBLE MEASUREMENTS
text: Here we simulate the process that a classical-quantum hybrid scheme would implement utilizing a quantum device and analyse its performance. These numerical simulations can in principle be validated in a physical experiment, where the measurement outcomes are used to infer the different probabilities for the cost function. To have a good estimation of the probabilities, and hence the cost function, one has to make repeated measurements to train the model, and we note that in particular better methods to evaluate the analytical gradient are available on a shallow quantum device (Mitarai et al. (2018)). We first give a brief discussion of the estimated number of repeated measurements which are required to approximate the gradient. This follows the treatment of Farhi & Neven (2018)[Section 3]. Since the gradients are calculated using the forward difference formula:
df dx (x) = f(x+ ε)− f(x) ε +O(ε) (B.1)
The error in the calculation of f must be at most of the order ofO(ε2), in order to prevent dominating the total error. To achieve this ideally with a 99% probability, one requires the number of repeated measurement to be of the order 1(ε2)2 = 1 ε4 .
1 For example, when ε = 10−3, the ideal number of repetitions is given by 1012.
In practice, we do not use 1ε4 measurements, since the Adam optimization algorithm is designed with the noise of the cost function taken into account. To give an estimate of the number of repeated measurements which are required for the convergence of the optimization process, we performed two numerical experiments. We first looked at the case when the number of repeated measurements
1 This assumes that the cost function follows a normal distribution with variance of the order 1√ N , where N is the number of measurements made in reach run in order to calculate the cost function.
was large (≥ 103) and ε = 10−2. We found that 105 repeated measurements for each iteration were a robust configuration for a successful convergence. Second, we used a small number of repeated measurements but varied the learning rate and increased the maximal number of iterations for Adam. Setting ε = 10−2 and taking only 100 repeated measurements, we observed that the optimizations were successful with a large number of iterations. In both experiments, the penalties were set to αinc = 5 and αerr = 40.
Large number of repetitions. Our results showed that for a fixed maximum number of iterations (5000) for Adam, a combination of ε = 10−2 and 105 repeated measurements gave robust results, i.e., the final cost function was close to the value obtained with the exact probabilities (with an error within 3%) and was stable (with a relative standard deviation of 13%). A more detailed description of the trade-off between repeated measurements and the stability of the cost function is shown in Fig. 4.
Small learning rates and high number of iterations. Our numerical experiments further showed that in the case of using a small number of repeated measurements, lowered learning rates could effectively counter the noisy brought by the insufficient sampling. Although in this case, the optimization required a large number of iterations to finish. For example, with only 100 repeated measurements, the variance of cost function J1 after 20000 iterations decreased as we lowered the learning rate (Fig.5(a)). We could visually observe the optimization process where the cost function J1 slowly approached the optimal value in Fig 5(b). Here, gradient step was taken as ε = 10−2.

Review summaries:
The authors partially integrate a neural network into classical approaches to classify the state of a quantum circuit. The model is not actually clear in what it is doing, but there are some trained weights somewhere. They allow for an "uncertainty" prediction by giving one more node than there are classification targets, corresponding to a less-penalized uncertain prediction. They evaluate their model on numerical simulations.