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

Experimental Hybrid Shadow Tomography and Distillation

Xu-Jie Peng These authors contributed equally to this work. School of Physics, State Key Laboratory of Crystal Materials, Shandong University, Jinan 250100, China    Qing Liu These authors contributed equally to this work. Key Laboratory for Information Science of Electromagnetic Waves (Ministry of Education), Fudan University, Shanghai 200433, China    Lu Liu These authors contributed equally to this work. School of Physics, State Key Laboratory of Crystal Materials, Shandong University, Jinan 250100, China    Ting Zhang School of Physics, State Key Laboratory of Crystal Materials, Shandong University, Jinan 250100, China    You Zhou [email protected] Key Laboratory for Information Science of Electromagnetic Waves (Ministry of Education), Fudan University, Shanghai 200433, China Hefei National Laboratory, Hefei 230088, China    He Lu [email protected] School of Physics, State Key Laboratory of Crystal Materials, Shandong University, Jinan 250100, China Shenzhen Research Institute of Shandong University, Shenzhen 518057, China
Abstract

Characterization of quantum states is a fundamental requirement in quantum science and technology. As a promising framework, shadow tomography shows significant efficiency in estimating linear functions, however, for the challenging nonlinear ones, it requires measurements at an exponential cost. Here, we implement an advanced shadow protocol, so-called hybrid shadow (HS) tomography, to reduce the measurement cost in the estimation of nonlinear functions in an optical system. We design and realize a deterministic quantum Fredkin gate with single photon, achieving high process fidelity of 0.935±0.0010.935\pm 0.001. Utilizing this novel Fredkin gate, we demonstrate HS in the estimations, like the higher-order moments up to 4, and reveal that the sample complexity of HS is significantly reduced compared with the original shadow protocol. Furthermore, we utilize these higher-degree functions to implement virtual distillation, which effectively extracts a high-purity quantum state from two noisy copies. The virtual distillation is also verified in a proof-of-principle demonstration of quantum metrology, further enhancing the accuracy of parameter estimation. Our results suggest that HS is efficient in state characterization and promising for quantum technologies.

Introduction.—Estimating properties of quantum systems is a both fundamental and practical issue for quantum science and technology [1, 2, 3], where shadow tomography is a recently developed general framework for such important tasks [4, 5, 6]. By post-processing the projective measurement results of underlying state ρ\rho on random bases, one can sequentially construct independent shadow snapshots, i.e., the unbiased estimator ρ^\hat{\rho} [5]. Shadow tomography shows promising measurement efficiency of simultaneously estimating many linear functions, such as local observables  [7, 8, 9] and quantum fidelities [10, 11], which lead to a few realizations [12, 13, 14, 15, 16]. On the other hand, the estimation of nonlinear functions is more challenging. Besides many important applications from quantum information processing [17, 18, 19, 20] to many-body physics [21, 22, 23], nonlinear functions, such as the purity and higher-order moment PL=Tr(ρL)P_{L}=\text{Tr}(\rho^{L}), are the key ingredient in virtual distillation (VD) [24, 25, 26, 27], playing a crucial role in error mitigation of noisy quantum processors [28, 29, 30]. However, the capability of the original shadow (OS) protocol for such nonlinear functions is inevitably limited by the exponentially-increasing sampling number regarding to the system size and the heavy cost of post-processing [17, 18].

A hybrid shadow (HS) tomography [31] has been proposed aiming to enhance the efficiency for estimating nonlinear functions, which combines the advantages of shadow estimation and the generalized SWAP test [32, 33]. HS can effectively conduct randomized measurements on ρk\rho^{k} by introducing a coherent controlled-(generalized) SWAP operation on kk-copy ρk\rho^{\otimes k}, and therefore construct the estimator ρk^\widehat{\rho^{k}}. In this way, HS is capable of estimating higher-degree functions by patching lower-degree estimator ρk^\widehat{\rho^{k}} via post-processing, which can significantly reduce the sampling and post-processing costs [31]. The theoretical and numerical findings there depend on the ideal multi-qubit coherent operation, and thus it remains an open question whether HS holds its effectiveness and superiority in real quantum platforms.

In this work, we give this question a positive answer by realizing HS in an optical system. We design and implement a novel quantum Fredkin gate with single photon, which is able to deterministically apply controlled-SWAP operation on two single-qubit states with high fidelity. Inspired by this novel Fredkin gate, we implement HS and show the efficiency of HS in estimation of higher-degree functions, i.e., the moment functions PLP_{L} with L={2,3,4}L=\{2,3,4\}. We demonstrate that the measurement budget and sample complexity are significantly reduced in HS compared to OS. Moreover, we showcase the usefulness of HS in VD and error-mitigated quantum metrology.

Refer to caption
Figure 1: The scheme of (a) original shadow tomography, (b) hybrid shadow tomography, and (c) error-mitigated quantum metrology within the hybrid framework.

Framework.— We start by briefly reviewing the OS in estimating various properties of an quantum state ρ\rho\in\mathcal{H} [5]. As shown in Fig. 1(a), one can obtain the outcome 𝒃\bm{b} by applying a random unitary operation sampled from some ensemble 𝑼𝒰\bm{U}\in\mathcal{U} followed with measurements on the computational basis. With the information of 𝑼\bm{U} and 𝒃\bm{b}, the classical shadow is constructed as

ρ^=1(𝑼|𝒃𝒃|𝑼),\hat{\rho}=\mathcal{M}^{-1}\left(\bm{U}^{\dagger}\ket{\bm{b}}\bra{\bm{b}}\bm{U}\right), (1)

which is an unbiased estimator, i.e., 𝔼{𝑼,𝒃}ρ^=ρ\mathbb{E}_{\{\bm{U},\bm{b}\}}\hat{\rho}=\rho. Here the classical inverse 1\mathcal{M}^{-1} is determined by the chosen random ensemble 𝒰\mathcal{U} [5, 34, 35].

For a (linear) observable OO, OS provides an unbiased estimation of O=Tr(Oρ)\langle O\rangle=\text{Tr}(O\rho) via o^=Tr(Oρ^)\hat{o}=\text{Tr}(O\hat{\rho}). Meanwhile, OS is capable of estimating nonlinear functions, such as the higher-order moment PLP_{L}, and the corresponding unbiased estimator shows

pL^(OS)=Tr[𝕊Lρ^(1)ρ^(2)ρ^(L)]=Tr[j=1Lρ^(j)],\widehat{p_{L}}_{(\text{OS})}=\text{Tr}\left[\mathbb{S}_{L}\hat{\rho}_{(1)}\otimes\hat{\rho}_{(2)}\otimes\cdots\otimes\hat{\rho}_{(L)}\right]=\text{Tr}\left[\prod_{j=1}^{L}\hat{\rho}_{(j)}\right], (2)

where 𝕊L\mathbb{S}_{L} denotes the generalized SWAP operation, i.e., the SHIFT operation on L\mathcal{H}^{\otimes L}. Here, ρ^(j)\hat{\rho}_{(j)} are distinct shadow snapshots. Meanwhile, one can construct the estimator for Tr(OρL)\text{Tr}(O\rho^{L}) as oL^(OS)=Tr[Oj=1Lρ^(j)]\widehat{o_{L}}_{(\text{OS})}=\text{Tr}\left[O\prod_{j=1}^{L}\hat{\rho}_{(j)}\right]. One would enhance the estimation accuracy by repeating the experiment for MM times to collect the shadow set {ρ^(i)}i=1M\{\hat{\rho}_{(i)}\}_{i=1}^{M}. However, the exponentially increased number of measurements with the qubit number, along with the cost for classical post-processing retards efficiency of OS in estimation of nonlinear functions [5, 17].

HS [31] advances OS on estimating nonlinear functions. As shown in Fig. 1(b), a controlled-𝕊k\mathbb{S}_{k} gate is applied on ρk\rho^{\otimes k} with the control qubit initialized as |+\ket{+}, and in general k<Lk<L. The measurement outcome of the control qubit in the X-basis is denoted as bc{b_{c}}, and one implements OS on one copy of ρ\rho with measurement outcome 𝒃\bm{b}. For each single-shot experimental run, one can construct the estimator of ρk\rho^{k} as

ρk^=(1)bc1(𝑼|𝒃𝒃|𝑼),\widehat{\rho^{k}}=(-1)^{{b_{c}}}\cdot\mathcal{M}^{-1}\left(\bm{U}^{\dagger}\ket{\bm{b}}\bra{\bm{b}}\bm{U}\right), (3)

such that 𝔼{U,𝒃,bc}ρk^=ρk\mathbb{E}_{\{U,\bm{b},b_{c}\}}\widehat{\rho^{k}}=\rho^{k}, and similarly one can collect the set {ρk^(i)}i=1M\{\widehat{\rho^{k}}_{(i)}\}_{i=1}^{M}. Interestingly, by ignoring the information of bcb_{c} in the hybrid setting, one can also get the classical shadow of ρ\rho with 𝑼\bm{U} and 𝒃\bm{b} via Eq. (1). (See Supplementary Materials for a detailed illustration.)

