time at which fidelity peaks depends on all couplings $J_k$’s. We then average the fidelity $F(t_{opt})$ over several different realizations (we did for 100) of the system for a fixed $\epsilon$. In Fig. \[fig5\](c) we depict the fidelity $\la F(t_{opt}) \ra$ averaged over 100 different realization as a function of $\epsilon$ when the first qubit is projected into the state $|+\ra$. It is seen that although the average fidelity decreases by increasing the randomness the mechanism shows a relatively high resistance against this destructive effect as fidelity remains above $0.85$ even for twenty percent of randomness (i.e. $\epsilon=0.2$).

![(Color online) (a) Cold atoms in an optical lattice prepared in a Mott insulator phase with exactly one atom per site realizes the Heisenberg Hamiltonian of Eq. (\[H\]). A local focused laser beam is used to manipulate the first qubit for both the gate operation and spin measurement. (b) The single qubit measurement is accomplished by a perpendicular focused laser beam which applies a strong radiation pressure to the state $|\downarrow\ra$ and leaves the atom unaffected if its quantum state is $|\uparrow\ra$. (c) Two parallel arrays in a two dimensional optical lattice are used for entanglement distribution in which a Bell measurement 