This paper was converted on www.awesomepapers.org from LaTeX by an anonymous user.
Want to know more? Visit the Converter page.

Improved Quantum Algorithms for Fidelity Estimation

András Gilyén        Alexander Poremba Alfréd Rényi Institute of Mathematics, Hungary. Supported in part by the AWS Center for Quantum Computing. [email protected]Caltech, Pasadena, CA, USA. Funding provided by Samsung Electronics Co., Ltd., for the project “The Computational Power of Sampling on Quantum Computers”. Additional support was provided by the Institute for Quantum Information and Matter, an NSF Physics Frontiers Center (NSF Grant PHY-1733907).Caltech, Pasadena, CA, USA. Partially supported by AFOSR YIP award number number FA9550-16-1-0495 and the Institute for Quantum Information and Matter (an NSF Physics Frontiers Center; NSF Grant PHY-1733907). [email protected]
Abstract

Fidelity is a fundamental measure for the closeness of two quantum states, which is important both from a theoretical and a practical point of view. Yet, in general, it is difficult to give good estimates of fidelity, especially when one works with mixed states over Hilbert spaces of very high dimension. Although, there has been some progress on fidelity estimation, all prior work either requires a large number of identical copies of the relevant states, or relies on unproven heuristics. In this work, we improve on both of these aspects by developing new and efficient quantum algorithms for fidelity estimation with provable performance guarantees in case at least one of the states is approximately low-rank. Our algorithms use advanced quantum linear algebra techniques, such as the quantum singular value transformation, as well as density matrix exponentiation and quantum spectral sampling. As a complementary result, we prove that fidelity estimation to any non-trivial constant additive accuracy is hard in general, by giving a sample complexity lower bound that depends polynomially on the dimension. Moreover, if circuit descriptions for the relevant states are provided, we show that the task is hard for the complexity class called (honest verifier) quantum statistical zero knowledge via a reduction to a closely related result by Watrous.

1 Introduction

Today’s quantum computers suffer from various kinds of incoherent noise (for example, as a result of T1T_{1} and T2T_{2} processes), which makes it difficult to use current quantum technologies to their best advantage [NC00]. Characterizing noise in quantum systems is therefore a fundamental problem for quantum computation and quantum information. Since quantum states have a much finer structure than their classical counterparts comprised of probability distributions, this calls for sophisticated distance measures between quantum states, such as trace distance, the Bures metric and fidelity.

Each distance measure captures slightly different aspects of how two quantum states differ. While fidelity is not a metric on the space of density matrices, it stands out by its versatility and applicability, and naturally appears in many practical scenarios. For example, it captures the geometric distance between thermal states of condensed matter systems nearing phase transitions, and can thus provide useful information about the zero temperature phase diagram [ZQWS07, QC09]. In other contexts, the fidelity of quantum states allows one to infer chaotic behavior of thermofield dynamics of many-body quantum systems [XCPdC21].

The fidelity of two positive semi-definite operators ρ\rho and σ\sigma on a Hilbert space111In the infinite dimensional setting one should also assume that ρ\rho and σ\sigma are trace-class operators. To avoid similar difficulties in this paper we restrict our attention to the finite-dimensional case. \mathcal{H} is defined as

F(ρ,σ)=Tr[ρσρ].\displaystyle F(\rho,\sigma)=\mbox{Tr}\left[\sqrt{\sqrt{\rho}\sigma\sqrt{\rho}}\right]. (1)

The fidelity is symmetric in ρ\rho and σ\sigma, and for quantum states its value lies between 0 and 11, equalling 11 if and only if the states are identical. In this work, we are concerned with the problem of estimating the fidelity up to some additive error. In other words, given two density operators ρ,σd×d\rho,\sigma\in\mathbb{C}^{d\times d} and ε(0,1)\varepsilon\in(0,1), the problem is to output an additive ε\varepsilon-approximation F^(ρ,σ)\hat{F}(\rho,\sigma) such that

F(ρ,σ)εF^(ρ,σ)F(ρ,σ)+ε.\displaystyle F(\rho,\sigma)-\varepsilon\,\leq\,\hat{F}(\rho,\sigma)\,\leq\,F(\rho,\sigma)+\varepsilon. (2)

We study two input models. In the weaker input model called sampling access, we only assume access to identical independent copies of the states, whereas in the stronger model called purified access, we assume access to quantum circuits UρU_{\rho} and UσU_{\sigma} that allow one to prepare a purification of the quantum states. In the latter model, we denote by TρT_{\rho} and TσT_{\sigma} the time complexity of preparing the purifications of ρ\rho and σ\sigma, respectively. Let us also denote by r[d]r\in[d] the smallest rank of the two states. Without loss of generality, we can always assume that r=rk(ρ)r=\mathrm{rk}\left(\rho\right). In general it is computationally difficult to give good estimates of the fidelity F(ρ,σ)F(\rho,\sigma), especially when one works with mixed states over Hilbert spaces of very high dimension.

In this work, we present new and efficient approximation algorithms for fidelity estimation which have poly(r,1/ε)\operatorname{poly}(r,1/\varepsilon) time and sample/query complexity, and far outperform previous algorithms in the literature. As a complementary result, we prove new hardness results and show that the task of approximating fidelity to any non-trivial constant error is hard for the complexity class called (honest verifier) quantum statistical zero knowledge.

1.1 Related work

We now give an overview of approximation algorithms for fidelity estimation. Let us first discuss the setting in which one of the states is pure, which is fairly well-understood as the fidelity reduces to the the simple quantity F(|ψψ|,σ)=ψ|σ|ψF(\lvert\psi\rangle\langle\psi\rvert,\sigma)=\sqrt{\langle\psi\rvert\sigma\lvert\psi\rangle}. Buhrmann et al. [BCWdW01] gave an efficient quantum algorithm known as the Swap Test which allows one to obtain an additive ε\varepsilon-approximation of ψ|σ|ψ\langle\psi\rvert\sigma\lvert\psi\rangle given O~(1/ε2)\tilde{O}(1/\varepsilon^{2}) indentical copies of |ψ\lvert\psi\rangle and σ\sigma (see also [CSSC18]). Flammia and Liu [FL11] subsequently gave a randomized ε\varepsilon-approximation algorithm known as direct fidelity estimation which only involves Pauli measurements on O~(d/ε2)\tilde{O}(d/\varepsilon^{2}) samples of |ψ\lvert\psi\rangle and σ\sigma. The general task of fidelity estimation in which both density operators are mixed states is far less understood and requires a much more careful approach.

A simple and direct method for estimating mixed state fidelity is through the use of quantum state tomography. O’Donnell and Wright [OW16] showed that, given O(rd/ε2)O(r\cdot d/\varepsilon^{2}) copies of ρ\rho, one can obtain an estimate ρ^\hat{\rho} such that ρ^ρ2ε\|\hat{\rho}-\rho\|_{2}\leq\varepsilon. Using quantum state tomography, one can therefore construct a simple poly(d,1/ε)\operatorname{poly}(d,1/\varepsilon)-time approximation algorithm which evaluates the fidelity F(ρ^,σ^)F(\hat{\rho},\hat{\sigma}) directly given in the order of poly(d,1/ε)\operatorname{poly}(d,1/\varepsilon) many copies of ρ\rho and σ\sigma.

Cerezo et al. [CPCC20] later studied the problem of low-rank fidelity estimation on near-term quantum computers via heuristic variational quantum algorithms that require many identical copies of ρ\rho and σ\sigma. In the same work, the authors also showed that low-rank fidelity estimation is hard for the complexity class called 𝖣𝖰𝖢𝟣\mathsf{DQC1}, which consists of all problems that can be efficiently solved with bounded error in the one clean-qubit model of quantum computation. Agarwal et al. [ARSW21] recently considered variational algorithms for fidelity estimation in other special cases. As a complementary result, the authors also showed that fidelity estimation in the case where one state is pure and the other is mixed is 𝖡𝖰𝖯\mathsf{BQP}-complete. In the meantime Wang et al. [WZC+21] proposed a quantum algorithm in the purified access model that utilizes block-encoding techniques and computes an ε\varepsilon-approximation to F(ρ,σ)F(\rho,\sigma) in time O(r21.5ε23.5(Tρ+Tσ))O\left(\frac{r^{21.5}}{{\varepsilon^{23.5}}}(T_{\rho}+T_{\sigma})\right), where TρT_{\rho} and TσT_{\sigma} correspond to the time complexity of purified access, i.e., the complexity of the circuits UρU_{\rho} and UσU_{\sigma} preparing purifications of ρ\rho and σ\sigma respectively. Crucially, the work of Wang et al. [WZC+21] does not take the special case into consideration where one of the states is approximately low-rank.

We give a summary of the most relevant results for fidelity estimation in the table below.

Approximation method Time/query/sample complexity Assumptions
Quantum state tomography [OW16] poly(d,1/ε)\operatorname{poly}(d,1/\varepsilon) identical copies
Variational fidelity estimation [CPCC20] N/A (heuristic) identical copies
Block-encoding algorithm [WZC+21] O~(r21.5ε23.5(Tρ+Tσ))\tilde{O}\left(\frac{r^{21.5}}{{\varepsilon^{23.5}}}(T_{\rho}+T_{\sigma})\right) purified access
Our block-encoding algorithm (Section 3) O~(r2.5ε5(Tρ+Tσ))\tilde{O}\left(\frac{r^{2.5}}{\varepsilon^{5}}(T_{\rho}+T_{\sigma})\right) purified access
O~(r5.5ε12)\tilde{O}\left(\frac{r^{5.5}}{\varepsilon^{12}}\right) identical copies
Our spectral sampling algorithm (Section 4) O~(r10.5(Tρ+Tσ)ε25Δ+r3Tρmin{ε7r3,Δ}3)\tilde{O}\left(\frac{r^{10.5}(T_{\rho}+T_{\sigma})}{\varepsilon^{25}\Delta}+\frac{r^{3}T_{\rho}}{\min\{\frac{\varepsilon^{7}}{r^{3}},\Delta\}^{3}}\right) purified access, spectrum*
Any (i.e., lower bound) [BOW19, OW15] Ω(rε)\Omega\left(\frac{r}{\varepsilon}\right) identical copies

We remark that our spectral sampling-based algorithm assumes that ρ\rho has a Δ\Delta-gapped spectrum.

Our improved quantum algorithms for fidelity estimation in Section 3 and Section 4 achieve poly(r,1/ε)\operatorname{poly}(r,1/\varepsilon) time and sample/query complexity in order to output an ε\varepsilon-estimate for the fidelity F(ρ,σ)F(\rho,\sigma). We remark that our algorithms give further significant improvements in the case in which at least one of the states is approximately low-rank through the use of truncation.222Just before submitting this manuscript we noticed the concurrent work of Wang et al. [WGL+22]. While our block-encoding based algorithm still has a far better complexity, our spectral sampling algorithm is less favourable in the worst case. However, it offers significant improvements in the approximate low-rank regime through the use of truncation.

1.2 Our results

Fidelity estimation with block-encoding based algorithms.

Our first algorithm is based on advanced quantum linear algebra techniques, such as block-encodings and the quantum singular value transformation (QSVT) [GSLW19]. Our algorithm obtains an estimate F(ρθ,σ)F(\rho_{\theta},\sigma), where ρθ\rho_{\theta} is a so-called “soft-thresholded” version of ρ\rho in which eigenvalues of ρ\rho below (1δ)θ(1-\delta)\theta are completely removed and eigenvalues above θ\theta are kept intact, while eigenvalues in the interval [(1δ)θ,θ][(1-\delta)\theta,\theta] are potentially missing or decreased by some amount. In the purified access model our algorithm has the complexity

𝒪~(rkθε2δθ32Tρ+rkθ2ε4θ12Tσ),\widetilde{\mathcal{O}}\left(\frac{\mathrm{rk}_{\theta}}{\varepsilon^{2}\delta\theta^{\frac{3}{2}}}T_{\rho}+\frac{\mathrm{rk}_{\theta}^{2}}{\varepsilon^{4}\theta^{\frac{1}{2}}}T_{\sigma}\right),

where rkθ\mathrm{rk}_{\theta} is any upper bound on the number of eigenvalues of ρ\rho in the interval [(1δ)θ,1][(1-\delta)\theta,1]. Since rkθ1(1δ)θ\mathrm{rk}_{\theta}\leq\frac{1}{(1-\delta)\theta}, for any δ[0,12]\delta\in[0,\frac{1}{2}], the above can be always be bounded above by

𝒪~(Tρε2δθ52+Tσε4θ52).\widetilde{\mathcal{O}}\left(\frac{T_{\rho}}{\varepsilon^{2}\delta\theta^{\frac{5}{2}}}+\frac{T_{\sigma}}{\varepsilon^{4}\theta^{\frac{5}{2}}}\right).

On the other hand, if we know that rk(ρ)r\mathrm{rk}\left(\rho\right)\leq r, then choosing θ=Θ(ε2r)\theta=\Theta(\frac{\varepsilon^{2}}{r}) and δ=12\delta=\frac{1}{2} our algorithm obtains an ε\varepsilon-precise estimate of F(ρ,σ)F(\rho,\sigma) in complexity

𝒪~(r52ε5(Tρ+Tσ)),\widetilde{\mathcal{O}}\left(\frac{r^{\frac{5}{2}}}{\varepsilon^{5}}(T_{\rho}+T_{\sigma})\right),

as we show that |F(ρ,σ)F(ρθ,σ)|Tr[Π[0,θ)ρΠ[0,θ)]|F(\rho,\sigma)-F(\rho_{\theta},\sigma)|\leq\sqrt{\mbox{Tr}\left[\Pi^{\phantom{\rho}}_{[0,\theta)}\rho\Pi^{\phantom{\rho}}_{[0,\theta)}\right]} in Section 2.7333Here Π[0,θ)\Pi_{[0,\theta)} projects out the eigenvalues of ρ\rho below θ\theta as defined in Corollary 24. analogously to [CPCC20].

At its core, our algorithm builds on the Hadamard Test which, given a quantum state ρ\rho and a block-encoding of a matrix AA, outputs 0 with probability Re(Tr[ρ(I+A)/2])\mathrm{Re}(\mbox{Tr}\left[\rho(I+A)/2\right]). Denoting by UΣVU\Sigma V^{\dagger} a singular value decomposition of ρσ\sqrt{\rho}\sqrt{\sigma}, we can then write the fidelity as follows:

F(ρ,σ)=ρσ1=Tr[UρσV]=Tr[ρσVU]=Tr[ρ(ρ12σVU)].\displaystyle F(\rho,\sigma)=\left\lVert\sqrt{\rho}\sqrt{\sigma}\right\rVert_{1}=\mbox{Tr}\left[U^{\dagger}\sqrt{\rho}\sqrt{\sigma}V\right]=\mbox{Tr}\left[\sqrt{\rho}\sqrt{\sigma}VU^{\dagger}\right]=\mbox{Tr}\left[\rho(\rho^{-\frac{1}{2}}\sqrt{\sigma}VU^{\dagger})\right].

Therefore, it suffices to construct a (subnormalized) block-encoding of ρ12σVU\rho^{-\frac{1}{2}}\sqrt{\sigma}VU^{\dagger} in order to compute an estimate of F(ρ,σ)F(\rho,\sigma). When working with ρθ\rho_{\theta} instead of ρ\rho we can effectively bound ρ12\left\lVert\rho^{-\frac{1}{2}}\right\rVert by 𝒪(θ12)\mathcal{O}\left(\theta^{-\frac{1}{2}}\right), so the block-encoding will have subnormlaization θ12\sim\theta^{-\frac{1}{2}}. This means that we can apply approximately 1θε\frac{1}{\sqrt{\theta}\varepsilon}-rounds of amplitude amplification to obtain an ε\varepsilon-precise estimate of F(ρθ,σ)F(\rho_{\theta},\sigma) with high probability.

In order to implement a block-encoding of ρ12σVU\rho^{-\frac{1}{2}}\sqrt{\sigma}VU^{\dagger} we implement each of ρ12\rho^{-\frac{1}{2}}, σ\sqrt{\sigma}, and VUVU^{\dagger} as individual block-encodings and simply take the products of the block-encodings, which is a native quantum operation [GSLW19]. Here, a key observation is that the purified access model implies that we also have a unitary block-encoding of ρ\rho and σ\sigma [GSLW19], so we can obtain block-encodings of ρ12\rho^{-\frac{1}{2}} and σ\sqrt{\sigma} by applying the QSVT on the block-encodings of ρ\rho and σ\sigma. We can obtain an approximate implementation of VUVU^{\dagger} by implementing an (approximate) block-encoding of σρ\sqrt{\sigma}\sqrt{\rho} then applying “singular vector transformation” [GSLW19]. Again in order to implement a block-encoding of σρ\sqrt{\sigma}\sqrt{\rho} we can simply implement block-encodings of both σ\sqrt{\sigma} and ρ\sqrt{\rho} via the QSVT. On a high level, the above describes the essence of our block-encoding-based algorithm. Since the QSVT only allows for polynomial transformations, we need to give appropriate polynomial approximations of x±12x^{\pm\frac{1}{2}} – the details of the approximation error and complexity analysis can be found in Section 3.

In case we only have access to samples of ρ\rho and σ\sigma, we can still use density matrix exponentiation [LMR14, KLL+17] in combination with the QSVT to implement approximate block-encodings of ρ\rho and σ\sigma, and use essentially the same strategy as described above. However, in order to maintain the required accuracy throughout the circuit our algorithm requires the use of a large number of samples.

Fidelity estimation via quantum spectral sampling.

Our second approximation algorithm for fidelity estimation exploits the fact that it is possible to “sample” from the spectrum of density operators. The main idea is the following. Suppose we wish to estimate the fidelity F(ρ,σ)F(\rho,\sigma), for density matrices ρ,σd×d\rho,\sigma\in\mathbb{C}^{d\times d}. Let r=rk(ρ)r=\mathrm{rk}\left(\rho\right) be the rank of ρ\rho, and let spec(ρ)=(λ1,,λr)\operatorname{spec}(\rho)=(\lambda_{1},\dots,\lambda_{r}) be the spectrum of ρ\rho (with multiplicity). Expanding σ\sigma in the eigenbasis of ρ=i=1rλi|ψiψi|\rho=\sum_{i=1}^{r}\lambda_{i}\lvert\psi_{i}\rangle\langle\psi_{i}\rvert, we find that

F(ρ,σ)=Tr[ρσρ]=Tr[i,j[r]λiλjψi|σ|ψj|ψiψj|].\displaystyle F(\rho,\sigma)=\mbox{Tr}{\left[\sqrt{\sqrt{\rho}\sigma\sqrt{\rho}}\right]}=\mbox{Tr}{\left[\sqrt{\sum_{i,j\in[r]}\sqrt{\lambda_{i}}\sqrt{\lambda_{j}}\langle\psi_{i}\rvert\sigma\lvert\psi_{j}\rangle\,\,\lvert\psi_{i}\rangle\langle\psi_{j}\rvert}\right]}. (3)

In other words, we can write the fidelity between ρ\rho and σ\sigma as the quantity F(ρ,σ)=Tr[Λ]F(\rho,\sigma)=\mbox{Tr}{[\sqrt{\Lambda}]}, where Λ(ρ,σ)=ρσρd×d\Lambda(\rho,\sigma)=\sqrt{\rho}\sigma\sqrt{\rho}\in\mathbb{C}^{d\times d} has the following non-trivial entries in the eigenbasis of ρ\rho:

Λij=λiλjψi|σ|ψj,i,j{1,,r}.\displaystyle\Lambda_{ij}=\sqrt{\lambda_{i}}\sqrt{\lambda_{j}}\langle\psi_{i}\rvert\sigma\lvert\psi_{j}\rangle,\quad\quad\forall i,j\in\{1,\dots,r\}.

Hence, it suffices to directly compute the matrix elements of Λ\Lambda in order to estimate the fidelity F(ρ,σ)F(\rho,\sigma). Let us first consider the case of exact fidelity estimation in order to illustrate how our spectral sampling algorithm works. We remark that our spectral sampling algorithm can handle the case when ρ\rho is approximately low-rank using a soft-thresholding approach similar to our block-encoding algorithm.

To estimate the eigenvalues of ρ\rho, we use the idea of quantum spectral sampling first introduced by Lloyd, Mohseni and Rebentrost [LMR14] in the context of quantum principal component analysis, and later extended by Prakash [Pra14]. This subroutine allows us to approximately perform quantum phase estimation on ρ\rho with respect to a unitary e2πiρe^{-2\pi i\rho}, resulting in the operation

ρ=i=1rλi|ψiψi|i=1rλi|ψiψi||λ~iλ~i|.\displaystyle\rho=\sum_{i=1}^{r}\lambda_{i}\lvert\psi_{i}\rangle\langle\psi_{i}\rvert\quad\mapsto\quad\sum_{i=1}^{r}\lambda_{i}\,\lvert\psi_{i}\rangle\langle\psi_{i}\rvert\otimes\lvert\tilde{\lambda}_{i}\rangle\langle\tilde{\lambda}_{i}\rvert. (4)

By repeatedly performing the operation in (4), we can sample random pairs of eigenstates and eigenvalues (|ψj,λ~j)(\lvert\psi_{j}\rangle,\tilde{\lambda}_{j}), where λ~jλj\tilde{\lambda}_{j}\approx\lambda_{j}. In order to obtain a full collection of all eigenvalues of spec(λ)\operatorname{spec}(\lambda), we have to repeat this procedure multiple times, which raises the question: How many repetitions of the quantum spectral sampling procedure are necessary to find a full collection of rr distinct eigenvalues? To distinguish between the different eigenvalues, we must assume that ρ\rho has a non-degenerate spectrum spec(ρ)=(λ1,,λr)\operatorname{spec}(\rho)=(\lambda_{1},\dots,\lambda_{r}), where each eigenvalue is separated by a gap Δ>0\Delta>0 with

Δ=mini[r1]|λi+1λi|.\displaystyle\Delta=\min_{i\in[r-1]}\big{|}\lambda_{i+1}-\lambda_{i}\big{|}. (5)

In Section 4.6, we give concrete upper bounds on the number of repetitions needed to complete a full collection. In particular, we analyze the non-uniform coupon collector problem which asks how many draws are needed to collect all rr eigenvalues, where the ii-th eigenvalue is drawn with probability λi(0,1]\lambda_{i}\in(0,1]. Denoting by Tspec(ρ)T_{\operatorname{spec}(\rho)} the random variable for the number of draws needed to complete the collection, we have by an identity due to Flajolet et al. [FGT92],

𝔼[Tspec(ρ)]=0(1i=1r(1eλit))dt.\displaystyle\mathbb{E}[T_{\operatorname{spec}(\rho)}]=\int_{0}^{\infty}\Big{(}1-\prod_{i=1}^{r}(1-e^{-\lambda_{i}t})\Big{)}\,\mathrm{d}t. (6)

Our first result is a non-trivial upper bound on the average number of draws in the non-uniform coupon collector problem. In Lemma 36, we show that

𝔼[Tspec(ρ)]rH(spec(ρ))1,\displaystyle\mathbb{E}[T_{\operatorname{spec}(\rho)}]\,\leq\,r\cdot H(\operatorname{spec}(\rho))^{-1}, (7)

where H(x)=r/i=1rxi1H(x)=r/\sum_{i=1}^{r}x_{i}^{-1} is the harmonic mean of x=(x1,,xr)x=(x_{1},\dots,x_{r}). This allows us to directly relate the average number of draws necessary to complete the collection to spectral properties of ρ\rho. Unfortunately, our initial bound in (7) is not tight. In particular, for the uniform spectrum (1r,,1r)(\frac{1}{r},\dots,\frac{1}{r}), our bound tells us that 𝔼[T(1r,,1r)]r2\mathbb{E}[T_{(\frac{1}{r},\dots,\frac{1}{r})}]\leq r^{2}, whereas a well known result on the (standard) uniform coupon collector problem states that the average number of draws is in the order of Θ(rlogr)\Theta(r\log r).

