-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Cross entropy benchmarking functionality does not match documentation #2757
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@viathor also to comment |
I believe the formula in the documentation is actually equivalent to what is being done in the code. This has been used on actual quantum processors and I have obtained fidelity numbers as expected. One can test the equivalence by generating bits using the Cirq simulator and compute the results using the code. If it is different than what you get out of implementing the formula in the documentation, please let me know. |
Circ cync: Looks like this is correct actually, @viathor will doublecheck and update status. |
@XiaoMiQC @kevinsung @dstrain115 Kevin is right. Docstring and code disagree. The former describes the linear cross-entropy benchmarking (which was our ultimate choice in QS experiment back in 2019). The fidelity estimate in this method is produced by averaging the expression OTOH, the code appears to use Vadim et al's Least Mean Square for XEB wherein the fidelity estimate is computed as the ratio I don't think it makes sense to change the code, but we should update the docstring. Also, it is worth noting that a number of XEB-based estimators of fidelity are implemented in fidelity_estimation.py. In particular, see Thus, some of the XEB functionality is unfortunately duplicated. What do y'all think about removing cross_entropy_benchmarking.py? Does anyone still use this code? Could they switch to the newer and more versatile alternative in fidelity_estimation.py and related(*) modules? (*) Note that fidelity_estimation.py has a narrower focus than cross_entropy_benchmarking.py. For example, it does not have code to generate RQCs. That said, AFAIK code to do all other XEB-related tasks exists elsewhere in cirq. |
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 30 days |
Issue closed due to inactivity. |
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 30 days |
Closes #2757. The "exp" suffix may be interpreted as either "experimental" or "expected" (as in "theoretically expected") which causes confusion that led to #2757. This PR changes the suffix to "th" (for "theoretical") which happens to be what is already used in the docstring. Also, added some missing docstrings.
) Closes quantumlib#2757. The "exp" suffix may be interpreted as either "experimental" or "expected" (as in "theoretically expected") which causes confusion that led to quantumlib#2757. This PR changes the suffix to "th" (for "theoretical") which happens to be what is already used in the docstring. Also, added some missing docstrings.
) Closes quantumlib#2757. The "exp" suffix may be interpreted as either "experimental" or "expected" (as in "theoretically expected") which causes confusion that led to quantumlib#2757. This PR changes the suffix to "th" (for "theoretical") which happens to be what is already used in the docstring. Also, added some missing docstrings.
) Closes quantumlib#2757. The "exp" suffix may be interpreted as either "experimental" or "expected" (as in "theoretically expected") which causes confusion that led to quantumlib#2757. This PR changes the suffix to "th" (for "theoretical") which happens to be what is already used in the docstring. Also, added some missing docstrings.
Documentation:
Cirq/cirq/experiments/cross_entropy_benchmarking.py
Line 107 in 1d35492
Code:
Cirq/cirq/experiments/cross_entropy_benchmarking.py
Lines 335 to 337 in 1d35492
In the code,
f_meas
seems to be a quite different thing from what's documented: it is obtained by estimating the experimental bitstring probabilitiesprob_meas
through a experimental histogram (note that most of these will be 0 at a modest number of qubits), and then multiplying that number by the theoretical probability.It appears that the documentation is based on the assumption of exponentially distributed (Porter-Thomas) probabilities, while the code is doing something else. Is that right?
@XiaoMiQC
The text was updated successfully, but these errors were encountered: