An ergodic L
2-theorem for inhomogeneous Markov chains covering simulated annealing with or without constraints and stochastic relaxation with or without constraints arising in Bayesian image reconstruction is proved. The derivation is self-contained.