  We consider a general network of harmonic oscillators driven out of thermal
equilibrium by coupling to several heat reservoirs at different temperatures.
The action of the reservoirs is implemented by Langevin forces. Assuming the
existence and uniqueness of the steady state of the resulting process, we
construct a canonical entropy production functional which satisfies the
Gallavotti--Cohen fluctuation theorem, i.e., a global large deviation principle
with a rate function I(s) obeying the Gallavotti--Cohen fluctuation relation
I(-s)-I(s)=s for all s. We also consider perturbations of our functional by
quadratic boundary terms and prove that they satisfy extended fluctuation
relations, i.e., a global large deviation principle with a rate function that
typically differs from I(s) outside a finite interval. This applies to various
physically relevant functionals and, in particular, to the heat dissipation
rate of the network. Our approach relies on the properties of the maximal
solution of a one-parameter family of algebraic matrix Riccati equations. It
turns out that the limiting cumulant generating functions of our functional and
its perturbations can be computed in terms of spectral data of a Hamiltonian
matrix depending on the harmonic potential of the network and the parameters of
the Langevin reservoirs. This approach is well adapted to both analytical and
numerical investigations.
