Erdos[0] certainly felt his creativity was helped by caffeine (and amphetamines). From personal experience, math professors seem to be the most reliable academic users of nicotine and caffeine. I'm skeptical they are all deluding themselves.
However, after months of amphetamines I felt like I was a workhorse with no novel ideas or approaches, but still very efficient.
I've heard that mathematicians carry a well-tested mental toolset that enable them to solve all kinds of problems. So, perhaps if you have the right toolset and you just need to put work on an problem, amphetamines can work great.