  We define thermodynamic configurations and identify two primitives of
discrete quantum processes between configurations for which heat and work can
be defined in a natural way. This allows us to uncover a general second law for
any discrete trajectory that consists of a sequence of these primitives,
linking both equilibrium and non-equilibrium configurations. Moreover, in the
limit of a discrete trajectory that passes through an infinite number of
configurations, i.e. in the reversible limit, we recover the saturation of the
second law. Finally, we show that for a discrete Carnot cycle operating between
four configurations one recovers Carnot's thermal efficiency.