In this way, one can build estimators for many nonlinear properties. For example, Tr(Oρk)\text{Tr}(O\rho^{k}) can be directly estimated with ok^=Tr(Oρk^)\widehat{o_{k}}=\text{Tr}(O\widehat{\rho^{k}}). Furthermore, more complex nonlinear functions with a higher degree can be estimated by combining low-degree shadow snapshots. Specifically, the unbiased estimator of PLP_{L} shows

pL^(HS)\displaystyle\widehat{p_{L}}_{(\text{HS})} =Tr[𝕊q+rρk^(1)ρk^(q)ρ^(1)ρ^(r)]\displaystyle=\text{Tr}\left[\mathbb{S}_{q+r}\widehat{\rho^{k}}_{(1)}\otimes\cdots\widehat{\rho^{k}}_{(q)}\otimes\widehat{\rho}_{(1)}\otimes\cdots\otimes\hat{\rho}_{(r)}\right] (4)
=Tr[j=1qρk^(j)j=1rρ^(j)],\displaystyle=\text{Tr}\left[\prod_{j=1}^{q}\widehat{\rho^{k}}_{(j)}\prod_{j^{\prime}=1}^{r}\hat{\rho}_{(j^{\prime})}\right],

where r=L(modk)r=L\ (\text{mod}\ k) with L=qk+rL=qk+r, ρk^(j)\widehat{\rho^{k}}_{(j)} and ρ^(j)\hat{\rho}_{(j^{\prime})} are distinct snapshots. Similarly, one can construct the corresponding estimator for Tr(OρL)\text{Tr}(O\rho^{L}) as oL^(HS)=Tr[Oj=1qρk^(j)j=1rρ^(j)]\widehat{o_{L}}_{(\text{HS})}=\text{Tr}\left[O\prod_{j=1}^{q}\widehat{\rho^{k}}_{(j)}\prod_{j^{\prime}=1}^{r}\hat{\rho}_{(j^{\prime})}\right]. Compared to the one by OS in Eq. (2), HS requires q+rq+r snapshots while OS requires LL ones, thus the classical post-processing cost for HS is significantly reduced. Moreover, as the estimator of HS effectively transfers an LL-degree nonlinear function to a (q+r)(q+r)-degree one, the statistical variance can also be reduced, thus saving the sample number of ρ\rho in practise.

Refer to caption
Figure 2: Schematic illustration of the experimental setup. (a) Generation of three-qubit input state |c|t1|t2\ket{c}\ket{t_{1}}\ket{t_{2}}, where |c\ket{c}, |t1\ket{t_{1}} and |t2\ket{t_{2}} are the states of control qubit, the first and the second target qubit respectively. (b) The optical network to implement Fredkin gate. (c) The travel path of four components |00\ket{00}, |01\ket{01}, |11\ket{11} and |10\ket{10} conditioned on |H\ket{H} (dashed line) and |V\ket{V} (solid line) respectively. (d) The setup to implement projective measurement on three qubits. (e) Symbols used in (a), (b), (c) and (d). PPKTP: periodically poled potassium titanyl phosphate; BD\uparrow: beam displacer that transmits |V\ket{V} and upward deviates |H\ket{H}; BD\downarrow: beam displacer that transmits |V\ket{V} and downward deviates |H\ket{H}; PBS: polarizing beam splitter that transmits |H\ket{H} and reflects |V\ket{V}; HWP: half-wave plate; QWP: quarter-wave plate.

Apart from many applications [36, 37, 38], nonlinear functions are vital in purification-based quantum error mitigation, say VD [24, 25, 27]. VD enables to approach the noiseless value of the observable OO over noisy state ρ\rho by OVD(L)=Tr(OρL)/Tr(ρL)\langle O\rangle^{(L)}_{\text{VD}}=\text{Tr}\left(O\rho^{L}\right)/\text{Tr}\left(\rho^{L}\right), which is more accurate than the noisy value Tr(Oρ)\text{Tr}(O\rho). Such enhancement increases exponentially with the degree LL. VD benefits a few quantum information tasks, such as quantum metrology [27, 39]. In quantum metrology [40, 41], a probe state |ψ\ket{\psi} evolves under the dynamics VθV_{\theta}, and the estimator θ^\hat{\theta} of the unknown parameter θ\theta can be constructed via measuring the evolved state |ψθ\ket{\psi_{\theta}} using some observable OO. A noisy preparation ρ\rho instead of |ψ\ket{\psi} would introduce considerable systematic errors [27, 42, 43]. Here in the hybrid framework, we follow the spirit of VD to feed one of the output port of ρk\rho^{\otimes k} after the control gate to the evolution VθV_{\theta} and finally make the measurement in the eigenbasis of some observable OO, as shown in Fig. 1(c). After repeating the experiment, OVD(k)\langle O\rangle^{(k)}_{\text{VD}} can be estimated by

i[M](1)bcioi/Mi[M](1)bci/M,\frac{\sum_{i\in[M]}(-1)^{{b_{c}}_{i}}o_{i}/M}{\sum_{i^{\prime}\in[M^{\prime}]}(-1)^{{b_{c}}_{i^{\prime}}}/{M^{\prime}}}, (5)

where oio_{i} is the outcome of OO for the ii-th shot. Such approach significantly enhances the estimating accuracy, as it effectively realizes quantum metrology with the purified state ρk/Tr(ρk)\rho^{k}/\text{Tr}(\rho^{k}), which is much closer to the ideal one |ψ\ket{\psi} than ρ\rho. We should remark that our scheme only needs to feed the purified port to the environment (other than all kk copies) and do not require the controlled-OO operation compared to Ref. [27]. (See Supplementary Materials for proofs and more details.)

Experiment.— We implement the HS using a novel quantum Fredkin gate. In contrast to multi-photon Fredkin gate [44, 45, 46], our Fredkin gate acts on three qubits encoded on different degrees of freedom (DOF) of a single photon. The single-photon Fredkin gate is deterministic and generally can achieve high fidelity as it does not depend on multi-photon interference and post-selection [47]. In our Fredkin gate, the control qubit is encoded in the polarization DOF |H=|1\ket{H}=\ket{1} and |V=|0\ket{V}=\ket{0}, with |H\ket{H} (|V\ket{V}) being the horizontal (vertical) polarization. Two target qubits are equivalently encoded in a four-dimensional Hilbert space spanned by the four path modes |l0=|00\ket{l_{0}}=\ket{00}, |l1=|01\ket{l_{1}}=\ket{01}, |l2=|11\ket{l_{2}}=\ket{11} and |l3=|10\ket{l_{3}}=\ket{10}. As illustrated in Fig. 2(a), the heralded single photon is obtained by triggering one photon of photon pair generated from a periodically poled potassium titanyl phosphate crystal via spontaneous parametric down conversion. We use three tunable half-wave plates (HWP1, HWP2 and HWP3), four HPWs with fixed angles and three beam displacers (BDs) to prepare the input state |c|t1|t2\ket{c}\ket{t_{1}}\ket{t_{2}} (hereafter referred as |ct1t2\ket{ct_{1}t_{2}}), where |c=cos2θ3|H+sin2θ3|V\ket{c}=\cos 2\theta_{3}\ket{H}+\sin 2\theta_{3}\ket{V}, |t2=cos2θ2|0+sin2θ2|1\ket{t_{2}}=\cos 2\theta_{2}\ket{0}+\sin 2\theta_{2}\ket{1} and |t1=cos2θ1|0+sin2θ1|1\ket{t_{1}}=\cos 2\theta_{1}\ket{0}+\sin 2\theta_{1}\ket{1}. θ1\theta_{1}, θ2\theta_{2} and θ3\theta_{3} are the angles of HWP1, HWP2 and HWP3 respectively. See Supplementary Materials for details of state preparation. The Fredkin gate is realized with the optical network shown in Fig. 2(b). To give a clear illustration, we individually show how the four path modes |00\ket{00},|01\ket{01},|10\ket{10} and |11\ket{11} pass through the optical network conditioned on |H\ket{H} (solid line) and |V\ket{V} (dashed line) in Fig. 2(d). The projective measurement is sequentially performed on the control qubit, the second and the first target qubit as shown in Fig. 2(c). (See Supplementary Materials for details of projective measurement.)

Refer to caption
Figure 3: Experimental results of estimations (a) P2^\widehat{P_{2}}, (b) P3^\widehat{P_{3}} and (c) P4^\widehat{P_{4}}. (d)-(f) The variances of estimations P2^\widehat{P_{2}}, P3^\widehat{P_{3}} and P4^\widehat{P_{4}}. The red and blue dots represent the results with HS and OS respectively, and the x-axis is the consumed number of the state ρ\rho, labeled by NN.

We first characterize the Fredkin gate by measuring the truth table, according to which we observe the classical fidelity of 0.9898±0.00030.9898\pm 0.0003 with respect to the ideal case. The Fredkin gate is also capable to generate three-qubit Greenberger-Horne-Zeilinger (GHZ) state |GHZ=(|010+|101)/2\ket{\text{GHZ}}=(\ket{010}+\ket{101})/\sqrt{2} by inputting |+10\ket{+10}. The fidelity of generated GHZ state is 0.933±0.0020.933\pm 0.002. Furthermore, we estimate the process fidelity 0.935±0.0010.935\pm 0.001 of the implemented gate. (See Supplementary Materials for more experimental results regarding the characterization of Fredkin gate.)

