Skip to content

Commit 16ce9c4

Browse files
Debug mean-field mix-in
1 parent e007a85 commit 16ce9c4

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

scripts/fc_tn_qiskit_validation.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,16 +88,17 @@ def calc_stats(ideal_probs, exp_probs, shots, depth):
8888
# For QV, we compare probabilities of (ideal) "heavy outputs."
8989
# If the probability is above 2/3, the protocol certifies/passes the qubit width.
9090
n_pow = len(ideal_probs)
91-
mean_guess = 1 / n_pow
9291
n = int(round(math.log2(n_pow)))
92+
mean_guess = 1 / n_pow
93+
model = 1 / n
9394
threshold = statistics.median(ideal_probs)
9495
u_u = statistics.mean(ideal_probs)
9596
numer = 0
9697
denom = 0
9798
sum_hog_counts = 0
9899
sqr_diff = 0
99100
for i in range(n_pow):
100-
exp = exp_probs[i] if i in exp_probs else 0
101+
exp = (1 - model) * (exp_probs[i] if i in exp_probs else 0) + model * mean_guess
101102
ideal = ideal_probs[i]
102103

103104
# XEB / EPLG

0 commit comments

Comments
 (0)