# Quantum Capacity¶

The True-Qᵀᴹ Quantum Capacity (QCAP) tool provides a bound on the performance of a circuit performed under Randomized Compiling (RC). Performance evaluation is measured as the total variational distance (TVD) between the ideal bitstring distribution of the circuit and the empirical bitstring distribution measured by a quantum device.

For example, if the ideal distribution of measurement bitstrings of a 2-qubit circuit is {“00”: 0.5, “11”: 0.5} and in 1000 shots the results {“00”: 552, “01”: 21, “11”: 427}, then the TVD between these two distributions is $$(|0.5-0.552|+|0.021|+|0.5-0.427|/2=0.073)$$, which represents the estimate of a 7.3% chance of getting the wrong bitstring in a given shot. Of course, computing the ideal bitstring distribution involves a full quantum simulation, which is not scalable. QCAP is able to estimate an upper bound on the TVD without such a simulation by characterizing the error rate of each cycle in the circuit and combining the results. This upper bound assumes the the circuit is being run under randomized compiling.

Running make_qcap() on a circuit will return a collection of Cycle Benchmarking (CB) circuits for every cycle in the circuit. Running fit() on the circuit collection allows users to retrieve infidelities for each cycle in the circuit. To retrieve the bound on quantum capacity for the circuit, qcap_bound() should be used. This bound is calculated using the results of the generated Cycle Benchmarking (CB) experiments.

Note

The QCAP bound reported could more accurately be called an estimated upper bound, as it depends on experimental/simulator data, and will therefore return a slightly different value each time it is called for a given circuit. The qcap_bound() function returns an estimate of the TVD and the standard deviation corresponding to that estimate.