---
title: Contextuality Index Overview
url: https://www.emergentmind.com/topics/contextuality-index
type: topic
---

# Contextuality Index Overview

A **contextuality index** is a scalar quantity that quantifies the degree to which an empirical model, measurement system, or geometric configuration fails to admit a noncontextual description. In the literature, the term does not denote a single universal invariant. Instead, it names several inequivalent constructions: convex-decomposition measures such as the contextual fraction, coupling-based deficits in Contextuality-by-Default (CbD), resource-theoretic quantities such as the rank of contextuality, and geometric indices derived from projector overlaps, coset commutation, or holonomy [1103.3980] [1504.00530] [2205.10307] [2604.23898]. This suggests that the phrase is best understood as a family of quantitative formalisms attached to different notions of noncontextuality.

## 1. Conceptual scope and representative forms

All contextuality indices replace a binary verdict—contextual versus noncontextual—by a graded quantity. The common structure is a comparison between observed data and an admissible noncontextual model. What varies is the mathematical object being compared: a convex decomposition, a global coupling, a nonnegative factorization, or a geometric obstruction.

Representative forms appear throughout the literature.

| Family | Representative formula | Vanishing criterion |
|---|---|---|
| Convex decomposition | $\lambda^*(e)=\min\{\lambda\in[0,1]\mid e=(1-\lambda)e^{NC}+\lambda e^C\}$ | $\lambda^*(e)=0$ iff a noncontextual model suffices |
| CbD / coupling | $\Delta^*=\min_S \sum [\,w_q(c,c')-\Pr(S_q^c=S_q^{c'})\,]$ | $\Delta^*=0$ iff an overall coupling attains all maximal couplings |
| Generalized CHSH-CbD | $C_{\rm gen}=\max\{0,S-\mathrm{ICC}-2\}$ | $C_{\rm gen}=0$ iff contextuality is absent beyond marginal inconsistency |
| Resource-theoretic | $\mathrm{RC}_2(P)=\log_2(\mathrm{RC}(P))$ | $\mathrm{RC}_2(P)=0$ iff $P$ is noncontextual |
| Rank-based | $\Delta_{\rm rank}(C)=\min_{C=FE}\bigl[\max\{\mathrm{rank}(F),\mathrm{rank}(E)\}-\mathrm{rank}(C)\bigr]$ | $\Delta_{\rm rank}(C)=0$ iff a noncontextual model exists |
| Projector-geometric | $S_2(G_\alpha)=-\log_2 E(G_\alpha)$ | $S_2=0$ iff the projector families coincide and commute |
| Incidence-geometric | $c(\mathcal G)=(\ell-u)/\ell$ | $c(\mathcal G)=0$ iff all lines are coset-commuting |
| Holonomy-based | $\kappa_{\rm avg}=\frac1{|\Cyc|}\sum_{C\in\Cyc}\iota(C)$ | $\kappa_{\rm avg}=0$ iff all chosen cycles are flat |

A recurrent misconception is that contextuality should always be identified with a single Bell- or Kochen–Specker-type inequality violation. The literature instead contains indices adapted to inconsistent connectedness, continuous outcomes, nonnegative matrix factorizations, and state-independent geometry. Another recurrent misconception is that context-dependence and contextuality are the same; the CbD literature explicitly separates direct influences in the marginals from genuinely contextual incompatibility.

## 2. Convex-decomposition indices and the contextual fraction

One of the earliest explicit quantitative proposals is Svozil’s contextuality index, defined as the minimal fraction of contextual assignments required in a convex decomposition of an empirical model. If
\[
e=(1-\lambda)e^{NC}+\lambda e^C,
\]
with $e^{NC}$ noncontextual and $e^C$ an arbitrary remainder, then
\[
\lambda^*(e)=\min\Bigl\{\lambda\in[0,1]\mid e=(1-\lambda)e^{NC}+\lambda e^C\Bigr\}.
\]
Svozil interprets $\lambda^*(e)$ as the minimal probability of “necessary violations of noncontextual assignments” [1103.3980].

In the CHSH scenario, with
\[
S=E(a,b)+E(a,b')+E(a',b)-E(a',b'),
\]
classical models satisfy $S\le 2$, while the algebraic maximum is $4$. For an observed value $S_{\rm obs}$ with $2<S_{\rm obs}\le 4$,
\[
\lambda=\frac{S_{\rm obs}-2}{2}.
\]
At Tsirelson’s bound $S_{\rm obs}=2\sqrt2$, this gives $\lambda^*=\sqrt2-1\approx 0.4142$; at $S_{\rm obs}=4$, one has $\lambda^*=1$; and at $S_{\rm obs}=2$, one has $\lambda^*=0$ [1103.3980]. The same source states that this index is effectively the same quantity later called the contextual fraction.

