An Efficient Quantum Classifier Based on Hamiltonian Representations