Using a publicly available code and modifying it to my PhD thesis. Should it be cited in the paper if I have modified the core equation?
If you borrowed something from another source and modified it, you should definitely cite the original source in your paper.