From: miha-q <> Date: Mon, 12 Feb 2024 00:58:55 +0000 (-0500) Subject: Sun Feb 11 07:58:55 PM EST 2024 X-Git-Url: http://www.foleosoft.com/?a=commitdiff_plain;h=a2b3254a1859ac24cd0bee43d4a895a73a5b2a76;p=QAnsel.git Sun Feb 11 07:58:55 PM EST 2024 --- 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