How do I tell my PhD advisor that I'm about to start medications that impair my cognition? So I'm bipolar, and earlier this year my doctor put me on antipsychotics.  They made it really hard for me to think, and my advisor expressed frustration with me not doing calculations fast enough, and not being able to keep our entire project in my head at once.  (I didn't tell him about the medication.)

This summer my doctor switched me to antidepressants, and I instantly became smarter and more productive, and my advisor became a lot happier with me.  But it looks like I'm having a hypomanic episode, so my doctor will probably want me to restart antipsychotics when I see her this week.

How should I explain to my advisor that I'm about to become stupid again, possibly for the rest of my time in grad school?  I have a wonderful advisor who seems to genuinely care for my well-being, but I'm afraid he might fire me if he thinks I'll be permanently unproductive.
In the UK, disability legislation says an employer has to make 'reasonable accomodations' for long term health issues like yours. Mental health problems are (sadly) not uncommon in academia. It sounds like you get on well enough with your supervisor that you could just tell him what's up. If you're not comfortable with that, you might consider going through more official channels.