We implement HS on two copies of single-qubit noisy state ρ=0.8|++|+0.2𝕀/2\rho=0.8\ket{+}\bra{+}+0.2\mathbb{I}/2, where the two-qubit target state ρ2\rho^{\otimes 2} can be written as

ρ2=\displaystyle\rho^{\otimes 2}= 0.64|++++|+0.08|+1+1|+0.08|+0+0|\displaystyle 0.64\ket{++}\bra{++}+0.08\ket{+1}\bra{+1}+0.08\ket{+0}\bra{+0} (6)
0.08|1+1+|+0.01|1111|+0.01|1010|\displaystyle 0.08\ket{1+}\bra{1+}+0.01\ket{11}\bra{11}+0.01\ket{10}\bra{10}
0.08|0+0+|+0.01|0101|+0.01|0010|,\displaystyle 0.08\ket{0+}\bra{0+}+0.01\ket{01}\bra{01}+0.01\ket{00}\bra{10},

and can be prepared by randomly setting angles [θ1,θ2,θ3][\theta_{1},\theta_{2},\theta_{3}] to generate |t1t2{|++\ket{t_{1}t_{2}}\in\{\ket{++}, |+1\ket{+1}, |+0\ket{+0}, |1+\ket{1+}, |11\ket{11}, |10\ket{10}, |0+\ket{0+}, |01\ket{01}, |00}\ket{00}\}, with probability of 0.64, 0.08, 0.08, 0.08, 0.01, 0.01, 0.08, 0.01, 0.01 (See supplementary Materials for the angle settings.) After the Fredkin gate, the control qubit is measured on Pauli-XX basis. The target qubit is randomly detected on Pauli-XX, YY and ZZ bases. By running the experiment many times, the unbiased estimators of P2P_{2}, P3P_{3} and P4P_{4} are constructed by

P2^(HS)=1Mi[M]Tr[ρ2^(i)],P3^(HS)=1MMi[M],i[M]Tr[ρ2^(i)ρ^(i)],P4^(HS)=1MMi[M],i[M]Tr[ρ2^(i)ρ2^(i)],\begin{split}&\widehat{P_{2}}_{(\text{HS})}=\frac{1}{M}\sum_{i\in\left[M\right]}{\text{Tr}\left[\widehat{\rho^{2}}_{(i)}\right]},\\ &\widehat{P_{3}}_{(\text{HS})}=\frac{1}{MM^{\prime}}\sum_{i\in[M],i^{\prime}\in[M^{\prime}]}{\text{Tr}\left[\widehat{\rho^{2}}_{(i)}\hat{\rho}_{(i^{\prime})}\right]},\\ &\widehat{P_{4}}_{(\text{HS})}=\frac{1}{MM^{\prime}}\sum_{i\in[M],i^{\prime}\in[M^{\prime}]}{\text{Tr}\left[\widehat{\rho^{2}}_{(i)}\widehat{\rho^{2}}_{(i^{\prime})}\right]},\end{split} (7)

according to Eq. (4), with {ρ^(i)}\{\hat{\rho}_{(i)}\} and {ρ2^(i)}\{\widehat{\rho^{2}}_{(i)}\} constructed via Eq. (1) and (3), respectively. The experimental results of P2^\widehat{P_{2}}, P3^\widehat{P_{3}} and P4^\widehat{P_{4}} are shown with red dots in Fig. 3(a)-Fig. 3(c), respectively. To give a comparison, we also implement OS to estimate P2^\widehat{P_{2}}, P3^\widehat{P_{3}} and P4^\widehat{P_{4}} according to Eq. (2), and the results are shown with blue dots in Fig. 3(a)-Fig. 3(c) respectively. Note that the HS consumes two copies of ρ\rho in each experiment run while the OS consumes one, so that the comparison is carried out with the same number of consumed copies (denoted by NN) instead of experimental runs MM. As reflected in Fig. 3(a)-Fig. 3(c), the results of HS converge faster than that of OS, which clearly demonstrate the reduction of sample complexity using the hybrid framework.

Refer to caption
Figure 4: (a) Experimental results of VD of the expectation value of observable Pauli XX, with the estimator X3^/P3^\widehat{X_{3}}/\widehat{P_{3}}, for both HS and OS. The green and yellow dashed lines in insert represent the theoretical prediction of X\langle X\rangle on |+\ket{+} and noisy ρ\rho respectively. (b) Estimation error of X3^/P3^\widehat{X_{3}}/\widehat{P_{3}}. (c) The accuracy of the estimation θ^\hat{\theta} using HS (red dots) and original single-copy method (blue dots); The green dots represent the results with (almost) perfect pure state |+\ket{+}.

The sample complexity is further investigated by the variance of PL^\widehat{P_{L}} [5, 48]

Var(PL^)=𝔼(PL^PL)2.\text{Var}\left(\widehat{P_{L}}\right)=\mathbb{E}\left(\widehat{P_{L}}-P_{L}\right)^{2}. (8)

Note that Var(PL^)0(\widehat{P_{L}})\to 0 when NN\to\infty. In the experiment, the converged value PLP_{L} is estimated by using a large number (3×1043\times 10^{4}) of copies. The results of Var(P^2)(\widehat{P}_{2}), Var(P^3)(\widehat{P}_{3}), Var(P^4)(\widehat{P}_{4}) are shown in Fig. 3(d)-Fig. 3(f) respectively, and we observe Var(PL^)(\widehat{P_{L}}) of HS converges to zero faster than that of OS.

Next, we show VD of the expectation value of some observable OO with the assistance of PL^\widehat{P_{L}} and OL^\widehat{O_{L}}. That is, estimating OVD(L)\langle O\rangle^{(L)}_{\text{VD}} with OL^/PL^\widehat{O_{L}}/\widehat{P_{L}}, where OL^\widehat{O_{L}} is an estimator of Tr(OρL)\text{Tr}(O\rho^{L}). For example, O3^\widehat{O_{3}} for HS is constructed as

O3^(HS)=1MMi[M],i[M]Tr[Oρ2^(i)ρ^(i)],\widehat{O_{3}}_{(\text{HS})}=\frac{1}{MM^{\prime}}\sum_{i\in\left[M\right],i^{\prime}\in\left[M^{\prime}\right]}{\text{Tr}\left[O\widehat{\rho^{2}}_{(i)}\widehat{\rho}_{(i^{\prime})}\right]}, (9)

in a similar way as P3^(HS)\widehat{P_{3}}_{(\text{HS})} in Eq. (7). The result of estimating XVD(3)\langle X\rangle^{(3)}_{\text{VD}} for observable O=XO=X is shown in Fig. 4(a). After VD, XVD(3)\langle X\rangle^{(3)}_{\text{VD}} is closer to 1, which is the theoretical prediction of X\langle X\rangle on state |+\ket{+} ( green dashed line in insert of Fig. 4(a)). Similarly, the variance of XVD3\langle X\rangle^{3}_{\text{VD}} converges faster compared to OS as reflected in Fig. 4(b). See Supplementary Materials for the results of XVD(2)\langle X\rangle^{(2)}_{\text{VD}} and XVD(4)\langle X\rangle^{(4)}_{\text{VD}}. Note that XVD(4)\langle X\rangle^{(4)}_{\text{VD}} is more accurate than XVD(3)\langle X\rangle^{(3)}_{\text{VD}}.

Finally, we demonstrate quantum metrology with the assistance of VD in such a hybrid framework. We consider the probe qubit passing through a phase gate Vθ=eiθ2Z{V_{\theta}}=e^{-i\frac{\theta}{2}Z} as shown in Fig. 2(e), and the value of θ\theta is the parameter to be estimated. By measuring the probe qubit in the eigenbasis of Pauli YY, one can obtain the estimation θ^=YL^/PL^\hat{\theta}=\widehat{Y_{L}}/\widehat{P_{L}}. The optimal accuracy is achieved with the perfect probe state of |+\ket{+}. In our experiment, we set θ=π/15\theta=\pi/15 and the initial probe state is a noisy state ρ=0.8|++|+0.2𝕀/2\rho=0.8\ket{+}\bra{+}+0.2\mathbb{I}/2. Without VD, δθ^\delta\hat{\theta} is illustrated with blue dots in Fig. 4(c). The results of δθ^\delta\hat{\theta} with VD are shown with red dots in Fig. 4(c), and we observe δθ^\delta\hat{\theta} with VD is smaller than that without it when around 2102^{10} copies of ρ\rho are consumed in the experiment. Also, we perform the metrology with perfect probe state of |+\ket{+}, and the results are shown with green dots in Fig. 4(c). The accuracy of θ^\hat{\theta} with noisy state ρ\rho achieves that with (almost) pure state |+\ket{+} when the virtual distillation is performed with around 2122^{12} copies.

