Skip to content
QFT.org

Search QFT.org

Enter a word or phrase.

    You can also browse the main navigation and chapter contents.

    Measuring Purity and Rényi Entropies

    Purity is nonlinear in a density matrix, but it is a linear expectation value on two independently prepared copies. This observation makes a Rényi entropy measurable without reconstructing every matrix element. The nonlinear logarithm still has a statistical cost: an unbiased purity estimate does not give an unbiased entropy estimate.

    Preparation: Reduced density matrices and elementary independent sampling. Use S2(ρ)=−log⁡tr⁡ρ2S_2(\rho)=-\log\operatorname{tr}\rho^2 in nats. The calculation below concerns a finite subsystem with a specified two-copy preparation and readout.

    Swap the subsystem, not the entire preparation

    Let VAV_A exchange the two copies of subsystem AA. In a basis,

    VA=∑ij∣i⟩⟨j∣⊗∣j⟩⟨i∣.V_A=\sum_{ij}|i\rangle\langle j|\otimes|j\rangle\langle i|.

    Direct multiplication gives

    tr⁡[VA(ρA⊗σA)]=∑ij(ρA)ji(σA)ij=tr⁡(ρAσA).\operatorname{tr}[V_A(\rho_A\otimes\sigma_A)] =\sum_{ij}(\rho_A)_{ji}(\sigma_A)_{ij} =\operatorname{tr}(\rho_A\sigma_A).

    For identical independent copies this is P=tr⁡ρA2P=\operatorname{tr}\rho_A^2. The same identity holds if the two complete systems are prepared independently and only AA is swapped. It does not require access to a decomposition of ρA\rho_A into pure states.

    Since VAV_A is Hermitian and unitary, a direct SWAP measurement has outcomes Y=±1Y=\pm1 with

    Pr⁡(Y=+1)=1+P2.\Pr(Y=+1)=\frac{1+P}{2}.

    Equivalently, an ancilla prepared in ∣+⟩|+\rangle controls the swap, and its XX readout has mean PP. This is an implementable two-copy observable when the required gates or interference measurement are available. It is not a cloning procedure for an unknown single specimen.

    Preparation matters. Nonidentical inputs estimate tr⁡(ρAσA)\operatorname{tr}(\rho_A\sigma_A), while correlated copies generally do not factorize and need not yield either purity. Likewise, in a field experiment, the regulator, selected modes and implementable subsystem swap must be specified before interpreting a finite measured number as a continuum entropy.

    One exact target and a shot model

    Prepare the pure two-qubit state

    ∣ψ⟩=0.7∣00⟩+0.3∣11⟩.|\psi\rangle=\sqrt{0.7}|00\rangle+\sqrt{0.3}|11\rangle.

    Its reduced state is ρA=diag⁡(0.7,0.3)\rho_A=\operatorname{diag}(0.7,0.3), so

    P=0.58,S2=−log⁡(0.58)=0.5447271754.P=0.58,\qquad S_2=-\log(0.58)=0.5447271754.

    For MM independent SWAP shots, let N+N_+ be the number of positive outcomes. Then

    N+∼Binomial⁡(M,0.79),P^=2N+M−1,N_+\sim\operatorname{Binomial}(M,0.79),\qquad \widehat P=\frac{2N_+}{M}-1, EP^=P,Var⁡(P^)=1−P2M.\mathbb E\widehat P=P,\qquad \operatorname{Var}(\widehat P)=\frac{1-P^2}{M}.

    The variance includes intrinsic quantum outcome fluctuations even with perfect gates and preparation. Device errors would be an additional model, not part of this ideal sampling distribution.

    The companion simulates 40,000 independent experiments at each shot count using a fixed retained random seed. It also computes the exact binomial distribution, rather than using the simulation alone as the statistical reference.

    Shots MMMean P^\widehat PSample standard deviationExact standard deviation
    1001000.5806850.5806850.0815960.0815960.0814620.081462
    100010000.5799640.5799640.0258430.0258430.0257600.025760
    10000100000.5800190.5800190.0081530.0081530.0081460.008146

    These are repeated-experiment statistics. The standard deviation in the table is the uncertainty of one experiment with MM shots, not the much smaller uncertainty in the tabulated mean over 40,000 repetitions.

    The logarithm introduces bias and a domain issue

    Expanding −log⁡(P+δP)-\log(P+\delta P) around PP gives, at large MM,

    Bias⁡(S^2)≃1−P22MP2,sd⁡(S^2)≃1−P2M P,S^2=−log⁡P^.\operatorname{Bias}(\widehat S_2)\simeq\frac{1-P^2}{2MP^2},\qquad \operatorname{sd}(\widehat S_2)\simeq\frac{\sqrt{1-P^2}}{\sqrt M\,P}, \qquad \widehat S_2=-\log\widehat P.

    The leading bias is positive because the logarithm with a minus sign is convex. At M=1000M=1000 the leading prediction is 0.0009863260.000986326, while the exact binomial positive-domain bias is 0.0009905950.000990595. At M=100M=100 they are 0.009863260.00986326 and 0.01032690.0103269; the difference resolves corrections to the large-sample expansion.

    There is a necessary qualification: P^\widehat P can be nonpositive, where the real logarithm is undefined. For this example the exact failure probability at M=100M=100 is 1.33446×10−101.33446\times10^{-10}; no such failure occurred in the retained simulations. Exact logarithmic moments quoted here are conditioned on P^>0\widehat P>0. Arbitrarily clipping invalid estimates would define a different biased estimator. The failure probability is negligible here, but cannot be ignored in a low-purity or low-shot experiment.

    Report an interval before taking a logarithm

    A conservative distribution-free bound follows from Y∈[−1,1]Y\in[-1,1]:

    Pr⁡(∣P^−P∣≥ϵ)≤2e−Mϵ2/2.\Pr\big(|\widehat P-P|\geq\epsilon\big) \leq2e^{-M\epsilon^2/2}.

    Thus an interval of half-width 2log⁡(2/δ)/M\sqrt{2\log(2/\delta)/M} has coverage at least 1−δ1-\delta. If the finite dimension dd is known, intersect it with the physical range [1/d,1][1/d,1]. For resulting endpoints Plo,Phi>0P_{\rm lo},P_{\rm hi}>0, transform the interval to

    −log⁡Phi≤S2≤−log⁡Plo.-\log P_{\rm hi}\leq S_2\leq-\log P_{\rm lo}.

    If the intersection is empty, report the inconsistency rather than manufacture an entropy value. This procedure separates a confidence statement from a point estimate. Tighter binomial intervals are possible without changing the observable.

    Summary

    The SWAP expectation measures purity directly on independent copies. Its shot estimator is unbiased with an exact variance, while its logarithm has bias and can leave its domain. These distinctions are already visible in a single reduced qubit.

    Exercises

    1. Show that a finite-dd maximally mixed subsystem requires a shot count of order d2d^2 for fixed relative precision in this simple SWAP protocol.
    Solution

    Here P=1/dP=1/d, while the purity standard deviation is approximately 1/M1/\sqrt M at large dd. The relative standard deviation is approximately d/Md/\sqrt M. Requiring it below a fixed ϵ\epsilon therefore needs MM of order d2/ϵ2d^2/\epsilon^2. Direct measurement of a nonlinear functional does not make all low-purity targets cheap.

    1. If the two preparations have diagonal weights (0.7,0.3)(0.7,0.3) and (0.6,0.4)(0.6,0.4), what is the SWAP expectation? Is it either preparation's purity?
    Solution

    The overlap is 0.7(0.6)+0.3(0.4)=0.540.7(0.6)+0.3(0.4)=0.54. The two purities are 0.580.58 and 0.520.52, respectively, so it is neither. The difference is a preparation mismatch, not a statistical bias of the SWAP estimator.

    References

    Scrollable formula. Use Left and Right arrow keys to reveal hidden content.

    Scrollable table. Use Left and Right arrow keys to reveal hidden columns.

    Scrollable figure. Use Left and Right arrow keys to reveal hidden content.