From: miha-q <> Date: Mon, 12 Feb 2024 19:26:56 +0000 (-0500) Subject: Mon Feb 12 02:26:56 PM EST 2024 X-Git-Url: http://www.foleosoft.com/?a=commitdiff_plain;h=c0d7d9c3df9e1bd85c99786dba7e440810fd28c7;p=QAnsel.git Mon Feb 12 02:26:56 PM EST 2024 --- diff --git a/src/QAnsel.c b/src/QAnsel.c index 6ee32a6..624e72e 100644 --- a/src/QAnsel.c +++ b/src/QAnsel.c @@ -429,7 +429,7 @@ void qansel_run(uint8_t qubitCount, uint8_t bitCount, QInstr* instr, uint8_t* re } cpx_t n; cpx_mtx_get(&stateVector, 0, j, &n); - printf(": %.2f%%\n", cpx_magsqr(&n) * 100); + printf(": %.1f%%\n", cpx_magsqr(&n) * 100); } } else if (strcmp(instr[i].n, "born") == 0) @@ -444,8 +444,8 @@ void qansel_run(uint8_t qubitCount, uint8_t bitCount, QInstr* instr, uint8_t* re prob += cpx_magsqr(&n); } } - printf("0: %.2f%%\n", (1 - prob) * 100.0); - printf("1: %.2f%%\n", prob * 100.0); + printf("0: %.1f%%\n", (1 - prob) * 100.0); + printf("1: %.1f%%\n", prob * 100.0); } else if (strcmp(instr[i].n, "hvar") == 0) { @@ -1321,14 +1321,14 @@ void process(int argc, char** argv) } if (fullSample == 255) { - printf(": %.2f%%\n", ((double)stats[i] / (double)shots) * (double)100); + printf(": %.1f%%\n", ((double)stats[i] / (double)shots) * (double)100); } } if (fullSample != 255) { double prob = ((double)count / (double)shots) * (double)100; - printf("0: %.2f%%\n", ((double)100)-prob); - printf("1: %.2f%%\n", prob); + printf("0: %.1f%%\n", ((double)100)-prob); + printf("1: %.1f%%\n", prob); } } else