Upon entangling a spatial binary alternative of a photon with its polarizat
ion, one can use single photons to study arbitrary 2-qubit states. Sending
the photon through a Mach-Zehnder interferometer, equipped with sets of wav
e plates that change the polarization, amounts to performing a unitary tran
sformation on the 2-qubit state. We show that any desired unitary gate can
be realized by a judicious choice of the parameters of the setup and discus
s a number of applications. They include the diagnosis of an unknown 2-qubi
t state, an optical Grover search, and the realization of a thought experim
ent invented by Vaidman. Aharonov. and Albert.