Solving Dirac equations on a 3D lattice with inverse Hamiltonian and spectral methods