This book gathers the lecture notes of courses given at the 2011 summer school in theoretical physics in Les Houches, France, Session XCVI. What is a quantum machine? Can we say that lasers and transistors are quantum machines? After all, physicists advertise these devices as the two main spin-offs of the understanding of quantum mechanical phenomena. However, while quantum mechanics must be used to predict the wavelength of a laser and the operation voltage of a transistor, it does not intervene at the level of the signals processed by these systems. Signals involve macroscopic collective variables like voltages and currents in a circuit or the amplitude of the oscillating electric field in an electromagnetic cavity resonator. In a true quantum machine, the signal collective variables, which both inform the outside on the state of the machine and receive controlling instructions, must themselves be treated as quantum operators, just as the position of the electron in a hydrogen atom. Quantum superconducting circuits, quantum dots, and quantum nanomechanical resonators satisfy the definition of quantum machines. These mesoscopic systems exhibit a few collective dynamical variables, whose fluctuations are well in the quantum regime and whose measurement is essentially limited in precision by the Heisenberg uncertainty principle. Other engineered quantum systems based on natural, rather than artificial degrees of freedom can also qualify as quantum machines: trapped ions, single Rydberg atoms in superconducting cavities, and lattices of ultracold atoms. This book provides the basic knowledge needed to understand and investigate the physics of these novel systems.