// Find power of 2 that lies between n^2 and 2*n^2
+ // Making inverse discrete quantum fourier transform gate, same size as the register.
+ Gate iqft = new InverseQFT(q);
//Create an array of complex numbers large enough to represent q in a register
entangled = new Complex[(int)Math.pow(2,findRegisterSize(n))];
// control variables - either we're done or we're taking too long.
boolean done = false, fail = false;
// Tracking our iterations.
entangled[i] = new Complex();
inState = new QubitRegister(entangled);
- // Making inverse discrete quantum fourier transform gate, same size as the register.
- Gate iqft = new InverseQFT(inState.getLength());
// This will hopefully transform the register into a particular value...
inState = inState.multiply(iqft);