Quantum simulation of massive Thirring and Gross-Neveu models for arbitrary number of flavors