Conclusion.— In this work, we design and implement a deterministic and high-fidelity quantum Fredkin gate with single photon, and demonstrate the advantages of HS in important tasks like quantum error mitigation and quantum metrology. Our protocols in principle can be systemically generalized to larger systems by using parallel Fredkin gates and entangled control qubits. Note that the Fredkin gate here would benefit the investigation of other photonic quantum information tasks, such as quantum fingerprinting [49] and optimal cloning [50]. We also expect HS can be further applied to other important scenarios in quantum information science, like quantum algorithm design [51, 52], quantum chaos diagnosis [53, 54], and quantum magic-resource quantification [55, 56, 57]. The extension of HS to the multi-shot scenario [58, 59] and continuous-variable quantum systems [60, 61] are also promising. Our research significantly enriches the scope of randomized measurements and shadow tomography, and advances its real-world experimental implementations, especially in the estimation of highly nonlinear functions.

References

Appendix A Additional notes for the hybrid framework

Here, we prove that one can construct the unbiased estimator of ρ\rho with the information 𝑼\bm{U} and 𝒃\bm{b} from the hybrid setting as shown in Fig. 1(b) in main text via

ρ^=1(𝑼|𝒃𝒃|𝑼),\hat{\rho}=\mathcal{M}^{-1}(\bm{U^{\dagger}\ket{\bm{b}}\bra{\bm{b}}U}), (10)

by ignoring the information of bcb_{c}.

Proof.

The expectation value of the estimator on random unitary 𝑼\bm{U} and the measurement result bcb_{c}, 𝒃\bm{b} is

𝔼{𝑼,bc,𝒃}ρ^\displaystyle\mathbb{E}_{\{\bm{U},b_{c},\bm{b}\}}\hat{\rho} =𝔼{𝑼,bc,𝒃}1(𝑼|𝒃𝒃|𝑼)\displaystyle=\mathbb{E}_{\{\bm{U},b_{c},\bm{b}\}}\mathcal{M}^{-1}(\bm{U^{\dagger}\ket{\bm{b}}\bra{\bm{b}}U}) (11)
=𝑼,bc,𝒃Pr(𝑼,bc,𝒃)1(𝑼|𝒃𝒃|𝑼)\displaystyle=\sum_{\bm{U},b_{c},\bm{b}}\Pr(\bm{U},b_{c},\bm{b})\mathcal{M}^{-1}(\bm{U^{\dagger}\ket{\bm{b}}\bra{\bm{b}}U})
=𝑼Pr(𝑼)bc,𝒃Pr(bc,𝒃|𝑼)1(𝑼|𝒃𝒃|𝑼).\displaystyle=\sum_{\bm{U}}\Pr(\bm{U})\sum_{b_{c},\bm{b}}\Pr(b_{c},\bm{b}|\bm{U})\mathcal{M}^{-1}(\bm{U^{\dagger}\ket{\bm{b}}\bra{\bm{b}}U}).

Given 𝑼\bm{U} and 𝒃\bm{b}, one can sum the index bcb_{c} as

bcPr(bc,𝒃|𝑼)=\displaystyle\sum_{b_{c}}\Pr(b_{c},\bm{b}|\bm{U})= Tr[+|c𝒃|𝑼CSk(|+c+|cρk)CSk𝑼|𝒃|+c]\displaystyle\text{Tr}\left[\bra{+}_{c}\bra{\bm{b}}\bm{U}\ CS_{k}\left(\ket{+}_{c}\bra{+}_{c}\otimes\rho^{\otimes k}\right)CS_{k}^{\dagger}\bm{U}^{\dagger}\ket{\bm{b}}\ket{+}_{c}\right] (12)
+Tr[|c𝒃|𝑼CSk(|+c+|cρk)CSk𝑼|𝒃|c]\displaystyle+\text{Tr}\left[\bra{-}_{c}\bra{\bm{b}}\bm{U}\ CS_{k}\left(\ket{+}_{c}\bra{+}_{c}\otimes\rho^{\otimes k}\right)CS_{k}^{\dagger}\bm{U}^{\dagger}\ket{\bm{b}}\ket{-}_{c}\right]
=\displaystyle= Tr[𝕀c𝒃|𝑼CSk(|+c+|cρk)CSk𝑼|𝒃]\displaystyle\text{Tr}\left[\mathbb{I}_{c}\bra{\bm{b}}\bm{U}\ CS_{k}\left(\ket{+}_{c}\bra{+}_{c}\otimes\rho^{\otimes k}\right)CS_{k}^{\dagger}\bm{U}^{\dagger}\ket{\bm{b}}\right]
=\displaystyle= Tr(ρ)k1𝒃|𝑼ρ𝑼|𝒃=𝒃|𝑼ρ𝑼|𝒃,\displaystyle\text{Tr}(\rho)^{k-1}\bra{\bm{b}}\bm{U}\rho\bm{U}^{\dagger}\ket{\bm{b}}=\bra{\bm{b}}\bm{U}\rho\bm{U}^{\dagger}\ket{\bm{b}},

with CSkCS_{k} denoting the controlled-𝕊k\mathbb{S}_{k} gate. Thus, one can rewrite Eq. (11) as

𝔼{𝑼,bc,𝒃}ρ^=𝑼𝒃Pr(𝑼)𝒃|𝑼ρ𝑼|𝒃1(𝑼|𝒃𝒃|𝑼)=ρ.\mathbb{E}_{\{\bm{U},b_{c},\bm{b}\}}\hat{\rho}=\sum_{\bm{U}}\sum_{\bm{b}}\Pr(\bm{U})\bra{\bm{b}}\bm{U}\rho\bm{U}^{\dagger}\ket{\bm{b}}\mathcal{M}^{-1}(\bm{U^{\dagger}\ket{\bm{b}}\bra{\bm{b}}U})=\rho. (13)

This equation is based on the definition of unbiased estimator given in the original shadow estimation protocol [5]. ∎

As introduced in main text, we implement OS tomography on one copy of ρ\rho after the SWAP-test. In fact, one can perform randomized measurements on each copy of ρ\rho in ρk\rho^{\otimes k} and record the corresponding {𝑼,𝒃}\{\bm{U},\bm{b}\}. Therefore, one can build kk distinct shadow snapshots for ρ^\hat{\rho} with the information of {𝑼,𝒃}\{\bm{U},\bm{b}\} for different copies in single-shot. This strategy would save the sample number of ρ\rho when constructing the shadow set {ρ^(i)}\{\hat{\rho}_{(i)}\}, thus reduce the sample complexity. We applied such scheme in the classical post-processing procedure in our experiments.

Appendix B Quantum metrology with the hybrid framework

B.1 Variance of estimating θ\theta with noisy state

In general quantum metrology settings [40, 41], one prepares a probe state ρ=|ψψ|\rho=|\psi\rangle\langle\psi| and evolves the state under the dynamics VθV_{\theta} characterized by parameter θ\theta. Then, one performs projective measurements described by OO on this state and records the outcomes oi{1,1}o_{i}\in\{1,-1\}. By fitting the experimental outcomes with a theoretical estimator o=Tr(Oρθ)\langle o\rangle=\text{Tr}(O\rho_{\theta}) with ρθ=VθρVθ\rho_{\theta}=V_{\theta}\rho V_{\theta}^{\dagger}, one can estimate the parameter θ\theta.

Here, we discuss in detail the variance of estimating θ\theta with the theoretical o=Tr(Oρθ)=a+bθ\langle o\rangle=\text{Tr}(O\rho_{\theta})=a+b\theta [27]. First, we derive the theoretical aa and bb for the ideal case when we set Vθ=eiθ2ZV_{\theta}=e^{-i\frac{\theta}{2}Z} and measure the evolved state in y-basis, i.e., O=YO=Y, as in the experiment. Here, we denote the ideal initial probe state as ρ\rho, thus

y\displaystyle\langle y\rangle =Tr(Yρθ)=Tr[Y(cosθ2Iisinθ2Z)ρ(cosθ2I+isinθ2Z)]\displaystyle=\text{Tr}(Y\rho_{\theta})=\text{Tr}\left[Y\left(\cos\frac{\theta}{2}I-i\sin\frac{\theta}{2}Z\right)\rho\left(\cos\frac{\theta}{2}I+i\sin\frac{\theta}{2}Z\right)\right] (14)
=1+cosθ2Tr(Yρ)+isinθ2Tr(Y[ρ,Z])+1cosθ2Tr(YZρZ)\displaystyle=\frac{1+\cos\theta}{2}\text{Tr}(Y\rho)+i\frac{\sin\theta}{2}\text{Tr}(Y\left[\rho,Z\right])+\frac{1-\cos\theta}{2}\text{Tr}(YZ\rho Z)
=cosθTr(Yρ)+sinθTr(Xρ).\displaystyle=\cos\theta\text{Tr}(Y\rho)+\sin\theta\text{Tr}(X\rho).

When θ\theta is small enough, one can ignore the higher order terms of θ\theta, that is

yθ0=Tr(Yρ)+Tr(Xρ)θ.\langle y\rangle_{\theta\to 0}=\text{Tr}(Y\rho)+\text{Tr}(X\rho)\theta. (15)

