Path-integral representation for quantum spin models: Application to the quantum cavity method and Monte Carlo simulations | Synapse