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));
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