From: miha-q <> Date: Thu, 15 Aug 2024 23:56:57 +0000 (-0400) Subject: Thu Aug 15 07:56:57 PM EDT 2024 X-Git-Url: http://www.foleosoft.com/?a=commitdiff_plain;h=e2deb4168e2b57fe9326e9a4d023cc0d0ec37818;p=QAnsel.git Thu Aug 15 07:56:57 PM EDT 2024 --- diff --git a/src/bytecode.c b/src/bytecode.c index 5b87e0b..e9b9552 100644 --- a/src/bytecode.c +++ b/src/bytecode.c @@ -742,7 +742,7 @@ void qansel_born(QAnselContext* ctx, cpx_mtx_t* stateVector, int PC, int qubitCo int maxi = -1; for (int j = 0; j < qubitCountPow2; j++) { - if (psisquared[j] > max) + if (psisquared[j] >= max) { max = psisquared[j]; maxi = j; @@ -755,6 +755,10 @@ void qansel_born(QAnselContext* ctx, cpx_mtx_t* stateVector, int PC, int qubitCo } //for (int i = 0; i < qubitCountPow2; i++) printf("]%i -> %i: %f[\n", rsorting[i], sorting[i], psisquared_sorted[i]); free(psisquared); + for (int i = 0; i < qubitCountPow2; i++) + { + printf("]%f[\n", psisquared_sorted[i]); + } unsigned short *stats = malloc(sizeof(unsigned short) * qubitCountPow2); for (int i = 0; i < qubitCountPow2; i++) stats[i] = 0; for (int i = 0; i < (ctx->bsampling_shots); i++)