Hi Shiyi Qin,
There is more than one way to write a mathematical formula. If there are differences, like a negative sign or constant, they will be accounted for in another place. Unfortunately, I don’t have time to track down these differences for you. If you really want to understand the Ewald summation, I would recommend that you do a literature search. You could also take a look in the book: Understanding Molecular Simulation: From Algorithms to Applications, by Frenkel and Smit.