Then, one can use the theoretical a=Tr(Yρ)a=\text{Tr}(Y\rho), b=Tr(Xρ)b=\text{Tr}(X\rho) to further estimate θ\theta, where the ideal (or theoretical) estimator of θ\theta is constructed as θ^=(yθ^a)/b\hat{\theta}=(\hat{y_{\theta}}-a)/b, with yθ^\hat{y_{\theta}} the variable of the average measurement outcome yi{1,1}y_{i}\in\{1,-1\} characterizing y=Tr(Yρθ)\langle y^{\prime}\rangle=\text{Tr}(Y\rho^{\prime}_{\theta}).

In practise, the real initial quantum state may be a noisy one denoted as ρ\rho^{\prime}. Thus, the real estimator of θ\theta should be defined as θ^=(yθ^a)/b\hat{\theta^{\prime}}=(\hat{y_{\theta}}-a^{\prime})/b^{\prime}, with a=Tr(Yρ)a^{\prime}=\text{Tr}(Y\rho^{\prime}) and b=Tr(Xρ)b^{\prime}=\text{Tr}(X\rho^{\prime}). However, due to a lack of information about the noisy state ρ\rho^{\prime}, one cannot access the real aa^{\prime} and bb^{\prime}. Thus, the variance of estimating θ\theta with the theoretical estimator follows

Var(θ^)\displaystyle\text{Var}(\hat{\theta}) =(θ^θ^)2=θ^22θ^θ^+θ^2\displaystyle=\langle(\hat{\theta}-\langle\hat{\theta^{\prime}}\rangle)^{2}\rangle=\langle\hat{\theta}^{2}\rangle-\langle 2\hat{\theta}\langle\hat{\theta^{\prime}}\rangle\rangle+\langle\hat{\theta^{\prime}}\rangle^{2} (16)
=1b2𝔼(yθ^22ayθ^+a2)+2bb[(𝔼yθ^)2(a+a)𝔼yθ^+aa]+1b2𝔼(yθ^22ayθ^+a2)\displaystyle=\frac{1}{b^{2}}\mathbb{E}\left(\hat{y_{\theta}}^{2}-2a\hat{y_{\theta}}+a^{2}\right)+\frac{2}{bb^{\prime}}\left[(\mathbb{E}\hat{y_{\theta}})^{2}-(a+a^{\prime})\mathbb{E}\hat{y_{\theta}}+aa^{\prime}\right]+\frac{1}{{b^{\prime}}^{2}}\mathbb{E}\left(\hat{y_{\theta}}^{2}-2a^{\prime}\hat{y_{\theta}}+{a^{\prime}}^{2}\right)
=(1b2𝔼(yθ^2)(2bb1b2)(𝔼yθ^)2)+(2ab2+2(a+a)bb2ab2)𝔼yθ^+(a2b22aabb+a2b2).\displaystyle=\left(\frac{1}{b^{2}}\mathbb{E}(\hat{y_{\theta}}^{2})-\left(\frac{2}{bb^{\prime}}-\frac{1}{{b^{\prime}}^{2}}\right)\left(\mathbb{E}\hat{y_{\theta}}\right)^{2}\right)+\left(-\frac{2a}{b^{2}}+\frac{2(a+a^{\prime})}{bb^{\prime}}-\frac{2a^{\prime}}{{b^{\prime}}^{2}}\right)\mathbb{E}\hat{y_{\theta}}+\left(\frac{a^{2}}{b^{2}}-\frac{2aa^{\prime}}{bb^{\prime}}+\frac{{a^{\prime}}^{2}}{{b^{\prime}}^{2}}\right).

Note that for the ideal case when ρ=ρ\rho^{\prime}=\rho, the variance of estimating θ\theta follows

Var(θ^)=1b2[𝔼(yθ^2)(𝔼yθ^)2]=1b2Var(yθ^).\text{Var}(\hat{\theta})=\frac{1}{b^{2}}\left[\mathbb{E}(\hat{y_{\theta}}^{2})-(\mathbb{E}\hat{y_{\theta}})^{2}\right]=\frac{1}{b^{2}}\text{Var}(\hat{y_{\theta}}). (17)

Such estimation variance arises from the statistical error of the variable yθ^\hat{y_{\theta}}, which decreases with the increasing of MM.

Therefore, when ρρ\rho^{\prime}\neq\rho, as illustrated in Eq. (16), the variance of estimating θ\theta with the original metrology setting suffers from both statistical and systematic error [27, 42, 43]. Specifically, the first term of Eq. (16) is mainly generated by the statistical error; while other terms describe the systematic error due to the incorrect estimation of y\langle y^{\prime}\rangle, that is, the value of aa^{\prime} and bb^{\prime}. Note that, the first term is also influenced by the systematic error when bbb^{\prime}\neq b.

In main text, we consider the error of estimating θ\theta described by δθ^=|θ^θ|\delta\hat{\theta}=|\hat{\theta}-\theta| for simplicity. Note that the error contains both statistical and systematic error. Thus, one should adopt error mitigation technique to reduce the systematic the error, which leads to our hybrid framework.

B.2 Error-mitigated quantum metrology

In this part, we introduce the hybrid framework for quantum metrology described in Fig. 1(c) and prove the unbiasedness of the estimator described in Eq.(5) in main text.

The hybrid framework for quantum metrology follows the spirit of VD. Specifically, one prepares kk copies of the probe state ρ\rho and sends them to the generalized SWAP test circuit, with the measurement outcome of the control qubit as bci{b_{c}}_{i}. Next, one feeds one of the output port of ρk\rho^{\otimes k} after the controlled-𝕊k\mathbb{S}_{k} to the evolution VθV_{\theta} and makes measurement in the eigenbasis of observable OO. The outcome is denoted as oi{1,1}o_{i}\in\{1,-1\}. After repeating the experiment, one can estimate OVD(k)\langle O\rangle^{(k)}_{\text{VD}} with bci{b_{c}}_{i} and oio_{i} via Eq.(5) in main text, that is

i[M](1)bcioi/Mi[M](1)bci/M,\frac{\sum_{i\in[M]}(-1)^{{b_{c}}_{i}}o_{i}/M}{\sum_{i^{\prime}\in[M^{\prime}]}(-1)^{{b_{c}}_{i^{\prime}}}/{M^{\prime}}}, (18)

which is an unbiased estimator of OVD(k)\langle O\rangle^{(k)}_{\text{VD}}. With this value, one can further estimate parameter θ\theta in VθV_{\theta} with higher precision using the metrology technique.

Proof.

Here, we prove that (1)bcioi(-1)^{{b_{c}}_{i}}o_{i} in the numerator term of Eq. (18) is an unbiased estimator of Tr(Oρθk)\text{Tr}(O\rho_{\theta}^{k}). The Hermitian operator OO can be decomposed as O=o𝒃|𝒃𝒃|O=\sum o_{\bm{b}}\ket{\bm{b}}\bra{\bm{b}}, with o𝒃o_{\bm{b}} the eigenvalue, which also describes the measurement outcome while measuring in the eigenbasis |𝒃\ket{\bm{b}} of OO. The joint density matrix for the whole system before all the projective measurements is

ρc,k\displaystyle\rho_{c,k} =12|00|(𝕀k1Vθ)ρk(𝕀k1Vθ)+12|01|(𝕀k1Vθ)ρk𝕊k(𝕀k1Vθ)\displaystyle=\frac{1}{2}|0\rangle\langle 0|\otimes(\mathbb{I}^{\otimes k-1}\otimes V_{\theta})\rho^{\otimes k}(\mathbb{I}^{\otimes k-1}\otimes V_{\theta}^{\dagger})+\frac{1}{2}|0\rangle\langle 1|\otimes(\mathbb{I}^{\otimes k-1}\otimes V_{\theta})\rho^{\otimes k}\mathbb{S}_{k}(\mathbb{I}^{\otimes k-1}\otimes V_{\theta}^{\dagger}) (19)
+12|10|(𝕀k1Vθ)𝕊kρk(𝕀k1Vθ)+12|11|(𝕀k1Vθ)𝕊kρk𝕊k(𝕀k1Vθ).\displaystyle+\frac{1}{2}|1\rangle\langle 0|\otimes(\mathbb{I}^{\otimes k-1}\otimes V_{\theta})\mathbb{S}_{k}\rho^{\otimes k}(\mathbb{I}^{\otimes k-1}\otimes V_{\theta}^{\dagger})+\frac{1}{2}|1\rangle\langle 1|\otimes(\mathbb{I}^{\otimes k-1}\otimes V_{\theta})\mathbb{S}_{k}\rho^{\otimes k}\mathbb{S}_{k}(\mathbb{I}^{\otimes k-1}\otimes V_{\theta}^{\dagger}).

When the measurement outcomes for one of the ρk\rho^{\otimes k} is o𝒃o_{\bm{b}}, the density matrix of the control qubit is

ρc=12𝒃|VθρVθ|𝒃𝕀c+12𝒃|VθρkVθ|𝒃Xc.\rho_{c}=\frac{1}{2}\bra{\bm{b}}V_{\theta}\rho V_{\theta}^{\dagger}\ket{\bm{b}}\mathbb{I}_{c}+\frac{1}{2}\bra{\bm{b}}V_{\theta}\rho^{k}V_{\theta}^{\dagger}\ket{\bm{b}}X_{c}. (20)

Thus, when measuring the control qubit in xx-basis, the probabilities for outcome 0 and 11 are

