[Retracted] Heuristic Reordering Strategy for Quantum Circuit Mapping on LNN Architectures
Algorithm 1
The global heuristic qubit reordering (GHQR) algorithm.
Step 1: Construct an array count of size n, and initialize the elements in it to 0; Traverse the quantum gate in circuit , let c and t be the control bit and target bit of respectively, count [c]+ = 1, count [t]+ = 1;
Step 2: Find the largest value in the set count, and assign its corresponding qubit to mcl;
Step 3: Construct a two-dimensional array cross of size n × n, and initialize its elements. to 0; Traverse the quantum gate in circuit , let c and t be the control bit and target bit of respectively, count[c, t]+ = 1, count[t, c]+ = 1;
Step 4: Initialize a vector new _ order to represent the rearranged qubit order, new _ order. push back (mcl), and for i = 0,1, 2, …, n, cross [i][mcl] = 0;
Step 5: Find the largest two values in an array cross [mcl][m1], cross [mcl ][m2] , new_order. push_back (m2), new_order. push_front(m1) , and for i = 0,1, 2, …, n, cross [i][m1] = 0,cross[i][m2] = 0;
Step 6: If the size of new.order is not equal to n, perform step 7; otherwise, go to step 10;
Step 7: Suppose there are two qubits top and bottom, representing the top and bottom qubits of the rearranged qubits, respectively, top = new_order. front(),bottom = new_order.back (). Find the maximum value in cross [top] and cross [bottom] respectively, cross [top][m1 ] and cross [bottom][m2], if m1 = m2, go to step 9, otherwise go to step 8;
Step 8: new_order. push_front (m1),new_order. push_back (m2), and for i = 0,1, 2, …, n, cross [i][m1] = 0, cross [i][m2] = 0, go to step 6;
Step 9: If cross [top][m1] > cross [bottom][m2], new_order. push_front (m1), otherwise new_order. push_back (m1), cross [i][m1] = 0, i = 0,1, 2, …, n, go to step 6;