In order to further improve on the bound in (7), we use a coupling argument which allows us to relate instances of the non-uniform coupon collector problem to worst-case instances of the uniform coupon collector problem. For example, we show in Lemma 38 that, if κ(0,1)\kappa\in(0,1) is a lower bound on the smallest eigenvalue of ρ\rho, then it holds that

𝔼[Tspec(ρ)]𝔼[T(1m,,1m)]=Θ(log(1/κ)/κ),\mathbb{E}[T_{\operatorname{spec}(\rho)}]\,\leq\,\mathbb{E}[T_{(\frac{1}{m},\dots,\frac{1}{m})}]=\Theta\left(\log(1/\kappa)/\kappa\right),

where we choose m=12κm=\lceil\frac{1}{2\kappa}\rceil. In Corollary 39, we generalize the former by introducing a threshold parameter θ(0,1)\theta\in(0,1) and only considering eigenvalues of ρ\rho which lie above θ\theta. This allows us to obtain upper bounds that asymptotically match the bounds for the uniform coupon collector problem.

Going back to fidelity estimation, let us now describe how we can approximate ψi|σ|ψj\langle\psi_{i}\rvert\sigma\lvert\psi_{j}\rangle, which is an additional quantity required to estimate the matrix elements Λij\Lambda_{ij}, for all i,j[r]i,j\in[r]. Our first observation is that the diagonal entries of Λ\Lambda can easily be estimated via the Swap Test introduced by Buhrmann et al. [BCWdW01]. In particular, once we have obtained a complete collection of pairs of eigenstates and eigenvalues (|ψi,λ~i)(\lvert\psi_{i}\rangle,\tilde{\lambda}_{i}), we can use the Swap Test on input |ψiψi||\psi_{i}\rangle\!\langle\psi_{i}| and σ\sigma to estimate ψi|σ|ψi\langle\psi_{i}\rvert\sigma\lvert\psi_{i}\rangle up to inverse-polynomial (in logd\log d) additive error. Unfortunately, estimating the off-diagonal entries of the matrix Λ\Lambda is a lot more involved, since σij=ψi|σ|ψj\sigma_{ij}=\langle\psi_{i}\rvert\sigma\lvert\psi_{j}\rangle is, in general, a complex number which contains both a real and an imaginary part.

One possible solution for estimating σij\sigma_{ij} is to use density matrix exponentiation introduced by Lloyd, Mohseni and Rebentrost [LMR14] which allows us to approximately implement a unitary eiσte^{-i\sigma t}, for small t(0,1)t\in(0,1). Let j[r]j\in[r] be an index. A second-order Taylor expansion of eiσte^{-i\sigma t} reveals that

eiσt|ψj=|ψjitσ|ψj+O(t2).\displaystyle e^{-i\sigma t}\lvert\psi_{j}\rangle=\lvert\psi_{j}\rangle-it\,\sigma\lvert\psi_{j}\rangle+O(t^{2}). (8)

Therefore, for any index i[r]i\in[r], we obtain the following identity,

ψi|eiσt|ψj=ψi|ψjitψi|σ|ψj+O(t2).\displaystyle\langle\psi_{i}\rvert e^{-i\sigma t}\lvert\psi_{j}\rangle=\langle\psi_{i}|\psi_{j}\rangle-it\,\langle\psi_{i}\rvert\sigma\lvert\psi_{j}\rangle+O(t^{2}). (9)

Re-arranging the quantity in (9), we find that

ψi|σ|ψj=it(ψi|ψjψi|eiσt|ψj)+O(t),\displaystyle\langle\psi_{i}\rvert\sigma\lvert\psi_{j}\rangle=\frac{-i}{t}\cdot(\langle\psi_{i}|\psi_{j}\rangle-\langle\psi_{i}\rvert e^{-i\sigma t}\lvert\psi_{j}\rangle)+O(t), (10)

which yields an approximate formula for σij=ψi|σ|ψj\sigma_{ij}=\langle\psi_{i}\rvert\sigma\lvert\psi_{j}\rangle (up to first order in tt). Notice that the right-hand side of Eq. (10) consists of simple overlaps between pure states. Unfortunately, we cannot apply the Swap Test to estimate the above quantities, since we are dealing with complex-valued inner products. Hence, we must rely on the so-called Hadamard Test due to Aharanov, Jones and Landau [AJL06], which allows one to estimate the real and imaginary parts of ψ|U|ψ\langle\psi\rvert U\lvert\psi\rangle, for a state |ψ\lvert\psi\rangle and unitary UU. However, in order to estimate the required quantities in Eq. (10), we have to make use of an additional technique. Namely, we use quantum eigenstate filtering due to Lin and Tong [LT20] in order to approximately obtain circuits UiU_{i} (and UiU_{i}^{\dagger}) that prepare (and uncompute) eigenstates |ψi\lvert\psi_{i}\rangle of the state ρ\rho via purified access to UρU_{\rho}, for every index i[r]i\in[r]. This allows us to estimate ψi|σ|ψj\langle\psi_{i}\rvert\sigma\lvert\psi_{j}\rangle by instead approximating the following simple quantities up to inverse-polynomial (in logd\log d) precision via the Hadamard Test:

ψi|ψj\displaystyle\langle\psi_{i}|\psi_{j}\rangle =Reψi|UjUi|ψi+Imψi|UjUi|ψi\displaystyle=\mathrm{Re}{\langle\psi_{i}\rvert U_{j}U_{i}^{\dagger}\lvert\psi_{i}\rangle}+\mathrm{Im}{\langle\psi_{i}\rvert U_{j}U_{i}^{\dagger}\lvert\psi_{i}\rangle}\vspace{4mm}
ψi|eiσt|ψj\displaystyle\langle\psi_{i}\rvert e^{-i\sigma t}\lvert\psi_{j}\rangle =Reψi|eiσtUjUi|ψi+Imψi|eiσtUjUi|ψi.\displaystyle=\mathrm{Re}{\langle\psi_{i}\rvert e^{-i\sigma t}U_{j}U_{i}^{\dagger}\lvert\psi_{i}\rangle}+\mathrm{Im}{\langle\psi_{i}\rvert e^{-i\sigma t}U_{j}U_{i}^{\dagger}\lvert\psi_{i}\rangle}.

Another possible – and much more efficient – solution for estimating the quantity σij=ψi|σ|ψj\sigma_{ij}=\langle\psi_{i}\rvert\sigma\lvert\psi_{j}\rangle is the following. Rather than using density matrix exponentiation, our spectral sampling algorithm implements a block-encoding of σ\sigma which we can easily construct via purified access to the state σ\sigma. Letting UU denote the associated block-encoding unitary, we perform a Hadamard test with respect to |00|\lvert 0\rangle\langle 0\rvert and UjUUiU_{j}^{\dagger}UU_{i} to directly estimate the real and imaginary parts of

tr[|00|UiUUj]=ψi|σ|ψj=σij,i,j[r].\mathrm{tr}[\lvert 0\rangle\langle 0\rvert U_{i}^{\dagger}UU_{j}]=\langle\psi_{i}\rvert\sigma\lvert\psi_{j}\rangle=\sigma_{ij},\quad\forall i,j\in[r].

Therefore, we can estimate the matrix entries Λij=λiλjψi|σ|ψj\Lambda_{ij}=\sqrt{\lambda_{i}}\sqrt{\lambda_{j}}\langle\psi_{i}\rvert\sigma\lvert\psi_{j}\rangle, for every pair of indices i,j[r]i,j\in[r]. Denoting our estimate by Λ^\hat{\Lambda}, we can then obtain an approximate fidelity estimate by computing F^(ρ,σ)=Tr[Λ^+]\hat{F}(\rho,\sigma)=\mbox{Tr}{[\sqrt{\hat{\Lambda}_{+}}}], where Λ^+\hat{\Lambda}_{+} is the projection of Λ^\hat{\Lambda} onto the positive semidefinite cone. We show in in Theorem 40 that our spectral sampling algorithm obtains an ε\varepsilon-estimate F(ρθ,σ)F(\rho_{\theta},\sigma) with high probability, where ρθ\rho_{\theta} is a “soft-thresholded” version of ρ\rho with θ(0,1)\theta\in(0,1), in time

O~(Tρ+Tσθ10.5ε4Δ+Tρθ3min{θ3ε,Δ}3).\tilde{O}\left(\frac{T_{\rho}+T_{\sigma}}{\theta^{10.5}\varepsilon^{4}\Delta}+\frac{T_{\rho}}{\theta^{3}\min\{\theta^{3}\varepsilon,\Delta\}^{3}}\right).

Finally, if we know that the rank of ρ\rho is at most rk(ρ)r\mathrm{rk}\left(\rho\right)\leq r, then choosing θ=Θ(ε2r)\theta=\Theta(\frac{\varepsilon^{2}}{r}) we obtain an ε\varepsilon-precise estimate of F(ρ,σ)F(\rho,\sigma) with high probability in time

O~(r10.5(Tρ+Tσ)ε25Δ+r3Tρmin{ε7r3,Δ}3).\tilde{O}\left(\frac{r^{10.5}(T_{\rho}+T_{\sigma}\big{)}}{\varepsilon^{25}\Delta}+\frac{r^{3}T_{\rho}}{\min\{\frac{\varepsilon^{7}}{r^{3}},\Delta\}^{3}}\right).

While our spectral-sampling based algorithm for fidelity estimation performs significantly worse than our block-encoding algorithm, it may be easier to implement in certain settings; for example, when it is easy to obtain circuits that prepare the eigenstates of one of the density operators.

1.3 𝖰𝖲𝖹𝖪𝖧𝖵\mathsf{QSZK_{HV}}-hardness of fidelity estimation to any non-trivial accuracy

Now we show that fidelity estimation to any non-trivial fixed precision is 𝖰𝖲𝖹𝖪𝖧𝖵\mathsf{QSZK_{HV}}-hard. This provides evidence for the intractability of the problem in general without further assumptions on the states.

Theorem 1 (𝖰𝖲𝖹𝖪𝖧𝖵\mathsf{QSZK_{HV}}-hardness of non-trivial fidelity estimation).

Consider the following problem: one is given (the description) of two quantum circuits U,VU,V preparing purifications of quantum states ρ\rho and σ\sigma respectively, and the task is to output a number F^(ρ,σ)\hat{F}(\rho,\sigma) such that |F^(ρ,σ)F(ρ,σ)|12δ|\hat{F}(\rho,\sigma)-F(\rho,\sigma)|\leq\frac{1}{2}-\delta. This problem is 𝖰𝖲𝖹𝖪𝖧𝖵\mathsf{QSZK_{HV}}-hard for every δ(0,12]\delta\in(0,\frac{1}{2}].

Proof.

By the Fuchs–van de Graaf inequalities, we have

1F(ρ,σ)12ρσ11F(ρ,σ)2.1-F(\rho,\sigma)\leq\frac{1}{2}\left\lVert\rho-\sigma\right\rVert_{1}\leq\sqrt{1-F(\rho,\sigma)^{2}}. (11)

Suppose we are given quantum circuits preparing purifications of ρ\rho and σ\sigma and we are promised that either 12ρσ1ε\frac{1}{2}\left\lVert\rho-\sigma\right\rVert_{1}\leq\varepsilon or 12ρσ11ε\frac{1}{2}\left\lVert\rho-\sigma\right\rVert_{1}\geq 1-\varepsilon for some constant ε(0,18]\varepsilon\in(0,\frac{1}{8}]. Watrous proved that this problem is 𝖰𝖲𝖹𝖪𝖧𝖵\mathsf{QSZK_{HV}}-complete [Wat02]. By Equation 11 12ρσ1ε\frac{1}{2}\left\lVert\rho-\sigma\right\rVert_{1}\leq\varepsilon implies 1εF(ρ,σ)1-\varepsilon\leq F(\rho,\sigma), and 1ε12ρσ11-\varepsilon\leq\frac{1}{2}\left\lVert\rho-\sigma\right\rVert_{1} implies F(ρ,σ)2εF(\rho,\sigma)\leq\sqrt{2\varepsilon}. In particular estimating the fidelity F(ρ,σ)F(\rho,\sigma) to precision 122ε\frac{1}{2}-\sqrt{2\varepsilon} solves the distinguishing problem. Substituting δ:=2ε\delta:=\sqrt{2\varepsilon} this implies that for every δ(0,12]\delta\in(0,\frac{1}{2}] fidelity estimation to precision 12δ\frac{1}{2}-\delta is 𝖰𝖲𝖹𝖪𝖧𝖵\mathsf{QSZK_{HV}}-hard. Since estimating the fidelity to precision 12\frac{1}{2} is trivial (taking estimate 12\frac{1}{2}), this means that fidelity estimation to any fixed non-trivial accuracy is 𝖰𝖲𝖹𝖪𝖧𝖵\mathsf{QSZK_{HV}}-hard in general. ∎

1.4 A sample complexity lower bound for constant precision fidelity estimation

Now we prove that any non-trivial fidelity estimation algorithm must use at least a polynomially large number of copies even if one of the states is known in advance.

As Bădescu, O’Donnell, and Wright [BOW19] pointed out testing closeness with respect to fidelity requires a number of copies of the states proportional to the dimension of the states even if one of the states is a fixed known state, namely the completely mixed state. Their observation follows from a reduction to the earlier results of O’Donnell, and Wright [OW15].

Corollary 2.

Let δ(0,1/7]\delta\in(0,1/7], and consider the following problem: Given a known quantum state σ\sigma of rank rr and copies of a state ρ\rho with the promise that rk(ρ)r\mathrm{rk}\left(\rho\right)\leq r, then computing an estimate F^(ρ,σ)\hat{F}(\rho,\sigma) such that |F^(ρ,σ)F(ρ,σ)|δ|\hat{F}(\rho,\sigma)-F(\rho,\sigma)|\leq\delta requires using Ω(r/δ)\Omega(r/\delta) copies in general.

Proof.

We proceed by a reduction to [BOW19, Theorem 1.7], which considers σ\sigma to be the completely mixed state in dimension rr and ρ\rho to be an arbitrary state having half of its eigenvalues 1εr\frac{1-\varepsilon}{r} and the other half 1εr\frac{1-\varepsilon}{r}. As [BOW19] notes it follows from the results of [OW15] that distinguishing σ\sigma from such states ρ\rho requires using Ω(rε2)\Omega(\frac{r}{\varepsilon^{2}}) samples for every ε[0,1]\varepsilon\in[0,1]. Although they state the result in term of the dimensionality of the Hilbert space, adding extra dimension to the Hilbert space will not reduce the sample complexity, so this result can also be stated in terms of rank.

On the other hand a δ:=F(σ,σ)F(ρ,σ)2=1F(ρ,σ)2\delta:=\frac{F(\sigma,\sigma)-F(\rho,\sigma)}{2}=\frac{1-F(\rho,\sigma)}{2}-precise fidelity estimation algorithm can in particular distinguish σ\sigma and ρ\rho, and thereby any such algorithm must use at least Ω(rε2)=Ω(rδ)\Omega(\frac{r}{\varepsilon^{2}})=\Omega(\frac{r}{\delta}) samples, since F(ρ,σ)=12(1+ε+1ε)1ε28F(\rho,\sigma)=\frac{1}{2}(\sqrt{1+\varepsilon}+\sqrt{1-\varepsilon})\leq 1-\frac{\varepsilon^{2}}{8} for every ε[0,1]δε216\varepsilon\in[0,1]\Rightarrow\delta\geq\frac{\varepsilon^{2}}{16}.444The Taylor series of f(x):=1+xf(x):=\sqrt{1+x} is 1+x2x28+x316𝒪(x4)1+\frac{x}{2}-\frac{x^{2}}{8}+\frac{x^{3}}{16}-\mathcal{O}\left(x^{4}\right). By Lagrange’s remainder theorem we get that for every x(1,1)x\in(-1,1) we have f(x)=1+x2x28+x316+f(4)(η)4!η4f(x)=1+\frac{x}{2}-\frac{x^{2}}{8}+\frac{x^{3}}{16}+\frac{f^{(4)}(\eta)}{4!}\eta^{4} for some η[|x|,|x|]\eta\in[-|x|,|x|]. Since the fourth derivative of f(x)=1+xf(x)=\sqrt{1+x} is f(4)(x)=1516(x+1)7/2f^{(4)}(x)=\frac{15}{16(x+1)^{7/2}} which is non-negative on (1,1)(-1,1) we get the inequality 1+x1+x2x28+x316\sqrt{1+x}\leq 1+\frac{x}{2}-\frac{x^{2}}{8}+\frac{x^{3}}{16} for every x[1,1]x\in[-1,1].

Proposition 3.

Let δ(0,12)\delta\in(0,\frac{1}{2}), and consider the following problem: Given a known quantum state σ\sigma of rank rr and copies of a state ρ\rho with the promise that rk(ρ)r\mathrm{rk}\left(\rho\right)\leq r, then computing an estimate F^(ρ,σ)\hat{F}(\rho,\sigma) such that |F^(ρ,σ)F(ρ,σ)|<12δ|\hat{F}(\rho,\sigma)-F(\rho,\sigma)|<\frac{1}{2}-\delta requires using Ω(δr)\Omega(\delta\sqrt{r}) copies in general.

Proof.

Consider σ\sigma to be the uniform distribution over [r][r], and the set of states ρ\rho that are uniform over a δ2r\delta^{2}r-sized subset of [r][r]. Then F(σ,ρ)=δF(\sigma,\rho)=\delta. Suppose we either get copies from σ\sigma or a uniformly random ρ\rho. Until an element is repeated all that we see are distinct uniformly random elements of [0,r][0,r] and in order to find a repetition with non-negligible probability we need to obtain at least Ω(δr)\Omega(\delta r) samples. On the other hand estimating fidelity to precision better than 12δ2\frac{1}{2}-\frac{\delta}{2} can distinguish the two cases. ∎

We think that the above bound can be improved to Ω(r)\Omega(r) using the techniques of [OW15], when one considers the set of states ρ\rho that are uniform over a δ2r\delta^{2}r-dimensional subspace of the support of σ\sigma, however this result does not seem to directly follow from the results of [OW15].

2 Preliminaries

For a matrix Am×nA\in\mathbb{C}^{m\times n} and p[1,]p\in[1,\infty], we denote by Ap\left\lVert A\right\rVert_{p} the Schatten pp-norm, which is the p\ell^{p}-norm of the singular values (iςip(A))1/p(\sum_{i}\varsigma_{i}^{p}(A))^{1/p}. In particular, we use the notation A=A\|A\|=\|A\|_{\infty}. We recall some useful inequalities [Bha97, Section IV.2]. Hölder’s inequality states that for all Bn×kB\in\mathbb{C}^{n\times k} and r,p,q[1,]r,p,q\in[1,\infty] such that 1p+1q=1r\frac{1}{p}+\frac{1}{q}=\frac{1}{r}, we have ABrApBq\left\lVert AB\right\rVert_{r}\leq\left\lVert A\right\rVert_{p}\left\lVert B\right\rVert_{q}.555Note that the expression (iςip(A))1/p(\sum_{i}\varsigma_{i}^{p}(A))^{1/p} makes sense for every p>0p>0, but will not give a norm for p(0,1)p\in(0,1) (due to violating the triangle inequality). Nevertheless, Hölder’s inequality holds for these quantities as well, which can be formulated as follows [Bha97, Exercise IV.2.7]: |AB|r11r|A|p11p|B|q11q\left\lVert|AB|^{r}\right\rVert_{1}^{\frac{1}{r}}\leq\left\lVert|A|^{p}\right\rVert_{1}^{\frac{1}{p}}\left\lVert|B|^{q}\right\rVert_{1}^{\frac{1}{q}} for all r,p,q(0,]r,p,q\in(0,\infty] such that 1p+1q=1r\frac{1}{p}+\frac{1}{q}=\frac{1}{r}, where |X|=XX|X|=\sqrt{X^{\dagger}X}. The trace-norm inequality states that if n=mn=m, then |Tr(A)|A1|\mbox{Tr}(A)|\leq\left\lVert A\right\rVert_{1}. For a hermitian matrix An×nA\in\mathbb{C}^{n\times n} with spectral decomposition A=UDUA=UDU^{\dagger} and D=diag(λ1,,λn)D=\mathrm{diag}(\lambda_{1},\dots,\lambda_{n}), we denote by A+=UD+UA_{+}=UD_{+}U^{\dagger} and A=UDUA_{-}=UD_{-}U^{\dagger} the projections onto the positive semidefinite and negative semidefinite cone, respectively, where we let D+=diag(max{0,λ1},,max{0,λn})D_{+}=\mathrm{diag}(\max\{0,\lambda_{1}\},\dots,\max\{0,\lambda_{n}\}) and D=diag(min{0,λ1},,min{0,λn})D_{-}=\mathrm{diag}(\min\{0,\lambda_{1}\},\dots,\min\{0,\lambda_{n}\}). For an integer mm\in\mathbb{N}, we denote by HmH_{m} the mm-th harmonic number given by Hm=1+12+13++1mH_{m}=1+\frac{1}{2}+\frac{1}{3}+\dots+\frac{1}{m}.

For a function f:f\colon\mathbb{R}\mapsto\mathbb{C} and set SS\subseteq\mathbb{R} we use the notation fS:=supxS|f(x)|\left\lVert f\right\rVert_{S}:=\sup_{x\in S}|f(x)|.

Definition 4 (Purified access).

Let ρd×d\rho\in\mathbb{C}^{d\times d} be a density operator. We say that we have purified access to the state ρ\rho if we have access to a unitary UρU_{\rho} (and its inverse) acting as follows:

Uρ|0A|0B=|ψρAB=i=1dλi|ϕiA|ψiB,U_{\rho}\lvert 0\rangle_{A}\lvert 0\rangle_{B}=\lvert\psi_{\rho}\rangle_{AB}=\sum_{i=1}^{d}\lambda_{i}\lvert\phi_{i}\rangle_{A}\lvert\psi_{i}\rangle_{B},

where TrA[|ψρψρ|AB]=ρ\mbox{Tr}_{A}\left[\lvert\psi_{\rho}\rangle\langle\psi_{\rho}\rvert_{AB}\right]=\rho, and where it holds that ϕi|ϕj=ψi|ψj=δij\langle\phi_{i}|\phi_{j}\rangle=\langle\psi_{i}|\psi_{j}\rangle=\delta_{ij}, for all i,j[d]i,j\in[d]. In this context, we denote by TρT_{\rho} the time it takes to implement the unitary UρU_{\rho}.

We use the following result which is a slight adaptation of [HJ90, Fact 7.4.9.2].

Lemma 5 (Projection onto the positive semidefinite cone).

Let An×nA\in\mathbb{C}^{n\times n} be a hermitian matrix with spectral decomposition A=UDUA=UDU^{\dagger}, where D=diag(λ1,,λn)D=\mathrm{diag}(\lambda_{1},\dots,\lambda_{n}), and let A+=UD+UA_{+}=UD_{+}U^{\dagger} be the projection onto the positive semidefinite cone with spectrum D+=diag(max{0,λ1},,max{0,λn})D_{+}=\mathrm{diag}(\max\{0,\lambda_{1}\},\dots,\max\{0,\lambda_{n}\}). Let ||||||{\left|\kern-1.07639pt\left|\kern-1.07639pt\left|\cdot\right|\kern-1.07639pt\right|\kern-1.07639pt\right|} be any unitarily invariant norm over n×n\mathbb{C}^{n\times n}. Then, it holds that

A+=argminX0|AX|.A_{+}=\underset{X\succeq 0}{\mathrm{argmin}}{\left|\kern-1.07639pt\left|\kern-1.07639pt\left|A-X\right|\kern-1.07639pt\right|\kern-1.07639pt\right|}.

In other words, A+A_{+} is the closest positive semidefinite matrix to AA with respect to the norm ||||||{\left|\kern-1.07639pt\left|\kern-1.07639pt\left|\cdot\right|\kern-1.07639pt\right|\kern-1.07639pt\right|}.

