  In this paper we propose and analyze a feasible scheme where the detection of
a single scattered photon from two trapped atoms or ions performs a conditional
unitary operation on two qubits. As examples we consider the preparation of all
four Bell states, the reverse operation that is a Bell measurement, and a CNOT
gate. We study the effect of atomic motion and multiple scattering, by
evaluating Bell inequalities violations, and by calculating the CNOT gate
fidelity.
