Reuse & Permissions

It is not necessary to obtain permission to reuse this article or its components as it is available under the terms of the Creative Commons Attribution 4.0 International license. This license permits unrestricted use, distribution, and reproduction in any medium, provided attribution to the author(s) and the published article's title, journal citation, and DOI are maintained. Please note that some figures may have been included with permission from other third parties. It is your responsibility to obtain the proper permission from the rights holder directly for these figures.

Export citation

Export citation

Choose format for download:

Download Citation
  • Featured in Physics
  • Open Access

Contextuality of Quantum Error-Correcting Codes

Derek Khu1,*, Andrew Tanggara2,3,†, Chao Jin1,‡, and Kishor Bharti4,5,§

  • *Contact author: derek_khu@a-star.edu.sg
  • †Contact author: andrew.tanggara@gmail.com
  • ‡Contact author: jin_chao@a-star.edu.sg
  • §Contact author: kishor.bharti1@gmail.com

PRX Quantum 7, 010319 – Published 28 January, 2026

DOI: https://doi.org/10.1103/7zb5-vs4x

Abstract

Fault-tolerant quantum computation requires quantum error correction (QEC), which relies on entanglement to protect information from local noise. Achieving universality, however, demands overcoming the Eastin-Knill theorem. This is often accomplished through strategies like magic state distillation, a process that prepares computational resources—namely, magic states—whose power is now understood to be rooted in quantum contextuality, a fundamental nonclassical feature generalizing Bell nonlocality. Yet, the broader role of contextuality in enabling universality, including its significance as an inherent feature of QEC codes and protocols themselves, has remained largely unexplored. In this work, we develop a rigorous framework for contextuality in QEC and prove three main results. Fundamentally, we show that subsystem stabilizer codes with two or more gauge qubits are strongly contextual in their partial closure, while others are noncontextual, establishing a clear criterion for identifying contextual codes. Mathematically, we unify Abramsky-Brandenburger’s sheaf-theoretic and Kirby-Love’s tree-based definitions of contextuality, resolving a conjecture of Kim and Abramsky. Practically, we prove that many widely studied code-switching protocols which admit universal transversal gate sets, such as the doubled color codes introduced by Bravyi and Cross, are necessarily strongly contextual in their partial closure. Collectively, our results establish quantum contextuality as an intrinsic characteristic of fault-tolerant quantum codes and protocols, complementing entanglement and magic as resources for scalable quantum computation. For quantum coding theorists, this provides a new invariant: contextuality classifies which subsystem stabilizer codes can participate in universal fault-tolerant protocols. These findings position contextuality not only as a foundational concept but also as a practical guide for the design and analysis of future QEC architectures.

View figure in article

Physics Subject Headings (PhySH)

Viewpoint

A New Ingredient for Quantum Error Correction

Published 28 January, 2026

Entanglement and so-called magic states have long been viewed as the key resources for quantum error correction. Now contextuality, a hallmark of quantum theory, joins them as a complementary resource.

See more in Physics

Popular Summary

Article Text