The continuous-variable extension defines the **noncontextual fraction**
\[
\NCF(e)=\sup\Bigl\{\mu(O_X)\mid \mu\in \mathrm{Meas}(\mathcal O_X),\ \forall C\in\mathcal M:\ \mu|_C\le e_C\Bigr\},
\]
and the **contextual fraction**
\[
\CF(e)=1-\NCF(e)\in[0,1].
\]
In that framework, the Fine–Abramsky–Brandenburger theorem extends to continuous-variable scenarios, and Bell nonlocality remains a special case of contextuality [1905.08267]. The same work states that the maximum normalised violation of any Bell-type or noncontextual inequality is precisely $\CF(e)$, and that $\CF$ is a non-increasing monotone under classical operations, including outcome coarse-graining by binning. Numerically, the continuous-variable problem becomes an infinite linear program, which is then approximated by a hierarchy of semidefinite relaxations via Lasserre–Parrilo methods [1905.08267].

These convex-decomposition indices are especially useful when the intended meaning of “amount of contextuality” is a minimal contextual resource share. Their operational reading is explicit: they ask what fraction of the observed behaviour cannot be accounted for by any noncontextual component.

## 3. Coupling-based indices in Contextuality-by-Default

CbD begins from a different premise: random variables are indexed by both **content** and **context**. A system is written as
\[
\{R_q^c : q\prec c\},
\]
with each context $c$ giving a jointly distributed bunch, while variables in different contexts are stochastically unrelated. Noncontextuality is defined through the existence of a single global coupling whose content-sharing marginals are as equal as they can possibly be [2104.12495].