2.1 Matrix Arithmetics using blocks of unitaries

In this section we recall some basic results from the generic matrix arithmetic toolbox described in [GSLW18], which is a distilled version of the results of a series of works on quantum algorithms [HHL09, BCC+15, CKS17, LC19, vAGGdW20, CGJ19].

First we introduce the definition of block-encoding which the main idea of which is to represents a subnormalized matrix as the upper-left block of a unitary.

U=[A/α...]A=α(0|I)U(|0I)U=\left[\begin{array}[]{cc}A/\alpha&.\\ .&.\end{array}\right]\kern 28.45274pt\Longrightarrow\kern 28.45274ptA=\alpha(\langle 0\rvert\otimes I)U(\lvert 0\rangle\otimes I)
Definition 6 (Block-encoding).

Suppose that AA is an ss-qubit operator, α,ε+\alpha,\varepsilon\in\mathbb{R}_{+} and aa\in\mathbb{N}, then we say that the (s+a)(s+a)-qubit unitary UU is an (α,a,ε)(\alpha,a,\varepsilon)-block-encoding of AA, if

Aα(0|aI)U(|0aI)ε.\left\lVert A-\alpha(\langle 0\rvert^{\otimes a}\otimes I)U(\lvert 0\rangle^{\otimes a}\otimes I)\right\rVert\leq\varepsilon.

In case α=1\alpha=1 and ε=0\varepsilon=0 we simply call an (α,a,ε)(\alpha,a,\varepsilon)-block-encoding a block-encoding (with aa ancillas).

There are several ways to construct block-encodings, for a summary of the techniques we refer to [GSLW19]. For our work the most important is the following result due to Low and Chuang [LC19]:

Lemma 7 (Block-encoding of density operators with purified access [GSLW18, Lemma 45]).

Suppose that ρ\rho is an ss-qubit density operator and GG is an (a+s)(a+s)-qubit unitary that on the |0|0\lvert 0\rangle\lvert 0\rangle input state prepares a purification |0|0|ρ\lvert 0\rangle\lvert 0\rangle\rightarrow\lvert\rho\rangle, s.t. Tra|ρρ|=ρ\mathrm{Tr}_{a}{|\rho\rangle\!\langle\rho|}=\rho. Then (GIs)(IaSWAPs)(GIs)(G^{\dagger}\otimes I_{s})(I_{a}\otimes\mathrm{SWAP}_{s})(G\otimes I_{s}) is a (1,a+s,0)(1,a+s,0)-block-encoding of ρ\rho.

Block-encodings are convenient to work with, in particular one can efficiently construct linear combinations of block-encodings via the the so-called linear combination of unitaries technique. Moreover, one can also easily form products of block-encodings as follows:

Lemma 8 (Product of block-encoded matrices [GSLW18, Lemma 53]).

If UU is an (α,a,δ)(\alpha,a,\delta)-block-encoding of an ss-qubit operator AA, and VV is an (β,b,ε)(\beta,b,\varepsilon)-block-encoding of an ss-qubit operator BB then666The identity operators act on each others ancilla qubits, which is hard to express properly using simple tensor notation, but the reader should read this tensor product this way. (IbU)(IaV)(I_{b}\otimes U)(I_{a}\otimes V) is an (αβ,a+b,αε+βδ)(\alpha\beta,a+b,\alpha\varepsilon+\beta\delta)-block-encoding of ABAB.

2.2 The Swap Test

Let us now recall the Swap Test introduced by Buhrmann et al. [BCWdW01]. We remark that detailed circuits for the general case can also be found in the work of Cincio et al. [CSSC18]. Given as input identical copies of density operators |ψψ|\lvert\psi\rangle\langle\psi\rvert and σ\sigma, we can repeat the following quantum circuit

\Qcircuit@C=2.47mm@R=1.32mm\lstick|0&\gateH\ctrl1\gateH\measureD0/1\lstick|ψ\qw\multigate1𝖲𝖶𝖠𝖯\qw\qw\lstickσ\qw\ghost𝖲𝖶𝖠𝖯\qw\qw\Qcircuit@C=2.47mm@R=1.32mm{\lstick{\lvert 0\rangle}&\gate{H}\ctrl{1}\gate{H}\measureD{0/1}\\ \lstick{\lvert\psi\rangle}\qw\multigate{1}{\mathsf{SWAP}}\qw\qw\\ \lstick{\sigma}\qw\ghost{\mathsf{SWAP}}\qw\qw}

log(2ν)/η2\log\big{(}\frac{2}{\nu}\big{)}/{\eta^{2}} many times with parameters η(0,1)\eta\in(0,1) and ν(0,1)\nu\in(0,1) to obtain an additive η\eta-approximation to the quantity ψ|σ|ψ\langle\psi\rvert\sigma\lvert\psi\rangle with probability at least 1ν1-\nu.

2.3 The Hadamard test and block-measurements

In this section, we recall the Hadamard Test due to Aharanov, Jones and Landau [AJL06]. Given as input identical copies of a state |ψ\lvert\psi\rangle and a unitary UU, we can repeat the following circuit

\Qcircuit@C=2.47mm@R=1.32mm\lstick|0&\gateH\ctrl1\gateH\measureD0/1\lstick|ψ\qw\gateU\qw\qw\Qcircuit@C=2.47mm@R=1.32mm{\lstick{\lvert 0\rangle}&\gate{H}\ctrl{1}\gate{H}\measureD{0/1}\\ \lstick{\lvert\psi\rangle}\qw\gate{U}\qw\qw}

4log(4δ)/ξ24\log\big{(}\frac{4}{\delta}\big{)}/\xi^{2} times with parameters ξ(0,1)\xi\in(0,1) and δ(0,1)\delta\in(0,1) to approximate z=ψ|U|ψz=\langle\psi\rvert U\lvert\psi\rangle as Reψ|U|ψ\mathrm{Re}{\langle\psi\rvert U\lvert\psi\rangle} and Imψ|U|ψ\mathrm{Im}{\langle\psi\rvert U\lvert\psi\rangle}, each within an additive error of ξ/2\xi/\sqrt{2} with probability 1δ/21-\delta/2. Note that, to obtain the imaginary part, we have to replace the final XX basis measurement of the circuit with a YY basis measurement. By the union bound, we obtain an estimate z~\tilde{z} with |z~z|ξ|\tilde{z}-z|\leq\xi with probability 1δ1-\delta.

We now generalize the Hadamard Test to expectation values of block-encoded matrices as follows.

Lemma 9 (Hadamard test for estimating the expectation value of block-encoded matrices).

Suppose that UU is a block-encoding of Ad×dA\in\mathbb{C}^{d\times d}. Then, performing the Hadamard test on a quantum state ρd×d\rho\in\mathbb{C}^{d\times d} with a controlled-UU and a subsequent XX or YY basis measurement yields outcome 0 with probability Re(Tr[ρ(I+A)/2])\mathrm{Re}(\mathrm{Tr}[{\rho(I+A)/2}]) and Im(Tr[ρ(I+A)/2])\mathrm{Im}(\mathrm{Tr}[{\rho(I+A)/2}]), respectively.

Proof.

The probability of getting outcome 0 with respect to an XX basis measurement is

(+|I)(|0|ψ+|1U|ψ)/22=14|ψ+U|ψ2=12+12Re(ψ|U|ψ)=12+12Re(Tr[|ψψ|U]).\left\lVert(\langle+\rvert\otimes I)(\lvert 0\rangle\lvert\psi\rangle+\lvert 1\rangle U\lvert\psi\rangle)/\sqrt{2}\right\rVert^{2}=\frac{1}{4}\left\lVert\lvert\psi\rangle+U\lvert\psi\rangle\right\rVert^{2}=\frac{1}{2}+\frac{1}{2}\mathrm{Re}(\langle\psi|U|\psi\rangle)=\frac{1}{2}+\frac{1}{2}\mathrm{Re}(\mbox{Tr}\left[|\psi\rangle\!\langle\psi|U\right]).

By linearity we see that for a mixed input state ρ\rho the probability of getting outcome 0 is

12+12Re(Tr[ρU])=Re(Tr[ρ(I+U)/2]).\frac{1}{2}+\frac{1}{2}\mathrm{Re}(\mbox{Tr}\left[\rho U\right])=\mathrm{Re}(\mbox{Tr}\left[\rho(I+U)/2\right]).

Now suppose that A=(0|I)U(|0I)A=(\langle 0\rvert\otimes I)U(\lvert 0\rangle\otimes I), and the input state is |00|ρ|0\rangle\!\langle 0|\otimes\rho, then the probability of getting outcome 0 is

Re(Tr[(|00|ρ)(I+U)/2])=Re(Tr[(|00|I)2(|00|ρ)(I+U)/2])=Re(Tr[ρ(I+A)/2]).\mathrm{Re}(\mbox{Tr}\left[(|0\rangle\!\langle 0|\otimes\rho)(I+U)/2\right])=\mathrm{Re}(\mbox{Tr}\left[(|0\rangle\!\langle 0|\!\otimes\!I)^{\!2}(|0\rangle\!\langle 0|\otimes\rho)(I+U)/2\right])=\mathrm{Re}(\mbox{Tr}\left[\rho(I+A)/2\right]).

We remark that the imaginary part can be analogously obtained via a final YY basis measurement. ∎

Let us also describe and alternative method for estimating Tr[ρAA]\mbox{Tr}\left[\rho\cdot A^{\dagger}A\right] using a block-encoding of AA. Suppose that UU is a block-encoding of AA, and we apply UU to a quantum state ρ\rho and then measure the defining auxiliary qubits of the block-encoding. The probability of finding them in the |0¯\lvert\bar{0}\rangle state is

Tr[U(|0~0~|ρ)U(|0¯0¯|I)]=Tr[(0¯|I)U(|0~I)𝐴ρ(0~|I)U(|0¯I)A]=Tr[ρAA].\displaystyle\mbox{Tr}\left[U(|\tilde{0}\rangle\!\langle\tilde{0}|\otimes\rho)U^{\dagger}(|\bar{0}\rangle\!\langle\bar{0}|\otimes I)\right]=\mbox{Tr}\Big{[}\underset{A}{\underbrace{(\langle\bar{0}\rvert\otimes I)U(\lvert\tilde{0}\rangle\otimes I)}}\cdot\rho\cdot\underset{A^{\dagger}}{\underbrace{(\langle\tilde{0}\rvert\otimes I)U^{\dagger}(\lvert\bar{0}\rangle\otimes I)}}\Big{]}=\mbox{Tr}\left[\rho\cdot A^{\dagger}A\right].

Note that AA can be a rectangular matrix, which is the case if 0¯\bar{0} and 0~\tilde{0} have an unequal number of qubits.

2.4 Quantum Singular Value Transformation

Let f:f\colon\mathbb{R}\mapsto\mathbb{C} be an odd function, i.e., f(x)=f(x)f(-x)=-f(x). For a matrix AA with singular value decomposition A=UΣVA=U\Sigma V^{\dagger} let us denote by SV(f)(A)\mathrm{SV}^{(f)}\!(A) the singular value transform of AA defined as SV(f)(A):=Uf(Σ)V\mathrm{SV}^{(f)}\!(A):=Uf(\Sigma)V^{\dagger}. We will heavily use the following fundamental result about quantum implementations of the singular value transform:

Theorem 10 (Quantum Singular Value Transformation [GSLW18, Corollary 18 & Lemma 19]).

If p[x]p\in\mathbb{R}[x] is an odd polynomial such that p(x)[1,1]1\left\lVert p(x)\right\rVert_{[-1,1]}\leq 1 and WW is a block-encoding of AA with aa ancillas, then we can implement a block-encoding of SV(f)(A)\mathrm{SV}^{(f)}\!(A) with (deg(p)+1)/2(\deg(p)+1)/2 uses of UU, (deg(p)1)/2(\deg(p)-1)/2 uses of UU^{\dagger}, and 𝒪(adeg(p))\mathcal{O}\left(a\deg(p)\right) other two-qubit gates.

In case we need to approximate the singular value transform by using an approximate block-encoding we have the following robustness result from [GSLW19]:

Lemma 11 (Robustness of singular value transformation [GSLW18, Lemma 23]).

If p[x]p\in\mathbb{C}[x] is an odd degree-dd polynomial such that p[1,1]1\left\lVert p\right\rVert_{[-1,1]}\leq 1, moreover A,A~n~×nA,\tilde{A}\in\mathbb{C}^{\tilde{n}\times n} are matrices of operator norm at most 11, such that

AA~+A+A~221,\left\lVert A-\tilde{A}\right\rVert+\left\lVert\frac{A+\tilde{A}}{2}\right\rVert^{2}\leq 1, (12)

then we have that

SV(p)(A)SV(p)(A~)d21A+A~22AA~.\left\lVert\mathrm{SV}^{(p)}\!(A)-\mathrm{SV}^{(p)}\!(\tilde{A})\right\rVert\leq d\sqrt{\frac{2}{1-\left\lVert\frac{A+\tilde{A}}{2}\right\rVert^{2}}}\left\lVert A-\tilde{A}\right\rVert.

The above lemma is proven in [GSLW18] by showing that there are block-encodings U,U~4(n~+n)×4(n~+n)U,\tilde{U}\in\mathbb{C}^{4(\tilde{n}+n)\times 4(\tilde{n}+n)} of AA and A~\tilde{A} respectively so that

UU~21A+A~22AA~.\left\lVert U-\tilde{U}\right\rVert\leq\sqrt{\frac{2}{1-\left\lVert\frac{A+\tilde{A}}{2}\right\rVert^{2}}}\left\lVert A-\tilde{A}\right\rVert. (13)

Using singular value decomposition one can show that if U,Wd×dU,W\in\mathbb{C}^{d\times d} are block-encodings of An~×nA\in\mathbb{C}^{\tilde{n}\times n}, then there are unitaries Vdn×dnV\in\mathbb{C}^{d-n\times d-n}, V~dn~×dn~\tilde{V}\in\mathbb{C}^{d-\tilde{n}\times d-\tilde{n}} such that (In~V~)U(InV)=W(I_{\tilde{n}}\oplus\tilde{V})U(I_{n}\oplus V^{\dagger})=W.777In fact this is implicit in the proof of the main results of [GSLW18].

Corollary 12.

For every block-encoding Ud×dU\in\mathbb{C}^{d\times d} of An~×nA\in\mathbb{C}^{\tilde{n}\times n} with d4(n~+n)d\geq 4(\tilde{n}+n) and for any A~n~×n\tilde{A}\in\mathbb{C}^{\tilde{n}\times n} satisfying Equation 12 we have a block-encoding U~d×d\tilde{U}\in\mathbb{C}^{d\times d} of A~\tilde{A} satisfying Equation 13.

Corollary 13 (Error propagation in block-encodings).

Let d4(n~+n)d\geq 4(\tilde{n}+n); let W(U)W(U) be a quantum circuit that uses UU and UU^{\dagger} a total of TT-times. If W(U)W(U) implements a block-encoding of BB for every block-encoding Ud×dU^{d\times d} of An~×nA\in\mathbb{C}^{\tilde{n}\times n}, then W(U~)W(\tilde{U}) implements a block-encoding of B~\tilde{B} such that if U~\tilde{U} is a block-encoding of A~n~×n\tilde{A}\in\mathbb{C}^{\tilde{n}\times n} satisfying Equation 12 then

BB~T21A+A~22AA~.\left\lVert B-\tilde{B}\right\rVert\leq T\sqrt{\frac{2}{1-\left\lVert\frac{A+\tilde{A}}{2}\right\rVert^{2}}}\left\lVert A-\tilde{A}\right\rVert. (14)
Proof.

Take some An~×nA\in\mathbb{C}^{\tilde{n}\times n}, d4(n~+n)d\geq 4(\tilde{n}+n), and a block-encoding U~\tilde{U} of some A~n~×n\tilde{A}\in\mathbb{C}^{\tilde{n}\times n} satisfying Equation 12. By Corollary 12 there exists some UU block-encoding of AA such that Equation 13 holds. Then W(U)W(U) is a block-encoding of BB, and W(U)W(U~)TUU~T21A+A~22AA~\left\lVert W(U)-W(\tilde{U})\right\rVert\leq T\left\lVert U-\tilde{U}\right\rVert\leq T\sqrt{\frac{2}{1-\left\lVert\frac{A+\tilde{A}}{2}\right\rVert^{2}}}\left\lVert A-\tilde{A}\right\rVert, and therefore Equation 14 holds as well. ∎

2.5 Low-degree polynomial approximations

As Theorem 10 suggests in order to optimize our algorithm we will need low-degree polynomial approximations of various functions. We list some polynomial approximation results that we need in our complexity analysis.

Later we will use a low-degree polynomial pp approximating the sign function sgn{1,0,1}\mathrm{sgn}\mapsto\{-1,0,1\}. To construct that we invoke a result of Low and Chuang [LC17, Corollary 6] about constructive polynomial approximations of the sign function – the error of the optimal approximation, studied by Eremenko and Yuditskii [EY07], achieves similar scaling but is non-constructive.

Lemma 14 (Polynomial approximations of the sign function).

For all δ>0\delta>0 , ε(0,1/2)\varepsilon\in(0,1/2) there exists an efficiently computable odd polynomial p[x]p\in\mathbb{R}[x] of degree n=𝒪(log(1/ε)δ)n=\mathcal{O}\left(\frac{\log(1/\varepsilon)}{\delta}\right), such that

  • for all x[2,2]:|p(x)|1x\in[-2,2]\colon|p(x)|\leq 1, and

  • for all x[2,2](δ,δ):|p(x)sgn(x)|εx\in[-2,2]\setminus(-\delta,\delta)\colon|p(x)-\mathrm{sgn}(x)|\leq\varepsilon.

Corollary 15 (Polynomial approximations of rectangle functions [GSLW19, Corollary 16]).

Let δ,ε\delta,\varepsilon (0,12)\in(0,\frac{1}{2}) and t[1,1]t\in[-1,1]. There exists an even polynomial P[x]P^{\prime}\in\mathbb{R}[x] of degree 𝒪(log(1ε)/δ)\mathcal{O}\left(\log(\frac{1}{\varepsilon})/\delta\right), such that |P(x)|1|P^{\prime}(x)|\leq 1 for all x[1,1]x\in[-1,1], and

