The computation of quadratic functionals of the solution to a linear stochastic partial differential equation with multiplicative noise is considered. An operator valued Lyapunov equation, whose solution admits a deterministic representation of the functional, is used for this purpose and error estimates are shown in suitable operator norms for a fully discrete approximation of this equation. Weak error rates are also derived for a fully discrete approximation of the stochastic partial differential equation, using the results obtained from the approximation of the Lyapunov equation. In the setting of finite element approximations, a computational complexity comparison reveals that approximating the Lyapunov equation allows for cheaper computation of quadratic functionals compared to applying Monte Carlo or covariance-based methods directly to the discretized stochastic partial differential equation. Numerical simulations illustrates the theoretical results.