From a2b3254a1859ac24cd0bee43d4a895a73a5b2a76 Mon Sep 17 00:00:00 2001 From: miha-q <> Date: Sun, 11 Feb 2024 19:58:55 -0500 Subject: [PATCH] Sun Feb 11 07:58:55 PM EST 2024 --- src/QAnsel.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/QAnsel.c b/src/QAnsel.c index e59b1c7..456f9f7 100644 --- a/src/QAnsel.c +++ b/src/QAnsel.c @@ -1250,7 +1250,8 @@ void process(int argc, char** argv) uint8_t* dat = malloc(instrLen * sizeof(QInstr)); memcpy(dat, instr, instrLen * sizeof(QInstr)); - for (uint32_t i = 0; i < 100; i++) + uint32_t shots = 100; + for (uint32_t i = 0; i < shots; i++) { qansel_run(qubitCount, bitCount, instr, bitVect, instrLen, doDisplay); memcpy(instr, dat, instrLen * sizeof(QInstr)); @@ -1270,7 +1271,7 @@ void process(int argc, char** argv) putchar('0' + (tmp >> (bitCount - 1) & 1)); tmp <<= 1; } - printf(": %.00f%%\n", (double)stats[i] / (double)10); + printf(": %.00f%%\n", ((double)stats[i] / (double)shots) * (double)100); } } else -- 2.39.5