{P(x)[0,ε]for all x[1,tδ][t+δ,1], andP(x)[1ε,1]for all x[t+δ,tδ].\left\{\begin{array}[]{rcl}P^{\prime}(x)\in&[0,\varepsilon]&\text{for all }x\in[-1,-t-\delta]\cup[t+\delta,1]\text{, and}\\ P^{\prime}(x)\in&[1-\varepsilon,1]&\text{for all }x\in[-t+\delta,t-\delta].\end{array}\right. (15)
Lemma 16 (Polynomial approximations of negative power functions [Gil19, Cor. 3.4.13]).

Let δ,ε(0,12]\delta,\varepsilon\in(0,\frac{1}{2}], c>0c>0 and let f(x):=δc2xcf(x):=\frac{\delta^{c}}{2}x^{-c}, then there exist even/odd polynomials P,P[x]P,P^{\prime}\in\mathbb{R}[x], such that Pf[δ,1]ε\left\lVert P-f\right\rVert_{[\delta,1]}\leq\varepsilon, P[1,1]1\left\lVert P\right\rVert_{[-1,1]}\leq 1 and similarly Pf[δ,1]ε\left\lVert P^{\prime}-f\right\rVert_{[\delta,1]}\leq\varepsilon, P[1,1]1\left\lVert P^{\prime}\right\rVert_{[-1,1]}\leq 1, moreover the degrees of the polynomials are 𝒪(max[1,c]δlog(1ε))\mathcal{O}\left(\frac{\max[1,c]}{\delta}\log\left(\frac{1}{\varepsilon}\right)\right).

Lemma 17 (Polynomial approximations of positive power functions [Gil19, Cor. 3.4.14]).

Let δ,ε(0,12]\delta,\varepsilon\in(0,\frac{1}{2}], c(0,1]c\in(0,1] and let f(x):=12xcf(x):=\frac{1}{2}x^{c}, then there exist even/odd polynomials P,P[x]P,P^{\prime}\in\mathbb{R}[x], such that Pf[δ,1]ε\left\lVert P-f\right\rVert_{[\delta,1]}\leq\varepsilon, P[1,1]1\left\lVert P\right\rVert_{[-1,1]}\leq 1 and similarly Pf[δ,1]ε\left\lVert P^{\prime}-f\right\rVert_{[\delta,1]}\leq\varepsilon, P[1,1]1\left\lVert P^{\prime}\right\rVert_{[-1,1]}\leq 1, moreover the degree of the polynomials are 𝒪(1δlog(1ε))\mathcal{O}\left(\frac{1}{\delta}\log\left(\frac{1}{\varepsilon}\right)\right).

Corollary 18 (Polynomial approximations of positive power functions).

Let δ,ε(0,12]\delta,\varepsilon\in(0,\frac{1}{2}], c(0,1]c\in(0,1] and let f(x):=12xcf(x):=\frac{1}{2}x^{c}, then there exist even/odd polynomials P,P[x]P,P^{\prime}\in\mathbb{R}[x], such that Pf[δ,1]ε\left\lVert P-f\right\rVert_{[\delta,1]}\leq\varepsilon, P[1,1]1\left\lVert P\right\rVert_{[-1,1]}\leq 1, x[1,1]:|P(x)|f(|x|)+ε\forall x\in[-1,1]\colon|P(x)|\leq f(|x|)+\varepsilon, and similarly Pf[δ,1]ε\left\lVert P^{\prime}-f\right\rVert_{[\delta,1]}\leq\varepsilon, P[1,1]1\left\lVert P^{\prime}\right\rVert_{[-1,1]}\leq 1, x[1,1]:|P(x)|f(|x|)+ε\forall x\in[-1,1]\colon|P^{\prime}(x)|\leq f(|x|)+\varepsilon, moreover the degrees of the polynomials are 𝒪(max[1,c]δlog(1ε))\mathcal{O}\left(\frac{\max[1,c]}{\delta}\log\left(\frac{1}{\varepsilon}\right)\right).

Proof.

Choose δ:=δ/2\delta^{\prime}:=\delta/2 and ε:=ε/2\varepsilon^{\prime}:=\varepsilon/2 in Lemma 17. Then take a polynomial given by Corollary 15 for parameters δ:=δ/4\delta^{\prime}:=\delta/4, t:=δ/4t:=\delta/4 and ε:=ε/2\varepsilon^{\prime}:=\varepsilon/2. The product of the corresponding polynomial satisfies the desired properties. ∎

2.6 Density matrix exponentiation and block-encodings

In case we do not have purified access to the density operators, but can only get independent copies we do not have a direct analog of Lemma 7. Instead we will rely on the technique of density matrix exponentiation [LMR14]. For this we invoke the following form of the result:

Theorem 19 (Density matrix exponentiation [KLL+17, Theorem 5 & Theorem 20]).

For an unkown quantum state ρ2q×2q\rho\in\mathbb{C}^{2^{q}\times 2^{q}} the sample complexity of implementing the controlled-eitρe^{it\rho} unitary to diamond-norm error δ\delta is Θ(t2δ)\Theta(\frac{t^{2}}{\delta}) (for the lower-bound one needs to assume δ16min(1,|t|π)\delta\leq\frac{1}{6}\min(1,\frac{|t|}{\pi})). Moreover, the implementation uses 𝒪(qt2δ)\mathcal{O}\left(q\cdot\frac{t^{2}}{\delta}\right) two-qubit quantum gates.

As pointed out in [GLM+20], using the results of [GSLW19], in particular the result about taking the logarithm of a unitary [GSLW18, Corollary 71] one can implement a block-encoding of ρ\rho also in the sampling access model. To see this we first recall the following result:

Lemma 20 (Implementing the logarithm of unitaries [GSLW18, Corollary 71]).

Suppose that U=eiHU=e^{iH}, where HH is a Hamiltonian of norm at most 12\frac{1}{2}. Let ε(0,12]\varepsilon\in(0,\frac{1}{2}], then we can implement a (2π,2,ε)(\frac{2}{\pi},2,\varepsilon)-block-encoding of HH with 𝒪(log(1ε))\mathcal{O}\left(\log\left(\frac{1}{\varepsilon}\right)\right) uses of controlled-UU and its inverse, using 𝒪(log(1ε))\mathcal{O}\left(\log\left(\frac{1}{\varepsilon}\right)\right) two-qubit gates and using a single ancilla qubit.

Applying this result to the controlled-e±iρ2e^{\pm i\frac{\rho}{2}} evolution given by Theorem 19 we get the following corollary of Theorem 19:

Corollary 21 (Sampling to block-encoding).

For an unknown quantum state ρ2q×2q\rho\in\mathbb{C}^{2^{q}\times 2^{q}} we can implement a quantum operation (quantum channel) that is δ\delta-close in the diamond-norm to an (4π,2,ε)(\frac{4}{\pi},2,\varepsilon)-block-encoding of ρ\rho by using 𝒪(log2(1/ε)δ)\mathcal{O}\left(\frac{\log^{2}(1/\varepsilon)}{\delta}\right) samples of ρ\rho and 𝒪(qlog2(1/ε)δ)\mathcal{O}\left(q\cdot\frac{\log^{2}(1/\varepsilon)}{\delta}\right) two-qubit quantum gates. In particular we can implement a quantum operation (quantum channel) that is δ\delta-close in the diamond-norm to an (4π,3,0)(\frac{4}{\pi},3,0)-block-encoding of ρ\rho by using 𝒪(log2(1/δ)δ)\mathcal{O}\left(\frac{\log^{2}(1/\delta)}{\delta}\right) samples of ρ\rho and 𝒪(qlog2(1/δ)δ)\mathcal{O}\left(q\cdot\frac{\log^{2}(1/\delta)}{\delta}\right) two-qubit quantum gates.

Proof.

Due to Lemma 20 we can implement an (4π,2,ε)(\frac{4}{\pi},2,\varepsilon)-block-encoding of ρ\rho with 𝒪(log(1/ε))\mathcal{O}\left(\log(1/\varepsilon)\right) uses of controlled-e±iρ2e^{\pm i\frac{\rho}{2}} unitary. Due to Theorem 19 we can approximate each application of the controlled-e±iρ2e^{\pm i\frac{\rho}{2}} unitary to diamond error 𝒪(δ/log(1/ε))\mathcal{O}\left(\delta/\log(1/\varepsilon)\right) using 𝒪(log(1/ε)δ)\mathcal{O}\left(\frac{\log(1/\varepsilon)}{\delta}\right) samples. This amounts to an overall number of 𝒪(log2(1/ε)δ)\mathcal{O}\left(\frac{\log^{2}(1/\varepsilon)}{\delta}\right) samples of ρ\rho. By the Lemma 20 and Theorem 19 the gate complexity of this implementation is 𝒪(qlog2(1/ε)δ)\mathcal{O}\left(q\cdot\frac{\log^{2}(1/\varepsilon)}{\delta}\right).

On the other hand a (4π,2,ε)(\frac{4}{\pi},2,\varepsilon)-block-encoding also trivially gives rise to a (4π,3,ε)(\frac{4}{\pi},3,\varepsilon)-block-encoding by simply adding an extra qubit with the identity operation on it. Furthermore, due to Corollary 13 a unitary (4π,3,ε)(\frac{4}{\pi},3,\varepsilon)-block-encoding of ρ\rho is 𝒪(ε)\mathcal{O}\left(\varepsilon\right)-close to a unitary (4π,3,0)(\frac{4}{\pi},3,0)-block-encoding of ρ\rho, and by definition these unitaries are also 𝒪(ε)\mathcal{O}\left(\varepsilon\right)-close in the diamond norm. So choosing δδ2\delta\leftarrow\frac{\delta^{\prime}}{2} and ε𝒪(δ)\varepsilon\leftarrow\mathcal{O}\left(\delta^{\prime}\right) the above construction gives a δ\delta^{\prime}-precise implementation of a (4π,3,0)(\frac{4}{\pi},3,0)-block-encoding of ρ\rho in the diamond norm. ∎

2.7 Truncated fidelity bounds

In general it is difficult to work with density operators that have a large number of tiny eigenvalues that all together represent a significant contribution to the trace. On the other hand, if we filter out small eigenvalues then the problem becomes tractable. Since in general we can only apply soft versions of filtering we need to understand how big is the inaccuracy introduced by such soft truncation. Therefore we devise some slight generalizations of the truncation bounds from [CPCC20, Section 2].

Lemma 22 (Monotonicity of fidelity).

Let 0AB0\preceq A\preceq B such that A,BA,B, and ρ\rho commute with each other, then

F(AρA,σ)F(BρB,σ).\displaystyle F(A\rho A,\sigma)\leq F(B\rho B,\sigma).
Proof.

Since AρABρBA\rho A\preceq B\rho B, and the \sqrt{\cdot} function is operator monotone [HP14, Chapter 4.1] we have

F(AρA,σ)=Tr[σAρAσ]Tr[σBρBσ]=F(BρB,σ).F(A\rho A,\sigma)=\mbox{Tr}\left[\sqrt{\sqrt{\sigma}A\rho A\sqrt{\sigma}}\right]\leq\mbox{Tr}\left[\sqrt{\sqrt{\sigma}B\rho B\sqrt{\sigma}}\right]=F(B\rho B,\sigma).\qed
Lemma 23 (Hard truncation bounds).

Let ρ,σ0\rho,\sigma\succeq 0 and Π\Pi be an orthogonal projector that commutes with ρ\rho, then

F(ρ,σ)F(ΠρΠ,σ)+Tr[(IΠ)ρ(IΠ)]Tr[(IΠ)σ(IΠ)].\displaystyle F(\rho,\sigma)\leq F(\Pi\rho\Pi,\sigma)+\sqrt{\mbox{Tr}\left[(I-\Pi)\rho(I-\Pi)\right]}\sqrt{\mbox{Tr}\left[(I-\Pi)\sigma(I-\Pi)\right]}. (16)
Proof.
F(ρ,σ)=ρσ1\displaystyle F(\rho,\sigma)=\left\lVert\sqrt{\rho}\sqrt{\sigma}\right\rVert_{1} ρΠσ1+ρ(IΠ)σ1\displaystyle\leq\left\lVert\sqrt{\rho}\Pi\sqrt{\sigma}\right\rVert_{1}+\left\lVert\sqrt{\rho}(I-\Pi)\sqrt{\sigma}\right\rVert_{1} (by the triangle inequality)
=ΠρΠσ1+ρ(IΠ)2σ1\displaystyle=\left\lVert\sqrt{\Pi\rho\Pi}\sqrt{\sigma}\right\rVert_{1}+\left\lVert\sqrt{\rho}(I-\Pi)^{2}\sqrt{\sigma}\right\rVert_{1} (Πρ=ρΠ\Pi\rho=\rho\Pi and (IΠ)=(IΠ)2(I-\Pi)=(I-\Pi)^{2})
ΠρΠσ1+ρ(IΠ)2σ(IΠ)2\displaystyle\leq\left\lVert\sqrt{\Pi\rho\Pi}\sqrt{\sigma}\right\rVert_{1}+\|\sqrt{\rho}(I-\Pi)\|_{2}\cdot\|\sqrt{\sigma}(I-\Pi)\|_{2} (by Hölder’s inequaltiy)
=F(ΠρΠ,σ)+Tr[(IΠ)ρ(IΠ)]Tr[(IΠ)σ(IΠ)].\displaystyle=F(\Pi\rho\Pi,\sigma)+\sqrt{\mbox{Tr}\left[(I-\Pi)\rho(I-\Pi)\right]}\cdot\sqrt{\mbox{Tr}\left[(I-\Pi)\sigma(I-\Pi)\right]}.\qed
Corollary 24 (Soft truncation bounds).

Let ρ,σ\rho,\sigma be quantum states and ΠI\Pi^{\phantom{\rho}}_{I} be the orthogonal projector to the subspace spanned by eigenvectors of ρ\rho with eigenvalues in II. Let 0αβ0\leq\alpha\leq\beta and f:[0,1]f\colon\mathbb{R}\mapsto[0,1] be such that for all x<αx<\alpha we have f(x)=0f(x)=0 and for all xβx\geq\beta we have f(x)=1f(x)=1, then

F(Π[β,1)ρΠ[β,1),σ)F(f(ρ)ρ,σ)F(Π[α,1)ρΠ[α,1),σ)F(ρ,σ),F(\Pi^{\phantom{\rho}}_{[\beta,1)}\rho\Pi^{\phantom{\rho}}_{[\beta,1)},\sigma)\leq F(f(\rho)\cdot\rho,\sigma)\leq F(\Pi^{\phantom{\rho}}_{[\alpha,1)}\rho\Pi^{\phantom{\rho}}_{[\alpha,1)},\sigma)\leq F(\rho,\sigma), (17)

and

F(ρ,σ)F(f(ρ)ρ,σ)Tr[Π[0,β)ρΠ[0,β)]Tr[Π[0,β)σΠ[0,β)].F(\rho,\sigma)-F(f(\rho)\cdot\rho,\sigma)\leq\sqrt{\mbox{Tr}\left[\Pi^{\phantom{\rho}}_{[0,\beta)}\rho\Pi^{\phantom{\rho}}_{[0,\beta)}\right]}\sqrt{\mbox{Tr}\left[\Pi^{\phantom{\rho}}_{[0,\beta)}\sigma\Pi^{\phantom{\rho}}_{[0,\beta)}\right]}. (18)
Proof.

Let P:=f(ρ)P:=\sqrt{f(\rho)}, then Π[β,1)PΠ[α,1)I\Pi^{\phantom{\rho}}_{[\beta,1)}\preceq P\preceq\Pi^{\phantom{\rho}}_{[\alpha,1)}\preceq I so Equation 17 follows from Lemma 22 and Equation 18 follows from Equation 17 and Lemma 23. ∎

Replacing ρ\rho in Lemma 23 by ΠαρΠα\Pi_{\alpha}^{\phantom{\rho}}\rho\Pi_{\alpha}^{\phantom{\rho}} (letting Πθ:=Π[θ,1)\Pi_{\theta}^{\phantom{\rho}}:=\Pi_{[\theta,1)}^{\phantom{\rho}}, αβ\alpha\leq\beta) we also get the following bound:

F(ΠαρΠα,σ)F(ΠβρΠβ,σ)\displaystyle F(\Pi_{\alpha}^{\phantom{\rho}}\rho\Pi_{\alpha}^{\phantom{\rho}},\sigma)-F(\Pi_{\beta}^{\phantom{\rho}}\rho\Pi_{\beta}^{\phantom{\rho}},\sigma) =F(ΠαρΠα,ΠασΠα)F(ΠαΠβρΠβΠα,ΠασΠα)\displaystyle=F(\Pi_{\alpha}^{\phantom{\rho}}\rho\Pi_{\alpha}^{\phantom{\rho}},\Pi_{\alpha}^{\phantom{\rho}}\sigma\Pi_{\alpha}^{\phantom{\rho}})-F(\Pi_{\alpha}^{\phantom{\rho}}\Pi_{\beta}^{\phantom{\rho}}\rho\Pi_{\beta}^{\phantom{\rho}}\Pi_{\alpha}^{\phantom{\rho}},\Pi_{\alpha}^{\phantom{\rho}}\sigma\Pi_{\alpha}^{\phantom{\rho}})
Tr[Π[α,β)ρΠ[α,β)]Tr[Π[α,β)σΠ[α,β)],\displaystyle\leq\sqrt{\mbox{Tr}\left[\Pi^{\phantom{\rho}}_{[\alpha,\beta)}\rho\Pi^{\phantom{\rho}}_{[\alpha,\beta)}\right]}\sqrt{\mbox{Tr}\left[\Pi^{\phantom{\rho}}_{[\alpha,\beta)}\sigma\Pi^{\phantom{\rho}}_{[\alpha,\beta)}\right]}, (19)

where in the equality we used that for any ρ0\rho\succeq 0 and Π\Pi orthogonal projector, we have

F(ΠρΠ,σ)=Tr[ΠρΠσΠρΠ]=Tr[ΠρΠΠσΠΠρΠ]=F(ΠρΠ,ΠσΠ).F(\Pi\rho\Pi,\sigma)=\mbox{Tr}\left[\sqrt{\sqrt{\Pi\rho\Pi}\sigma\sqrt{\Pi\rho\Pi}}\right]=\mbox{Tr}\left[\sqrt{\sqrt{\Pi\rho\Pi}\Pi\sigma\Pi\sqrt{\Pi\rho\Pi}}\right]=F(\Pi\rho\Pi,\Pi\sigma\Pi).

3 Fidelity estimation with block-encoding based algorithms

Let us now sketch the main idea behind our block-encoding algorithm that builds on the Hadamard test. Suppose that ρσ\sqrt{\rho}\sqrt{\sigma} has singular value decomposition UΣVU\Sigma V^{\dagger}, then

F(ρ,σ)=ρσ1=Tr[UρσV]=Tr[ρσVU]=Tr[ρ(ρ12σVU)].\displaystyle F(\rho,\sigma)=\left\lVert\sqrt{\rho}\sqrt{\sigma}\right\rVert_{1}=\mbox{Tr}\left[U^{\dagger}\sqrt{\rho}\sqrt{\sigma}V\right]=\mbox{Tr}\left[\sqrt{\rho}\sqrt{\sigma}VU^{\dagger}\right]=\mbox{Tr}\left[\rho(\rho^{-\frac{1}{2}}\sqrt{\sigma}VU^{\dagger})\right]. (20)

By Lemma 9 it suffices to implement a (subnormalized) block-encoding of (ρ12σVU)(\rho^{-\frac{1}{2}}\sqrt{\sigma}VU^{\dagger}) in order to use the Hadamard test for computing an estimate of the fidelity. The main issue with this approach is that ρ12\rho^{-\frac{1}{2}} can, in general, have arbitrarily large eigenvalues.

In order to deal with singularities arising from small eigenvalues we modify the task as follows. Let ρI:=ΠIρΠI\rho_{I}:=\Pi^{\phantom{\rho}}_{I}\rho\Pi^{\phantom{\rho}}_{I} denote the subnormalized density matrix we get after throwing away eigenvalues outside the interval II. For some δ,ε[0,12]\delta,\varepsilon\in[0,\frac{1}{2}] we wish to provide an estimate ff of F(ρ[θ,1],σ)F(\rho_{[\theta,1]},\sigma) to precision

Tr[ρ[(1δ)θ,θ)]Tr[Π[(1δ)θ,θ)σΠ[(1δ)θ,θ)]+ε,\sqrt{\mbox{Tr}\left[\rho_{[(1-\delta)\theta,\theta)}\right]}\sqrt{\mbox{Tr}\left[\Pi^{\phantom{\rho}}_{[(1-\delta)\theta,\theta)}\sigma\Pi^{\phantom{\rho}}_{[(1-\delta)\theta,\theta)}\right]}+\varepsilon, (21)

in turn providing an estimate of F(ρ,σ)F(\rho,\sigma) with precision

Tr[ρ[0,θ)]Tr[Π[0,θ)σΠ[0,θ)]+ε.\sqrt{\mbox{Tr}\left[\rho_{[0,\theta)}\right]}\sqrt{\mbox{Tr}\left[\Pi^{\phantom{\rho}}_{[0,\theta)}\sigma\Pi^{\phantom{\rho}}_{[0,\theta)}\right]}+\varepsilon. (22)

For this we shall use some soft threshold function t:[0,1]t\colon\mathbb{R}\mapsto[0,1] such that for all x<(1δ)θx<(1-\delta)\theta we have t(x)=0t(x)=0 and for all xθx\geq\theta we have t(x)=1t(x)=1. By Equation 19 and Corollary 24 we have that f:=F(t2(ρ)ρ,σ)f:=F(t^{2}(\rho)\rho,\sigma) satisfies both the above requirements with ε=0\varepsilon=0, so it suffices to compute F(t2(ρ)ρ,σ)F(t^{2}(\rho)\rho,\sigma) with ε\varepsilon-precision.

In the following we analyze the propagation of errors and the complexity of the implementation.

3.1 Polynomial approximations and error bounds

In order to make the procedure more efficient we can approximate σ\sqrt{\sigma}. Let 12s:[0,1]\frac{1}{2}s\colon\mathbb{R}\mapsto[0,1] be a polynomial function provided by Corollary 18 with parameters δε2160rk(t(ρ))\delta^{\prime}\leftarrow\frac{\varepsilon^{2}}{160\mathrm{rk}\left(t(\rho)\right)} and εε20rk(t(ρ))\varepsilon^{\prime}\leftarrow\frac{\varepsilon}{20\sqrt{\mathrm{rk}\left(t(\rho)\right)}}, then s[1,1]1+ε1+ε2\left\lVert s\right\rVert_{[-1,1]}\leq 1+\varepsilon^{\prime}\leq 1+\varepsilon\leq 2 and

|t(ρ)ρσ1t(ρ)ρs(σ)1|\displaystyle\left|\left\lVert t(\rho)\sqrt{\rho}\sqrt{\sigma}\right\rVert_{1}-\left\lVert t(\rho)\sqrt{\rho}s(\sigma)\right\rVert_{1}\right| t(ρ)ρ(σs(σ))1\displaystyle\leq\left\lVert t(\rho)\sqrt{\rho}(\sqrt{\sigma}-s(\sigma))\right\rVert_{1} (by the triangle inequality)
t(ρ)2ρ2σs(σ)\displaystyle\leq\left\lVert t(\rho)\right\rVert_{2}\left\lVert\sqrt{\rho}\right\rVert_{2}\left\lVert\sqrt{\sigma}-s(\sigma)\right\rVert (by Hölder’s inequality)
rk(t(ρ))1ε5rk(t(ρ))=ε5.\displaystyle\leq\sqrt{\mathrm{rk}\left(t(\rho)\right)}\cdot 1\cdot\frac{\varepsilon}{5\sqrt{\mathrm{rk}\left(t(\rho)\right)}}=\frac{\varepsilon}{5}. (23)

Let us also approximate ρ\sqrt{\rho} by a polynomial. We construct a polynomial θ22q\frac{\sqrt{\theta}}{2\sqrt{2}}q by Lemma 16, with parameters δθ2\delta^{\prime}\leftarrow\frac{\theta}{2} and εεθ202\varepsilon^{\prime}\leftarrow\frac{\varepsilon\sqrt{\theta}}{20\sqrt{2}}, then xq(x)[1,1]2\left\lVert xq(x)\right\rVert_{[-1,1]}\leq 2 and

|t(ρ)ρs(σ)1t(ρ)ρq(ρ)s(σ)1|\displaystyle\left|\left\lVert t(\rho)\sqrt{\rho}s(\sigma)\right\rVert_{1}-\left\lVert t(\rho)\rho q(\rho)s(\sigma)\right\rVert_{1}\right| t(ρ)ρ(1ρq(ρ))s(σ)1\displaystyle\leq\left\lVert t(\rho)\rho\left(\frac{1}{\sqrt{\rho}}-q(\rho)\right)s(\sigma)\right\rVert_{1} (by the triangle inequality)
ρ1t(ρ)ρt(ρ)q(ρ)s(σ)\displaystyle\leq\left\lVert\rho\right\rVert_{1}\left\lVert\frac{t(\rho)}{\sqrt{\rho}}-t(\rho)q(\rho)\right\rVert\left\lVert s(\sigma)\right\rVert (by Hölder’s inequality)
1ε102=ε5.\displaystyle\leq 1\cdot\frac{\varepsilon}{10}\cdot 2=\frac{\varepsilon}{5}. (24)

Let Q:=t(ρ)ρq(ρ)s(σ)Q:=t(\rho)\rho q(\rho)s(\sigma), by definition we have that

Q1=Tr[QSV(sgn)(Q)].\left\lVert Q\right\rVert_{1}=\mbox{Tr}\left[Q\cdot SV^{(\mathrm{sgn})}\!(Q^{\dagger})\right]. (25)

Observe that QQ has at most rk(t(ρ))\mathrm{rk}\left(t(\rho)\right) non-zero singular values. Also by Hölder’s inequality we know that t(ρ)ρσ1t(ρ)ρ2σ21\left\lVert t(\rho)\sqrt{\rho}\sqrt{\sigma}\right\rVert_{1}\leq\left\lVert t(\rho)\right\rVert\left\lVert\sqrt{\rho}\right\rVert_{2}\left\lVert\sqrt{\sigma}\right\rVert_{2}\leq 1, so by Equations 23 and 24 we get Q11+2ε565\left\lVert Q\right\rVert_{1}\leq 1+\frac{2\varepsilon}{5}\leq\frac{6}{5}. Let ςi\varsigma_{i} denote the singular values of QQ. Let p:[1,1][1,1]p\colon[-1,1]\mapsto[-1,1] be an odd function such that for all x[1,1]x\in[-1,1] with |x|ε160rk(t(ρ))|x|\geq\frac{\varepsilon}{160\mathrm{rk}\left(t(\rho)\right)} we have sgn(x)p(x)5ε/60\mathrm{sgn}(x)-p(x)\leq 5\varepsilon/60, then

|Tr[QSV(sgn)(Q)]Tr[QSV(p)(Q/8)]|\displaystyle\left|\mbox{Tr}\left[Q\cdot\mathrm{SV}^{(\mathrm{sgn})}\!(Q^{\dagger})\right]-\mbox{Tr}\left[Q\cdot\mathrm{SV}^{(p)}\!(Q^{\dagger}/8)\right]\right| =|i=1ςiςip(ςi/8)|\displaystyle=\left|\sum_{i=1}\varsigma_{i}-\varsigma_{i}p(\varsigma_{i}/8)\right|
i=1ςi|1p(ςi/8)|\displaystyle\leq\sum_{i=1}\varsigma_{i}|1-p(\varsigma_{i}/8)|
=ςiε20rk(t(ρ))ςi|1p(ςi/8)|+ςi<ε20rk(t(ρ))ςi|1p(ςi/8)|\displaystyle=\kern-2.84526pt\sum_{\varsigma_{i}\geq\frac{\varepsilon}{20\mathrm{rk}\left(t(\rho)\right)}}\kern-8.53581pt\varsigma_{i}|1-p(\varsigma_{i}/8)|+\kern-2.84526pt\sum_{\varsigma_{i}<\frac{\varepsilon}{20\mathrm{rk}\left(t(\rho)\right)}}\kern-8.53581pt\varsigma_{i}|1-p(\varsigma_{i}/8)|
ςiε20rk(t(ρ))ςi5ε60+ςi<ε20rk(t(ρ))2ςi\displaystyle\leq\sum_{\varsigma_{i}\geq\frac{\varepsilon}{20\mathrm{rk}\left(t(\rho)\right)}}\varsigma_{i}\frac{5\varepsilon}{60}+\sum_{\varsigma_{i}<\frac{\varepsilon}{20\mathrm{rk}\left(t(\rho)\right)}}2\varsigma_{i}
Tr[Σ]ε10+0<ςi<ε20rk(t(ρ))2ε20rk(t(ρ))ε5.\displaystyle\leq\mbox{Tr}\left[\Sigma\right]\frac{\varepsilon}{10}+\sum_{0<\varsigma_{i}<\frac{\varepsilon}{20\mathrm{rk}\left(t(\rho)\right)}}2\frac{\varepsilon}{20\mathrm{rk}\left(t(\rho)\right)}\leq\frac{\varepsilon}{5}. (26)

So performing singular value transformation according to pp as opposed to sgn\mathrm{sgn} introduces an error in the estimation that is bounded by ε/5\varepsilon/5. Moreover, due to Lemma 14 we can find such a polynomial pp with degree 𝒪(rk(t(ρ))εlog(1/ε))\mathcal{O}\left(\frac{\mathrm{rk}\left(t(\rho)\right)}{\varepsilon}\log(1/\varepsilon)\right).

Now we find a polynomial approximation of t(x)t(x). We choose a polynomial t~(x):=1P(x)\tilde{t}(x):=1-P^{\prime}(x) for a rectangle function from Corollary 15 with parameters t=(1δ2)θt^{\prime}=(1-\frac{\delta}{2})\theta, δδ2θ\delta^{\prime}\leftarrow\frac{\delta}{2}\theta, and εmin{θε202,5ε60deg(p)}\varepsilon^{\prime}\leftarrow\min\{\frac{\sqrt{\theta}\varepsilon}{20\sqrt{2}},\frac{5\varepsilon}{60\deg(p)}\}. The degree of t~\tilde{t} is 𝒪(1δθlogrk(t(ρ))θε)\mathcal{O}\left(\frac{1}{\delta\theta}\log\frac{\mathrm{rk}\left(t(\rho)\right)}{\theta\varepsilon}\right). Note that we did not yet even specify the shape of t(x)t(x) for x[(1δ2)θ,θ]x\in[(1-\frac{\delta}{2})\theta,\theta], so we simply define it to be t~(x)\tilde{t}(x) – resulting in |t(x)t~(x)|ε|t(x)-\tilde{t}(x)|\leq\varepsilon^{\prime} for x[0,1]x\in[0,1]. Let us define Q~:=t~(ρ)ρq(ρ)s(σ)\tilde{Q}:=\tilde{t}(\rho)\rho q(\rho)s(\sigma), then we wish to bound

|Tr[QSV(p)(Q/8)]Tr[Q~SV(p)(Q~/8)]|\displaystyle\left|\mbox{Tr}\left[Q\cdot\mathrm{SV}^{(p)}\!(Q^{\dagger}/8)\right]-\mbox{Tr}\left[\tilde{Q}\cdot\mathrm{SV}^{(p)}\!(\tilde{Q}^{\dagger}/8)\right]\right| |Tr[Q(SV(p)(Q/8)SV(p)(Q~/8))]|\displaystyle\leq\left|\mbox{Tr}\left[Q\cdot\left(\mathrm{SV}^{(p)}\!(Q^{\dagger}/8)-\mathrm{SV}^{(p)}\!(\tilde{Q}^{\dagger}/8)\right)\right]\right|
+|Tr[(QQ~)SV(p)(Q~/8)]|\displaystyle\phantom{=}+\left|\mbox{Tr}\left[\left(Q-\tilde{Q}\right)\cdot\mathrm{SV}^{(p)}\!(\tilde{Q}^{\dagger}/8)\right]\right| (triangle inequality)
Q(SV(p)(Q/8)SV(p)(Q~/8))1\displaystyle\leq\left\lVert Q\cdot\left(\mathrm{SV}^{(p)}\!(Q^{\dagger}/8)-\mathrm{SV}^{(p)}\!(\tilde{Q}^{\dagger}/8)\right)\right\rVert_{1}
+(QQ~)SV(p)(Q~/8)1\displaystyle\phantom{=}+\left\lVert\left(Q-\tilde{Q}\right)\cdot\mathrm{SV}^{(p)}\!(\tilde{Q}^{\dagger}/8)\right\rVert_{1} (trace-norm inequality)
Q165SV(p)(Q/8)SV(p)(Q~/8)\displaystyle\leq\underset{\leq\frac{6}{5}}{\underbrace{\left\lVert Q\right\rVert_{1}}}\cdot\left\lVert\mathrm{SV}^{(p)}\!(Q^{\dagger}/8)-\mathrm{SV}^{(p)}\!(\tilde{Q}^{\dagger}/8)\right\rVert (Hölder’s ineq.)
+QQ~1SV(p)(Q~/8)1.\displaystyle\phantom{=}+\left\lVert Q-\tilde{Q}\right\rVert_{1}\cdot\underset{\leq 1}{\underbrace{\left\lVert\mathrm{SV}^{(p)}\!(\tilde{Q}^{\dagger}/8)\right\rVert}}.

Now we bound both terms individually as follows

QQ~1\displaystyle\left\lVert Q-\tilde{Q}\right\rVert_{1} =t(ρ)ρq(ρ)s(σ)1t~(ρ)ρq(ρ)s(σ)1\displaystyle=\left\lVert t(\rho)\rho q(\rho)s(\sigma)\right\rVert_{1}-\left\lVert\tilde{t}(\rho)\rho q(\rho)s(\sigma)\right\rVert_{1} (by definition)
(t(ρ)t~(ρ))ρq(ρ)s(σ)1\displaystyle\leq\left\lVert(t(\rho)-\tilde{t}(\rho))\rho q(\rho)s(\sigma)\right\rVert_{1} (by the triangle inequality)
(t(ρ)t~(ρ))ρ1q(ρ)s(σ)\displaystyle\leq\left\lVert(t(\rho)-\tilde{t}(\rho))\right\rVert\left\lVert\rho\right\rVert_{1}\left\lVert q(\rho)\right\rVert\left\lVert s(\sigma)\right\rVert (by Hölder’s inequality)
ε122θ2=ε10,\displaystyle\leq\varepsilon^{\prime}\cdot 1\cdot\frac{2\sqrt{2}}{\sqrt{\theta}}\cdot 2=\frac{\varepsilon}{10},

and by Lemma 11 (choosing A¯:=Q¯/8\bar{A}:=\bar{Q}/8, and observing Q¯4\left\lVert\bar{Q}\right\rVert\leq 4 for Q¯{Q,Q~}\bar{Q}\in\{Q,\tilde{Q}\}) we have that

SV(p)(Q/8)SV(p)(Q~/8)\displaystyle\left\lVert\mathrm{SV}^{(p)}\!(Q/8)-\mathrm{SV}^{(p)}\!(\tilde{Q}/8)\right\rVert deg(p)14Q~Q\displaystyle\leq\deg(p)\cdot\frac{1}{4}\cdot\left\lVert\tilde{Q}-Q\right\rVert
=deg(p)4(t(ρ)t~(ρ))ρq(ρ)s(σ)\displaystyle=\frac{\deg(p)}{4}\left\lVert(t(\rho)-\tilde{t}(\rho))\rho q(\rho)s(\sigma)\right\rVert
deg(p)4t(ρ)t~(ρ)ρq(ρ)s(σ)\displaystyle\leq\frac{\deg(p)}{4}\left\lVert t(\rho)-\tilde{t}(\rho)\right\rVert\left\lVert\rho q(\rho)\right\rVert\left\lVert s(\sigma)\right\rVert
deg(p)4ε45ε60,\displaystyle\leq\frac{\deg(p)}{4}\cdot\varepsilon^{\prime}\cdot 4\leq\frac{5\varepsilon}{60},

ultimately resulting in

|Tr[QSV(p)(Q/8)]Tr[Q~SV(p)(Q~/8)]|ε5.\left|\mbox{Tr}\left[Q\cdot\mathrm{SV}^{(p)}\!(Q^{\dagger}/8)\right]-\mbox{Tr}\left[\tilde{Q}\cdot\mathrm{SV}^{(p)}\!(\tilde{Q}^{\dagger}/8)\right]\right|\leq\frac{\varepsilon}{5}. (27)

Therefore, combining Equations 23, 24, 25, 26 and 27 we ultimately get

|t(ρ)ρσ1Tr[Q~SV(p)(Q~/8)]|4ε5.\left|\left\lVert t(\rho)\sqrt{\rho}\sqrt{\sigma}\right\rVert_{1}-\mbox{Tr}\left[\tilde{Q}\cdot\mathrm{SV}^{(p)}\!(\tilde{Q}^{\dagger}/8)\right]\right|\leq\frac{4\varepsilon}{5}. (28)

3.2 Complexity analysis – with purified access

Assuming the purified access model, we can show the following result for our block-encoding algorithm.

Theorem 25.

Let ρ,σd×d\rho,\sigma\in\mathbb{C}^{d\times d} be arbitrary density matrices. Suppose also that ρ\rho has the smallest rank of the two states. Let ε(0,1)\varepsilon\in(0,1), δ(0,1)\delta\in(0,1) and θ(0,1)\theta\in(0,1) be parameters. Then, given purified access to ρ\rho and σ\sigma, our block-encoding algorithm in Section 3 runs in time

𝒪~(rk(Π[(1δ)θ,1]ρ)ε2δθ32Tρ+rk(Π[(1δ)θ,1]ρ)2ε4θ12Tσ)\widetilde{\mathcal{O}}\left(\frac{\mathrm{rk}\left(\Pi^{\rho}_{[(1-\delta)\theta,1]}\right)}{\varepsilon^{2}\delta\theta^{\frac{3}{2}}}T_{\rho}+\frac{\mathrm{rk}\left(\Pi^{\rho}_{[(1-\delta)\theta,1]}\right)^{2}}{\varepsilon^{4}\theta^{\frac{1}{2}}}T_{\sigma}\right)

and outputs (with high probability) an estimate F^(ρθ,σ)\hat{F}(\rho_{\theta},\sigma) such that

|F(ρθ,σ)F^(ρθ,σ)|ε,|F(\rho_{\theta},\sigma)-\hat{F}(\rho_{\theta},\sigma)|\leq\varepsilon,

where ρθ\rho_{\theta} is a “soft-thresholded” version of ρ\rho in which eigenvalues of ρ\rho below (1δ)θ(1-\delta)\theta are removed and those above θ\theta are kept intact, while eigenvalues in [(1δ)θ,θ][(1-\delta)\theta,\theta] are decreased by some amount.

Proof.

By Lemma 9 it suffices to implement a (θ42\frac{\sqrt{\theta}}{4\sqrt{2}} subnormalized) block-encoding of

t~(ρ)q(ρ)s(σ)SV(p)(t~(ρ)ρq(ρ)s(σ)/8)\tilde{t}(\rho)q(\rho)s(\sigma)\mathrm{SV}^{(p)}\!(\tilde{t}(\rho)\rho q(\rho)s(\sigma)/8)

in order to use the Hadamard test for computing an estimate of Tr[ρt~(ρ)q(ρ)s(σ)SV(p)(t~(ρ)ρq(ρ)s(σ)/8)]\mbox{Tr}\left[\rho\tilde{t}(\rho)q(\rho)s(\sigma)\mathrm{SV}^{(p)}\!(\tilde{t}(\rho)\rho q(\rho)s(\sigma)/8)\right] – which by Equation 28 is 4ε5\frac{4\varepsilon}{5}-close to the fidelity. Using amplitude estimation we can estimate the success probability of the Hadamard test to precision 𝒪(εθ402)\mathcal{O}\left(\frac{\varepsilon\sqrt{\theta}}{40\sqrt{2}}\right), which then results in an ε\varepsilon precise estimate of

F(t2(ρ)ρ,σ)=t(ρ)ρσ1.F(t^{2}(\rho)\rho,\sigma)=\left\lVert t(\rho)\sqrt{\rho}\sqrt{\sigma}\right\rVert_{1}. (29)

In order to implement a block-encoding of Q~/8\tilde{Q}/8 we implement both t~(ρ)ρq(ρ)/4\tilde{t}(\rho)\rho q(\rho)/4 and s(σ)/2s(\sigma)/2 using QSVT and take their product [GSLW19]. Sine deg(s)=𝒪(rk(t(ρ))ε2logrk(t(ρ))ε)\deg(s)=\mathcal{O}\left(\frac{\mathrm{rk}\left(t(\rho)\right)}{\varepsilon^{2}}\log\frac{\mathrm{rk}\left(t(\rho)\right)}{\varepsilon}\right) and deg(t~(x)xq(x))\deg(\tilde{t}(x)\cdot x\cdot q(x)) is 𝒪(1δθlogrk(t(ρ))θε)\mathcal{O}\left(\frac{1}{\delta\theta}\log\frac{\mathrm{rk}\left(t(\rho)\right)}{\theta\varepsilon}\right), the complexity of implementing t~(ρ)ρq(ρ)s(σ)8\frac{\tilde{t}(\rho)\rho q(\rho)s(\sigma)}{8} is 𝒪(Tρδθlogrk(t(ρ))θε+Tσrk(t(ρ))ε2logrk(t(ρ))ε)\mathcal{O}\left(\frac{T_{\rho}}{\delta\theta}\log\frac{\mathrm{rk}\left(t(\rho)\right)}{\theta\varepsilon}+\frac{T_{\sigma}\mathrm{rk}\left(t(\rho)\right)}{\varepsilon^{2}}\log\frac{\mathrm{rk}\left(t(\rho)\right)}{\varepsilon}\right). Applying QSVT by the polynomial pp uses the above block-encoding a total of 𝒪(rk(t(ρ))εlog(1/ε))\mathcal{O}\left(\frac{\mathrm{rk}\left(t(\rho)\right)}{\varepsilon}\log(1/\varepsilon)\right) times resulting in complexity 𝒪~(Tρrk(t(ρ))εδθ+Tσrk(t(ρ))2ε3)\widetilde{\mathcal{O}}\left(\frac{T_{\rho}\mathrm{rk}\left(t(\rho)\right)}{\varepsilon\delta\theta}+\frac{T_{\sigma}\mathrm{rk}\left(t(\rho)\right)^{2}}{\varepsilon^{3}}\right) for implementing SV(p)(t~(ρ)ρq(ρ)s(σ)/8)\mathrm{SV}^{(p)}\!(\tilde{t}(\rho)\rho q(\rho)s(\sigma)/8). Similarly we can implement a block-encoding pf t~(ρ)q(ρ)θ22\tilde{t}(\rho)q(\rho)\cdot\frac{\sqrt{\theta}}{2\sqrt{2}} by QSVT and take its product with s(σ)/2s(\sigma)/2, then take a product with SV(p)(t~(ρ)ρq(ρ)s(σ)/8)\mathrm{SV}^{(p)}\!(\tilde{t}(\rho)\rho q(\rho)s(\sigma)/8), which only gives a lower order contribution to the running time. Before providing the final runtime bound let us note that rk(t(ρ))rk(Π[(1δ)θ,1]ρ)\mathrm{rk}\left(t(\rho)\right)\leq\mathrm{rk}\left(\Pi^{\rho}_{[(1-\delta)\theta,1]}\right). This all together gives the runtime bound

𝒪~(rk(Π[(1δ)θ,1]ρ)ε2δθ32Tρ+rk(Π[(1δ)θ,1]ρ)2ε4θ12Tσ).\widetilde{\mathcal{O}}\left(\frac{\mathrm{rk}\left(\Pi^{\rho}_{[(1-\delta)\theta,1]}\right)}{\varepsilon^{2}\delta\theta^{\frac{3}{2}}}T_{\rho}+\frac{\mathrm{rk}\left(\Pi^{\rho}_{[(1-\delta)\theta,1]}\right)^{2}}{\varepsilon^{4}\theta^{\frac{1}{2}}}T_{\sigma}\right).

This proves the claim. ∎

If we have an upper bound on the smallest rank of the two states, we obtain the following result.

Corollary 26.

Let ρ,σd×d\rho,\sigma\in\mathbb{C}^{d\times d} be arbitrary density matrices. Suppose also that ρ\rho has the smallest rank of the two states, where rk(ρ)r\mathrm{rk}\left(\rho\right)\leq r. Let ε(0,1)\varepsilon\in(0,1) be a parameter. Then, our block-encoding algorithm in Section 3 runs in time

𝒪~(r52ε5(Tρ+Tσ)).\widetilde{\mathcal{O}}\left(\frac{r^{\frac{5}{2}}}{\varepsilon^{5}}(T_{\rho}+T_{\sigma})\right).

and outputs (with high probability) an estimate F^(ρθ,σ)\hat{F}(\rho_{\theta},\sigma) such that

|F(ρ,σ)F^(ρθ,σ)|ε,|F(\rho,\sigma)-\hat{F}(\rho_{\theta},\sigma)|\leq\varepsilon,

where ρθ\rho_{\theta} is a “soft-thresholded” version of ρ\rho with parameters θ=Θ(ε2r)\theta=\Theta(\frac{\varepsilon^{2}}{r}) and δ=12\delta=\frac{1}{2}.

Proof.

Assuming that rk(ρ)r\mathrm{rk}\left(\rho\right)\leq r, we can use Equation 22 and set θ=Θ(ε2r)\theta=\Theta(\frac{\varepsilon^{2}}{r}) and δ=12\delta=\frac{1}{2} to obtain an ε\varepsilon-precise estimate F^(ρθ,σ)\hat{F}(\rho_{\theta},\sigma) to the fidelity F(ρ,σ)F(\rho,\sigma) in complexity 𝒪~(r52ε5(Tρ+Tσ))\widetilde{\mathcal{O}}\left(\frac{r^{\frac{5}{2}}}{\varepsilon^{5}}(T_{\rho}+T_{\sigma})\right). ∎

3.3 Complexity analysis – with sampling access

Assuming the purified access model, we can show the following result for our block-encoding algorithm.

Theorem 27.

Let ρ,σd×d\rho,\sigma\in\mathbb{C}^{d\times d} be arbitrary density matrices. Suppose also that ρ\rho has the smallest rank of the two states. Let ε(0,1)\varepsilon\in(0,1), δ(0,1)\delta\in(0,1) and θ(0,1)\theta\in(0,1) be parameters. Then, given sampling access to ρ\rho and σ\sigma, our block-encoding algorithm in Section 3 uses

𝒪~(rk(t(ρ))2ε5δ2θ72) copies of ρ and𝒪~(rk(t(ρ))4ε9θ32) copies of σ,\widetilde{\mathcal{O}}\left(\frac{\mathrm{rk}\left(t(\rho)\right)^{2}}{\varepsilon^{5}\delta^{2}\theta^{\frac{7}{2}}}\right)\text{ copies of }\rho\text{ and}\,\,\widetilde{\mathcal{O}}\left(\frac{\mathrm{rk}\left(t(\rho)\right)^{4}}{\varepsilon^{9}\theta^{\frac{3}{2}}}\right)\text{ copies of }\sigma,

where tt is the threshold function in Section 3, and outputs (with high probability) F^(ρθ,σ)\hat{F}(\rho_{\theta},\sigma) such that

|F(ρθ,σ)F^(ρθ,σ)|ε,|F(\rho_{\theta},\sigma)-\hat{F}(\rho_{\theta},\sigma)|\leq\varepsilon,

where ρθ\rho_{\theta} is a “soft-thresholded” version of ρ\rho in which eigenvalues of ρ\rho below (1δ)θ(1-\delta)\theta are removed and those above θ\theta are kept intact, while eigenvalues in [(1δ)θ,θ][(1-\delta)\theta,\theta] are decreased by some amount.

Proof.

The overall approach is analogous to Section 3.2. We implement a Θ(θ)\Theta(\sqrt{\theta})-subnormalized (𝒪(εθ)\mathcal{O}(\varepsilon\sqrt{\theta})-approximate) block-encoding of

t~(ρ)q(ρ)s(σ)SV(p)(t~(ρ)ρq(ρ)s(σ)/8),\tilde{t}(\rho)q(\rho)s(\sigma)\mathrm{SV}^{(p)}\!(\tilde{t}(\rho)\rho q(\rho)s(\sigma)/8), (30)

and apply the block-Hadamard test on a copy of ρ\rho as described in Lemma 9. Then it suffices to estimate the probability of outcome 0 to precision 𝒪(εθ)\mathcal{O}\left(\varepsilon\sqrt{\theta}\right). Since in this scenario we only get copies of ρ\rho we cannot implement amplitude estimation (which would require the ability to prepare ρ\rho), but need to repeat the Hadamard test a total of 1ε2θ\frac{1}{\varepsilon^{2}\theta} times to get an estimate with such precision.

Another difference from Section 3.2 is that we do not natively have a perfect block-encoding of ρ\rho and σ\sigma. However, using density matrix exponentiation by Corollary 21 we can get an approximate block-encoding of a π4\frac{\pi}{4}-subnormalized block-encoding of ρ\rho and σ\sigma. The π4\frac{\pi}{4}-subnormalization constant only induces constant factor changes in our analysis in Section 3.1. In particular our earlier analysis in Section 3.2 still shows that a Θ(θ)\Theta(\sqrt{\theta})-subnormalized block-encoding of (30) can be implemented with bρ:=𝒪~(rk(t(ρ))εδθ)b_{\rho}:=\widetilde{\mathcal{O}}\left(\frac{\mathrm{rk}\left(t(\rho)\right)}{\varepsilon\delta\theta}\right) uses of UρU_{\rho} a block-encoding of π4ρ\frac{\pi}{4}\rho and bσ:=𝒪~(rk(t(ρ))2ε3)b_{\sigma}:=\widetilde{\mathcal{O}}\left(\frac{\mathrm{rk}\left(t(\rho)\right)^{2}}{\varepsilon^{3}}\right) uses of UσU_{\sigma} a block-encoding of π4σ\frac{\pi}{4}\sigma. We can implement UρU_{\rho} to 𝒪(εθbρ)\mathcal{O}\left(\frac{\varepsilon\sqrt{\theta}}{b_{\rho}}\right)-error in the diamond norm by using 𝒪~(bρεθ)\widetilde{\mathcal{O}}\left(\frac{b_{\rho}}{\varepsilon\sqrt{\theta}}\right) copies of ρ\rho and similarly implement UσU_{\sigma} to 𝒪(εθbσ)\mathcal{O}\left(\frac{\varepsilon\sqrt{\theta}}{b_{\sigma}}\right)-error in the diamond norm by using 𝒪~(bσεθ)\widetilde{\mathcal{O}}\left(\frac{b_{\sigma}}{\varepsilon\sqrt{\theta}}\right) copies of σ\sigma due to Corollary 21. This then results in an implementation of a block-encoding of a Θ(θ)\Theta(\sqrt{\theta})-subnormalized version of (30) up to diamond-norm error 𝒪(εθ)\mathcal{O}\left(\varepsilon\sqrt{\theta}\right) using 𝒪~(bρ2εθ)\widetilde{\mathcal{O}}\left(\frac{b_{\rho}^{2}}{\varepsilon\sqrt{\theta}}\right) copies of ρ\rho and 𝒪~(bσ2εθ)\widetilde{\mathcal{O}}\left(\frac{b_{\sigma}^{2}}{\varepsilon\sqrt{\theta}}\right) copies of σ\sigma. This construction ensures that the probability of getting outcome 0 in the Hadamard-test is 𝒪(εθ)\mathcal{O}\left(\varepsilon\sqrt{\theta}\right)-close to the outcome one would get by using an exact block-encoding of (30). By appropriately choosing the constants this ensures that repeating the Hadamard-test 1ε2θ\frac{1}{\varepsilon^{2}\theta} times with high-probability we get an ε\varepsilon-precisie estimate of (29).

This amounts to an algorithm that uses 𝒪~(bρ2ε3θ32)\widetilde{\mathcal{O}}\left(\frac{b_{\rho}^{2}}{\varepsilon^{3}\theta^{\frac{3}{2}}}\right) and 𝒪~(bσ2ε3θ32)\widetilde{\mathcal{O}}\left(\frac{b_{\sigma}^{2}}{\varepsilon^{3}\theta^{\frac{3}{2}}}\right) copies of ρ\rho and σ\sigma respectively, i.e., the ultimate algorithm uses

𝒪~(rk(t(ρ))2ε5δ2θ72) copies of ρ\widetilde{\mathcal{O}}\left(\frac{\mathrm{rk}\left(t(\rho)\right)^{2}}{\varepsilon^{5}\delta^{2}\theta^{\frac{7}{2}}}\right)\text{ copies of }\rho

and

𝒪~(rk(t(ρ))4ε9θ32) copies of σ.\widetilde{\mathcal{O}}\left(\frac{\mathrm{rk}\left(t(\rho)\right)^{4}}{\varepsilon^{9}\theta^{\frac{3}{2}}}\right)\text{ copies of }\sigma.

The implementation is also gate efficient, the gate complexity overhead of the implementation is 𝒪(log(dim(ρ)))\mathcal{O}\left(\log(\dim(\rho))\right) as follows from Corollary 21. This proves the claim. ∎

If we have an upper bound on the smallest rank of the two states, we get the following:

Corollary 28.

Let ρ,σd×d\rho,\sigma\in\mathbb{C}^{d\times d} be arbitrary density matrices. Suppose also that ρ\rho has the smallest rank of the two states, where rk(ρ)r\mathrm{rk}\left(\rho\right)\leq r. Let ε(0,1)\varepsilon\in(0,1) be a parameter. Then, given sampling access to ρ\rho and σ\sigma, our block-encoding algorithm in Section 3 uses 𝒪~(r5.5ε12)\widetilde{\mathcal{O}}\left(\frac{r^{5.5}}{\varepsilon^{12}}\right) copies of ρ\rho and σ\sigma and outputs (with high probability) an estimate F^(ρθ,σ)\hat{F}(\rho_{\theta},\sigma) such that

|F(ρ,σ)F^(ρθ,σ)|ε,|F(\rho,\sigma)-\hat{F}(\rho_{\theta},\sigma)|\leq\varepsilon,

where ρθ\rho_{\theta} is a “soft-thresholded” version of ρ\rho with parameters θ=Θ(ε2r)\theta=\Theta(\frac{\varepsilon^{2}}{r}) and δ=12\delta=\frac{1}{2}.

Proof.

In case we know that rk(ρ)r\mathrm{rk}\left(\rho\right)\leq r, by Equation 22 we can see that by setting θ=Θ(ε2r)\theta=\Theta(\frac{\varepsilon^{2}}{r}) and δ=12\delta=\frac{1}{2} we can obtain an ε\varepsilon-precise estimate with 𝒪~(r5.5ε12)\widetilde{\mathcal{O}}\left(\frac{r^{5.5}}{\varepsilon^{12}}\right) copies of ρ\rho and σ\sigma. ∎

4 Fidelity estimation via spectral sampling

In this section, we present our second approximation algorithm for the problem of fidelity estimation. Recall that we can write the fidelity between two states ρ,σd×d\rho,\sigma\in\mathbb{C}^{d\times d} as the quantity F(ρ,σ)=Tr[Λ]F(\rho,\sigma)=\mbox{Tr}{[\sqrt{\Lambda}]}, where Λ(ρ,σ)=ρσρd×d\Lambda(\rho,\sigma)=\sqrt{\rho}\sigma\sqrt{\rho}\in\mathbb{C}^{d\times d} has the following non-trivial entries in the eigenbasis of ρ\rho:

Λij=λiλjψi|σ|ψj,i,j{1,,rk(ρ)}.\displaystyle\Lambda_{ij}=\sqrt{\lambda_{i}}\sqrt{\lambda_{j}}\langle\psi_{i}\rvert\sigma\lvert\psi_{j}\rangle,\quad\quad\forall i,j\in\{1,\dots,\mathrm{rk}\left(\rho\right)\}.

Hence, it suffices to directly compute the matrix elements of Λ\Lambda in order to estimate the fidelity F(ρ,σ)F(\rho,\sigma). In Section 4.1, we show a continuity bound for fidelity estimation. This allows us to quantify the approximation error of our estimate F^(ρ,σ)=Tr[Λ^+]\hat{F}(\rho,\sigma)=\mathrm{Tr}\big{[}{\sqrt{\hat{\Lambda}_{+}}}\big{]} for F(ρ,σ)=Tr[Λ]F(\rho,\sigma)=\mbox{Tr}{[\sqrt{\Lambda}]} in terms of the approximation error between Λ\Lambda and Λ^\hat{\Lambda}, where Λ^\hat{\Lambda} is our initial estimate and Λ^+\hat{\Lambda}_{+} is the projection onto the positive semidefinite cone. In particular, we show in Theorem 29 that

|F(ρ,σ)F^(ρ,σ)|2rΛΛ^1,|F(\rho,\sigma)-\hat{F}(\rho,\sigma)|\,\leq\,\sqrt{2}r\cdot\sqrt{\left\|\Lambda-\hat{\Lambda}\right\|_{1}},

where r=min{rk(ρ),rk(σ)}r=\min\{\mathrm{rk}\left(\rho\right),\mathrm{rk}\left(\sigma\right)\} denotes the smallest rank of the states ρ\rho and σ\sigma. To estimate the eigenvalues of ρ\rho, we rely on the technique called quantum spectral sampling first introduced by Lloyd, Mohseni and Rebentrost [LMR14] in the context of quantum principal component analysis.

4.1 Continuity bound for fidelity estimation

In this section, we prove an important technical result which allows us to relate the approximation error of a fidelity estimate for F(ρ,σ)=Tr[Λ]F(\rho,\sigma)=\mbox{Tr}{[\sqrt{\Lambda}]} in terms of the approximation error for the matrix Λ(ρ,σ)=ρσρ\Lambda(\rho,\sigma)=\sqrt{\rho}\sigma\sqrt{\rho}. In other words, if Λ\Lambda and Λ^\hat{\Lambda} are close, then the fidelity estimate F^(ρ,σ)=Tr[Λ^+]\hat{F}(\rho,\sigma)=\mathrm{Tr}\big{[}{\sqrt{\hat{\Lambda}_{+}}}\big{]} is close to F(ρ,σ)=Tr[Λ]F(\rho,\sigma)=\mbox{Tr}{[\sqrt{\Lambda}]}, where Λ^+\hat{\Lambda}_{+} is the projection onto the positive semidefinite cone.

Theorem 29 (Continuity bound).

Let ρ,σd×d\rho,\sigma\in\mathbb{C}^{d\times d} be density matrices and Λ(ρ,σ)=ρσρ\Lambda(\rho,\sigma)=\sqrt{\rho}\sigma\sqrt{\rho}. Let Λ^d×d\hat{\Lambda}\in\mathbb{C}^{d\times d} be an arbitrary hermitian matrix with rk(Λ^)rk(Λ)\mathrm{rk}(\hat{\Lambda})\leq\mathrm{rk}\left(\Lambda\right) and suppose that F^(ρ,σ)=Tr[Λ^+]\hat{F}(\rho,\sigma)=\mathrm{Tr}\big{[}{\sqrt{\hat{\Lambda}_{+}}}\big{]}, where Λ^+\hat{\Lambda}_{+} is the projection of Λ^\hat{\Lambda} onto the positive semidefinite cone. Then,

|F(ρ,σ)F^(ρ,σ)|=|Tr[Λ]Tr[Λ^+]|2rΛΛ^1,|F(\rho,\sigma)-\hat{F}(\rho,\sigma)|=\big{|}\mathrm{Tr}\big{[}{\sqrt{\Lambda}}\big{]}-\mathrm{Tr}\big{[}{\sqrt{\hat{\Lambda}_{+}}}\big{]}\big{|}\,\leq\,\sqrt{2}r\cdot\sqrt{\left\|\Lambda-\hat{\Lambda}\right\|_{1}},

where we let r=min{rk(ρ),rk(σ)}r=\min\{\mathrm{rk}\left(\rho\right),\mathrm{rk}\left(\sigma\right)\} denote the smallest rank of the states ρ\rho and σ\sigma.

Proof.

Note that Λ(ρ,σ)=ρσρ\Lambda(\rho,\sigma)=\sqrt{\rho}\sigma\sqrt{\rho} is positive semidefinite and hermitian with rk(Λ)r\mathrm{rk}\left(\Lambda\right)\leq r. Let spec(Λ)=(λ1,,λr)\operatorname{spec}(\Lambda)=(\lambda_{1},\dots,\lambda_{r}) and spec(Λ^+)=(λ^1+,,λ^r+)\operatorname{spec}(\hat{\Lambda}_{+})=(\hat{\lambda}^{+}_{1},\dots,\hat{\lambda}^{+}_{r}) be the spectra of Λ\Lambda and Λ^+\hat{\Lambda}_{+}, respectively. Then,

|Tr[Λ]Tr[Λ^+]|\displaystyle\big{|}\mathrm{Tr}\big{[}{\sqrt{\Lambda}}\big{]}-\mathrm{Tr}\big{[}{\sqrt{\hat{\Lambda}^{+}}}\big{]}\big{|} =|i=1rλii=1rλ^i+|\displaystyle=\big{|}\sum_{i=1}^{r}\sqrt{\lambda_{i}}-\sum_{i=1}^{r}\sqrt{\hat{\lambda}^{+}_{i}}\big{|} (by definition)\displaystyle(\text{by definition})
i=1r|λiλ^i+|\displaystyle\leq\sum_{i=1}^{r}\big{|}\sqrt{\lambda_{i}}-\sqrt{\hat{\lambda}_{i}^{+}}\big{|} (triangle inequality)\displaystyle(\text{triangle inequality})
rmax1ir|λiλ^i+|\displaystyle\leq r\cdot\max_{1\leq i\leq r}\big{|}\sqrt{\lambda_{i}}-\sqrt{\hat{\lambda}_{i}^{+}}\big{|}
rΛΛ^+2\displaystyle\leq r\cdot\left\|\sqrt{\Lambda}-\sqrt{\hat{\Lambda}_{+}}\right\|_{2} ([Bha97, Problem III.6.13])\displaystyle(\text{\cite[cite]{[\@@bibref{}{bhatia1997MatrixAnalysis}{}{}, Problem III.6.13]}})
rΛΛ^+1\displaystyle\leq r\cdot\sqrt{\left\|\Lambda-\hat{\Lambda}_{+}\right\|_{1}} ([PS70, Lemma 4.1])\displaystyle(\text{\cite[cite]{[\@@bibref{}{cmp/1103842028}{}{}, Lemma 4.1]}})

Note that Λ^=Λ^++Λ^\hat{\Lambda}=\hat{\Lambda}_{+}+\hat{\Lambda}_{-}. Thus, by the triangle inequality, we obtain

ΛΛ^+1=ΛΛ^+Λ^1ΛΛ^1+Λ^1.\displaystyle\left\|\Lambda-\hat{\Lambda}_{+}\right\|_{1}=\left\|\Lambda-\hat{\Lambda}+\hat{\Lambda}_{-}\right\|_{1}\leq\left\|\Lambda-\hat{\Lambda}\right\|_{1}+\left\|\hat{\Lambda}_{-}\right\|_{1}. (31)

Let us now bound the quantity Λ^1\|\hat{\Lambda}_{-}\|_{1}. Recall from Lemma 5 that the projection Λ^+\hat{\Lambda}_{+} satisfies

Λ^+=argminX0XΛ^1.\displaystyle\hat{\Lambda}_{+}=\underset{X\succeq 0}{\mathrm{argmin}}\left\|X-\hat{\Lambda}\right\|_{1}. (32)

In other words, Eq. (32) yields the following inequality

XΛ^1Λ^+Λ^1=Λ^1,X0.\displaystyle\left\|X-\hat{\Lambda}\right\|_{1}\geq\left\|\hat{\Lambda}_{+}-\hat{\Lambda}\right\|_{1}=\left\|\hat{\Lambda}_{-}\right\|_{1},\quad\quad\forall X\succeq 0. (33)

Using the fact that Λ0\Lambda\succeq 0, Eq. (33) implies the following upper bound given by

Λ^1ΛΛ^1.\displaystyle\left\|\hat{\Lambda}_{-}\right\|_{1}\leq\left\|\Lambda-\hat{\Lambda}\right\|_{1}. (34)

Putting everything together, we can use (31) and (34) to conclude that

|F(ρ,σ)F^(ρ,σ)|\displaystyle|F(\rho,\sigma)-\hat{F}(\rho,\sigma)| =|Tr[Λ]Tr[Λ^+]|\displaystyle=\big{|}\mathrm{Tr}\big{[}{\sqrt{\Lambda}}\big{]}-\mathrm{Tr}\big{[}{\sqrt{\hat{\Lambda}_{+}}}\big{]}\big{|}
rΛΛ^+1\displaystyle\leq r\cdot\sqrt{\left\|\Lambda-\hat{\Lambda}_{+}\right\|_{1}}
=2rΛΛ^1.\displaystyle=\sqrt{2}r\cdot\sqrt{\left\|\Lambda-\hat{\Lambda}\right\|_{1}}.\quad\quad\quad

This proves the claim. ∎

4.2 Algorithm

Let us now state our second approximation algorithm for fidelity estimation via quantum spectral sampling. Recall that, in Section 2.2 and Section 2.3, we reviewed the Swap Test and Hadamard Test, respectively. We will review the quantum spectral sampling algorithm in Section 4.3 and the quantum eigenstate filtering algorithm in Section 4.4.

Finally, we also remark that the analysis of the algorithm is given in Section 4.7.

Input: Purified access to density operators ρ,σd×d\rho,\sigma\in\mathbb{C}^{d\times d} via unitaries UρU_{\rho} and UσU_{\sigma}.
Promise: ρ=i=1rk(ρ)λi|ψiψi|\rho=\sum_{i=1}^{\mathrm{rk}\left(\rho\right)}\lambda_{i}\lvert\psi_{i}\rangle\langle\psi_{i}\rvert has well-separated spectrum with gap Δ>0\Delta>0.
Parameters: ε(0,1)\varepsilon\in(0,1), δ(0,1)\delta\in(0,1), θ(0,1)\theta\in(0,1)
1 Set m12θm\leftarrow\lceil\frac{1}{2\theta}\rceil.
2 repeat 16mHmδθ2\left\lceil\frac{16\cdot mH_{m}}{\delta\cdot\theta^{2}}\right\rceil times
3       Run the subroutine Quantum_Spectral_Sampling(Uρ,γ,)(U_{\rho},\gamma,\ell) with γ=min{θ3ε2,Δ2}\gamma=\min\{\frac{\theta^{3}\varepsilon}{\sqrt{2}},\frac{\Delta}{2}\} and =log(16δθ2)+log16mHmδθ2\ell=\left\lceil\log\big{(}\frac{16}{\delta\cdot\theta^{2}}\big{)}+\log\lceil\frac{16mH_{m}}{\delta\cdot\theta^{2}}\rceil\right\rceil to generate the bipartite state
i=1rk(ρ)λi|ψiψi||λ~iλ~i|\sum_{i=1}^{\mathrm{rk}\left(\rho\right)}\lambda_{i}\,\lvert\psi_{i}\rangle\langle\psi_{i}\rvert\otimes\lvert\tilde{\lambda}_{i}\rangle\langle\tilde{\lambda}_{i}\rvert
4       Measure the second register in the computational basis to obtain a sample λ~j\tilde{\lambda}_{j}.
5       Discard λ~j\tilde{\lambda}_{j} if it is smaller than 3θ4\frac{3\theta}{4} or within distance Δ2+γ\frac{\Delta}{2}+\gamma of any previously seen sample.
6 end
7Let (λ~1,,λ~rθ)(\tilde{\lambda}_{1},\dots,\tilde{\lambda}_{r_{\theta}}) be the collected eigenvalues in decreasing order.
8 for i=1i=1 to rθr_{\theta} do
9       for j=ij=i to rθr_{\theta} do
10             if i=ji=j then
11                   Run Swap_Test(Ui|0logd,σ,ξ,ν)(U_{i}\lvert 0^{\log d}\rangle,\sigma,\xi,\nu) with ξ=ε28rθ4\xi=\frac{\varepsilon^{2}}{8r_{\theta}^{4}} and ν=δ2rθ2\nu=\frac{\delta}{2r_{\theta}^{2}} to obtain σ~iiψi|σ|ψi\tilde{\sigma}_{ii}\approx\langle\psi_{i}\rvert\sigma\lvert\psi_{i}\rangle, for the unitary Ui=Quantum_Eigenstate_Filtering(Uρ,λ~i,ε216rθ4)U_{i}=\texttt{Quantum\_Eigenstate\_Filtering}(U_{\rho},\tilde{\lambda}_{i},\frac{\varepsilon^{2}}{16r_{\theta}^{4}}) in Theorem 32
12                   Set Λ^iiθλ~iσ~ii\hat{\Lambda}_{ii}^{\theta}\leftarrow\tilde{\lambda}_{i}\tilde{\sigma}_{ii}
13                  
14            else
15                   Run Hadamard_Test(|0logd,UiUUj,ξ,ν)(\lvert 0^{\log d}\rangle,U_{i}^{\dagger}UU_{j},\xi,\nu) with parameters ξ=ε28rθ4\xi=\frac{\varepsilon^{2}}{8r_{\theta}^{4}} and ν=δ2rθ2\nu=\frac{\delta}{2r_{\theta}^{2}}, for the unitaries Uj=Quantum_Eigenstate_Filtering(Uρ,λ~j,ε216rθ4)U_{j}=\texttt{Quantum\_Eigenstate\_Filtering}(U_{\rho},\tilde{\lambda}_{j},\frac{\varepsilon^{2}}{16r_{\theta}^{4}}) and Ui=Quantum_Eigenstate_Filtering(Uρ,λ~i,ε216rθ4)U_{i}^{\dagger}=\texttt{Quantum\_Eigenstate\_Filtering}(U_{\rho},\tilde{\lambda}_{i},\frac{\varepsilon^{2}}{16r_{\theta}^{4}})^{\dagger} in Theorem 32, and where UU is a block-encoding of σ\sigma as in Lemma 7, to obtain σ~ijψi|σ|ψj\tilde{\sigma}_{ij}\approx\langle\psi_{i}\rvert\sigma\lvert\psi_{j}\rangle.
16                   Set Λ^ijθλ~iλ~jσ~ij\hat{\Lambda}^{\theta}_{ij}\leftarrow\sqrt{\tilde{\lambda}_{i}}\sqrt{\tilde{\lambda}_{j}}\,\tilde{\sigma}_{ij}
17                   Set Λ^jiθ=Λ^ijθ\hat{\Lambda}^{\theta}_{ji}=\hat{\Lambda}^{\theta^{*}}_{ij}
18             end if
19            
20       end for
21      
22 end for
Output the estimate F^(ρθ,σ)=Tr[Λ^+θ]\hat{F}(\rho_{\theta},\sigma)=\mathrm{Tr}\left[\sqrt{\hat{\Lambda}_{+}^{\theta}}\right]
Algorithm 1 Fidelity estimation via spectral sampling

4.3 Quantum spectral sampling

The following definition of the infinitesimal SWAP operation allows us to approximately implement the density matrix exponential U=e2πiρU=e^{-2\pi i\rho}, as shown by Lloyd, Mohseni and Rebentrost [LMR14] in the context of quantum principal component analysis, and later extended by Prakash [Pra14].

Definition 30 (Infinitesimal SWAP operation).

Let kk\in\mathbb{N} be a parameter and let ρ\rho be a mixed state. We define the action U(k)σU(k):=σ(k)U^{(k)}\sigma U^{(k)}{}^{\dagger}:=\sigma^{(k)} on an input state σ\sigma implicitly via the following iteration:

σ(0)=σ\displaystyle\sigma^{(0)}=\sigma
σ(n+1)=TrB[e2πiS/k(σA(n)ρB)e2πiS/k],0nk1,\displaystyle\sigma^{(n+1)}=\mathrm{Tr}_{B}\big{[}e^{-2\pi iS/k}\big{(}\sigma^{(n)}_{A}\otimes\rho_{B}\big{)}e^{2\pi iS/k}\big{]},\quad 0\leq n\leq k-1,

where SS is the SWAP operator.

Prakash [Pra14] showed that the procedure U(k)e2πiρU^{(k)}\approx e^{-2\pi i\rho} can be implemented in time O(kTρ)O(kT_{\rho}), where TρT_{\rho} is the time it takes to prepare the state ρ\rho given purified access UρU_{\rho}. In particular, the following theorem due Prakash [Pra14, Theorem 3.2.1] states that it is possible to sample from the eigenvalues of a density operator ρd×d\rho\in\mathbb{C}^{d\times d} in time O~(Tρ/γ3)\tilde{O}(T_{\rho}/\gamma^{3}) with high probability.

Theorem 31 ([Pra14]).

Let ρd×d\rho\in\mathbb{C}^{d\times d} be a density matrix, and let TρT_{\rho} denote the time it takes to prepare ρ\rho via purified access to the unitary UρU_{\rho}. Let γ(0,1)\gamma\in(0,1) and \ell\in\mathbb{N} be parameters. Then, the procedure Quantum_Spectral_Sampling(Uρ,γ,)(U_{\rho},\gamma,\ell) in Algorithm 2 runs in time O~(Tρ/γ3)\tilde{O}(\ell\cdot T_{\rho}/\gamma^{3}) and produces eigenvalue estimates λ~j\tilde{\lambda}_{j} such that |λ~jλj|γ|\tilde{\lambda}_{j}-\lambda_{j}|\leq\gamma with probability at least 121-2^{-\ell}.

Input: Purified access to ρd×d\rho\in\mathbb{C}^{d\times d} with spectral decomposition ρ=i=1rk(ρ)λi|ψiψi|\rho=\sum_{i=1}^{\mathrm{rk}\left(\rho\right)}\lambda_{i}\lvert\psi_{i}\rangle\langle\psi_{i}\rvert via UρU_{\rho}. Parameters γ(0,1)\gamma\in(0,1) and \ell\in\mathbb{N}.  
 
1
2repeat \ell times
3       Run Quantum_Phase_Estimation on ρ\rho and the simulated unitary UkU_{k} in Definition 30 with precision γ\gamma and parameter k=200log(dlog(1/γ)/γ))γ2k=\lceil\frac{200\log(d\log(1/\gamma)/\gamma))}{\gamma^{2}}\rceil
4      
5 end
Post-select the most frequently observed estimates λ~i\tilde{\lambda}_{i} to obtain the state
i=1rk(ρ)λi|ψiψi||λ~iλ~i|\sum_{i=1}^{\mathrm{rk}\left(\rho\right)}\lambda_{i}\,\lvert\psi_{i}\rangle\langle\psi_{i}\rvert\otimes\lvert\tilde{\lambda}_{i}\rangle\langle\tilde{\lambda}_{i}\rvert
Algorithm 2 Quantum_Spectral_Sampling

