| : Size of the population that is, number of individuals. |
| : Size of the Problem being solved that is, number of variables. |
| : Number of Rows |
| : Number of Columns |
| : Generation Counter. |
| : th -bit that stores the value of their and . |
| : th Quantum Individual comprising of their , where . |
| : Quantum Register that comprises of all the Quantum individuals, , where . |
| : th binary bit that stores the value of 0 or 1 formed by collapsing corresponding . |
| : th Binary Individual comprising of their , where . |
| : Binary Register that comprises of all the Binary individuals, , where . |
| : stores the best solution of all the Binary individuals, , where . |
| : Attractor Register that stores the attractor individual for every , where . |
| : current Global Best Solution. |
| NL: List of neighbors of all the individuals, , where . |
| Begin |
| t = 0; assign , , A, B; |
| (a) initialize Q(t); |
| (b) make P(t) by observing the states of Q(t); |
| (c) evaluate P(t); |
| (d) store the best solutions among P(t) into B(t); |
| (e) compute NL; |
| (f) store the best solution b amongst B(t); |
| while (termination condition is not met) do |
| begin |
| t = t + 1; |
| (g) select AR(t); |
| (h) update Q(t−1) according to P(t−1) and AR(t) using Q-gates; |
| (i) make P(t) by observing the states of Q(t); |
| (j) evaluate P(t); |
| (k) store the best solutions among P(t) and B(t−1) into B(t); |
| (l) stores the best solution b amongst B(t); |
| end |
| end |