The Bacon-Shor codes [1]} mentioned in the previous section were
generalized by Bravyi [2]} to yield a family of sparse subsystem codes
encoding \(k \propto \sqrt{n}\)  qubits while still respecting the geometric locality of the gauge
generators in \(D=2\)  dimensions and maintaining the distance \(d= \sqrt{n}\) . This is an
example of how subsystem codes can outperform stabilizer codes under spatial locality
constraints, since two-dimensional stabilizer codes were proven in [2]} to
satisfy \(kd^2 \le O(n)\)  (which generalizes [4]} in \(D\)  dimensions to
\(k d^{2/(D-1)} \le O(n)\) ). Bravyi [2]} has also shown that all
spatially local subsystem codes in \(D=2\)  dimensions obey the bound \(k d \le O(n)\)  for \(D=2\) 
and so this scaling is optimal for two dimensions.
