The mathematical definition is simple (and analogous to the so-called Wilson loop in quantum chromodynamics): One considers for example expressions ("total energies" or "Hamiltonians") of the form
where G is the graph considered, whereas the quantities  are the so-called "exchange energies" between nearest-neighbours, which (in the energy units considered) assume the values ±1 (mathematically, this is a signed graph), while the  are inner products of scalar or vectorial spins or pseudo-spins. If the graph G has quadratic or triangular faces P, the so-called "plaquette variables" P, "loop-products" of the following kind, appear:
: and  respectively,
which are also called "frustration products". One has to perform a sum over these products, summed over all plaquettes. The result for a single plaquette is either +1 or −1. In the last-mentioned case the plaquette is "geometrically frustrated".
It can be shown that the result has a simple gauge invariance: it does not change &ndash; nor do other measurable quantities, e.g. the "total energy"  – even if locally the exchange integrals and the spins are simultaneously modified as follows:
Here the numbers ε and ε are arbitrary signs, i.e. +1 or −1, so that the modified structure may look totally random.