For a content $q$ appearing in two contexts $c\neq c'$, a coupling of $R_q^c$ and $R_q^{c'}$ is chosen to maximize the probability of equality. For finite outcome sets $\mathcal A$,
\[
w_q(c,c')=\max \Pr[\tilde R_q^c=\tilde R_q^{c'}]
=\sum_{a\in\mathcal A}\min\{\Pr[R_q^c=a],\Pr[R_q^{c'}=a]\}.
\]
A system is noncontextual if there exists an overall coupling $S=\{S_q^c\}$ such that each context marginal is preserved and every pair $(S_q^c,S_q^{c'})$ attains the corresponding maximal coincidence probability $w_q(c,c')$ [2104.12495].

When no such coupling exists, the contextuality index is the minimal total shortfall:
\[
\Delta^*
=
\min_{S}
\sum_{q,\ c\neq c'}
\Bigl[w_q(c,c')-\Pr(S_q^c=S_q^{c'})\Bigr].
\]
Equivalently, for dichotomous variables, one may express the objective through mismatch probabilities. The same source gives a linear-program formulation over the global assignment probabilities $p(\mathbf s)$ and notes that the constraints and objective are linear [2104.12495].

For cyclic-4 systems, the CbD literature isolates the effect of inconsistent connectedness through
\[
\mathrm{ICC}
=
|\langle R_1^1\rangle-\langle R_1^4\rangle|
+
|\langle R_2^1\rangle-\langle R_2^2\rangle|
+
|\langle R_3^2\rangle-\langle R_3^3\rangle|
+
|\langle R_4^3\rangle-\langle R_4^4\rangle|.
\]
The generalized noncontextuality criterion is
\[
S-\mathrm{ICC}\le 2,
\]
and the corresponding generalized contextuality index is
\[
C_{\rm gen}=\max\{0,S-\mathrm{ICC}-2\}.
\]
When the system is consistently connected, $\mathrm{ICC}=0$ and $C_{\rm gen}$ reduces to the traditional excess over the CHSH bound [1508.04751].

A related proposal measures contextuality by the minimal distance to an approximating noncontextual single-indexed system. There the index is
\[
\Delta^*=A_*-A_0(R),
\]
where $A_*$ is the minimum total context-wise mismatch from any single-indexed approximation and $A_0(R)$ is the mismatch forced by inconsistent marginals alone. This measure agrees with a CbD measure whenever each property enters in exactly two contexts and extends the negative-probability approach to inconsistently connected systems [1512.02340].

Another important result is the coincidence, in Leggett–Garg and EPR–Bell systems, between the CbD mismatch index and a negative-probability index based on minimizing the $L_1$ norm of a signed joint distribution. In the normalization used there, both reduce to $\max\{0,S-1\}$ [1406.3088].

## 4. Resource-theoretic, rank-based, and dimension-normalized indices

The **rank of contextuality** introduces a resource-theoretic perspective. For a behaviour $P$, $\mathrm{RC}(P)$ is the minimum number of noncontextual behaviours needed so that, for every context $X$, some noncontextual behaviour in the chosen set reproduces $P(\cdot\mid X)$. Its logarithmic version is
\[
\mathrm{RC}_2(P)=\log_2(\mathrm{RC}(P)).
\]
This quantity is faithful, monotone under free operations, and additive under tensor products:
\[
\mathrm{RC}(P\otimes Q)=\mathrm{RC}(P)\,\mathrm{RC}(Q),
\qquad
\mathrm{RC}_2(P\otimes Q)=\mathrm{RC}_2(P)+\mathrm{RC}_2(Q).
\]
Operationally, $\mathrm{RC}_2$ is a memory cost: it is the logarithm of the number of noncontextual internal states needed by a simulator [2205.10307].

The same framework gives explicit examples. For a $k$-cycle behaviour,
\[
\mathrm{RC}(k\text{-cycle})=2,\qquad \mathrm{RC}_2(k\text{-cycle})=1.
\]
For behaviours on complete bipartite graphs,
\[
\mathrm{RC}(K_{m,n}\text{-behaviour})=
\Bigl\lceil\frac{mn}{m+n-1}\Bigr\rceil.
\]
More generally, for any graph $G$, there exists a contextual behaviour $P_G$ such that
\[
\mathrm{RC}(P_G)=\Upsilon(G),
\]
where $\Upsilon(G)$ is the arboricity of $G$ [2205.10307].

A different rank-based construction starts from a prepare-and-measure **COPE matrix**
\[
C=[\,p(k\mid i)\,].
\]
An ontological model is an exact nonnegative matrix factorization $C=FE$, and noncontextuality is characterized by the existence of such a factorization with
\[
\mathrm{rank}(F)=\mathrm{rank}(E)=\mathrm{rank}(C).
\]
The **rank-separation index**
\[
\Delta_{\rm rank}(C)=
\min_{C=FE,\ F,E\ge 0}
\bigl[\max\{\mathrm{rank}(F),\mathrm{rank}(E)\}-\mathrm{rank}(C)\bigr]
\]
therefore quantifies the minimal extra hidden-variable dimension beyond the linear dimension of the statistics. It vanishes if and only if the experiment admits a noncontextual model, and the same work states that it is monotone under classical pre- and post-processing [2406.19382].

The literature also contains dimension-normalized witnesses. In high-dimensional contextuality concentration, a family of inequalities with noncontextual bound $C_d$ and quantum bound $Q_d$ yields the **Contextuality Index**
\[
\eta(d)=\frac{Q_d-C_d}{d}.
\]
For the family considered there, with $d=2^n-1$ and $n$ odd,
\[
\eta(d)
=
\frac{2^{n-1}-\bigl(2^{n-2}+2^{\frac{n-3}{2}}\bigr)}{2^n-1},
\]
and asymptotically
\[
\eta(d)\to \frac14.
\]
The intended meaning is “contextuality packed per dimension,” i.e. a quantum–classical gap normalized by Hilbert-space dimension [2209.02808].

## 5. Geometric and state-independent contextuality indices

A state-independent projector-geometric construction is organized around the overlap matrix
\[
T_{ij}=\frac1d\,\mathrm{Tr}[(P_iQ_j)^2],
\]
where $P_i$ and $Q_j$ are the joint-eigenspace projectors associated with two compatible observable pairs within a context. Its scalar contraction
\[
E(G_\alpha)=\sum_{i,j}T_{ij}
\]
lies in $[1/d,1]$, and the logarithmic form
\[
S_2(G_\alpha)=-\log_2 E(G_\alpha)
\]
is explicitly called a contextuality index. It is state-independent, basis-invariant, and monotone under coarse-graining. The same work proves that $S_2(G)=0$ implies the existence of a noncontextual hidden-variable model for the collection of contexts $G$, so $S_2(G)>0$ is a necessary condition for any state-dependent witness to fire [2604.23898].

For the spin-1 KCBS pentagon, each context contributes
\[
S_2(G_\alpha)\approx 0.5453\ \text{bits},
\]
and the total is
\[
S_2(G_{\rm KCBS})\approx 2.7266\ \text{bits}.
\]
In that realization, the shared $m_s=0$ eigenstate forces $c_{\rm MU}=1$, so Maassen–Uffink-type entropic bounds are trivial, yet $S_2>0$ throughout. Applied to CHSH, the same framework identifies regimes in which $\chi$, contextual fraction, entropic witnesses, and the operational commutator witness are silent while $S_2(G)>0$ remains positive by projector geometry alone [2604.23898].

Planat’s incidence-geometric construction defines
\[
c(\mathcal G)=\frac{\ell-u}{\ell},
\]
where $\ell$ is the total number of lines in an incidence geometry and $u$ is the number of lines whose points pairwise commute in the group-theoretic sense. An alternative unnormalized ratio is
\[
K(\mathcal G)=\ell/u.
\]
For Mermin’s square, $\ell=6$ and $u=5$, giving $c=1/6$; for Mermin’s pentagram, $\ell=5$ and $u=2$, giving $c=3/5$ [1411.7704].

A more recent geometric generalization appears in group-valued Boltzmann machines. For an oriented simple cycle
\[
C=(i_1\to i_2\to\cdots\to i_k\to i_1),
\]
with group-valued edge weights, the holonomy is
\[
\Hol(C)=\prod_{r=1}^k w_{i_r,i_{r+1}}.
\]
Cycle-wise deviation from flatness is
\[
\iota(C)=d_G(\Hol(C),e_G),
\]
and global indices include
\[
\kappa_{\rm avg}=\frac1{|\Cyc|}\sum_{C\in\Cyc}\iota(C),
\qquad
\kappa_{\max}=\max_{C\in\Cyc} d_G(\Hol(C),e_G).
\]
For compact matrix groups there is also a trace-based Berry-type index built from $|\arg(\mathrm{Tr}(\Hol(C)))|$. The intended interpretation is an obstruction to finding a global trivialization, equivalently a discrete curvature signal [2509.10536].

## 6. Extensions, applications, and cross-disciplinary use

Contextuality indices have been extended well beyond finite, no-signalling quantum scenarios. In continuous-variable systems, the contextual fraction is formulated as an infinite linear program with a dual continuous-function program, and a hierarchy of semidefinite relaxations gives convergent numerical approximations [1905.08267]. In resource-theoretic language, $\mathrm{RC}_2$ has been proposed as a quantifier for probabilistic databases and randomness amplification, where it measures, respectively, minimal repair overhead and the adversary’s memory cost [2205.10307]. The rank-separation index is applied to Hardy’s excess-baggage theorem, minimum-error quantum state discrimination, and optimal phase-covariant and universal cloning, where contextuality appears as unavoidable extra ontic dimension [2406.19382].

In behavioral data, the CbD literature emphasizes that inconsistent connectedness does not by itself establish contextuality. The generalized criterion $S-\mathrm{ICC}\le 2$ separates direct context-driven marginal shifts from genuinely contextual incompatibility. In the behavioral data sets reviewed there, none exhibited contextuality in the generalized sense, while the traditional definition did not apply because the data violated consistent connectedness [1508.04751].

Natural-language applications now form an additional domain. In “Quantum-Like Contextuality in Large Language Models,” a linguistic schema modeled over a contextual quantum scenario was instantiated in the Simple English Wikipedia, and probability distributions were extracted for the instances using BERT. The paper reports the discovery of **77,118 sheaf-contextual** and **36,938,948 CbD contextual** instances. It further reports an equation between degrees of contextuality and Euclidean distances of BERT embedding vectors, and a regression model in which Euclidean distance is the best statistical predictor of contextuality. The linguistic schema is described as a variant of the co-reference resolution challenge, and the reported results are presented as an indication that quantum methods may be advantageous in language tasks [2412.16806].

A general lesson across these applications is that different contextuality indices answer different quantitative questions. Some ask for the minimal contextual share in a convex decomposition; some ask for the minimal mismatch in a global coupling; some ask for memory cost, extra ontic dimension, or geometric curvature. Consequently, numerical values from different indices are not interchangeable, even when they vanish on the same noncontextual set.

Source: https://www.emergentmind.com/topics/contextuality-index