  We demonstrate deterministic control of the nearest and next-nearest neighbor
coupling in the unit cell of a square lattice of microcavity exciton-polariton
condensates. We tune the coupling in a continuous and reversible manner by
optically imprinting potential barriers of variable height, in the form of
spatially localized incoherent exciton reservoirs that modify the particle flow
between condensates. By controlling the couplings in a $2\times2$ polariton
cluster, we realize ferromagnetic, anti-ferromagnetic and paired ferromagnetic
phases. Our approach paves the way towards simulating complex condensed matter
phases through precise control of the individual couplings in networks of
optical nonlinear oscillators.