Pr(0,𝒃)\displaystyle\Pr(0,\bm{b}) =+|ρc|+=12𝒃|VθρVθ|𝒃+12𝒃|VθρkVθ|𝒃\displaystyle=\bra{+}\rho_{c}\ket{+}=\frac{1}{2}\bra{\bm{b}}V_{\theta}\rho V_{\theta}^{\dagger}\ket{\bm{b}}+\frac{1}{2}\bra{\bm{b}}V_{\theta}\rho^{k}V_{\theta}^{\dagger}\ket{\bm{b}} (21)
Pr(1,𝒃)\displaystyle\Pr(1,\bm{b}) =|ρc|=12𝒃|VθρVθ|𝒃12𝒃|VθρkVθ|𝒃,\displaystyle=\bra{-}\rho_{c}\ket{-}=\frac{1}{2}\bra{\bm{b}}V_{\theta}\rho V_{\theta}^{\dagger}\ket{\bm{b}}-\frac{1}{2}\bra{\bm{b}}V_{\theta}\rho^{k}V_{\theta}^{\dagger}\ket{\bm{b}},

respectively. Thus, in the ii-th shot, the expectation value shows (we ignore the subscript ii in bci{b_{c}}_{i} and 𝒃i\bm{b}_{i} for simplicity)

𝔼{bc,𝒃}(1)bco𝒃\displaystyle\mathbb{E}_{\{{b_{c}},\bm{b}\}}(-1)^{b_{c}}o_{\bm{b}} =bc,𝒃Pr(bc,𝒃)(1)bco𝒃\displaystyle=\sum_{b_{c},\bm{b}}\Pr(b_{c},\bm{b})(-1)^{b_{c}}o_{\bm{b}} (22)
=𝒃o𝒃[Pr(0,𝒃)Pr(1,𝒃)]\displaystyle=\sum_{\bm{b}}o_{\bm{b}}\left[\Pr(0,\bm{b})-\Pr(1,\bm{b})\right]
=𝒃o𝒃𝒃|VθρkVθ|𝒃\displaystyle=\sum_{\bm{b}}o_{\bm{b}}\bra{\bm{b}}V_{\theta}\rho^{k}V_{\theta}^{\dagger}\ket{\bm{b}}
=𝒃o𝒃𝒃|ρθk|𝒃=Tr(Oρθk).\displaystyle=\sum_{\bm{b}}o_{\bm{b}}\bra{\bm{b}}\rho_{\theta}^{k}\ket{\bm{b}}=\text{Tr}(O\rho_{\theta}^{k}).

Here, we use the property that ρθk=(VθρVθ)k=VθρkVθ\rho_{\theta}^{k}=(V_{\theta}\rho V_{\theta}^{\dagger})^{k}=V_{\theta}\rho^{k}V_{\theta}^{\dagger} in the last line of Eq. (22). ∎

Note that, when O=𝕀O=\mathbb{I}, we can prove that 𝔼{bc,𝒃}(1)bc=Tr(ρθk)\mathbb{E}_{\{b_{c},\bm{b}\}}(-1)^{b_{c}}=\text{Tr}(\rho_{\theta}^{k}), which shows that (1)bci(-1)^{{b_{c}}_{i}} in the denominator term of Eq. (18) is an unbiased estimator of Tr(ρθk)\text{Tr}(\rho_{\theta}^{k}).

Appendix C Details of experiment

We start by presenting an overview of the critical optical components utilized in our experimental setup and elucidate their respective functions:

  1. 1.

    Waveplates: Central to our experimental design are HWPs and QWPs. The angle parameters, θ\theta for HWPs and ζ\zeta for QWPs, define the orientation of the fast axis relative to the vertical polarization direction.

    - HWP Unitary Transformation (UHWP(θ)U_{\text{HWP}}(\theta)):

    UHWP(θ)=(cos2θsin2θsin2θcos2θ)U_{\text{HWP}}(\theta)=-\begin{pmatrix}\cos 2\theta&\sin 2\theta\\ \sin 2\theta&-\cos 2\theta\\ \end{pmatrix}

    - QWP Unitary Transformation (UQWP(ζ)U_{\text{QWP}}(\zeta)):

    UQWP(ζ)=12(1+icos2ζisin2ζisin2ζ1icos2ζ)U_{\text{QWP}}(\zeta)=\frac{1}{\sqrt{2}}\begin{pmatrix}1+i\cos 2\zeta&i\sin 2\zeta\\ i\sin 2\zeta&1-i\cos 2\zeta\\ \end{pmatrix}
  2. 2.

    Beam displacer (BD): A BD transmits the vertically polarized photons and deviates the horizontally polarized photons.

  3. 3.

    Polarizing Beam Splitter (PBS): A PBS transmits the horizontal polarization and reflects the vertical polarization.

C.1 Preparation of input states

We use an ultraviolet diode laser to pump a periodically poled potassium titanyl phosphate crystal. The generated two photons are with orthogonal polarizations, and are separated by a polarizing beam splitter. The reflected photon is detected by a single-photon detector, serving as trigger to herald the existence of the other photon. The heralded photon is injected into the Fredkin gate. The step-by-step description of preparation of input state |c|t1|t2\ket{c}\ket{t_{1}}\ket{t_{2}} is

Refer to caption
Figure 5: Schematic illustration of the generation of install states.
|H\displaystyle\ket{H} HWP1@θ1cos2θ1|H+sin2θ1|VBD1cos2θ1|Hl0+sin2θ1|Vl1,\displaystyle\xrightarrow{\text{HWP${}_{1}$}@\theta_{1}}\cos 2\theta_{1}\ket{H}+\sin 2\theta_{1}\ket{V}\xrightarrow{\text{BD1}}\cos 2\theta_{1}\ket{Hl_{0}}+\sin 2\theta_{1}\ket{Vl_{1}}, (23)
HWP@45cos2θ1|Vl0+sin2θ1|Hl1BD2cos2θ1|Vl0+sin2θ1|Hl2,\displaystyle\xrightarrow{\text{HWP}@45^{\circ}}\cos 2\theta_{1}\ket{Vl_{0}}+\sin 2\theta_{1}\ket{Hl_{1}}\xrightarrow{\text{BD2}}\cos 2\theta_{1}\ket{Vl_{0}}+\sin 2\theta_{1}\ket{Hl_{2}},
HWP2@θ2cos2θ1sin2θ2|Hl0cos2θ1cos2θ2|Vl0+sin2θ1cos2θ2|Hl2+sin2θ1sin2θ2|Vl2,\displaystyle\xrightarrow{\text{HWP${}_{2}$}@\theta_{2}}\cos 2\theta_{1}\sin 2\theta_{2}\ket{Hl_{0}}-\cos 2\theta_{1}\cos 2\theta_{2}\ket{Vl_{0}}+\sin 2\theta_{1}\cos 2\theta_{2}\ket{Hl_{2}}+\sin 2\theta_{1}\sin 2\theta_{2}\ket{Vl_{2}},
BD3cos2θ1cos2θ2|Vl0+cos2θ1sin2θ2|Hl1+sin2θ1sin2θ2|Vl2+sin2θ1cos2θ2|Hl3,\displaystyle\xrightarrow{\text{BD3}}-\cos 2\theta_{1}\cos 2\theta_{2}\ket{Vl_{0}}+\cos 2\theta_{1}\sin 2\theta_{2}\ket{Hl_{1}}+\sin 2\theta_{1}\sin 2\theta_{2}\ket{Vl_{2}}+\sin 2\theta_{1}\cos 2\theta_{2}\ket{Hl_{3}},
HWPs on four modes|H(cos2θ1cos2θ2|l0+cos2θ1sin2θ2|l1+sin2θ1sin2θ3|l2+sin2θ1cos2θ3|l3),\displaystyle\xrightarrow{\text{HWPs on four modes}}\ket{H}\left(\cos 2\theta_{1}\cos 2\theta_{2}\ket{l_{0}}+\cos 2\theta_{1}\sin 2\theta_{2}\ket{l_{1}}+\sin 2\theta_{1}\sin 2\theta_{3}\ket{l_{2}}+\sin 2\theta_{1}\cos 2\theta_{3}\ket{l_{3}}\right),
=|H(cos2θ1cos2θ2|00+cos2θ1sin2θ2|01+sin2θ1sin2θ3|11+sin2θ1cos2θ3|10)\displaystyle=\ket{H}\left(\cos 2\theta_{1}\cos 2\theta_{2}\ket{00}+\cos 2\theta_{1}\sin 2\theta_{2}\ket{01}+\sin 2\theta_{1}\sin 2\theta_{3}\ket{11}+\sin 2\theta_{1}\cos 2\theta_{3}\ket{10}\right)
=|H(cos2θ1|0+sin2θ1|1)(cos2θ2|0+sin2θ2|1),\displaystyle=\ket{H}\left(\cos 2\theta_{1}\ket{0}+\sin 2\theta_{1}\ket{1}\right)\left(\cos 2\theta_{2}\ket{0}+\sin 2\theta_{2}\ket{1}\right),
HWP3@θ3(sin2θ3|H+cos2θ3|V)(cos2θ2|0+sin2θ2|1)(cos2θ1|0+sin2θ1|1).\displaystyle\xrightarrow{\text{HWP}_{3}@\theta_{3}}\left(\sin 2\theta_{3}\ket{H}+\cos 2\theta_{3}\ket{V}\right)\left(\cos 2\theta_{2}\ket{0}+\sin 2\theta_{2}\ket{1}\right)\left(\cos 2\theta_{1}\ket{0}+\sin 2\theta_{1}\ket{1}\right).

