  Two-state models provide phenomenological descriptions of many different
systems, ranging from physics to chemistry and biology. We investigate work
fluctuations in an ensemble of two-state systems driven out of equilibrium
under the action of an external perturbation. We calculate the probability
density P(W) that a work equal to W is exerted upon the system along a given
non-equilibrium trajectory and introduce a trajectory thermodynamics formalism
to quantify work fluctuations in the large-size limit. We then define a
trajectory entropy S(W) that counts the number of non-equilibrium trajectories
P(W)=exp(S(W)/kT) with work equal to W. A trajectory free-energy F(W) can also
be defined, which has a minimum at a value of the work that has to be
efficiently sampled to quantitatively test the Jarzynski equality. Within this
formalism a Lagrange multiplier is also introduced, the inverse of which plays
the role of a trajectory temperature. Our solution for P(W) exactly satisfies
the fluctuation theorem by Crooks and allows us to investigate
heat-fluctuations for a protocol that is invariant under time reversal. The
heat distribution is then characterized by a Gaussian component (describing
small and frequent heat exchange events) and exponential tails (describing the
statistics of large deviations and rare events). For the latter, the width of
the exponential tails is related to the aforementioned trajectory temperature.
Finite-size effects to the large-N theory and the recovery of work
distributions for finite N are also discussed. Finally, we pay particular
attention to the case of magnetic nanoparticle systems under the action of a
magnetic field H where work and heat fluctuations are predicted to be
observable in ramping experiments in micro-SQUIDs.
