Skip to content

Commit 40814e3

Browse files
Optimize tfim_validation.py
1 parent 9a46f16 commit 40814e3

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

scripts/tfim_validation.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -295,15 +295,14 @@ def main():
295295
m /= n_qubits
296296
sqr_magnetization_0 += value * m * m
297297

298-
c_magnetization, c_sqr_magnetization = 0, 0
298+
c_sqr_magnetization = 0, 0
299299
for p in range(1 << n_qubits):
300300
perm = p
301301
m = 0
302302
for _ in range(n_qubits):
303303
m += -1 if (perm & 1) else 1
304304
perm >>= 1
305305
m /= n_qubits
306-
c_magnetization += control_probs[p] * m
307306
c_sqr_magnetization += control_probs[p] * m * m
308307

309308
# Save the sum of squares and sum of square residuals on the magnetization curve values.

0 commit comments

Comments
 (0)