The essential operations of a quantum computer can be accomplished using so
lely optical elements, with different polarization or spatial modes represe
nting the individual qubits. We present-a simple all-optical implementation
of Grover's algorithm for efficient searching, in which a database of four
elements is searched with a single query. By 'compiling' the actual set-up
, we have reduced the required number:of optical elements from 24 to only 1
2. We discuss the extension to large databases, and the limitations of thes
e techniques.