Fermionic and bosonic synthesis with optimal resource cost
We establish optimal worst-case non-Gaussian gate counts for exact state preparation and unitary synthesis in fermionic and bosonic systems, resolving natural analogues of the extensively studied qubit $T$-count problem where an exponential gap persists for general unitaries. Specifically, with Gaussian unitaries free, we prove optimal costs of $Θ(\sqrt D)$ for pure state preparation and $Θ(D)$ for unitary synthesis, where $D=2^n$ for $n$ fermionic modes and $D=2^q$ for $q$ bosonic dual-rail qubits. The cost counts uses of any given non-Gaussian gate that preserves fermion parity or total photon number, respectively. In both settings, our protocols employ a simple single-particle encoding scheme that maps each logical basis state to a distinct register mode so that passive Gaussian operations implement any target unitary directly, with non-Gaussian gates required only for target-independent encoding and decoding. Matching lower bounds follow from dimension counting and hold for almost every allowed target, even with arbitrarily many ancillary modes, adaptive Gaussian processing, and postselection. Furthermore, we show that coherent circuits obey a mode-gate tradeoff requiring exponential circuit width to reach these minimal gate counts, so our protocols simultaneously achieve optimality in gate cost and ancillary space.