In the characterizations of Fredkin gate, the input states are |000\ket{000}, |001\ket{001}, |010\ket{010}, |011\ket{011}, |100\ket{100}, |101\ket{101}, |110\ket{110} and |111\ket{111} for classical fidelity measurement, and |+10\ket{+10} for generation of three-qubit GHZ state. The angle setting of [θ1,θ2,θ3][\theta_{1},\theta_{2},\theta_{3}] are listed in Table 1.

|000\ket{000} |001\ket{001} |010\ket{010} |011\ket{011} |100\ket{100} |101\ket{101} |110\ket{110} |111\ket{111} |+10\ket{+10}
θ1\theta_{1} 0 0 0 0 45 45 45 45
θ2\theta_{2} 0 0 45 45 0 0 45 45
θ3\theta_{3} 0 45 0 45 0 45 0 45
Table 1: The setting of angles θ1\theta_{1}, θ2\theta_{2} and θ3\theta_{3} to prepare input state.

In the HS experiment, the state of control qubit is |+\ket{+}, and we set θ3=22.5\theta_{3}=22.5^{\circ}. The angle settings of [θ2,θ3][\theta_{2},\theta_{3}] to prepare target states |t1t2{|++\ket{t_{1}t_{2}}\in\{\ket{++}, |+1\ket{+1}, |+0\ket{+0}, |1+\ket{1+}, |11\ket{11}, |10\ket{10}, |0+\ket{0+}, |01\ket{01}, |00}\ket{00}\} are listed in Table 2.

|++\ket{++} |+1\ket{+1} |+0\ket{+0} |1+\ket{1+} |11\ket{11} |10\ket{10} |0+\ket{0+} |01\ket{01} |00\ket{00}
θ1\theta_{1} 22.5 22.5 22.5 45 45 45 0 0 0
θ2\theta_{2} 22.5 45 0 22.5 45 0 22.5 45 0
Table 2: The setting of angles θ1\theta_{1} and θ2\theta_{2} to generate two-copy noisy state.

C.2 Measurement

The measurement setup is shown in Fig. 6, which is able to perform the projective measurement on state |φc|φ1|φ2=(αc|0+βc|1)(α1|0+β1|1)(α2|0+β2|1)\ket{\varphi_{c}}\ket{\varphi_{1}}\ket{\varphi_{2}}=(\alpha_{c}\ket{0}+\beta_{c}\ket{1})\otimes(\alpha_{1}\ket{0}+\beta_{1}\ket{1})\otimes(\alpha_{2}\ket{0}+\beta_{2}\ket{1}) with α,β,α1,β1,α2,β2\alpha,\beta,\alpha_{1},\beta_{1},\alpha_{2},\beta_{2} being complex numbers.

Refer to caption
Figure 6: Illustration of setup to perfrom projective measurement on control qubit and two target qubits.

The step-by-step description of this projective measurement is

|φc|φ1|φ2\displaystyle\ket{\varphi_{c}}\ket{\varphi_{1}}\ket{\varphi_{2}} =(αc|0+βc|1)(α1|0+β1|1)(α2|0+β2|1)\displaystyle=(\alpha_{c}\ket{0}+\beta_{c}\ket{1})\otimes(\alpha_{1}\ket{0}+\beta_{1}\ket{1})\otimes(\alpha_{2}\ket{0}+\beta_{2}\ket{1}) (24)
=(αc|H+βc|V)(α1α2|00+α1β2|01+β1α2|10+β1β2|11)\displaystyle=(\alpha_{c}\ket{H}+\beta_{c}\ket{V})(\alpha_{1}\alpha_{2}\ket{00}+\alpha_{1}\beta_{2}\ket{01}+\beta_{1}\alpha_{2}\ket{10}+\beta_{1}\beta_{2}\ket{11})
=(αc|H+βc|V)(α1α2|l0+α1β2|l1+β1β2|l2+β1α2|l3)\displaystyle=(\alpha_{c}\ket{H}+\beta_{c}\ket{V})(\alpha_{1}\alpha_{2}\ket{l_{0}}+\alpha_{1}\beta_{2}\ket{l_{1}}+\beta_{1}\beta_{2}\ket{l_{2}}+\beta_{1}\alpha_{2}\ket{l_{3}})
HWP@θc,QWP@ζc|H(α1α2|l0+α1β2|l1+β1β2|l2+β1α2|l3)\displaystyle\xrightarrow{\text{HWP}@\theta_{c},\text{QWP}@\zeta_{c}}\ket{H}(\alpha_{1}\alpha_{2}\ket{l_{0}}+\alpha_{1}\beta_{2}\ket{l_{1}}+\beta_{1}\beta_{2}\ket{l_{2}}+\beta_{1}\alpha_{2}\ket{l_{3}})
HWPs@0,45,0,45|H(α1α2|l0)+|V(α1β2|l1)+|H(β1β2|l2)+|V(β1α2|l3)\displaystyle\xrightarrow{\text{HWPs}@0^{\circ},45^{\circ},0^{\circ},45^{\circ}}\ket{H}(\alpha_{1}\alpha_{2}\ket{l_{0}})+\ket{V}(\alpha_{1}\beta_{2}\ket{l_{1}})+\ket{H}(\beta_{1}\beta_{2}\ket{l_{2}})+\ket{V}(\beta_{1}\alpha_{2}\ket{l_{3}})
BD1(α2|H+β2|V)α1|l1+(α2|V+β2|H)β1|l3\displaystyle\xrightarrow{\text{BD${}_{1}$}}(\alpha_{2}\ket{H}+\beta_{2}\ket{V})\alpha_{1}\ket{l_{1}}+(\alpha_{2}\ket{V}+\beta_{2}\ket{H})\beta_{1}\ket{l_{3}}
HWP@θt2,QWP@ζt2α1|H|l1+β1|V|l3\displaystyle\xrightarrow{\text{HWP}@\theta_{t2},\text{QWP}@\zeta_{t2}}\alpha_{1}\ket{H}\ket{l_{1}}+\beta_{1}\ket{V}\ket{l_{3}}
BD2,HWP@45α1|V|l2+β1|H|l3\displaystyle\xrightarrow{\text{BD${}_{2}$},\text{HWP}@45^{\circ}}\alpha_{1}\ket{V}\ket{l_{2}}+\beta_{1}\ket{H}\ket{l_{3}}
BD3α1|V+β1|H\displaystyle\xrightarrow{\text{BD${}_{3}$}}\alpha_{1}\ket{V}+\beta_{1}\ket{H}
HWP@θt1,QWP@ζt1|H\displaystyle\xrightarrow{\text{HWP}@\theta_{t1},\text{QWP}@\zeta_{t1}}\ket{H}\

In our experiment, the projective measurement is performed on Pauli bases and the angle setting are listed in Table 3.

|φc\ket{\varphi_{c}} |V\ket{V} |H\ket{H} |+\ket{+} |\ket{-} |R\ket{R} |L\ket{L}
θc\theta_{c} 0 45 22.5 67.5 0 0
ζc\zeta_{c} 0 0 0 0 45 -45
|φ2\ket{\varphi_{2}} |0\ket{0} |1\ket{1} |+\ket{+} |\ket{-} |R\ket{R} |L\ket{L}
θt2\theta_{t2} 0 45 22.5 67.5 0 0
ζt2\zeta_{t2} 0 0 0 0 45 -45
|φ1\ket{\varphi_{1}} |0\ket{0} |1\ket{1} |+\ket{+} |\ket{-} |R\ket{R} |L\ket{L}
θt1\theta_{t1} 45 0 22.5 67.5 0 0
ζt2\zeta_{t2} 0 0 0 0 45 -45
Table 3: The setting of angles HWP and QWP to perform projective measurements of Pauli bases on control qubit, the first and second target qubits. For the first and second target qubits, |H(1)\ket{H(1)} and |V(0)\ket{V(0)} are the eigenbasis of Pauli-ZZ, |±=12(|H(1)±|V(0))\ket{\pm}=\frac{1}{\sqrt{2}}(\ket{H(1)}\pm\ket{V(0)}) are the eigenbasis of Pauli-XX and |R=12(|H(1)+i|V(0))\ket{R}=\frac{1}{\sqrt{2}}(\ket{H(1)}+i\ket{V(0)}) and |L=12(|H(1)i|V(0))\ket{L}=\frac{1}{\sqrt{2}}(\ket{H(1)}-i\ket{V(0)}) are the eigenbasis of Pauli-YY.

C.3 Characterization of Fredkin gate

