From e2deb4168e2b57fe9326e9a4d023cc0d0ec37818 Mon Sep 17 00:00:00 2001 From: miha-q <> Date: Thu, 15 Aug 2024 19:56:57 -0400 Subject: [PATCH] Thu Aug 15 07:56:57 PM EDT 2024 --- src/bytecode.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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++) -- 2.39.5