References (111)

  1. P. W. Shor, Scheme for reducing decoherence in quantum computer memory, Phys. Rev. A 52, R2493 (1995).
  2. D. Gottesman, Stabilizer codes and quantum error correction, Ph.D. thesis, California Institute of Technology, 1997.
  3. E. Dennis, A. Kitaev, A. Landahl, and J. Preskill, Topological quantum memory, J. Math. Phys. 43, 4452 (2002).
  4. A. Y. Kitaev, Fault-tolerant quantum computation by anyons, Ann. Phys. 303, 2 (2003).
  5. Quantum Error Correction, edited by P. A. Lidar and T. A. Brun (Cambridge University, Cambridge, United Kingdom, 2013).
  6. B. M. Terhal, Quantum error correction for quantum memories, Rev. Mod. Phys. 87, 307 (2015).
  7. C. H. Bennett, D. P. DiVincenzo, J. A. Smolin, and W. K. Wootters, Mixed-state entanglement and quantum error correction, Phys. Rev. A 54, 3824 (1996).
  8. T. Brun, I. Devetak, and M.-H. Hsieh, Correcting quantum errors with entanglement, Science 314, 436 (2006).
  9. W. Dür and H. J. Briegel, Entanglement purification and quantum error correction, Rep. Prog. Phys. 70, 1381 (2007).
  10. S. Bravyi, D. Lee, Z. Li, and B. Yoshida, How much entanglement is needed for quantum error correction? Phys. Rev. Lett. 134, 210602 (2025).
  11. A. Anshu, N. P. Breuckmann, and C. Nirkhe, in Proceedings of the 55th Annual ACM Symposium on Theory of Computing, STOC ’23 (ACM, New York, NY, USA, 2023), pp. 1090–1096.
  12. S. Bravyi and A. Kitaev, Universal quantum computation with ideal Clifford gates and noisy ancillas, Phys. Rev. A 71, 022316 (2005).
  13. V. Veitch, S. A. Hamed Mousavian, D. Gottesman, and J. Emerson, The resource theory of stabilizer quantum computation, New J. Phys. 16, 013009 (2014).
  14. C. Gidney, N. Shutty, and C. Jones, Magic state cultivation: growing T states as cheap as CNOT gates), arXiv:2409.17595 [quant-ph].
  15. B. Eastin and E. Knill, Restrictions on transversal encoded quantum gate sets, Phys. Rev. Lett. 102, 110502 (2009).
  16. S. Kochen and E. P. Specker, The problem of hidden variables in quantum mechanics, J. Math. Mech. 17, 59 (1967).
  17. E. Specker, Die Logik nicht gleichzeitig entscheidbarer Aussagen, Dialectica 14, 239 (1960).
  18. C. Budroni, A. Cabello, O. Gühne, M. Kleinmann, and J.-Å. Larsson, Kochen-Specker contextuality, Rev. Mod. Phys. 94, 045007 (2022).
  19. A. A. Klyachko, M. A. Can, S. Binicioğlu, and A. S. Shumovsky Simple test for hidden variables in spin-1 systems, Phys. Rev. Lett. 101, 020403 (2008).
  20. R. Raussendorf, Contextuality in measurement-based quantum computation, Phys. Rev. A 88, 022322 (2013).
  21. R. Lapkiewicz, P. Li, C. Schaeff, N. K. Langford, S. Ramelow, M. Wieśniak, and A. Zeilinger, Experimental non-classicality of an indivisible quantum system, Nature 474, 490 (2011).
  22. M. Um, X. Zhang, J. Zhang, Y. Wang, S. Yangchao, D. L. Deng, L.-M. Duan, and K. Kim, Experimental certification of random numbers via quantum contextuality, Sci. Rep. 3, 1627 (2013).
  23. M. Jerger, Y. Reshitnyk, M. Oppliger, A. Potočnik, M. Mondal, A. Wallraff, K. Goodenough, S. Wehner, K. Juliusson, N. K. Langford, and A. Fedorov, Contextuality without nonlocality in a superconducting quantum system, Nat. Commun. 7, 12930 (2016).
  24. X. Zhan, P. Kurzyński, D. Kaszlikowski, K. Wang, Z. Bian, Y. Zhang, and P. Xue, Experimental detection of information deficit in a photonic contextuality scenario, Phys. Rev. Lett. 119, 220403 (2017).
  25. M. Malinowski, C. Zhang, F. M. Leupold, A. Cabello, J. Alonso, and J. P. Home, Probing the limits of correlations in an indivisible quantum system, Phys. Rev. A 98, 050102(R) (2018).
  26. F. M. Leupold, M. Malinowski, C. Zhang, V. Negnevitsky, J. Alonso, J. P. Home, and A. Cabello, Sustained state-independent quantum contextual correlations from a single ion, Phys. Rev. Lett. 120, 180401 (2018).
  27. A. Zhang, H. Xu, J. Xie, H. Zhang, B. J. Smith, M. S. Kim, and L. Zhang, Experimental test of contextuality in quantum and classical systems, Phys. Rev. Lett. 122, 080401 (2019).
  28. M. Um, Q. Zhao, J. Zhang, P. Wang, Y. Wang, M. Qiao, H. Zhou, X. Ma, and K. Kim, Randomness expansion secured by quantum contextuality, Phys. Rev. Appl. 13, 034077 (2020).
  29. P. Wang, J. Zhang, C.-Y. Luan, M. Um, Y. Wang, M. Qiao, T. Xie, J.-N. Zhang, A. Cabello, and K. Kim, Significant loophole-free test of Kochen-Specker contextuality using two species of atomic ions, Sci. Adv. 8, eabk1660 (2022).
  30. X.-M. Hu, X.-M. Hu, Y. Xie, A. S. Arora, M.-Z. Ai, K. Bharti, J. Zhang, W. Wu, P.-X. Chen, J.-M. Cui, B.-H. Liu, Y.-F. Huang, C.-F. Li, G.-C. Guo, J. Roland, A. Cabello, and L.-C. Kwek, Self-testing of a single quantum system from theory to experiment, npj Quantum Inf. 9, 103 (2023).
  31. Z.-H. Liu, H.-X. Meng, Z.-P. Xu, J. Zhou, J.-L. Chen, J.-S. Xu, C.-F. Li, G.-C. Guo, and A. Cabello, Experimental test of high-dimensional quantum contextuality based on contextuality concentration, Phys. Rev. Lett. 130, 240202 (2023).
  32. K. Bharti, M. Ray, A. Varvitsiotis, N. A. Warsi, A. Cabello, and L.-C. Kwek, Robust self-testing of quantum systems via noncontextuality inequalities, Phys. Rev. Lett. 122, 250403 (2019).
  33. K. Bharti, M. Ray, A. Varvitsiotis, A. Cabello, and L.-C. Kwek, Local certification of programmable quantum devices of arbitrary high dimensionality, arXiv:1911.09448 [quant-ph].
  34. Z.-P. Xu, D. Saha, K. Bharti, and A. Cabello, Certifying sets of quantum observables with any full-rank state, Phys. Rev. Lett. 132, 140201 (2024).
  35. D. Saha, R. Santos, and R. Augusiak, Sum-of-squares decompositions for a family of noncontextuality inequalities and self-testing of quantum devices, Quantum 4, 302 (2020).
  36. Z.-H. Liu, Exploring Quantum Contextuality with Photons (Springer Nature, Singapore, 2023).
  37. A. S. Arora, K. Bharti, A. Cojocaru, and A. Coladangelo, in 2024 IEEE 65th Annual Symposium on Foundations of Computer Science (FOCS) (IEEE, Chicago, IL, USA, 2024), pp. 1106–1125..
  38. J. Bowles, V. J. Wright, M. Farkas, N. Killoran, and M. Schuld, Contextuality and inductive bias in quantum machine learning, arXiv:2302.01365 [quant-ph].
  39. X. Gao, E. R. Anschuetz, S.-T. Wang, J. I. Cirac, and M. D. Lukin, Enhancing generative models via quantum correlations, Phys. Rev. X 12, 021037 (2022).
  40. A. Hameedi, A. Tavakoli, B. Marques, and M. Bourennane, Communication games reveal preparation contextuality, Phys. Rev. Lett. 119, 220402 (2017).
  41. D. Saha, P. Horodecki, and M. Pawłowski, State independent contextuality advances one-way communication, New J. Phys. 21, 093057 (2019).
  42. S. Gupta, D. Saha, Z.-P. Xu, A. Cabello, and A. S. Majumdar, Quantum contextuality provides communication complexity advantage, Phys. Rev. Lett. 130, 080802 (2023).
  43. N. D. Mermin, Extreme quantum entanglement in a superposition of macroscopically distinct states, Phys. Rev. Lett. 65, 1838 (1990).
  44. S. Abramsky and A. Brandenburger, The sheaf-theoretic structure of non-locality and contextuality, New J. Phys. 13, 113036 (2011).
  45. S. Abramsky, R. Soares Barbosa, K. Kishida, R. Lal, and S. Mansfield, in 24th EACSL Annual Conference on Computer Science Logic (CSL 2015) (Schloss Dagstuhl—Leibniz-Zentrum für Informatik, Dagstuhl, Germany, 2015).
  46. W. M. Kirby and P. J. Love, Contextuality test of the nonclassicality of variational quantum eigensolvers, Phys. Rev. Lett. 123, 200501 (2019).
  47. B. Kim and S. Abramsky, State-independent all-versus-nothing arguments, arXiv:2311.11218.
  48. F. Butt, S. Heußen, M. Rispler, and M. Müller, Fault-tolerant code-switching protocols for near-term quantum processors, PRX Quantum 5, 020345 (2024).
  49. S. Bravyi and A. Cross, Doubled color codes, arXiv:1509.03239 [quant-ph].
  50. E. Chitambar and G. Gour, Quantum resource theories, Rev. Mod. Phys. 91, 025001 (2019).
  51. J. S. Bell, On the Einstein Podolsky Rosen paradox, Phys. Phys. Fiz. 1, 195 (1964).
  52. D. M. Greenberger, M. A. Horne, and A. Zeilinger, in Bell’s Theorem, Quantum Theory and Conceptions of the Universe (Springer Netherlands, Dordrecht, Netherlands, 1989), pp. 69–72.
  53. D. M. Greenberger, M. A. Horne, A. Shimony, and A. Zeilinger, Bell’s theorem without inequalities, Am. J. Phys. 58, 1131 (1990).
  54. D. P. DiVincenzo and A. Peres, Quantum code words contradict local realism, Phys. Rev. A 55, 4089 (1997).
  55. A. Cabello, O. Gühne, and D. Rodríguez, Mermin inequalities for perfect correlations, Phys. Rev. A 77, 062106 (2008).
  56. S. Abramsky, R. S. Barbosa, G. Carù, and S. Perdrix, A complete characterization of all-versus-nothing arguments for stabilizer states, Phil. Trans. R. Soc. A 375, 20160385 (2017).
  57. M. Howard, J. Wallman, V. Veitch, and J. Emerson, Contextuality supplies the ‘magic’ for quantum computation, Nature 510, 351 (2014).
  58. A. Cabello, S. Severini, and A. Winter, (Non-)contextuality of physical theories as an axiom, arXiv:1010.2163 [quant-ph].
  59. A. Cabello, S. Severini, and A. Winter, Graph-theoretic approach to quantum correlations, Phys. Rev. Lett. 112, 040401 (2014).
  60. W. M. Kirby, A. Tranter, and P. J. Love, Contextual subspace variational quantum eigensolver, Quantum 5, 456 (2021).
  61. S. Abramsky, Ş.-I. Cercelescu, and C.-M. Constantin, in 9th International Conference on Formal Structures for Computation and Deduction (FSCD 2024), Leibniz International Proceedings in Informatics (LIPIcs) Vol. 299, edited by J. Rehof (Schloss Dagstuhl—Leibniz-Zentrum für Informatik, Dagstuhl, Germany, 2024), pp. 28:1–28:20.
  62. D. Gottesman, Surviving as a quantum computer in a classical world (2024), textbook manuscript preprint available at https://www.cs.umd.edu/class/spring2024/cmsc858G/QECCbook-2024-ch1-15.pdf.
  63. All instances of log in this paper refer to the base-2 logarithm.
  64. D. Kribs, R. Laflamme, D. Poulin, and M. Lesosky, Operator quantum error correction, Quantum Inf. Comput. 6, 382 (2006).
  65. D. Kribs, R. Laflamme, and D. Poulin, Unified and generalized approach to quantum error correction, Phys. Rev. Lett. 94, 180501 (2005).
  66. D. Poulin, Stabilizer formalism for operator quantum error correction, Phys. Rev. Lett. 95, 230504 (2005).
  67. In this paper, the word “ring” (resp. “semiring”) always refers to a commutative ring (resp. semiring) with unit.
  68. In this paper, the word “graph” always refers to a simple, undirected graph.
  69. It makes sense for a(x) to take values in Z2 because x2=I.
  70. M. Suchara, S. Bravyi, and B. Terhal, Constructions and noise threshold of topological subsystem codes, J. Phys. A: Math. Theor. 44, 155301 (2011).
  71. O. Higgott and N. P. Breuckmann, Subsystem codes with high thresholds by gauge fixing and reduced qubit overhead, Phys. Rev. X 11, 031039 (2021).
  72. B. Shaw, M. M. Wilde, O. Oreshkov, I. Kremsky, and D. A. Lidar, Encoding one logical qubit into six physical qubits, Phys. Rev. A 78, 012337 (2008).
  73. The Error Correction Zoo, edited by V. V. Albert and P. Faist (2025).
  74. M. B. Hastings and J. Haah, Dynamically generated logical qubits, Quantum 5, 564 (2021).
  75. If V=U, then M′={∅}.
  76. It is not hard to see that zerosumfree semifields are in fact exactly the semifields which are not fields.
  77. A. Chermak, Fusion systems and localities, Acta Math. 211, 47 (2013).
  78. J. T. Anderson, G. Duclos-Cianci, and D. Poulin, Fault-tolerant conversion between the Steane and Reed-Muller quantum codes, Phys. Rev. Lett. 113, 080501 (2014).
  79. H. Bombin and M. A. Martin-Delgado, Topological quantum distillation, Phys. Rev. Lett. 97, 180501 (2006).
  80. This is initially given as ∑j=1t2j=t2+t in Eq. (85) of Ref. [49], but it was later noted at the very end of Sec. 12 in the paper that this number can be reduced by 2.
  81. N. Rengaswamy, R. Calderbank, M. Newman, and H. D. Pfister, On optimality of CSS codes for transversal T, IEEE J. Sel. Areas Inf. Theory 1, 499 (2020).
  82. B. Sudakov and P. Vieira, Two remarks on eventown and oddtown problems, SIAM J. Discrete Math. 32, 280 (2018).
  83. A collection of sets {A1,…,Aℓ} is a strong k-wise eventown if |⋂j∈SAj|=0mod2 for any S⊆{1,…,ℓ} with |S|=m for all 1≤m≤k. So, {supp(v):v∈C2} is a strong (|A|−1)-wise eventown since |⋂v∈Ssupp(v)|=0mod2 for all S⊆{1,…,n} with 1≤|S|≤|A|−1, by the minimality of |A|. However it is not a |A|-wise eventown since |⋂v∈Asupp(v)|=1mod2, by the definition of A.
  84. The inclusion map V↪W1 maps v∈V to v∈W1. The quotient map W1↠W1/(W1∩W2) maps w∈W1 to coset w+(W1+W2).
  85. This notion of transversality is often referred to as “weak transversality” where a logical U gate on an n-qubit code is given by U¯=⨂i=1nVi where the physical unitaries Vi,Vj for i≠j need not be the same (nor equal to U). This is a relaxation of transversality (which is sometimes referred to as “strict transversality”) where U¯=V⊗n.
  86. S. Abramsky, R. Barbosa, and S. Mansfield, in 13th International Conference on Quantum Physics and Logic (QPL 2016) (Glasgow, United Kingdom, 2016). http://qpl2016.cis.strath.ac.uk/.
  87. S. Boyd and L. Vandenberghe, Convex Optimization (Cambridge University, Cambridge, United Kingdom, 2004).
  88. P. Panteleev and G. Kalachev, Maximally extendable sheaf codes, arXiv:2403.03651 [cs.IT].
  89. T.-C. Lin, Transversal non-Clifford gates for quantum LDPC codes on sheaves, arXiv:2410.14631 [quant-ph].
  90. I. Dinur, T.-C. Lin, and T. Vidick, Expansion of higher-dimensional cubical complexes with application to quantum locally testable codes, arXiv:2402.07476 [quant-ph].
  91. G. Kalachev and P. Panteleev, Maximally extendable product codes are good coboundary expanders, arXiv:2501.01411 [cs.IT].
  92. M. Davydova, N. Tantivasadakarn, and S. Balasubramanian, Floquet codes without parent subsystem codes, PRX Quantum 4, 020341 (2023).
  93. A. Fahimniya, H. Dehghani, K. Bharti, S. Mathew, A. J. Kollár, A. V. Gorshkov, and M. J. Gullans, Fault-tolerant hyperbolic Floquet quantum error correcting codes, Quantum 9, 1849 (2025).
  94. C. Gidney, M. Newman, A. Fowler, and M. Broughton, A fault-tolerant honeycomb memory, Quantum 5, 605 (2021).
  95. J. Haah and M. B. Hastings, Boundaries for the honeycomb code, Quantum 6, 693 (2022).
  96. C. Vuillot, Planar Floquet codes, arXiv:2110.05348 [quant-ph].
  97. A. Paetznick, C. Knapp, N. Delfosse, B. Bauer, J. Haah, M. B. Hastings, and M. P. da Silva, Performance of planar Floquet codes with Majorana-based qubits, PRX Quantum 4, 010310 (2023).
  98. C. Gidney, M. Newman, and M. McEwen, Benchmarking the planar honeycomb code, Quantum 6, 813 (2022).
  99. P. Hilaire, T. Dessertaine, B. Bourdoncle, A. Denys, G. de Gliniasty, G. Valentí-Rojas, and S. Mansfield, Enhanced fault-tolerance in photonic quantum computing: Floquet code outperforms surface code in tailored architecture, arXiv:2410.07065 [quant-ph].
  100. O. Higgott and N. P. Breuckmann, Constructions and performance of hyperbolic and semi-hyperbolic Floquet codes, PRX Quantum 5, 040327 (2024).
  101. D. Aasen, J. Haah, Z. Li, and R. S. K. Mong, Measurement quantum cellular automata and anomalies in Floquet codes, arXiv:2304.01277 [quant-ph].
  102. Z. Zhang, D. Aasen, and S. Vijay, X-cube Floquet code: A dynamical quantum error correcting code with a subextensive number of logical qubits, Phys. Rev. B 108, 205116 (2023).
  103. A. Dua, N. Tantivasadakarn, J. Sullivan, and T. D. Ellison, Engineering 3D Floquet codes by rewinding, PRX Quantum 5, 020305 (2024).
  104. M. S. Alam and E. Rieffel, Dynamical logical qubits in the Bacon-Shor code, Phys. Rev. A 112, 022436 (2025).
  105. H. Bombin, D. Litinski, N. Nickerson, F. Pastawski, and S. Roberts, Unifying flavors of fault tolerance with the ZX calculus, Quantum 8, 1379 (2024).
  106. A. Tanggara, M. Gu, and K. Bharti, Strategic code: A unified spatio-temporal framework for quantum error-correction, arXiv:2405.17567 [quant-ph].
  107. A. Townsend-Teague, J. Magdalena de la Fuente, and M. Kesselring, Floquetifying the colour code, Electron. Proc. Theor. Comput. Sci. 384, 265 (2023).
  108. T. D. Ellison, J. Sullivan, and A. Dua, Floquet codes with a twist, arXiv:2306.08027 [quant-ph].
  109. J. Sullivan, R. Wen, and A. C. Potter, Floquet codes and phases in twist-defect networks, Phys. Rev. B 108, 195134 (2023).
  110. A. Tanggara, M. Gu, and K. Bharti, Simple construction of qudit Floquet codes on a family of lattices, arXiv:2410.02022 [quant-ph].
  111. We slightly abuse notation here for the sake of notation clarity: each ordered pair listed in fact refers to function that sends the relevant operators (in the order listed) to the ordered pair. For instance, by S({X1,X2})={(0,0),(1,1)}, we mean that S({X1,X2}) consists of two functions: one sends both X1 and X2 to 0, and the other sends both X1 and X2 to 1.

Outline

Information

Sign In to Your Journals Account

Filter

Filter

Article Lookup

Enter a citation