  We describe a joint cohomological framework for measurement-based quantum
computation (MBQC) and the corresponding contextuality proofs. The central
object in this framework is an element in the second cohomology group of the
chain complex describing a given MBQC. It contains the function computed, up to
gauge equivalence, and at the same time is a contextuality witness. The present
cohomological description only applies to temporally flat MBQCs, and we outline
an approach for extending it to the temporally ordered case.
