container
ΒΆ
Classical Shadow - Classical Shadow - Container
(qurry.process.classical_shadow.container
)
- class qurry.process.classical_shadow.container.ClassicalShadowBasic[source]ΒΆ
The basic information of the classical shadow.
- class qurry.process.classical_shadow.container.ClassicalShadowComplex[source]ΒΆ
The expectation value of Rho and the purity calculated by classical shadow.
- class qurry.process.classical_shadow.container.ClassicalShadowEstimation[source]ΒΆ
The esitimations of the classical shadow from classical snapshots.
Here, we use the notations that use in the supplementary material of [Predicting many properties of a quantum system from very few measurements](
- accuracy_predict_epsilon: floatΒΆ
The prediction of accuracy, which used the notation \(\epsilon\) and mentioned in Theorem S1 in the supplementary material, the equation (S13) in the supplementary material.
We can calculate the prediction of accuracy \(\epsilon\) from the equation (S13) in the supplementary material, the equation (S13) is as follows, .. math:
N = \frac{34}{\epsilon^2} \max_{1 \leq i \leq M} || O_i - \frac{\text{tr}(O_i)}{2^n} ||_{\text{shadow}}^2
where \(\epsilon\) is the prediction of accuracy, and \(M\) is the number of given operatorsm and \(N\) is the number of classical snapshots. The \(|| O_i - \frac{\text{tr}(O_i)}{2^n} ||_{\text{shadow}}^2\) is maximum shadow norm, which is defined in the supplementary material with value between 0 and 1.
- accuracy_prob_comp_delta: floatΒΆ
The probabiltiy complement of accuracy, which used the notation \(\delta\) and mentioned in Theorem S1 in the supplementary material, the equation (S13) in the supplementary material. The probabiltiy of accuracy is \(1 - \delta\).
The number of given operators and the accuracy parameters will be used to decide the number of estimators K from the equation (S13) in the supplementary material.
\[K = 2 \log(2M / \delta)\]where \(\delta\) is the probabiltiy complement of accuracy, and \(M\) is the number of given operators.
But we can see \(K\) will be not the integer value of the result of the equation. So, we will use the ceil value of the result of the equation. And recalculate the probabiltiy complement of accuracy from this new value of \(K\).
- corresponding_rhos: list[ndarray[tuple[int, ...], dtype[complex128]]]ΒΆ
The corresponding rho of measurement primitive \(\mathcal{U}\).
- epsilon_upperbound: floatΒΆ
The upper bound of the prediction of accuracy, which used the notation \(\epsilon\) and mentioned in Theorem S1 in the supplementary material, the equation (S13) in the supplementary material.
\[|| O ||_{\text{shadow}}^2 \leq 4^n || O ||_{\infty}^2\]where \(O\) is the any operator, and \(n\) is the number of qubits,
So we set the shadow norm as follows, .. math:
\chi = || O_i - \frac{\text{tr}(O_i)}{2^n} ||_{\text{shadow}} \\ \chi_{\infty} = 4^n || O_i - \frac{\text{tr}(O_i)}{2^n} ||_{\infty}^2 \\ \chi^2 \leq \chi_{\infty}
and we can simplify the equation to: .. math:
N = \frac{34}{\epsilon^2} \max_{1 \leq i \leq M} \chi^2 \leq \frac{34}{\epsilon^2} \max_{1 \leq i \leq M} \chi_{\infty}^2
Then get: .. math:
\epsilon \leq \sqrt{\frac{34}{N}} \max_{1 \leq i \leq M} \chi_\infty
- estimate_of_given_operators: list[complex128]ΒΆ
The esitmation values of measurement primitive \(\mathcal{U}\).
- maximum_shadow_norm: floatΒΆ
The maximum shadow norm, which is defined in the supplementary material. The maximum shadow norm is used to calculate the prediction of accuracy \(\epsilon\) from the equation (S13) in the supplementary material.
We can calculate the prediction of accuracy \(\epsilon\) from the equation (S13) in the supplementary material, the equation (S13) is as follows, .. math:
N = \frac{34}{\epsilon^2} \max_{1 \leq i \leq M} || O_i - \frac{\text{tr}(O_i)}{2^n} ||_{\text{shadow}}^2
where \(\epsilon\) is the prediction of accuracy, and \(M\) is the number of given operatorsm and \(N\) is the number of classical snapshots. The \(|| O_i - \frac{\text{tr}(O_i)}{2^n} ||_{\text{shadow}}^2\) is maximum shadow norm.
Due to its calculation is complex, we curently use the value of np.nan to represent the maximum shadow norm.
- num_of_estimators_k: intΒΆ
The number of esitmators, which used the notation K and mentioned in Algorithm 1 in the paper, Theorem S1 in the supplementary material, the equation (S13) in the supplementary material.
We can calculate the number of esitmator K from the equation (S13) in the supplementary material, the equation (S13) is as follows, .. math:
K = 2 \log(2M / \delta)
where \(\delta\) is the probabiltiy complement of accuracy, and \(M\) is the number of given operators.
But we can see \(K\) will be not the integer value of the result of the equation. So, we will use the ceil value of the result of the equation. And recalculate the probabiltiy complement of accuracy from this new value of \(K\).
- shadow_norm_upperbound: floatΒΆ
The largest shadow norm upper bound is defined as follows, .. math:
|| O ||_{\text{shadow}}^2 \leq 4^n || O ||_{\infty}^2
where \(O\) is the operator, and \(n\) is the number of qubits, which mentioned in the paper at Theorem 1 (informal version).
This is the worst scenario of the shadow norm for its scaling can be reduced to \(3^n || O ||_{\infty}^2\), which is the significantly lower bound than the worst case scenario.