4.4 Quantum eigenstate filtering

The following theorem is implicit in the work of Lin and Tong [LT20, Theorem 3] and states that we can approximately prepare a given eigenstate |ψi\lvert\psi_{i}\rangle of a density operator ρ=i=1rλi|ψiψi|\rho=\sum_{i=1}^{r}\lambda_{i}\lvert\psi_{i}\rangle\langle\psi_{i}\rvert up to precision ε(0,1)\varepsilon\in(0,1) in time poly(Δ1,1/λi,log(1/ε),Tρ)\operatorname{poly}\big{(}\Delta^{-1},1/\sqrt{\lambda_{i}},\log\left(1/\varepsilon\right),T_{\rho}\big{)}, where r=rk(ρ)r=\mathrm{rk}\left(\rho\right) is the rank of ρ\rho and where TρT_{\rho} is the time it takes to prepare a purification if ρ\rho.

Theorem 32 ([LT20]).

Let ρ=i=1rλi|ψiψi|d×d\rho=\sum_{i=1}^{r}\lambda_{i}\lvert\psi_{i}\rangle\langle\psi_{i}\rvert\in\mathbb{C}^{d\times d} be a density operator with rank r=rk(ρ)r=\mathrm{rk}\left(\rho\right) and Δ\Delta-gapped spectrum spec(ρ)=(λ1,,λr)\operatorname{spec}(\rho)=(\lambda_{1},\dots,\lambda_{r}), for some Δ>0\Delta>0. Then, given purified access UρU_{\rho} to ρ\rho, one can construct a unitary quantum circuit Ui=Quantum_Eigenstate_Filtering(Uρ,λi,ε)U_{i}=\texttt{Quantum\_Eigenstate\_Filtering}(U_{\rho},\lambda_{i},\varepsilon) (and its inverse UiU_{i}^{\dagger}) with respect to an eigenvalue λi\lambda_{i} and parameter ε(0,1)\varepsilon\in(0,1) which takes as input |0logd\lvert 0^{\log d}\rangle and generates an approximate eigenstate |ψ~i\lvert\tilde{\psi}_{i}\rangle in time O(log(1ε)TρΔλi)O\left(\frac{\log\left(\frac{1}{\varepsilon}\right)T_{\rho}}{\Delta\cdot\sqrt{\lambda_{i}}}\right) such that:

