Variational Quantum Fidelity Estimation

Computing quantum state ﬁdelity will be important to verify and characterize states prepared on a quantum computer. In this work, we propose novel lower and upper bounds for the ﬁdelity F ( ρ, σ ) based on the “trun-cated ﬁdelity” F ( ρ m , σ ) , which is evaluated for a state ρ m obtained by projecting ρ onto its m -largest eigenvalues. Our bounds can be re-ﬁned, i.e., they tighten monotonically with m . To compute our bounds, we introduce a hybrid quantum-classical algorithm, called Variational Quantum Fidelity Estimation, that involves three steps: (1) variationally diagonal-ize ρ , (2) compute matrix elements of σ in the eigenbasis of ρ , and (3) combine these matrix elements to compute our bounds. Our algo-rithm is aimed at the case where σ is arbitrary and ρ is low rank, which we call low-rank ﬁ-delity estimation, and we prove that no classical algorithm can eﬃciently solve this problem under reasonable assumptions. Finally, we demonstrate that our bounds can detect quantum phase transitions and are often tighter than previously known computable bounds for realistic situations.


Introduction
In the near future, quantum computers will become quantum state preparation factories. They will prepare ground and excited states of molecules [1], states that simulate quantum dynamics [2], and states that encode the solutions to linear systems [3]. These states will necessarily be impure, either intentionally (e.g., when studying thermal states) or due to incoherent noise of the quantum computer (e.g., T 1 and T 2 processes). Verification and characterization of these mixed states will be important, and hence efficient algorithms will be needed for this purpose. A widely used measure for verification and characterization is the fidelity [4][5][6][7][8]. For example, one may be interested in the fidelity with a fixed target state (i.e., for verification) or the fidelity between subsystems of manybody states to study behavior near a phase transition (i.e., for characterization) [9]. For two states ρ and σ, M. Cerezo: marcovsebastian@gmail.com the fidelity is defined as [4][5][6][7] F (ρ, σ) = Tr where A 1 = Tr  for properties of F (ρ, σ).
Classically computing F (ρ, σ), or any other metric on quantum states, could scale exponentially due to the exponentially large dimension of the density matrix. This raises the question of whether a quantum computer could avoid this exponential scaling. However, F (ρ, σ) involves non-integer powers of ρ and σ, implying that there is no exact quantum algorithm for computing it directly from the probability of a measurement outcome on a finite number of copies of ρ and σ. In addition, deciding whether the trace distance (which is closely related to fidelity [6,7]) is large or small is QSZK-complete [10]. Here, QSZK (quantum statistical zero-knowledge) is a complexity class that contains BQP [6] (bounded-error quantum polynomial time). It is therefore reasonable to suspect that estimating F (ρ, σ) is hard even for quantum computers.
This does not preclude the efficient estimation of fidelity for the practical case when one of the states is low rank. Low-rank states appear in condensed matter physics [11] (marginals of grounds states) and data science [12] (covariance matrices). We define Low-Rank Fidelity Estimation as the problem of estimating F (ρ, σ) when σ is arbitrary and ρ is approximately low rank. We prove under standard assumptions that a classical algorithm cannot efficiently perform Low-Rank Fidelity Estimation.
In this work, we propose a variational hybrid quantum-classical algorithm [1,[13][14][15][16][17][18][19][20][21] for Low-Rank Fidelity Estimation called Variational Quantum Fidelity Estimation (VQFE). VQFE computes upper and lower bounds on F (ρ, σ) that can be refined to arbitrary tightness. Our bounds are based on the truncated fidelity, which involves evaluating (1) for σ and ρ m , a truncated version of ρ obtained by projecting ρ onto the subspace associated with its m-largest eigenvalues. Crucially, our bounds tighten monotonically in m, and eventually they equal the fidelity when m = rank(ρ). This is in contrast to the state-of-the-art quantum algorithm to bound the fidelity, which employs fixed bounds called the sub-and super-fidelity bounds (SSFB) [22][23][24][25], defined as G(ρ, σ) = Trρσ + (1 − Trρ 2 )(1 − Trσ 2 ) , respectively, such that E(ρ, σ) F (ρ, σ) G (ρ, σ). Since the SSFB are expressed as traces of products of density matrices, they can be efficiently measured on a quantum computer [26][27][28][29]. These bounds are generally looser when both ρ and σ have high rank, and hence the SSFB likewise perform better when one of the states is low rank. Below we give a detailed comparison, showing that VQFE often outperforms the SSFB. We also note that VQFE only requires 2n + 1 qubits while the SSFB require 4n + 1 qubits, for n-qubit states.
To produce certified bounds from the output of VQFE, we prove several novel bounds that should be of independent interest in quantum information theory. In addition, we introduce the fidelity spectrum, which is the collection of all truncated fidelities. In the same sense that the entanglement spectrum provides more information than a single entanglement measure [11], we argue that the fidelity spectrum gives more information about the closeness of ρ and σ than just In what follows, we first present our bounds and the VQFE algorithm. We compare its performance with the SSFB and illustrate its application to phase transitions. All proofs of our results are delegated to the Appendix.

Truncated fidelity bounds
Let Π ρ m be the projector onto the subspace spanned by the eigenvectors of ρ with the m-largest eigenvalues. Consider the sub-normalized states (4) where the eigenvalues {r i } of ρ are in decreasing order (r i r i+1 ). For simplicity we denote ρ ρ m = ρ m . These sub-normalized states can be used to define the truncated fidelity and the truncated generalized fidelity where the generalized fidelity [30,31] was defined for two sub-normalized states as F * (ρ, σ) = √ ρ √ σ 1 + (1 − Tr ρ)(1 − Tr σ). The generalized fidelity reduces to (1) if at least one state is normalized. Equations (5) and (6) are in fact lower and upper bounds, respectively, for the fidelity. (1) First, ρ is diagonalized with a hybrid quantum-classical optimization loop, outputting the largest eigenvalues {ri} of ρ and a gate sequence that prepares the associated eigenvectors. (2) Second, a hybrid quantum-classical computation gives the matrix elements of σ in the eigenbasis of ρ. (3) Finally, classical processing gives upper and lower bounds on F (ρ, σ). Proposition 1. The following truncated fidelity bounds (TFB) hold: We refer to the collection of TFB for different values of m as the fidelity spectrum. The TFB are satisfied with equality when m = rank(ρ). Moreover, they monotonically get tighter as m increases. Hence they can be refined to arbitrary tightness by increasing m.
Proposition 2. The truncated fidelity F (ρ m , σ ρ m ) is monotonically increasing in m, and the truncated generalized fidelity F * (ρ m , σ ρ m ) is monotonically decreasing in m.
Ultimately, we will consider the case when ρ is either low rank or -low-rank. Here we define the -rank as a generalization of the rank to within some error: where d is the Hilbert space dimension. Note that rank 0 (ρ) = rank(ρ). We remark that the looseness of the TFB is bounded by the square root of ρ−ρ m 1 = 1 − Tr(ρ m ): where we have used (5), (6), and Trσ ρ m 1. Hence, the TFB looseness is bounded by √ provided that m = rank (ρ). Figure 1 shows the overall structure of the VQFE algorithm. VQFE involves three steps: (1) approximately diagonalize ρ with a variational hybrid quantum-classical algorithm, (2) compute matrix elements of σ in the eigenbasis of ρ, (3) classically process these matrix elements to produce certified bounds on F (ρ, σ).

The VQFE algorithm
The first subroutine employs Variational Quantum State Diagonalization (VQSD) [18], a variational hybrid algorithm that takes in two copies of ρ and outputs approximations of the m-largest eigenvalues {r i } and a gate sequence U that prepares the associated eigenvectors {|r i }. This subroutine involves a quantum-classical optimization loop that minimizes a cost function C that quantifies how farρ = U ρU † is from being diagonal. Namely, C = D HS (ρ, Z(ρ)), with D HS (ρ, σ) = Tr[(ρ − σ) 2 ] the Hilbert-Schmidt distance and Z the dephasing channel in the computational basis. When C = 0 we have exact diagonalization, whereas for C = 0, VQSD outputs the eigenvalues and eigenvectors of such that C = D HS (ρ, ρ ). The second subroutine measures the matrix elements σ ij = r i |σ|r j , or more precisely σ ij = r i |σ|r j if C = 0. This is done by preparing superpositions of the eigenvectors of the form (|r i + |r j )/ √ 2 (by means of VQSD's eigenstate preparation circuit [18]) and computing the inner product of this superposition with σ via a Swap Test. (For example, see [19,28] for the precise circuit.) For a fixed m, one needs to measure m(m + 1)/2 matrix elements. However, when incrementing m to m + 1, one only needs to measure 2m + 1 new quantities.
The third subroutine involves only classical computation, combining the outputs of the previous subroutines to produce bounds on F (ρ, σ). These bounds employ the TFB described before, for which one needs to compute Here we have defined the m × m matrix T with elements T ij = √ r i r j r i |σ|r j = √ r i r j σ ij such that T 0. Note that the T ij can be computed directly from the outputs of the first two subroutines. One can then classically diagonalize T to compute (11). (If shot noise leads to a non-positive matrix T , one can efficiently find the maximum-likelihood matrixT 0 which gives the observed results with highest probability [32], and useT in place of T .) Note that since Technically, the aforementioned procedure computes F (ρ m , σ ρ m ) and F * (ρ m , σ ρ m ). If C ≈ 0, then ρ ≈ ρ and these quantities are actually bounds on F (ρ, σ). However, if C is appreciable then to produce certified bounds we must account for ρ = ρ. Here we present two such certified bounds.
Proposition 3. The following certified cost function bounds (CCFB) hold: Figure 2: Implementations of VQFE on IBM's quantum computer simulator. The left (right) panel shows bounds on F (ρ, σ) (solid straight line) versus m for a random state σ and a tensor product state ρ of n = 3 (n = 6) qubits with rank(ρ) = 4 (rank(ρ) = 8). Dashed lines depict the SSFB. In both cases the TFB converge to F (ρ, σ). The Certified Bounds (CB) become tighter than the SSFB in both cases, but for n = 6 case the certified bounds remain gapped for large m since the cost C is non-negligible.
The CCFB show the operational meaning of C, which not only bounds the VQSD eigenvalue and eigenvector error [18] but also the VQFE error. Note that δ 2 is directly computable from the VQSD experimental data, whereas δ 1 is useful if one has a promise that ρ is low rank. Alternatively one can use the following certified bounds based on the triangle inequality.
Proposition 4. Let D (F (ρ, σ)) be a distance measure that is monotonically decreasing in F (ρ, σ). Let ρ, σ, and ρ be three arbitrary quantum states. Then the following certified triangular inequality bounds (CTIB) hold: with where ρ m , σ ρ m , and ρ ρ m are projections onto the subspace of the m largest eigenvectors of ρ analogous to (4).
One obtains bounds on F (ρ, σ) from Proposition 4 by inverting D. Moreover, from Proposition 2, one can show that these bounds are refinable: D LB m monotonically increases in m, and D UB m monotonically decreases in m. The CTIB are valid for the Bures angle D A (F (ρ, σ)) = arccos F (ρ, σ), Bures distance D B (F (ρ, σ)) = 2 − 2F (ρ, σ), and the Sine distance D S (F (ρ, σ)) = 1 − F (ρ, σ) 2 [33, 34], and hence one can take the metric that gives the tightest bounds. Furthermore, combining Propositions 3 and 4, we use the term Certified Bounds (CB in Fig. 2) to refer to the minimum (maximum) of our certified upper (lower) bounds. In other words, the Certified Bounds are obtained by taking the tighter of the two bounds provided by Propositions 3 and 4.  (TFB, CCFB, and CTIB) to become tighter than the SSFB (m * ) versus n. Results were averaged over 2000 random states σ (with uniformly distributed rank and purity), and random states ρ with: low rank (rank(ρ) = n, left), or high purity (1/n Tr(ρ 2 ) < 1, right). Error bars depict standard deviation. A non-zero cost C was obtained by applying a random unitary close to the identity to the diagonal form of ρ. As n increases, m * remains O(n) while the dimension grows exponentially (dashed curve). Figure 2 shows our VQFE implementations on IBM's quantum computer simulator. The left and right panels show representative results for n = 3 and n = 6 qubits, respectively. We used the Constrained Optimization By Linear Approximation (COBYLA) algorithm [35] in the VQSD optimization loop and achieved a cost of C ∼ 10 −6 (see Ref.

Implementations
[36] for a comparison of state-of-the-art optimizers for variational algorithms). We chose σ as a random state and ρ = n j=1 ρ j as a tensor product state, where the latter can be diagonalized with a depth-one quantum circuit ansatz. As one can see, as m increases the TFB rapidly converge to F (ρ, σ), and since C is small (∼ 10 −6 ), the TFB can be viewed as bounds on F (ρ, σ). Nevertheless we also show our Certified Bounds, and in both cases the Certified Bounds are significantly tighter than the SSFB.

Heuristic scaling
Let m * denote the minimum value of m needed for our bounds to become tighter than the SSFB. Figure 3 plots m * for the TFB, CCFB, and CTIB for systems with n = 2, . . . , 7 qubits. The results were obtained by averaging m * over 2000 random states ρ and σ. We considered two cases of interest: when ρ is a lowrank state, and when it has an exponentially decaying spectrum leading to full rank but high purity. In both scenarios m * is O(n) with m * ≈ 2 for the TFB and CCFB, implying that our bounds can outperform the SSFB by only considering a number of eigenvalues in the truncated states which do not scale exponentially with n. Figure 4: Fidelity spectrum (m = 1, . . . , 5) between thermal states ρ(h) and ρ(h + δh) of a cyclic Ising chain with N = 8 spins-1/2 in a magnetic field h at inverse temperature β = 10/J, with J the coupling strength and δh = 0.01/J. Dashed lines indicate the SSFB. The left (right) panel depicts the lower (upper) TFB of (7). The fidelities present a dip at h ≈ 1 indicating the zero temperature transition of the model. Inset: Bounds for the position of the minimum of the fidelity (and hence the transition) derived from the SSFB and TFB.

Example: Quantum phase transition
It has been shown that the fidelity can capture the geometric distance between thermal states of condensed matter systems nearing phase transitions and can provide information about the zero-temperature phase diagram [37][38][39]. We now demonstrate the application of VQFE to the study of phase transitions. Consider a cyclic Ising chain of N = 8 spins-1/2 in a uniform field. The Hamiltonian reads the spin components at site j, h the magnetic field, and J the exchange coupling strength. While this model is exactly solvable, it remains of interest as its thermal states can be exactly prepared on a quantum computer [40,41]. Figure 4 shows the fidelity spectrum for this example. We first verify that the SSFB and the TFB present a pronounced dip near h = 1, implying that they can detect the presence of the zero-temperature transition. Moreover, VQFE allows a better determination of the critical field: The TFB give a range for the transition which monotonically tightens as m increases and outperforms the SSFB already for m = 3 (see inset). The TFB also provide information regarding the closeness of eigenvectors (e.g., upper-TFB which are ≈ 1 for m = 1, 2), and can detect level crossings where the structure of the subspace spanned by {|r i } drastically changes. For instance, near h = 1 the m = 3, 4 TFB present a discontinuity from the crossing between a uniform eigenstate and a pair of exactly degenerate non-uniform symmetry-breaking states. Hence, the fidelity spectrum provides information about the structure of the states beyond the scope of the SSFB or even F (ρ, σ).

Complexity analysis
Recent dequantization results [42,43] suggest that exponential speedup over classical algorithms can disappear under low-rank assumptions. Here we show this is not the case for Low-Rank Fidelity Estimation. Low-Rank Fidelity Estimation remains classically hard despite the restriction that one or both of the states are low rank. We formally define Low-Rank Fidelity Estimation as follows.
We remark that VQFE does not require knowledge of the circuit descriptions of ρ and σ. Rather, allowing for such knowledge is useful when considering classical algorithms.
Next, we analyze the hardness of Low-Rank Fidelity Estimation. Recall that the complexity class DQC1 consists of all problems that can be efficiently solved with bounded error in the one-clean-qubit model of computation [44]. The classical simulation of DQC1 is impossible unless the polynomial hierarchy collapses to the second level [45,46], which is not believed to be the case. Hence, given the following proposition, one can infer that a classical algorithm cannot efficiently perform Low-Rank Fidelity Estimation.
On the other hand, let us now consider the complexity of the VQFE algorithm. The following proposition demonstrates that VQFE is efficient, so long as the VQSD step is efficient. Proposition 6. Let ρ and σ be quantum states, and suppose we have access to a subroutine that diagonalizes ρ up to error bounded by C = D HS (ρ, ρ ). Let m and ζ be parameters. Then, VQFE runs in time O(m 6 /ζ 2 ) and outputs an additive ±γ-approximation of F (ρ, σ), for and where is determined by m = rank (ρ).
Consider the implications of Proposition 6 when ρ is -low rank, meaning that = 1/ poly(n) for m = poly(n). In this case, VQFE can solve Low-Rank Fidelity Estimation with precision γ = 1/ poly(n), assuming that the diagonalization error C is small enough such that mC = 1/ poly(n) and also that ζ = 1/ poly(n), which suffices since T 1. Under these assumptions, the run time of VQFE will be poly(n).

Conclusion
In this work, we introduced novel bounds on the fidelity based on truncating the spectrum of one of the states, and we proposed a hybrid quantum-classical algorithm to compute these bounds. We furthermore showed that our bounds typically outperform the sub-and super-fidelities, and they are also useful for detecting quantum phase transitions. Our algorithm will likely find use in verifying and characterizing quantum states prepared on a quantum computer.
Let us recall that we have proposed employing maximum likelihood methods to reconstruct the T matrix when noise makes it non-positive. However, in the context of state tomography, such procedures can can lead to biases that change the entanglement properties of the estimated state [47,48]. Hence, we leave for future work the analysis of the effect that such reconstruction methods can have on our bounds.
A strength of VQFE is that it does not require access to purifications of ρ and σ, although future research could study whether having such access could simplify the estimation of F (ρ, σ) (e.g., using Uhlmann's theorem [6]). Another important future direction is to use VQFE to compute distance between quantum operations, e.g., as in [49]. In addition it would be of interest to extend VQFE to the sandwiched Renyi relative entropies D α (ρ||σ) [50, 51], defined by: (17) Note that α = 1/2 corresponds to F (ρ, σ). Expanding (17)  A Proof of Proposition 1 Proposition 1. The following truncated fidelity bounds (TFB) hold: (1) Proof. The right-hand-side of (1) follows from the fact that the generalized fidelity is monotonous under completely positive trace non-increasing (CPTNI) maps [30,31]. In particular, we can define the CPTNI map with Π ρ m the projector onto the subspace spanned by the eigenvectors with m-largest eigenvalues, which leads to The lower bound is derived from the strong concavity of the fidelity [6], as follows: Proof. The monotonicity of the truncated fidelity follows from the same procedure as the one used to derived (4). Namely, we expand ρ m = Π ρ m−1 ρΠ ρ m−1 + |r m ρ mm r m |, with ρ mm = r m |ρ|r m , and we defineρ m = ρ m /p m with p m = Trρ m . Applying strong concavity gives On the other hand, since ρ m = E m (ρ m+1 ) and σ ρ m = E m (σ ρ m+1 ), then by the monotonocity under CPTNI maps of the generalized fidelity we get F * (ρ m+1 , σ ρ m+1 ) F * (ρ m , σ ρ m ).

C Proof of Proposition 3
Before proving Proposition 3, we first prove four useful lemmas. Of particular interest is Lemma 4 below since it generalizes the main result of [52] (corresponding to the special case of = 0). All of these lemmas employ our notion of -rank. We remind the reader that this is defined as follows: where d is the Hilbert-space dimension.
Lemma 1. For any positive semi-definite operators A, B, and C, where C is normalized (Tr(C) = 1), we have Proof. We first write the left-hand-side as It is well known that given a d × d matrix M with singular value decomposition M = U 0 SU 1 , then (We remark that in the last expression the absolute value is not necessary but we include it for clarity.) Let V opt and W opt be the optimal unitaries for F (A, C) and F (B, C), respectively. Then (8) can be expressed as Tr( = Tr ( where we have used |Tr CV opt | and the triangular inequality for the absolute value. Then, by means of the matrix Hölder inequality [53] and the fact that C is normalized, we obtain ∆F Tr ( By symmetry, one can replace ∆F with −∆F in (13). So (13) also holds for |∆F |.
Lemma 2. Let ρ be a quantum state and let ρ = U † Z(U ρU † )U be its VQSD approximation defined in (10) of the main text. Then rank (ρ) rank (ρ ) .
Proof. Let us first defineρ Z = Z(ρ), withρ = U ρU † and Z the dephasing channel in the computational basis, such that ρ = U †ρ Z U . Due to Schur-Horn's theorem we have that the eigenvalues ofρ majorize its diagonal elements, implying thatρ majorizesρ Z . Moreover, sinceρ has the same eigenvalues as ρ, and ρ has the same eigenvalues asρ Z , then we have that ρ majorizes ρ . In summary, ρ ρ Z , and ρ ρ .
Next, let us definem = rank (ρ ). Since ρ ρ , we have j m r j j m r j and hence The fact that ρ − ρm 1 implies that rank (ρ) m and hence rank (ρ) rank (ρ ) .
Proof. Let {r j }, {s j }, and {δ j } respectively denote the eigenvalues of ρ, σ, and ∆, where the eigenvalues in each set are in decreasing order. By means of Weyl's inequality [54,55] applied to ρ = ∆ + σ we get Because σ 0, we have s d 0, and hence r j δ j , ∀j .
Since ∆ + is the positive part of ∆, then from the previous equation its eigenvalues (which we denote {δ + j } and which are in decreasing order) are such that Let us now definem = rank (ρ). By means of the definition of -rank (6), we have that Moreover, from (21) we get j>m r j j>m δ + j = ∆ + − ∆ + m 1 , which gives This implies that rank (∆ + ) m and hence that rank (∆ + ) rank (ρ). Similarly we denote the set of eigenvalues of ∆ − as {δ − j }. From Weyl's inequality we now have s j δ − j , ∀j. Letm = rank (σ) such that σ − σm 1 = j>m s j . Since j>m s j j>m δ − j , we then get which implies rank (∆ − ) m and hence rank (∆ − ) rank (σ).

D Proof of Proposition 4
We remark that Proposition 4 applies to any three quantum states, although for our purposes we are interested in its application to the states ρ, σ, and ρ discussed in the main text. Hence, for consistency, we state this proposition for these states, but we note that these states can be arbitrary. D (F (ρ, σ)) be a distance measure that is monotonically decreasing in F (ρ, σ). Let ρ, σ, and ρ be three arbitrary quantum states. Then the following certifiable triangular inequality bounds (CTIB) hold:

Proposition 4. Let
with where ρ m , σ ρ m , and ρ ρ m are projections of ρ , σ, and ρ, respectively, onto the subspace of the m-largest eigenvectors of ρ .
Proof. Since D (F (ρ, σ)) is a distance measure, it satisfies the triangular inequality. Applying this to the states ρ, σ, and ρ gives Combining Proposition 1 with (46) and using the monotonicity of D yields (43).

E Proof of Proposition 5
Proposition 5. The problem Low-rank Fidelity Estimation to within precision ±γ = 1/ poly(n) is DQC1hard.
Proof. We reduce from the problem of approximating the Hilbert-Schmidt inner-product magnitude ∆ HS between two quantum circuitsŨ andṼ acting on n-qubits [17], where we define where d = 2 n . Consider a specific instance of approximating ∆ HS . We are given as input classical instructions to prepare poly(n)-sized quantum circuitsŨ andṼ on n-qubits each, and the task is to approximate ∆ HS (Ũ ,Ṽ ) to precision 1/ poly(n). Our reduction will identify this problem as a specific instance of Low-rank Fidelity Estimation (Low-Rank Fidelity Estimation) via the Choi-Jamiołkowski isomorphism over the unitary channels, where D(H d ) is the space of d × d dimensional hermitian matrices. Consider now the 2n-qubit maximally entangled state, where j = (j 1 , j 2 , ..., j n ) is a binary vector taking values j k in {0, 1}, and where E is an efficent unitary entangling gate (e.g., a depth-two circuit composed of Hadamard and CNOT gates), where |0 = |0 ⊗2n . A special case of Low-Rank Fidelity Estimation is when ρ and σ correspond to the Choi states ofŨ andṼ .
In this case, as the input to Low-Rank Fidelity Estimation, we would be given the gate sequences U = (Ũ ⊗ 1)E and V = (Ṽ ⊗ 1)E, which respectively prepare the pure states ρ and σ as Then, the fidelity between ρ and σ is given by We can run Low-rank Fidelity Estimation to estimate the above expression to within γ = 1/ poly(n) precision, and thus also approximate ∆ HS (U, V ) to within 1/ poly(n). Finally, it is known that approximating ∆ HS (U, V ) to within inverse polynomial precision is DQC1-hard [17], and hence the result follows.

F Proof of Proposition 6
Before proving Proposition 6, we first prove the following useful lemmas.
Proof. Consider the difference where we have defined the vector δ = r − r , with r = {r 1 , . . . , r m } and r = {r 1 , . . . , r m }. From the vector norm equivalence, we have that δ 1 √ m δ 2 , which then implies Moreover, as shown in [18], the VQSD cost C bounds the eigenvalue error as δ 2 2 = m i=1 (r i −r i ) 2 C. Hence, combining this with Eq. (56), we get m m + √ mC.
The following lemma is an alternative version of Proposition 6 that may be of interest in itself, particularly when we do not have the promise that ρ is low rank. Note that this lemma does not refer to the rank properties of ρ but rather refers to the rank properties of ρ . The -rank of ρ is experimentally measurable and hence one can use the following lemma to guarantee a particular precision even when there is no prior knowledge about the rank properties of ρ. Lemma 6. Let ρ and σ be quantum states, and suppose we have access to a subroutine that diagonalizes ρ up to error bounded by C = D HS (ρ, ρ ). Let m and ζ be parameters. Then, VQFE runs in time O(m 6 /ζ 2 ) and outputs an additive ±γ -approximation of F (ρ, σ), for where m = ρ − ρ m 1 .
Proof. Let us first define the following quantities which will be useful to bound the error in each step of the VQFE algorithm: where the notationâ (e.g., inT ) indicates a fine-sampling estimate of the random variable a. Note that the following bounds hold: where the first inequality comes from Eq. (42) and the second inequality can be derived from Eq. (9) of the main text as follows Finally, we prove the third inequality in Eq. (73) below. By means of multiple applications of the triangle inequality, we obtain the following result: Let us define and combine our previous results to bound the VQFE run time: Pr |F (ρ, σ) −F (ρ m , σ)| γ = Pr [∆ 0 B 1 + B 2 + ζ T ] As previously mentioned, VQFE performs the Swap Test for each of the O(m 2 ) matrix elements. Therefore, VQFE runs in time O(m 6 /ζ 2 · log(2m 2 /δ)), or just O(m 6 /ζ 2 ) when neglecting slower growing logarithmic contributions. Furthermore, from (82), we have that VQFE outputs an additive ±γ -approximation of the fidelity F (ρ, σ) with precision γ defined by (77) and with probability at least 1 − δ.
Proof. This proposition is very similar to Lemma 6 except that γ is replaced by γ. To make this replacement we show that γ γ as follows: The first inequality follows from the fact that m = rank (ρ) and the second inequality follows from Lemma 5. Recall from the proof of Lemma 6 (Eq. (82)) that the output of VQFE satisfies the following inequality Pr |F (ρ, σ) −F (ρ m , σ)| γ 1 − δ.
As noted in the proof of Lemma 6, VQFE achieves this output with a run time O(m 6 /ζ 2 ). Hence, with this run time, VQFE outputs a ±γ-approximation of the fidelity F (ρ, σ) with precision γ defined by (83) and with probability at least 1 − δ.