  We have investigated the heralded generation of two-qubit dual-rail-encoded
states by programmable linear optics. Two types of schemes generating the
states from four single photons, which is the minimal possible to accomplish
the task, have been considered. The schemes have different detection patterns
heralding successful generation events, namely, one-mode heralding, in which
the two auxiliary photons are detected in one mode, and two-mode heralding, in
which single photons are detected in each of the two modes simultaneously. We
have shown that the dependence of the schemes' success probabilities on the
target state's degree of entanglement are essentially different. In particular,
one-mode heralding yields better efficiency for highly-entangled states, if the
programmable interferometers can explore the full space of the unitary transfer
matrices,. It is reversed in case of weakly-entangled states where two-mode
heralding is better. We have found a minimal decomposition of the scheme with
two-mode heralding that is programmed by one variable phase shift. We infer
that the linear optical schemes designed specifically for generation of
two-qubit states are more efficient than schemes implementing gate-based
circuits with known two-qubit linear optical gates. Our results yield
substantial reduction of physical resources needed to generate two-qubit
dual-rail-encoded photonic states.
