Is it a good idea to express my gratitude to a co-author with a gift card? I am an undergraduate level student planning to put out a research paper for publication. The second author is a PhD student who has helped me to do much editing (including re-writing my entire paper into a concise and expressive form, and also the numerical simulation part). I think he helps me a lot. My friend suggests to me to buy him a gift card at the end to express my gratitude. I am wondering would this be a good idea or not?
Others may differ in opinion, but I personally think that gift cards are a poor choice for expressing personal gratitude.  The problem is that gift cards are effectively cash with spending restrictions.  Your colleague has invested time and energy in helping you, and giving cash would essentially be saying how much per hour you feel their time is worth.

Instead, I would recommend offering something like taking them out for a fancy lunch, which invests your time and gives the two of you a chance to do some informal bonding and building of your professional relationship.  Unless, of course you don't actually want to spend time alone with this colleague (many possible good reasons for that), in which case I would still recommend looking for some way to express gratitude that shows an investment of time and caring beyond just money.