In part because "imagination" is a slippery notion, its exact role in the production of scientific knowledge remains unclear. There is, however, one often explicit and deliberate use of imagination by scientists that can be (and has been) studied intensively by epistemologists and historians of science: thought experiments. The main goal of this article is to document the varieties of thought experimentation, not so much in terms of the different sciences in which they occur but rather in terms of the different functions they fulfil. I argue that thought experimentation (and hence imagination) plays a role not only in theory choice but in singular causal analysis and scientific discovery as well. I pinpoint, moreover, some of the rules gove...