In this section, we present an illustrative example that demonstrates how variance regularization significantly enhances the robustness of a QNN against finite-sampling noise within a shot-based simulation. This example also highlights that a perfect fit, derived from a noise-free simulation, could inadvertently introduce a substantial variance of the expectation value. Consequently, this would necessitate a significantly large number of shots for an accurate evaluation. We want to point out that this effect should Layer l times repeated |0⟩ ˆ Ry(φs,1) ˆ Rx(φl,1 cos−1(x)) ˆ Rzz(φl,8) ˆ Ry(φe,1) |0⟩ ˆ Ry(φs,2) ˆ Rx(φl,2 cos−1(x)) ˆ Rzz(φl,5) ˆ Ry(φe,2) |0⟩ ˆ Ry(φs,3) ˆ Rx(φl,3 cos−1(x)) ˆ Rzz(φl,7) ˆ Ry(φe,3) |0⟩ ˆ Ry(φs,4) ˆ Rx(φl,4 cos−1(x)) ˆ Rzz(φl,6) ˆ Ry(φe,4) with = ˆ Rzz(φ) ˆ Rz(φ) Figure 1: Parameterized quantum circuit of the QNN used in all examples in this work. The first layer of ˆ Ry gates manipulates the initial state. The blueish highlighted layer includes the Chebychev input encoding in the ˆ Rx gates as well as the parameterized control manipulation of the quantum state. The layer is repeated l times for a repeated input encoding. The last layer of ˆ Ry gates serves as a change of the basis that is used for measurement. For a hardware efficient approach, the rightmost controlled gate in the blueish layer is removed to avoid swapping. be taken into account when interpreting results from QNNs that are entirely sourced from noise-free simulators. Figure 1 displays the PQC that is utilized throughout this work. We use the Chebyshev input encoding in which the input data is first encoded by a cos−1(x) function [12]. The use of the inverse cosine implies a rescaling of the input data to [−1, 1]. Using this non-linear input encoding as angles in rotation gates around the x-axis yields the following identity for integer n [41]: ˆ Rx(n cos−1(x)) = Tn(x) ˆ I −i√ 1 − x2Un−1(x) ˆ X , (13) in which Tn(x) and Un(x) are the first and second kind Chebyshev polynomials of degree n [44]. ˆ X denotes the Pauli-X operator. In contrast to previous works, we introduce a parameter φ instead of a fixed value for n which enables a flexible optimization of the degree of the Chebyshev polynomials during the training. An example of curves generated using Chebyshev polynomials with a non-integer value of n is presented in the Appendix A.1. These curves demonstrate a smooth transition between the individual Chebyshev polynomials. The initial values for the parameters in the encoding are chosen to be evenly distributed between φl,1 = 0.01 and φl,Nq = β following the idea of the Chebyshev tower approach [41]. Here and in the subsequent sections, Nq denotes the number of qubits. The initial value 0.01 is chosen to avoid a redundancy in the parameter that occurs for φ = 0.0, and β is considered as a hyper-parameter of the model. The quantum state from the input encoding is manipulated by a hardware efficient approach of ˆ Rzz(φ) = exp(−i φ 2ˆ Z⊗ ˆ Z) twoqubit interaction gates that are arranged in a nearest neighbor entangling set-up. The ˆ Ry gates at the beginning and the end of the feature map enable a basis Accepted in Quantum 2024-06-17, click title to verify. Published under CC-BY 4.0.

0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 x −2.5 −2.0 −1.5 −1.0 −0.5 0.0 fx () θ Final fit loss: 9.3 · 10−5 Final averaged variance: 111.33 a Solution without variance regularization Shot-based simulation Noise-free simulation Training data 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 x −2.5 −2.0 −1.5 −1.0 −0.5 0.0 fx () θ b Final fit loss: 8.3 · 10−3 Final averaged variance: 1.31 Solution with variance regularization Shot-based simulation Noise-free simulation Training data 1 Figure 2: The output of the QNN is evaluated for two cases: trained with (a) and without (b) variance regularization. The training is conducted using a noise-free simulator, and the output is computed with and without shots. For the shotbased simulation, 10 000 shots are utilized. change of the initial state and the measuring basis. Both are also optimized during the training. In this introductory example, we choose the Ising Hamiltonian introduced in Eq. (10) as the cost operator. The parameters φ1 to φ3 of the Ising Hamiltonian are also optimized in the optimization. The first parameter φ1 introduces a constant offset of the output of the QNN. The specific selection of this operator exemplifies a scenario where a large variance is observed after the training process. The PQC of the QNN is introduced in Figure 1, and Nq = 4 qubits and l = 2 layers are chosen. The optimization of the loss function, i.e. the training, is conducted using the noise-free simulator of Qiskit [45], and it is performed with and without the variance regularization. Figure 2 displays the inference of the trained QNN with and without finite sampling noise. The top plot illustrates the QNN obtained without variance regularization, while the plot at the bottom demonstrates the outcomes with variance regularization. Note that the noise free output of the QNN, represented by the dotted black line, accurately reproduces the logarithm function in both plots. The results of the shot-based simulator, here the QASM simulator in Qiskit [45], are computed utilizing 10 000 shots. By incorporating the variance regularization, the averaged variance of the trained QNN is reduced significantly by a factor of 85. This reduction in variance impacts the model’s precision, and it leads to an increase in the squared error from 9.3 · 10−5 to 8.3 · 10−3 in the noise-free optimization. However, there is no substantial visual difference observed in the noise-free outcome for these low fitting losses. This picture changes when considering the results of the shot-based simulations. Here, the difference between the evaluation of the QNN with the parameters obtained with and without variance regularization during the training is substantial. While the former results in a drastically noisy inference, the latter is difficult to visually distinguish from the noisefree result. Effectively, the 85-fold reduction in variance implies that the same level of shot noise can be achieved with 85 times fewer shots. Alternatively, if the number of shots is kept constant (as depicted in Figure 2), the standard deviation (cf. Eq. (6)) is reduced by a factor of 9.2. The example without variance regularization further illustrates that the QNN obtained through training with a noise-free simulator may not be practical for evaluations on a shotbased backend. Despite its high accuracy, the solution without variance regularization would require approximately 850000 shots to achieve a similar result as the QNN trained with variance regularization. The cost operator presented in Eq. (10) exhibits limited flexibility due to its inclusion of only three free parameters. Additionally, the two-body interaction term is not well-suited for calculating the variance, as classical post-processing scales with O(N 4 q ). In the subsequent sections, we will utilize a different operator for our experiments, given by: ˆ C(φ) = φ0 ˆ I+ Nq ∑ p φp ˆ Zp. (14) Our experiments have shown this operator to be more versatile and less susceptible to shot noise in general. Therefore, all the results presented in the following sections are obtained using this cost operator.
上述内容中实验过程使用的是什么内容，图中的曲线又代表了什么？是准确率还是拟合度？