Patent Publication Number: US-2020279185-A1

Title: Quantum relative entropy training of boltzmann machines

Description:
BACKGROUND 
     A quantum computer is a physical machine configured to execute logical operations based on or influenced by quantum-mechanical phenomena. Such logical operations may include, for example, mathematical computation. Current interest in quantum-computer technology is motivated by theoretical analysis suggesting that the computational efficiency of an appropriately configured quantum computer may surpass that of any practicable non-quantum computer when applied to certain types of problems. Such problems include, for example, integer factorization, data searching, computer modeling of quantum phenomena, function optimization including machine learning, and solution of systems of linear equations. Moreover, it has been predicted that continued miniaturization of conventional computer logic structures will ultimately lead to the development of nanoscale logic components that exhibit quantum effects, and must therefore be addressed according to quantum-computing principles. 
     In the application of quantum computers to neural networks, various challenges persist as to the manner in which a quantum neural network may be trained to a desired task. In classical neural-network training, parametric weights and thresholds are optimized according to the gradient of a cost function evaluated over the domain of neuron states. For quantum neural networks, however, the gradient of the cost function may be difficult to estimate due to operator non-commutivity and other analytical complexities. 
     SUMMARY 
     This disclosure describes, inter alia, methods to train a quantum Boltzmann machine (QBM) having one or more visible nodes and one or more hidden nodes. The methods comprise associating each visible and each hidden node of the QBM to a different corresponding qubit of a plurality of qubits of a quantum computer, wherein a state of each of the plurality of qubits contributes to a global energy of the QBM according to a set of weighting factors, and wherein the plurality of qubits include one or more output qubits corresponding to one or more visible nodes of the QBM. The methods further comprise providing a distribution of training data over the one or more output qubits, estimating a gradient of a quantum relative entropy between the one or more output qubits and the distribution of training data, and training the set of weighting factors based on the estimated gradient, using the quantum relative entropy as a cost function. 
     This Summary is provided to introduce a selection of concepts in a simplified form that are further described below in the Detailed Description. This Summary is not intended to identify key features or essential features of the claimed subject matter, nor is it intended to be used to limit the scope of the claimed subject matter. Furthermore, the claimed subject matter is not limited to implementations that solve any or all disadvantages noted in any part of this disclosure. 
    
    
     
       BRIEF DESCRIPTION OF THE DRAWINGS 
         FIG. 1  shows aspects of an example quantum computer. 
         FIG. 2  illustrates a Bloch sphere, which graphically represents the quantum state of one qubit of a quantum computer. 
         FIG. 3  shows aspects of an example signal waveform for effecting a quantum-gate operation in a quantum computer. 
         FIG. 4A  shows aspects of an example Boltzmann machine. 
         FIG. 4B  shows aspects of an example restricted Boltzmann machine. 
         FIG. 5  illustrates an example method to train a quantum Boltzmann machine having visible and hidden nodes. 
         FIGS. 6A and 6B  illustrate an example method to estimate the gradient of the quantum relative entropy of a restricted quantum Boltzmann machine having visible and hidden nodes. 
         FIG. 7  illustrates an example method to estimate the gradient of the quantum relative entropy of a restricted or non-restricted quantum Boltzmann machine. 
     
    
    
     DETAILED DESCRIPTION 
       FIG. 1  shows aspects of an example quantum computer  10  configured to execute quantum-logic operations (vide infra). Whereas conventional computer memory holds digital data in an array of bits and enacts bit-wise logic operations, a quantum computer holds data in an array of qubits and operates quantum-mechanically on the qubits in order to implement the desired logic. Accordingly, quantum computer  10  of  FIG. 1  includes at least one qubit register  12  comprising an array of qubits  14 . The illustrated qubit register is eight qubits in length; qubit registers comprising longer and shorter qubit arrays are also envisaged, as are quantum computers comprising two or more qubit registers of any length. 
     Qubits  14  of qubit register  12  may take various forms, depending on the desired architecture of quantum computer  10 . Each qubit may comprise: a superconducting Josephson junction, a trapped ion, a trapped atom coupled to a high-finesse cavity, an atom or molecule confined within a fullerene, an ion or neutral dopant atom confined within a host lattice, a quantum dot exhibiting discrete spatial- or spin-electronic states, electron holes in semiconductor junctions entrained via an electrostatic trap, a coupled quantum-wire pair, an atomic nucleus addressable by magnetic resonance, a free electron in helium, a molecular magnet, or a metal-like carbon nanosphere, as non-limiting examples. More generally, each qubit  14  may comprise any particle or system of particles that can exist in two or more discrete quantum states that can be measured and manipulated experimentally. For instance, a qubit may be implemented in the plural processing states corresponding to different modes of light propagation through linear optical elements (e.g., mirrors, beam splitters and phase shifters), as well as in states accumulated within a Bose-Einstein condensate. 
       FIG. 2  is an illustration of a Bloch sphere  16 , which provides a graphical description of some quantum mechanical aspects of an individual qubit  14 . In this description, the north and south poles of the Bloch sphere correspond to the standard basis vectors |0  and |1 , respectively up and down spin states, for example, of an electron or other fermion. The set of points on the surface of the Bloch sphere comprise all possible pure states |ψ  of the qubit, while the interior points correspond to all possible mixed states. A mixed state of a given qubit may result from decoherence, which may occur because of undesirable coupling to external degrees of freedom. 
     Returning now to  FIG. 1 , quantum computer  10  includes a controller  18 . The controller may include at least one processor  20  and associated computer memory  22 . A processor  20  of controller  18  may be coupled operatively to peripheral componentry, such as network componentry, to enable the quantum computer to be operated remotely. A processor  20  of controller  18  may take the form of a central processing unit (CPU), a graphics processing unit (GPU), or the like. As such, the controller may comprise classical electronic componentry. The term ‘classical’ is applied herein to any component that can be modeled accurately as an ensemble of particles without considering the quantum state of any individual particle. Classical electronic components include integrated, microlithographed transistors, resistors, and capacitors, for example. Computer memory  22  may be configured to hold program instructions  24  that cause processor  20  to execute any function or process of the controller. In examples in which qubit register  12  is a low-temperature or cryogenic device, controller  18  may include control componentry operable at low or cryogenic temperatures—e.g., a field-programmable gate array (FPGA) operated at 77K. In such examples, the low-temperature control componentry may be coupled operatively to interface componentry operable at normal temperatures. 
     Controller  18  of quantum computer  10  is configured to receive a plurality of inputs  26  and to provide a plurality of outputs  28 . The inputs and outputs may each comprise digital and/or analog lines. At least some of the inputs and outputs may be data lines through which data is provided to and extracted from the quantum computer. Other inputs may comprise control lines via which the operation of the quantum computer may be adjusted or otherwise controlled. 
     Controller  18  is operatively coupled to qubit register  12  via quantum interface  30 . The quantum interface is configured to exchange data bidirectionally with the controller. The quantum interface is further configured to exchange signal corresponding to the data bidirectionally with the qubit register. Depending on the architecture of quantum computer  10 , such signal may include electrical, magnetic, and/or optical signal. Via signal conveyed through the quantum interface, the controller may interrogate and otherwise influence the quantum state held in the qubit register, as defined by the collective quantum state of the array of qubits  14 . To this end, the quantum interface includes at least one modulator  32  and at least one demodulator  34 , each coupled operatively to one or more qubits of the qubit register. Each modulator is configured to output a signal to the qubit register based on modulation data received from the controller. Each demodulator is configured to sense a signal from the qubit register and to output data to the controller based on the signal. The data received from the demodulator may, in some examples, be an estimate of an observable to the measurement of the quantum state held in the qubit register. 
     In some examples, suitably configured signal from modulator  32  may interact physically with one or more qubits  14  of qubit register  12  to trigger measurement of the quantum state held in one or more qubits. Demodulator  34  may then sense a resulting signal released by the one or more qubits pursuant to the measurement, and may furnish the data corresponding to the resulting signal to the controller. Stated another way, the demodulator may be configured to output, based on the signal received, an estimate of one or more observables reflecting the quantum state of one or more qubits of the qubit register, and to furnish the estimate to controller  18 . In one non-limiting example, the modulator may provide, based on data from the controller, an appropriate voltage pulse or pulse train to an electrode of one or more qubits, to initiate a measurement. In short order, the demodulator may sense photon emission from the one or more qubits and may assert a corresponding digital voltage level on a quantum-interface line into the controller. Generally speaking, any measurement of a quantum-mechanical state is defined by the operator O corresponding to the observable to be measured; the result R of the measurement is guaranteed to be one of the allowed eigenvalues of O. In quantum computer  10 , R is statistically related to the qubit-register state prior to the measurement, but is not uniquely determined by the qubit-register state. 
     Pursuant to appropriate input from controller  18 , quantum interface  30  may be configured to implement one or more quantum-logic gates to operate on the quantum state held in qubit register  12 . Whereas the function of each type of logic gate of a classical computer system is described according to a corresponding truth table, the function of each type of quantum gate is described by a corresponding operator matrix. The operator matrix operates on (i.e., multiplies) the complex vector representing the qubit register state and effects a specified rotation of that vector in Hilbert space. 
     For example, the Hadamard gate H is defined by 
     
       
         
           
             
               
                 
                   H 
                   = 
                   
                     
                       1 
                       
                         2 
                       
                     
                      
                     
                       [ 
                       
                         
                           
                             1 
                           
                           
                             1 
                           
                         
                         
                           
                             1 
                           
                           
                             
                               - 
                               1 
                             
                           
                         
                       
                       ] 
                     
                   
                 
               
               
                 
                   ( 
                   1 
                   ) 
                 
               
             
           
         
       
     
     The H gate acts on a single qubit; it maps the basis state |0  to (|0 +|1 )/√{square root over (2)}, and maps |1  to (|0 −|1 )/√{square root over (2)}. Accordingly, the H gate creates a superposition of states that, when measured, have equal probability of revealing |0  or |1 . 
     The phase gate S is defined by 
     
       
         
           
             
               
                 
                   S 
                   = 
                   
                     
                       [ 
                       
                         
                           
                             1 
                           
                           
                             0 
                           
                         
                         
                           
                             0 
                           
                           
                             
                               e 
                               
                                 i 
                                  
                                 
                                     
                                 
                                  
                                 π 
                                  
                                 
                                   / 
                                 
                                  
                                 2 
                               
                             
                           
                         
                       
                       ] 
                     
                     . 
                   
                 
               
               
                 
                   ( 
                   2 
                   ) 
                 
               
             
           
         
       
     
     The S gate leaves the basis state |0  unchanged but maps |1  to e iπ/2 |1 . Accordingly, the probability of measuring either |0 or |1  is unchanged by this gate, but the phase of the quantum state of the qubit is shifted. This is equivalent to rotating ψ by 90 degrees along a circle of latitude on the Bloch sphere of  FIG. 2 . 
     Some quantum gates operate on two or more qubits. The SWAP gate, for example, acts on two distinct qubits and swaps their values. This gate is defined by 
     
       
         
           
             
               
                 
                   SWAP 
                   = 
                   
                     
                       [ 
                       
                         
                           
                             1 
                           
                           
                             0 
                           
                           
                             0 
                           
                           
                             0 
                           
                         
                         
                           
                             0 
                           
                           
                             0 
                           
                           
                             1 
                           
                           
                             0 
                           
                         
                         
                           
                             0 
                           
                           
                             1 
                           
                           
                             0 
                           
                           
                             0 
                           
                         
                         
                           
                             0 
                           
                           
                             0 
                           
                           
                             0 
                           
                           
                             1 
                           
                         
                       
                       ] 
                     
                     . 
                   
                 
               
               
                 
                   ( 
                   3 
                   ) 
                 
               
             
           
         
       
     
     The foregoing list of quantum gates and associated operator matrices is non-exhaustive, but is provided for ease of illustration. Other quantum gates include Pauli-X, -Y, and -Z gates, the √{square root over (NOT)} gate, additional phase-shift gates, the √{square root over (SWAP)} gate, controlled cX, cY, and cZ gates, and the Toffoli, Fredkin, Ising, and Deutsch gates, as non-limiting examples. 
     Continuing in  FIG. 1 , suitably configured signal from modulators  32  of quantum interface  30  may interact physically with one or more qubits  14  of qubit register  12  so as to assert any desired quantum-gate operation. As noted above, the desired quantum-gate operations are specifically defined rotations of a complex vector representing the qubit register state. In order to effect a desired rotation O, one or more modulators of quantum interface  30  may apply a predetermined signal level S i  for a predetermined duration T i . In some examples, plural signal levels may be applied for plural sequenced or otherwise associated durations, as shown in  FIG. 3 , to assert a quantum-gate operation on one or more qubits of the qubit register. In general, each signal level S i  and each duration T i  is a control parameter adjustable by appropriate programming of controller  18 . 
     The term ‘oracle’ is used herein to describe a predetermined sequence of elementary quantum-gate and/or measurement operations executable by quantum computer  10 . An oracle may be used to transform the quantum state of qubit register  12  to effect a classical or non-elementary quantum-gate operation or to apply a density operator, for example. In some examples, an oracle may be used to enact a predefined ‘black-box’ operation ƒ(x), which may be incorporated in a complex sequence of operations. To ensure adjoint operation, an oracle mapping n input qubits |x  to m output or ancilla qubits |y=ƒ(x)) may be defined as a quantum gate O(|x ⊗|y ) operating on the (n+m) qubits. In this case, O may be configured to pass the n input qubits unchanged but combine the result of the operation ƒ(x) with the ancillary qubits via an XOR operation, such that O(|x)  ⊗|y )=|x ⊗|y ⊗ƒ(x) . As described further below, a Gibbs-state oracle is an oracle configured to generate a Gibbs state based on a quantum state of specified qubit length. 
     Implicit in the description herein is that each qubit  14  of qubit register  12  may be interrogated via quantum interface  30  so as to reveal with confidence the standard basis vector |0 or |1 that characterizes the quantum state of that qubit. In some implementations, however, measurement of the quantum state of a physical qubit may be subject to error. Accordingly, any qubit  14  may be implemented as a logical qubit, which includes a grouping of physical qubits measured according to an error-correcting oracle that reveals the quantum state of the logical qubit with confidence. 
     Within the last several years, quantum machine learning has emerged as a significant motivation for developing quantum computers. In theory, quantum computers are naturally poised to model various real-world problems to which classical models are difficult to apply. Relative to the analogous classical model, a quantum model may be more accurate, more private, or faster to train, for example. Significantly, quantum computers may be capable of modeling probability distributions that, when represented by classical models, cannot be sampled efficiently. This ability may provide a broader or richer family of distributions than could be realized using a polynomial-sized classical model. 
     Many examples in which quantum machine learning may provide such advantages involve data having inherently quantum features, e.g., physical, chemical, and/or biological data. A quantum machine-learning dataset may include inter-atomic energy potentials, molecular atomization energy data, polarization data, molecular orbital eigenvalue data, protein or nucleic-acid folding data, etc. In some examples, quantum machine learning models may be suitable for simulating, evaluating, and/or designing physical quantum systems. For example, quantum machine learning models may be used to predict behavior of nanomaterials (e.g., quantum dot charge states, quantum circuitry, and the like). In some examples, quantum machine learning models may be suitable for tomography and/or partial tomography of quantum systems, e.g., approximately cloning an oracle system represented by an unknown density operator. Numerous other examples are equally envisaged. 
     Classical data is traditionally fed to a quantum algorithm in the form of a training set, or test set, of vectors. But rather than train on individual vectors, as one does in classical machine learning, quantum machine learning provides an opportunity to train on quantum-state vectors. More specifically, if the classical training set is thought of as a distribution over input vectors, then the analogous quantum training set would be a density operator, denoted ρ, which operates on the global quantum state of the network. 
     The goals in quantum machine learning vary from task to task. For unsupervised generative tasks, a common goal is to find, by experimenting with ρ, a process V such that V:|0   σ such that ∥ρ−σ∥ is small. Such a task corresponds, in quantum information language, to partial tomography or approximate cloning. Alternatively, supervised learning tasks are possible, in which the task is not to replicate the distribution but rather to replicate the conditional probability distributions over a label subspace. This approach is frequently taken in QAOA-based quantum neural networks. 
     In recent years, quantum Boltzmann machines have emerged as one of the most promising architectures for quantum neural networks. So that the reader can more easily understand the function of the quantum Boltzmann machine, the classical variant of the Boltzmann machine will first be described, with reference to  FIGS. 4A and 4B . The skilled reader will understand that some but not all aspects of this description are relevant also to the quantum variant, which is further described hereinafter. 
       FIG. 4A  shows aspects of a Boltzmann machine  40 , in one example. Every Boltzmann machine includes one or more of visible nodes v i  and may also include one or more hidden nodes h i . The term ‘unit’ may also be used to refer to a node of a Boltzmann machine; these terms are used interchangeably herein. Only the visible nodes receive data from outside the Boltzmann machine. While  FIG. 4A  shows four visible and four hidden nodes, other combinations of visible and hidden nodes are also envisaged, and certainly the numbers of visible and hidden nodes need not be equal. Each visible node v i  and each hidden node h i  of classical Boltzmann machine  40  is characterized by a state variable s i , which may have a value of 0 or 1. The collective states of the visible and hidden nodes are expressible, therefore, as a binary vectors v and h, respectively. 
     Collectively, the {s i } determines the global energy E of classical Boltzmann machine  40 , according to 
     
       
         
           
             
               
                 
                   
                     
                       - 
                       E 
                     
                     = 
                     
                       
                         
                           ∑ 
                           
                             i 
                             &lt; 
                             j 
                           
                         
                          
                         
                           
                             w 
                             ij 
                           
                            
                           
                             s 
                             i 
                           
                            
                           
                             s 
                             j 
                           
                         
                       
                       + 
                       
                         
                           ∑ 
                           i 
                         
                          
                         
                           
                             θ 
                             i 
                           
                            
                           
                             s 
                             i 
                           
                         
                       
                     
                   
                   , 
                 
               
               
                 
                   ( 
                   4 
                   ) 
                 
               
             
           
         
       
     
     where each θ i  defines the bias of s i  on the energy, and each w ij  defines the weight of an additional energy of interaction, or ‘connection strength’, between nodes i and j. 
     During operation of Boltzmann machine  40 , the equilibrium state is approached by resetting the state variable s i  of each of a sequence of randomly selected nodes according to a statistical rule. The rule for a classical Boltzmann machine is that the ensemble of nodes adheres to the Boltzmann distribution of statistical mechanics. In other words, 
     
       
         
           
             
               
                 
                   
                     
                       Δ 
                        
                       
                           
                       
                        
                       
                         E 
                         i 
                       
                     
                     = 
                     
                       
                         - 
                         
                           k 
                           B 
                         
                       
                        
                       T 
                        
                       
                           
                       
                        
                       ln 
                        
                       
                         
                           p 
                           
                             
                               s 
                               i 
                             
                             = 
                             0 
                           
                         
                         
                           p 
                           
                             
                               s 
                               i 
                             
                             = 
                             1 
                           
                         
                       
                     
                   
                   , 
                 
               
               
                 
                   ( 
                   5 
                   ) 
                 
               
             
           
         
       
     
     where p s     i     =0  and p s     i     =1  express the probabilities that s i =0 or 1, respectively, where ΔE i  is the change in the energy E of the ensemble of nodes due to the transition of the single node i from the s i =0 to the s i =1 state, where k B  is a constant, and where T is an adjustable parameter akin to the ‘temperature’ of the system. The reader will note that ΔE i  is readily obtained from Eq 4, above. Substituting p s     i     =0 =1−p s     i     =1 , the logistic function for the classical Boltzmann machine is obtained, 
     
       
         
           
             
               
                 
                   
                     p 
                     
                       
                         s 
                         i 
                       
                       = 
                       1 
                     
                   
                   = 
                   
                     
                       1 
                       
                         1 
                         + 
                         
                           e 
                           
                             
                               - 
                               Δ 
                             
                              
                             
                                 
                             
                              
                             
                               E 
                               i 
                             
                              
                             
                               / 
                             
                              
                             T 
                           
                         
                       
                     
                     . 
                   
                 
               
               
                 
                   ( 
                   6 
                   ) 
                 
               
             
           
         
       
     
     After a sufficient number of iterations at a predetermined T, the probability of observing any global state {s i } will depend only upon the energy of that state, not on the initial state from which the process was started. At that limit, the Boltzmann machine has achieved ‘thermal equilibrium’ at temperature T. In the optional method of ‘simulated annealing’, T is gradually transitioned from higher to lower values during the approach to equilibrium, in order to increase the likelihood of descending to a global energy minimum. 
     In useful examples, a Boltzmann machine is trained to converge to one or more desired global states using an external training distribution over such states. During the training, biases θ i  and weights w ij  are adjusted so that the global states with the highest probabilities have the lowest energies. To illustrate the training method, let P + (v) be a distribution of training data over the vector of visible nodes v, and let P − (v) be a distribution of thermally equilibrated states of the Boltzmann machine, which have been ‘marginalized’ over the hidden nodes of the machine. An appropriate measure of the dissimilarity of the two distributions is the Kullback-Leibler (KL) divergence G, defined as 
     
       
         
           
             
               
                 
                   
                     G 
                     = 
                     
                       
                         ∑ 
                         v 
                       
                        
                       
                         
                           
                             P 
                             + 
                           
                            
                           
                             ( 
                             v 
                             ) 
                           
                         
                          
                         
                             
                         
                          
                         ln 
                          
                         
                           
                             
                               P 
                               + 
                             
                              
                             
                               ( 
                               v 
                               ) 
                             
                           
                           
                             
                               P 
                               - 
                             
                              
                             
                               ( 
                               v 
                               ) 
                             
                           
                         
                       
                     
                   
                   , 
                 
               
               
                 
                   ( 
                   7 
                   ) 
                 
               
             
           
         
       
     
     where the sum is over all possible states v of v. In practice, a Boltzmann machine may be trained in two alternating phases: a ‘positive’ phase in which v is constrained to one particular binary state vector sampled from the training set (according to P+(v)), and a ‘negative’ phase in which the network is allowed to run freely. In this approach, the gradient with respect to a given weight, w ij  is given by 
     
       
         
           
             
               
                 
                   
                     
                       
                         ∂ 
                         G 
                       
                       
                         ∂ 
                         
                           w 
                           ij 
                         
                       
                     
                     = 
                     
                       - 
                       
                         
                           
                             p 
                             ij 
                             + 
                           
                           - 
                           
                             p 
                             ij 
                             - 
                           
                         
                         R 
                       
                     
                   
                   , 
                 
               
               
                 
                   ( 
                   8 
                   ) 
                 
               
             
           
         
       
     
     where p ij   +  is the probability that s i =s j =1 at thermal equilibrium of the positive phase, p ij   −  is the probability that s i =s j =1 at thermal equilibrium of the negative phase, and where R is a learning-rate parameter. Finally, the biases are trained according to 
     
       
         
           
             
               
                 
                   
                     
                       ∂ 
                       G 
                     
                     
                       ∂ 
                       
                         θ 
                         i 
                       
                     
                   
                   = 
                   
                     - 
                     
                       
                         
                           
                             p 
                             i 
                             + 
                           
                           - 
                           
                             p 
                             i 
                             - 
                           
                         
                         R 
                       
                       . 
                     
                   
                 
               
               
                 
                   ( 
                   9 
                   ) 
                 
               
             
           
         
       
     
     An important variant of the Boltzmann machine is the ‘restricted’ Boltzman machine (RBM). An example RBM  42  is represented in  FIG. 4B . An RBM differs from a generic Boltzmann machine in that it has no connection (w ij =0) between any pair of hidden nodes or any pair of visible nodes. Relative to the generic classical Boltzmann machine, the classical RBM is more easily trained and is applicable to a ‘deep-learning’ strategy in which the hidden nodes of a trained, upstream RBM are used to provide training data for training an adjacent downstream RBM, in a stacked, multilayer configuration. 
     Returning briefly to  FIG. 1 , quantum computer  10  may be configured to instantiate a quantum-computing analog of the classical Boltzmann machine, which is referred to herein as a quantum Boltzmann machine (QBM). The state {s i } of the visible and hidden nodes of a QBM may be represented in the array of qubits  14  of qubit register  12 . For example, the state of four visible nodes of a QBM may be represented in qubits  14 A through  14 D, and the state of four hidden nodes of the QBM may be represented in qubits  14 E through  14 H. In other examples, qubit register  12  may include, in addition to qubits corresponding to the visible and hidden nodes, one or more ‘ancilla’ qubits used to transiently store quantum states derived from the states of the visible and hidden nodes e.g., to implement an oracle. Naturally, any physical register of two or more qubits is divisible, as well as associable, so as to form any number of logical qubit registers visible, hidden, and ancilla registers, for example. The skilled reader will understand that a qubit register may be referred to as a ‘register’ in the description below. 
     Boltzmann machines are extensible to the quantum domain because they approximate the physics inherent in a quantum computer. In particular, a Boltzmann machine provides an energy for every configuration of a system and generates samples from the distribution of configurations with probabilities that depend exponentially on the energy. The same would be expected of a canonical ensemble in statistical physics. The explicit model in this case is 
     
       
         
           
             
               
                 
                   
                     
                       σ 
                       v 
                     
                     = 
                     
                       
                         Tr 
                         h 
                       
                       ( 
                       
                         
                           e 
                           
                             - 
                             H 
                           
                         
                         Z 
                       
                       ) 
                     
                   
                   , 
                 
               
               
                 
                   ( 
                   10 
                   ) 
                 
               
             
           
         
       
     
     where Tr h (⋅) is the partial trace over an auxiliary subsystem known as the hidden subsystem, which serves to build correlations between nodes of the visible subsystem. Thus, the goal of generative quantum Boltzmann training is to choose σ v =argmin H  (dist(ρ, σ v )) for an appropriate distance, or divergence, function. In this disclosure, the terms ‘loss function’, ‘cost function’, and ‘divergence function’ are used interchangeably. 
     The goal in training a QBM is to find a Hamiltonian that replicates a given input state as closely as possible. This is useful not only in generative applications, but can also be used for discriminative tasks by defining the visible unit subsystem to be composed of the tensor products of a visible subsystem and an output layer that yields the classification of the system. While generative tasks are the main focus here, it is straightforward to generalize this work to classification. 
     As noted above, for generative training on classical data, the natural divergence between the input and output distributions is the KL divergence. When the input is a quantum state, however, the quantum relative entropy is an appropriate measure of the divergence: 
         S (ρ|σ v )=Tr(ρ log ρ)−Tr(ρ log σ v ).  (11)
 
     The skilled reader will note that Eq. 11 reduces to the KL divergence if ρ and σ v  are classical. Moreover, S becomes zero if and only if ρ=σ v . 
     While quantum relative entropy is generally difficult to compute, the gradient of the quantum relative entropy is readily available for QBMs with all visible units. In such cases, σ v =e −H /Z. Further, the relation log(e −H /Z)=−H−log(Z) allows straightforward computation of the required matrix derivatives. On the other hand, no methods are known prior to this disclosure for generative training of QBMs using quantum relative entropy as a loss function when hidden units are present. This is because the partial trace in log(Tr h e −H /Z) prevents simplification of the logarithm term when computing the gradient. 
     The purpose of this disclosure is to provide practical methods for training generic QBMs that have hidden as well as visible units. Two variants are disclosed herein. The first and more efficient approach assumes a special form for the Hamiltonian, from which variational upper bounds on the quantum relative entropy are found, with an easy-to-compute derivatives. More specifically, the Hamiltonian acting on the hidden units commutes in this approach, such that the relevant gradients can be computed using a polynomial number of queries to a coherent Gibbs-state oracle. The second and more general approach uses recent techniques from quantum simulation to approximate the exact expression for the gradient of the relative entropy using Fourier-series approximations and high-order divided-difference formulas in place of the analytic derivative. Here, the exact gradient is computed using a polynomial (albeit greater) number of queries. Both methods are efficient provided that Gibbs-state preparation is efficient, which is expected to hold in most practical cases of Boltzmann training (although it is worth noting that efficient Gibbs-state preparation in general would imply QMA ⊂ BQP, which is unlikely to hold). 
     The interested reader is referred to the following list of references, which are cited below and hereby incorporated by reference herein.
     [1] L D Landau and E M Lifshitz. Statistical physics, vol. 5. Course of theoretical physics, 30, 1980.   [2] Maria Kieferova and Nathan Wiebe. Tomography and generative data modeling via quantum boltzmann training. arXiv preprint arXiv:1612.05204, 2016.   [3] Joran Van Apeldoorn, Andras Gilyén, Sander Gribling, and Ronald de Wolf. Quantum sdp-solvers: Better upper and lower bounds. In Foundations of Computer Science (FOCS), 2017 IEEE 58th Annual Symposium on, pages 403-414. IEEE, 2017.   [4] David Poulin and Pawel Wocjan. Sampling from the thermal quantum gibbs state and evaluating partition functions with a quantum computer. Physical review letters, 103(22):220502, 2009.   [5] Seth Lloyd, Masoud Mohseni, and Patrick Rebentrost. Quantum principal component analysis. Nature Physics, 10(9):631, 2014.   [6] Shelby Kimmel, Cedric Yen-Yu Lin, Guang Hao Low, Maris Ozols, and Theodore J Yoder. Hamiltonian simulation with optimal sample complexity. npj Quantum Information, 3(1):13, 2017.   [7] Howard E Haber. Notes on the matrix exponential and logarithm. 2018.   [8] Nicholas J Higham. Functions of matrices: theory and computation, volume 104. Siam, 2008.   [9] Gilles Brassard, Peter Hoyer, Michele Mosca, and Alain Tapp. Quantum amplitude amplification and estimation. Contemporary Mathematics, 305:53-74, 2002.   

     Returning now to the drawings,  FIG. 5  illustrates an example method  50  to train a QBM having one or more visible nodes and one or more hidden nodes. The method uses quantum relative entropy as a cost function and includes estimation of the gradient of the quantum relative entropy. 
     At  52  of method  50 , a QBM having visible and hidden nodes is instantiated in a quantum computer. Here each visible and each hidden node of the QBM is associated with a different corresponding qubit of a plurality of qubits of the quantum computer. As described above, the state of each of the plurality of qubits contributes to the global energy of the QBM according to a set of weighting factors. 
     At  54  initial values of the weighting factors—e.g., biases θ i  and weights w ij —are provided to the QBM. As noted above, the initial values of the weighting factors may be incorporated into a distribution σ v  over the one or more visible nodes of the QBM, for example. 
     At  56  a predetermined distribution of training data is provided to the visible nodes of the QBM. Generally speaking, training data may be provided so as to span the entire visible subsystem of the QBM, or any subset thereof. For generative applications, for example, the training distribution may cover all of the visible nodes, whereas for some classification tasks, it may be sufficient to compute a training loss function (such as a classification error rate) on a subset of visible nodes designated as the ‘output units’ or ‘output qubits’. Accordingly, the plurality of qubits of the qubit register may include one or more designated output qubits corresponding to one, some, or all of the visible nodes of the QBM, and a distribution of training data is provided over the one or more output qubits. 
     As noted above, the distribution of training data may take the form of a density operator ρ, which represents the quantum state of the visible subsystem as a statistical distribution or mixture of pure quantum states. Accordingly, the density operator may represent a statistically-weighted collection of possible observations of a quantum system, analogous to a probability distribution over classical state vectors. In some examples, a density operator ρ may represent superpositions of different basis states and/or entangled states. Superposition states in quantum data may represent uncertainty and/or ambiguity in the data. Entangled states may represent correlations between states. Accordingly, a density operator ρ may be used to more precisely describe systems in which uncertainty and/or non-trivial correlations occur, relative to any competing classical distribution. In some examples, classical distributions of training data may be converted to an appropriate density operator for use in the methods herein. 
     At  58  the QBM is driven to thermal equilibrium by repeated resetting of the state of each node and application of a logistic measurement function. At  60  the gradient of the quantum relative entropy between the one or more output qubits and the distribution of training data is estimated with respect to the weighting factors, based on the thermally equilibrated qubit state held in the quantum computer. At  62  it is determined whether a minimum of the quantum relative entropy has been reached with respect to the set of weighting factors. If a minimum has not been reached, then the method advances to  64 , where the weighting factors are adjusted (i.e., trained) based on the estimated gradient of the quantum relative entropy, using the quantum relative entropy as a cost function. From here the equilibrium state of the QBM is again approached, now using the adjusted weighting factors. If a minimum in the quantum relative entropy is reached at  62 , then the training procedure concludes with the currently adjusted values of the weighting factors accepted as trained values. The trained QBM may now be provided, at  66 , subsequent non-training distributions, for generative, discriminative, or classification tasks. In other examples, execution of method  50  may loop back to  56  where an additional training distribution is offered and processed. 
     Whereas computing the gradient of the average log-likelihood is a straightforward task when training a classical Boltzmann machine, finding the gradient of the quantum relative entropy is much harder. The reason is that, in general, [∂ θ H(θ), H(θ)]≠0. This means that certain rules for finding the derivative no longer hold. One important example, used repeatedly herein, is Duhamel&#39;s formula: 
       ∂ θ   e   H(θ) =∫ 0   1   dse   H(θ)s ∂θ H (θ) e   H(θ)(1−s) .  (12)
 
     This formula is proven by expanding the operator exponential in a Trotter-Suzuki expansion with r time-slices, differentiating the result and then taking the limit as r→∞. However, the relative complexity of this expression compared to what would be expected from the product rule serves as an important reminder that computing the gradient is not a trivial exercise. A similar formula for the logarithm is provided in the Appendix herein. 
     Because this disclosure involves functions of matrices, the notion of monotonicity is relevant, in addition to a formal definition of a QBM. For some approximations to hold, it is also necessary to define the notion of concavity, in order to use Jensen&#39;s inequality. 
     Definition 1. Operator Monoticity 
     A function ƒ is operator monotone with respect to the semidefinite order if 0 A B, for two symmetric positive definite operators, implies ƒ(A) ƒ(B). A function is operator concave w.r.t. the semidefinite order if cƒ(A)+(1−c)ƒ(B) ƒ(cA+(1−c)B) for all positive definite A, B, and c∈[0, 1]. 
     Definition 2 
     A quantum Boltzmann machine (QBM) is defined as a quantum mechanical system that acts on a tensor product of Hilbert spaces    v     h ∈   2     n    that correspond to the visible and hidden subsystems of the QBM. The QBM has a Hamiltonian of the form H∈   2     n     ×2     n    such that ∥H−diag(H)∥&gt;0. The QBM takes these parameters and then outputs a state of the form Tr h   
     
       
         
           
             
               ( 
               
                 
                   e 
                   
                     - 
                     H 
                   
                 
                 
                   Tr 
                    
                   
                     ( 
                     
                       e 
                       
                         - 
                         H 
                       
                     
                     ) 
                   
                 
               
               ) 
             
             , 
           
         
       
     
     where Tr h (⋅) refers to the partial trace over the hidden subspace of the model. 
     As described above, the quantum relative entropy cost function for a QBM with hidden units is given by 
           ρ ( H )= S (ρ|Tr h [ e   −H /Tr[ e   −H ]]),  (13)
 
     where S(ρ|σ):=Tr [ρ log ρ]−Tr [ρ log σ] is the quantum relative entropy. In the following, the reduced density matrix on the visible units of the QBM is denoted σ=Tr h  [e −H /Tr [e −H ]]. A regularization term may be included in the expression above to penalize unnecessary quantum correlations in the model. For simplicity, however, such regularization has been omitted herein. 
     In the case of an all-visible QBM (which corresponds to dim(   h )=1) a closed form expression for the gradient of the quantum relative entropy is known: 
     
       
         
           
             
               
                 
                   
                     
                       
                         ∂ 
                         
                           
                              
                             ρ 
                           
                            
                           
                             ( 
                             H 
                             ) 
                           
                         
                       
                       
                         ∂ 
                         θ 
                       
                     
                     = 
                     
                       - 
                       
                         Tr 
                          
                         
                           [ 
                           
                             
                               ∂ 
                               
                                 ∂ 
                                 θ 
                               
                             
                              
                             ρ 
                              
                             
                                 
                             
                              
                             log 
                              
                             
                                 
                             
                              
                             σ 
                           
                           ] 
                         
                       
                     
                   
                   , 
                 
               
               
                 
                   ( 
                   14 
                   ) 
                 
               
             
           
         
       
     
     which can be simplified using log(exp(−H))=−H and Duhamels formula to obtain the following equation for the gradient. Denoting ∂ θ :=∂/∂θ, 
       Tr[ρ∂ θ   H ]−Tr[ e   −H ∂ θ   H ]/Tr[ e   −H ].  (15)
 
     However, the above gradient formula is not generally valid, and indeed does not hold, if hidden units are included. Allowing for hidden units, it is necessary to addition-ally trace out the hidden subsystem, which results in the majorised distribution σ v :=Tr h  [e −H /Tr [e −H ]]. In general, the adapted cost function for the QBM with hidden units takes the form 
           ρ ( H )= S (ρ∥Tr h [ e   −H ]/Tr[ −H ].  (16)
 
     Note that H depends on variables that will be altered during the training process, while ρ is the target density matrix on which the training will have no influence. Therefore, in estimating the gradient of the above, it is possible to omit the Tr [ρ log ρ] and obtain: 
     
       
         
           
             
               
                 
                   
                     
                       
                         ∂ 
                         
                           
                              
                             ρ 
                           
                            
                           
                             ( 
                             H 
                             ) 
                           
                         
                       
                       
                         ∂ 
                         θ 
                       
                     
                     = 
                     
                       - 
                       
                         Tr 
                          
                         
                           [ 
                           
                             
                               ∂ 
                               
                                 ∂ 
                                 θ 
                               
                             
                              
                             ρ 
                              
                             
                                 
                             
                              
                             log 
                              
                             
                                 
                             
                              
                             
                               σ 
                               v 
                             
                           
                           ] 
                         
                       
                     
                   
                   , 
                 
               
               
                 
                   ( 
                   17 
                   ) 
                 
               
             
           
         
       
     
     where with σ v :=Tr h  [e −H ]/Tr [e −H ] is denoted the reduced density matrix, which is marginalised over the hidden units. 
     Two different training variants will now be discussed. While the first is less general, it gives an easily implementable algorithm and strong bounds using based on optimizing a variational bound. The second approach is, on the other hand, applicable to any problem instance and represents a general-purpose gradient-optimisation algorithm for relative-entropy training. The no-free-lunch theorem suggests that no (good) bounds can be obtained without assumptions on the problem instance, and indeed, the general algorithm exhibits, potentially, exponentially worse complexity. However, it may still be possible to make use of the second variant for specific applications, particularly because it gives a generally applicable algorithm for training QBMs on a quantum device. This appears to be the first known result of this kind. 
     Approach 1: Variational Training for Restricted Hamiltonians 
     The first approach is based on a variational bound of the objective function, i.e., the quantum relative entropy. In order to operationalize this approach, certain assumptions on the Hamiltonian are relied upon. These assumptions are important, as several instances of scalar calculus fail on transitioning to matrix functional analysis, and, for gradient-based approaches in particular, the assumptions are required in order to obtain a feasible analytical solution. 
     The Hamiltonian for a QBM may be expressed as 
         H=H   v   +H   h   +H   int ,  (18)
 
     which represents the energy operator acting on the visible units, the hidden units and a third interaction operator that creates correlations between the two. It is further assumed, for simplicity, that there are two sets of operators {v k } and {h k } composed of D=W v +W h +W int  terms with 
     
       
         
           
             
               
                 
                   
                     
                       
                         H 
                         v 
                       
                       = 
                       
                         
                           ∑ 
                           
                             k 
                             = 
                             1 
                           
                           
                             W 
                             v 
                           
                         
                          
                         
                             
                         
                          
                         
                           
                             θ 
                             k 
                           
                            
                           
                             
                               v 
                               k 
                             
                             ⊗ 
                             I 
                           
                         
                       
                     
                     , 
                     
                       
 
                     
                      
                     
                       
                         H 
                         h 
                       
                       = 
                       
                         
                           ∑ 
                           
                             k 
                             = 
                             
                               
                                 W 
                                 v 
                               
                               + 
                               1 
                             
                           
                           
                             
                               W 
                               v 
                             
                             + 
                             
                               W 
                               h 
                             
                           
                         
                          
                         
                             
                         
                          
                         
                           
                             θ 
                             k 
                           
                            
                           
                             I 
                             ⊗ 
                             
                               h 
                               k 
                             
                           
                         
                       
                     
                   
                    
                   
                     
 
                   
                    
                   
                     
                       
                         H 
                         int 
                       
                       = 
                       
                         
                           ∑ 
                           
                             k 
                             = 
                             
                               
                                 W 
                                 v 
                               
                               + 
                               
                                 W 
                                 h 
                               
                               + 
                               1 
                             
                           
                           
                             
                               W 
                               v 
                             
                             + 
                             
                               W 
                               h 
                             
                             + 
                             
                               W 
                               int 
                             
                           
                         
                          
                         
                             
                         
                          
                         
                           
                             θ 
                             k 
                           
                            
                           
                             
                               v 
                               k 
                             
                             ⊗ 
                             
                               h 
                               k 
                             
                           
                         
                       
                     
                     , 
                     
                       
 
                     
                      
                     
                       
                         [ 
                         
                           
                             h 
                             k 
                           
                           , 
                           
                             h 
                             j 
                           
                         
                         ] 
                       
                       = 
                       
                         0 
                          
                         
                             
                         
                          
                         
                           ∀ 
                           j 
                         
                       
                     
                     , 
                     
                       k 
                       . 
                     
                   
                 
               
               
                 
                   ( 
                   19 
                   ) 
                 
               
             
           
         
       
     
     While this implies that the Hamiltonian can in general be expressed as 
     
       
         
           
             
               
                 
                   
                     H 
                     = 
                     
                       
                         ∑ 
                         
                           k 
                           = 
                           1 
                         
                         D 
                       
                        
                       
                           
                       
                        
                       
                         
                           θ 
                           k 
                         
                          
                         
                           
                             v 
                             k 
                           
                           ⊗ 
                           
                             h 
                             k 
                           
                         
                       
                     
                   
                   , 
                 
               
               
                 
                   ( 
                   20 
                   ) 
                 
               
             
           
         
       
     
     it is useful to break up the Hamiltonian into the above form, to emphasize the qualitative difference between the types of terms that can appear in this model. 
     The intention of the form of the Hamiltonian in Eq. 19 is to force the non-commuting terms to act only on the visible units of the model. In contrast, only commuting Hamiltonian terms act on the hidden register. Since the hidden units commute, the eigenvalues and eigenvectors for the Hamiltonian can be expressed as text use 
         H|v   h     ⊗|h     =λ   v     h     ,h   |v   h     ⊗|h     ,   (21)
 
     where both the conditional eigenvectors and eigenvalues for the visible subsystem are functions of the eigenvector |h  obtained in the hidden register. This allows the hidden units to select between eigenbases to interpret the input data while also penalizing portions of the accessible Hilbert space that are not supported by the training data. However, since the hidden units commute, they cannot be used to construct a non-diagonal eigenbasis. This division of labor between the visible and hidden layers not only helps build intuition about the model but also opens up the possibility for more efficient training algorithms to exploit this fact. 
     For the following result, a variational bound is used in order to train the QBM weights for a Hamiltonian H of the form given in Eq. 20. The variational bound is expressible compactly in terms of a thermal expectation against a fictitious thermal probability distribution, as defined below. 
     Definition 3 
     Let {tilde over (H)} h =Σ k θ k Tr [ρv k ] h k  be the Hamiltonian acting conditioned on the visible subspace only on the hidden subsystem of the Hamiltonian H:=Σ k θ k v k ⊗h k . Then the expectation value over the marginal distribution over the hidden variables h is defined as: 
     
       
         
           
             
               
                 
                   
                     
                        
                       h 
                     
                      
                     
                       ( 
                       · 
                       ) 
                     
                   
                   = 
                   
                     
                       ∑ 
                       h 
                     
                      
                     
                       
                         
                           
                             ( 
                             · 
                             ) 
                           
                            
                           
                             r 
                             
                               - 
                               
                                 Tr 
                                  
                                 
                                   [ 
                                   
                                     ρ 
                                      
                                     
                                         
                                     
                                      
                                     
                                       
                                         H 
                                         ~ 
                                       
                                       h 
                                     
                                   
                                   ] 
                                 
                               
                             
                           
                         
                         
                           
                             Σ 
                             h 
                           
                            
                           
                             e 
                             
                               - 
                               
                                 Tr 
                                  
                                 
                                   [ 
                                   
                                     ρ 
                                      
                                     
                                         
                                     
                                      
                                     
                                       
                                         H 
                                         ~ 
                                       
                                       h 
                                     
                                   
                                   ] 
                                 
                               
                             
                           
                         
                       
                       . 
                     
                   
                 
               
               
                 
                   ( 
                   22 
                   ) 
                 
               
             
           
         
       
     
     This definition is now used to state the expression for the gradient of the variational bound on the quantum relative entropy. 
     Definition 4 
     Assume that the Hamiltonian of the QBM takes the form H, where θ k  are the parameters that determine the interaction strength and v k , h k  are unitary operators. Furthermore, let h k |h =E h,k |h  be the eigenvalues of the hidden subsystem, and let    h (⋅) be as given by Def. 3, i.e., the expectation value over the effective Boltzmann distribution of the visible layer with {tilde over (H)} h :=Σ h,k θ k v k . Finally, let the variational upper bound of the objective function be given by 
     
       
         
           
             
               
                 
                   
                     
                       
                         
                           S 
                           ~ 
                         
                          
                         
                           ( 
                           
                             ρ 
                              
                             H 
                           
                           ) 
                         
                       
                        
                       
                           
                       
                        
                       
                         := 
                       
                        
                       
                           
                       
                        
                       
                         Tr 
                          
                         
                           [ 
                           
                             ρ 
                              
                             
                                 
                             
                              
                             log 
                              
                             
                                 
                             
                              
                             ρ 
                           
                           ] 
                         
                       
                     
                     + 
                     
                       Tr 
                        
                       
                         [ 
                         
                           
                             ρ 
                              
                             
                               
                                 ∑ 
                                 k 
                               
                                
                               
                                 
                                    
                                   h 
                                 
                                  
                                 
                                   [ 
                                   
                                     
                                       E 
                                       
                                         h 
                                         , 
                                         k 
                                       
                                     
                                      
                                     
                                       θ 
                                       k 
                                     
                                      
                                     
                                       v 
                                       k 
                                     
                                   
                                   ] 
                                 
                               
                             
                           
                           + 
                           
                             
                                
                               h 
                             
                              
                             
                               [ 
                               
                                 log 
                                  
                                 
                                     
                                 
                                  
                                 
                                   α 
                                   h 
                                 
                               
                               ] 
                             
                           
                         
                         ] 
                       
                     
                     - 
                     
                       log 
                        
                       
                           
                       
                        
                       Z 
                     
                   
                   , 
                   
                     
 
                   
                    
                   
                       
                   
                    
                   where 
                 
               
               
                 
                   ( 
                   23 
                   ) 
                 
               
             
             
               
                 
                   
                       
                   
                    
                   
                     
                       α 
                       h 
                     
                     = 
                     
                       
                         
                           e 
                           
                             - 
                             
                               Tr 
                                
                               
                                 [ 
                                 
                                   ρ 
                                    
                                   
                                       
                                   
                                    
                                   
                                     
                                       H 
                                       ~ 
                                     
                                     h 
                                   
                                 
                                 ] 
                               
                             
                           
                         
                         
                           
                             Σ 
                             h 
                           
                            
                           
                             e 
                             
                               - 
                               
                                 Tr 
                                  
                                 
                                   [ 
                                   
                                     ρ 
                                      
                                     
                                         
                                     
                                      
                                     
                                       
                                         H 
                                         ~ 
                                       
                                       h 
                                     
                                   
                                   ] 
                                 
                               
                             
                           
                         
                       
                       . 
                     
                   
                 
               
               
                 
                   ( 
                   24 
                   ) 
                 
               
             
           
         
       
     
     This is the corresponding Gibbs distribution for the visible units. 
     Lemma 1. 
     Under the assumptions of Def. 4, {tilde over (S)} is a variational upper bound on the quantum relative entropy, meaning that {tilde over (S)}(ρ|H)≥S(ρ|e −H /Z). Furthermore, the derivatives of this upper bound with respect to the parameters of the Boltzmann machine are 
     
       
         
           
             
               
                 
                   
                     
                       ∂ 
                       
                         
                           S 
                           ~ 
                         
                          
                         
                           ( 
                           
                             ρ 
                              
                             H 
                           
                           ) 
                         
                       
                     
                     
                       ∂ 
                       
                         θ 
                         p 
                       
                     
                   
                   = 
                   
                     
                       
                          
                         h 
                       
                        
                       
                         [ 
                         
                           Tr 
                           ( 
                           
                             ρ 
                              
                             
                                 
                             
                              
                             
                               E 
                               
                                 h 
                                 , 
                                 p 
                               
                             
                              
                             
                               v 
                               p 
                             
                           
                           ] 
                         
                         ] 
                       
                     
                     - 
                     
                       
                         Tr 
                          
                         
                           [ 
                           
                             
                               
                                 ∂ 
                                 H 
                               
                               
                                 ∂ 
                                 
                                   θ 
                                   p 
                                 
                               
                             
                              
                             
                               
                                 e 
                                 
                                   - 
                                   H 
                                 
                               
                               Z 
                             
                           
                           ] 
                         
                       
                       . 
                     
                   
                 
               
               
                 
                   ( 
                   25 
                   ) 
                 
               
             
           
         
       
     
     Proof. 
     First derived is the gradient of the normalization term (Z) in the relative entropy, which can be trivially evaluated using Duhamels formula to obtain 
     
       
         
           
             
               
                 
                   
                     
                       ∂ 
                       
                         ∂ 
                         
                           θ 
                           p 
                         
                       
                     
                      
                     log 
                      
                     
                         
                     
                      
                     
                       Tr 
                        
                       
                         [ 
                         
                           e 
                           
                             - 
                             H 
                           
                         
                         ] 
                       
                     
                   
                   = 
                   
                     
                       - 
                       
                         Tr 
                          
                         
                           [ 
                           
                             
                               
                                 ∂ 
                                 H 
                               
                               
                                 ∂ 
                                 
                                   θ 
                                   p 
                                 
                               
                             
                              
                             
                               
                                 e 
                                 
                                   - 
                                   H 
                                 
                               
                               Z 
                             
                           
                           ] 
                         
                       
                     
                     = 
                     
                       - 
                       
                         
                           Tr 
                            
                           
                             [ 
                             
                               σ 
                                
                               
                                 
                                   ∂ 
                                   
                                     θ 
                                     p 
                                   
                                 
                                  
                                 H 
                               
                             
                             ] 
                           
                         
                         . 
                       
                     
                   
                 
               
               
                 
                   ( 
                   26 
                   ) 
                 
               
             
           
         
       
     
     Note that this term is evaluated by first preparing the Gibbs state σ Gibbs :=e −H /Z and then evaluating the expectation value of the operator ∂ θ     j   H w.r.t. the Gibbs state, using amplitude estimation for the Hadamard test. If T Gibbs  is the query complexity for the Gibbs state preparation, then the query complexity of the whole algorithm including the phase estimation step is then given by O(T Gibbs /{tilde over (∈)}) for an {tilde over (∈)}-accurate estimate of phase estimation. 
     Proceeding now with the gradient evaluations for the model, the reader will recall that the Hamiltonian H is assumed to take the form 
     
       
         
           
             
               
                 
                   
                     H 
                      
                     
                         
                     
                      
                     
                       := 
                     
                      
                     
                         
                     
                      
                     
                       
                         ∑ 
                         k 
                       
                        
                       
                         
                           θ 
                           k 
                         
                          
                         
                           
                             v 
                             k 
                           
                           ⊗ 
                           
                             h 
                             k 
                           
                         
                       
                     
                   
                   , 
                 
               
               
                 
                   ( 
                   27 
                   ) 
                 
               
             
           
         
       
     
     where v k  and h k  are operators acting on the visible and hidden units respectively, and that h k =d k  is assumed to be diagonal in the chosen basis. Under the assumption that [h i , h j ]=0, ∇i, j, c.f., the assumptions in Eq. 19, there exists a basis {|h } for the hidden subspace such that h k |h =E h,k |h . With these assumptions, the logarithm may be reformulated as 
     
       
         
           
             
               
                 
                   
                     log 
                      
                     
                         
                     
                      
                     
                       
                         Tr 
                         h 
                       
                        
                       
                         [ 
                         
                           e 
                           
                             - 
                             H 
                           
                         
                         ] 
                       
                     
                   
                   = 
                   
                     log 
                     ( 
                     
                       
                         ∑ 
                         
                           v 
                           , 
                           
                             v 
                             ′ 
                           
                           , 
                           h 
                         
                       
                        
                       
                         
                           〈 
                           
                             v 
                             , 
                             
                               h 
                                
                               
                                  
                                 
                                   e 
                                   
                                     
                                       - 
                                       
                                         Σ 
                                         k 
                                       
                                     
                                      
                                     
                                       θ 
                                       k 
                                     
                                      
                                     
                                       
                                         v 
                                         k 
                                       
                                       ⊗ 
                                       
                                         h 
                                         k 
                                       
                                     
                                   
                                 
                                  
                               
                                
                               
                                 v 
                                 ′ 
                               
                             
                             , 
                             h 
                           
                           〉 
                         
                          
                         
                            
                           v 
                           〉 
                         
                          
                         
                           〈 
                           
                             v 
                             ′ 
                           
                            
                         
                       
                     
                     ) 
                   
                 
               
               
                 
                   ( 
                   28 
                   ) 
                 
               
             
             
               
                 
                   = 
                   
                     log 
                     ( 
                     
                       
                         ∑ 
                         
                           v 
                           , 
                           
                             v 
                             ′ 
                           
                           , 
                           h 
                         
                       
                        
                       
                         
                           〈 
                           
                             v 
                              
                             
                                
                               
                                 e 
                                 
                                   
                                     - 
                                     
                                       Σ 
                                       k 
                                     
                                   
                                    
                                   
                                     E 
                                     
                                       h 
                                       , 
                                       k 
                                     
                                   
                                    
                                   
                                     θ 
                                     k 
                                   
                                    
                                   
                                     v 
                                     k 
                                   
                                 
                               
                                
                             
                              
                             
                               v 
                               ′ 
                             
                           
                           〉 
                         
                          
                         
                            
                           v 
                           〉 
                         
                          
                         
                           〈 
                           
                             v 
                             ′ 
                           
                            
                         
                       
                     
                     ) 
                   
                 
               
               
                 
                   ( 
                   29 
                   ) 
                 
               
             
             
               
                 
                   
                     = 
                     
                       log 
                       ( 
                       
                         
                           ∑ 
                           h 
                         
                          
                         
                           e 
                           
                             
                               - 
                               
                                 Σ 
                                 k 
                               
                             
                              
                             
                               E 
                               
                                 h 
                                 , 
                                 k 
                               
                             
                              
                             
                               θ 
                               k 
                             
                              
                             
                               v 
                               k 
                             
                           
                         
                       
                       ) 
                     
                   
                   , 
                 
               
               
                 
                   ( 
                   30 
                   ) 
                 
               
             
           
         
       
     
     where it is important to note that v k  are operators, and hence, the matrix representation of these are used in the last step. In order to further simplify this expression, it is noted that each term in the sum is a positive semi-definite operator. In particular, it will be noted that the matrix logarithm is operator concave and operator monotone, and hence by Jensen&#39;s inequality, for any sequence of non-negative number {α i }:Σ i α i =1, 
     
       
         
           
             
               
                 
                   
                     log 
                     ( 
                     
                       
                         
                           ∑ 
                           
                             i 
                             = 
                             1 
                           
                           N 
                         
                          
                         
                             
                         
                          
                         
                           
                             α 
                             i 
                           
                            
                           
                             U 
                             i 
                           
                         
                       
                       
                         
                           Σ 
                           j 
                         
                          
                         
                           α 
                           j 
                         
                       
                     
                     ) 
                   
                   ≥ 
                   
                     
                       
                         
                           ∑ 
                           
                             i 
                             = 
                             1 
                           
                           N 
                         
                          
                         
                             
                         
                          
                         
                           
                             α 
                             i 
                           
                            
                           
                               
                           
                            
                           log 
                            
                           
                               
                           
                            
                           
                             ( 
                             
                               U 
                               i 
                             
                             ) 
                           
                         
                       
                       
                         
                           Σ 
                           j 
                         
                          
                         
                           α 
                           j 
                         
                       
                     
                     . 
                   
                 
               
               
                 
                   ( 
                   31 
                   ) 
                 
               
             
           
         
       
     
     Further, since Tr [ρ log ρ]−Tr [ρ log σ v ] is being optimized, for arbitrary choice of {α i } i  under the above constraints, 
     
       
         
           
             
               
                 
                   
                     Tr 
                      
                     
                       [ 
                       
                         ρ 
                          
                         
                             
                         
                          
                         
                           log 
                            
                           
                             ( 
                             
                               
                                 ∑ 
                                 
                                   h 
                                   = 
                                   1 
                                 
                                 N 
                               
                                
                               
                                   
                               
                                
                               
                                 e 
                                 
                                   
                                     - 
                                     
                                       Σ 
                                       k 
                                     
                                   
                                    
                                   
                                     E 
                                     
                                       h 
                                       , 
                                       k 
                                     
                                   
                                    
                                   
                                     θ 
                                     k 
                                   
                                    
                                   
                                     v 
                                     k 
                                   
                                 
                               
                             
                             ) 
                           
                         
                       
                       ] 
                     
                   
                   = 
                   
                     
                       Tr 
                        
                       
                         [ 
                         
                           ρ 
                            
                           
                               
                           
                            
                           
                             log 
                              
                             
                               ( 
                               
                                 
                                   ∑ 
                                   
                                     h 
                                     = 
                                     1 
                                   
                                   N 
                                 
                                  
                                 
                                     
                                 
                                  
                                 
                                   
                                     α 
                                     h 
                                   
                                    
                                   
                                     
                                       
                                         e 
                                         
                                           
                                             - 
                                             
                                               Σ 
                                               k 
                                             
                                           
                                            
                                           
                                             E 
                                             
                                               h 
                                               , 
                                               k 
                                             
                                           
                                            
                                           
                                             θ 
                                             k 
                                           
                                            
                                           
                                             v 
                                             k 
                                           
                                         
                                       
                                        
                                       
                                         / 
                                       
                                        
                                       
                                         α 
                                         h 
                                       
                                     
                                     
                                       
                                         Σ 
                                         
                                           h 
                                           ′ 
                                         
                                       
                                        
                                       
                                         α 
                                         
                                           h 
                                           ′ 
                                         
                                       
                                     
                                   
                                 
                               
                               ) 
                             
                           
                         
                         ] 
                       
                     
                     ≥ 
                     
                       - 
                       
                         
                           Tr 
                            
                           
                             [ 
                             
                               ρ 
                                
                               
                                 
                                   
                                     
                                       Σ 
                                       h 
                                     
                                      
                                     
                                       α 
                                       h 
                                     
                                      
                                     
                                       Σ 
                                       k 
                                     
                                      
                                     
                                       E 
                                       
                                         h 
                                         , 
                                         k 
                                       
                                     
                                      
                                     
                                       θ 
                                       k 
                                     
                                      
                                     
                                       v 
                                       k 
                                     
                                   
                                   + 
                                   
                                     
                                       Σ 
                                       h 
                                     
                                      
                                     
                                       α 
                                       h 
                                     
                                      
                                     
                                         
                                     
                                      
                                     log 
                                      
                                     
                                         
                                     
                                      
                                     
                                       α 
                                       h 
                                     
                                   
                                 
                                 
                                   
                                     Σ 
                                     
                                       h 
                                       ′ 
                                     
                                   
                                    
                                   
                                     α 
                                     
                                       h 
                                       ′ 
                                     
                                   
                                 
                               
                             
                             ] 
                           
                         
                         . 
                       
                     
                   
                 
               
               
                 
                   ( 
                   32 
                   ) 
                 
               
             
           
         
       
     
     Hence, the variational bound on the objective function for any {α i } i  is 
     
       
         
           
             
               
                 
                   
                     
                       
                          
                         ρ 
                       
                        
                       
                         ( 
                         H 
                         ) 
                       
                     
                     = 
                     
                       
                         
                           Tr 
                            
                           
                             [ 
                             
                               ρ 
                                
                               
                                   
                               
                                
                               log 
                                
                               
                                   
                               
                                
                               ρ 
                             
                             ] 
                           
                         
                         - 
                         
                           Tr 
                            
                           
                             [ 
                             
                               ρ 
                                
                               
                                   
                               
                                
                               log 
                                
                               
                                   
                               
                                
                               
                                 σ 
                                 v 
                               
                             
                             ] 
                           
                         
                       
                       ≤ 
                       
                         
                           Tr 
                            
                           
                             [ 
                             
                               ρ 
                                
                               
                                   
                               
                                
                               log 
                                
                               
                                   
                               
                                
                               ρ 
                             
                             ] 
                           
                         
                         + 
                         
                           Tr 
                            
                           
                             [ 
                             
                               ρ 
                                
                               
                                 
                                   
                                     
                                       Σ 
                                       h 
                                     
                                      
                                     
                                       α 
                                       h 
                                     
                                      
                                     
                                       Σ 
                                       k 
                                     
                                      
                                     
                                       E 
                                       
                                         h 
                                         , 
                                         k 
                                       
                                     
                                      
                                     
                                       θ 
                                       k 
                                     
                                      
                                     
                                       v 
                                       k 
                                     
                                   
                                   + 
                                   
                                     
                                       Σ 
                                       h 
                                     
                                      
                                     
                                       α 
                                       h 
                                     
                                      
                                     
                                         
                                     
                                      
                                     log 
                                      
                                     
                                         
                                     
                                      
                                     
                                       α 
                                       h 
                                     
                                   
                                 
                                 
                                   
                                     Σ 
                                     
                                       h 
                                       ′ 
                                     
                                   
                                    
                                   
                                     α 
                                     
                                       h 
                                       ′ 
                                     
                                   
                                 
                               
                             
                             ] 
                           
                         
                         + 
                         
                           log 
                            
                           
                               
                           
                            
                           Z 
                            
                           
                               
                           
                            
                           
                             =: 
                           
                            
                           
                               
                           
                            
                           
                             S 
                             ~ 
                           
                         
                       
                     
                   
                   , 
                 
               
               
                 
                   ( 
                   33 
                   ) 
                 
               
             
           
         
       
     
     which yields 
     
       
         
           
             
               
                 
                   
                     
                       ∂ 
                       
                         S 
                         ~ 
                       
                     
                     
                       ∂ 
                       
                         θ 
                         p 
                       
                     
                   
                   = 
                   
                     
                       - 
                       
                         Tr 
                          
                         
                           [ 
                           
                             
                               
                                 ∂ 
                                 H 
                               
                               
                                 ∂ 
                                 
                                   θ 
                                   p 
                                 
                               
                             
                              
                             
                               
                                 e 
                                 
                                   - 
                                   H 
                                 
                               
                               Z 
                             
                           
                           ] 
                         
                       
                     
                     + 
                     
                       Tr 
                       [ 
                       
                         
                           ∂ 
                           
                             ∂ 
                             
                               θ 
                               p 
                             
                           
                         
                          
                         ρ 
                          
                         
                           
                             ∑ 
                             h 
                           
                            
                           
                             
                               α 
                               h 
                             
                              
                             
                               
                                 ∑ 
                                 k 
                               
                                
                               
                                 
                                   E 
                                   
                                     h 
                                     , 
                                     k 
                                   
                                 
                                  
                                 
                                   θ 
                                   k 
                                 
                                  
                                 
                                   v 
                                   k 
                                 
                               
                             
                           
                         
                       
                       ] 
                     
                     + 
                     
                       
                         ∂ 
                         
                           ∂ 
                           
                             θ 
                             p 
                           
                         
                       
                        
                       
                         
                           ∑ 
                           h 
                         
                          
                         
                           
                             α 
                             h 
                           
                            
                           
                               
                           
                            
                           log 
                            
                           
                               
                           
                            
                           
                             α 
                             h 
                           
                         
                       
                     
                   
                 
               
               
                 
                   ( 
                   34 
                   ) 
                 
               
             
             
               
                 
                   = 
                   
                     
                       - 
                       
                         Tr 
                          
                         
                           [ 
                           
                             
                               
                                 ∂ 
                                 H 
                               
                               
                                 ∂ 
                                 
                                   θ 
                                   p 
                                 
                               
                             
                              
                             
                               
                                 e 
                                 
                                   - 
                                   H 
                                 
                               
                               Z 
                             
                           
                           ] 
                         
                       
                     
                     + 
                     
                       
                         ∂ 
                         
                           ∂ 
                           
                             θ 
                             p 
                           
                         
                       
                        
                       
                         ( 
                         
                           
                             
                               ∑ 
                               h 
                             
                              
                             
                               
                                 α 
                                 h 
                               
                                
                               
                                 Tr 
                                 [ 
                                 
                                   ρ 
                                    
                                   
                                     
                                       ∑ 
                                       k 
                                     
                                      
                                     
                                       
                                         E 
                                         
                                           h 
                                           , 
                                           k 
                                         
                                       
                                        
                                       
                                         θ 
                                         k 
                                       
                                        
                                       
                                         v 
                                         k 
                                       
                                     
                                   
                                 
                                 ] 
                               
                             
                           
                           + 
                           
                             
                               ∑ 
                               h 
                             
                              
                             
                               
                                 α 
                                 h 
                               
                                
                               
                                   
                               
                                
                               log 
                                
                               
                                   
                               
                                
                               
                                 α 
                                 h 
                               
                             
                           
                         
                         ) 
                       
                     
                   
                 
               
               
                 
                   ( 
                   35 
                   ) 
                 
               
             
           
         
       
     
     where the first term results from the partition sum. The former term can be seen as a new effective Hamiltonian, while the latter term is the entropy. The latter term hence resembles the free energy F(h)=E(h)−TS(h), where E(h) is the mean energy of the effective system with energies E(h):=Tr [ρΣ k E h,k θ k v k ], T the temperature and S(h) the Shannon entropy of the α h  distribution. Now α h  terms are chosen to minimize this variational upper bound. 
     It is well-established in statistical physics, see for example [1], that the distribution that maximizes the free energy is the Boltzmann (or Gibbs) distribution, i.e., 
     
       
         
           
             
               
                 
                   
                     
                       α 
                       h 
                     
                     = 
                     
                       
                         e 
                         
                           - 
                           
                             Tr 
                              
                             
                               [ 
                               
                                 ρ 
                                  
                                 
                                     
                                 
                                  
                                 
                                   
                                     H 
                                     ~ 
                                   
                                   h 
                                 
                               
                               ] 
                             
                           
                         
                       
                       
                         
                           Σ 
                           h 
                         
                          
                         
                           e 
                           
                             - 
                             
                               Tr 
                                
                               
                                 [ 
                                 
                                   ρ 
                                    
                                   
                                       
                                   
                                    
                                   
                                     
                                       H 
                                       ~ 
                                     
                                     h 
                                   
                                 
                                 ] 
                               
                             
                           
                         
                       
                     
                   
                   , 
                 
               
               
                 
                   ( 
                   36 
                   ) 
                 
               
             
           
         
       
     
     where {tilde over (H)} h :=Σ k E h,k θ k v k  is a new effective Hamiltonian on the visible units, and the {α i } are given by the corresponding Gibbs distribution for the visible units. 
     Therefore, the gradients can be taken with respect to this distribution and the bound above, where Tr [ρ{tilde over (H)} h ] is the mean energy of the effective visible system w.r.t. the data-distribution. For the derivative of the energy term, 
     
       
         
           
             
               
                 
                   
                       
                   
                    
                   
                     
                       
                         ∂ 
                         
                           ∂ 
                           
                             θ 
                             p 
                           
                         
                       
                        
                       
                         
                           ∑ 
                           h 
                         
                          
                         
                           
                             α 
                             h 
                           
                            
                           
                             Tr 
                             [ 
                             
                               ρ 
                                
                               
                                 
                                   ∑ 
                                   k 
                                 
                                  
                                 
                                   
                                     E 
                                     
                                       h 
                                       , 
                                       k 
                                     
                                   
                                    
                                   
                                     θ 
                                     k 
                                   
                                    
                                   
                                     v 
                                     k 
                                   
                                 
                               
                             
                             ] 
                           
                         
                       
                     
                     = 
                   
                 
               
               
                 
                   ( 
                   37 
                   ) 
                 
               
             
             
               
                 
                   = 
                   
                     
                       ∑ 
                       h 
                     
                      
                     
                       ( 
                       
                         
                           
                             
                               α 
                               h 
                             
                              
                             
                               ( 
                               
                                 
                                   
                                      
                                     
                                       h 
                                       ′ 
                                     
                                   
                                    
                                   
                                     [ 
                                     
                                       Tr 
                                        
                                       
                                         [ 
                                         
                                           ρ 
                                            
                                           
                                               
                                           
                                            
                                           
                                             E 
                                             
                                               
                                                 h 
                                                 ′ 
                                               
                                               , 
                                               p 
                                             
                                           
                                            
                                           
                                             v 
                                             p 
                                           
                                         
                                         ] 
                                       
                                     
                                     ] 
                                   
                                 
                                 - 
                                 
                                   Tr 
                                    
                                   
                                     [ 
                                     
                                       ρ 
                                        
                                       
                                           
                                       
                                        
                                       
                                         E 
                                         
                                           h 
                                           , 
                                           p 
                                         
                                       
                                        
                                       
                                         v 
                                         p 
                                       
                                     
                                     ] 
                                   
                                 
                               
                               ) 
                             
                           
                            
                           
                             Tr 
                              
                             
                               [ 
                               
                                 ρ 
                                  
                                 
                                     
                                 
                                  
                                 
                                   
                                     H 
                                     ~ 
                                   
                                   h 
                                 
                               
                               ] 
                             
                           
                         
                         + 
                         
                           
                             α 
                             h 
                           
                            
                           
                             Tr 
                              
                             
                               [ 
                               
                                 ρ 
                                  
                                 
                                     
                                 
                                  
                                 
                                   E 
                                   
                                     h 
                                     , 
                                     p 
                                   
                                 
                                  
                                 
                                   v 
                                   p 
                                 
                               
                               ] 
                             
                           
                         
                       
                       ) 
                     
                   
                 
               
               
                 
                   ( 
                   38 
                   ) 
                 
               
             
             
               
                 
                   
                     = 
                     
                       
                          
                         h 
                       
                        
                       
                         [ 
                         
                           
                             
                               ( 
                               
                                 
                                   
                                      
                                     
                                       h 
                                       ′ 
                                     
                                   
                                    
                                   
                                     [ 
                                     
                                       Tr 
                                        
                                       
                                         [ 
                                         
                                           ρ 
                                            
                                           
                                               
                                           
                                            
                                           
                                             E 
                                             
                                               
                                                 h 
                                                 ′ 
                                               
                                               , 
                                               p 
                                             
                                           
                                            
                                           
                                             v 
                                             p 
                                           
                                         
                                         ] 
                                       
                                     
                                     ] 
                                   
                                 
                                 - 
                                 
                                   Tr 
                                    
                                   
                                     [ 
                                     
                                       ρ 
                                        
                                       
                                           
                                       
                                        
                                       
                                         E 
                                         
                                           h 
                                           , 
                                           p 
                                         
                                       
                                        
                                       
                                         v 
                                         p 
                                       
                                     
                                     ] 
                                   
                                 
                               
                               ) 
                             
                              
                             
                               Tr 
                                
                               
                                 [ 
                                 
                                   ρ 
                                    
                                   
                                       
                                   
                                    
                                   
                                     
                                       H 
                                       ~ 
                                     
                                     h 
                                   
                                 
                                 ] 
                               
                             
                           
                           + 
                           
                             Tr 
                              
                             
                               [ 
                               
                                 ρ 
                                  
                                 
                                     
                                 
                                  
                                 
                                   E 
                                   
                                     h 
                                     , 
                                     p 
                                   
                                 
                                  
                                 
                                   v 
                                   p 
                                 
                               
                               ] 
                             
                           
                         
                         ] 
                       
                     
                   
                   , 
                 
               
               
                 
                   ( 
                   39 
                   ) 
                 
               
             
           
         
       
     
     while the entropy term yields 
     
       
         
           
             
               
                 
                   
                     
                       ∂ 
                       
                         ∂ 
                         
                           θ 
                           p 
                         
                       
                     
                      
                     
                       
                         ∑ 
                         h 
                       
                        
                       
                         
                           α 
                           h 
                         
                          
                         
                             
                         
                          
                         log 
                          
                         
                             
                         
                          
                         
                           α 
                           h 
                         
                       
                     
                   
                   = 
                   
                     
                       
                         ∑ 
                         h 
                       
                        
                       
                         
                           α 
                           h 
                         
                          
                         
                           ( 
                           
                             
                               
                                 [ 
                                 
                                   
                                     Tr 
                                      
                                     
                                       [ 
                                       
                                         ρ 
                                          
                                         
                                             
                                         
                                          
                                         
                                           E 
                                           
                                             h 
                                             , 
                                             p 
                                           
                                         
                                          
                                         
                                           v 
                                           p 
                                         
                                       
                                       ] 
                                     
                                   
                                   - 
                                   
                                     
                                        
                                       
                                         h 
                                         ′ 
                                       
                                     
                                      
                                     
                                       [ 
                                       
                                         Tr 
                                          
                                         
                                           [ 
                                           
                                             ρ 
                                              
                                             
                                                 
                                             
                                              
                                             
                                               E 
                                               
                                                 
                                                   h 
                                                   ′ 
                                                 
                                                 , 
                                                 p 
                                               
                                             
                                              
                                             
                                               v 
                                               p 
                                             
                                           
                                           ] 
                                         
                                       
                                       ] 
                                     
                                   
                                 
                                 ] 
                               
                                
                               
                                 Tr 
                                  
                                 
                                   [ 
                                   
                                     ρ 
                                      
                                     
                                         
                                     
                                      
                                     
                                       
                                         H 
                                         ~ 
                                       
                                       h 
                                     
                                   
                                   ] 
                                 
                               
                             
                             - 
                             
                               Tr 
                                
                               
                                 [ 
                                 
                                   ρ 
                                    
                                   
                                       
                                   
                                    
                                   
                                     E 
                                     
                                       h 
                                       , 
                                       p 
                                     
                                   
                                    
                                   
                                     v 
                                     p 
                                   
                                 
                                 ] 
                               
                             
                           
                           ) 
                         
                       
                     
                     + 
                     
                       
                         ∑ 
                         h 
                       
                        
                       
                         
                           
                             α 
                             h 
                           
                            
                           
                             ( 
                             
                               
                                 Tr 
                                  
                                 
                                   [ 
                                   
                                     ρ 
                                      
                                     
                                         
                                     
                                      
                                     
                                       E 
                                       
                                         h 
                                         , 
                                         p 
                                       
                                     
                                   
                                   ] 
                                 
                               
                               - 
                               
                                 
                                    
                                   
                                     h 
                                     ′ 
                                   
                                 
                                  
                                 
                                   [ 
                                   
                                     Tr 
                                      
                                     
                                       [ 
                                       
                                         ρ 
                                          
                                         
                                             
                                         
                                          
                                         
                                           E 
                                           
                                             
                                               h 
                                               ′ 
                                             
                                             , 
                                             p 
                                           
                                         
                                          
                                         
                                           v 
                                           p 
                                         
                                       
                                       ] 
                                     
                                   
                                   ] 
                                 
                               
                             
                             ) 
                           
                         
                          
                         log 
                          
                         
                             
                         
                          
                         
                           Tr 
                           [ 
                           
                             e 
                             
                               - 
                               
                                 
                                   H 
                                   ~ 
                                 
                                 h 
                               
                             
                           
                           ] 
                         
                       
                     
                     + 
                     
                       
                         
                            
                           
                             h 
                             ′ 
                           
                         
                          
                         
                           [ 
                           
                             Tr 
                              
                             
                               [ 
                               
                                 ρ 
                                  
                                 
                                     
                                 
                                  
                                 
                                   E 
                                   
                                     
                                       h 
                                       ′ 
                                     
                                     , 
                                     p 
                                   
                                 
                                  
                                 
                                   v 
                                   p 
                                 
                               
                               ] 
                             
                           
                           ] 
                         
                       
                       . 
                     
                   
                 
               
               
                 
                   ( 
                   40 
                   ) 
                 
               
             
           
         
       
     
     This can be further simplified to 
     
       
         
           
             
               
                 
                   
                     ∑ 
                     h 
                   
                    
                   
                     
                       
                         α 
                         h 
                       
                        
                       
                         ( 
                         
                           
                             Tr 
                              
                             
                               [ 
                               
                                 ρ 
                                  
                                 
                                     
                                 
                                  
                                 
                                   E 
                                   
                                     h 
                                     , 
                                     p 
                                   
                                 
                                  
                                 
                                   v 
                                   p 
                                 
                               
                               ] 
                             
                           
                           - 
                           
                             
                                
                               
                                 h 
                                 ′ 
                               
                             
                              
                             
                               [ 
                               
                                 Tr 
                                  
                                 
                                   [ 
                                   
                                     ρ 
                                      
                                     
                                         
                                     
                                      
                                     
                                       E 
                                       
                                         
                                           h 
                                           ′ 
                                         
                                         , 
                                         p 
                                       
                                     
                                      
                                     
                                       v 
                                       p 
                                     
                                   
                                   ] 
                                 
                               
                               ] 
                             
                           
                         
                         ) 
                       
                     
                      
                     
                       Tr 
                        
                       
                         [ 
                         
                           ρ 
                            
                           
                               
                           
                            
                           
                             
                               H 
                               ~ 
                             
                             h 
                           
                         
                         ] 
                       
                     
                   
                 
               
               
                 
                   ( 
                   41 
                   ) 
                 
               
             
             
               
                 
                   = 
                   
                     
                       
                          
                         h 
                       
                        
                       
                         [ 
                         
                           
                             ( 
                             
                               
                                 Tr 
                                  
                                 
                                   [ 
                                   
                                     ρ 
                                      
                                     
                                         
                                     
                                      
                                     
                                       E 
                                       
                                         
                                           h 
                                           ′ 
                                         
                                         , 
                                         p 
                                       
                                     
                                      
                                     
                                       v 
                                       p 
                                     
                                   
                                   ] 
                                 
                               
                               - 
                               
                                 
                                    
                                   
                                     h 
                                     ′ 
                                   
                                 
                                  
                                 
                                   [ 
                                   
                                     Tr 
                                      
                                     
                                       [ 
                                       
                                         ρ 
                                          
                                         
                                             
                                         
                                          
                                         
                                           E 
                                           
                                             
                                               h 
                                               ′ 
                                             
                                             , 
                                             p 
                                           
                                         
                                          
                                         
                                           v 
                                           p 
                                         
                                       
                                       ] 
                                     
                                   
                                   ] 
                                 
                               
                             
                             ) 
                           
                            
                           
                             Tr 
                              
                             
                               [ 
                               
                                 ρ 
                                  
                                 
                                     
                                 
                                  
                                 
                                   
                                     H 
                                     ~ 
                                   
                                   h 
                                 
                               
                               ] 
                             
                           
                         
                         ] 
                       
                     
                     . 
                   
                 
               
               
                 
                   ( 
                   42 
                   ) 
                 
               
             
           
         
       
     
     The resulting gradient for the variational bound for the visible terms is hence given by 
     
       
         
           
             
               
                 
                   
                     
                       ∂ 
                       
                         S 
                         ~ 
                       
                     
                     
                       ∂ 
                       
                         θ 
                         p 
                       
                     
                   
                   = 
                   
                     
                       
                          
                         h 
                       
                        
                       
                         [ 
                         
                           Tr 
                            
                           
                             [ 
                             
                               ρ 
                                
                               
                                   
                               
                                
                               
                                 E 
                                 
                                   h 
                                   , 
                                   p 
                                 
                               
                                
                               
                                 v 
                                 p 
                               
                             
                             ] 
                           
                         
                         ] 
                       
                     
                     - 
                     
                       
                         Tr 
                          
                         
                           [ 
                           
                             
                               
                                 ∂ 
                                 H 
                               
                               
                                 ∂ 
                                 
                                   θ 
                                   p 
                                 
                               
                             
                              
                             
                               
                                 e 
                                 
                                   - 
                                   H 
                                 
                               
                               Z 
                             
                           
                           ] 
                         
                       
                       . 
                     
                   
                 
               
               
                 
                   ( 
                   43 
                   ) 
                 
               
             
           
         
       
     
     Notably, if one considers no interactions between the visible and hidden units, then indeed the gradient above reduces to the case of the visible Boltzmann machine, which was treated in [2], resulting in the gradient 
     
       
         
           
             
               
                 
                   
                     
                       Tr 
                        
                       
                         [ 
                         
                           ρ 
                            
                           
                             
                               ∂ 
                               
                                 θ 
                                 p 
                               
                             
                              
                             H 
                           
                         
                         ] 
                       
                     
                     - 
                     
                       Tr 
                       [ 
                       
                         
                           
                             e 
                             
                               - 
                               H 
                             
                           
                           Z 
                         
                          
                         
                           
                             ∂ 
                             
                               θ 
                               p 
                             
                           
                            
                           H 
                         
                       
                       ] 
                     
                   
                   , 
                 
               
               
                 
                   ( 
                   44 
                   ) 
                 
               
             
           
         
       
     
     under applicable assumptions on the form of H, ∂ θ     p   H=v p . 
     Operationalizing the Gradient-Based Training. 
     From Lemma 1, it is known that the derivative of the relative entropy w.r.t. any parameter θ p  can be stated as 
     
       
         
           
             
               
                 
                   
                     
                       ∂ 
                       
                         S 
                         ~ 
                       
                     
                     
                       ∂ 
                       
                         θ 
                         p 
                       
                     
                   
                   = 
                   
                     
                       
                         
                            
                           h 
                         
                          
                         
                           [ 
                           
                             E 
                             
                               h 
                               , 
                               p 
                             
                           
                           ] 
                         
                       
                        
                       
                         Tr 
                          
                         
                           [ 
                           
                             ρ 
                              
                             
                                 
                             
                              
                             
                               v 
                               p 
                             
                           
                           ] 
                         
                       
                     
                     - 
                     
                       
                         Tr 
                          
                         
                           [ 
                           
                             
                               
                                 ∂ 
                                 H 
                               
                               
                                 ∂ 
                                 
                                   θ 
                                   p 
                                 
                               
                             
                              
                             
                               
                                 e 
                                 
                                   - 
                                   H 
                                 
                               
                               Z 
                             
                           
                           ] 
                         
                       
                       . 
                     
                   
                 
               
               
                 
                   ( 
                   45 
                   ) 
                 
               
             
           
         
       
     
     Since evaluating the latter part is, as mentioned above, straightforward, an algorithm is now given for evaluating the first part. 
     In view of the foregoing analysis, it is possible to evaluate each term Tr [ρv k ] individually for all k∈[D], i.e., all D dimensions of the gradient via the Hadamard test for v k , assuming v k  is unitary. More generally, for non-unitary v k  one could evaluate this term using a linear combination of unitary operations. Therefore, the remaining task is to evaluate the terms    h [E h,p ] in Eq. 45, which reduces to sampling according to the distribution {α h }. For this it is necessary to be able to create a Gibbs distribution for the effective Hamiltonian {tilde over (H)} h =Σ k θ k Tr [ρv k ] h k  that contains only D terms and can hence be evaluated efficiently as long as D is small, which can generally be assumed. In order to sample according to the distribution {α h }, the factors θ k Tr [ρv k ] in the sum over k are first evaluated via the Hadamard test, and then used in order to implement the Gibbs distribution exp (−{tilde over (H)} h )/{tilde over (Z)} for the Hamiltonian 
     
       
         
           
             
               
                 
                   
                     
                       H 
                       ~ 
                     
                     h 
                   
                   = 
                   
                     
                       ∑ 
                       k 
                     
                      
                     
                       
                         θ 
                         k 
                       
                        
                       
                         Tr 
                          
                         
                           [ 
                           
                             ρ 
                              
                             
                                 
                             
                              
                             
                               v 
                               k 
                             
                           
                           ] 
                         
                       
                        
                       
                         
                           h 
                           k 
                         
                         . 
                       
                     
                   
                 
               
               
                 
                   ( 
                   46 
                   ) 
                 
               
             
           
         
       
     
     To this end, the results of [3] are adapted in order to prepare the corresponding Gibbs state, although alternative methods may also be used, e.g., [4]. 
     Theorem 1. 
     Gibbs state preparation [3]. Suppose that I H and we are given K∈   +  such that ∥H∥≤2K, and let H∈   N×N  be a d-sparse Hamiltonian, and we know a lower bound z≤Z=Tr [e −H ]. If ϵ∈(0, ⅓), then we can prepare a purified Gibbs state |γ   AB  such that 
     
       
         
           
             
               
                 
                   
                      
                     
                       
                         
                           Tr 
                           B 
                         
                          
                         
                           [ 
                           
                             
                                
                               γ 
                               〉 
                             
                              
                             
                               
                                 〈 
                                 γ 
                                  
                               
                               AB 
                             
                           
                           ] 
                         
                       
                       - 
                       
                         
                           e 
                           
                             - 
                             H 
                           
                         
                         Z 
                       
                     
                      
                   
                   ≤ 
                   ϵ 
                 
               
               
                 
                   ( 
                   47 
                   ) 
                 
               
             
           
         
       
     
     using 
     
       
         
           
             
               
                 
                   
                      
                     ~ 
                   
                    
                   
                     ( 
                     
                       
                         
                           N 
                           z 
                         
                       
                        
                       Kd 
                        
                       
                           
                       
                        
                       log 
                        
                       
                         ( 
                         
                           K 
                           ϵ 
                         
                         ) 
                       
                        
                       
                         log 
                          
                         
                           ( 
                           
                             1 
                             ϵ 
                           
                           ) 
                         
                       
                     
                     ) 
                   
                 
               
               
                 
                   ( 
                   48 
                   ) 
                 
               
             
           
         
       
     
     queries, and 
     
       
         
           
             
               
                 
                   
                      
                     ~ 
                   
                    
                   
                     ( 
                     
                       
                         
                           N 
                           z 
                         
                       
                        
                       Kd 
                        
                       
                           
                       
                        
                       
                         log 
                          
                         
                           ( 
                           
                             K 
                             ϵ 
                           
                           ) 
                         
                       
                        
                       
                         
                           log 
                            
                           
                             ( 
                             
                               1 
                               ϵ 
                             
                             ) 
                           
                         
                          
                         
                           [ 
                           
                             
                               log 
                                
                               
                                 ( 
                                 N 
                                 ) 
                               
                             
                             + 
                             
                               
                                 log 
                                 
                                   5 
                                    
                                   
                                     / 
                                   
                                    
                                   2 
                                 
                               
                                
                               
                                 ( 
                                 
                                   K 
                                   ϵ 
                                 
                                 ) 
                               
                             
                           
                           ] 
                         
                       
                     
                     ) 
                   
                 
               
               
                 
                   ( 
                   49 
                   ) 
                 
               
             
           
         
       
     
     gates. 
     Note that by using the above algorithm with {tilde over (H)}/2, the preparation of the purified Gibbs state will result in the state 
     
       
         
           
             
               
                 
                   
                     
                       
                         
                           
                             
                               
                                 
                                   
                                     
                                        
                                       ψ 
                                     
                                     〉 
                                   
                                   Gibbs 
                                 
                                  
                                 
                                     
                                 
                                  
                                 
                                   := 
                                 
                                  
                                 
                                     
                                 
                                  
                                 
                                   
                                     ∑ 
                                     h 
                                   
                                    
                                   
                                     
                                       e 
                                       
                                         
                                           - 
                                           
                                             E 
                                             h 
                                           
                                         
                                          
                                         
                                           / 
                                         
                                          
                                         2 
                                       
                                     
                                     
                                       Z 
                                     
                                   
                                 
                               
                                
                               h 
                             
                             〉 
                           
                           A 
                         
                          
                         
                           φ 
                           h 
                         
                       
                       〉 
                     
                     B 
                   
                   , 
                 
               
               
                 
                   ( 
                   50 
                   ) 
                 
               
             
           
         
       
     
     where |ϕ j     B  are mutually orthogonal trash states, which can typically be chosen to be |h , i.e., a copy of the first register, which is irrelevant for our computation, and |h   A  are the eigenstates of {tilde over (H)}. Tracing out the second register will hence result in the corresponding Gibbs state 
     
       
         
           
             
               
                 
                   
                     
                       σ 
                       h 
                     
                      
                     
                         
                     
                      
                     
                       := 
                     
                      
                     
                         
                     
                      
                     
                       
                         ∑ 
                         h 
                       
                        
                       
                         
                           
                             e 
                             
                               - 
                               
                                 E 
                                 h 
                               
                             
                           
                           Z 
                         
                          
                         
                            
                           h 
                           〉 
                         
                          
                         
                           
                             〈 
                             h 
                              
                           
                           A 
                         
                       
                     
                   
                   , 
                 
               
               
                 
                   ( 
                   51 
                   ) 
                 
               
             
           
         
       
     
     and hence the Hadamard test may now be used with input h k  and σ h , i.e., the operators on the hidden units and the Gibbs state, and estimate the expectation value    h  [E h,k ]. Such a method is provided below. 
     Theorem 2. 
     Under the assumptions of Lemma 1 and Theorem 1,  ∈   D  can be computed for such that for any ϵ∈(0, max{⅓, 4 max h,p |E h,p |}) such that 
     
       
         
           
             
               
                 
                   
                     
                       
                          
                         
                            
                           - 
                           
                             ∇ 
                             
                                
                               ~ 
                             
                           
                         
                          
                       
                       max 
                     
                     ≤ 
                     ϵ 
                   
                   , 
                   
                     
 
                   
                    
                   with 
                 
               
               
                 
                   ( 
                   52 
                   ) 
                 
               
             
             
               
                 
                   
                     
                        
                       ~ 
                     
                     ( 
                     
                       
                         ξ 
                       
                        
                       
                         
                           D 
                            
                           
                             
                                
                               θ 
                                
                             
                             1 
                           
                            
                           
                               
                           
                            
                           
                             dn 
                             2 
                           
                         
                         ϵ 
                       
                     
                     ) 
                   
                   , 
                 
               
               
                 
                   ( 
                   53 
                   ) 
                 
               
             
           
         
       
     
     queries to the oracle O H  and O ρ  with probability at least ⅔, where ξ:=max[N/z, N h /z h ], N=2 n , N h =2 n     h   , and z, z h  are known lower bounds on the partition functions for the Gibbs state of H and {tilde over (H)} h  respectively. 
     Proof. 
     Conceptually, the following steps are performed, starting with Gibbs state preparation followed by a Hadamard test coupled with amplitude estimation to obtain estimates of the probability of a 0 measurement. The proof follows straight from the following algorithm.
         1. One starts by preparing a Hadamard test state, i.e., let       

     
       
         
           
             
               
                 
                   
                      
                     ψ 
                     〉 
                   
                   
                     G 
                      
                     i 
                      
                     b 
                      
                     b 
                      
                     s 
                   
                 
                 : 
               
               = 
               
                 
                   Σ 
                   h 
                 
                  
                 
                   
                     e 
                     
                       
                         - 
                         
                           E 
                           h 
                         
                       
                       / 
                       2 
                     
                   
                   
                     Z 
                   
                 
                  
                 
                   
                      
                     h 
                     〉 
                   
                   A 
                 
                  
                 
                   
                      
                     
                       φ 
                       h 
                     
                     〉 
                   
                   B 
                 
               
             
             , 
           
         
       
     
     be the purified Gibbs state. Then an ancilla qubit is prepared in the |+ -state, and a controlled-h k  conditioned on the ancilla register is applied, followed by a Hadamard gate, i.e., 
       ½(|0 (|ψ   Gibbs +( h   k   ⊗I )|ψ   Gibbs )+|1 (|ψ   Gibbs −( h   k   ⊗I )|ψ   Gibbs ))  (54)
         2. Next an amplitude estimation is performed on the |0  state. Let reflector Z:=−2|0   0|+I, where I is the identity which is just the Pauli Z matrix up to a global phase, and let G:=(2|ϕ   ϕ|−I) (Z⊗I), for |ϕ  being the state after the Hadamard test, prior to the measurement. The operator G has then the eigenvalue μ ± =±e ±i2θ  where 2θ=arcsin Pr(0), and Pr(0) is the probability to measure the ancilla qubit in the |0  state. Let now T Gibbs  be the query complexity for preparing the purified Gibbs state, given in Eq. 48. It is now possible to perform phase estimation with precision e for the operator G requiring O(T Gibbs /{tilde over (ϵ)}) queries to the oracle of H.   3. Note that the above will return an {tilde over (ϵ)}-estimate of the probability of the Hadamard test to return 0, if we measure now the phase estimation register. For the outcome, note that       

     
       
         
           
             
               
                 
                   
                     
                       
                         
                           Pr 
                            
                           
                             ( 
                             0 
                             ) 
                           
                         
                         = 
                           
                          
                         
                           
                             1 
                             2 
                           
                            
                           
                             ( 
                             
                               1 
                               + 
                               
                                 Re 
                                  
                                 
                                   〈 
                                   
                                     ψ 
                                      
                                     
                                       
                                          
                                         
                                           G 
                                            
                                           i 
                                            
                                           b 
                                            
                                           b 
                                            
                                           s 
                                         
                                       
                                        
                                       
                                         
                                           ( 
                                           
                                             
                                               h 
                                               k 
                                             
                                             ⊗ 
                                             I 
                                           
                                           ) 
                                         
                                          
                                         
                                           
                                              
                                             ψ 
                                             〉 
                                           
                                           
                                             G 
                                              
                                             i 
                                              
                                             b 
                                              
                                             b 
                                              
                                             s 
                                           
                                         
                                       
                                     
                                   
                                 
                               
                             
                             ) 
                           
                         
                       
                     
                   
                   
                     
                       
                         = 
                           
                          
                         
                           
                             1 
                             2 
                           
                            
                           
                             ( 
                             
                               1 
                               + 
                               
                                 
                                   ∑ 
                                   h 
                                 
                                  
                                 
                                   
                                     
                                       e 
                                       
                                         - 
                                         
                                           E 
                                           h 
                                         
                                       
                                     
                                      
                                     
                                       E 
                                       
                                         h 
                                         , 
                                         k 
                                       
                                     
                                   
                                   Z 
                                 
                               
                             
                             ) 
                           
                         
                       
                     
                   
                   
                     
                       
                         
                           = 
                             
                            
                           
                             
                               1 
                               2 
                             
                              
                             
                               ( 
                               
                                 1 
                                 + 
                                 
                                   
                                      
                                     h 
                                   
                                    
                                   
                                     [ 
                                     
                                       E 
                                       
                                         h 
                                         , 
                                         k 
                                       
                                     
                                     ] 
                                   
                                 
                               
                               ) 
                             
                           
                         
                         , 
                       
                     
                   
                 
               
               
                 
                   ( 
                   55 
                   ) 
                 
               
             
           
         
       
         
         
           
             from which one can easily infer the estimate of    h  [E h,k ] up to precision e for all the k terms.    
           
         
       
    
     From the above it is seen that the runtime constitutes the query complexity of preparing the Gibbs state 
     
       
         
           
             
               
                 
                   
                     
                       T 
                       
                         G 
                          
                         i 
                          
                         b 
                          
                         b 
                          
                         s 
                       
                       V 
                     
                     = 
                     
                       
                          
                         ~ 
                       
                       ( 
                       
                         
                           
                             
                               2 
                               n 
                             
                             Z 
                           
                         
                          
                         
                           
                             
                                
                               
                                 H 
                                  
                                 
                                   ( 
                                   θ 
                                   ) 
                                 
                               
                                
                             
                              
                             d 
                           
                           ϵ 
                         
                          
                         
                           log 
                            
                           
                             ( 
                             
                               
                                  
                                 
                                   H 
                                    
                                   
                                     ( 
                                     θ 
                                     ) 
                                   
                                 
                                  
                               
                               
                                 ϵ 
                                 ~ 
                               
                             
                             ) 
                           
                         
                          
                         
                           log 
                            
                           
                             ( 
                             
                               1 
                               
                                 ϵ 
                                 ~ 
                               
                             
                             ) 
                           
                         
                       
                       ) 
                     
                   
                   , 
                 
               
               
                 
                   ( 
                   56 
                   ) 
                 
               
             
           
         
       
     
     where 2 n  is the dimension of the Hamiltonian, as given in Theorem 2 and combining it with the query complexity of the amplitude estimation procedure, i.e., 1/ϵ. However, in order to obtain a final error of ϵ, the error in the Gibbs state preparation must also be accounted for. For this, note that terms of the form Tr AB  [ ψ| Gibbs  (h k ⊗I)|ψ   Gibbs   V ]=Tr AB  [(h k ⊗I)|ψ   Gibbs   V   ψ| Gibbs   V ] may be estimated. The error w.r.t. the true Gibbs state σ Gibbs  is therefore be estimated as 
     
       
         
           
             
               
                 
                   
                     
                       
                         Tr 
                         AB 
                       
                        
                       
                         [ 
                         
                           
                             ( 
                             
                               
                                 h 
                                 k 
                               
                               ⊗ 
                               I 
                             
                             ) 
                           
                            
                           
                             
                                
                               ψ 
                               〉 
                             
                             Gibbs 
                             V 
                           
                            
                           
                             
                               〈 
                               ψ 
                                
                             
                             Gibbs 
                             V 
                           
                         
                         ] 
                       
                     
                     - 
                     
                       
                         Tr 
                         A 
                       
                        
                       
                         [ 
                         
                           
                             h 
                             k 
                           
                            
                           
                             σ 
                             Gibbs 
                           
                         
                         ] 
                       
                     
                   
                   = 
                   
                     
                       
                         Tr 
                         A 
                       
                        
                       
                         [ 
                         
                           
                             
                               h 
                               k 
                             
                              
                             
                               
                                 Tr 
                                 
                                   B 
                                    
                                   
                                       
                                   
                                 
                               
                                
                               
                                 [ 
                                 
                                   
                                     
                                        
                                       ψ 
                                       〉 
                                     
                                     Gibbs 
                                     V 
                                   
                                    
                                   
                                     
                                       〈 
                                       ψ 
                                        
                                     
                                     Gibbs 
                                     V 
                                   
                                 
                                 ] 
                               
                             
                           
                           - 
                           
                             
                               h 
                               k 
                             
                              
                             
                               σ 
                               Gibbs 
                             
                           
                         
                         ] 
                       
                     
                     ≤ 
                     
                       
                         ∑ 
                         i 
                       
                        
                       
                         
                           
                             σ 
                             i 
                           
                            
                           
                             ( 
                             
                               h 
                               k 
                             
                             ) 
                           
                         
                          
                         
                            
                           
                             
                               
                                 Tr 
                                 B 
                               
                                
                               
                                 [ 
                                 
                                   
                                     
                                        
                                       ψ 
                                       〉 
                                     
                                     Gibbs 
                                     V 
                                   
                                    
                                   
                                     
                                       〈 
                                       ψ 
                                        
                                     
                                     Gibbs 
                                     V 
                                   
                                 
                                 ] 
                               
                             
                             - 
                             
                               σ 
                               Gibbs 
                             
                           
                            
                         
                       
                     
                     ≤ 
                     
                       
                         ϵ 
                         ~ 
                       
                        
                       
                         
                           ∑ 
                           i 
                         
                          
                         
                           
                             
                               σ 
                               i 
                             
                              
                             
                               ( 
                               
                                 h 
                                 k 
                               
                               ) 
                             
                           
                           . 
                         
                       
                     
                   
                 
               
               
                 
                   ( 
                   57 
                   ) 
                 
               
             
           
         
       
     
     For the final error being less then ϵ, the precision used in the phase estimation procedure, it is necessary to set {acute over (ϵ)}=ϵ/(2Σ i σ i (h k ))≤2 −n−1 ϵ, reminding that h k  is unitary, and similarly precision ϵ/2 for the amplitude estimation, which yields the query complexity of 
     
       
         
           
             
               
                 
                   
                      
                     ( 
                     
                       
                         
                           
                             N 
                             h 
                           
                           
                             z 
                             h 
                           
                         
                       
                        
                       
                         
                           
                              
                             
                               H 
                                
                               
                                 ( 
                                 θ 
                                 ) 
                               
                             
                              
                           
                            
                           d 
                         
                         ϵ 
                       
                        
                       
                         ( 
                         
                           
                             n 
                             2 
                           
                           + 
                           
                             n 
                              
                             
                               log 
                                
                               
                                 ( 
                                 
                                   
                                      
                                     
                                       H 
                                        
                                       
                                         ( 
                                         θ 
                                         ) 
                                       
                                     
                                      
                                   
                                   ϵ 
                                 
                                 ) 
                               
                             
                           
                           + 
                           
                             n 
                              
                             
                                 
                             
                              
                             
                               log 
                                
                               
                                 ( 
                                 
                                   1 
                                   ϵ 
                                 
                                 ) 
                               
                             
                           
                           + 
                           
                             
                               log 
                                
                               
                                 ( 
                                 
                                   
                                      
                                     
                                       H 
                                        
                                       
                                         ( 
                                         θ 
                                         ) 
                                       
                                     
                                      
                                   
                                   ϵ 
                                 
                                 ) 
                               
                             
                              
                             
                               log 
                                
                               
                                 ( 
                                 
                                   1 
                                   ϵ 
                                 
                                 ) 
                               
                             
                           
                         
                         ) 
                       
                     
                     ) 
                   
                   , 
                   
                     
 
                   
                    
                   
                       
                   
                    
                   
                     ∈ 
                     
                       
                         
                           O 
                           ~ 
                         
                          
                         
                           ( 
                           
                             
                               
                                 
                                   N 
                                   h 
                                 
                                 
                                   z 
                                   h 
                                 
                               
                             
                              
                             
                               ( 
                               
                                 
                                   
                                     n 
                                     2 
                                   
                                    
                                   
                                     
                                        
                                       
                                         H 
                                          
                                         
                                           ( 
                                           θ 
                                           ) 
                                         
                                       
                                        
                                     
                                     1 
                                   
                                    
                                   d 
                                 
                                 ϵ 
                               
                               ) 
                             
                           
                           ) 
                         
                       
                       . 
                     
                   
                 
               
               
                 
                   ( 
                   58 
                   ) 
                 
               
             
           
         
       
     
     where one denotes with A the hidden subsystem with dimensionality 2 n     h   ≤2 N , on which the Gibbs state is prepared, and with B, the subsystem for the trash state. 
     Similarly, the evaluation of the second part in Eq. 45 requires the Gibbs state preparation for H, the Hadamard test, and phase estimation. Similar to the above it is necessary to take the error into account. Letting the purified version of the Gibbs state for H be given by |ψ   Gibbs , which is obtained using Theorem 1, and letting σ Gibbs  be the perfect state, then the error is given by 
     
       
         
           
             
               
                 
                   
                     
                       
                         
                           Tr 
                           AB 
                         
                          
                         
                           [ 
                           
                             
                               ( 
                               
                                 
                                   v 
                                   k 
                                 
                                 ⊗ 
                                 
                                   h 
                                   k 
                                 
                                 ⊗ 
                                 I 
                               
                               ) 
                             
                              
                             
                               
                                  
                                 ψ 
                                 〉 
                               
                               Gibbs 
                             
                              
                             
                               
                                 〈 
                                 ψ 
                                  
                               
                               Gibbs 
                             
                           
                           ] 
                         
                       
                       - 
                       
                         
                           Tr 
                           A 
                         
                          
                         
                           [ 
                           
                             
                               ( 
                               
                                 
                                   v 
                                   k 
                                 
                                 ⊗ 
                                 
                                   h 
                                   k 
                                 
                               
                               ) 
                             
                              
                             
                               σ 
                               Gibbs 
                             
                           
                           ] 
                         
                       
                     
                     = 
                     
                       
                         
                           Tr 
                           A 
                         
                         [ 
                         
                           
                             
                               ( 
                               
                                 
                                   v 
                                   k 
                                 
                                 ⊗ 
                                 
                                   h 
                                   k 
                                 
                               
                               ) 
                             
                              
                             
                               
                                 Tr 
                                 B 
                               
                               [ 
                               
                                 
                                   
                                      
                                     ψ 
                                     〉 
                                   
                                   Gibbs 
                                   V 
                                 
                                  
                                 
                                   
                                     〈 
                                     ψ 
                                      
                                   
                                   gibbs 
                                   V 
                                 
                               
                               ] 
                             
                           
                           - 
                           
                             
                               ( 
                               
                                 
                                   v 
                                   k 
                                 
                                 ⊗ 
                                 
                                   h 
                                   k 
                                 
                               
                               ) 
                             
                              
                             
                               σ 
                               Gibbs 
                             
                           
                         
                         ] 
                       
                       ≤ 
                       
                         
                           ∑ 
                           i 
                         
                          
                         
                           
                             
                               σ 
                               i 
                             
                              
                             
                               ( 
                               
                                 
                                   v 
                                   k 
                                 
                                 ⊗ 
                                 
                                   h 
                                   k 
                                 
                               
                               ) 
                             
                           
                            
                           
                              
                             
                               
                                 
                                   Tr 
                                   B 
                                 
                                  
                                 
                                   [ 
                                   
                                     
                                       
                                          
                                         ψ 
                                         〉 
                                       
                                       Gibbs 
                                       V 
                                     
                                      
                                     
                                       
                                         〈 
                                         ψ 
                                          
                                       
                                       Gibbs 
                                       V 
                                     
                                   
                                   ] 
                                 
                               
                               - 
                               
                                 
                                   h 
                                   k 
                                 
                                  
                                 
                                   σ 
                                   Gibbs 
                                 
                               
                             
                              
                           
                         
                       
                       ≤ 
                       
                         
                           ϵ 
                           ~ 
                         
                          
                         
                           
                             ∑ 
                             i 
                           
                            
                           
                             
                               σ 
                               i 
                             
                              
                             
                               ( 
                               
                                 
                                   v 
                                   k 
                                 
                                 ⊗ 
                                 
                                   h 
                                   k 
                                 
                               
                               ) 
                             
                           
                         
                       
                     
                   
                   , 
                 
               
               
                 
                   ( 
                   59 
                   ) 
                 
               
             
           
         
       
     
     where in this case A is the subsystem of the visible and hidden subspace and B the trash system. The upper bound on the error is set as above and introducing ξ:=max[N/z, N h /z h ], one can find that a uniform bound on the query complexity for evaluating 
     
       
         
           
             
               
                 
                   
                     
                       O 
                       ~ 
                     
                     ( 
                     
                       
                         ζ 
                       
                        
                       
                         ( 
                         
                           
                             
                               n 
                               2 
                             
                              
                             
                               
                                  
                                 
                                   H 
                                    
                                   
                                     ( 
                                     θ 
                                     ) 
                                   
                                 
                                  
                               
                               1 
                             
                              
                             d 
                           
                           ϵ 
                         
                         ) 
                       
                     
                     ) 
                   
                   , 
                 
               
               
                 
                   ( 
                   60 
                   ) 
                 
               
             
           
         
       
     
     thus one attains the claimed query complexity by repeating the above procedure for each of the D components of the estimated gradient vector S. 
     Note that it is also necessary to evaluate the terms Tr [ρv k ] to precision {circumflex over (ϵ)}≤ϵ, which though only incurs an additive cost of D/ϵ to the total query complexity, since this step is required to be performed once. Note that |   h (h p )|≤1 because h p  is assumed to be unitary. To complete the proof it is necessary only to take the success probability of the amplitude estimation process into account. For completeness, the algorithm is stated in the Appendix and herein only Theorem 5 is referred to, from which it follows that the procedure succeeds with probability at least 8/π 2 . In order to have a failure probability of the final algorithm of less than ⅓, it is necessary to repeat the procedure for all d dimensions of the gradient and to take the median. The number of repetitions may now be bounded in the following way. 
     Let n ƒ  be the number of instances of the gradient estimate such that the error is larger than ϵ, and let n s  be the number of instances with an error ≤ϵ for one dimension of the gradient, and let the result taken be the median of the estimates, where n=n s +n ƒ  samples are collected. The algorithm gives a wrong answer for each dimension if 
     
       
         
           
             
               
                 n 
                 s 
               
               ≤ 
               
                 ⌊ 
                 
                   n 
                   2 
                 
                 ⌋ 
               
             
             , 
           
         
       
     
     since then the median is a sample such that the error is not bound by ϵ. Let p=8/π 2  be the success probability to draw a positive sample, as is the case of the amplitude estimation procedure. Since each instance of the phase estimation algorithm will independently return an estimate, the total failure probability is given by the union bound, i.e., 
     
       
         
           
             
               
                 
                   
                     
                       P 
                        
                       
                         r 
                         
                           f 
                            
                           a 
                            
                           i 
                            
                           l 
                         
                       
                     
                     ≤ 
                     
                       D 
                       · 
                       
                         Pr 
                          
                         
                           [ 
                           
                             
                               n 
                               s 
                             
                             ≤ 
                             
                               ⌊ 
                               
                                 n 
                                 2 
                               
                               ⌋ 
                             
                           
                           ] 
                         
                       
                     
                     ≤ 
                     
                       D 
                       · 
                       
                         q 
                         
                           
                             - 
                             
                               n 
                               
                                 2 
                                  
                                 p 
                               
                             
                           
                            
                           
                             
                               ( 
                               
                                 p 
                                 - 
                                 
                                   1 
                                   2 
                                 
                               
                               ) 
                             
                             2 
                           
                         
                       
                     
                     ≤ 
                     
                       1 
                       3 
                     
                   
                   , 
                 
               
               
                 
                   ( 
                   61 
                   ) 
                 
               
             
           
         
       
     
     which follows from the Chernoff inequality for a binomial variable with p&gt;½, which is given in the present case. Therefore, by taking 
     
       
         
           
             
               
                 n 
                 ≥ 
                 
                   
                     
                       2 
                        
                       p 
                     
                     
                       
                         ( 
                         
                           p 
                           - 
                           
                             1 
                             / 
                             2 
                           
                         
                         ) 
                       
                       2 
                     
                   
                    
                   
                     log 
                      
                     
                       ( 
                       
                         3 
                          
                         D 
                       
                       ) 
                     
                   
                 
               
               = 
               
                 
                   
                     
                       1 
                        
                       6 
                     
                     
                       
                         ( 
                         
                           8 
                           - 
                           
                             
                               π 
                               2 
                             
                             / 
                             2 
                           
                         
                         ) 
                       
                       2 
                     
                   
                    
                   
                     log 
                      
                     
                       ( 
                       
                         3 
                          
                         D 
                       
                       ) 
                     
                   
                 
                 = 
                 
                   O 
                    
                   
                     ( 
                     
                       log 
                        
                       
                         ( 
                         
                           3 
                            
                           D 
                         
                         ) 
                       
                     
                     ) 
                   
                 
               
             
             , 
           
         
       
     
     a total failure probability of at most ⅓ is achieved. This is sufficient to demonstrate the validity of the algorithm if 
       Tr[ρ {tilde over (H)}   h ]  (62)
 
     is known exactly. This is difficult to do because the probability distribution α h  is not usually known apriori. As a result, it is assumed that the distribution will be learned empirically and to do so it is necessary to draw samples from the purified Gibbs states used as input. This sampling procedure will incur errors. To take such errors into account, assume that it is possible to obtain estimates T h  of Eq. 62 with precision δ t , i.e., 
       | T   h −Tr[ρ {tilde over (H)}   h ]≤δ t .  (63)
 
     Under this assumption, it is now possible to bound the distance |αh−{tilde over (α)} h | in the following way. Observe that 
     
       
         
           
             
               
                 
                   
                     
                       | 
                       
                         
                           α 
                           h 
                         
                         - 
                         
                           
                             α 
                             ~ 
                           
                           h 
                         
                       
                       | 
                     
                     = 
                     
                       
                          
                         
                           
                             
                               e 
                               
                                 
                                   - 
                                   T 
                                 
                                  
                                 
                                   r 
                                    
                                   
                                     [ 
                                     
                                       ρ 
                                        
                                       
                                         
                                           H 
                                           ~ 
                                         
                                         h 
                                       
                                     
                                     ] 
                                   
                                 
                               
                             
                             
                               
                                 Σ 
                                 h 
                               
                                
                               
                                 e 
                                 
                                   - 
                                   
                                     Tr 
                                      
                                     
                                       [ 
                                       
                                         ρ 
                                          
                                         
                                             
                                         
                                          
                                         
                                           
                                             H 
                                             ~ 
                                           
                                           h 
                                         
                                       
                                       ] 
                                     
                                   
                                 
                               
                             
                           
                           - 
                           
                             
                               T 
                               h 
                             
                             
                               
                                 Σ 
                                 h 
                               
                                
                               
                                 T 
                                 h 
                               
                             
                           
                         
                          
                       
                       ≤ 
                       
                         
                            
                           
                             
                               
                                 e 
                                 
                                   
                                     - 
                                     T 
                                   
                                    
                                   
                                     r 
                                      
                                     
                                       [ 
                                       
                                         ρ 
                                          
                                         
                                             
                                         
                                          
                                         
                                           
                                             H 
                                             ~ 
                                           
                                           h 
                                         
                                       
                                       ] 
                                     
                                   
                                 
                               
                               
                                 
                                   Σ 
                                   h 
                                 
                                  
                                 
                                   e 
                                   
                                     
                                       - 
                                       T 
                                     
                                      
                                     
                                       r 
                                        
                                       
                                         [ 
                                         
                                           ρ 
                                            
                                           
                                             
                                               H 
                                               ~ 
                                             
                                             h 
                                           
                                         
                                         ] 
                                       
                                     
                                   
                                 
                               
                             
                             - 
                             
                               
                                 T 
                                 h 
                               
                               
                                 
                                   Σ 
                                   h 
                                 
                                  
                                 
                                   e 
                                   
                                     
                                       - 
                                       T 
                                     
                                      
                                     
                                       r 
                                        
                                       
                                         [ 
                                         
                                           ρ 
                                            
                                           
                                             
                                               H 
                                               ~ 
                                             
                                             h 
                                           
                                         
                                         ] 
                                       
                                     
                                   
                                 
                               
                             
                           
                            
                         
                         + 
                         
                            
                           
                             
                               
                                 T 
                                 h 
                               
                               
                                 
                                   Σ 
                                   h 
                                 
                                  
                                 
                                   e 
                                   
                                     
                                       - 
                                       T 
                                     
                                      
                                     
                                       r 
                                        
                                       
                                         [ 
                                         
                                           ρ 
                                            
                                           
                                             
                                               H 
                                               ~ 
                                             
                                             h 
                                           
                                         
                                         ] 
                                       
                                     
                                   
                                 
                               
                             
                             - 
                             
                               
                                 T 
                                 h 
                               
                               
                                 
                                   Σ 
                                   h 
                                 
                                  
                                 
                                   T 
                                   h 
                                 
                               
                             
                           
                            
                         
                       
                     
                   
                   , 
                 
               
               
                 
                   ( 
                   64 
                   ) 
                 
               
             
           
         
       
     
     and hence it is necessary to bound the following two quantities in order to bound the error. First, a bound is required on 
         e   −Tr[ρ{tilde over (H)}     h     ]   −e   −T     h   |.  (65)
 
     For this, let ƒ(s):=T h (1−s)+Tr [ρ{tilde over (H)} h ] s, such that Eq. 65 can be rewritten as 
     
       
         
           
             
               
                 
                   
                     
                       
                         
                            
                           
                             
                               e 
                               
                                 - 
                                 
                                   f 
                                    
                                   
                                     ( 
                                     1 
                                     ) 
                                   
                                 
                               
                             
                             - 
                             
                               e 
                               
                                 - 
                                 
                                   f 
                                    
                                   
                                     ( 
                                     0 
                                     ) 
                                   
                                 
                               
                             
                           
                            
                         
                         = 
                           
                          
                         
                            
                           
                             
                               ∫ 
                               0 
                               1 
                             
                              
                             
                               
                                 d 
                                 
                                   d 
                                    
                                   s 
                                 
                               
                                
                               
                                 e 
                                 
                                   - 
                                   
                                     f 
                                      
                                     
                                       ( 
                                       s 
                                       ) 
                                     
                                   
                                 
                               
                                
                               ds 
                             
                           
                            
                         
                       
                     
                   
                   
                     
                       
                         = 
                           
                          
                         
                            
                           
                             
                               ∫ 
                               0 
                               1 
                             
                              
                             
                               
                                 
                                   f 
                                   . 
                                 
                                  
                                 
                                   ( 
                                   s 
                                   ) 
                                 
                               
                                
                               
                                 e 
                                 
                                   - 
                                   
                                     f 
                                      
                                     
                                       ( 
                                       s 
                                       ) 
                                     
                                   
                                 
                               
                                
                               ds 
                             
                           
                            
                         
                       
                     
                   
                   
                     
                       
                         = 
                           
                          
                         
                            
                           
                             
                               ∫ 
                               0 
                               1 
                             
                              
                             
                               
                                 ( 
                                 
                                   
                                     T 
                                      
                                     
                                       r 
                                        
                                       
                                         [ 
                                         
                                           ρ 
                                            
                                           
                                             
                                               H 
                                               ~ 
                                             
                                             h 
                                           
                                         
                                         ] 
                                       
                                     
                                   
                                   - 
                                   
                                     T 
                                     h 
                                   
                                 
                                 ) 
                               
                                
                               
                                 e 
                                 
                                   - 
                                   
                                     f 
                                      
                                     
                                       ( 
                                       s 
                                       ) 
                                     
                                   
                                 
                               
                                
                               ds 
                             
                           
                            
                         
                       
                     
                   
                   
                     
                       
                         ≤ 
                           
                          
                         
                           δ 
                            
                           
                             e 
                             
                               
                                 - 
                                 m 
                               
                                
                               
                                   
                               
                                
                               i 
                                
                               
                                   
                               
                                
                               
                                 n 
                                 s 
                               
                                
                               
                                 f 
                                  
                                 
                                   ( 
                                   s 
                                   ) 
                                 
                               
                             
                           
                         
                       
                     
                   
                   
                     
                       
                         ≤ 
                           
                          
                         
                           δ 
                            
                           
                             e 
                             
                               
                                 
                                   - 
                                   T 
                                 
                                  
                                 
                                   r 
                                    
                                   
                                     [ 
                                     
                                       ρ 
                                        
                                       
                                         H 
                                         h 
                                       
                                     
                                     ] 
                                   
                                 
                               
                               + 
                               δ 
                             
                           
                         
                       
                     
                   
                 
               
               
                 
                   ( 
                   66 
                   ) 
                 
               
             
           
         
       
     
     and assuming δ≤log(2), this reduces to 
       | e   −ƒ(1)   −e   −ƒ(0) |≤2δ e   −Tr[ρ{tilde over (H)}     h     ] .  (67)
 
     Second, 
     
       
         
           
             
               
                 
                   
                      
                     
                       
                         
                           ∑ 
                           h 
                         
                          
                         
                           e 
                           
                             
                               - 
                               T 
                             
                              
                             
                               r 
                                
                               
                                 [ 
                                 
                                   ρ 
                                    
                                   
                                     
                                       H 
                                       ~ 
                                     
                                     h 
                                   
                                 
                                 ] 
                               
                             
                           
                         
                       
                       - 
                       
                         
                           ∑ 
                           h 
                         
                          
                         
                           T 
                           h 
                         
                       
                     
                      
                   
                   ≤ 
                   
                     2 
                      
                     δ 
                      
                     
                       
                         ∑ 
                         h 
                       
                        
                       
                         
                           e 
                           
                             
                               - 
                               T 
                             
                              
                             
                               r 
                                
                               
                                 [ 
                                 
                                   ρ 
                                    
                                   
                                     
                                       H 
                                       ~ 
                                     
                                     h 
                                   
                                 
                                 ] 
                               
                             
                           
                         
                         . 
                       
                     
                   
                 
               
               
                 
                   ( 
                   68 
                   ) 
                 
               
             
           
         
       
     
     Using this, Eq. 64 can be bounded above by 
     
       
         
           
             
               
                 
                   
                     
                       
                         
                           2 
                            
                           δ 
                            
                           
                               
                           
                            
                           
                             e 
                             
                               - 
                               
                                 Tr 
                                  
                                 
                                   [ 
                                   
                                     ρ 
                                      
                                     
                                         
                                     
                                      
                                     
                                       
                                         H 
                                         ~ 
                                       
                                       h 
                                     
                                   
                                   ] 
                                 
                               
                             
                           
                         
                         
                           
                             ∑ 
                             h 
                           
                            
                           
                             e 
                             
                               - 
                               
                                 Tr 
                                  
                                 
                                   [ 
                                   
                                     ρ 
                                      
                                     
                                         
                                     
                                      
                                     
                                       
                                         H 
                                         ~ 
                                       
                                       h 
                                     
                                   
                                   ] 
                                 
                               
                             
                           
                         
                       
                       + 
                       
                         
                            
                           
                             T 
                             h 
                           
                            
                         
                          
                         
                            
                           
                             
                               1 
                               
                                 
                                   ∑ 
                                   h 
                                 
                                  
                                 
                                   e 
                                   
                                     - 
                                     
                                       Tr 
                                        
                                       
                                         [ 
                                         
                                           ρ 
                                            
                                           
                                               
                                           
                                            
                                           
                                             
                                               H 
                                               ~ 
                                             
                                             h 
                                           
                                         
                                         ] 
                                       
                                     
                                   
                                 
                               
                             
                             - 
                             
                               1 
                               
                                 
                                   ( 
                                   
                                     1 
                                     - 
                                     
                                       2 
                                        
                                       δ 
                                     
                                   
                                   ) 
                                 
                                  
                                 
                                   
                                     ∑ 
                                     h 
                                   
                                    
                                   
                                     e 
                                     
                                       - 
                                       
                                         Tr 
                                          
                                         
                                           [ 
                                           
                                             ρ 
                                              
                                             
                                                 
                                             
                                              
                                             
                                               
                                                 H 
                                                 ~ 
                                               
                                               h 
                                             
                                           
                                           ] 
                                         
                                       
                                     
                                   
                                 
                               
                             
                           
                            
                         
                       
                     
                     ≤ 
                     
                       
                         
                           2 
                            
                           δ 
                            
                           
                               
                           
                            
                           
                             e 
                             
                               - 
                               
                                 Tr 
                                  
                                 
                                   [ 
                                   
                                     ρ 
                                      
                                     
                                         
                                     
                                      
                                     
                                       
                                         H 
                                         ~ 
                                       
                                       n 
                                     
                                   
                                   ] 
                                 
                               
                             
                           
                         
                         
                           
                             ∑ 
                             h 
                           
                            
                           
                             e 
                             
                               - 
                               
                                 Tr 
                                  
                                 
                                   [ 
                                   
                                     ρ 
                                      
                                     
                                         
                                     
                                      
                                     
                                       
                                         H 
                                         ~ 
                                       
                                       h 
                                     
                                   
                                   ] 
                                 
                               
                             
                           
                         
                       
                       + 
                       
                         
                           4 
                            
                           δ 
                            
                           
                              
                             
                               T 
                               h 
                             
                              
                           
                         
                         
                           
                             ∑ 
                             h 
                           
                            
                           
                             e 
                             
                               - 
                               
                                 Tr 
                                  
                                 
                                   [ 
                                   
                                     ρ 
                                      
                                     
                                         
                                     
                                      
                                     
                                       
                                         H 
                                         ~ 
                                       
                                       h 
                                     
                                   
                                   ] 
                                 
                               
                             
                           
                         
                       
                     
                   
                   , 
                 
               
               
                 
                   ( 
                   69 
                   ) 
                 
               
             
           
         
       
     
     where δ≤¼ is applied. Note that 
       4ϵ| T   h |≤4δ( e   −Tr[ρ{tilde over (H)}     h     ] +2δ e   −Tr[ρ{tilde over (H)}     h     ] )= e   −Tr[ρ{tilde over (H)}     h     ] (4δ+8δ 2 )≤ e   −Tr[ρ{tilde over (H)}     h     ] (4δ+2δ)≤6δ e   −Tr[ρ{tilde over (H)}     H     ] ,  (70)
 
     which leads to a final error of 
     
       
         
           
             
               
                 
                   
                      
                     
                       
                         α 
                         h 
                       
                       - 
                       
                         
                           α 
                           ~ 
                         
                         h 
                       
                     
                      
                   
                   ≤ 
                   
                     8 
                      
                     δ 
                      
                     
                       
                         
                           e 
                           
                             
                               - 
                               T 
                             
                              
                             
                               r 
                                
                               
                                 [ 
                                 
                                   ρ 
                                    
                                   
                                       
                                   
                                    
                                   
                                     
                                       H 
                                       ~ 
                                     
                                     h 
                                   
                                 
                                 ] 
                               
                             
                           
                         
                         
                           
                             Σ 
                             h 
                           
                            
                           
                             e 
                             
                               
                                 - 
                                 T 
                               
                                
                               
                                 r 
                                  
                                 
                                   [ 
                                   
                                     ρ 
                                      
                                     
                                         
                                     
                                      
                                     
                                       
                                         H 
                                         ~ 
                                       
                                       h 
                                     
                                   
                                   ] 
                                 
                               
                             
                           
                         
                       
                       . 
                     
                   
                 
               
               
                 
                   ( 
                   71 
                   ) 
                 
               
             
           
         
       
     
     With this it is now possible to bound the error in the expectation w.r.t. the faulty distribution for some function ƒ(h) to be 
     
       
         
           
             
               
                 
                   
                      
                     
                       
                         
                            
                           h 
                         
                          
                         
                           ( 
                           
                             f 
                              
                             
                               ( 
                               h 
                               ) 
                             
                           
                           ) 
                         
                       
                       - 
                       
                         
                           
                              
                             ~ 
                           
                           h 
                         
                          
                         
                           ( 
                           
                             f 
                              
                             
                               ( 
                               h 
                               ) 
                             
                           
                           ) 
                         
                       
                     
                      
                   
                   ≤ 
                   
                     8 
                      
                     δ 
                      
                     
                       
                         ∑ 
                         h 
                       
                        
                       
                         
                           
                             f 
                              
                             
                               ( 
                               h 
                               ) 
                             
                           
                            
                           
                             e 
                             
                               
                                 - 
                                 T 
                               
                                
                               
                                 r 
                                  
                                 
                                   [ 
                                   
                                     ρ 
                                      
                                     
                                       
                                         H 
                                         ~ 
                                       
                                       h 
                                     
                                   
                                   ] 
                                 
                               
                             
                           
                         
                         
                           
                             Σ 
                             h 
                           
                            
                           
                             e 
                             
                               
                                 - 
                                 T 
                               
                                
                               
                                 r 
                                  
                                 
                                   [ 
                                   
                                     ρ 
                                      
                                     
                                       
                                         H 
                                         ~ 
                                       
                                       h 
                                     
                                   
                                   ] 
                                 
                               
                             
                           
                         
                       
                     
                   
                   ≤ 
                   
                     8 
                      
                     
                       δmax 
                       h 
                     
                      
                     
                       
                         f 
                          
                         
                           ( 
                           h 
                           ) 
                         
                       
                       . 
                     
                   
                 
               
               
                 
                   ( 
                   72 
                   ) 
                 
               
             
           
         
       
     
     This can now be used in order to estimate the error introduced in the first term of Eq. 45 through errors in the distribution {α h } as 
     
       
         
           
             
               
                 
                   
                     
                        
                       
                         
                           
                             
                                
                               h 
                             
                              
                             
                               [ 
                               
                                 E 
                                 
                                   h 
                                    
                                   p 
                                 
                               
                               ] 
                             
                           
                            
                           T 
                            
                           
                             r 
                              
                             
                               [ 
                               
                                 ρ 
                                  
                                 
                                   v 
                                   p 
                                 
                               
                               ] 
                             
                           
                         
                         - 
                         
                           
                              
                             ~ 
                           
                            
                           
                             [ 
                             
                               
                                 E 
                                 
                                   h 
                                    
                                   p 
                                 
                               
                                
                               T 
                                
                               
                                 r 
                                  
                                 
                                   [ 
                                   
                                     ρ 
                                      
                                     
                                       v 
                                       p 
                                     
                                   
                                   ] 
                                 
                               
                             
                             ] 
                           
                         
                       
                        
                     
                     ≤ 
                     
                       8 
                        
                       
                         δmax 
                         h 
                       
                        
                       
                          
                         
                           
                             E 
                             
                               h 
                                
                               p 
                             
                           
                            
                           T 
                            
                           
                             r 
                              
                             
                               [ 
                               
                                 ρ 
                                  
                                 
                                   v 
                                   p 
                                 
                               
                               ] 
                             
                           
                         
                          
                       
                     
                     ≤ 
                     
                       8 
                        
                       δ 
                        
                       
                         
                           max 
                           
                             h 
                             , 
                             p 
                           
                         
                          
                         
                            
                           
                             E 
                             
                               h 
                                
                               p 
                             
                           
                            
                         
                       
                     
                   
                   , 
                 
               
               
                 
                   ( 
                   73 
                   ) 
                 
               
             
           
         
       
     
     where in the last step the unitarity of v k  and the Von-Neumann trace inequality was used. For an final error of ϵ, δ t =ϵ/[16 max h,p |E h,p ] is therefore chosen, to ensure that this sampling error incurrs at most half the error budget of ϵ. Thus it is ensured that δ≤¼ if ϵ≤4 max h,p |E h,p |. 
     It is possible to improve the query complexity of estimating the above expectation by values by using amplitude amplification, since one obtains the measurement via a Hadamard test. For this case only O(max h,p |E h,p |/ϵ) samples are required in order to achieve the desired accuracy from the sampling. Noting that it may not be possible to even access {tilde over (H)} h  without any error, it is deduced that the error of the individual terms of {tilde over (H)} h  for an ϵ-error in the final estimate must be bounded by δ t v∥θ∥ 1 , where with abuse of notation, δ t  now denotes the error in the estimates of E h,k . Even taking that into account, the evaluation of this contribution is dominated by the second term, and hence can be neglected in the analysis. 
     Theorem 2 shows that the computational complexity of estimating the gradient grows the closer one approaches a pure state, since for a pure state the inverse temperature β→∞, and therefore the norm ∥H(θ)∥→∞, as the Hamiltonian is depending on the parameters, and hence the type of state described. In such cases one typically would rely on alternative techniques. However, this cannot be generically improved because otherwise it would be possible to find minimum energy configurations using a number of queries in o(√{square root over (N)}), which would violate lower bounds for Grover&#39;s search. Therefore more precise statements of the complexity will require further restrictions on the classes of problem Hamiltonians to avoid lower bounds imposed by Grover&#39;s search and similar algorithms. 
     Returning again to the drawings,  FIGS. 6A and 6B  illustrate an example method  60 A to estimate the gradient of the quantum relative entropy of a restricted QBM having visible and hidden nodes. In a restricted QBM, the Hamiltonian terms acting on the hidden units mutually commute by definition herein. As evident from Eq. 45, the estimated gradient may be computed as a difference of two terms, the first term relating to the training distribution and the second term relating to the quantum state of the visible nodes. Accordingly,  FIG. 6A  illustrates aspects of method  60 A related to computation of the first term, while  FIG. 6B  illustrates aspects of method  60 A related to computation of the second term. Method  60 A may be employed as a particular instance of step  60  in the training method of  FIG. 5 . Each step of this method is developed in detail in the description above; accordingly, the present description provides only summary detail to enable the reader to understand the process flow in one non-limiting example. 
     In method  60 A, estimation of the gradient of the quantum relative entropy of a QBM includes computing a variational upper bound on the quantum relative entropy, according to the following algorithm. Beginning in  FIG. 6A , at  70  of method  60 A, the trace Tr [ρv k ] computed for all k∈D is passed to a Gibbs-state preparation method (vide supra). At  72 , biases θ k  and operator h k  are also passed to the Gibbs-state preparation method. At  74  the Gibbs-state preparation method is executed, resulting in population of the plurality of qubits of the quantum computer with a purified Gibbs state for Hamiltonians H h . In this method, estimating the gradient includes using substantially commuting operators (i.e., having a commutator which is small or negligible in comparison to each operator) to assign an energy penalty to each qubit corresponding to a hidden node of the QBM. 
     At  76  of method  60 A, a control loop is encountered wherein an ancilla qubit is prepared in the state |+ =|0 +|1 . At  78  a controlled h k  operation is performed, using the ancilla qubit prepared at  76  as a control. At  82  a Hadamard gate is applied to the ancilla qubit. Then, at  84 , the amplitude of the ancilla qubit state is estimated on the  10 ) state. At this point in the method, the confidence analysis described above is applied in order to determine whether additional measurements are required to achieve precision ϵ. If so, execution returns to  76 . Otherwise, the product &lt;E h,p &gt; h  Tr [ρv k ] of the expectation value and the trace is evaluated and returned. 
     Turning now to  FIG. 6B , at  90  of method  60 A, the visible state v k  is passed to the Gibbs-state preparation method. At  92 , biases θ k  and operator h k  are also passed to the Gibbs-state preparation method. At  94  the Gibbs-state preparation method is executed, thereby populating the plurality of qubits of the quantum computer with a purified Gibbs state for Hamiltonian H. 
     At  96  of method  60 A, a control loop is encountered wherein an ancilla qubit is prepared in the state |+ =|0 +|1 . At  100 , a controlled v k ⊗h k  operation is applied, using the ancilla qubit as a control, prior to application at  102  of a Hadamard gate on the ancilla qubit. Then, at  104 , the amplitude of the ancilla qubit state is estimated on the |0  state. At this point in the method, the confidence analysis described above is applied in order to determine whether additional measurements are required to achieve precision ϵ. If so, execution returns to  96 . Otherwise, the resulting expectation value is evaluated and returned. 
     Approach 2: Training with Higher Order Divided Differences and Function Approximations 
     This section describes a scheme to train a QBM using divided difference estimates for the relative entropy error and to generate differentiation formulas by differentiating and interpolating. First an interpolating polynomial is constructed from the data. Second, an approximation of the derivative at any point can be obtained by a direct differentiation of the interpolant. In the following it is assumed that it will be possible to simulate and evaluate Tr [ρ log σ v ]. As this is generally non-trivial, and the error is typically large, in the next section is proposed a different, more specialised approach that, however, still allows training of arbitrary models with the relative entropy objective. 
     In order to proof the error of the gradient estimation via interpolation, it is necessary to first establish error bounds on the interpolating polynomial which can be obtained via the remainder of the Lagrange interpolation polynomial. The gradient error for the objective can then be obtained by as a combination of this error with a bound on the n+1-st order derivative of the objective. The first step is to bound the error in the polynomial approximation. 
     Lemma 2. 
     Let ƒ(θ) be the n+1 times differentiable function for which we want to approximate the gradient and let p n (θ) be the degree n Lagrange interpolation polynomial for points {θ 1 , θ 2 , . . . , θ k , . . . , θ n }. The gradient evaluated at point θ k  is then given by the interpolation polynomial 
     
       
         
           
             
               
                 
                   
                     
                       
                         ∂ 
                         
                           p 
                            
                           
                             ( 
                             
                               θ 
                               k 
                             
                             ) 
                           
                         
                       
                       
                         ∂ 
                         θ 
                       
                     
                     = 
                     
                       
                         ∑ 
                         
                           j 
                           = 
                           0 
                         
                         n 
                       
                        
                       
                         
                           f 
                            
                           
                             ( 
                             
                               θ 
                               j 
                             
                             ) 
                           
                         
                          
                         
                           
                             ℒ 
                             
                               n 
                               , 
                               j 
                             
                             ′ 
                           
                            
                           
                             ( 
                             
                               θ 
                               k 
                             
                             ) 
                           
                         
                       
                     
                   
                   , 
                 
               
               
                 
                   ( 
                   74 
                   ) 
                 
               
             
           
         
       
     
     where    n,j ′ is the derivative of the Lagrange interpolation polynomials 
     
       
         
           
             
               
                 
                   
                     
                       
                         ℒ 
                         
                           μ 
                           , 
                           j 
                         
                       
                        
                       
                         ( 
                         θ 
                         ) 
                       
                     
                     := 
                     
                       
                         ∏ 
                         
                           
                             k 
                             = 
                             0 
                           
                           
                             k 
                             ≠ 
                             j 
                           
                         
                         μ 
                       
                        
                       
                         
                           θ 
                           - 
                           
                             θ 
                             k 
                           
                         
                         
                           
                             θ 
                             j 
                           
                           - 
                           
                             θ 
                             k 
                           
                         
                       
                     
                   
                   , 
                 
               
               
                 
                     
                 
               
             
           
         
       
     
     and the error is given by 
     
       
         
           
             
               
                 
                   
                     
                        
                       
                         
                           
                             ∂ 
                             
                               f 
                                
                               
                                 ( 
                                 
                                   θ 
                                   k 
                                 
                                 ) 
                               
                             
                           
                           
                             ∂ 
                             θ 
                           
                         
                         - 
                         
                           
                             ∂ 
                             
                               
                                 p 
                                 n 
                               
                                
                               
                                 ( 
                                 
                                   θ 
                                   k 
                                 
                                 ) 
                               
                             
                           
                           
                             ∂ 
                             θ 
                           
                         
                       
                        
                     
                     ≤ 
                     
                       
                         1 
                         
                           
                             ( 
                             
                               n 
                               + 
                               1 
                             
                             ) 
                           
                           ! 
                         
                       
                        
                       
                          
                         
                           
                             
                               f 
                               
                                 ( 
                                 
                                   n 
                                   + 
                                   1 
                                 
                                 ) 
                               
                             
                              
                             
                               ( 
                               
                                 ξ 
                                  
                                 
                                   ( 
                                   
                                     θ 
                                     k 
                                   
                                   ) 
                                 
                               
                               ) 
                             
                           
                            
                           
                             
                               ∏ 
                               
                                 
                                   j 
                                   = 
                                   0 
                                 
                                 
                                   j 
                                   ≠ 
                                   k 
                                 
                               
                               n 
                             
                              
                             
                               ( 
                               
                                 
                                   θ 
                                   j 
                                 
                                 - 
                                 
                                   θ 
                                   k 
                                 
                               
                               ) 
                             
                           
                         
                          
                       
                     
                   
                   , 
                 
               
               
                 
                   ( 
                   75 
                   ) 
                 
               
             
           
         
       
     
     where ξ(θ k ) is a constant depending on the point θ k  at which the gradient is evaluated, and where ƒ (i)  denotes the i-th derivative of ƒ. Note that θ is a point within the set of points at which evaluation is attempted. 
     Proof. 
     Recall that the error for the degree n Lagrange interpolation polynomial is given by 
     
       
         
           
             
               
                 
                   
                     
                       
                         f 
                          
                         
                           ( 
                           θ 
                           ) 
                         
                       
                       - 
                       
                         
                           p 
                           n 
                         
                          
                         
                           ( 
                           θ 
                           ) 
                         
                       
                     
                     ≤ 
                     
                       
                         1 
                         
                           
                             ( 
                             
                               n 
                               + 
                               1 
                             
                             ) 
                           
                           ! 
                         
                       
                        
                       
                         
                           f 
                           
                             ( 
                             
                               n 
                               + 
                               1 
                             
                             ) 
                           
                         
                          
                         
                           ( 
                           
                             ξ 
                             θ 
                           
                           ) 
                         
                       
                        
                       
                         w 
                          
                         
                           ( 
                           θ 
                           ) 
                         
                       
                     
                   
                   , 
                 
               
               
                 
                   ( 
                   76 
                   ) 
                 
               
             
           
         
       
     
     where 
     
       
         
           
             
               w 
                
               
                 ( 
                 θ 
                 ) 
               
             
             := 
             
               
                 ∏ 
                 
                   j 
                   = 
                   1 
                 
                 n 
               
                
               
                 
                   ( 
                   
                     θ 
                     - 
                     
                       θ 
                       j 
                     
                   
                   ) 
                 
                 . 
               
             
           
         
       
     
     It is necessary to estimate the gradient of this, and hence to evaluate 
     
       
         
           
             
               
                 
                   
                     
                       
                         ∂ 
                         
                           f 
                            
                           
                             ( 
                             θ 
                             ) 
                           
                         
                       
                       
                         ∂ 
                         θ 
                       
                     
                     - 
                     
                       
                         ∂ 
                         
                           
                             p 
                             n 
                           
                            
                           
                             ( 
                             θ 
                             ) 
                           
                         
                       
                       
                         ∂ 
                         θ 
                       
                     
                   
                   ≤ 
                   
                     
                       lim 
                       
                         Δ 
                         -&gt; 
                         0 
                       
                     
                      
                     
                       
                         ( 
                         
                           
                             
                               
                                 1 
                                 
                                   
                                     ( 
                                     
                                       n 
                                       + 
                                       1 
                                     
                                     ) 
                                   
                                   ! 
                                 
                               
                                
                               
                                 
                                   f 
                                   
                                     ( 
                                     
                                       n 
                                       + 
                                       1 
                                     
                                     ) 
                                   
                                 
                                  
                                 
                                   ( 
                                   
                                     ξ 
                                     
                                       θ 
                                       + 
                                       Δ 
                                     
                                   
                                   ) 
                                 
                               
                                
                               
                                 w 
                                  
                                 
                                   ( 
                                   
                                     θ 
                                     + 
                                     Δ 
                                   
                                   ) 
                                 
                               
                             
                             - 
                             
                               
                                 1 
                                 
                                   
                                     ( 
                                     
                                       n 
                                       + 
                                       1 
                                     
                                     ) 
                                   
                                   ! 
                                 
                               
                                
                               
                                 
                                   f 
                                   
                                     ( 
                                     
                                       n 
                                       + 
                                       1 
                                     
                                     ) 
                                   
                                 
                                  
                                 
                                   ( 
                                   
                                     ξ 
                                     θ 
                                   
                                   ) 
                                 
                               
                                
                               
                                 w 
                                  
                                 
                                   ( 
                                   θ 
                                   ) 
                                 
                               
                             
                           
                           Δ 
                         
                         ) 
                       
                       . 
                     
                   
                 
               
               
                 
                   ( 
                   77 
                   ) 
                 
               
             
           
         
       
     
     Now, since it is not necessary to estimate the gradient at an arbitrary point θ, but sufficient to estimate the gradient at a chosen point, it is possible to set θ to be one of the points at which the function ƒ(θ), i.e., θ∈{θ i } i=1   n , is evaluated. Let this choice be given by θ k , arbitrarily chosen. Then the latter term vanishes since w(θ k )=0. Therefore, 
     
       
         
           
             
               
                 
                   
                     
                       
                         
                           ∂ 
                           
                             f 
                              
                             
                               ( 
                               
                                 θ 
                                 k 
                               
                               ) 
                             
                           
                         
                         
                           ∂ 
                           θ 
                         
                       
                       - 
                       
                         
                           ∂ 
                           
                             
                               p 
                               n 
                             
                              
                             
                               ( 
                               
                                 θ 
                                 k 
                               
                               ) 
                             
                           
                         
                         
                           ∂ 
                           θ 
                         
                       
                     
                     ≤ 
                     
                       
                         lim 
                         
                           Δ 
                           → 
                           0 
                         
                       
                        
                       
                         ( 
                         
                           
                             
                               1 
                               
                                 
                                   ( 
                                   
                                     n 
                                     + 
                                     1 
                                   
                                   ) 
                                 
                                 ! 
                               
                             
                              
                             
                               
                                 f 
                                 
                                   ( 
                                   
                                     n 
                                     + 
                                     1 
                                   
                                   ) 
                                 
                               
                                
                               
                                 ( 
                                 
                                   ξ 
                                   
                                     
                                       θ 
                                       k 
                                     
                                     + 
                                     Δ 
                                   
                                 
                                 ) 
                               
                             
                              
                             
                               w 
                                
                               
                                 ( 
                                 
                                   
                                     θ 
                                     k 
                                   
                                   + 
                                   Δ 
                                 
                                 ) 
                               
                             
                           
                           Δ 
                         
                         ) 
                       
                     
                   
                   , 
                 
               
               
                 
                   ( 
                   78 
                   ) 
                 
               
             
           
         
       
     
     and noting that w(θ k ) contains one term (θ k +Δ−θ k )=Δ achieves the claimed result. 
     A number of approximation steps will be performed in order to obtain a form which can be simulated on a quantum computer more efficiently, and only then resolve to divided differences at this “lower level”. In detail the following steps are performed. Recalling the need to evaluate the gradient of 
     
       
         
           
             Tr 
              
             
               
                 [ 
                 
                   
                     
                       ∂ 
                       
                         ∂ 
                         θ 
                       
                     
                      
                     ρ 
                   
                    
                   
                     log 
                      
                     
                       ( 
                       
                         σ 
                         v 
                       
                       ) 
                     
                   
                 
                 ] 
               
               , 
             
           
         
       
         
         
           
             1. The logarithm is first approximated via a Fourier-like approximation, i.e., 
           
         
       
    
       log σ v →log K,M σ v ,  (79)
             similar to [3], which will yield a Fourier-like series in terms of σ v , i.e., Σ m c m  exp (imπσ v ).       2. Next, it is necessary to evaluate the gradient of the function       

     
       
         
           
             Tr 
              
             
               
                 [ 
                 
                   
                     
                       ∂ 
                       
                         ∂ 
                         θ 
                       
                     
                      
                     ρ 
                   
                    
                   
                     
                       log 
                       
                         K 
                         , 
                         M 
                       
                     
                      
                     
                       ( 
                       
                         σ 
                         v 
                       
                       ) 
                     
                   
                 
                 ] 
               
               , 
             
           
         
       
     
     where log(σ v ) is now approximated with the truncated Fourier series up to order K, using an additional parameter M which will be explained below. Taking the derivative yields many terms of the form 
     
       
         
           
             
               
                 
                   
                     
                       ∫ 
                       0 
                       1 
                     
                      
                     
                       d 
                        
                       s 
                        
                       
                         e 
                         
                           ( 
                           
                             i 
                              
                             s 
                              
                             m 
                              
                             π 
                              
                             
                               σ 
                               v 
                             
                           
                           ) 
                         
                       
                        
                       
                         
                           ∂ 
                           
                             σ 
                             v 
                           
                         
                         
                           ∂ 
                           θ 
                         
                       
                        
                       
                         e 
                         
                           ( 
                           
                             
                               i 
                                
                               
                                 ( 
                                 
                                   1 
                                   - 
                                   s 
                                 
                                 ) 
                               
                             
                              
                             m 
                              
                             π 
                              
                             
                               σ 
                               v 
                             
                           
                           ) 
                         
                       
                     
                   
                   , 
                 
               
               
                 
                   ( 
                   80 
                   ) 
                 
               
             
           
         
       
         
         
           
             
               
                 as a result of the Duhamel&#39;s formula. Note that this derivative is exact except the approximation error of the logarithm. Each term in this expansion can furthermore be evaluated separately via a sampling procedure, i.e., 
               
             
           
         
       
    
     
       
         
           
             
               
                 
                   
                     
                       
                         ∫ 
                         0 
                         1 
                       
                        
                       
                         d 
                          
                         s 
                          
                         
                           e 
                           
                             ( 
                             
                               i 
                                
                               s 
                                
                               m 
                                
                               π 
                                
                               
                                 σ 
                                 v 
                               
                             
                             ) 
                           
                         
                          
                         
                           
                             ∂ 
                             
                               σ 
                               v 
                             
                           
                           
                             ∂ 
                             θ 
                           
                         
                          
                         
                           e 
                           
                             ( 
                             
                               
                                 i 
                                  
                                 
                                   ( 
                                   
                                     1 
                                     - 
                                     s 
                                   
                                   ) 
                                 
                               
                                
                               m 
                                
                               π 
                                
                               
                                 σ 
                                 v 
                               
                             
                             ) 
                           
                         
                       
                     
                     ≈ 
                     
                       
                          
                         s 
                       
                        
                       
                         [ 
                         
                           
                             e 
                             
                               ( 
                               
                                 i 
                                  
                                 s 
                                  
                                 m 
                                  
                                 π 
                                  
                                 
                                   σ 
                                   v 
                                 
                               
                               ) 
                             
                           
                            
                           
                             
                               ∂ 
                               
                                 σ 
                                 v 
                               
                             
                             
                               ∂ 
                               θ 
                             
                           
                            
                           
                             e 
                             
                               ( 
                               
                                 
                                   i 
                                    
                                   
                                     ( 
                                     
                                       1 
                                       - 
                                       s 
                                     
                                     ) 
                                   
                                 
                                  
                                 m 
                                  
                                 π 
                                  
                                 
                                   σ 
                                   v 
                                 
                               
                               ) 
                             
                           
                         
                         ] 
                       
                     
                   
                   , 
                 
               
               
                 
                   ( 
                   81 
                   ) 
                 
               
             
           
         
       
         
         
           
             
               
                 and there is now only a logarithmic number of terms, so the result can be combined via classical postprocessing once the trace is evaluated. 
               
             
             3. Next, a divided difference scheme is applied to approximate the gradient 
           
         
       
    
     
       
         
           
             
               
                 
                   
                     
                       ∂ 
                       
                         σ 
                         v 
                       
                     
                     
                       ∂ 
                       θ 
                     
                   
                   , 
                 
               
               
                 
                     
                 
               
             
           
         
       
     
     which results in a polynomial of order n (i.e., the number of points at which the function is evaluated) in σ v , which we can be evaluated efficiently.
         4. However, evaluating these terms is still not trivial. The final step consists hence of implementing a routine that allows evaluation of these terms on a quantum device. In order to do so, one again makes use of the Fourier series approach. Applied this time is the simple idea of approximating the density operator σ v  by the series of itself, i.e., σ v ≈F(σ v ):=Σ m′ c m′ exp (imπm′σ v ), which can be implemented conveniently via sample based Hamiltonian simulation [ ].       

     The following provides concrete bounds on the error introduced by the approximations and details of the implementation. The final result is then stated in Theorem 4. First one bounds the error in the approximation of the logarithm and then uses Lemma 37 of [3] to obtain a Fourier series approximation which is close to log(z). The Taylor series of 
     for x∈(0,1) and where 
     
       
         
           
             
               
                 
                   
                     
                       
                         
                           
                             log 
                              
                             
                               ( 
                               x 
                               ) 
                             
                           
                           = 
                           
                             
                               ∑ 
                               
                                 k 
                                 = 
                                 1 
                               
                               ∞ 
                             
                              
                             
                               
                                 
                                   ( 
                                   
                                     - 
                                     1 
                                   
                                   ) 
                                 
                                 
                                   k 
                                   + 
                                   1 
                                 
                               
                                
                               
                                 
                                   
                                     ( 
                                     
                                       x 
                                       - 
                                       1 
                                     
                                     ) 
                                   
                                   k 
                                 
                                 k 
                               
                             
                           
                         
                       
                     
                     
                       
                         
                           
                             = 
                             
                               
                                 
                                   ∑ 
                                   
                                     k 
                                     = 
                                     1 
                                   
                                   
                                     K 
                                     1 
                                   
                                 
                                  
                                 
                                   
                                     
                                       ( 
                                       
                                         - 
                                         1 
                                       
                                       ) 
                                     
                                     
                                       k 
                                       + 
                                       1 
                                     
                                   
                                    
                                   
                                     
                                       
                                         ( 
                                         
                                           x 
                                           - 
                                           1 
                                         
                                         ) 
                                       
                                       k 
                                     
                                     k 
                                   
                                 
                               
                               + 
                               
                                 
                                   R 
                                   
                                     
                                       K 
                                       1 
                                     
                                     + 
                                     1 
                                   
                                 
                                  
                                 
                                   ( 
                                   
                                     x 
                                     - 
                                     1 
                                   
                                   ) 
                                 
                               
                             
                           
                           , 
                         
                       
                     
                   
                     
                 
               
               
                 
                   ( 
                   82 
                   ) 
                 
               
             
           
         
       
     
     for x  6  (0.1) and where 
     
       
         
           
             
               
                 R 
                 
                   K 
                   + 
                   1 
                 
               
                
               
                 ( 
                 z 
                 ) 
               
             
             = 
             
               
                 
                   
                     f 
                     
                       
                         K 
                         1 
                       
                       + 
                       1 
                     
                   
                    
                   
                     ( 
                     c 
                     ) 
                   
                 
                 
                   K 
                   ! 
                 
               
                
               
                 
                   ( 
                   
                     z 
                     - 
                     c 
                   
                   ) 
                 
                 
                   K 
                   1 
                 
               
                
               z 
             
           
         
       
     
     is the Cauchy remainder of the Taylor series, for −1&lt;z&lt;0. The error can hence be bounded as 
     
       
         
           
             
               
                 
                   
                     
                        
                       
                         
                           R 
                           
                             
                               K 
                               1 
                             
                             + 
                             1 
                           
                         
                          
                         
                           ( 
                           z 
                           ) 
                         
                       
                        
                     
                     = 
                     
                        
                       
                         
                           
                             ( 
                             
                               - 
                               1 
                             
                             ) 
                           
                           
                             K 
                             1 
                           
                         
                          
                         
                           
                             
                               
                                 z 
                                 
                                   
                                     K 
                                     1 
                                   
                                   + 
                                   1 
                                 
                               
                                
                               
                                 ( 
                                 
                                   1 
                                   - 
                                   α 
                                 
                                 ) 
                               
                             
                             
                               K 
                               1 
                             
                           
                           
                             
                               ( 
                               
                                 1 
                                 + 
                                 
                                   α 
                                    
                                   z 
                                 
                               
                               ) 
                             
                             
                               
                                 K 
                                 1 
                               
                               + 
                               1 
                             
                           
                         
                       
                        
                     
                   
                   , 
                 
               
               
                 
                   ( 
                   83 
                   ) 
                 
               
             
           
         
       
     
     where the derivatives of the logarithm are evaluated, and where 0≤α≤1 is a parameter. Using that 1+αz≥1+z (since z≤0) and hence 
     
       
         
           
             
               0 
               ≤ 
               
                 
                   1 
                   - 
                   α 
                 
                 
                   1 
                   + 
                   
                     α 
                      
                     z 
                   
                 
               
               ≤ 
               1 
             
             , 
           
         
       
     
     the error bound becomes 
     
       
         
           
             
               
                 
                   
                      
                     
                       
                         R 
                         
                           
                             K 
                             1 
                           
                           + 
                           1 
                         
                       
                        
                       
                         ( 
                         z 
                         ) 
                       
                     
                      
                   
                   ≤ 
                   
                     
                       
                          
                         z 
                          
                       
                       
                         
                           K 
                           1 
                         
                         + 
                         1 
                       
                     
                     
                       1 
                       + 
                       z 
                     
                   
                 
               
               
                 
                   ( 
                   84 
                   ) 
                 
               
             
           
         
       
     
     Reversing to the variable x the error bound for the Taylor series, and assuming that 0&lt;δ l &lt;z and 0&lt;|−z|≤δ u &lt;1, which is justified when dealing with sufficiently mixed states, then the approximation error is given by 
     
       
         
           
             
               
                 
                   
                      
                     
                       
                         R 
                         
                           
                             K 
                             1 
                           
                           + 
                           1 
                         
                       
                        
                       
                         ( 
                         z 
                         ) 
                       
                     
                      
                   
                   ≤ 
                   
                     
                       
                         ( 
                         
                           δ 
                           l 
                         
                         ) 
                       
                       
                         
                           K 
                           1 
                         
                         + 
                         1 
                       
                     
                     
                       δ 
                       u 
                     
                   
                    
                   
                     ≤ 
                     ! 
                   
                    
                   
                     
                       ϵ 
                       1 
                     
                     . 
                   
                 
               
               
                 
                   ( 
                   85 
                   ) 
                 
               
             
           
         
       
     
     Hence in order to achieve the desired error ϵ 1  we need 
     
       
         
           
             
               
                 
                   
                     K 
                     1 
                   
                   ≥ 
                   
                     
                       
                         log 
                          
                         
                           ( 
                           
                             
                               ( 
                               
                                 
                                   ϵ 
                                   1 
                                 
                                  
                                 
                                   δ 
                                   u 
                                 
                               
                               ) 
                             
                             
                               - 
                               1 
                             
                           
                           ) 
                         
                       
                       
                         log 
                          
                         
                           ( 
                           
                             
                               ( 
                               
                                 δ 
                                 l 
                               
                               ) 
                             
                             
                               - 
                               1 
                             
                           
                           ) 
                         
                       
                     
                     . 
                   
                 
               
               
                 
                   ( 
                   86 
                   ) 
                 
               
             
           
         
       
     
     Hence, it is possible to choose K 1  such that the error in the approximation of the Taylor series is ≤ϵ 1 /4. This implies the ability to make use of Lemma 37 of [3], and therefore to obtain a Fourier series approximation for the logarithm. This Lemma is now restated here for completeness: 
     Lemma 3. 
     (Lemma 37 in [3]) Let ƒ: →  and δ,ϵ∈(0,1), and T(ƒ):=Σ k=0   K a k x k  be a polynomial such that |ƒ(x)−T(ƒ)|≤ϵ/4 for all x∈[−1+δ,1−δ]. Then ∃c∈   2M+1 . 
     
       
         
           
             
               
                 
                   
                      
                     
                       
                         f 
                          
                         
                           ( 
                           x 
                           ) 
                         
                       
                       - 
                       
                         
                           ∑ 
                           
                             m 
                             = 
                             
                               - 
                               M 
                             
                           
                           M 
                         
                          
                         
                           
                             c 
                             m 
                           
                            
                           
                             e 
                             
                               
                                 
                                   i 
                                    
                                   
                                       
                                   
                                    
                                   π 
                                    
                                   
                                       
                                   
                                    
                                   m 
                                 
                                 2 
                               
                                
                               x 
                             
                           
                         
                       
                     
                      
                   
                   ≤ 
                   ϵ 
                 
               
               
                 
                   ( 
                   87 
                   ) 
                 
               
             
           
         
       
     
     for all x∈[−1+δ,1−], where 
     
       
         
           
             M 
             = 
             
               max 
                
               
                 ( 
                 
                   
                     2 
                      
                     
                       ⌈ 
                       
                         
                           ln 
                            
                           
                             ( 
                             
                               
                                 4 
                                  
                                 
                                   
                                      
                                     a 
                                      
                                   
                                   1 
                                 
                               
                               ϵ 
                             
                             ) 
                           
                         
                          
                         
                           1 
                           δ 
                         
                       
                       ] 
                     
                   
                   , 
                   0 
                 
                 ) 
               
             
           
         
       
     
     and ∥c∥ 1 ≤∥a∥ 1 . Moreover, c can be efficiently calculated on a classical computer in time poly(K,M,log(1/ϵ)). 
     In order to apply this lemma to the present case, the approximation rate is now restricted to the range (δ l ,δ u ), where 0&lt;δ l ≤δ u &lt;1. Therefore over this range an approximation of the following form is obtained. 
     Corollary 1. 
     Let ƒ: →  be defined as ƒ(x)=log(x), δ,ϵ 1 ∈(0,1), and 
     
       
         
           
             
               
                 log 
                 K 
               
                
               
                 ( 
                 
                   1 
                   - 
                   x 
                 
                 ) 
               
             
             := 
             
               
                 ∑ 
                 
                   k 
                   = 
                   1 
                 
                 
                   K 
                   1 
                 
               
                
               
                 
                   
                     
                       ( 
                       
                         - 
                         1 
                       
                       ) 
                     
                     
                       k 
                       - 
                       1 
                     
                   
                   k 
                 
                  
                 
                   x 
                   k 
                 
               
             
           
         
       
     
     such that 
     
       
         
           
             
               
                 a 
                 k 
               
               : 
             
             = 
             
               
                 
                   ( 
                   
                     - 
                     1 
                   
                   ) 
                 
                 
                   k 
                   - 
                   1 
                 
               
               k 
             
           
         
       
     
     and 
     
       
         
           
             
               
                  
                 a 
                  
               
               1 
             
             = 
             
               
                 ∑ 
                 
                   k 
                   = 
                   1 
                 
                 
                   K 
                   1 
                 
               
                
               
                 1 
                 k 
               
             
           
         
       
     
     with 
     
       
         
           
             
               K 
               1 
             
             ≥ 
             
               
                 log 
                  
                 
                   ( 
                   
                     4 
                      
                     
                       
                         ( 
                         
                           
                             ϵ 
                             1 
                           
                            
                           
                             δ 
                             1 
                             u 
                           
                         
                         ) 
                       
                       
                         - 
                         1 
                       
                     
                   
                   ) 
                 
               
               
                 log 
                  
                 
                   ( 
                   
                     
                       ( 
                       
                         δ 
                         l 
                       
                       ) 
                     
                     
                       - 
                       1 
                     
                   
                   ) 
                 
               
             
           
         
       
     
     such that |log(x)−log K (x)|≤ϵ 1 /4 for all x∈[δ l ,δ u ]. Then ∃c∈   2M+1 . 
     
       
         
           
             
               
                 
                   
                      
                     
                       
                         f 
                          
                         
                           ( 
                           x 
                           ) 
                         
                       
                       - 
                       
                         
                           ∑ 
                           
                             m 
                             = 
                             
                               - 
                               
                                 M 
                                 1 
                               
                             
                           
                           
                             M 
                             1 
                           
                         
                          
                         
                           
                             c 
                             m 
                           
                            
                           
                             e 
                             
                               
                                 
                                   i 
                                    
                                   
                                       
                                   
                                    
                                   π 
                                    
                                   
                                       
                                   
                                    
                                   m 
                                 
                                 2 
                               
                                
                               x 
                             
                           
                         
                       
                     
                      
                   
                   ≤ 
                   
                     ϵ 
                     1 
                   
                 
               
               
                 
                   ( 
                   88 
                   ) 
                 
               
             
           
         
       
     
     for all x∈[δ l ,δ u ], where 
     
       
         
           
             
               M 
               1 
             
             = 
             
               max 
                
               
                 ( 
                 
                   
                     2 
                      
                     
                       ⌈ 
                       
                         
                           ln 
                            
                           
                             ( 
                             
                               
                                 4 
                                  
                                 
                                   
                                      
                                     a 
                                      
                                   
                                   1 
                                 
                               
                               
                                 ϵ 
                                 1 
                               
                             
                             ) 
                           
                         
                          
                         
                           1 
                           
                             1 
                             - 
                             
                               δ 
                               u 
                             
                           
                         
                       
                       ⌉ 
                     
                   
                   , 
                   0 
                 
                 ) 
               
             
           
         
       
     
     and ∥c∥ 1 ≤∥a∥ 1 . Moreover, c can be efficiently calculated on a classical computer in time poly(K 1 , M 1 , log(1/ϵ 1 )). 
     Proof. 
     The proof follows straightforwardly by combining Lemma 3 with the approximation of the logarithm and the range over which we want to approximate the function. 
     In the following 
     
       
         
           
             
               
                 
                   log 
                   
                     K 
                     , 
                     M 
                   
                 
                  
                 
                   ( 
                   x 
                   ) 
                 
               
               := 
               
                 
                   ∑ 
                   
                     m 
                     = 
                     
                       - 
                       
                         M 
                         1 
                       
                     
                   
                   
                     M 
                     1 
                   
                 
                  
                 
                   
                     c 
                     m 
                   
                    
                   
                     e 
                     
                       
                         
                           i 
                            
                           π 
                            
                           m 
                         
                         2 
                       
                        
                       x 
                     
                   
                 
               
             
             , 
           
         
       
     
     where the K-subscript is retained to denote that classical computation of this approximation is poly(K)-dependent. Now the gradient of the objective is expressed via this approximation as 
     
       
         
           
             
               
                 
                   Tr 
                    
                   
                     
                       [ 
                       
                         
                           
                             ∂ 
                             
                               ∂ 
                               θ 
                             
                           
                            
                           ρ 
                         
                          
                         
                           log 
                           
                             K 
                             , 
                             M 
                           
                         
                          
                         
                           σ 
                           v 
                         
                       
                       ] 
                     
                     ≈ 
                     
                       
                         ∑ 
                         
                           m 
                           = 
                           
                             - 
                             
                               M 
                               1 
                             
                           
                         
                         
                           M 
                           1 
                         
                       
                        
                       
                         
                           
                             i 
                              
                             
                               c 
                               m 
                             
                              
                             m 
                              
                             π 
                           
                           2 
                         
                          
                         
                           
                             ∫ 
                             0 
                             1 
                           
                            
                           
                             
                               dsTr 
                               [ 
                               
                                 ρ 
                                  
                                 
                                     
                                 
                                  
                                 
                                   e 
                                   
                                     
                                       
                                         i 
                                          
                                         s 
                                          
                                         π 
                                          
                                         m 
                                       
                                       2 
                                     
                                      
                                     
                                       σ 
                                       v 
                                     
                                   
                                 
                                  
                                 
                                   
                                     ∂ 
                                     
                                       σ 
                                       v 
                                     
                                   
                                   
                                     ∂ 
                                     θ 
                                   
                                 
                                  
                                 
                                   e 
                                   
                                     
                                       
                                         
                                           i 
                                            
                                           
                                             ( 
                                             
                                               1 
                                               - 
                                               s 
                                             
                                             ) 
                                           
                                         
                                          
                                         π 
                                          
                                         m 
                                       
                                       2 
                                     
                                      
                                     
                                       σ 
                                       v 
                                     
                                   
                                 
                               
                               ] 
                             
                             . 
                           
                         
                       
                     
                   
                 
               
               
                 
                   ( 
                   89 
                   ) 
                 
               
             
           
         
       
     
     where each term in the sum may be evaluated individually and the results classically post-processed, i.e., sumed up. In particular the latter can be evaluated as the expectation value over s, i.e., 
     
       
         
           
             
               
                 
                   
                     
                       
                         ∫ 
                         0 
                         1 
                       
                        
                       
                         dsTr 
                          
                         
                           [ 
                           
                             ρ 
                              
                             
                                 
                             
                              
                             
                               e 
                               
                                 
                                   
                                     i 
                                      
                                     s 
                                      
                                     π 
                                      
                                     m 
                                   
                                   2 
                                 
                                  
                                 
                                   σ 
                                   v 
                                 
                               
                             
                              
                             
                               
                                 ∂ 
                                 
                                   σ 
                                   v 
                                 
                               
                               
                                 ∂ 
                                 θ 
                               
                             
                              
                             
                               e 
                               
                                 
                                   
                                     
                                       i 
                                        
                                       
                                         ( 
                                         
                                           1 
                                           - 
                                           s 
                                         
                                         ) 
                                       
                                     
                                      
                                     π 
                                      
                                     m 
                                   
                                   2 
                                 
                                  
                                 
                                   σ 
                                   v 
                                 
                               
                             
                           
                           ] 
                         
                       
                     
                     = 
                     
                       
                          
                         
                           s 
                           ∈ 
                           
                             [ 
                             
                               0 
                               , 
                               1 
                             
                             ] 
                           
                         
                       
                        
                       
                         [ 
                         
                           Tr 
                            
                           
                             [ 
                             
                               ρ 
                                
                               
                                   
                               
                                
                               
                                 e 
                                 
                                   
                                     
                                       i 
                                        
                                       s 
                                        
                                       π 
                                        
                                       m 
                                     
                                     2 
                                   
                                    
                                   
                                     σ 
                                     v 
                                   
                                 
                               
                                
                               
                                 
                                   ∂ 
                                   
                                     σ 
                                     v 
                                   
                                 
                                 
                                   ∂ 
                                   θ 
                                 
                               
                                
                               
                                 e 
                                 
                                   
                                     
                                       
                                         i 
                                          
                                         
                                           ( 
                                           
                                             1 
                                             - 
                                             s 
                                           
                                           ) 
                                         
                                       
                                        
                                       π 
                                        
                                       m 
                                     
                                     2 
                                   
                                    
                                   
                                     σ 
                                     v 
                                   
                                 
                               
                             
                             ] 
                           
                         
                         ] 
                       
                     
                   
                   , 
                 
               
               
                 
                   ( 
                   90 
                   ) 
                 
               
             
           
         
       
     
     which can be evaluated separately on a quantum device. In the following it is necessary to devise a method to evaluate this expectation value. 
     First, the gradient is expanded using a divided difference formula such that 
     
       
         
           
             
               ∂ 
               
                 σ 
                 v 
               
             
             
               ∂ 
               θ 
             
           
         
       
     
     is approximated by the Lagrange interpolation polynomial of degree μ−1, i.e., 
     
       
         
           
             
               
                 
                   
                     
                       
                         
                           ∂ 
                           
                             σ 
                             v 
                           
                         
                         
                           ∂ 
                           θ 
                         
                       
                        
                       
                         ( 
                         θ 
                         ) 
                       
                     
                     ≈ 
                     
                       
                         ∑ 
                         
                           j 
                           = 
                           0 
                         
                         μ 
                       
                        
                       
                         
                           
                             σ 
                             v 
                           
                            
                           
                             ( 
                             
                               θ 
                               j 
                             
                             ) 
                           
                         
                          
                         
                           
                             ℒ 
                             
                               μ 
                               , 
                               j 
                             
                             ′ 
                           
                            
                           
                             ( 
                             θ 
                             ) 
                           
                         
                       
                     
                   
                   , 
                   
                     
 
                   
                    
                   where 
                 
               
               
                 
                   ( 
                   91 
                   ) 
                 
               
             
             
               
                 
                   
                     
                       ℒ 
                       
                         μ 
                         , 
                         j 
                       
                     
                      
                     
                       ( 
                       θ 
                       ) 
                     
                   
                   := 
                   
                     
                       ∏ 
                       
                         
                           k 
                           = 
                           0 
                         
                         
                           k 
                           ≠ 
                           j 
                         
                       
                       μ 
                     
                      
                     
                       
                         
                           θ 
                           - 
                           
                             θ 
                             k 
                           
                         
                         
                           
                             θ 
                             j 
                           
                           - 
                           
                             θ 
                             k 
                           
                         
                       
                       . 
                     
                   
                 
               
               
                 
                   ( 
                   92 
                   ) 
                 
               
             
           
         
       
     
     Note that the order p is free to chose, and will guarantee a different error in the solution of the gradient estimate as described prior in Lemma 2. Using this in the gradient estimation, a polynomial of the form is obtained (evaluated at θ j , i.e., the chosen points) 
     
       
         
           
             
               
                 
                   
                     
                       ∑ 
                       
                         m 
                         = 
                         
                           - 
                           
                             M 
                             1 
                           
                         
                       
                       
                         M 
                         1 
                       
                     
                      
                     
                       
                         
                           i 
                            
                           
                             c 
                             m 
                           
                            
                           m 
                            
                           π 
                         
                         2 
                       
                        
                       
                         
                           ∑ 
                           
                             j 
                             = 
                             0 
                           
                           μ 
                         
                          
                         
                           
                             
                               ℒ 
                               
                                 μ 
                                 , 
                                 j 
                               
                               ′ 
                             
                              
                             
                               ( 
                               
                                 θ 
                                 j 
                               
                               ) 
                             
                           
                            
                           
                             
                                
                               
                                 s 
                                 ∈ 
                                 
                                   [ 
                                   
                                     0 
                                     , 
                                     1 
                                   
                                   ] 
                                 
                               
                             
                              
                             
                               [ 
                               
                                 Tr 
                                  
                                 
                                   [ 
                                   
                                     ρ 
                                      
                                     
                                         
                                     
                                      
                                     
                                       e 
                                       
                                         
                                           
                                             i 
                                              
                                             s 
                                              
                                             π 
                                              
                                             m 
                                           
                                           2 
                                         
                                          
                                         
                                           σ 
                                           v 
                                         
                                       
                                     
                                      
                                     
                                       
                                         σ 
                                         v 
                                       
                                        
                                       
                                         ( 
                                         
                                           θ 
                                           j 
                                         
                                         ) 
                                       
                                     
                                      
                                     
                                       e 
                                       
                                         
                                           
                                             
                                               i 
                                                
                                               
                                                 ( 
                                                 
                                                   1 
                                                   - 
                                                   s 
                                                 
                                                 ) 
                                               
                                             
                                              
                                             π 
                                              
                                             m 
                                           
                                           2 
                                         
                                          
                                         
                                           σ 
                                           v 
                                         
                                       
                                     
                                   
                                   ] 
                                 
                               
                               ] 
                             
                           
                         
                       
                     
                   
                   , 
                 
               
               
                 
                   ( 
                   93 
                   ) 
                 
               
             
           
         
       
     
     where each term again can be evaluated separately, and efficiently combined via classical post-processing. Note that the error in the Lagrange interpolation polynomial decreases exponentially fast, and therefore the number of terms we use is sufficiently small to do so. Next, it is necessary to deploy a method to evaluate the above expressions. In order to do so, σ v  is implemented as a Fourier series of itself, i.e., σ v =arcsin(sin(σ v π/2)/(π/2)), which will then be approximated in a similar approach as taken in Lemma 3. With this the following result is obtained. 
     Lemma 4. 
     Let δ, ϵ 2 ∈(0,1), and {tilde over (x)}:=Σ m′=−M     2     M     2   {tilde over (c)} m′ e iπm′x/2  with 
     
       
         
           
             
               K 
               2 
             
             ≥ 
             
               
                 
                   log 
                    
                   
                     ( 
                     
                       4 
                       / 
                       
                         ϵ 
                         2 
                       
                     
                     ) 
                   
                 
                 
                   log 
                    
                   
                     ( 
                     
                       δ 
                       u 
                       
                         - 
                         1 
                       
                     
                     ) 
                   
                 
               
                
               
                   
               
                
               and 
             
           
         
       
       
         
           
             
               M 
               2 
             
             ≥ 
             
               ⌈ 
               
                 
                   log 
                    
                   
                     ( 
                     
                       4 
                       
                         ϵ 
                         2 
                       
                     
                     ) 
                   
                 
                  
                 
                   
                     
                       ( 
                       
                         2 
                          
                         log 
                          
                         
                           δ 
                           u 
                           
                             - 
                             1 
                           
                         
                       
                       ) 
                     
                     
                       - 
                       1 
                     
                   
                 
               
               ⌉ 
             
           
         
       
     
     and x∈[δ l ,δ u ]. Then ∃{tilde over (c)}∈   2M+1 : 
       | x−{tilde over (x)}|≤ϵ   2   (94)
 
     for all x∈[δ l ,δ u ], and ∥c∥ 1 ≤1. Moreover, {tilde over (c)} can be efficiently calculated on a classical computer in time poly(K 2 , M 2 , log(1/ϵ 2 )). 
     Proof. 
     Invoking the technique used in [3], we expand 
     
       
         
           
             
               
                 
                   
                     
                       arcsin 
                        
                       
                         ( 
                         z 
                         ) 
                       
                     
                     = 
                     
                       
                         
                           ∑ 
                           
                             k 
                             = 
                             0 
                           
                           
                             K 
                             2 
                           
                         
                          
                         
                           
                             2 
                             
                               
                                 - 
                                 2 
                               
                                
                               
                                 k 
                                 ′ 
                               
                             
                           
                            
                           
                             ( 
                             
                               
                                 
                                   
                                     2 
                                      
                                     
                                       k 
                                       ′ 
                                     
                                   
                                 
                               
                               
                                 
                                   k 
                                 
                               
                             
                             ) 
                           
                            
                           
                             
                               z 
                               
                                 
                                   2 
                                    
                                   
                                     k 
                                     ′ 
                                   
                                 
                                 + 
                                 1 
                               
                             
                             
                               
                                 2 
                                  
                                 
                                   k 
                                   ′ 
                                 
                               
                               + 
                               1 
                             
                           
                         
                       
                       + 
                       
                         
                           R 
                           
                             
                               K 
                               2 
                             
                             + 
                             1 
                           
                         
                          
                         
                           ( 
                           z 
                           ) 
                         
                       
                     
                   
                   , 
                 
               
               
                 
                   ( 
                   95 
                   ) 
                 
               
             
           
         
       
     
     where R K     2     +1  is the remainder as before. For 0&lt;z≤δ u ≤½, remainder can be bound by 
     
       
         
           
             
               
                  
                 
                   R 
                   
                     
                       K 
                       2 
                     
                     + 
                     1 
                   
                 
                  
               
               ≤ 
               
                 
                   
                      
                     
                       δ 
                       u 
                     
                      
                   
                   
                     
                       K 
                       2 
                     
                     + 
                     1 
                   
                 
                 
                   1 
                   / 
                   2 
                 
               
                
               
                 ≤ 
                 ! 
               
                
               
                 
                   ɛ 
                   2 
                 
                 / 
                 2 
               
             
             , 
           
         
       
     
     which gives the bound 
     
       
         
           
             
               
                 
                   
                     
                       K 
                       2 
                     
                     ≥ 
                     
                       
                         log 
                          
                         
                           ( 
                           
                             4 
                             / 
                             
                               ϵ 
                               2 
                             
                           
                           ) 
                         
                       
                       
                         log 
                          
                         
                           ( 
                           
                             δ 
                             u 
                             
                               - 
                               1 
                             
                           
                           ) 
                         
                       
                     
                   
                   . 
                 
               
               
                 
                   ( 
                   96 
                   ) 
                 
               
             
           
         
       
     
     By approximation, 
     
       
         
           
             
               
                 
                   
                     
                       sin 
                       l 
                     
                      
                     
                       ( 
                       x 
                       ) 
                     
                   
                   = 
                   
                     
                       
                         ( 
                         
                           i 
                           2 
                         
                         ) 
                       
                       l 
                     
                      
                     
                       
                         ∑ 
                         
                           
                             m 
                             ′ 
                           
                           = 
                           0 
                         
                         l 
                       
                        
                       
                         
                           
                             ( 
                             
                               - 
                               1 
                             
                             ) 
                           
                           
                             m 
                             ′ 
                           
                         
                          
                         
                           ( 
                           
                             
                               
                                 l 
                               
                             
                             
                               
                                 
                                   m 
                                   ′ 
                                 
                               
                             
                           
                           ) 
                         
                          
                         
                           e 
                           
                             i 
                              
                             
                               x 
                                
                               
                                 ( 
                                 
                                   
                                     2 
                                      
                                     
                                       m 
                                       ′ 
                                     
                                   
                                   - 
                                   l 
                                 
                                 ) 
                               
                             
                           
                         
                       
                     
                   
                 
               
               
                 
                   ( 
                   97 
                   ) 
                 
               
             
           
         
       
     
     by 
     
       
         
           
             
               
                 
                   
                     
                       
                         sin 
                         l 
                       
                        
                       
                         ( 
                         x 
                         ) 
                       
                     
                     ≈ 
                     
                       
                         
                           ( 
                           
                             i 
                             2 
                           
                           ) 
                         
                         l 
                       
                        
                       
                         
                           ∑ 
                           
                             
                               m 
                               ′ 
                             
                             = 
                             
                               
                                 ⌈ 
                                 
                                   l 
                                   / 
                                   2 
                                 
                                 ⌉ 
                               
                               - 
                               
                                 M 
                                 2 
                               
                             
                           
                           
                             
                               ⌊ 
                               
                                 l 
                                 / 
                                 2 
                               
                               ⌋ 
                             
                             + 
                             
                               M 
                               2 
                             
                           
                         
                          
                         
                           
                             
                               ( 
                               
                                 - 
                                 1 
                               
                               ) 
                             
                             
                               m 
                               ′ 
                             
                           
                            
                           
                             ( 
                             
                               
                                 
                                   l 
                                 
                               
                               
                                 
                                   
                                     m 
                                     ′ 
                                   
                                 
                               
                             
                             ) 
                           
                            
                           
                             e 
                             
                               i 
                                
                               
                                 x 
                                  
                                 
                                   ( 
                                   
                                     
                                       2 
                                        
                                       
                                         m 
                                         ′ 
                                       
                                     
                                     - 
                                     l 
                                   
                                   ) 
                                 
                               
                             
                           
                         
                       
                     
                   
                   , 
                 
               
               
                 
                   ( 
                   98 
                   ) 
                 
               
             
           
         
       
     
     which induces an error of ϵ 2 /2 for the choice 
     
       
         
           
             
               
                 
                   
                     
                       M 
                       2 
                     
                     ≥ 
                     
                       ⌈ 
                       
                         
                           log 
                            
                           
                             ( 
                             
                               4 
                               
                                 ϵ 
                                 2 
                               
                             
                             ) 
                           
                         
                          
                         
                           
                             
                               ( 
                               
                                 2 
                                  
                                 log 
                                  
                                 
                                   δ 
                                   u 
                                   
                                     - 
                                     1 
                                   
                                 
                               
                               ) 
                             
                             
                               - 
                               1 
                             
                           
                         
                       
                       ⌉ 
                     
                   
                   . 
                 
               
               
                 
                   ( 
                   99 
                   ) 
                 
               
             
           
         
       
     
     This can be seen by using Chernoff&#39;s inequality for sums of binomial coefficients, i.e., 
     
       
         
           
             
               
                 
                   
                     
                       
                         ∑ 
                         
                           
                             m 
                             ′ 
                           
                           = 
                           
                             ⌈ 
                             
                               
                                 l 
                                 / 
                                 2 
                               
                               + 
                               
                                 M 
                                 2 
                               
                             
                             ⌉ 
                           
                         
                         l 
                       
                        
                       
                         
                           2 
                           
                             - 
                             l 
                           
                         
                          
                         
                           ( 
                           
                             
                               
                                 l 
                               
                             
                             
                               
                                 
                                   m 
                                   ′ 
                                 
                               
                             
                           
                           ) 
                         
                       
                     
                     ≤ 
                     
                       e 
                       
                         - 
                         
                           
                             2 
                              
                             
                               M 
                               2 
                               2 
                             
                           
                           l 
                         
                       
                     
                   
                   , 
                 
               
               
                 
                   ( 
                   100 
                   ) 
                 
               
             
           
         
       
     
     and choosing M appropriately. Finally, defining ƒ(z):=arcsin(sin(zπ/2)/(π/2)), as well as {tilde over (ƒ)} 1 :=Σ k′=0   K     2   b k′  sin 2k′+1 (zπ/2) and 
     
       
         
           
             
               
                 
                   
                     
                       
                         
                           
                             f 
                             ~ 
                           
                           2 
                         
                          
                         
                           ( 
                           z 
                           ) 
                         
                       
                       : 
                     
                     = 
                     
                       
                         ∑ 
                         
                           
                             k 
                             ′ 
                           
                           = 
                           0 
                         
                         
                           K 
                           2 
                         
                       
                        
                       
                         
                           
                             
                               b 
                               
                                 k 
                                 ′ 
                               
                             
                              
                             
                               ( 
                               
                                 i 
                                 2 
                               
                               ) 
                             
                           
                           l 
                         
                          
                         
                           
                             ∑ 
                             
                               
                                 m 
                                 ′ 
                               
                               = 
                               
                                 
                                   ⌈ 
                                   
                                     l 
                                     / 
                                     2 
                                   
                                   ⌉ 
                                 
                                 - 
                                 
                                   M 
                                   2 
                                 
                               
                             
                             
                               
                                 ⌊ 
                                 
                                   l 
                                   / 
                                   2 
                                 
                                 ⌋ 
                               
                               + 
                               
                                 M 
                                 2 
                               
                             
                           
                            
                           
                             
                               
                                 ( 
                                 
                                   - 
                                   1 
                                 
                                 ) 
                               
                               
                                 m 
                                 ′ 
                               
                             
                              
                             
                               ( 
                               
                                 
                                   
                                     l 
                                   
                                 
                                 
                                   
                                     
                                       m 
                                       ′ 
                                     
                                   
                                 
                               
                               ) 
                             
                              
                             
                               e 
                               
                                 i 
                                  
                                 
                                   x 
                                    
                                   
                                     ( 
                                     
                                       
                                         2 
                                          
                                         
                                           m 
                                           ′ 
                                         
                                       
                                       - 
                                       l 
                                     
                                     ) 
                                   
                                 
                               
                             
                           
                         
                       
                     
                   
                   , 
                 
               
               
                 
                   ( 
                   101 
                   ) 
                 
               
             
           
         
       
     
     and observing that 
       ∥ƒ−{tilde over (ƒ)} 2 ∥ ∞ ≤∥ƒ−{tilde over (ƒ)} 1 ∥ ∞ +∥{tilde over (ƒ)} 1 −{tilde over (ƒ)} 2 ∥ ∞ ,  (102)
 
     yields the final error of ϵ 2  for the approximation z≈{tilde over (z)}=Σ m′ {tilde over (c)} m′ e iπm′z/2 . 
     Note that this immediately leads to an ϵ 2  error in the spectral norm for the approximation 
     
       
         
           
             
               
                 
                   
                     
                       
                          
                         
                           
                             σ 
                             υ 
                           
                           - 
                           
                             
                               ∑ 
                               
                                 
                                   m 
                                   ′ 
                                 
                                 = 
                                 
                                   - 
                                   
                                     M 
                                     2 
                                   
                                 
                               
                               
                                 M 
                                 2 
                               
                             
                              
                             
                               
                                 
                                   c 
                                   ~ 
                                 
                                 
                                   m 
                                   ′ 
                                 
                               
                                
                               
                                 e 
                                 
                                   i 
                                    
                                   
                                       
                                   
                                    
                                   π 
                                    
                                   
                                       
                                   
                                    
                                   
                                     m 
                                     ′ 
                                   
                                    
                                   
                                     
                                       σ 
                                       υ 
                                     
                                     / 
                                     2 
                                   
                                 
                               
                             
                           
                         
                          
                       
                       2 
                     
                     ≤ 
                     
                       ϵ 
                       2 
                     
                   
                   , 
                 
               
               
                 
                   ( 
                   103 
                   ) 
                 
               
             
           
         
       
     
     where σ v  is the reduced density matrix. 
     Since the final goal is to estimate Tr [∂ θ ρ log σ v ], with a variety of σ v (θ j ) using the divided difference approach, it is also necessary to bound the error in this estimate which is now introduced with the above approximations. Bounding the derivative with respect to the remainder can be done by using the truncated series expansion and bounding the gradient of the remainder. This yields the following result. 
     Lemma 5. 
     For the of the parameters M 1 , M 2 , K 1 , L, μ, Δ, s given in Eq. (143-150), and ρ, σ v  being two density matrices, we can estimate the gradient of the relative entropy such that 
       |∂ θ Tr[ρ log σ v ]−∂ θ Tr[ρ log K     1     ,M     1   {tilde over (σ)} v ]|≤ϵ,  (104)
 
     where the function ∂ θ Tr [ρ log K     1     ,M     1   {tilde over (σ)} v ] evaluated at θ is defined as 
     
       
         
           
             
               
                 
                   Re 
                    
                   
                     [ 
                     
                       
                         ∑ 
                         
                           m 
                           = 
                           
                             - 
                             
                               M 
                               1 
                             
                           
                         
                         
                           M 
                           1 
                         
                       
                        
                       
                         
                           ∑ 
                           
                             
                               m 
                               ′ 
                             
                             = 
                             
                               - 
                               
                                 M 
                                 2 
                               
                             
                           
                           
                             M 
                             2 
                           
                         
                          
                         
                           
                             
                               i 
                                
                               
                                 c 
                                 m 
                               
                                
                               
                                 
                                   c 
                                   ~ 
                                 
                                 
                                   m 
                                   ′ 
                                 
                               
                                
                               m 
                                
                               
                                   
                               
                                
                               π 
                             
                             2 
                           
                            
                           
                             
                               ∑ 
                               
                                 j 
                                 = 
                                 0 
                               
                               μ 
                             
                              
                             
                               
                                 
                                   ℒ 
                                   
                                     μ 
                                     , 
                                     j 
                                   
                                   ′ 
                                 
                                  
                                 
                                   ( 
                                   θ 
                                   ) 
                                 
                               
                                
                               
                                 
                                    
                                   
                                     s 
                                     ∈ 
                                     
                                       [ 
                                       
                                         0 
                                         , 
                                         1 
                                       
                                       ] 
                                     
                                   
                                 
                                  
                                 
                                   [ 
                                   
                                     Tr 
                                      
                                     
                                       [ 
                                       
                                         ρ 
                                          
                                         
                                             
                                         
                                          
                                         
                                           e 
                                           
                                             
                                               
                                                 i 
                                                  
                                                 
                                                     
                                                 
                                                  
                                                 s 
                                                  
                                                 
                                                     
                                                 
                                                  
                                                 π 
                                                  
                                                 
                                                     
                                                 
                                                  
                                                 m 
                                               
                                               2 
                                             
                                              
                                             
                                               σ 
                                               υ 
                                             
                                           
                                         
                                          
                                         
                                           e 
                                           
                                             
                                               
                                                 i 
                                                  
                                                 
                                                     
                                                 
                                                  
                                                 π 
                                                  
                                                 
                                                     
                                                 
                                                  
                                                 
                                                   m 
                                                   ′ 
                                                 
                                               
                                               2 
                                             
                                              
                                             
                                               
                                                 σ 
                                                 υ 
                                               
                                                
                                               
                                                 ( 
                                                 
                                                   θ 
                                                   j 
                                                 
                                                 ) 
                                               
                                             
                                           
                                         
                                          
                                         
                                           e 
                                           
                                             
                                               
                                                 
                                                   i 
                                                    
                                                   
                                                     ( 
                                                     
                                                       1 
                                                       - 
                                                       s 
                                                     
                                                     ) 
                                                   
                                                 
                                                  
                                                 π 
                                                  
                                                 m 
                                               
                                               2 
                                             
                                              
                                             
                                               σ 
                                               υ 
                                             
                                           
                                         
                                       
                                       ] 
                                     
                                   
                                   ] 
                                 
                               
                             
                           
                         
                       
                     
                     ] 
                   
                 
               
               
                 
                   ( 
                   105 
                   ) 
                 
               
             
           
         
       
     
     The gradient can hence be approximated to error ϵ with O(poly(M 1 , M 2 , K 1 , L, s, Δ, μ)) computation on a classical computer and using only the Hadamard test, Gibbs state preparation and LCU on a quantum device. 
     Notably the expression in Eq. 105 can now be evaluated with a quantum-classical hybrid device by evaluating each term in the trace separately via a Hadamard test and, since the number of terms is only polynomial, and then evaluating the whole sum efficiently on a classical device. 
     Proof. 
     For the proof we perform the following steps. Let σ i (ρ) be the singular values of ρ, which are equivalently the eigenvalues since ρ is Hermitian. Then observe that the gradient can be separated in different terms, i.e., let log K     1     ,M     1     s σ v  be the approximation as given above for a finite sample of the expectation values    s , then 
     
       
         
           
             
               
                 
                   
                      
                     
                       
                         
                           ∂ 
                           θ 
                         
                          
                         
                           Tr 
                            
                           
                             [ 
                             
                               ρlog 
                                
                               
                                 σ 
                                 υ 
                               
                             
                             ] 
                           
                         
                       
                       - 
                       
                         
                           ∂ 
                           θ 
                         
                          
                         
                           Tr 
                            
                           
                             [ 
                             
                               ρ 
                                
                               
                                 log 
                                 
                                   
                                     K 
                                     1 
                                   
                                   , 
                                   
                                     M 
                                     1 
                                   
                                 
                                 s 
                               
                                
                               
                                 
                                   σ 
                                   ~ 
                                 
                                 υ 
                               
                             
                             ] 
                           
                         
                       
                     
                      
                   
                   ≤ 
                   ≤ 
                   
                     
                       ∑ 
                       i 
                     
                      
                     
                       
                         
                           σ 
                           i 
                         
                          
                         
                           ( 
                           ρ 
                           ) 
                         
                       
                       · 
                       
                          
                         
                           
                             ∂ 
                             θ 
                           
                            
                           
                             [ 
                             
                               
                                 log 
                                  
                                 
                                   σ 
                                   υ 
                                 
                               
                               - 
                               
                                 
                                   log 
                                   
                                     
                                       K 
                                       1 
                                     
                                     , 
                                     
                                       M 
                                       1 
                                     
                                   
                                   s 
                                 
                                  
                                 
                                   
                                     σ 
                                     ~ 
                                   
                                   υ 
                                 
                               
                             
                             ] 
                           
                         
                          
                       
                     
                   
                   ≤ 
                   
                     
                       ∑ 
                       i 
                     
                      
                     
                       
                         
                           σ 
                           i 
                         
                          
                         
                           ( 
                           ρ 
                           ) 
                         
                       
                       · 
                       
                         ( 
                         
                           
                              
                             
                               
                                 ∂ 
                                 θ 
                               
                                
                               
                                 [ 
                                 
                                   
                                     log 
                                      
                                     
                                       σ 
                                       υ 
                                     
                                   
                                   - 
                                   
                                     
                                       log 
                                       
                                         
                                           K 
                                           1 
                                         
                                         , 
                                         
                                           M 
                                           1 
                                         
                                       
                                     
                                      
                                     
                                       σ 
                                       υ 
                                     
                                   
                                 
                                 ] 
                               
                             
                              
                           
                           + 
                           
                              
                             
                               
                                 ∂ 
                                 θ 
                               
                                
                               
                                 [ 
                                 
                                   
                                     
                                       log 
                                       
                                         
                                           K 
                                           1 
                                         
                                         , 
                                         
                                           M 
                                           1 
                                         
                                       
                                     
                                      
                                     
                                       σ 
                                       υ 
                                     
                                   
                                   - 
                                   
                                     
                                       log 
                                       
                                         
                                           K 
                                           1 
                                         
                                         , 
                                         
                                           M 
                                           1 
                                         
                                       
                                     
                                      
                                     
                                       
                                         σ 
                                         ~ 
                                       
                                       υ 
                                     
                                   
                                 
                                 ] 
                               
                             
                              
                           
                           + 
                           
                              
                             
                               
                                 ∂ 
                                 θ 
                               
                                
                               
                                 [ 
                                 
                                   
                                     
                                       log 
                                       
                                         
                                           K 
                                           1 
                                         
                                         , 
                                         
                                           M 
                                           1 
                                         
                                       
                                     
                                      
                                     
                                       
                                         σ 
                                         ~ 
                                       
                                       υ 
                                     
                                   
                                   - 
                                   
                                     
                                       log 
                                       
                                         
                                           K 
                                           1 
                                         
                                         , 
                                         
                                           M 
                                           1 
                                         
                                       
                                       s 
                                     
                                      
                                     
                                       
                                         σ 
                                         ~ 
                                       
                                       υ 
                                     
                                   
                                 
                                 ] 
                               
                             
                              
                           
                         
                         ) 
                       
                     
                   
                 
               
               
                 
                   ( 
                   106 
                   ) 
                 
               
             
           
         
       
     
     where the second step follows from the Von-Neumann trace inequality and the terms are (1) the error in approximating the logarithm, (2) the error introduced by the divided difference and the approximation of σ v  as a Fourier-like series, and (3) is the finite sampling approximation error. It is now possible to bound the different terms separately, and to start with the first part which is in general harder to estimate. The bound is partitioned into three terms, corresponding to the three different approximations taken above. 
     
       
         
           
             
               
                 
                   
                       
                   
                    
                   
                     
                        
                       
                         
                           ∂ 
                           θ 
                         
                          
                         
                           [ 
                           
                             
                               log 
                                
                               
                                 σ 
                                 υ 
                               
                             
                             - 
                             
                               
                                 log 
                                 
                                   
                                     K 
                                     1 
                                   
                                   , 
                                   
                                     M 
                                     1 
                                   
                                 
                               
                                
                               
                                 σ 
                                 υ 
                               
                             
                           
                           ] 
                         
                       
                        
                     
                     ≤ 
                   
                 
               
               
                 
                   ( 
                   107 
                   ) 
                 
               
             
             
               
                 
                   
                       
                   
                    
                   
                     ≤ 
                     
                       
                          
                         
                           
                             ∂ 
                             θ 
                           
                            
                           
                             
                               ∑ 
                               
                                 k 
                                 = 
                                 
                                   
                                     K 
                                     1 
                                   
                                   + 
                                   1 
                                 
                               
                               ∞ 
                             
                              
                             
                                 
                             
                              
                             
                               
                                 
                                   
                                     ( 
                                     
                                       - 
                                       1 
                                     
                                     ) 
                                   
                                   k 
                                 
                                 k 
                               
                                
                               
                                 σ 
                                 υ 
                                 k 
                               
                             
                           
                         
                          
                       
                       + 
                       
                          
                         
                           
                             ∂ 
                             θ 
                           
                            
                           
                             
                               ∑ 
                               
                                 k 
                                 = 
                                 1 
                               
                               
                                 K 
                                 1 
                               
                             
                              
                             
                                 
                             
                              
                             
                               
                                 
                                   
                                     ( 
                                     
                                       - 
                                       1 
                                     
                                     ) 
                                   
                                   k 
                                 
                                 k 
                               
                                
                               
                                 
                                   ∑ 
                                   
                                     l 
                                     = 
                                     L 
                                   
                                   ∞ 
                                 
                                  
                                 
                                   
                                     b 
                                     l 
                                     
                                       ( 
                                       k 
                                       ) 
                                     
                                   
                                    
                                   
                                     
                                       sin 
                                       l 
                                     
                                      
                                     
                                       ( 
                                       
                                         
                                           σ 
                                           υ 
                                         
                                          
                                         π 
                                          
                                         
                                           / 
                                         
                                          
                                         2 
                                       
                                       ) 
                                     
                                   
                                 
                               
                             
                           
                         
                          
                       
                     
                   
                 
               
               
                 
                   ( 
                   108 
                   ) 
                 
               
             
             
               
                 
                   + 
                   
                      
                     
                       
                         ∂ 
                         θ 
                       
                        
                       
                         
                           ∑ 
                           
                             k 
                             = 
                             1 
                           
                           
                             K 
                             1 
                           
                         
                          
                         
                             
                         
                          
                         
                           
                             
                               
                                 ( 
                                 
                                   - 
                                   1 
                                 
                                 ) 
                               
                               k 
                             
                             k 
                           
                            
                           
                             
                               ∑ 
                               
                                 l 
                                 = 
                                 L 
                               
                               ∞ 
                             
                              
                             
                               
                                 
                                   
                                     b 
                                     l 
                                     
                                       ( 
                                       k 
                                       ) 
                                     
                                   
                                    
                                   
                                     ( 
                                     
                                       1 
                                       2 
                                     
                                     ) 
                                   
                                 
                                 l 
                               
                                
                               
                                 
                                   ∑ 
                                   
                                     m 
                                     ∈ 
                                     
                                       
                                         [ 
                                         
                                           0 
                                           , 
                                           
                                             
                                               ⌈ 
                                               
                                                 l 
                                                 / 
                                                 2 
                                               
                                               ⌉ 
                                             
                                             - 
                                             
                                               M 
                                               1 
                                             
                                           
                                         
                                         ] 
                                       
                                       ⋃ 
                                       
                                         [ 
                                         
                                           
                                             
                                               ⌊ 
                                               
                                                 l 
                                                 / 
                                                 2 
                                               
                                               ⌋ 
                                             
                                             + 
                                             
                                               M 
                                               1 
                                             
                                           
                                           , 
                                           l 
                                         
                                         ] 
                                       
                                     
                                   
                                   
                                       
                                   
                                 
                                  
                                 
                                     
                                 
                                  
                                 
                                   
                                     
                                       ( 
                                       
                                         - 
                                         1 
                                       
                                       ) 
                                     
                                     m 
                                   
                                    
                                   
                                     e 
                                     
                                       
                                         i 
                                          
                                         
                                           ( 
                                           
                                             
                                               2 
                                                
                                               
                                                   
                                               
                                                
                                               m 
                                             
                                             - 
                                             l 
                                           
                                           ) 
                                         
                                       
                                        
                                       
                                         σ 
                                         υ 
                                       
                                        
                                       
                                         π 
                                         / 
                                         2 
                                       
                                     
                                   
                                 
                               
                             
                           
                         
                       
                     
                      
                   
                 
               
               
                 
                   ( 
                   109 
                   ) 
                 
               
             
           
         
       
     
     The first term can be bound in the following way: 
     
       
         
           
             
               
                 
                   
                     
                       ≤ 
                       
                         
                           ∑ 
                           
                             k 
                             = 
                             
                               
                                 K 
                                 1 
                               
                               + 
                               1 
                             
                           
                           ∞ 
                         
                          
                         
                           
                              
                             
                               σ 
                               υ 
                             
                              
                           
                           
                             k 
                             - 
                             1 
                           
                         
                       
                     
                     = 
                     
                       
                         
                            
                           
                             σ 
                             υ 
                           
                            
                         
                         
                           K 
                           1 
                         
                       
                       
                         1 
                         - 
                         
                            
                           
                             σ 
                             υ 
                           
                            
                         
                       
                     
                   
                   , 
                 
               
               
                 
                   ( 
                   110 
                   ) 
                 
               
             
           
         
       
     
     and, assuming ∥σ v ∥&lt;1, we hence can set 
         K   1 ≥log((1−∥σ v ∥)ϵ/9)/log(∥σ v ∥)  (111)
 
     appropriately in order to achieve an ϵ/9 error. The second term can be bound by assuming that ∥σ v π∥&lt;1, and choosing 
     
       
         
           
             
               
                 
                   
                     L 
                     ≥ 
                     
                       log 
                        
                       
                         
                           ( 
                           
                             ϵ 
                             
                               9 
                                
                               π 
                                
                               
                                   
                               
                                
                               K 
                                
                               
                                  
                                 
                                   
                                     ∂ 
                                     
                                       σ 
                                       υ 
                                     
                                   
                                   
                                     ∂ 
                                     θ 
                                   
                                 
                                  
                               
                             
                           
                           ) 
                         
                         
                           log 
                            
                           
                             ( 
                             
                               
                                  
                                 
                                   σ 
                                   υ 
                                 
                                  
                               
                                
                               π 
                             
                             ) 
                           
                         
                       
                     
                   
                   , 
                 
               
               
                 
                   ( 
                   112 
                   ) 
                 
               
             
           
         
       
     
     which we derive by observing that 
     
       
         
           
             
               
                 
                   ≤ 
                   
                     
                       ∑ 
                       
                         k 
                         = 
                         1 
                       
                       K 
                     
                      
                     
                       
                         1 
                         k 
                       
                        
                       
                         
                           ∑ 
                           
                             l 
                             = 
                             L 
                           
                           ∞ 
                         
                          
                         
                           
                             b 
                             l 
                             
                               ( 
                               k 
                               ) 
                             
                           
                            
                           l 
                            
                           
                             
                                
                               
                                 
                                   sin 
                                   
                                     l 
                                     - 
                                     1 
                                   
                                 
                                  
                                 
                                   ( 
                                   
                                     
                                       σ 
                                       υ 
                                     
                                      
                                     
                                       π 
                                       / 
                                       2 
                                     
                                   
                                   ) 
                                 
                               
                                
                             
                             · 
                             
                                
                               
                                 
                                   π 
                                   2 
                                 
                                  
                                 
                                   
                                     ∂ 
                                     
                                       σ 
                                       υ 
                                     
                                   
                                   
                                     ∂ 
                                     θ 
                                   
                                 
                               
                                
                             
                           
                         
                       
                     
                   
                 
               
               
                 
                   ( 
                   113 
                   ) 
                 
               
             
             
               
                 
                   &lt; 
                   
                     
                       ∑ 
                       
                         k 
                         = 
                         1 
                       
                       K 
                     
                      
                     
                       
                         1 
                         k 
                       
                        
                       
                         
                           ∑ 
                           
                             l 
                             = 
                             
                               L 
                               + 
                               1 
                             
                           
                           ∞ 
                         
                          
                         
                           
                             b 
                             l 
                             
                               ( 
                               k 
                               ) 
                             
                           
                            
                           π 
                            
                           
                             
                               
                                  
                                 
                                   
                                     σ 
                                     υ 
                                   
                                    
                                   π 
                                 
                                  
                               
                               
                                 l 
                                 - 
                                 1 
                               
                             
                             · 
                             
                                
                               
                                 
                                   ∂ 
                                   
                                     σ 
                                     υ 
                                   
                                 
                                 
                                   ∂ 
                                   θ 
                                 
                               
                                
                             
                           
                         
                       
                     
                   
                 
               
               
                 
                   ( 
                   114 
                   ) 
                 
               
             
             
               
                 
                   
                     ≤ 
                     
                       
                         ∑ 
                         
                           k 
                           = 
                           1 
                         
                         K 
                       
                        
                       
                         
                           1 
                           k 
                         
                          
                         π 
                          
                         
                           
                             
                                
                               
                                 
                                   σ 
                                   υ 
                                 
                                  
                                 π 
                               
                                
                             
                             L 
                           
                           · 
                           
                              
                             
                               
                                 ∂ 
                                 
                                   σ 
                                   υ 
                                 
                               
                               
                                 ∂ 
                                 θ 
                               
                             
                              
                           
                         
                       
                     
                   
                   , 
                 
               
               
                 
                   ( 
                   115 
                   ) 
                 
               
             
           
         
       
     
     where l&lt;2 l  is used in the second step. Finally, the last term can be bound similarly, which yields 
     
       
         
           
             
               
                 
                   ≤ 
                   
                     
                       ∑ 
                       
                         k 
                         = 
                         1 
                       
                       K 
                     
                      
                     
                       
                         1 
                         k 
                       
                        
                       
                         
                           ∑ 
                           
                             l 
                             = 
                             1 
                           
                           L 
                         
                          
                         
                           
                             b 
                             l 
                             
                               ( 
                               k 
                               ) 
                             
                           
                            
                           
                             
                               e 
                               
                                 
                                   - 
                                   2 
                                 
                                  
                                 
                                   
                                     
                                       ( 
                                       
                                         M 
                                         1 
                                       
                                       ) 
                                     
                                     2 
                                   
                                   / 
                                   l 
                                 
                               
                             
                             · 
                             l 
                             · 
                             
                               π 
                               2 
                             
                           
                            
                           
                              
                             
                               
                                 ∂ 
                                 
                                   σ 
                                   υ 
                                 
                               
                               
                                 ∂ 
                                 θ 
                               
                             
                              
                           
                         
                       
                     
                   
                 
               
               
                 
                   ( 
                   116 
                   ) 
                 
               
             
             
               
                 
                   ≤ 
                   
                     
                       ∑ 
                       
                         k 
                         = 
                         1 
                       
                       K 
                     
                      
                     
                       
                         L 
                         k 
                       
                        
                       
                         
                           ∑ 
                           
                             l 
                             = 
                             1 
                           
                           L 
                         
                          
                         
                           
                             b 
                             l 
                             
                               ( 
                               k 
                               ) 
                             
                           
                            
                           
                             e 
                             
                               
                                 - 
                                 2 
                               
                                
                               
                                 
                                   ( 
                                   
                                     M 
                                     1 
                                   
                                   ) 
                                 
                                 2 
                               
                                
                               
                                 / 
                               
                                
                               L 
                             
                           
                            
                           
                             π 
                             2 
                           
                            
                           
                              
                             
                               
                                 ∂ 
                                 
                                   σ 
                                   υ 
                                 
                               
                               
                                 ∂ 
                                 θ 
                               
                             
                              
                           
                         
                       
                     
                   
                 
               
               
                 
                   ( 
                   117 
                   ) 
                 
               
             
             
               
                 
                   
                     ≤ 
                     
                       
                         ∑ 
                         
                           k 
                           = 
                           1 
                         
                         K 
                       
                        
                       
                         
                           L 
                           k 
                         
                          
                         
                           e 
                           
                             
                               - 
                               2 
                             
                              
                             
                               
                                 ( 
                                 
                                   M 
                                   1 
                                 
                                 ) 
                               
                               2 
                             
                              
                             
                               / 
                             
                              
                             L 
                           
                         
                          
                         
                           π 
                           2 
                         
                          
                         
                            
                           
                             
                               ∂ 
                               
                                 σ 
                                 υ 
                               
                             
                             
                               ∂ 
                               θ 
                             
                           
                            
                         
                       
                     
                     ≤ 
                     
                       
                         
                           K 
                            
                           L 
                            
                           π 
                         
                         2 
                       
                        
                       
                         e 
                         
                           
                             - 
                             2 
                           
                            
                           
                             
                               ( 
                               
                                 M 
                                 1 
                               
                               ) 
                             
                             2 
                           
                            
                           
                             / 
                           
                            
                           L 
                         
                       
                        
                       
                          
                         
                           
                             ∂ 
                             
                               σ 
                               υ 
                             
                           
                           
                             ∂ 
                             θ 
                           
                         
                          
                       
                     
                   
                   , 
                 
               
               
                 
                   ( 
                   118 
                   ) 
                 
               
             
           
         
       
     
     and we can hence chose 
     
       
         
           
             
               
                 
                   
                     M 
                     1 
                   
                   ≥ 
                   
                     
                       L 
                        
                       
                           
                       
                        
                       
                         log 
                         ( 
                         
                           
                             9 
                              
                             
                                
                               
                                 
                                   ∂ 
                                   
                                     σ 
                                     υ 
                                   
                                 
                                 
                                   ∂ 
                                   θ 
                                 
                               
                                
                             
                              
                             
                               K 
                               1 
                             
                              
                             L 
                              
                             π 
                           
                           
                             2 
                              
                             ϵ 
                           
                         
                         ) 
                       
                     
                   
                 
               
               
                 
                   ( 
                   119 
                   ) 
                 
               
             
           
         
       
     
     in order to decrease the error to e/ 3  for the first term in Eq. 106.
 
For the second term, first note that with the notation chosen, ∥∂ θ [log K     1     ,M     1   σ v −log K     1     ,M     1   {tilde over (σ)} v ]∥ is the difference between the log-approximation where the gradient of σ v  is still exact, i.e., Eq. 89, and the version where the gradient is approximated via divided differences and the linear combination of unitaries, given in Eq. 105. Recall that the first level approximation was given by
 
     
       
         
           
             
               
                 
                   
                     
                       ∑ 
                       
                         m 
                         = 
                         
                           - 
                           
                             M 
                             1 
                           
                         
                       
                       
                         M 
                         1 
                       
                     
                      
                     
                       
                         
                           i 
                            
                           
                             c 
                             m 
                           
                            
                           m 
                            
                           π 
                         
                         2 
                       
                        
                       
                         
                           ∫ 
                           0 
                           1 
                         
                          
                         
                           ds 
                            
                           
                               
                           
                            
                           
                             Tr 
                              
                             
                               [ 
                               
                                 ρ 
                                  
                                 
                                   e 
                                   
                                     
                                       
                                         i 
                                          
                                         s 
                                          
                                         π 
                                          
                                         m 
                                       
                                       2 
                                     
                                      
                                     
                                       σ 
                                       υ 
                                     
                                   
                                 
                                  
                                 
                                   
                                     ∂ 
                                     
                                       σ 
                                       υ 
                                     
                                   
                                   
                                     ∂ 
                                     θ 
                                   
                                 
                                  
                                 
                                   e 
                                   
                                     
                                       
                                         
                                           i 
                                            
                                           
                                             ( 
                                             
                                               1 
                                               - 
                                               s 
                                             
                                             ) 
                                           
                                         
                                          
                                         π 
                                          
                                         m 
                                       
                                       2 
                                     
                                      
                                     
                                       σ 
                                       υ 
                                     
                                   
                                 
                               
                               ] 
                             
                           
                         
                       
                     
                   
                   , 
                 
               
               
                 
                   ( 
                   120 
                   ) 
                 
               
             
           
         
       
     
     where one returns from the expectation value formulation back to the integral formulation to avoid consideration of potential errors due to sampling. 
     Bounding the difference hence yields one term from the divided difference approximation of the gradient and an error from the Fourier series, which are both bounded separately. Denoting ∂{tilde over (p)}(θ k )/∂θ as the divided difference and the LCU approximation of the Fourier series 1 , and with ∂p(θ k )/∂θ the divided difference without approximation via the Fourier series,  1  which effectively means that the coefficients of the interpolation polynomial are approximated 
     
       
         
           
             
               
                 
                   
                       
                   
                    
                   
                     
                        
                       
                         
                           ∂ 
                           θ 
                         
                          
                         
                           [ 
                           
                             
                               
                                 log 
                                 
                                   
                                     K 
                                     1 
                                   
                                   , 
                                   
                                     M 
                                     1 
                                   
                                 
                               
                                
                               
                                 σ 
                                 υ 
                               
                             
                             - 
                             
                               
                                 log 
                                 
                                   
                                     K 
                                     1 
                                   
                                   , 
                                   
                                     M 
                                     1 
                                   
                                 
                               
                                
                               
                                 
                                   σ 
                                   ~ 
                                 
                                 υ 
                               
                             
                           
                           ] 
                         
                       
                        
                     
                     ≤ 
                   
                 
               
               
                 
                   ( 
                   121 
                   ) 
                 
               
             
             
               
                 
                   ≤ 
                   
                      
                     
                       
                         ∑ 
                         
                           m 
                           = 
                           
                             - 
                             
                               M 
                               1 
                             
                           
                         
                         
                           M 
                           1 
                         
                       
                        
                       
                         
                           
                             i 
                              
                             
                               c 
                               m 
                             
                              
                             m 
                              
                             π 
                           
                           2 
                         
                          
                         
                           
                             ∫ 
                             0 
                             1 
                           
                            
                           
                             ds 
                              
                             
                                 
                             
                              
                             
                               Tr 
                                
                               
                                 [ 
                                 
                                   ρ 
                                    
                                   
                                     
                                       e 
                                       
                                         
                                           
                                             i 
                                              
                                             s 
                                              
                                             π 
                                              
                                             m 
                                           
                                           2 
                                         
                                          
                                         
                                           σ 
                                           υ 
                                         
                                       
                                     
                                      
                                     
                                       ( 
                                       
                                         
                                           
                                             ∂ 
                                             
                                               σ 
                                               υ 
                                             
                                           
                                           
                                             ∂ 
                                             θ 
                                           
                                         
                                         - 
                                         
                                           
                                             ∂ 
                                             
                                               
                                                 p 
                                                 ~ 
                                               
                                                
                                               
                                                 ( 
                                                 
                                                   θ 
                                                   k 
                                                 
                                                 ) 
                                               
                                             
                                           
                                           
                                             ∂ 
                                             θ 
                                           
                                         
                                       
                                       ) 
                                     
                                   
                                    
                                   
                                     e 
                                     
                                       
                                         
                                           
                                             i 
                                              
                                             
                                               ( 
                                               
                                                 1 
                                                 - 
                                                 s 
                                               
                                               ) 
                                             
                                           
                                            
                                           π 
                                            
                                           m 
                                         
                                         2 
                                       
                                        
                                       
                                         σ 
                                         υ 
                                       
                                     
                                   
                                 
                                 ] 
                               
                             
                           
                         
                       
                     
                      
                   
                 
               
               
                 
                   ( 
                   122 
                   ) 
                 
               
             
             
               
                 
                   
                       
                   
                    
                   
                     ≤ 
                     
                       
                         
                           
                             M 
                             1 
                           
                            
                           π 
                            
                           
                             
                                
                               a 
                                
                             
                             1 
                           
                         
                         2 
                       
                        
                       
                         
                           ∫ 
                           0 
                           1 
                         
                          
                         
                           d 
                            
                           s 
                            
                           
                             
                               ∑ 
                               i 
                             
                              
                             
                               
                                 
                                   σ 
                                   i 
                                 
                                  
                                 
                                   ( 
                                   ρ 
                                   ) 
                                 
                               
                                
                               
                                  
                                 
                                   
                                     
                                       ∂ 
                                       
                                         σ 
                                         υ 
                                       
                                     
                                     
                                       ∂ 
                                       θ 
                                     
                                   
                                   - 
                                   
                                     
                                       ∂ 
                                       
                                         
                                           p 
                                           ~ 
                                         
                                          
                                         
                                           ( 
                                           
                                             θ 
                                             k 
                                           
                                           ) 
                                         
                                       
                                     
                                     
                                       ∂ 
                                       θ 
                                     
                                   
                                 
                                  
                               
                             
                           
                         
                       
                     
                   
                 
               
               
                 
                   ( 
                   123 
                   ) 
                 
               
             
             
               
                 
                   ≤ 
                   
                     
                       
                         
                           M 
                           1 
                         
                          
                         π 
                          
                         
                           
                              
                             a 
                              
                           
                           1 
                         
                       
                       2 
                     
                      
                     
                       
                         ∫ 
                         0 
                         1 
                       
                        
                       
                         d 
                          
                         s 
                          
                         
                           
                             ∑ 
                             i 
                           
                            
                           
                             
                               
                                 σ 
                                 i 
                               
                                
                               
                                 ( 
                                 ρ 
                                 ) 
                               
                             
                              
                             
                               ( 
                               
                                 
                                    
                                   
                                     
                                       
                                         ∂ 
                                         
                                           σ 
                                           υ 
                                         
                                       
                                       
                                         ∂ 
                                         θ 
                                       
                                     
                                     - 
                                     
                                       
                                         ∂ 
                                         
                                           p 
                                            
                                           
                                             ( 
                                             
                                               θ 
                                               k 
                                             
                                             ) 
                                           
                                         
                                       
                                       
                                         ∂ 
                                         θ 
                                       
                                     
                                   
                                    
                                 
                                 + 
                                 
                                    
                                   
                                     
                                       
                                         ∂ 
                                         
                                           p 
                                            
                                           
                                             ( 
                                             
                                               θ 
                                               k 
                                             
                                             ) 
                                           
                                         
                                       
                                       
                                         ∂ 
                                         θ 
                                       
                                     
                                     - 
                                     
                                       
                                         ∂ 
                                         
                                           
                                             p 
                                             ~ 
                                           
                                            
                                           
                                             ( 
                                             
                                               θ 
                                               k 
                                             
                                             ) 
                                           
                                         
                                       
                                       
                                         ∂ 
                                         θ 
                                       
                                     
                                   
                                    
                                 
                               
                               ) 
                             
                           
                         
                       
                     
                   
                 
               
               
                 
                   ( 
                   124 
                   ) 
                 
               
             
             
               
                 
                   ≤ 
                   
                     
                       
                         
                           M 
                           1 
                         
                          
                         
                           
                              
                             a 
                              
                           
                           1 
                         
                          
                         π 
                       
                       2 
                     
                      
                     
                       
                         ∫ 
                         0 
                         1 
                       
                        
                       
                         d 
                          
                         s 
                          
                         
                           
                             ∑ 
                             i 
                           
                            
                           
                             
                               
                                 σ 
                                 i 
                               
                                
                               
                                 ( 
                                 ρ 
                                 ) 
                               
                             
                              
                             
                               ( 
                               
                                 
                                   
                                      
                                     
                                       
                                         
                                           ∂ 
                                           
                                             μ 
                                             + 
                                             1 
                                           
                                         
                                          
                                         
                                           σ 
                                           υ 
                                         
                                       
                                       
                                         ∂ 
                                         
                                           θ 
                                           
                                             μ 
                                             + 
                                             1 
                                           
                                         
                                       
                                     
                                      
                                   
                                    
                                   
                                     
                                       ( 
                                       
                                         Δ 
                                         
                                           μ 
                                           - 
                                           1 
                                         
                                       
                                       ) 
                                     
                                     μ 
                                   
                                    
                                   
                                     
                                       
                                         max 
                                         k 
                                       
                                        
                                       
                                         
                                           ( 
                                           
                                             μ 
                                             - 
                                             k 
                                           
                                           ) 
                                         
                                         ! 
                                       
                                     
                                     
                                       
                                         ( 
                                         
                                           μ 
                                           + 
                                           1 
                                         
                                         ) 
                                       
                                       ! 
                                     
                                   
                                 
                                 + 
                                 
                                   
                                     ∑ 
                                     
                                       j 
                                       = 
                                       0 
                                     
                                     μ 
                                   
                                    
                                   
                                     
                                        
                                       
                                         
                                           ℒ 
                                           
                                             μ 
                                             , 
                                             j 
                                           
                                           ′ 
                                         
                                          
                                         
                                           ( 
                                           
                                             θ 
                                             j 
                                           
                                           ) 
                                         
                                       
                                        
                                     
                                      
                                     
                                        
                                       
                                         
                                           σ 
                                           υ 
                                         
                                         - 
                                         
                                           
                                             σ 
                                             ~ 
                                           
                                           υ 
                                         
                                       
                                        
                                     
                                   
                                 
                               
                               ) 
                             
                           
                         
                       
                     
                   
                 
               
               
                 
                   ( 
                   125 
                   ) 
                 
               
             
             
               
                 
                   
                     ≤ 
                     
                       
                         
                           
                             M 
                             1 
                           
                            
                           
                             
                                
                               a 
                                
                             
                             1 
                           
                            
                           π 
                         
                         2 
                       
                        
                       
                         ( 
                         
                           
                             
                                
                               
                                 
                                   
                                     ∂ 
                                     
                                       μ 
                                       + 
                                       1 
                                     
                                   
                                    
                                   
                                     σ 
                                     υ 
                                   
                                 
                                 
                                   ∂ 
                                   
                                     θ 
                                     
                                       μ 
                                       + 
                                       1 
                                     
                                   
                                 
                               
                                
                             
                              
                             
                               
                                 ( 
                                 
                                   Δ 
                                   
                                     μ 
                                     - 
                                     1 
                                   
                                 
                                 ) 
                               
                               μ 
                             
                              
                             
                               
                                 μ 
                                 ! 
                               
                               
                                 
                                   ( 
                                   
                                     μ 
                                     + 
                                     1 
                                   
                                   ) 
                                 
                                 ! 
                               
                             
                           
                           + 
                           
                             μ 
                              
                             
                               
                                  
                                 
                                   
                                     ℒ 
                                     
                                       μ 
                                       , 
                                       j 
                                     
                                     ′ 
                                   
                                    
                                   
                                     ( 
                                     
                                       θ 
                                       j 
                                     
                                     ) 
                                   
                                 
                                  
                               
                               ∞ 
                             
                              
                             
                               ϵ 
                               2 
                             
                           
                         
                         ) 
                       
                     
                   
                   , 
                 
               
               
                 
                   ( 
                   126 
                   ) 
                 
               
             
           
         
       
     
     where ∥a∥ 1 =Σ k=1   K     1   /k, and in the last step the results of Lemma 4 are used. Under appropriate assumptions on the grid-spacing for the divided difference scheme Δ and the number of evaluated points p as well as a bound on the μ+1-st derivative of σ v  w.r.t. θ, it is now possible to also bound this error. In order to do so, it is necessary to analyze the μ+1-st derivative of σ v =Tr h  [e −H ]/Z with Z=Tr [e −H ]. For this, 
     
       
         
           
             
               
                 
                   
                      
                     
                       
                         
                           ∂ 
                           
                             μ 
                             + 
                             1 
                           
                         
                          
                         
                           σ 
                           υ 
                         
                       
                       
                         ∂ 
                         
                           θ 
                           
                             μ 
                             + 
                             1 
                           
                         
                       
                     
                      
                   
                   ≤ 
                   
                     
                       ∑ 
                       
                         p 
                         = 
                         1 
                       
                       
                         μ 
                         + 
                         1 
                       
                     
                      
                     
                       
                         ( 
                         
                           
                             
                               
                                 μ 
                                 + 
                                 1 
                               
                             
                           
                           
                             
                               p 
                             
                           
                         
                         ) 
                       
                        
                       
                          
                         
                           
                             
                               
                                 ∂ 
                                 p 
                               
                                
                               T 
                             
                              
                             
                               
                                 r 
                                 h 
                               
                                
                               
                                 [ 
                                 
                                   e 
                                   
                                     - 
                                     H 
                                   
                                 
                                 ] 
                               
                             
                           
                           
                             ∂ 
                             
                               θ 
                               p 
                             
                           
                         
                          
                       
                        
                       
                          
                         
                           
                             
                               ∂ 
                               
                                 μ 
                                 + 
                                 1 
                                 - 
                                 p 
                               
                             
                              
                             
                               Z 
                               
                                 - 
                                 1 
                               
                             
                           
                           
                             ∂ 
                             
                               θ 
                               
                                 μ 
                                 + 
                                 1 
                                 - 
                                 p 
                               
                             
                           
                         
                          
                       
                     
                   
                   ≤ 
                   
                     
                       2 
                       
                         μ 
                         + 
                         1 
                       
                     
                      
                     
                       
                         max 
                         p 
                       
                        
                       
                         
                            
                           
                             
                               
                                 
                                   ∂ 
                                   p 
                                 
                                  
                                 T 
                               
                                
                               
                                 
                                   r 
                                   h 
                                 
                                  
                                 
                                   [ 
                                   
                                     e 
                                     
                                       - 
                                       H 
                                     
                                   
                                   ] 
                                 
                               
                             
                             
                               ∂ 
                               
                                 θ 
                                 p 
                               
                             
                           
                            
                         
                          
                         
                            
                           
                             
                               
                                 ∂ 
                                 
                                   μ 
                                   + 
                                   1 
                                   - 
                                   p 
                                 
                               
                                
                               
                                 Z 
                                 
                                   - 
                                   1 
                                 
                               
                             
                             
                               ∂ 
                               
                                 θ 
                                 
                                   μ 
                                   + 
                                   1 
                                   - 
                                   p 
                                 
                               
                             
                           
                            
                         
                       
                     
                   
                 
               
               
                 
                   ( 
                   127 
                   ) 
                 
               
             
           
         
       
     
     Also, 
     
       
         
           
             
               
                 
                   
                      
                     
                       
                         
                           
                             ∂ 
                             p 
                           
                            
                           T 
                         
                          
                         
                           
                             r 
                             h 
                           
                            
                           
                             [ 
                             
                               e 
                               
                                 - 
                                 H 
                               
                             
                             ] 
                           
                         
                       
                       
                         ∂ 
                         
                           θ 
                           p 
                         
                       
                     
                      
                   
                   ≤ 
                   
                     
                       dim 
                        
                       
                         ( 
                         
                           H 
                           h 
                         
                         ) 
                       
                     
                      
                     
                        
                       
                         
                           
                             ∂ 
                             q 
                           
                            
                           
                             e 
                             
                               - 
                               H 
                             
                           
                         
                         
                           ∂ 
                           
                             θ 
                             q 
                           
                         
                       
                        
                     
                   
                 
               
               
                 
                   ( 
                   128 
                   ) 
                 
               
             
           
         
       
     
     where dim(H h )=2 n     h   . In order to bound this, the infinitesimal expansion of the exponent is employed, i.e., 
     
       
         
           
             
               
                 
                   
                     
                       
                         
                            
                           
                             
                               
                                 ∂ 
                                 q 
                               
                                
                               
                                 e 
                                 
                                   - 
                                   H 
                                 
                               
                             
                             
                               ∂ 
                               
                                 θ 
                                 q 
                               
                             
                           
                            
                         
                         = 
                           
                          
                         
                            
                           
                             
                               
                                 ∂ 
                                 q 
                               
                               
                                 ∂ 
                                 
                                   θ 
                                   q 
                                 
                               
                             
                              
                             
                               
                                 lim 
                                 
                                   r 
                                   → 
                                   ∞ 
                                 
                               
                                
                               
                                 
                                   ∏ 
                                   
                                     j 
                                     = 
                                     1 
                                   
                                   r 
                                 
                                  
                                 
                                   e 
                                   
                                     
                                       - 
                                       H 
                                     
                                     / 
                                     r 
                                   
                                 
                               
                             
                           
                            
                         
                       
                     
                   
                   
                     
                       
                         = 
                           
                          
                         
                            
                           
                             
                               lim 
                               
                                 r 
                                 → 
                                 ∞ 
                               
                             
                              
                             
                                 
                             
                              
                             
                               ( 
                               
                                 
                                   
                                     
                                       
                                         ∂ 
                                         q 
                                       
                                        
                                       
                                         e 
                                         
                                           
                                             - 
                                             H 
                                           
                                           / 
                                           r 
                                         
                                       
                                     
                                     
                                       ∂ 
                                       
                                         θ 
                                         q 
                                       
                                     
                                   
                                    
                                   
                                     
                                       ∏ 
                                       
                                         j 
                                         = 
                                         2 
                                       
                                       r 
                                     
                                      
                                     
                                       e 
                                       
                                         
                                           - 
                                           H 
                                         
                                         / 
                                         r 
                                       
                                     
                                   
                                 
                                 + 
                               
                             
                           
                         
                       
                     
                   
                   
                     
                       
                         
                             
                            
                           
                             
                               
                                 
                                   
                                     ∂ 
                                     
                                       q 
                                       - 
                                       1 
                                     
                                   
                                    
                                   
                                     e 
                                     
                                       
                                         - 
                                         H 
                                       
                                       / 
                                       r 
                                     
                                   
                                 
                                 
                                   ∂ 
                                   
                                     θ 
                                     
                                       q 
                                       - 
                                       1 
                                     
                                   
                                 
                               
                                
                               
                                 
                                   ∂ 
                                   
                                     e 
                                     
                                       
                                         - 
                                         H 
                                       
                                       / 
                                       r 
                                     
                                   
                                 
                                 
                                   ∂ 
                                   θ 
                                 
                               
                                
                               
                                 
                                   ∏ 
                                   
                                     j 
                                     = 
                                     3 
                                   
                                   r 
                                 
                                  
                                 
                                   e 
                                   
                                     
                                       - 
                                       H 
                                     
                                     / 
                                     r 
                                   
                                 
                               
                             
                             + 
                             … 
                           
                            
                           
                               
                           
                           ) 
                         
                          
                       
                     
                   
                   
                     
                       
                         ≤ 
                           
                          
                         
                           
                             lim 
                             
                               r 
                               → 
                               ∞ 
                             
                           
                            
                           
                               
                           
                            
                           
                             
                                
                               
                                 
                                   
                                     
                                       ( 
                                       
                                         
                                           
                                             ∂ 
                                             H 
                                           
                                           / 
                                           r 
                                         
                                         
                                           ∂ 
                                           θ 
                                         
                                       
                                        
                                     
                                     q 
                                   
                                    
                                   
                                       
                                   
                                   · 
                                   
                                     r 
                                     q 
                                   
                                 
                                 + 
                                 
                                   O 
                                    
                                   
                                     ( 
                                     
                                       1 
                                       r 
                                     
                                     ) 
                                   
                                 
                               
                               ) 
                             
                              
                             
                                
                               
                                 e 
                                 
                                   - 
                                   H 
                                 
                               
                                
                             
                           
                         
                       
                     
                   
                   
                     
                       
                         
                           = 
                             
                            
                           
                             
                               
                                  
                                 
                                   
                                     ∂ 
                                     H 
                                   
                                   
                                     ∂ 
                                     θ 
                                   
                                 
                                  
                               
                               q 
                             
                              
                             
                                
                               
                                 e 
                                 
                                   - 
                                   H 
                                 
                               
                                
                             
                           
                         
                         , 
                       
                     
                   
                 
               
               
                 
                   ( 
                   129 
                   ) 
                 
               
             
           
         
       
     
     where the last step follows from the r q  terms and that the error introduced by the commutations above will be of O(1/r). Observing that ∂ θ     i   H=∂ θ     i   Σ j θ j H j =H i  and assuming that λ max  is the largest singular eigenvalue of H, this can be bounded by λ max   q ∥e −H ∥. 
     
       
         
           
             
               
                 
                   
                     
                       
                         
                            
                           
                             
                               
                                 
                                   ∂ 
                                   p 
                                 
                                  
                                 T 
                               
                                
                               
                                 
                                   r 
                                   h 
                                 
                                  
                                 
                                   [ 
                                   
                                     e 
                                     
                                       - 
                                       H 
                                     
                                   
                                   ] 
                                 
                               
                             
                             
                               ∂ 
                               
                                 θ 
                                 p 
                               
                             
                           
                            
                         
                         ≤ 
                           
                          
                         
                           
                             dim 
                              
                             
                               ( 
                               
                                 H 
                                 h 
                               
                               ) 
                             
                           
                            
                           
                              
                             
                               
                                 
                                   ∂ 
                                   q 
                                 
                                  
                                 
                                   e 
                                   
                                     - 
                                     H 
                                   
                                 
                               
                               
                                 ∂ 
                                 
                                   θ 
                                   q 
                                 
                               
                             
                              
                           
                         
                       
                     
                   
                   
                     
                       
                         ≤ 
                           
                          
                         
                           
                             λ 
                             max 
                             p 
                           
                            
                           
                             dim 
                              
                             
                               ( 
                               
                                 H 
                                 h 
                               
                               ) 
                             
                           
                            
                           
                              
                             
                               
                                 T 
                                 T 
                               
                                
                               
                                 r 
                                  
                                 
                                   [ 
                                   
                                     e 
                                     
                                       - 
                                       H 
                                     
                                   
                                   ] 
                                 
                               
                             
                              
                           
                         
                       
                     
                   
                 
               
               
                 
                   ( 
                   130 
                   ) 
                 
               
             
             
               
                 
                   
                     
                       
                         
                            
                           
                             
                               
                                 ∂ 
                                 
                                   μ 
                                   + 
                                   1 
                                   - 
                                   p 
                                 
                               
                                
                               
                                 Z 
                                 
                                   - 
                                   1 
                                 
                               
                             
                             
                               ∂ 
                               
                                 θ 
                                 
                                   μ 
                                   + 
                                   1 
                                   - 
                                   p 
                                 
                               
                             
                           
                            
                         
                         ≤ 
                           
                          
                         
                           
                             
                               
                                 
                                   ( 
                                   
                                     μ 
                                     + 
                                     1 
                                     - 
                                     p 
                                   
                                   ) 
                                 
                                 ! 
                               
                               | 
                               
                                 λ 
                                 max 
                               
                                
                               
                                 | 
                                 
                                   μ 
                                   + 
                                   1 
                                   - 
                                   p 
                                 
                               
                             
                             
                               Z 
                               
                                 μ 
                                 + 
                                 2 
                                 - 
                                 p 
                               
                             
                           
                            
                           
                             Tr 
                              
                             
                               [ 
                               
                                 e 
                                 
                                   - 
                                   H 
                                 
                               
                               ] 
                             
                           
                         
                       
                     
                   
                   
                     
                       
                         ≤ 
                           
                          
                         
                           
                             
                               ( 
                               
                                 
                                   μ 
                                   + 
                                   1 
                                   - 
                                   p 
                                 
                                 
                                   e 
                                    
                                   Z 
                                 
                               
                               ) 
                             
                             
                               μ 
                               + 
                               1 
                               - 
                               p 
                             
                           
                            
                           
                             e 
                             Z 
                           
                            
                           
                             
                                
                               
                                 λ 
                                 max 
                               
                                
                             
                             
                               μ 
                               + 
                               1 
                               - 
                               p 
                             
                           
                            
                           T 
                            
                           
                             r 
                              
                             
                               [ 
                               
                                 e 
                                 
                                   - 
                                   H 
                                 
                               
                               ] 
                             
                           
                         
                       
                     
                   
                   
                     
                       
                         = 
                           
                          
                         
                           
                             
                               ( 
                               
                                 
                                   μ 
                                   + 
                                   1 
                                   - 
                                   p 
                                 
                                 
                                   e 
                                    
                                   Z 
                                 
                               
                               ) 
                             
                             
                               μ 
                               + 
                               1 
                               - 
                               p 
                             
                           
                            
                           e 
                            
                           
                             
                                
                               
                                 λ 
                                 max 
                               
                                
                             
                             
                               μ 
                               + 
                               1 
                               - 
                               p 
                             
                           
                         
                       
                     
                   
                 
               
               
                 
                   ( 
                   131 
                   ) 
                 
               
             
           
         
       
     
     We can therefore find a bound for Eq. 127 as 
     
       
         
           
             
               
                 
                   
                      
                     
                       
                         
                           ∂ 
                           
                             μ 
                             + 
                             1 
                           
                         
                          
                         
                           σ 
                           υ 
                         
                       
                       
                         ∂ 
                         
                           θ 
                           
                             μ 
                             + 
                             1 
                           
                         
                       
                     
                      
                   
                   ≤ 
                   
                     e 
                      
                     
                       2 
                       
                         μ 
                         + 
                         1 
                         + 
                         
                           n 
                           h 
                         
                       
                     
                      
                     
                       λ 
                       max 
                       
                         μ 
                         + 
                         1 
                       
                     
                      
                     
                        
                       
                         
                           Tr 
                           h 
                         
                          
                         
                           [ 
                           
                             e 
                             
                               - 
                               H 
                             
                           
                           ] 
                         
                       
                        
                     
                      
                     
                       
                         max 
                         p 
                       
                        
                       
                         
                           
                             ( 
                             
                               
                                 μ 
                                 + 
                                 1 
                                 - 
                                 p 
                               
                               
                                 e 
                                  
                                 Z 
                               
                             
                             ) 
                           
                           
                             μ 
                             + 
                             1 
                             - 
                             p 
                           
                         
                         . 
                       
                     
                   
                 
               
               
                 
                   ( 
                   132 
                   ) 
                 
               
             
           
         
       
     
     Plugging this result into the bound from above yields 
     
       
         
           
             
               
                 
                   
                     
                        
                       
                         
                           ∂ 
                           θ 
                         
                          
                         
                           [ 
                           
                             
                               
                                 log 
                                 
                                   
                                     K 
                                     1 
                                   
                                   , 
                                   
                                     M 
                                     1 
                                   
                                 
                               
                                
                               
                                 σ 
                                 υ 
                               
                             
                             - 
                             
                               
                                 log 
                                 
                                   
                                     K 
                                     1 
                                   
                                   , 
                                   
                                     M 
                                     1 
                                   
                                 
                               
                                
                               
                                 
                                   σ 
                                   ~ 
                                 
                                 υ 
                               
                             
                           
                           ] 
                         
                       
                        
                     
                     ≤ 
                     
                       
                         
                           
                             
                               M 
                               1 
                             
                              
                             
                               
                                  
                                 a 
                                  
                               
                               1 
                             
                              
                             π 
                           
                           2 
                         
                          
                         
                           ( 
                           
                             e 
                              
                             
                               2 
                               
                                 μ 
                                 + 
                                 1 
                                 + 
                                 
                                   n 
                                   h 
                                 
                               
                             
                              
                             
                               λ 
                               max 
                               
                                 μ 
                                 + 
                                 1 
                               
                             
                              
                             
                                
                               
                                 
                                   Tr 
                                   h 
                                 
                                  
                                 
                                   [ 
                                   
                                     e 
                                     
                                       - 
                                       H 
                                     
                                   
                                   ] 
                                 
                               
                                
                             
                              
                             
                               
                                 max 
                                 p 
                               
                                
                               
                                 
                                   
                                     ( 
                                     
                                       
                                         μ 
                                         + 
                                         1 
                                         - 
                                         p 
                                       
                                       
                                         e 
                                          
                                         Z 
                                       
                                     
                                     ) 
                                   
                                   
                                     μ 
                                     + 
                                     1 
                                     - 
                                     p 
                                   
                                 
                                  
                                 
                                   
                                     ( 
                                     
                                       Δ 
                                       
                                         μ 
                                         - 
                                         1 
                                       
                                     
                                     ) 
                                   
                                   μ 
                                 
                                  
                                 
                                   1 
                                   
                                     μ 
                                     + 
                                     1 
                                   
                                 
                               
                             
                           
                           ) 
                         
                       
                       + 
                       
                         
                           
                             
                               M 
                               1 
                             
                              
                             
                               
                                  
                                 a 
                                  
                               
                               1 
                             
                              
                             π 
                           
                           2 
                         
                          
                         
                           ( 
                           
                             μ 
                              
                             
                               
                                  
                                 
                                   
                                     ℒ 
                                     
                                       μ 
                                       , 
                                       j 
                                     
                                     ′ 
                                   
                                    
                                   
                                     ( 
                                     
                                       θ 
                                       j 
                                     
                                     ) 
                                   
                                 
                                  
                               
                               ∞ 
                             
                              
                             
                               ϵ 
                               2 
                             
                           
                           ) 
                         
                       
                     
                   
                   , 
                 
               
               
                 
                   ( 
                   133 
                   ) 
                 
               
             
           
         
       
     
     Note that under the reasonable assumption that 2≤μ&lt;&lt;Z, the maximum is achieved for p=μ+1, and hence the upper bound is 
     
       
         
           
             
               
                 
                   
                     
                       
                         
                           
                             M 
                             1 
                           
                            
                           
                             
                                
                               a 
                                
                             
                             1 
                           
                            
                           π 
                         
                         2 
                       
                        
                       
                         ( 
                         
                           
                             
                               2 
                               
                                 n 
                                 h 
                               
                             
                              
                             
                               
                                 e 
                                  
                                 
                                   ( 
                                   
                                     2 
                                      
                                     
                                        
                                       
                                         λ 
                                         max 
                                       
                                        
                                     
                                   
                                   ) 
                                 
                               
                               
                                 μ 
                                 + 
                                 1 
                               
                             
                              
                             
                                
                               
                                 
                                   Tr 
                                   h 
                                 
                                  
                                 
                                   [ 
                                   
                                     e 
                                     
                                       - 
                                       H 
                                     
                                   
                                   ] 
                                 
                               
                                
                             
                              
                             
                               
                                 ( 
                                 
                                   Δ 
                                   
                                     μ 
                                     - 
                                     1 
                                   
                                 
                                 ) 
                               
                               μ 
                             
                              
                             
                               1 
                               
                                 μ 
                                 + 
                                 1 
                               
                             
                           
                           + 
                           
                             μ 
                              
                             
                               
                                  
                                 
                                   
                                     ℒ 
                                     
                                       μ 
                                       , 
                                       j 
                                     
                                     ′ 
                                   
                                    
                                   
                                     ( 
                                     
                                       θ 
                                       j 
                                     
                                     ) 
                                   
                                 
                                  
                               
                               ∞ 
                             
                              
                             
                               ϵ 
                               2 
                             
                           
                         
                         ) 
                       
                     
                     ≤ 
                     
                       
                         
                           
                             M 
                             1 
                           
                            
                           
                             
                                
                               a 
                                
                             
                             1 
                           
                            
                           π 
                         
                         2 
                       
                        
                       
                         ( 
                         
                           
                             
                               2 
                               
                                 n 
                                 h 
                               
                             
                              
                             
                               
                                 e 
                                  
                                 
                                   ( 
                                   
                                     2 
                                      
                                     
                                        
                                       
                                         λ 
                                         max 
                                       
                                       ⌉ 
                                     
                                   
                                   ) 
                                 
                               
                               
                                 μ 
                                 + 
                                 1 
                               
                             
                              
                             
                                
                               
                                 
                                   Tr 
                                   h 
                                 
                                  
                                 
                                   [ 
                                   
                                     e 
                                     
                                       - 
                                       H 
                                     
                                   
                                   ] 
                                 
                               
                                
                             
                              
                             
                               
                                 ( 
                                 
                                   Δ 
                                   
                                     μ 
                                     - 
                                     1 
                                   
                                 
                                 ) 
                               
                               μ 
                             
                           
                           + 
                           
                             μ 
                              
                             
                               
                                  
                                 
                                   
                                     ℒ 
                                     
                                       μ 
                                       , 
                                       j 
                                     
                                     ′ 
                                   
                                    
                                   
                                     ( 
                                     
                                       θ 
                                       j 
                                     
                                     ) 
                                   
                                 
                                  
                               
                               ∞ 
                             
                              
                             
                               ϵ 
                               2 
                             
                           
                         
                         ) 
                       
                     
                   
                   , 
                 
               
               
                 
                   ( 
                   134 
                   ) 
                 
               
             
           
         
       
     
     and hence a bound is obtained on μ, the grid point number, in order to achieve an error of ϵ/6&gt;0 for the former term, which is given by 
     
       
         
           
             
               
                 
                   
                     μ 
                     ≥ 
                     
                       
                         ( 
                         
                           
                              
                             
                               λ 
                               max 
                             
                              
                           
                            
                           Δ 
                         
                         ) 
                       
                        
                       
                         exp 
                         ( 
                         
                           W 
                           ( 
                           
                             
                               log 
                               ( 
                               
                                 
                                   2 
                                   
                                     n 
                                     h 
                                   
                                 
                                  
                                 
                                   
                                     
                                       
                                         
                                           6 
                                            
                                           
                                             M 
                                             1 
                                           
                                            
                                           
                                             
                                                
                                               a 
                                                
                                             
                                             1 
                                           
                                            
                                           
                                             e 
                                             2 
                                           
                                            
                                           
                                              
                                             
                                               λ 
                                               max 
                                             
                                              
                                           
                                         
                                       
                                     
                                     
                                       
                                         
                                           π 
                                            
                                           
                                              
                                             
                                               
                                                 Tr 
                                                 h 
                                               
                                                
                                               
                                                 [ 
                                                 
                                                   e 
                                                   
                                                     - 
                                                     H 
                                                   
                                                 
                                                 ] 
                                               
                                             
                                              
                                           
                                         
                                       
                                     
                                   
                                   ϵ 
                                 
                               
                               ) 
                             
                             
                               2 
                                
                               
                                 λ 
                                 max 
                               
                                
                               Δ 
                             
                           
                           ) 
                         
                         ) 
                       
                     
                   
                   , 
                 
               
               
                 
                   ( 
                   135 
                   ) 
                 
               
             
           
         
       
     
     where W is the Lambert function, also known as product-log function, which generally grows slower than the logarithm in the asymptotic limit. Note that μ can hence be lower bounded by 
     
       
         
           
             
               
                 
                   
                     μ 
                     ≥ 
                     
                       
                         n 
                         h 
                       
                       + 
                       
                         log 
                         ( 
                         
                           
                             
                               
                                 
                                   6 
                                    
                                   
                                     M 
                                     1 
                                   
                                    
                                   
                                     
                                        
                                       a 
                                        
                                     
                                     1 
                                   
                                    
                                   
                                     e 
                                     2 
                                   
                                    
                                   
                                      
                                     
                                       λ 
                                       max 
                                     
                                      
                                   
                                 
                               
                             
                             
                               
                                 
                                   π 
                                    
                                   
                                      
                                     
                                       
                                         Tr 
                                         h 
                                       
                                        
                                       
                                         [ 
                                         
                                           e 
                                           
                                             - 
                                             H 
                                           
                                         
                                         ] 
                                       
                                     
                                      
                                   
                                 
                               
                             
                           
                           ϵ 
                         
                         ) 
                       
                     
                   
                   := 
                   
                     
                       n 
                       h 
                     
                     + 
                     
                       
                         log 
                          
                         
                           ( 
                           
                             
                               
                                 M 
                                 1 
                               
                                
                               Λ 
                             
                             ϵ 
                           
                           ) 
                         
                       
                       . 
                     
                   
                 
               
               
                 
                   ( 
                   136 
                   ) 
                 
               
             
           
         
       
     
     For convenience, ϵ is chosen such that n h +log(M 1 Λ/ϵ) is an integer. This is done simply to avoid having to keep track of ceiling or floor functions in the following discussion where μ=n h +log(M 1 Λ/ϵ) is chosen. 
     For the second part, the derivative of the Lagrangian interpolation polynomial will be bounded. First, note that 
     
       
         
           
             
               
                 ℒ 
                 
                   μ 
                   , 
                   j 
                 
                 ′ 
               
                
               
                 ( 
                 θ 
                 ) 
               
             
             = 
             
               
                 
                   Σ 
                   
                     
                       l 
                       = 
                       0 
                     
                     ; 
                     
                       l 
                       ≠ 
                       j 
                     
                   
                   μ 
                 
                  
                 
                   ( 
                   
                     
                       Π 
                       
                         
                           
                             k 
                             = 
                             0 
                           
                           ; 
                           
                             k 
                             ≠ 
                             j 
                           
                         
                         , 
                         l 
                       
                     
                      
                     
                       
                         θ 
                         - 
                         
                           θ 
                           k 
                         
                       
                       
                         
                           θ 
                           j 
                         
                         - 
                         
                           θ 
                           k 
                         
                       
                     
                   
                   ) 
                 
               
                
               
                 1 
                 
                   
                     θ 
                     j 
                   
                   - 
                   
                     θ 
                     l 
                   
                 
               
             
           
         
       
     
     for a chosen discretization of the space such that θ k −θ j =(k−j)Δ/μ can be bound by using a central difference formula, such that an uneven number of points may be used (i.e., one takes μ=2κ+1 for positive integer κ) and chooses the point m at which one evaluates the gradient as the central point of the mesh. Note that in this case, for μ≥5 and θ m  being the parameters at the midpoint of the stencil, 
     
       
         
           
             
               
                 
                   
                     
                       
                         
                            
                           
                             ℒ 
                             
                               μ 
                               , 
                               j 
                             
                             ′ 
                           
                            
                         
                         ∞ 
                       
                       ≤ 
                       
                         
                           ∑ 
                           
                             l 
                             ≠ 
                             j 
                           
                         
                          
                         
                           
                             ∏ 
                             
                               
                                 k 
                                 ≠ 
                                 j 
                               
                               , 
                               l 
                             
                           
                            
                           
                             
                               
                                  
                                 
                                   
                                     θ 
                                     m 
                                   
                                   - 
                                   
                                     θ 
                                     k 
                                   
                                 
                                  
                               
                               
                                  
                                 
                                   
                                     θ 
                                     j 
                                   
                                   - 
                                   
                                     θ 
                                     k 
                                   
                                 
                                  
                               
                             
                              
                             
                               1 
                               
                                  
                                 
                                   
                                     θ 
                                     l 
                                   
                                   - 
                                   
                                     θ 
                                     j 
                                   
                                 
                                  
                               
                             
                           
                         
                       
                       ≤ 
                       
                         
                           
                             
                               ( 
                               
                                 κ 
                                 ! 
                               
                               ) 
                             
                             2 
                           
                           
                             
                               ( 
                               
                                 κ 
                                 ! 
                               
                               ) 
                             
                             2 
                           
                         
                          
                         
                           μ 
                           Δ 
                         
                          
                         
                           
                             ∑ 
                             
                               l 
                               ≠ 
                               j 
                             
                           
                            
                           
                             1 
                             
                               | 
                               
                                 l 
                                 - 
                                 j 
                               
                               | 
                             
                           
                         
                       
                       ≤ 
                       
                         
                           
                             2 
                              
                             μ 
                           
                           Δ 
                         
                          
                         
                           
                             ∑ 
                             
                               l 
                               = 
                               1 
                             
                             κ 
                           
                            
                           
                             1 
                             l 
                           
                         
                       
                       ≤ 
                       
                         
                           
                             2 
                              
                             μ 
                           
                           Δ 
                         
                          
                         
                           ( 
                           
                             1 
                             + 
                             
                               
                                 ∫ 
                                 1 
                                 
                                   κ 
                                   - 
                                   1 
                                 
                               
                                
                               
                                 
                                   1 
                                   l 
                                 
                                  
                                 d 
                                  
                                 
                                     
                                 
                                  
                                  
                               
                             
                           
                           ) 
                         
                       
                     
                     = 
                     
                       
                         
                           
                             2 
                              
                             μ 
                           
                           Δ 
                         
                          
                         
                           ( 
                           
                             1 
                             + 
                             
                               log 
                                
                               
                                 ( 
                                 
                                   
                                     ( 
                                     
                                       μ 
                                       - 
                                       3 
                                     
                                     ) 
                                   
                                    
                                   
                                     / 
                                   
                                    
                                   2 
                                 
                                 ) 
                               
                             
                           
                           ) 
                         
                       
                       ≤ 
                       
                         
                           
                             5 
                              
                             μ 
                           
                           Δ 
                         
                          
                         
                           log 
                            
                           
                             ( 
                             
                               μ 
                                
                               
                                 / 
                               
                                
                               2 
                             
                             ) 
                           
                         
                       
                     
                   
                   , 
                 
               
               
                 
                   ( 
                   137 
                   ) 
                 
               
             
           
         
       
     
     where the last inequality follows from the fact that μ≥5 and 1+ln(5/2)&lt;(5/2) ln(5/2). Now, plugging in the μ from Eq. 148, this error is bound by 
     
       
         
           
             
               
                 
                   
                     
                       
                         
                            
                           
                             ℒ 
                             
                               μ 
                               , 
                               j 
                             
                             ′ 
                           
                            
                         
                         ∞ 
                       
                       ≤ 
                       
                         
                           
                             
                               5 
                                
                               
                                 n 
                                 h 
                               
                             
                             + 
                             
                               5 
                                
                               
                                 log 
                                  
                                 
                                   ( 
                                   
                                     
                                       
                                         M 
                                         1 
                                       
                                        
                                       Λ 
                                     
                                     ϵ 
                                   
                                   ) 
                                 
                               
                             
                           
                           Δ 
                         
                          
                         
                           log 
                            
                           
                             ( 
                             
                               
                                 
                                   n 
                                   h 
                                 
                                  
                                 
                                   / 
                                 
                                  
                                 2 
                               
                               + 
                               
                                 
                                   log 
                                    
                                   
                                     ( 
                                     
                                       
                                         
                                           M 
                                           1 
                                         
                                          
                                         Λ 
                                       
                                       ϵ 
                                     
                                     ) 
                                   
                                 
                                  
                                 
                                   / 
                                 
                                  
                                 2 
                               
                             
                             ) 
                           
                         
                       
                     
                     = 
                     
                       
                         O 
                         ~ 
                       
                       ( 
                       
                         
                           
                             n 
                             h 
                           
                           + 
                           
                             log 
                              
                             
                               ( 
                               
                                 
                                   
                                     M 
                                     1 
                                   
                                    
                                   Λ 
                                 
                                 ϵ 
                               
                               ) 
                             
                           
                         
                         Δ 
                       
                       ) 
                     
                   
                   , 
                 
               
               
                 
                   ( 
                   138 
                   ) 
                 
               
             
           
         
       
     
     If an upper bound of ϵ/6 is desired for the second term of the error in Eq. 134, then the following is required: 
     
       
         
           
             
               
                 
                   
                     
                       
                         
                           ϵ 
                           2 
                         
                         ≤ 
                           
                          
                         
                           ϵ 
                           
                             15 
                              
                             
                               M 
                               1 
                             
                              
                             
                               
                                  
                                 a 
                                  
                               
                               1 
                             
                              
                             πμ 
                              
                             
                               
                                  
                                 
                                   
                                     ℒ 
                                     
                                       μ 
                                       , 
                                       j 
                                     
                                     ′ 
                                   
                                    
                                   
                                     ( 
                                     θ 
                                     ) 
                                   
                                 
                                  
                               
                               ∞ 
                             
                           
                         
                       
                     
                   
                   
                     
                       
                         ≤ 
                           
                          
                         
                           ϵΔ 
                           
                             
                               
                                 
                                   15 
                                    
                                   
                                     M 
                                     1 
                                   
                                    
                                   
                                     
                                        
                                       a 
                                        
                                     
                                     1 
                                   
                                    
                                   
                                     
                                       π 
                                        
                                       
                                         ( 
                                         
                                           
                                             n 
                                             h 
                                           
                                           + 
                                           
                                             log 
                                              
                                             
                                               ( 
                                               
                                                 
                                                   M 
                                                   1 
                                                 
                                                  
                                                 Λ 
                                                  
                                                 
                                                   / 
                                                 
                                                  
                                                 ϵ 
                                               
                                               ) 
                                             
                                           
                                         
                                         ) 
                                       
                                     
                                     2 
                                   
                                 
                               
                             
                             
                               
                                 
                                   log 
                                    
                                   
                                     ( 
                                     
                                       
                                         ( 
                                         
                                           
                                             n 
                                             h 
                                           
                                            
                                           
                                             / 
                                           
                                            
                                           2 
                                         
                                         ) 
                                       
                                       + 
                                       
                                         
                                           log 
                                            
                                           
                                             ( 
                                             
                                               
                                                 M 
                                                 1 
                                               
                                                
                                               Λ 
                                                
                                               
                                                 / 
                                               
                                                
                                               ϵ 
                                             
                                             ) 
                                           
                                         
                                          
                                         
                                           / 
                                         
                                          
                                         2 
                                       
                                     
                                     ) 
                                   
                                 
                               
                             
                           
                         
                       
                     
                   
                   
                     
                       
                         ≤ 
                           
                          
                         
                           ϵΔ 
                           
                             1 
                              
                             5 
                              
                             
                               M 
                               1 
                             
                              
                             
                               
                                  
                                 a 
                                  
                               
                               1 
                             
                              
                             π 
                              
                             
                               μ 
                               2 
                             
                              
                             
                               log 
                                
                               
                                 ( 
                                 
                                   
                                     ( 
                                     
                                       μ 
                                       - 
                                       1 
                                     
                                     ) 
                                   
                                    
                                   
                                     / 
                                   
                                    
                                   2 
                                 
                                 ) 
                               
                             
                           
                         
                       
                     
                   
                 
               
               
                 
                   ( 
                   139 
                   ) 
                 
               
             
           
         
       
     
     Hence, the approximation error due to the divided differences and Fourier series approximation of or is bounded by ϵ/3 for the above choice of ϵ 2  and μ. This bounds the second term in Eq. 126 by ϵ/3. 
     Finally, it is necessary to take into account the error ∥∂ θ [log K     1     ,M     1   {tilde over (σ)} v −log K     1     ,M     1     8 {tilde over (σ)} v ] which is introduced through the sampling process, i.e., through the finite sample estimate of    s [⋅] here indicated with the superscript s over the logarithm. Note that this error can be bound straightforwardly by Eq. 105. It is necessary only to bound the error introduced via the finite amount of samples we take, which is a well-known procedure. The concrete bounds for the sample error when estimating the expectation value are stated in the following lemma. 
     Lemma 6. 
     Let σ m  be the sample standard deviation of the random variable 
     
       
         
           
             
               
                 
                   
                     
                       
                          
                         ~ 
                       
                       
                         s 
                         ∈ 
                         
                           [ 
                           
                             0 
                             , 
                             1 
                           
                           ] 
                         
                       
                     
                      
                     
                       [ 
                       
                         Tr 
                          
                         
                           [ 
                           
                             ρ 
                              
                             
                                 
                             
                              
                             
                               e 
                               
                                 
                                   
                                     i 
                                      
                                     s 
                                      
                                     π 
                                      
                                     m 
                                   
                                   2 
                                 
                                  
                                 
                                   σ 
                                   υ 
                                 
                               
                             
                              
                             
                               e 
                               
                                 
                                   
                                     i 
                                      
                                     
                                         
                                     
                                      
                                     π 
                                      
                                     
                                         
                                     
                                      
                                     
                                       m 
                                       ′ 
                                     
                                   
                                   2 
                                 
                                  
                                 
                                   
                                     σ 
                                     υ 
                                   
                                    
                                   
                                     ( 
                                     
                                       θ 
                                       j 
                                     
                                     ) 
                                   
                                 
                               
                             
                              
                             
                               e 
                               
                                 
                                   
                                     
                                       i 
                                        
                                       
                                         ( 
                                         
                                           1 
                                           - 
                                           s 
                                         
                                         ) 
                                       
                                     
                                      
                                     π 
                                      
                                     m 
                                   
                                   2 
                                 
                                  
                                 
                                   σ 
                                   υ 
                                 
                               
                             
                           
                           ] 
                         
                       
                       ] 
                     
                   
                   , 
                 
               
               
                 
                   ( 
                   140 
                   ) 
                 
               
             
           
         
       
     
     such that the sample standard deviation is given by 
     
       
         
           
             
               σ 
               k 
             
             = 
             
               
                 
                   σ 
                   m 
                 
                 
                   k 
                 
               
               . 
             
           
         
       
     
     Then with probability at least 1−δ s , we can obtain an estimate which is within ϵ s σ m  of the mean by taking 
     
       
         
           
             k 
             = 
             
               4 
               
                 ϵ 
                 s 
                 2 
               
             
           
         
       
     
     samples for each sample estimate and taking the median of O(log(1/δ s )) such samples. 
     Proof. 
     From Chebyshev&#39;s inequality taking 
     
       
         
           
             k 
             = 
             
               4 
               
                 ϵ 
                 s 
                 2 
               
             
           
         
       
     
     samples implies that with probability of at least p=¾ each of the mean estimates is within 2σ k =ϵ s σ m  from the true mean. Therefore, using standard techniques, one takes the median of O(log(1/δ s )) such estimates which gives with probability 1−δ s  an estimate of the mean with error at most ϵ s σ m , which implies that the procedure must be repeated 
     
       
         
           
             O 
              
             
               ( 
               
                 
                   1 
                   
                     ϵ 
                     s 
                     2 
                   
                 
                  
                 
                   log 
                    
                   
                     ( 
                     
                       1 
                       
                         δ 
                         s 
                       
                     
                     ) 
                   
                 
               
               ) 
             
           
         
       
     
     times. 
     It is now possible to bound the error of the sampling step in the final estimate, denoting with ϵ s  the sample error, as 
     
       
         
           
             
               
                 
                   
                     
                       
                         ∑ 
                         
                           m 
                           = 
                           
                             - 
                             
                               M 
                               1 
                             
                           
                         
                         
                           M 
                           1 
                         
                       
                        
                       
                         
                           ∑ 
                           
                             
                               m 
                               ′ 
                             
                             = 
                             
                               - 
                               
                                 M 
                                 2 
                               
                             
                           
                           
                             M 
                             2 
                           
                         
                          
                         
                           
                              
                             
                               
                                 i 
                                  
                                 
                                   c 
                                   m 
                                 
                                  
                                 
                                   c 
                                   
                                     m 
                                     ′ 
                                   
                                 
                                  
                                 m 
                                  
                                 
                                     
                                 
                                  
                                 π 
                               
                               2 
                             
                              
                           
                            
                           
                             
                               ∑ 
                               
                                 j 
                                 = 
                                 0 
                               
                               μ 
                             
                              
                             
                               
                                  
                                 
                                   
                                     ℒ 
                                     
                                       μ 
                                       , 
                                       j 
                                     
                                     ′ 
                                   
                                    
                                   
                                     ( 
                                     θ 
                                     ) 
                                   
                                 
                                  
                               
                                
                               
                                 ϵ 
                                 s 
                               
                                
                               
                                 σ 
                                 m 
                               
                             
                           
                         
                       
                     
                     ≤ 
                     
                       
                         5 
                          
                         
                           
                              
                             a 
                              
                           
                           1 
                         
                          
                         
                           M 
                           1 
                         
                          
                         
                           ϵ 
                           s 
                         
                          
                         
                           σ 
                           m 
                         
                          
                         π 
                          
                         
                           μ 
                           2 
                         
                          
                         
                           log 
                            
                           
                             ( 
                             
                               μ 
                               2 
                             
                             ) 
                           
                         
                       
                       Δ 
                     
                     ≤ 
                     
                       ϵ 
                       3 
                     
                   
                   , 
                 
               
               
                 
                   ( 
                   141 
                   ) 
                 
               
             
           
         
       
     
     Hence, for 
     
       
         
           
             
               
                 
                   
                     
                       
                         
                           ϵ 
                           s 
                         
                         ≤ 
                           
                          
                         
                           
                             ϵ 
                              
                             
                                 
                             
                              
                             Δ 
                           
                           
                             15 
                              
                             
                               
                                  
                                 a 
                                  
                               
                               1 
                             
                              
                             
                               M 
                               1 
                             
                              
                             
                               σ 
                               m 
                             
                              
                             π 
                              
                             
                               μ 
                               2 
                             
                              
                             
                               log 
                                
                               
                                 ( 
                                 
                                   μ 
                                   2 
                                 
                                 ) 
                               
                             
                           
                         
                       
                     
                   
                   
                     
                       
                         ≤ 
                           
                          
                         
                           
                             ϵ 
                              
                             
                                 
                             
                              
                             Δ 
                           
                           
                             
                               
                                 
                                   15 
                                    
                                   
                                     M 
                                     1 
                                   
                                    
                                   
                                     
                                        
                                       a 
                                        
                                     
                                     1 
                                   
                                    
                                   
                                     σ 
                                     m 
                                   
                                    
                                   
                                     
                                       π 
                                        
                                       
                                         ( 
                                         
                                           
                                             n 
                                             h 
                                           
                                           + 
                                           
                                             log 
                                              
                                             
                                               ( 
                                               
                                                 
                                                   M 
                                                   1 
                                                 
                                                  
                                                 Λ 
                                                  
                                                 
                                                   / 
                                                 
                                                  
                                                 ϵ 
                                               
                                               ) 
                                             
                                           
                                         
                                         ) 
                                       
                                     
                                     2 
                                   
                                 
                               
                             
                             
                               
                                 
                                   log 
                                    
                                   
                                     ( 
                                     
                                       
                                         ( 
                                         
                                           
                                             n 
                                             n 
                                           
                                            
                                           
                                             / 
                                           
                                            
                                           2 
                                         
                                         ) 
                                       
                                       + 
                                       
                                         
                                           log 
                                            
                                           
                                             ( 
                                             
                                               
                                                 M 
                                                 1 
                                               
                                                
                                               Λ 
                                                
                                               
                                                 / 
                                               
                                                
                                               ϵ 
                                             
                                             ) 
                                           
                                         
                                          
                                         
                                           / 
                                         
                                          
                                         2 
                                       
                                     
                                     ) 
                                   
                                 
                               
                             
                           
                         
                       
                     
                   
                   
                     
                       
                         ≤ 
                           
                          
                         
                           
                             ϵ 
                              
                             
                                 
                             
                              
                             Δ 
                           
                           
                             15 
                              
                             
                               M 
                               1 
                             
                              
                             
                               
                                  
                                 a 
                                  
                               
                               1 
                             
                              
                             
                               σ 
                               m 
                             
                              
                             
                               πμ 
                               2 
                             
                              
                             
                               log 
                                
                               
                                 ( 
                                 
                                   μ 
                                    
                                   
                                     / 
                                   
                                    
                                   2 
                                 
                                 ) 
                               
                             
                           
                         
                       
                     
                   
                 
               
               
                 
                   ( 
                   142 
                   ) 
                 
               
             
           
         
       
     
     also the last term in Eq. 106 can be bounded by ϵ/3, which together results in an overall error of ϵ for the various approximation steps, which concludes the proof. 
     Notably all quantities which occur in these bounds are only polynomial in the number of the qubits. The lower bounds for the choice of parameters are summarized in the following inequalities (Eq. 143-150). 
     
       
         
           
             
               
                 
                   
                     M 
                     1 
                   
                   ≥ 
                   
                     
                       L 
                        
                       
                           
                       
                        
                       
                         log 
                         ( 
                         
                           
                             9 
                              
                             
                                
                               
                                 
                                   ∂ 
                                   
                                     σ 
                                     υ 
                                   
                                 
                                 
                                   ∂ 
                                   θ 
                                 
                               
                                
                             
                              
                             
                               K 
                               1 
                             
                              
                             L 
                              
                             π 
                           
                           
                             2 
                              
                             ϵ 
                           
                         
                         ) 
                       
                     
                   
                 
               
               
                 
                   ( 
                   143 
                   ) 
                 
               
             
             
               
                 
                   
                     M 
                     2 
                   
                   ≥ 
                   
                     ⌈ 
                     
                       
                         log 
                          
                         
                           ( 
                           
                             4 
                             
                               ϵ 
                               2 
                             
                           
                           ) 
                         
                       
                        
                       
                         
                           
                             ( 
                             
                               2 
                                
                               log 
                                
                               
                                 δ 
                                 u 
                                 
                                   - 
                                   1 
                                 
                               
                             
                             ) 
                           
                           
                             - 
                             1 
                           
                         
                       
                     
                     ⌉ 
                   
                 
               
               
                 
                   ( 
                   144 
                   ) 
                 
               
             
             
               
                 
                   
                     K 
                     1 
                   
                   ≥ 
                   
                     
                       log 
                        
                       
                         ( 
                         
                           
                             ( 
                             
                               1 
                               - 
                               
                                  
                                 
                                   σ 
                                   υ 
                                 
                                  
                               
                             
                             ) 
                           
                            
                           
                             ϵ 
                             / 
                             9 
                           
                         
                         ) 
                       
                     
                      
                     
                       / 
                     
                      
                     
                       log 
                        
                       
                         ( 
                         
                            
                           
                             σ 
                             υ 
                           
                            
                         
                         ) 
                       
                     
                   
                 
               
               
                 
                   ( 
                   145 
                   ) 
                 
               
             
             
               
                 
                   
                     K 
                     2 
                   
                   ≥ 
                   
                     
                       log 
                        
                       
                         ( 
                         
                           4 
                            
                           
                             / 
                           
                            
                           
                             ϵ 
                             2 
                           
                         
                         ) 
                       
                     
                     
                       log 
                        
                       
                         ( 
                         
                           δ 
                           u 
                           
                             - 
                             1 
                           
                         
                         ) 
                       
                     
                   
                 
               
               
                 
                   ( 
                   146 
                   ) 
                 
               
             
             
               
                 
                   L 
                   ≥ 
                   
                     
                       log 
                       ( 
                       
                         ϵ 
                         
                           9 
                            
                           π 
                            
                           
                             K 
                             1 
                           
                            
                           
                              
                             
                               
                                 ∂ 
                                 
                                   σ 
                                   υ 
                                 
                               
                               
                                 ∂ 
                                 θ 
                               
                             
                              
                           
                         
                       
                       ) 
                     
                     
                       log 
                        
                       
                         ( 
                         
                           
                              
                             
                               σ 
                               υ 
                             
                              
                           
                            
                           π 
                         
                         ) 
                       
                     
                   
                 
               
               
                 
                   ( 
                   147 
                   ) 
                 
               
             
             
               
                 
                   
                     μ 
                     ≥ 
                     
                       
                         n 
                         h 
                       
                       + 
                       
                         log 
                         ( 
                         
                           
                             
                               
                                 
                                   6 
                                    
                                   
                                     M 
                                     1 
                                   
                                    
                                   
                                     
                                        
                                       a 
                                        
                                     
                                     1 
                                   
                                    
                                   
                                     e 
                                     2 
                                   
                                    
                                   
                                      
                                     
                                       λ 
                                       max 
                                     
                                      
                                   
                                 
                               
                             
                             
                               
                                 
                                   π 
                                    
                                   
                                      
                                     
                                       
                                         Tr 
                                         h 
                                       
                                        
                                       
                                         [ 
                                         
                                           e 
                                           
                                             - 
                                             H 
                                           
                                         
                                         ] 
                                       
                                     
                                      
                                   
                                 
                               
                             
                           
                           ϵ 
                         
                         ) 
                       
                     
                   
                   := 
                   
                     
                       n 
                       h 
                     
                     + 
                     
                       log 
                        
                       
                         ( 
                         
                           
                             M 
                             1 
                           
                            
                           
                             Λ 
                             / 
                             ϵ 
                           
                         
                         ) 
                       
                     
                   
                 
               
               
                 
                   ( 
                   148 
                   ) 
                 
               
             
             
               
                 
                   
                     
                       
                         
                           ϵ 
                           2 
                         
                         ≤ 
                           
                          
                         
                           
                             ϵ 
                              
                             
                                 
                             
                              
                             Δ 
                           
                           
                             
                               
                                 
                                   15 
                                    
                                   
                                     M 
                                     1 
                                   
                                    
                                   
                                     
                                        
                                       a 
                                        
                                     
                                     1 
                                   
                                    
                                   
                                     
                                       π 
                                        
                                       
                                         ( 
                                         
                                           
                                             n 
                                             h 
                                           
                                           + 
                                           
                                             log 
                                              
                                             
                                               ( 
                                               
                                                 
                                                   M 
                                                   1 
                                                 
                                                  
                                                 
                                                   Λ 
                                                   / 
                                                   ϵ 
                                                 
                                               
                                               ) 
                                             
                                           
                                         
                                         ) 
                                       
                                     
                                     2 
                                   
                                 
                               
                             
                             
                               
                                 
                                   log 
                                    
                                   
                                     ( 
                                     
                                       
                                         ( 
                                         
                                           
                                             n 
                                             h 
                                           
                                            
                                           
                                             / 
                                           
                                            
                                           2 
                                         
                                         ) 
                                       
                                       + 
                                       
                                         
                                           log 
                                            
                                           
                                             ( 
                                             
                                               
                                                 M 
                                                 1 
                                               
                                                
                                               Λ 
                                                
                                               
                                                 / 
                                               
                                                
                                               ϵ 
                                             
                                             ) 
                                           
                                         
                                          
                                         
                                           / 
                                         
                                          
                                         2 
                                       
                                     
                                     ) 
                                   
                                 
                               
                             
                           
                         
                       
                     
                   
                   
                     
                       
                         ≤ 
                           
                          
                         
                           
                             ϵ 
                              
                             
                                 
                             
                              
                             Δ 
                           
                           
                             15 
                              
                             
                               M 
                               1 
                             
                              
                             
                               
                                  
                                 a 
                                  
                               
                               1 
                             
                              
                             π 
                              
                             
                               μ 
                               2 
                             
                              
                             
                               log 
                                
                               
                                 ( 
                                 
                                   
                                     ( 
                                     
                                       μ 
                                       - 
                                       1 
                                     
                                     ) 
                                   
                                    
                                   
                                     / 
                                   
                                    
                                   2 
                                 
                                 ) 
                               
                             
                           
                         
                       
                     
                   
                 
               
               
                 
                   ( 
                   149 
                   ) 
                 
               
             
             
               
                 
                   
                     
                       
                         
                           ϵ 
                           s 
                         
                         ≤ 
                           
                          
                         
                           
                             ϵ 
                              
                             
                                 
                             
                              
                             Δ 
                           
                           
                             
                               
                                 
                                   15 
                                    
                                   
                                     M 
                                     1 
                                   
                                    
                                   
                                     
                                        
                                       a 
                                        
                                     
                                     1 
                                   
                                    
                                   
                                     σ 
                                     m 
                                   
                                    
                                   
                                     
                                       π 
                                        
                                       
                                         ( 
                                         
                                           
                                             n 
                                             h 
                                           
                                           + 
                                           
                                             log 
                                              
                                             
                                               ( 
                                               
                                                 
                                                   M 
                                                   1 
                                                 
                                                  
                                                 Λ 
                                                  
                                                 
                                                   / 
                                                 
                                                  
                                                 ϵ 
                                               
                                               ) 
                                             
                                           
                                         
                                         ) 
                                       
                                     
                                     2 
                                   
                                 
                               
                             
                             
                               
                                 
                                   log 
                                    
                                   
                                     ( 
                                     
                                       
                                         ( 
                                         
                                           
                                             n 
                                             n 
                                           
                                            
                                           
                                             / 
                                           
                                            
                                           2 
                                         
                                         ) 
                                       
                                       + 
                                       
                                         
                                           log 
                                            
                                           
                                             ( 
                                             
                                               
                                                 M 
                                                 1 
                                               
                                                
                                               Λ 
                                                
                                               
                                                 / 
                                               
                                                
                                               ϵ 
                                             
                                             ) 
                                           
                                         
                                          
                                         
                                           / 
                                         
                                          
                                         2 
                                       
                                     
                                     ) 
                                   
                                 
                               
                             
                           
                         
                       
                     
                   
                   
                     
                       
                         ≤ 
                           
                          
                         
                           
                             ϵ 
                              
                             
                                 
                             
                              
                             Δ 
                           
                           
                             15 
                              
                             
                               M 
                               1 
                             
                              
                             
                               
                                  
                                 a 
                                  
                               
                               1 
                             
                              
                             
                               σ 
                               m 
                             
                              
                             π 
                              
                             
                               μ 
                               2 
                             
                              
                             
                               log 
                                
                               
                                 ( 
                                 
                                   μ 
                                    
                                   
                                     / 
                                   
                                    
                                   2 
                                 
                                 ) 
                               
                             
                           
                         
                       
                     
                   
                 
               
               
                 
                   ( 
                   150 
                   ) 
                 
               
             
           
         
       
     
     Operationalising. 
     In the following two established subroutines are used, namely sample based Hamiltonian simulation (aka the LMR protocol) [5], as well as the Hadamard test, in order to evaluate the gradient approximation as defined in Eq. 105. In order to hence derive the query complexity for this algorithm, it is necessary only to multiply the cost of the number of factors we need to evaluate with the query complexity of these routines. For this the following result is relied upon. 
     Theorem 3. 
     Sample based Hamiltonian simulation [6]] Let 0≤ϵ h ≤⅙ be an error parameter and let ρ be a density for which multiple copies are obtained through queries to a oracle O ρ . It is now possible to simulate the time evolution e −iρt  up to error ϵ h  in trace norm as long as ϵ h /t≤1/(6π) with Θ(t 2 /ϵ h ) copies of ρ and hence queries to O ρ . 
     Needed particularly are terms of the form 
     
       
         
           
             
               
                 
                   Tr 
                    
                   
                     [ 
                     
                       ρ 
                        
                       
                           
                       
                        
                       
                         e 
                         
                           
                             
                               is 
                                
                               
                                   
                               
                                
                               π 
                                
                               
                                   
                               
                                
                               m 
                             
                             2 
                           
                            
                           
                             σ 
                             υ 
                           
                         
                       
                        
                       
                         e 
                         
                           
                             
                               i 
                                
                               
                                   
                               
                                
                               π 
                                
                               
                                   
                               
                                
                               
                                 m 
                                 ′ 
                               
                             
                             2 
                           
                            
                           
                             
                               σ 
                               υ 
                             
                              
                             
                               ( 
                               
                                 θ 
                                 j 
                               
                               ) 
                             
                           
                         
                       
                        
                       
                         e 
                         
                           
                             
                               
                                 i 
                                  
                                 
                                   ( 
                                   
                                     1 
                                     - 
                                     s 
                                   
                                   ) 
                                 
                               
                                
                               π 
                                
                               
                                   
                               
                                
                               m 
                             
                             2 
                           
                            
                           
                             σ 
                             υ 
                           
                         
                       
                     
                     ] 
                   
                 
               
               
                 
                   ( 
                   151 
                   ) 
                 
               
             
           
         
       
     
     Note that it is possible to simulate every term in the trace (except ρ) via the sample based Hamiltonian simulation approach to error ϵ h  in trace norm. This will introduce a additional error which must be taken into account for the analysis. Let Ũ i , i∈{1,2,3} be the unitaries such that ∥U i −Ũ i ∥ * ≤ϵ h  where the U i  are corresponding to the factors in Eq. 151, i.e., 
     
       
         
           
             
               
                 U 
                 1 
               
               := 
               
                 e 
                 
                   
                     
                       i 
                        
                       s 
                        
                       π 
                        
                       m 
                     
                     2 
                   
                    
                   
                     σ 
                     υ 
                   
                 
               
             
             , 
             
               
                 U 
                 2 
               
               := 
               
                 e 
                 
                   
                     
                       i 
                        
                       
                           
                       
                        
                       π 
                        
                       
                           
                       
                        
                       
                         m 
                         ′ 
                       
                     
                     2 
                   
                    
                   
                     
                       σ 
                       υ 
                     
                      
                     
                       ( 
                       
                         θ 
                         j 
                       
                       ) 
                     
                   
                 
               
             
             , 
             
               
                 and 
                  
                 
                     
                 
                  
                 
                   U 
                   3 
                 
               
               := 
               
                 
                   e 
                   
                     
                       
                         
                           i 
                            
                           
                             ( 
                             
                               1 
                               - 
                               s 
                             
                             ) 
                           
                         
                          
                         π 
                          
                         m 
                       
                       2 
                     
                      
                     
                       σ 
                       υ 
                     
                   
                 
                 . 
               
             
           
         
       
     
     The error is now bounded as follows. First note that ∥Ũ i ∥≤∥Ũ i −U i ∥+∥U i ∥≤1+ϵ h , using Theorem 3 and the fact that the spectral norm is upper bounded by the trace norm. 
       Tr[ρ U   1   U   2   U   3 ]−Tr[ρ Ũ   1   Ũ   2   Ũ   3 ]=Tr[ρ U   1   U   2   U   3   −ρŨ   1   Ũ   2   Ũ   3 ]≤∥ U   1   U   2   U   3   −Ũ   1   Ũ   2   Ũ   3   ∥≤∥U   1   −Ũ   1   ∥∥Ũ   2   ∥∥Ũ   3   ∥+∥U   2   −Ũ   2   ∥Ũ   3   +∥U   3   −Ũ   3   ∥≤∥U   1   −Ũ   1 ∥ * (1+ϵ h ) 2   +∥U   2   −Ũ   2 ∥ * (1+ϵ h )+∥ U   3   −Ũ   3 ∥ * ≤ϵ h (1+ϵ h ) 2 +ϵ h (1+ϵ h )+ϵ h   =O (ϵ h ),  (152)
 
     neglecting higher orders of ϵ h , and where in the first step the Von-Neumann trace inequality is applied, as well as the fact that ρ is Hermitian. In the last step, moreover, the results of Theorem 3 are used. 
     One now requires O((max{M 1 ,M 2 }π) 2 /ϵ h ) queries to the oracles for σ v  for the evaluation of each term in the multi sum in Eq. 105. Note that the Hadamard test has a query cost of O(1). In order to hence achieve an overall error of ϵ in the gradient estimation, the error introduced by the sample based Hamiltonian simulation must also be of O(e). Therefore, it is required that 
     
       
         
           
             
               
                 ϵ 
                 h 
               
               ≤ 
               
                 O 
                  
                 
                   ( 
                   
                     
                       ϵ 
                        
                       
                           
                       
                        
                       Δ 
                     
                     
                       5 
                        
                       
                         
                            
                           a 
                            
                         
                         1 
                       
                        
                       
                         M 
                         1 
                       
                        
                       π 
                        
                       
                         μ 
                         2 
                       
                        
                       
                         log 
                          
                         
                           ( 
                           
                             μ 
                              
                             
                               / 
                             
                              
                             2 
                           
                           ) 
                         
                       
                     
                   
                   ) 
                 
               
             
             , 
           
         
       
     
     similar to the sample based error which yield the query complexity of 
     
       
         
           
             
               
                 
                   O 
                    
                   
                     ( 
                     
                       
                         max 
                          
                         
                           
                             { 
                             
                               
                                 M 
                                 1 
                               
                               , 
                               
                                 M 
                                 2 
                               
                             
                             } 
                           
                           2 
                         
                          
                         
                           
                              
                             a 
                              
                           
                           1 
                         
                          
                         
                           M 
                           1 
                         
                          
                         
                           π 
                           3 
                         
                          
                         
                           μ 
                           2 
                         
                          
                         
                           log 
                            
                           
                             ( 
                             
                               μ 
                                
                               
                                 / 
                               
                                
                               2 
                             
                             ) 
                           
                         
                       
                       
                         ϵ 
                          
                         
                             
                         
                          
                         Δ 
                       
                     
                     ) 
                   
                 
               
               
                 
                   ( 
                   153 
                   ) 
                 
               
             
           
         
       
     
     Adjusting the constants gives then the required bound of ϵ of the total error and the query complexity for the algorithm to the Gibbs state preparation procedure is consequentially given by the number of terms in Eq. 105 times the query complexity for the individual term, yielding 
     
       
         
           
             
               
                 
                   
                     O 
                     ( 
                     
                       
                         
                           M 
                           1 
                           2 
                         
                          
                         
                           M 
                           2 
                         
                          
                         max 
                          
                         
                           
                             { 
                             
                               
                                 M 
                                 1 
                               
                               , 
                               
                                 M 
                                 2 
                               
                             
                             } 
                           
                           2 
                         
                          
                         
                           
                              
                             a 
                             〛 
                           
                           1 
                         
                          
                         
                           σ 
                           m 
                         
                          
                         
                           π 
                           3 
                         
                          
                         
                           μ 
                           3 
                         
                          
                         
                           log 
                            
                           
                             ( 
                             
                               μ 
                               2 
                             
                             ) 
                           
                         
                       
                       
                         ϵ 
                          
                         
                             
                         
                          
                         
                           ϵ 
                           s 
                           2 
                         
                          
                         Δ 
                       
                     
                     ) 
                   
                   , 
                 
               
               
                 
                   ( 
                   154 
                   ) 
                 
               
             
           
         
       
     
     and classical precomputation polynomial in M 1 , M 2 , K 1 , L, s, Δ, μ, where the different quantities are defined in Eq. 143-150.
 
Taking into account the query complexity of the individual steps then results in the following theorem.
 
     Theorem 4. 
     Let ρ, σ v  being two density matrices, ∥σ v ∥&lt;1/π, and we have access to an oracle O H  for the d-sparse Hamiltonian H(θ) and an oracle O ρ  which returns copies of purified density matrix of the data ρ, and ϵ∈(0, ⅙) an error parameter. With probability at least ⅔ an estimate   of the gradient w.r.t. θ∈   D  of the relative entropy ∇ θ Tr [ρ log σ v ] is obtained, such that 
       ∥∇ θ Tr[ρ log σ v ]− ∥ max ≤ϵ,  (155)
 
     with 
     
       
         
           
             
               
                 
                   
                     
                       O 
                       ~ 
                     
                     ( 
                     
                       
                         
                           N 
                           z 
                         
                       
                        
                       
                         
                           D 
                            
                           
                              
                             
                               H 
                                
                               
                                 ( 
                                 θ 
                                 ) 
                               
                             
                              
                           
                            
                           d 
                            
                           
                               
                           
                            
                           
                             μ 
                             5 
                           
                            
                           γ 
                         
                         
                           ϵ 
                           3 
                         
                       
                     
                     ) 
                   
                   , 
                 
               
               
                 
                   ( 
                   156 
                   ) 
                 
               
             
           
         
       
     
     queries to O H  and O ρ , where μ∈O(n h +log(1/ϵ)), ∥∂ θ σ v ∥≤e γ , ∥σ v ∥≥2 −n     v    for n v  being the number of visible units and n h  being the number of hidden units, and 
         Õ (poly(γ, n   v   ,n   h ,log(1/ϵ)))  (157)
 
     classical precomputation. 
     Proof. 
     The runtime follows straightforwardly by using the bounds derived in Eq. 153 and Lemma 5, and by using the bounds for the parameters M 1 , M 2 , K 1 , L, μ, Δ, s given in Eq. (143-150). For the success probability for estimating the whole gradient with dimensionality d, it is now possible to again make use of the boosting scheme used in Eq. 61 to be 
     
       
         
           
             
               
                 
                   
                     
                       O 
                       ~ 
                     
                     ( 
                     
                       
                         
                           d 
                            
                           
                             
                                
                               a 
                                
                             
                             1 
                             3 
                           
                            
                           
                             σ 
                             m 
                             3 
                           
                            
                           
                             μ 
                             5 
                           
                            
                           
                             
                               log 
                               3 
                             
                              
                             
                               ( 
                               
                                 μ 
                                  
                                 
                                   / 
                                 
                                  
                                 2 
                               
                               ) 
                             
                           
                            
                           poly 
                            
                           
                               
                           
                            
                           
                             log 
                             
                               ( 
                               
                                 
                                   
                                      
                                     
                                       
                                         
                                           ∂ 
                                           σ 
                                         
                                          
                                         v 
                                       
                                       
                                         ∂ 
                                         θ 
                                       
                                     
                                      
                                   
                                   ϵ 
                                 
                                 , 
                                 
                                   
                                     
                                       n 
                                       h 
                                       2 
                                     
                                      
                                     
                                       
                                          
                                         a 
                                          
                                       
                                       1 
                                     
                                      
                                     
                                       σ 
                                       m 
                                     
                                   
                                   
                                     ϵ 
                                      
                                     
                                         
                                     
                                      
                                     Δ 
                                   
                                 
                               
                               ) 
                             
                           
                         
                         
                           
                             ϵ 
                             3 
                           
                            
                           
                             Δ 
                             3 
                           
                         
                       
                        
                       
                         log 
                          
                         
                           ( 
                           d 
                           ) 
                         
                       
                     
                     ) 
                   
                   , 
                 
               
               
                 
                   ( 
                   158 
                   ) 
                 
               
             
           
         
       
     
     where μ=n h +log(M 1 Λ/ϵ). 
     Next it is necessary to take into account the errors from the Gibbs state preparation given in Lemma 3. For this note that the error between the perfect Hamiltonian simulation of σ v  and the sample based Hamiltonian simulation with an erroneous density matrix denoted by Ũ, i.e., including the error from the Gibbs state preparation procedure, is given by 
       ∥ Ũ−e   −iσ     v     t   ∥≤∥Ũ−e   −i{tilde over (σ)}     v     t   ∥+∥e   −i{tilde over (σ)}     v     t   −e   −iσ     v     t ∥≤ϵ h +ϵ G   t   (159)
 
     where ϵ h  is the error of the sample based Hamiltonian simulation, which holds since the trace norm is an upper bound for the spectral norm, and ∥σ v −{tilde over (σ)} v ∥≤ϵ G  is the error for the Gibbs state preparation from Theorem 1 for a d-sparse Hamiltonian, for a cost 
     
       
         
           
             
               
                 
                   
                     
                        
                       ~ 
                     
                     ( 
                     
                       
                         
                           N 
                           z 
                         
                       
                        
                       
                          
                         H 
                          
                       
                        
                       d 
                        
                       
                           
                       
                        
                       
                         log 
                          
                         
                           ( 
                           
                             
                                
                               H 
                                
                             
                             
                               ϵ 
                               G 
                             
                           
                           ) 
                         
                       
                        
                       
                         log 
                          
                         
                           ( 
                           
                             1 
                             
                               ϵ 
                               G 
                             
                           
                           ) 
                         
                       
                     
                     ) 
                   
                   . 
                 
               
               
                 
                   ( 
                   160 
                   ) 
                 
               
             
           
         
       
     
     From Eq. 152 it is known that the error ϵ h  propagates nearly linear, and hence it suffices for us to take ϵ G ≤ϵ h /t where t=O(max{M 1 , M 2 }) and adjust the constants ϵ h −ϵ h /2 in order to achieve the same precision ϵ in the final result. It is now required that 
     
       
         
           
             
               
                 
                   
                      
                     ~ 
                   
                   ( 
                   
                     
                       
                         N 
                         z 
                       
                     
                      
                     
                        
                       
                         H 
                          
                         
                           ( 
                           θ 
                           ) 
                         
                       
                        
                     
                      
                     
                       log 
                       ( 
                       
                         
                           
                             
                               
                                  
                                 
                                   H 
                                    
                                   
                                     ( 
                                     θ 
                                     ) 
                                   
                                 
                                  
                               
                             
                           
                           
                             
                               
                                 max 
                                  
                                 
                                   { 
                                   
                                     
                                       M 
                                       1 
                                     
                                     , 
                                     
                                       M 
                                       2 
                                     
                                   
                                   } 
                                 
                               
                             
                           
                         
                         
                           ϵ 
                           h 
                         
                       
                       ) 
                     
                      
                     
                       log 
                        
                       
                         ( 
                         
                           
                             max 
                              
                             
                               { 
                               
                                 
                                   M 
                                   1 
                                 
                                 , 
                                 
                                   M 
                                   2 
                                 
                               
                               } 
                             
                           
                           
                             ϵ 
                             h 
                           
                         
                         ) 
                       
                     
                   
                   ) 
                 
               
               
                 
                   ( 
                   161 
                   ) 
                 
               
             
           
         
       
     
     and using the ϵ h  from before we hence find that this s bound by 
     
       
         
           
             
               
                 
                   
                      
                     ~ 
                   
                   ( 
                   
                     
                       
                         N 
                         z 
                       
                     
                      
                     
                        
                       
                         H 
                          
                         
                           ( 
                           θ 
                           ) 
                         
                       
                        
                     
                      
                     
                       log 
                       ( 
                       
                         
                           
                              
                             
                               H 
                                
                               
                                 ( 
                                 θ 
                                 ) 
                               
                             
                              
                           
                            
                           
                             n 
                             h 
                             2 
                           
                         
                         ϵΔ 
                       
                       ) 
                     
                      
                     
                       log 
                       ( 
                       
                         
                           n 
                           h 
                           2 
                         
                         ϵΔ 
                       
                       ) 
                     
                   
                   ) 
                 
               
               
                 
                   ( 
                   162 
                   ) 
                 
               
             
           
         
       
     
     query complexity to the oracle of H for the Gibbs state preparation. 
     The procedure succeeds with probability at least 1−δ s  for a single repetition for each entry of the gradient. In order to have a failure probability of the final algorithm of less than ⅓, it is necessary to repeat the procedure for all D dimensions of the gradient and take for each the median over a number of samples. Let n f  be as previously the number of instances of the one component of the gradient such that the error is larger than ϵ s σ m  and n s  be the number of instances with an error ≤ϵ s σ m , and the result taken is the median of the estimates, where n=n s +n f  samples are collected. The algorithm gives a wrong answer for each dimension if 
     
       
         
           
             
               
                 n 
                 s 
               
               ≤ 
               
                 ⌊ 
                 
                   n 
                   2 
                 
                 ⌋ 
               
             
             , 
           
         
       
     
     since then the median is a sample such that the error is larger than ϵ s σ m . Let p=1−δ s  be the success probability to draw a positive sample, as is the case of the algorithm. Since each instance of(recall that each sample here consists of a number of samples itself) from the algorithm will independently return an estimate for the entry of the gradient, the total failure probability is bounded by the union bound, i.e., 
     
       
         
           
             
               
                 
                   
                     
                       P 
                        
                       
                         r 
                         
                           f 
                            
                           a 
                            
                           i 
                            
                           l 
                         
                       
                     
                     ≤ 
                     
                       D 
                       · 
                       
                         Pr 
                          
                         
                           [ 
                           
                             
                               n 
                               s 
                             
                             ≤ 
                             
                               ⌊ 
                               
                                 n 
                                 2 
                               
                               ⌋ 
                             
                           
                           ] 
                         
                       
                     
                     ≤ 
                     
                       D 
                       · 
                       
                         
                           e 
                           
                             
                               - 
                               
                                 n 
                                 
                                   2 
                                    
                                   
                                     ( 
                                     
                                       1 
                                       - 
                                       
                                         δ 
                                         s 
                                       
                                     
                                     ) 
                                   
                                 
                               
                             
                              
                             
                               ( 
                               
                                 
                                   ( 
                                   
                                     1 
                                     - 
                                     
                                       δ 
                                       s 
                                     
                                   
                                   ) 
                                 
                                 - 
                                 
                                   1 
                                   2 
                                 
                               
                               ) 
                             
                           
                         
                         2 
                       
                     
                     ≤ 
                     
                       1 
                       3 
                     
                   
                   , 
                 
               
               
                 
                   ( 
                   163 
                   ) 
                 
               
             
           
         
       
     
     which follows from the Chernoff inequality for a binomial variable with 1−δ s &gt;½, which is given in the present case for a proper choice of δ s &lt;½. Therefore, by taking 
     
       
         
           
             
               
                 n 
                 ≥ 
                 
                   
                     
                       2 
                       - 
                       
                         2 
                          
                         
                           δ 
                           s 
                         
                       
                     
                     
                       
                         ( 
                         
                           
                             1 
                              
                             
                               / 
                             
                              
                             2 
                           
                           - 
                           
                             δ 
                             s 
                           
                         
                         ) 
                       
                       2 
                     
                   
                    
                   
                     log 
                      
                     
                       ( 
                       
                         3 
                          
                         D 
                       
                       ) 
                     
                   
                 
               
               = 
               
                 O 
                  
                 
                   ( 
                   
                     log 
                      
                     
                       ( 
                       
                         3 
                          
                         D 
                       
                       ) 
                     
                   
                   ) 
                 
               
             
             , 
           
         
       
     
     a total failure probability of at least ⅓ is achieved for a constant, fixed δ s . Note that this for a constant, fixed. Note that this hence results in an multiplicative factor of O(log(D)) in the query complexity of Eq. 156.
 
The total query complexity to the oracle O ρ  for a purified density matrix of the data ρ and the Hamiltonian oracle O H  is then given by
 
     
       
         
           
             
               
                 
                   
                     
                       O 
                       ~ 
                     
                     ( 
                     
                       
                         
                           N 
                           z 
                         
                       
                        
                       
                         
                           ( 
                           
                             
                               
                                 
                                   d 
                                    
                                   
                                     log 
                                      
                                     
                                       ( 
                                       d 
                                       ) 
                                     
                                   
                                    
                                   
                                      
                                     
                                       H 
                                        
                                       
                                         ( 
                                         θ 
                                         ) 
                                       
                                     
                                      
                                   
                                    
                                   
                                     
                                        
                                       a 
                                        
                                     
                                     1 
                                     3 
                                   
                                    
                                   
                                     σ 
                                     m 
                                     3 
                                   
                                    
                                   
                                     μ 
                                     5 
                                   
                                    
                                   
                                     
                                       log 
                                       3 
                                     
                                      
                                     
                                       ( 
                                       
                                         μ 
                                          
                                         
                                           / 
                                         
                                          
                                         2 
                                       
                                       ) 
                                     
                                   
                                 
                               
                             
                             
                               
                                 
                                   
                                     poly 
                                      
                                     
                                         
                                     
                                      
                                     log 
                                      
                                     
                                       
                                          
                                         
                                           
                                             ∂ 
                                             
                                               σ 
                                               υ 
                                             
                                           
                                           
                                             ∂ 
                                             θ 
                                           
                                         
                                          
                                       
                                       ϵ 
                                     
                                   
                                   , 
                                   
                                     
                                       
                                         n 
                                         h 
                                         2 
                                       
                                        
                                       
                                         
                                            
                                           a 
                                            
                                         
                                         1 
                                       
                                        
                                       
                                         σ 
                                         m 
                                       
                                     
                                     
                                       ϵ 
                                        
                                       
                                           
                                       
                                        
                                       Δ 
                                     
                                   
                                   , 
                                   
                                      
                                     
                                       H 
                                        
                                       
                                         ( 
                                         θ 
                                         ) 
                                       
                                     
                                      
                                   
                                 
                               
                             
                           
                           ) 
                         
                         
                           
                             ϵ 
                             3 
                           
                            
                           
                             Δ 
                             3 
                           
                         
                       
                     
                     ) 
                   
                   , 
                 
               
               
                 
                   ( 
                   164 
                   ) 
                 
               
             
           
         
       
     
     which reduces to 
     
       
         
           
             
               
                 
                   
                     
                       O 
                       ~ 
                     
                      
                     
                       ( 
                       
                         
                           
                             N 
                             z 
                           
                         
                          
                         
                           
                             D 
                              
                             
                                
                               
                                 H 
                                  
                                 
                                   ( 
                                   θ 
                                   ) 
                                 
                               
                                
                             
                              
                             d 
                              
                             
                                 
                             
                              
                             
                               μ 
                               5 
                             
                              
                             α 
                           
                           
                             ϵ 
                             3 
                           
                         
                       
                       ) 
                     
                   
                   , 
                 
               
               
                 
                   ( 
                   165 
                   ) 
                 
               
             
           
         
       
     
     hiding the logarithmic factors in the Õ notation. 
     Returning once again to the drawings,  FIG. 7  illustrates an example method  60 B to estimate the gradient of the quantum relative entropy of a restricted or non-restricted QBM having visible and hidden nodes. Method  60 B may be employed as a particular instance of step  60  in training method of  FIG. 5 . Each step of this method is developed in detail in the description above; accordingly, the present description provides only summary detail to enable the reader to understand the process flow in one non-limiting example. 
     In this method, the gradient of the quantum relative entropy is estimated based on one or more high-order divided-difference formulas. At  110  of method  60 B, truncated Fourier-series expansions of log(x) and x are computed. At  112  an interpolation polynomial L′(θ) is computed to represent a derivative that appears in the gradient of the quantum relative entropy. At  114  the density operator ρ is computed. 
     At  116  of method  60 B, a control loop is encountered wherein an ancilla qubit is prepared in the state |+ ⊗ρ=1/√{square root over (2)}(|0 +|1 )⊗ρ. At  120 , a sample-based Hamiltonian simulation is applied to provide a majorised distribution σ v  over the one or more visible nodes at fixed s. Then, at  122 , a Hadamard gate is applied. At  124 , the amplitude of the ancilla qubit state is estimated with the |0  state of the ancilla qubit marked. Accordingly, estimating based on the one or more high-order divided-difference formulas in method  60 B includes using the quantum computer to compute one or more divided differences of a training objective function of the QBM using Fourier-series methods. 
     At each iteration through the control loop, the confidence analysis described above is applied in order to determine whether additional measurements are required to achieve precision ϵ. If so, execution returns to  116 . Otherwise, the product of the expectation values and the Fourier and L′(θ) coefficients is evaluated and returned. 
     Appendix for Approach 1 and Approach 2 
     Bounds on the Gradient. 
     Starting with some preliminary equations needed in order to obtain a useful bound on the gradient, 
     Let A(θ) be a linear operator which depends linearly on the density matrix σ. Then 
     
       
         
           
             
               
                 
                   
                     
                       
                         ∂ 
                         
                           ∂ 
                           θ 
                         
                       
                        
                       
                         
                           A 
                            
                           
                             ( 
                             θ 
                             ) 
                           
                         
                         
                           - 
                           1 
                         
                       
                     
                     = 
                     
                       
                         - 
                         
                           A 
                           
                             - 
                             1 
                           
                         
                       
                        
                       
                         
                           ∂ 
                           σ 
                         
                         
                           ∂ 
                           θ 
                         
                       
                        
                       
                         A 
                         
                           - 
                           1 
                         
                       
                     
                   
                   . 
                 
               
               
                 
                   ( 
                   166 
                   ) 
                 
               
             
           
         
       
     
     Proof. 
     The proof follows straightforwardly by using the identity I. 
     
       
         
           
             
               
                 
                   ∂ 
                   I 
                 
                 
                   ∂ 
                   θ 
                 
               
               = 
               
                 0 
                 = 
                 
                   
                     
                       
                         ∂ 
                         
                           ∂ 
                           θ 
                         
                       
                        
                       A 
                     
                      
                     
                       A 
                       
                         - 
                         1 
                       
                     
                   
                   = 
                   
                     
                       
                         ( 
                         
                           
                             ∂ 
                             A 
                           
                           
                             ∂ 
                             θ 
                           
                         
                         ) 
                       
                        
                       
                         A 
                         
                           - 
                           1 
                         
                       
                     
                     + 
                     
                       A 
                        
                       
                         ( 
                         
                           
                             ∂ 
                             
                               A 
                               
                                 - 
                                 1 
                               
                             
                           
                           
                             ∂ 
                             θ 
                           
                         
                         ) 
                       
                     
                   
                 
               
             
             . 
           
         
       
     
     Reordering the terms completes the proof. This can equally be proven using the Gateau derivative. 
     In the following one will furthermore rely on the following well-known inequality. 
     Lemma 7. 
     Von Neumann Trace Inequality. Let A∈   n×n  and B∈   n×n  with singular values {σ i (A)} i=1   n  and {σ i (B)} i=1   n  respectively such that σ i (⋅)≤σ j (⋅) if i≤j. It then holds that 
     
       
         
           
             
               
                 
                   
                      
                     
                       Tr 
                        
                       
                         [ 
                         AB 
                         ] 
                       
                     
                      
                   
                   ≤ 
                   
                     
                       ∑ 
                       
                         i 
                         = 
                         1 
                       
                       n 
                     
                      
                     
                       
                         
                           σ 
                            
                           
                             ( 
                             A 
                             ) 
                           
                         
                         i 
                       
                        
                       
                         
                           
                             σ 
                              
                             
                               ( 
                               B 
                               ) 
                             
                           
                           i 
                         
                         . 
                       
                     
                   
                 
               
               
                 
                   ( 
                   167 
                   ) 
                 
               
             
           
         
       
     
     Note that from this, one immediately obtains 
     
       
         
           
             
               
                 
                   
                     
                        
                       
                         Tr 
                          
                         
                           [ 
                           AB 
                           ] 
                         
                       
                        
                     
                     ≤ 
                     
                       
                         ∑ 
                         
                           i 
                           = 
                           1 
                         
                         n 
                       
                        
                       
                         
                           
                             σ 
                              
                             
                               ( 
                               A 
                               ) 
                             
                           
                           i 
                         
                          
                         
                           
                             σ 
                              
                             
                               ( 
                               B 
                               ) 
                             
                           
                           i 
                         
                       
                     
                     ≤ 
                     
                       
                         
                           σ 
                           max 
                         
                          
                         
                           ( 
                           B 
                           ) 
                         
                       
                        
                       
                         
                           ∑ 
                           i 
                         
                          
                         
                           
                             σ 
                              
                             
                               ( 
                               A 
                               ) 
                             
                           
                           i 
                         
                       
                     
                   
                   = 
                   
                     
                        
                       B 
                        
                     
                      
                     
                       
                         ∑ 
                         i 
                       
                        
                       
                         
                           
                             σ 
                              
                             
                               ( 
                               A 
                               ) 
                             
                           
                           i 
                         
                         . 
                       
                     
                   
                 
               
               
                 
                   ( 
                   168 
                   ) 
                 
               
             
           
         
       
     
     This is particularly useful if A is Hermitian and PSD, since this implies |Tr [AB]|≤∥B∥ Tr [A] for Hermitian A. 
     Since dealing with operators, the common chain rule of differentiation does not hold generally. Indeed the chain rule is a special case if the derivative of the operator commutes with the operator itself. Since a term of the form log σ(θ) is encountered, one cannot assume that [σ, σ′]=0, where σ′:=σ (1)  is the derivative w.r.t., θ. For this case the following identity is needed, similar to Duhamels formula, in the derivation of the gradient for the purely-visible-units Boltzmann machine. 
     Lemma 8. Derivative of Matrix Logarithm [7] 
     
       
         
           
             
               
                 
                   
                     
                       d 
                       
                         d 
                          
                         t 
                       
                     
                      
                     log 
                      
                     
                       A 
                        
                       
                         ( 
                         t 
                         ) 
                       
                     
                   
                   = 
                   
                     
                       ∫ 
                       0 
                       1 
                     
                      
                     
                       
                         
                           [ 
                           
                             
                               s 
                                
                               A 
                             
                             + 
                             
                               
                                 ( 
                                 
                                   1 
                                   - 
                                   s 
                                 
                                 ) 
                               
                                
                               I 
                             
                           
                           ] 
                         
                         
                           - 
                           1 
                         
                       
                        
                       
                         
                           
                             
                               ( 
                               
                                 
                                   d 
                                    
                                   A 
                                 
                                 
                                   d 
                                    
                                   t 
                                 
                               
                               ) 
                             
                              
                             
                               [ 
                               
                                 
                                   s 
                                    
                                   A 
                                 
                                 + 
                                 
                                   
                                     ( 
                                     
                                       1 
                                       - 
                                       s 
                                     
                                     ) 
                                   
                                    
                                   I 
                                 
                               
                               ] 
                             
                           
                           
                             - 
                             1 
                           
                         
                         . 
                       
                     
                   
                 
               
               
                 
                   ( 
                   169 
                   ) 
                 
               
             
           
         
       
     
     For completeness a proof of the above identity is now included. 
     Proof. 
     The integral definition of the logarithm [8] is used for a complex, invertible, n×n matrix A=A(t) with no real negative 
       log  A =( A−I )∫ 0   1 [ s ( A−I )+ I ] −1 .  (170)
 
     From this is obtained the derivative 
     
       
         
           
             
               
                 
                   
                     
                       d 
                       
                         d 
                          
                         t 
                       
                     
                      
                     log 
                      
                     
                         
                     
                      
                     A 
                   
                   = 
                   
                     
                       
                         d 
                          
                         A 
                       
                       
                         d 
                          
                         t 
                       
                     
                      
                     
                       
                         ∫ 
                         0 
                         1 
                       
                        
                       
                         d 
                          
                         
                           
                             s 
                              
                             
                               [ 
                               
                                 
                                   s 
                                    
                                   
                                     ( 
                                     
                                       A 
                                       - 
                                       I 
                                     
                                     ) 
                                   
                                 
                                 + 
                                 I 
                               
                               ] 
                             
                           
                           
                             - 
                             1 
                           
                         
                          
                         
                           ( 
                           
                             A 
                             - 
                             I 
                           
                           ) 
                         
                          
                         
                           
                             ∫ 
                             0 
                             1 
                           
                            
                           
                             d 
                              
                             s 
                              
                             
                               
                                 
                                   
                                     d 
                                     
                                       d 
                                        
                                       t 
                                     
                                   
                                    
                                   
                                     [ 
                                     
                                       
                                         s 
                                          
                                         
                                           ( 
                                           
                                             A 
                                             - 
                                             I 
                                           
                                           ) 
                                         
                                       
                                       + 
                                       I 
                                     
                                     ] 
                                   
                                 
                                 
                                   - 
                                   1 
                                 
                               
                               . 
                             
                           
                         
                       
                     
                   
                 
               
               
                 
                   ( 
                   171 
                   ) 
                 
               
             
           
         
       
     
     Applying Eq. 166 to the second term on the right hand side yields 
     
       
         
           
             
               
                 
                   
                     
                       
                         d 
                         
                           d 
                            
                           t 
                         
                       
                        
                       log 
                        
                       
                           
                       
                        
                       A 
                     
                     = 
                     
                       
                         
                           
                             d 
                              
                             A 
                           
                           
                             d 
                              
                             t 
                           
                         
                          
                         
                           
                             ∫ 
                             0 
                             1 
                           
                            
                           
                             d 
                              
                             
                               
                                 s 
                                  
                                 
                                   [ 
                                   
                                     
                                       s 
                                        
                                       
                                         ( 
                                         
                                           A 
                                           - 
                                           I 
                                         
                                         ) 
                                       
                                     
                                     + 
                                     I 
                                   
                                   ] 
                                 
                               
                               
                                 - 
                                 1 
                               
                             
                           
                         
                       
                       + 
                       
                         
                           ( 
                           
                             A 
                             - 
                             I 
                           
                           ) 
                         
                          
                         
                           
                             ∫ 
                             0 
                             1 
                           
                            
                           
                             d 
                              
                             
                               
                                 s 
                                  
                                 
                                   [ 
                                   
                                     
                                       s 
                                        
                                       
                                         ( 
                                         
                                           A 
                                           - 
                                           I 
                                         
                                         ) 
                                       
                                     
                                     + 
                                     I 
                                   
                                   ] 
                                 
                               
                               
                                 - 
                                 1 
                               
                             
                              
                             s 
                              
                             
                               
                                 
                                   
                                     d 
                                      
                                     A 
                                   
                                   
                                     d 
                                      
                                     t 
                                   
                                 
                                  
                                 
                                   [ 
                                   
                                     
                                       s 
                                        
                                       
                                         ( 
                                         
                                           A 
                                           - 
                                           I 
                                         
                                         ) 
                                       
                                     
                                     + 
                                     I 
                                   
                                   ] 
                                 
                               
                               
                                 - 
                                 1 
                               
                             
                           
                         
                       
                     
                   
                   , 
                 
               
               
                 
                   ( 
                   172 
                   ) 
                 
               
             
           
         
       
     
     which can be rewritten as 
     
       
         
           
             
               
                 
                   
                     
                       d 
                       
                         d 
                          
                         t 
                       
                     
                      
                     log 
                      
                     
                         
                     
                      
                     A 
                   
                   = 
                   
                     
                       ∫ 
                       0 
                       1 
                     
                      
                     
                       d 
                        
                       
                         
                           
                             s 
                              
                             
                               [ 
                               
                                 
                                   s 
                                    
                                   
                                     ( 
                                     
                                       A 
                                       - 
                                       I 
                                     
                                     ) 
                                   
                                 
                                 + 
                                 I 
                               
                               ] 
                             
                           
                            
                           
                             [ 
                             
                               
                                 s 
                                  
                                 
                                   ( 
                                   
                                     A 
                                     - 
                                     I 
                                   
                                   ) 
                                 
                               
                               + 
                               I 
                             
                             ] 
                           
                         
                         
                           - 
                           1 
                         
                       
                        
                       
                         
                           
                             
                               d 
                                
                               A 
                             
                             
                               d 
                                
                               t 
                             
                           
                            
                           
                             [ 
                             
                               
                                 s 
                                  
                                 
                                   ( 
                                   
                                     A 
                                     - 
                                     I 
                                   
                                   ) 
                                 
                               
                               + 
                               I 
                             
                             ] 
                           
                         
                         
                           - 
                           1 
                         
                       
                     
                   
                 
               
               
                 
                   ( 
                   173 
                   ) 
                 
               
             
             
               
                 
                   
                       
                   
                    
                   
                     
                       
                         + 
                         
                           ( 
                           
                             A 
                             - 
                             I 
                           
                           ) 
                         
                       
                        
                       
                         
                           ∫ 
                           0 
                           1 
                         
                          
                         
                           d 
                            
                           
                             
                               s 
                                
                               
                                 [ 
                                 
                                   
                                     s 
                                      
                                     
                                       ( 
                                       
                                         A 
                                         - 
                                         I 
                                       
                                       ) 
                                     
                                   
                                   + 
                                   I 
                                 
                                 ] 
                               
                             
                             
                               - 
                               1 
                             
                           
                            
                           s 
                            
                           
                             
                               
                                 
                                   d 
                                    
                                   A 
                                 
                                 
                                   d 
                                    
                                   t 
                                 
                               
                                
                               
                                 [ 
                                 
                                   
                                     s 
                                      
                                     
                                       ( 
                                       
                                         A 
                                         - 
                                         I 
                                       
                                       ) 
                                     
                                   
                                   + 
                                   I 
                                 
                                 ] 
                               
                             
                             
                               - 
                               1 
                             
                           
                         
                       
                     
                     , 
                   
                 
               
               
                 
                   ( 
                   174 
                   ) 
                 
               
             
           
         
       
     
     by adding the identity I=[s(A−I)+I][s(A−I)+I] −1  in the first integral and reordering commuting terms (i.e., s). Notice that one can hence just subtract the first two terms in the integral which yields Eq. 169 as desired. 
     Amplitude Estimation. 
     The well known amplitude estimation algorithm can be performed via the following steps.
         1. Initialize two registers of appropriate sizes to the state |0   |0 , where   is a unitary transformation which prepares the input state, i.e., |ψ = |0     2. Apply the quantum Fourier transform       

     
       
         
           
             
               QFT 
               N 
             
             : 
             
               
                  
                 x 
                 〉 
               
               → 
               
                 
                   1 
                   
                     N 
                   
                 
                  
                 
                   Σ 
                   
                     y 
                     = 
                     0 
                   
                   
                     N 
                     - 
                     1 
                   
                 
                  
                 
                   e 
                   
                     2 
                      
                     π 
                      
                     i 
                      
                     x 
                      
                     
                       y 
                       / 
                       N 
                     
                   
                 
                  
                 
                    
                   y 
                   〉 
                 
               
             
           
         
       
     
     for 0≤x&lt;N, to the first register.
         3. Apply the controlled-Q operator to the second register, i.e., let Λ N (U):|j |y →|j (U j |y ) for 0≤j&lt;N), then we apply λ N (Q) where Q:=− S 0     † S t  is the Grover&#39;s operator, S 0  changes the sign of the amplitude if and only if the state is the zero state |0 , and St is the sign-flip operator for the target state, i.e., if |x  is the desired outcome, then S t :=I−2|x   x|.   4. Apply QFT N   †  to the first register.   5. Output       

     
       
         
           
             
               a 
               ~ 
             
             = 
             
               
                 
                   sin 
                   2 
                 
                  
                 
                   ( 
                   
                     π 
                      
                     
                       
                         θ 
                         ~ 
                       
                       N 
                     
                   
                   ) 
                 
               
               . 
             
           
         
       
     
     The algorithm can hence be summarized as the unitary transformation 
       (( QFT†⊗I )Λ N ( Q )( QFT   N   ⊗I ))  (175)
 
     applied to the state |0   |0 , followed by a measurement of the first register and classical post-processing returns an estimate {tilde over (θ)} of the amplitude of the desired outcome such that |θ−{tilde over (θ)}|≤ϵ with probability at least 8/π 2 . The result is summarized in the following theorem, which states a slightly more general version. 
     Theorem 5. 
     Amplitude Estimation [9] For any positive integer k, the Amplitude Estimation Algorithm returns an estimate ã (0≤ã≤1) such that 
     
       
         
           
             
               
                 
                   
                      
                     
                       
                         a 
                         ~ 
                       
                       - 
                       a 
                     
                      
                   
                   ≤ 
                   
                     
                       2 
                        
                       πk 
                        
                       
                         
                           
                             a 
                              
                             
                               ( 
                               
                                 1 
                                 - 
                                 a 
                               
                               ) 
                             
                           
                         
                         N 
                       
                     
                     + 
                     
                       
                         k 
                         2 
                       
                        
                       
                         
                           π 
                           2 
                         
                         
                           N 
                           2 
                         
                       
                     
                   
                 
               
               
                 
                   ( 
                   176 
                   ) 
                 
               
             
           
         
       
     
     with probability at least 
     
       
         
           
             
               8 
               
                 π 
                 2 
               
             
             ≈ 
             
               
                 0 
                 . 
                 8 
               
                
               1 
             
           
         
       
     
     for k=1 and with probability greater than 
     
       
         
           
             1 
             - 
             
               1 
               
                 2 
                  
                 
                   ( 
                   
                     k 
                     - 
                     1 
                   
                   ) 
                 
               
             
           
         
       
     
     for k≥2. If a=0 then ã=0 with certainty, and if a=1 and N is even, then ã=1 with certainty. 
     Notice that the amplitude θ can hence be recovered via the relation θ=arcsin √{square root over (θ a )} as described above which incurs an ϵ-error for θ (c.f., Lemma 7, [9]). 
     CONCLUSION AND CLAIMS 
     One aspect of this disclosure is directed to a method to train a QBM having one or more visible nodes and one or more hidden nodes. The method comprises associating each visible and each hidden node of the QBM to a different corresponding qubit of a plurality of qubits of a quantum computer, wherein a state of each of the plurality of qubits contributes to a global energy of the QBM according to a set of weighting factors, and wherein the plurality of qubits include one or more output qubits corresponding to one or more visible nodes of the QBM. The method further comprises providing a distribution of training data over the one or more output qubits, estimating a gradient of a quantum relative entropy between the one or more output qubits and the distribution of training data, and training the set of weighting factors based on the estimated gradient, using the quantum relative entropy as a cost function. 
     In some implementations, the quantum relative entropy S is defined by S(ρ|σ v )=Tr (ρ log ρ)−Tr (ρ log σ v ), wherein S is a function of density operator ρ conditioned on a majorised distribution σ v  over the one or more visible nodes, and wherein Tr is a trace of an operator. In some implementations, the QBM is a restricted QBM, in which every Hamiltonian operator acting on a qubit corresponding to a hidden node of the QBM commutes with every other Hamiltonian operator acting on a qubit corresponding to a hidden node of the QBM. In some implementations, estimating the gradient includes computing a variational upper bound on the quantum relative entropy. In some implementations, estimating the gradient includes using substantially commuting operators to assign an energy penalty to each qubit corresponding to a hidden node of the QBM. In some implementations, estimating the gradient includes preparing a purified Gibbs state in the plurality of qubits based on one or more Hamiltonians. In some implementations, estimating the gradient of the quantum relative entropy includes estimating based on one or more high-order divided-difference formulas. In some implementations, estimating based on the one or more high-order divided-difference formulas includes using the quantum computer to compute one or more divided differences of a training objective function of the QBM using Fourier-series methods. In some implementations, using the quantum computer to compute the one or more divided differences includes using the quantum computer to compute one or more truncated Fourier-series expansions. In some implementations, estimating the gradient of the quantum relative entropy includes computing an interpolation polynomial to represent a derivative appearing in the gradient. In some implementations, estimating the gradient of the quantum relative entropy includes applying a sample-based Hamiltonian simulation to provide a distribution σ v  over the one or more visible nodes. 
     Another aspect of this disclosure is directed to a quantum computer comprising a register including a plurality of qubits, a modulator configured to implement one or more quantum-logic operations on the plurality of qubits, a demodulator configured to output data based on a quantum state of the plurality of qubits, a controller operatively coupled to the modulator and to the demodulator, and computer memory associated with the controller. The computer memory holds instructions that cause the controller to instantiate a QBM having one or more visible nodes and one or more hidden nodes, wherein each visible and each hidden node corresponds to a different qubit of the plurality of qubits, wherein a state of each of the plurality of qubits contributes to a global energy of the QBM according to a set of weighting factors, wherein the plurality of qubits include one or more output qubits corresponding to one or more visible nodes of the QBM, and wherein the weighting factors are trained using a distribution of training data over the one or more output qubits, based on a previously estimated gradient of a quantum relative entropy between the one or more output qubits and the distribution of training data, using the quantum relative entropy as a cost function. 
     In some implementations, the instructions cause the controller to estimate the gradient of the quantum relative entropy and to train the set of weighting factors based on the estimated gradient, using the quantum relative entropy as a cost function. 
     Another aspect of this disclosure is directed to a quantum computer comprising a register including a plurality of qubits, a modulator configured to implement one or more quantum-logic operations on the plurality of qubits, a demodulator configured to output data based on a quantum state of the plurality of qubits, a controller operatively coupled to the modulator and to the demodulator, and computer memory associated with the controller. The computer memory holds instructions that cause the controller to instantiate a QBM having one or more visible nodes and one or more hidden nodes, wherein each visible and each hidden node corresponds to a different qubit of the plurality of qubits, wherein a state of each of the plurality of qubits contributes to a global energy of the QBM according to a set of weighting factors, and wherein the plurality of qubits include one or more output qubits corresponding to one or more visible nodes of the QBM. The instructions further cause the controller to provide a distribution of training data over the one or more output qubits, estimate a gradient of a quantum relative entropy between the one or more output qubits and the distribution of training data, and train the set of weighting factors based on the estimated gradient, using the quantum relative entropy as a cost function. 
     In some implementations, the QBM is a restricted QBM, in which every Hamiltonian operator acting on a qubit corresponding to a hidden node of the QBM commutes with every other Hamiltonian operator acting on a qubit corresponding to a hidden node of the QBM, and estimation of the gradient includes computation of a variational upper bound on the quantum relative entropy. In some implementations, estimation of the gradient includes use of substantially commuting operators to assign an energy penalty to each qubit corresponding to a hidden node of the QBM. In some implementations, estimation of the gradient includes preparation of a purified Gibbs state in the plurality of qubits based on one or more Hamiltonians. In some implementations, the gradient of the quantum relative entropy is estimated based on one or more high-order divided-difference formulas, and estimation of the gradient based on the one or more divided-difference formulas includes using the quantum computer to compute one or more divided differences of a training objective function of the QBM using Fourier-series methods. In some implementations, estimation of the gradient includes computation of an interpolation polynomial to represent a derivative appearing in the gradient. In some implementations, estimation of the gradient includes applying a sample-based Hamiltonian simulation to provide a distribution σ v  over the one or more visible nodes. 
     This disclosure is presented by way of example and with reference to the attached drawing figures. Components, process steps, and other elements that may be substantially the same in one or more of the figures are identified coordinately and described with minimal repetition. It will be noted, however, that elements identified coordinately may also differ to some degree. It will be further noted that the figures are schematic and generally not drawn to scale. Rather, the various drawing scales, aspect ratios, and numbers of components shown in the figures may be purposely distorted to make certain features or relationships easier to see. 
     It will be understood that the configurations and/or approaches described herein are exemplary in nature, and that these specific embodiments or examples are not to be considered in a limiting sense, because numerous variations are possible. The specific routines or methods described herein may represent one or more of any number of processing strategies. As such, various acts illustrated and/or described may be performed in the sequence illustrated and/or described, in other sequences, in parallel, or omitted. Likewise, the order of the above-described processes may be changed. 
     The subject matter of the present disclosure includes all novel and non-obvious combinations and sub-combinations of the various processes, systems and configurations, and other features, functions, acts, and/or properties disclosed herein, as well as any and all equivalents thereof.