How can an undergraduate be recognized for work done on a paper, with a fellow PhD student and a professor?
The best thing you can do to ensure your work is recognized and credited is to have honest, open communications with the other people you’re working with. So long as everybody’s clear on who is doing what, and everybody is acting ethically, you shouldn’t run into problems.