#include struct quantum_reg { int size; unsigned *state; }; void main () { int i, j, k, m; struct quantum_reg reg; reg.size = 2048; reg.state = (unsigned *)malloc(2048* sizeof(unsigned)); for (i=0; i<100; i++) { for (j=1000; j>0; j--) { #pragma unroll(4) for (k=0; k<100*reg.size; k++) { m = k % 2048; if(reg.state[m] & ((unsigned) 1 << i)) { if(reg.state[m] & ((unsigned) 1 << j)) { reg.state[m] ^= ((unsigned) 1 << (i+j)); } } } } } printf ("%d, %d, %u\n", reg.size, reg.state[80], reg.state[999]); }