|ψ~i|ψiε.\|\lvert\tilde{\psi}_{i}\rangle-\lvert\psi_{i}\rangle\|\leq\varepsilon.

4.5 Technical lemmas

Lemma 33.

Let |ψ,|ϕd\lvert\psi\rangle,\lvert\phi\rangle\in\mathbb{C}^{d} be pure states and σd×d\sigma\in\mathbb{C}^{d\times d} a density matrix, and suppose that there exist pure states |ψ~,|ϕ~d\lvert\tilde{\psi}\rangle,\lvert\tilde{\phi}\rangle\in\mathbb{C}^{d} such that |ψ~|ψε\|\lvert\tilde{\psi}\rangle-\lvert\psi\rangle\|\leq\varepsilon and |ϕ~|ϕε\|\lvert\tilde{\phi}\rangle-\lvert\phi\rangle\|\leq\varepsilon, for ε(0,1)\varepsilon\in(0,1). Then,

|ψ~|σ|ϕ~ψ|σ|ϕ|2ε.\big{|}\langle\tilde{\psi}\rvert\sigma\lvert\tilde{\phi}\rangle-\langle\psi\rvert\sigma\lvert\phi\rangle\big{|}\leq 2\varepsilon.
Proof.

Using that the states are normalized, we find that

|ψ~|σ|ϕ~ψ|σ|ϕ|\displaystyle\big{|}\langle\tilde{\psi}\rvert\sigma\lvert\tilde{\phi}\rangle-\langle\psi\rvert\sigma\lvert\phi\rangle\big{|} |ψ~|σ|ϕ~ψ~|σ|ϕ|+|ψ~|σ|ϕψ|σ|ϕ|\displaystyle\leq\big{|}\langle\tilde{\psi}\rvert\sigma\lvert\tilde{\phi}\rangle-\langle\tilde{\psi}\rvert\sigma\lvert\phi\rangle\big{|}+\big{|}\langle\tilde{\psi}\rvert\sigma\lvert\phi\rangle-\langle\psi\rvert\sigma\lvert\phi\rangle\big{|}
=|ψ~|σ(|ϕ~|ϕ)|+|(ψ~|ψ|)σ|ϕ|\displaystyle=\big{|}\langle\tilde{\psi}\rvert\sigma(\lvert\tilde{\phi}\rangle-\lvert\phi\rangle)\big{|}+\big{|}(\langle\tilde{\psi}\rvert-\langle\psi\rvert)\sigma\lvert\phi\rangle\big{|} (linearity)\displaystyle(\text{linearity})
=|ψ~|σ(|ϕ~|ϕ)|+|ϕ|σ(|ψ~|ψ)|\displaystyle=\big{|}\langle\tilde{\psi}\rvert\sigma(\lvert\tilde{\phi}\rangle-\lvert\phi\rangle)\big{|}+\big{|}\langle\phi\rvert\sigma(\lvert\tilde{\psi}\rangle-\lvert\psi\rangle)^{*}\big{|} (skew symmetry)\displaystyle(\text{skew symmetry})
ψ~σ|ϕ~|ϕ+ϕσ|ψ~|ψ\displaystyle\leq\|\tilde{\psi}\|\cdot\|\sigma\|\cdot\|\lvert\tilde{\phi}\rangle-\lvert\phi\rangle\|+\|\phi\|\cdot\|\sigma\|\cdot\|\lvert\tilde{\psi}\rangle-\lvert\psi\rangle\| (Cauchy-Schwarz)\displaystyle(\text{Cauchy-Schwarz})
2ε.\displaystyle\leq 2\varepsilon.

