  We propose and analyse a scheme for single-rail-encoded arbitrary multi-qubit
quantum-state generation to provide a versatile tool for quantum optics and
quantum information applications. Our scheme can be realized, for small numbers
of qubits, with current technologies using single photon inputs, passive linear
optics, and heralding measurements. The particular examples of two- and
three-qubit cluster states are studied in detail. We show that such states can
be prepared with a high probability of success. Our analysis quantifies the
effects of experimentally relevant imperfections and inefficiencies. The
general case of arbitrary N-qubit preparation is discussed and some interesting
connections to the boson sampling problem are given.
