摘要:It is desirable to implement an efficient quantum information process demanding fewer quantum resources. We designed two compact quantum circuits for determinately implementing four-qubit Toffoli and Fredkin gates on single-photon systems in both the polarization and spatial degrees of freedom (DoFs) via diamond nitrogen-vacancy (NV) centers in resonators. The gates are heralded by the electron spins associated with the diamond NV centers. In contrast to the ones with one DoF, our implementations reduce the quantum resource and are robust against the decoherence. Evaluations of fidelities and efficiencies of our gates show that our schemes may be implemented with current technology.