  We consider two qubits interacting by means of an optical cavity, where each
qubit is represented by a single electron spin confined to a quantum dot. It is
known that electron spins in III-V semiconductor quantum dots are affected by
the decoherence due to the hyperfine interaction with nuclear spins. Here we
show that the interaction between two qubits is influenced by the Overhauser
field as well. Starting from an unpolarizied nuclear ensemble, we investigate
the dependance of the fidelities for two-qubit gates on the Overhauser field.
We include the hyperfine interaction perturbatively to second order in our
analytical results, and to arbitrary precision numerically.
