Moved qubit array functions into setup