We measure the truth table of Fredkin gate, which are the probabilities Pijk|ct1t2P_{ijk|ct_{1}t_{2}} of the outcome state in the computational basis |ijk\ket{ijk} with input state |ct1t2{|000,|001,|010,|011,|100,|101,|110,|111}\ket{ct_{1}t_{2}}\in\{\ket{000},\ket{001},\ket{010},\ket{011},\ket{100},\ket{101},\ket{110},\ket{111}\}, respectively. The measurement results are shown in Fig. 7 and the values of Pijk|ct1t2P_{ijk|ct_{1}t_{2}} are listed in Table 4. Then, we can calculate the classical fidelity FzzzF_{zzz} of the Fredkin gate [45]

Fzzz=18(P000|000+P001|001+P010|010+P011|011+P100|100+P110|101+P101|110+P111|111),F_{zzz}=\frac{1}{8}\left(P_{000|000}+P_{001|001}+P_{010|010}+P_{011|011}+P_{100|100}+P_{110|101}+P_{101|110}+P_{111|111}\right), (25)

and obtain Fzzz=0.9898±0.0003F_{zzz}=0.9898\pm 0.0003.

Refer to caption
Figure 7: Measurement results of the Fredkin gate in computational basis.
output input 000 001 010 011
000 0.976±0.0090.976\pm 0.009 0.0029±0.00050.0029\pm 0.0005 0.0005±0.00020.0005\pm 0.0002 0.00008±0.000080.00008\pm 0.00008
001 0.0054±0.00060.0054\pm 0.0006 0.990±0.0090.990\pm 0.009 0.0008±0.00020.0008\pm 0.0002 0.0017±0.00040.0017\pm 0.0004
010 0.0011±0.00030.0011\pm 0.0003 0.00008±0.000080.00008\pm 0.00008 0.990±0.0090.990\pm 0.009 0.0018±0.00040.0018\pm 0.0004
011 0.0011±0.00030.0011\pm 0.0003 0.0020±0.00040.0020\pm 0.0004 0.0061±0.00070.0061\pm 0.0007 0.994±0.0090.994\pm 0.009
100 0.015±0.0010.015\pm 0.001 0.0007±0.00030.0007\pm 0.0003 0.00008±0.000080.00008\pm 0.00008 0.0002±0.00020.0002\pm 0.0002
101 0.0002±0.00020.0002\pm 0.0002 0.0020±0.00040.0020\pm 0.0004 0.00016±0.000080.00016\pm 0.00008 0.0004±0.00020.0004\pm 0.0002
110 0.00008±0.000080.00008\pm 0.00008 0.0016±0.00040.0016\pm 0.0004 0.0026±0.00050.0026\pm 0.0005 0.0013±0.00030.0013\pm 0.0003
111 0.0006±0.00020.0006\pm 0.0002 0.0011±0.00030.0011\pm 0.0003 0.00008±0.000080.00008\pm 0.00008 0.0009±0.00020.0009\pm 0.0002
output input 100 101 110 111
000 0.016±0.0010.016\pm 0.001 0.00008±0.000080.00008\pm 0.00008 0.0002±0.00020.0002\pm 0.0002 0.0016±0.00030.0016\pm 0.0003
001 0.00008±0.000080.00008\pm 0.00008 0.0009±0.00020.0009\pm 0.0002 0.0021±0.00040.0021\pm 0.0004 0.0010±0.00030.0010\pm 0.0003
010 0.00008±0.000080.00008\pm 0.00008 0.0014±0.00030.0014\pm 0.0003 0.0004±0.00020.0004\pm 0.0002 0.00008±0.000080.00008\pm 0.00008
011 0.0024±0.00040.0024\pm 0.0004 0.0008±0.00020.0008\pm 0.0002 0.0003±0.00020.0003\pm 0.0002 0.0029±0.00050.0029\pm 0.0005
100 0.976±0.0090.976\pm 0.009 0.0002±0.00020.0002\pm 0.0002 0.0019±0.00040.0019\pm 0.0004 0.00008±0.000080.00008\pm 0.00008
101 0.0039±0.00060.0039\pm 0.0006 0.0003±0.00020.0003\pm 0.0002 0.99±0.010.99\pm 0.01 0.0007±0.00020.0007\pm 0.0002
110 0.0005±0.00020.0005\pm 0.0002 0.985±0.0090.985\pm 0.009 0.0010±0.00020.0010\pm 0.0002 0.0010±0.00020.0010\pm 0.0002
111 0.0010±0.00030.0010\pm 0.0003 0.011±0.0010.011\pm 0.001 0.0007±0.00020.0007\pm 0.0002 0.993±0.00090.993\pm 0.0009
Table 4: Truth tables of the Fredkin gate.

We also generate a three-qubit GHZ state by inputting |+10\ket{+10} into the Fredkin gate. The output state is

|GHZ3=12(|010+|101).\ket{\text{GHZ}_{3}}=\frac{1}{\sqrt{2}}(\ket{010}+\ket{101}). (26)

The fidelity of outcome state ρ\rho with respect to |GHZ3\ket{\text{GHZ}_{3}} is F=Tr(|GHZ3GHZ3|ρ)F=\text{Tr}\left(\ket{\text{GHZ}_{3}}\bra{\text{GHZ}_{3}}\rho\right), where |GHZ3GHZ3|\ket{\text{GHZ}_{3}}\bra{\text{GHZ}_{3}} can be decomposed into

|GHZ3GHZ3|=12(|010010|+|101101|)+18(XXX+XYYYXY+YYX).\ket{\text{GHZ}_{3}}\bra{\text{GHZ}_{3}}=\frac{1}{2}\left(\ket{010}\bra{010}+\ket{101}\bra{101}\right)+\frac{1}{8}\left(XXX+XYY-YXY+YYX\right). (27)

To calculate the fidelity FF, we first measure the probabilities of outcome state on computational basis, and the results are shown in Fig. 8(a). Then, we measure the expected values of observable XXXXXX, XYYXYY, YXYYXY and YYXYYX, and the results are shown in Fig. 8(b). Accordingly, we calculate the fidelity F=0.933±0.002F=0.933\pm 0.002. Using these data, we can estimate the process fidelity of Fredkin gate by [45]

Fprocess=12Fzzz+18(XXX+XYYYXY+YYX),F_{\text{process}}=\frac{1}{2}F_{zzz}+\frac{1}{8}\left(\langle XXX\rangle+\langle XYY\rangle-\langle YXY\rangle+\langle YYX\rangle\right), (28)

and obtain Fprocess=0.935±0.001F_{\text{process}}=0.935\pm 0.001.

Refer to caption
Figure 8: (a) Probabilities of the prepared GHZ state on computation bases, the black box represents the theoretical prediction of 0.5. (b) The expectation values of XXX\left<XXX\right>, XYY\left<XYY\right>, YYX\left<YYX\right>, YXY\left<YXY\right>.

Appendix D More experimental results of distillation

The estimators of Tr(Oρ2)\text{Tr}({O}\rho^{2}) and Tr(Oρ4)\text{Tr}({O}\rho^{4}) with HS are

O2^(HS)=1Mi[M]Tr[Oρ2^(i)].\widehat{O_{2}}_{(\text{HS})}=\frac{1}{M}\sum_{i\in\left[M\right]}{\text{Tr}[O\widehat{\rho^{2}}_{\left(i\right)}]}. (29)
O4^(HS)=1MMi[M],i[M]Tr[Oρ2^(i)ρ2^(i)].\widehat{O_{4}}_{(\text{HS})}=\frac{1}{MM^{\prime}}\sum_{i\in\left[M\right],i^{\prime}\in\left[M^{\prime}\right]}{\text{Tr}\left[{O}\widehat{\rho^{2}}_{\left(i\right)}\widehat{\rho^{2}}_{\left(i^{\prime}\right)}\right]}. (30)

The results of XVD(2)\langle X\rangle^{(2)}_{\text{VD}} and XVD(4)\langle X\rangle^{(4)}_{\text{VD}} are shown in Fig. 9. Indeed, the larger LL is, the more accuracy XVD(L)\langle X\rangle^{(L)}_{\text{VD}} is. To clarify this, we perform the VD of XVD(2)\langle X\rangle^{(2)}_{\text{VD}}, XVD(3)\langle X\rangle^{(3)}_{\text{VD}} and XVD(4)\langle X\rangle^{(4)}_{\text{VD}} with number of copies of N=2400,3600N=2400,3600 and 48004800 respectively, and the results are shown in Fig. 10. The accuracy of XVD(L)\langle X\rangle^{(L)}_{\text{VD}} increases with increasing LL either with HS and OS, however, the variance is smaller with HS compared to OS.

Refer to caption
Figure 9: Experimental results of virtual distillation of expected value of observable XX, with the estimator (a) X2^/P2^\widehat{X_{2}}/\widehat{P_{2}} and (c) X4^/P4^\widehat{X_{4}}/\widehat{P_{4}}. Estimation error of (b) X2^/P2^\widehat{X_{2}}/\widehat{P_{2}} and (d) X4^/P4^\widehat{X_{4}}/\widehat{P_{4}} to corresponding target values. The red and blue dots represent the results with HS and OS, respectively.
Refer to caption
Figure 10: Experimental results of virtual distillation of expected value of observable XVD(L)\langle X\rangle^{(L)}_{\text{VD}} with L=2,3L=2,3 and 4. The red and blue dots represent the results with HS and OS, respectively.