Quantum codes for quantum simulation of fermions on a square lattice of qubits