Counting constraint-satisfaction problems (#CSP), evaluating partition functions of many physical models, as well as many topics in classically simulating quantum states/circuits, are all fundamentally contracting tensor networks, which is a #P-complete problem. For a good overview see the following papers:
Itai Arad, Zeph Landau, Quantum computation and the evaluation of tensor networks
Cai, Lu, Xia Holographic Algorithms with Matchgates Capture Precisely Tractable Planar #CSP
See especially the introduction of the latter for the connection to physical models.