  Interactions govern the flow of information and the formation of correlations
in quantum systems, dictating the phases of matter found in nature and the
forms of entanglement generated in the laboratory. Typical interactions decay
with distance and thus produce a network of connectivity governed by geometry,
e.g., by the crystalline structure of a material or the trapping sites of atoms
in a quantum simulator. However, many envisioned applications in quantum
simulation and computation require richer coupling graphs including nonlocal
interactions, which notably feature in mappings of hard optimization problems
onto frustrated spin systems and in models of information scrambling in black
holes. Here, we report on the realization of programmable nonlocal interactions
in an array of atomic ensembles within an optical cavity, where photons carry
information between distant atomic spins. By programming the
distance-dependence of interactions, we access effective geometries where the
dimensionality, topology, and metric are entirely distinct from the physical
arrangement of atoms. As examples, we engineer an antiferromagnetic triangular
ladder, a Moebius strip with sign-changing interactions, and a treelike
geometry inspired by concepts of quantum gravity. The tree graph constitutes a
toy model of holographic duality, where the quantum system may be viewed as
lying on the boundary of a higher-dimensional geometry that emerges from
measured spin correlations. Our work opens broader prospects for simulating
frustrated magnets and topological phases, investigating quantum optimization
algorithms, and engineering new entangled resource states for sensing and
computation.