Lemma 34 (Estimation errors for diagonal terms).

Let ρ,σd×d\rho,\sigma\in\mathbb{C}^{d\times d} be density matrices, where ρ\rho has the spectral decomposition ρ=i=1rλi|ψiψi|\rho=\sum_{i=1}^{r}\lambda_{i}\lvert\psi_{i}\rangle\langle\psi_{i}\rvert. Suppose that, for every i[r]i\in[r], there exist estimates λ~i(0,1]\tilde{\lambda}_{i}\in(0,1] and σ~ii(0,1]\tilde{\sigma}_{ii}\in(0,1] as well as parameters γ,ξ,τ,ν(0,1)\gamma,\xi,\tau,\nu\in(0,1) such that

  • |λ~iλi|γ|\tilde{\lambda}_{i}-\lambda_{i}|\leq\gamma with probability at least 1τ1-\tau,

  • |σ~iiψi|σ|ψi|ξ|\tilde{\sigma}_{ii}-\langle\psi_{i}\rvert\sigma\lvert\psi_{i}\rangle|\leq\xi with probability at least 1ν1-\nu.

Then, for i[r]i\in[r], it holds with probability at least 1τν1-\tau-\nu:

|λ~iσ~iiλiψi|σ|ψi|γ+ξ.\big{|}\tilde{\lambda}_{i}\tilde{\sigma}_{ii}-\lambda_{i}\langle\psi_{i}\rvert\sigma\lvert\psi_{i}\rangle\big{|}\leq\gamma+\xi.
Proof.

Fix i[r]i\in[r]. By the union bound we get that with probability at least 1τν1-\tau-\nu:

|λ~iσ~iiλiψi|σ|ψi|\displaystyle\big{|}\tilde{\lambda}_{i}\tilde{\sigma}_{ii}-\lambda_{i}\langle\psi_{i}\rvert\sigma\lvert\psi_{i}\rangle\big{|} =|λ~iσ~iiλ~iψi|σ|ψi+λ~iψi|σ|ψiλiψi|σ|ψi|\displaystyle=|\tilde{\lambda}_{i}\tilde{\sigma}_{ii}-\tilde{\lambda}_{i}\langle\psi_{i}\rvert\sigma\lvert\psi_{i}\rangle+\tilde{\lambda}_{i}\langle\psi_{i}\rvert\sigma\lvert\psi_{i}\rangle-\lambda_{i}\langle\psi_{i}\rvert\sigma\lvert\psi_{i}\rangle|
λ~i|σ~iiψi|σ|ψi|+|ψi|σ|ψi||λ~iλi|\displaystyle\leq\tilde{\lambda}_{i}\cdot|\tilde{\sigma}_{ii}-\langle\psi_{i}\rvert\sigma\lvert\psi_{i}\rangle|+|\langle\psi_{i}\rvert\sigma\lvert\psi_{i}\rangle|\cdot|\tilde{\lambda}_{i}-{\lambda}_{i}| (triangle inequality)\displaystyle(\text{triangle inequality})
λ~i|σ~iiψi|σ|ψi|+ψiσ|ψi|λ~iλi|\displaystyle\leq\tilde{\lambda}_{i}\cdot|\tilde{\sigma}_{ii}-\langle\psi_{i}\rvert\sigma\lvert\psi_{i}\rangle|+\|\psi_{i}\|\cdot\|\sigma\lvert\psi_{i}\rangle\|\cdot|\tilde{\lambda}_{i}-{\lambda}_{i}| (Cauchy-Schwarz)\displaystyle(\text{Cauchy-Schwarz})
λ~i|σ~iiψi|σ|ψi|+ψiσψi|λ~iλi|\displaystyle\leq\tilde{\lambda}_{i}\cdot|\tilde{\sigma}_{ii}-\langle\psi_{i}\rvert\sigma\lvert\psi_{i}\rangle|+\|\psi_{i}\|\cdot\|\sigma\|\cdot\|\psi_{i}\|\cdot|\tilde{\lambda}_{i}-{\lambda}_{i}| (consistency of norm)\displaystyle(\text{consistency of norm})
λ~i|σ~iiψi|σ|ψi|+σ1|λ~iλi|\displaystyle\leq\tilde{\lambda}_{i}\cdot|\tilde{\sigma}_{ii}-\langle\psi_{i}\rvert\sigma\lvert\psi_{i}\rangle|+\|\sigma\|_{1}\cdot|\tilde{\lambda}_{i}-{\lambda}_{i}| (since σσ1)\displaystyle(\text{since }\|\sigma\|\leq\|\sigma\|_{1})
ε+ξ,\displaystyle\leq\varepsilon+\xi,

where in the last last we used that 0λ~i10\leq\tilde{\lambda}_{i}\leq 1, for all i[r]i\in[r], and that σ1=1\|\sigma\|_{1}=1. ∎

Lemma 35 (Estimation errors for off-diagonal terms).

Let ρ,σd×d\rho,\sigma\in\mathbb{C}^{d\times d} be density matrices, where ρ\rho has the spectral decomposition ρ=i=1rλi|ψiψi|\rho=\sum_{i=1}^{r}\lambda_{i}\lvert\psi_{i}\rangle\langle\psi_{i}\rvert. Let t(0,1)t\in(0,1) and suppose that, for every i,j[r]i,j\in[r] with i<ji<j, there exist λ~i,σ~ii(0,1]\tilde{\lambda}_{i},\tilde{\sigma}_{ii}\in(0,1] as well as parameters γ,τ,ζ,ν(0,1)\gamma,\tau,\zeta,\nu\in(0,1) such that

  • |λ~iλi|γ|\tilde{\lambda}_{i}-\lambda_{i}|\leq\gamma with probability at least 1τ1-\tau, and

  • |σ~ijψi|σ|ψj|ζ|\tilde{\sigma}_{ij}-\langle\psi_{i}\rvert\sigma\lvert\psi_{j}\rangle|\leq\zeta with probability at least 1ν1-\nu.

Then, for any fixed pair i<ji<j, it holds with probability at least 1ν2τ1-\nu-2\tau:

|λiλjψi|σ|ψiλ~iλ~jσ~ij|ζ+γ22κ2,\Big{|}\sqrt{\lambda_{i}}\sqrt{\lambda_{j}}\langle\psi_{i}\rvert\sigma\lvert\psi_{i}\rangle-\sqrt{\tilde{\lambda}_{i}}\sqrt{\tilde{\lambda}_{j}}\,\tilde{\sigma}_{ij}\Big{|}\leq\zeta+\frac{\gamma^{2}}{2\kappa^{2}},

where κ\kappa is a lower bound on the smallest eigenvalue of ρ\rho.

Proof.

Let us first bound the additive error of the estimate λ~iλ~j\sqrt{\tilde{\lambda}_{i}}\sqrt{\tilde{\lambda}_{j}}. Recall that a simple first-order Taylor expansion for f(x)=xf(x)=\sqrt{x} with additive error Δx\Delta x with respect to xx reveals that

x+Δx=x(1+12Δxx)+O(Δx2),x0.\sqrt{x+\Delta x}=\sqrt{x}\cdot\left(1+\frac{1}{2}\frac{\Delta x}{x}\right)+O(\Delta x^{2}),\quad\quad\forall x\geq 0.

Using Lagrange’s remainder theorem, we can bound the remainder as 18Δx2x2\frac{1}{8}\frac{\Delta x^{2}}{x^{2}}. Assuming that κ(0,1)\kappa\in(0,1) is a lower bound on the smallest eigenvalue of ρ\rho, we get with probability 1τ1-\tau,

|λ~iλi|γ28κ2.\displaystyle|\sqrt{\tilde{\lambda}_{i}}-\sqrt{\lambda_{i}}|\leq\frac{\gamma^{2}}{8\kappa^{2}}. (35)

Consequently, with probability at least 12τ1-2\tau, we have

|λ~iλ~jλiλj|γ24κ2+γ464κ4γ22κ2.\displaystyle|\sqrt{\tilde{\lambda}_{i}}\sqrt{\tilde{\lambda}_{j}}-\sqrt{{\lambda}_{i}}\sqrt{{\lambda}_{j}}|\leq\frac{\gamma^{2}}{4\kappa^{2}}+\frac{\gamma^{4}}{64\kappa^{4}}\leq\frac{\gamma^{2}}{2\kappa^{2}}. (36)

where we used the fact that γ(0,1)\gamma\in(0,1). Therefore, by the triangle inequality and (36), we obtain the following upper bound with probability at least 1ν2τ1-\nu-2\tau:

|λiλjψi|σ|ψiλ~iλ~jσ~ij|\displaystyle\Big{|}\sqrt{\lambda_{i}}\sqrt{\lambda_{j}}\langle\psi_{i}\rvert\sigma\lvert\psi_{i}\rangle-\sqrt{\tilde{\lambda}_{i}}\sqrt{\tilde{\lambda}_{j}}\,\tilde{\sigma}_{ij}\Big{|}
|λiλjψi|σ|ψiλiλjσ~ij|+|λiλjσ~ijλ~iλ~jσ~ij|\displaystyle\leq\Big{|}\sqrt{\lambda_{i}}\sqrt{\lambda_{j}}\langle\psi_{i}\rvert\sigma\lvert\psi_{i}\rangle-\sqrt{\lambda_{i}}\sqrt{\lambda_{j}}\,\tilde{\sigma}_{ij}\Big{|}+\Big{|}\sqrt{\lambda_{i}}\sqrt{\lambda_{j}}\,\tilde{\sigma}_{ij}-\sqrt{\tilde{\lambda}_{i}}\sqrt{\tilde{\lambda}_{j}}\,\tilde{\sigma}_{ij}\Big{|}
λiλj|ψi|σ|ψiσ~ij|+σ~ij|λ~iλ~jλiλj|\displaystyle\leq\sqrt{\lambda_{i}}\sqrt{\lambda_{j}}\cdot\big{|}\langle\psi_{i}\rvert\sigma\lvert\psi_{i}\rangle-\tilde{\sigma}_{ij}\big{|}+\tilde{\sigma}_{ij}\cdot\Big{|}\sqrt{\tilde{\lambda}_{i}}\sqrt{\tilde{\lambda}_{j}}-\sqrt{\lambda_{i}}\sqrt{\lambda_{j}}\Big{|}
ζ+γ22κ2\displaystyle\leq\zeta+\frac{\gamma^{2}}{2\kappa^{2}}

This proves the claim. ∎

4.6 Bounds for the non-uniform coupon collector problem

The non-uniform coupon collector problem was first analyzed by Flajolet et al. [FGT92] and asks the following: Given a (possibly non-uniform) probability distribution p=(p1,,pn)p=(p_{1},\dots,p_{n}) with pi>0p_{i}>0 over a set of nn coupons, where the ii-th coupon is sampled independently with probability pip_{i}, how many independent samples from pp are necessary to obtain a full collection? If pp is the uniform distribution, the problem is equivalent to the well-known (standard) coupon collector problem.

Let T(p1,,pn)T_{(p_{1},\dots,p_{n})} be a random variable for the number of samples that are necessary to obtain a complete collection of all nn coupons. Our first result is the following non-trivial upper bound on the average waiting time 𝔼[T(p1,,pn)]\mathbb{E}[T_{(p_{1},\dots,p_{n})}] with respect to the random variable T(p1,,pn)T_{(p_{1},\dots,p_{n})}.

Lemma 36.

Let p=(p1,,pn)p=(p_{1},\dots,p_{n}) be a distribution such that pi>0p_{i}>0, for all i[n]i\in[n]. Then,

𝔼[T(p1,,pn)]=0(1i=1n(1epit))dtnH(p1,,pn)1,\mathbb{E}[T_{(p_{1},\dots,p_{n})}]=\int_{0}^{\infty}\Big{(}1-\prod_{i=1}^{n}(1-e^{-p_{i}t})\Big{)}\,\mathrm{d}t\,\leq\,n\cdot H(p_{1},\dots,p_{n})^{-1},

where H(x1,,xn)=n/(i=1nxi1)H(x_{1},\dots,x_{n})=n/(\sum_{i=1}^{n}x_{i}^{-1}) is the harmonic mean.

Proof.

Using an identity due to Flajolet et al. [FGT92], we obtain

𝔼[T(p1,,pn)]\displaystyle\mathbb{E}[T_{(p_{1},\dots,p_{n})}] =0(1i=1n(1epit))dt\displaystyle=\int_{0}^{\infty}\Big{(}1-\prod_{i=1}^{n}(1-e^{-p_{i}t})\Big{)}\,\mathrm{d}t
0(i=1nepit)dt\displaystyle\leq\int_{0}^{\infty}\Big{(}\sum_{i=1}^{n}e^{-p_{i}t}\Big{)}\,\mathrm{d}t (Weierstrass product inequality)\displaystyle(\text{Weierstrass product inequality})
=i=1n0epitdt\displaystyle=\sum_{i=1}^{n}\int_{0}^{\infty}e^{-p_{i}t}\,\mathrm{d}t (switching order of summation and integration)\displaystyle(\text{switching order of summation and integration})
=i=1n[epitpi]0\displaystyle=\sum_{i=1}^{n}\left[-\frac{e^{-p_{i}t}}{p_{i}}\right]_{0}^{\infty}
=i=1npi1=nH(p1,,pn)1.\displaystyle=\sum_{i=1}^{n}p_{i}^{-1}\quad=\quad n\cdot H(p_{1},\dots,p_{n})^{-1}. (by definition)\displaystyle(\text{by definition})

We can now apply the previous lemma in the context of spectral sampling as follows. Let ρd×d\rho\in\mathbb{C}^{d\times d} be a density matrix with spectrum spec(ρ)=(λ1,,λr)\operatorname{spec}(\rho)=(\lambda_{1},\dots,\lambda_{r}). Suppose we have access to a subroutine as in (4) that allows us to sample random pairs of eigenstates and eigenvalues (|ψi,λ~i)(\lvert\psi_{i}\rangle,\tilde{\lambda}_{i}) with probability λi(0,1]\lambda_{i}\in(0,1], with the promise that each approximate eigenvalue λ~i\tilde{\lambda}_{i} is sufficiently close to λi\lambda_{i} and separated from the remaining spectrum of ρ\rho. Let 𝔼[Tspec(ρ)]\mathbb{E}[T_{\operatorname{spec}(\rho)}] denote the average number of repetitions needed to obtain a full collection of rr distinct eigenvalues.

Applying the inequality in Lemma 36 in the context of spectral sampling of a density operator ρd×d\rho\in\mathbb{C}^{d\times d}, we obtain the following upper bound which directly relates the average time to complete the collection to the spectral properties of ρ\rho.

Corollary 37.

Let ρd×d\rho\in\mathbb{C}^{d\times d} be a density matrix and let spec(ρ)=(λ1,,λr)\operatorname{spec}(\rho)=(\lambda_{1},\dots,\lambda_{r}) with r=rk(ρ)r=\mathrm{rk}\left(\rho\right). Then,

𝔼[Tspec(ρ)]=0(1i=1r(1eλit))dtrH(spec(ρ))1.\mathbb{E}[T_{\operatorname{spec}(\rho)}]=\int_{0}^{\infty}\Big{(}1-\prod_{i=1}^{r}(1-e^{-\lambda_{i}t})\Big{)}\,\mathrm{d}t\,\leq\,r\cdot H(\operatorname{spec}(\rho))^{-1}.

Unfortunately, the above result is not tight. In particular, for the uniform spectrum (1r,,1r)(\frac{1}{r},\dots,\frac{1}{r}), our bound tells us that 𝔼[T(1r,,1r)]r2\mathbb{E}[T_{(\frac{1}{r},\dots,\frac{1}{r})}]\leq r^{2}, whereas a well known result on the (standard) uniform coupon collector problem states that the average number of draws is in the order of Θ(rlogr)\Theta(r\log r).

In order to find an improved bound which asymptotically matches the standard coupon collector result, we use a coupling argument which allows us to relate an instance of the non-uniform coupon collector problem to a worst-case instance of the uniform coupon collector problem.

To this end, it is convenient to formalize the coupon collector problem with respect to the uniform distribution 𝒰([0,1])\mathcal{U}([0,1]) on the interval [0,1][0,1] as follows. Let p=(p1,,pn)p=(p_{1},\dots,p_{n}) be a (possibly non-uniform) distribution with pi>0p_{i}>0, for all i[n]i\in[n], and consider the following experiment:

  1. 1.

    Sample x𝒰([0,1])x\sim\mathcal{U}([0,1]) according to the uniform distribution over [0,1][0,1].

  2. 2.

    Assign xx to a coupon by bucketing it according to the probability distribution pp.

The problem then becomes: How many samples from 𝒰([0,1])\mathcal{U}([0,1]) are needed for a full collection? It is easy to see that the experiment is equivalent to the standard (non-uniform) coupon collector problem. 
 
As an example, consider the uniform distribution p=(1n,,1n)p=(\frac{1}{n},\dots,\frac{1}{n}). In this case, we bucket using the function f(x)=xnf(x)=\lceil x\cdot n\rceil, which means that we obtain the ii-th coupon with probability

Prx𝒰([0,1])[f(x)=i]=1n.\underset{{x\sim\mathcal{U}([0,1])}}{\mbox{Pr}}\left[f(x)=i\right]=\frac{1}{n}.

In the non-uniform case, pp implicitly defines a partition of [0,1][0,1] since i=1npi=1\sum_{i=1}^{n}p_{i}=1. We let gg define the function that maps xx to a unique coupon by bucketing it into the respective interval in [0,1][0,1].

We prove the following result.

Lemma 38 (Worst-case bound for the non-uniform coupon collector’s problem).

Let p=(p1,,pn)p=(p_{1},\dots,p_{n}) be a probability distribution with p1p2pn>0p_{1}\geq p_{2}\geq\dots\geq p_{n}>0 and let mm be the smallest integer such that pn12mp_{n}\geq\frac{1}{2m}. Then, we obtain the following upper bound to sample a full collection

𝔼[T(p1,,pn)]𝔼[T(1m,,1m)].\mathbb{E}\big{[}T_{(p_{1},\dots,p_{n})}\big{]}\leq\mathbb{E}\big{[}T_{(\frac{1}{m},\dots,\frac{1}{m})}\big{]}.
Proof.

We use a coupling argument by analyzing the two instances of the coupon collector over the probability measure 𝒰([0,1])\mathcal{U}([0,1]). By using ff and gg from before, we can see that the marginal distributions of our coupling match the original instances. In fact, the ii-th coupon is selected with probability

Prx𝒰([0,1])[g(x)=i]=pi\displaystyle\underset{{x\sim\mathcal{U}([0,1])}}{\mbox{Pr}}\left[g(x)=i\right]=p_{i} (non-uniform distribution)\displaystyle(\text{non-uniform distribution})
Prx𝒰([0,1])[f(x)=i]=1m\displaystyle\underset{{x\sim\mathcal{U}([0,1])}}{\mbox{Pr}}\left[f(x)=i\right]=\frac{1}{m} (uniform distribution)\displaystyle(\text{uniform distribution})

Therefore, our aforementioned coupling over the probability measure 𝒰([0,1])\mathcal{U}([0,1]) is well-defined. Let XtX_{t} be the event that the collection is incomplete at step t1t-1 for the distribution pp. Similarly, we define YtY_{t} to be the event that the collection is incomplete at step t1t-1 for the distribution q=(1m,,1m)q=(\frac{1}{m},\dots,\frac{1}{m}).

We now claim that XtYtX_{t}\subseteq Y_{t}, for every t1t\geq 1. In other words, if the collection is incomplete with respect to pp, then it must be also be incomplete with respect to qq. Suppose that event XtX_{t} occurs, hence there exists a coupon jj which has not been collected. Because of the coupling this means that there exists an interval Ij[0,1]I_{j}\subset[0,1] for which no xx has appeared such that xIjx\in I_{j}. Now, because mini[n]pi12m\min_{i\in[n]}p_{i}\geq\frac{1}{2m}, it follows that IjI_{j} contains at least one interval of size 1m\frac{1}{m} in the range of ff. Hence, there exists a coupon for the distribution qq which has not been collected. This proves the claim.

