Optical lattice is one of the promising candidates for realizing quantum computation due to the long decoherence time and manipulation techniques available. However, the generation of entanglement between qubits is still a challenging problem in optical lattice. In this thesis we perform the numerical simulation on an optical lattice of double well, and optimize the transportation for the preparation of entanglement between two qubits by Krotov's method. In the future we may use this entangled state to create the fundamental quantum logic gate.