Stochastic Quantum Sampling for Non-Logconcave Distributions and Estimating Partition Functions