We can now show the following upper bound:

𝔼[T(p1,,pn)]\displaystyle\mathbb{E}\big{[}T_{(p_{1},\dots,p_{n})}\big{]} =𝔼[t=1𝕀Xt]\displaystyle=\mathbb{E}\left[\sum_{t=1}^{\infty}\mathbb{I}_{X_{t}}\right] (by definition)\displaystyle(\text{by definition})
=t=1𝔼[𝕀Xt]\displaystyle=\sum_{t=1}^{\infty}\mathbb{E}[\mathbb{I}_{X_{t}}] (linearity of expectation)\displaystyle(\text{linearity of expectation})
=t=1Pr[Xt]\displaystyle=\sum_{t=1}^{\infty}\mbox{Pr}[X_{t}]
t=1Pr[Yt]\displaystyle\leq\sum_{t=1}^{\infty}\mbox{Pr}[Y_{t}] (using that XtYt)\displaystyle(\text{using that }X_{t}\subseteq Y_{t})
=𝔼[T(1m,,1m)].\displaystyle=\mathbb{E}\big{[}T_{(\frac{1}{m},\dots,\frac{1}{m})}\big{]}.

The following corollary is a simple consequence of Lemma 38.

Corollary 39 (Worst-case bound for the thresholded non-uniform coupon collector’s problem).

Let p=(p1,,pn)p=(p_{1},\dots,p_{n}) be an arbitrary probability distribution with p1p2pn>0p_{1}\geq p_{2}\geq\dots\geq p_{n}>0 and let θ(0,1)\theta\in(0,1) be a threshold value and let m=12θm=\lceil\frac{1}{2\theta}\rceil. Let T(p1,,pn)θT_{(p_{1},\dots,p_{n})}^{\theta} be the the random variable for the number of repetitions it takes to sample all coupons which occur with probability at least θ\theta. Then,

𝔼[T(p1,,pn)θ]𝔼[T(1m,,1m)].\mathbb{E}\big{[}T_{(p_{1},\dots,p_{n})}^{\theta}\big{]}\leq\mathbb{E}\big{[}T_{(\frac{1}{m},\dots,\frac{1}{m})}\big{]}.

4.7 Analysis of the Algorithm

Let us now analyze our spectral sampling-based algorithm for (truncated) fidelity estimation.

Theorem 40.

Let ρ,σd×d\rho,\sigma\in\mathbb{C}^{d\times d} be arbitrary density matrices, and suppose that ρ\rho has a well-separated spectrum with a gap Δ>0\Delta>0. Suppose also that ρ\rho has the smallest rank of the two states. Let ε(0,1)\varepsilon\in(0,1), δ(0,1)\delta\in(0,1), θ(0,1)\theta\in(0,1) be parameters. Then, Algorithm 1 runs in time

O~(Tρ+Tσθ10.5ε4Δ+Tρδθ3γ3)\tilde{O}\left(\frac{T_{\rho}+T_{\sigma}}{\theta^{10.5}\varepsilon^{4}\Delta}+\frac{T_{\rho}}{\delta\theta^{3}\gamma^{3}}\right)

where γ=min{θ3ε2,Δ2}\gamma=\min\{\frac{\theta^{3}\varepsilon}{\sqrt{2}},\frac{\Delta}{2}\} and outputs an estimate F^(ρθ,σ)\hat{F}(\rho_{\theta},\sigma) such that with probability 1δ1-\delta:

|F(ρθ,σ)F^(ρθ,σ)|ε,|F(\rho_{\theta},\sigma)-\hat{F}(\rho_{\theta},\sigma)|\leq\varepsilon,

where ρθ\rho_{\theta} is a “soft-thresholded” version of ρ\rho in which eigenvalues of ρ\rho below θ/2\theta/2 are completely removed and those above θ\theta are kept intact, while eigenvalues in [θ/2,θ][\theta/2,\theta] are decreased by some amount.

Proof.

Let ε(0,1)\varepsilon\in(0,1) and δ(0,1)\delta\in(0,1) be parameters, and let θ(0,1)\theta\in(0,1) be the truncation parameter. Let spec(ρ)=(λ1,,λrk(ρ))\operatorname{spec}(\rho)=(\lambda_{1},\dots,\lambda_{\mathrm{rk}\left(\rho\right)}) be the eigenvalue spectrum of ρd×d\rho\in\mathbb{C}^{d\times d} and let rkθ\mathrm{rk}_{\theta} be the number of eigenvalues in the interval (θ,1](\theta,1]. Let m=12θm=\lceil\frac{1}{2\theta}\rceil be a parameter and note that rkθ1θ\mathrm{rk}_{\theta}\leq\frac{1}{\theta}.

We show that it suffices to run Quantum_Spectral_Sampling(Uρ,γ,)(U_{\rho},\gamma,\ell) at most M=16mHmδθ2M=\lceil\frac{16mH_{m}}{\delta\cdot\theta^{2}}\rceil times with parameters γ=min{θ3ε2,Δ2}\gamma=\min\{\frac{\theta^{3}\varepsilon}{\sqrt{2}},\frac{\Delta}{2}\} and =log(16δθ2)+logM\ell=\lceil\log\big{(}\frac{16}{\delta\cdot\theta^{2}}\big{)}+\log M\rceil to find rθrkθr_{\theta}\geq\mathrm{rk}_{\theta} accurate estimates λ~i3θ4\tilde{\lambda}_{i}\geq\frac{3\theta}{4} of distinct eigenvalues λi[θ2,1]\lambda_{i}\in[\frac{\theta}{2},1], including the complete set of eigenvalues in the interval (θ,1](\theta,1], with probability at least 1δθ281-\frac{\delta\cdot\theta^{2}}{8}. Let us now analyze the procedure in more detail.

In each iteration of Quantum_Spectral_Sampling(Uρ,γ,)(U_{\rho},\gamma,\ell), we obtain an eigenvalue estimate λ~i\tilde{\lambda}_{i} such that |λ~iλi|γ|\tilde{\lambda}_{i}-\lambda_{i}|\leq\gamma with probability 12l1-2^{-l}. Hence, by the union bound, all MM trials will produce accurate estimates with probability at least 1δθ2161-\frac{\delta\cdot\theta^{2}}{16}. Moreover, by our choice of parameters, each eigenvalue estimate λ~i\tilde{\lambda}_{i} falls within distance γ<Δ2\gamma<\frac{\Delta}{2} of the eigenvalue λi\lambda_{i}, enabling Algorithm 1 to uniquely identify each sample. Note also that, since γ<θ4\gamma<\frac{\theta}{4}, Algorithm 1 never accepts any eigenvalue estimates λ~i3θ4\tilde{\lambda}_{i}\geq\frac{3\theta}{4} that correspond to eigenvalues λi\lambda_{i} in the interval (0,θ2)(0,\frac{\theta}{2}), thus implying that rθ2θr_{\theta}\leq\frac{2}{\theta}.

Let us now bound the probability of error, i.e. the probability of not finding a complete set of at least rkθ\mathrm{rk}_{\theta} distinct samples, including all eigenvalues in (θ,1](\theta,1], after MM trials. Let T(λ1,,λrk(ρ))θT_{(\lambda_{1},\dots,\lambda_{\mathrm{rk}(\rho)})}^{\theta} be a random variable for the number of samples needed to obtain such a collection. By Markov’s inequality,

Pr[T(λ1,,λrk(ρ))θ16mHmδθ2]δθ216mHm𝔼[T(λ1,,λrk(ρ))θ].\displaystyle\mbox{Pr}\left[T_{(\lambda_{1},\dots,\lambda_{\mathrm{rk}(\rho)})}^{\theta}\geq\frac{16mH_{m}}{\delta\cdot\theta^{2}}\right]\leq\frac{\delta\cdot\theta^{2}}{16mH_{m}}\mathbb{E}[T_{(\lambda_{1},\dots,\lambda_{\mathrm{rk}(\rho)})}^{\theta}]. (37)

Let T(1m,,1m)T_{(\frac{1}{m},\dots,\frac{1}{m})} denote the number of repetitions needed to draw mm distinct coupons in the uniform coupon collector problem, where m=12θm=\lceil\frac{1}{2\theta}\rceil. From Corollary 39 it follows that

𝔼[T(λ1,,λrk(ρ))θ]𝔼[T(1m,,1m)]=mHm,\mathbb{E}[T_{(\lambda_{1},\dots,\lambda_{\mathrm{rk}(\rho)})}^{\theta}]\,\leq\,\mathbb{E}[T_{(\frac{1}{m},\dots,\frac{1}{m})}]=m\cdot H_{m},

where HmH_{m} is the mm-th harmonic number and mHm=Θ(mlogm)m\cdot H_{m}=\Theta(m\log m). Hence, the probability in (37) is at most δθ216\frac{\delta\cdot\theta^{2}}{16}, as required. Therefore, by the union bound, the quantum spectral sampling procedure of Algorithm 1 succeeds at collecting rθrkθr_{\theta}\geq\mathrm{rk}_{\theta} both distinct and accurate eigenvalue estimates after

M=16mHmδθ2=Θ(log(θ1)δθ3)M=\left\lceil\frac{16\cdot mH_{m}}{\delta\cdot\theta^{2}}\right\rceil=\Theta\left(\frac{\log\big{(}\theta^{-1}\big{)}}{\delta\cdot\theta^{3}}\right)

repetitions of Quantum_Spectral_Sampling(Uρ,γ,)(U_{\rho},\gamma,\ell) with probability at least 1δθ281-\frac{\delta\cdot\theta^{2}}{8}. Because r02θr_{0}\leq\frac{2}{\theta}, this in turn implies that the spectral sampling procedure succeeds with probability at least 1δ2r021-\frac{\delta}{2r_{0}^{2}}.

Recall that Λ(ρ,σ)=ρσρd×d\Lambda(\rho,\sigma)=\sqrt{\rho}\sigma\sqrt{\rho}\in\mathbb{C}^{d\times d} has the following non-trivial entries in the eigenbasis of ρ\rho:

Λij=λiλjψi|σ|ψj,i,j{1,,rk(ρ)}.\displaystyle\Lambda_{ij}=\sqrt{\lambda_{i}}\sqrt{\lambda_{j}}\langle\psi_{i}\rvert\sigma\lvert\psi_{j}\rangle,\quad\quad\forall i,j\in\{1,\dots,\mathrm{rk}\left(\rho\right)\}.

We show that Algorithm 1 obtains an estimate Λ^θ\hat{\Lambda}^{\theta} of a matrix Λθ=Λ(ρθ,σ)\Lambda^{\theta}=\Lambda(\rho_{\theta},\sigma), where ρθ\rho_{\theta} is a soft truncation of ρ\rho in which eigenvalues of ρ\rho below θ/2\theta/2 are completely removed and those above θ\theta are kept intact, while eigenvalues in [θ/2,θ][\theta/2,\theta] are potentially incomplete or decreased by some amount.

Let us now consider the estimates for the diagonal entries of the matrix Λθ\Lambda^{\theta} (lines 1111 and 1212). Let i[rθ]i\in[r_{\theta}] be an index. To estimate Λiiθ\Lambda_{ii}^{\theta}, we first run Swap_Test(Ui|0logd,σ,ξ,ν)(U_{i}\lvert 0^{\log d}\rangle,\sigma,\xi,\nu) with parameters ξ=ε28rθ4\xi=\frac{\varepsilon^{2}}{8r_{\theta}^{4}} and ν=δ2rθ2\nu=\frac{\delta}{2r_{\theta}^{2}} to obtain an estimate σ~ii\tilde{\sigma}_{ii} such that |σ~iiψi|σ|ψi|ξ|\tilde{\sigma}_{ii}-\langle\psi_{i}\rvert\sigma\lvert\psi_{i}\rangle|\leq\xi with probability at least 1ν1-\nu (by Lemma 33), where Ui=Quantum_Eigenstate_Filtering(Uρ,λ~i,ε216rθ4)U_{i}=\texttt{Quantum\_Eigenstate\_Filtering}(U_{\rho},\tilde{\lambda}_{i},\frac{\varepsilon^{2}}{16r_{\theta}^{4}}) is the unitary in Theorem 32. Letting Λ^iiθλ~iσ~ii\hat{\Lambda}_{ii}^{\theta}\leftarrow\tilde{\lambda}_{i}\tilde{\sigma}_{ii}, it then follows from Lemma 34 that for every index i[rθ]i\in[r_{\theta}],

Pr[|ΛiiθΛ^iiθ|ε22rθ4]1δrθ2.\displaystyle\mbox{Pr}\left[\Big{|}{\Lambda}_{ii}^{\theta}-\hat{\Lambda}_{ii}^{\theta}\Big{|}\leq\frac{\varepsilon^{2}}{2r_{\theta}^{4}}\right]\geq 1-\frac{\delta}{r_{\theta}^{2}}. (38)

Let us now consider the estimates for the off-diagonal entries of the matrix Λθ\Lambda^{\theta} (lines 1414 to 1616). Let i,j[rθ]i,j\in[r_{\theta}] be a pair of indices with i<ji<j. We run Hadamard_Test(|0logd,UiUUj,ξ,ν)(\lvert 0^{\log d}\rangle,U_{i}^{\dagger}UU_{j},\xi,\nu) with parameters ξ=ε28rθ4\xi=\frac{\varepsilon^{2}}{8r_{\theta}^{4}} and ν=δ2rθ2\nu=\frac{\delta}{2r_{\theta}^{2}} to obtain an estimate σ~ij\tilde{\sigma}_{ij}, where Uj=Quantum_Eigenstate_Filtering(Uρ,λ~j,ε216rθ4)U_{j}=\texttt{Quantum\_Eigenstate\_Filtering}(U_{\rho},\tilde{\lambda}_{j},\frac{\varepsilon^{2}}{16r_{\theta}^{4}}) and Ui=Quantum_Eigenstate_Filtering(Uρ,λ~i,ε216rθ4)U_{i}^{\dagger}=\texttt{Quantum\_Eigenstate\_Filtering}(U_{\rho},\tilde{\lambda}_{i},\frac{\varepsilon^{2}}{16r_{\theta}^{4}})^{\dagger} are unitary as in Theorem 32, and where UU is a block-encoding of σ\sigma as in Lemma 7. Letting Λ^ijθλ~iλ~jσ~ij\hat{\Lambda}_{ij}^{\theta}\leftarrow\sqrt{\tilde{\lambda}_{i}}\sqrt{\tilde{\lambda}_{j}}\,\tilde{\sigma}_{ij} and Λ^jiθ=Λ^ijθ\hat{\Lambda}^{\theta}_{ji}=\hat{\Lambda}^{\theta^{*}}_{ij} for iji\neq j, we then have by Lemma 35 that

Pr[|ΛijθΛ^ijθ|ε22rθ4]1δrθ2.\mbox{Pr}\left[\Big{|}{\Lambda}_{ij}^{\theta}-\hat{\Lambda}_{ij}^{\theta}\Big{|}\leq\frac{\varepsilon^{2}}{2r_{\theta}^{4}}\right]\geq 1-\frac{\delta}{r_{\theta}^{2}}.

Given our choice of parameters ε\varepsilon and δ\delta, we have that for every fixed i,j[rθ]i,j\in[r_{\theta}]:

Pr[|ΛijθΛ^ijθ|>ε22rθ4]δrθ2.\mbox{Pr}\left[\Big{|}{\Lambda}_{ij}^{\theta}-\hat{\Lambda}_{ij}^{\theta}\Big{|}>\frac{\varepsilon^{2}}{2r_{\theta}^{4}}\right]\leq\frac{\delta}{r_{\theta}^{2}}.

Using the continuity bound for fidelity estimation (Theorem 29), we obtain

|F(ρθ,σ)F^(ρθ,σ)|\displaystyle|F(\rho_{\theta},\sigma)-\hat{F}(\rho_{\theta},\sigma)| =|Tr[Λθ]Tr[Λ^+θ]|\displaystyle=\big{|}\mathrm{Tr}\big{[}{\sqrt{\Lambda^{\theta}}}\big{]}-\mathrm{Tr}\big{[}{\sqrt{\hat{\Lambda}_{+}^{\theta}}}\big{]}\big{|} (39)
2rθΛθΛ^θ1\displaystyle\leq\sqrt{2}r_{\theta}\cdot\sqrt{\|\Lambda^{\theta}-\hat{\Lambda}^{\theta}\|_{1}}
2rθ2ΛθΛ^θmax\displaystyle\leq\sqrt{2}r_{\theta}^{2}\cdot\sqrt{\|\Lambda^{\theta}-\hat{\Lambda}^{\theta}\|_{\max}}
=2rθ2max1i,jrθ|ΛijθΛ^ijθ|.\displaystyle=\sqrt{2}r_{\theta}^{2}\cdot\sqrt{\max_{1\leq i,j\leq r_{\theta}}|\Lambda_{ij}^{\theta}-\hat{\Lambda}_{ij}^{\theta}|}. (40)

Putting everything together and using the inequality in (40), we find that

Pr[|F(ρθ,σ)F^(ρθ,σ)|ε]\displaystyle\mbox{Pr}\Big{[}|F(\rho_{\theta},\sigma)-\hat{F}(\rho_{\theta},\sigma)|\leq\varepsilon\Big{]} =Pr[|Tr[Λθ]Tr[Λ^+θ]|ε]\displaystyle=\mbox{Pr}\Big{[}\big{|}\mathrm{Tr}\big{[}{\sqrt{\Lambda^{\theta}}}\big{]}-\mathrm{Tr}\big{[}{\sqrt{\hat{\Lambda}_{+}^{\theta}}}\big{]}\big{|}\leq\varepsilon\Big{]} (by definition)\displaystyle(\text{by definition})
Pr[max1i,jrθ|ΛijθΛ^ijθ|ε22rθ4]\displaystyle\geq\mbox{Pr}\left[\max_{1\leq i,j\leq r_{\theta}}\,\Big{|}\Lambda_{ij}^{\theta}-\hat{\Lambda}_{ij}^{\theta}\Big{|}\leq\frac{\varepsilon^{2}}{2r_{\theta}^{4}}\right]
Pr[i,j:|ΛijθΛ^ijθ|ε22rθ4]\displaystyle\geq\mbox{Pr}\left[\forall i,\forall j\,:\,\Big{|}\Lambda_{ij}^{\theta}-\hat{\Lambda}_{ij}^{\theta}\Big{|}\leq\frac{\varepsilon^{2}}{2r_{\theta}^{4}}\right]
1i=1rθj=1rθPr[|ΛijθΛ^ijθ|>ε22rθ4]\displaystyle\geq 1-\sum_{i=1}^{r_{\theta}}\sum_{j=1}^{r_{\theta}}\mbox{Pr}\left[\Big{|}\Lambda_{ij}^{\theta}-\hat{\Lambda}_{ij}^{\theta}\Big{|}>\frac{\varepsilon^{2}}{2r_{\theta}^{4}}\right] (union bound)\displaystyle(\text{union bound})
1rθ2δ/rθ2=1δ.\displaystyle\geq 1-r_{\theta}^{2}\cdot\delta/r_{\theta}^{2}\quad=\quad 1-\delta.

This proves the claim. ∎

Finally, we obtain the following result.

Theorem 41.

Let ρ,σd×d\rho,\sigma\in\mathbb{C}^{d\times d} be arbitrary density matrices, and suppose that ρ\rho has a well-separated spectrum with a gap Δ>0\Delta>0 and that ρ\rho has the smallest rank with rk(ρ)r\mathrm{rk}\left(\rho\right)\leq r. Let ε(0,1)\varepsilon\in(0,1) and δ(0,1)\delta\in(0,1), and fix θ=ε24r\theta=\frac{\varepsilon^{2}}{4r}. Then, Algorithm 1 with parameters ε=ε2\varepsilon^{\prime}=\frac{\varepsilon}{2}, δ\delta and θ\theta runs in time

O~(r10.5ε25Δ(Tρ+Tσ)+r3Tρδmin{ε7r3,Δ}3)\tilde{O}\left(\frac{r^{10.5}}{\varepsilon^{25}\Delta}\cdot\big{(}T_{\rho}+T_{\sigma}\big{)}+\frac{r^{3}T_{\rho}}{\delta\min\{\frac{\varepsilon^{7}}{r^{3}},\Delta\}^{3}}\right)

and outputs an estimate F^(ρθ,σ)\hat{F}(\rho_{\theta},\sigma) such that with probability 1δ1-\delta:

|F(ρ,σ)F^(ρθ,σ)|ε.|F(\rho,\sigma)-\hat{F}(\rho_{\theta},\sigma)|\leq\varepsilon.
Proof.

Given the set of parameters ε=ε2(0,1)\varepsilon^{\prime}=\frac{\varepsilon}{2}\in(0,1), δ(0,1)\delta\in(0,1) and θ=ε24r\theta=\frac{\varepsilon^{2}}{4r}, it follows from Theorem 40 that Algorithm 1 outputs an estimate F^(ρθ,σ)\hat{F}(\rho_{\theta},\sigma) such that with probability 1δ1-\delta:

|F(ρθ,σ)F^(ρθ,σ)|ε2,|F(\rho_{\theta},\sigma)-\hat{F}(\rho_{\theta},\sigma)|\leq\frac{\varepsilon}{2},

where ρθ\rho_{\theta} is a “soft-thresholded” version of ρ\rho in which eigenvalues of ρ\rho below θ/2\theta/2 are completely removed and those above θ\theta are kept intact, while eigenvalues in [θ/2,θ][\theta/2,\theta] are decreased by some amount. Therefore, using the soft truncation bound from Corollary 24, we get that with probability 1δ1-\delta:

|F(ρ,σ)F^(ρθ,σ)|\displaystyle|F(\rho,\sigma)-\hat{F}(\rho_{\theta},\sigma)| |F(ρ,σ)F(ρθ,σ)|+|F(ρθ,σ)F^(ρθ,σ)|\displaystyle\leq|F(\rho,\sigma)-F(\rho_{\theta},\sigma)|+|F(\rho_{\theta},\sigma)-\hat{F}(\rho_{\theta},\sigma)|
Tr[Π[0,θ)ρΠ[0,θ)]+|F(ρθ,σ)F^(ρθ,σ)|\displaystyle\leq\sqrt{\mbox{Tr}\left[\Pi_{[0,\theta)}\rho\Pi_{[0,\theta)}\right]}+|F(\rho_{\theta},\sigma)-\hat{F}(\rho_{\theta},\sigma)|
rθ+|F(ρθ,σ)F^(ρθ,σ)|\displaystyle\leq\sqrt{r\cdot\theta}+|F(\rho_{\theta},\sigma)-\hat{F}(\rho_{\theta},\sigma)|
ε2+ε2\displaystyle\leq\frac{\varepsilon}{2}+\frac{\varepsilon}{2}
=ε.\displaystyle=\varepsilon.

This proves the claim. ∎

5 Discussion

We give an efficient and versatile algorithm for (truncated) fidelity estimation. Our algorithm demonstrates the potential of block-encoding and quantum singular value transformation techniques for quantum information processing tasks. We also demonstrate and work out the specifics of a generic method suggested by [GLM+20] for utilizing these techniques in the scenario when one only has access to copies of the states. This method might be of independent interest.

Our alternative spectral-sampling-based algorithm for fidelity estimation performs significantly worse in general compared to our block-encoding algorithm, however it may be easier to implement in certain settings, e.g., when it is easy to obtain circuits that prepare the eigenstates of one of the density operators. For example, consider the problem of exactly simulating the one-dimensional Ising chain [CL18]. There, it is possible to efficiently prepare all eigenstates of the Ising Hamiltonian without relying on quantum eigenstate filtering.

Acknowledgements

A.P. would like to thank Ronald de Wolf and Thomas Vidick for many useful suggestions that helped improve the spectral sampling algorithm.

Part of this work was done while the authors visited the Simons Institute for the Theory of Computing; we gratefully acknowledge its hospitality.

References