  Bell nonlocality is the resource that enables device-independent quantum
information processing tasks. It is revealed through the violation of so-called
Bell inequalities, indicating that the observed correlations cannot be
reproduced by any local hidden variable model. While well explored in few-body
settings, the question of which Bell inequalities are best suited for a given
task remains quite open in the many-body scenario. One natural approach is to
assign Bell inequalities to physical Hamiltonians, mapping their interaction
graph to two-body, nearest-neighbor terms. Here, we investigate the effect of
boundary conditions in a two-dimensional square lattice, which can induce
different topologies in lattice systems. We find a relation between the induced
topology and the Bell inequality's effectiveness in revealing nonlocal
correlations. By using a combination of tropical algebra and tensor networks,
we quantify their detection capacity for nonlocality. Our work can act as a
guide to certify Bell nonlocality in many-qubit devices by choosing a suitable
Hamiltonian and measuring its ground state energy; a task that many quantum
experiments are purposely built for.
