10 votes
Accepted

Parallel Mersenne Twister for Monte Carlo

Like you say, using the Mersenne Twister for parallel computations is almost always done incorrectly, as the correct method is tricky to implement. By far the easiest and best answer would be to move ...
LKlevin's user avatar
  • 2,493
7 votes

Maximizing unknown noisy function

There are several Bayesian optimization techniques you could try. Easiest are based on Gaussian process: Harold J. Kushner. A new method of locating the maximum of an arbitrary multipeak curve in the ...
Memming's user avatar
  • 870
7 votes
Accepted

Why the magnetisation shows abrupt behaviour for this 3D ising spin system

Your lattice consists of 5 x 5 x 5 = 125 spins, so your number of Montecarlo steps to reach equilibrium should be >> 125, because you randomly picking a site and flipping it, so random numbers should ...
147875's user avatar
  • 276
6 votes

Python implementations of Gillespie's direct method

As part of the lab the developed and maintains StochKit. I am happy to hear that it is highly recommended in the previous answers. However, I wanted to update everyone. There already is a python ...
briandrawert's user avatar
5 votes
Accepted

Mean-squared displacement in Monte Carlo studies

This is possible (see [1]) but uncommon, as it requires Monte Carlo moves that alter the current conformations by a very small perturbation. In that setting of "small" Metropolis MC moves, it is ...
Juan M. Bello-Rivas's user avatar
5 votes

Mean-squared displacement in Monte Carlo studies

It is in some cases possible to map the dynamics obtained in MC simulations to other (more realistic) dynamics, especially for the case of dense colloidal suspensions. The following two papers talk ...
lr1985's user avatar
  • 677
5 votes
Accepted

Absence of Discontinuity in Specific Heat Plot Simulated by Ising Model

I sincerely thank @Daniel Shapero for directing me towards this answer. Discontinuity in the specific heat or susceptibility curves to be visible significantly, you should take much more finer ...
147875's user avatar
  • 276
5 votes
Accepted

Use Monte Carlo integration to compute the volume and centre of mass in Python

Here is a corrected and slightly improved code, set up here for calculation of the full torus volume to verify the result. ...
Maxim Umansky's user avatar
4 votes

Under what circumstances is Monte Carlo integration better than quasi-Monte Carlo?

Advantages of traditional Monte-Carlo integration over quasi-Monte Carlo integration are discussed in Kocis and Whiten's paper here. They list the following reasons: The error bound of qmc methods $\...
user14717's user avatar
  • 2,125
4 votes

How to sample points in hyperbolic space?

I'm in the middle of doing this for myself. I think the most appropriate analogue to the Gaussian would be the heat kernel in hyperbolic space. Fortunately, this has been figured out before: https://...
xue2sheng1's user avatar
4 votes

Simple Monte Carlo in C++, result dependent from seed

As noted in the comments by Kirill, the y-axes of the two plots are very different. And if they are rescaled accordingly, the boxes will certainly look very similar, if not identical. Therefore, it ...
Anton Menshov's user avatar
  • 8,602
4 votes

How to optimize sampling for global sensitivity analysis

What you're looking for goes under the name of quasi-Monte Carlo (QMC) sequences. Quasi Monte Carlo sequences are "more random than random", i.e. they fill high dimensional spaces better ...
Chris Rackauckas's user avatar
4 votes
Accepted

Automatic Differentiation In the Presence of Jump Points

Finite differences, when applied to a function from $\mathbb{R}$ to $\mathbb{R}$ with a discontinuity, will do a better job of capturing the nature of the derivative, which is no longer a function but ...
MSMommer's user avatar
4 votes

Determining the importance of different parameters in a simulation

Optimal sampling will in general depend on one's objective. From the title it seems you are mainly interested in variable importance. This is typically one of the objectives of sensitivity analysis, ...
user9794's user avatar
  • 465
3 votes

2D Ising Model in Python

Your specific heat is indeed not correct. You should get a peak centered on the critical temperature $T_c\simeq 2.27$. The specific heat is $$C=\big[\langle E^2\rangle-\langle E\rangle^2\big]/k_BT^...
Christophe's user avatar
3 votes

Parallel Mersenne Twister for Monte Carlo

If you want to use MT, you can use SFMT as your PRNG and SFMT jump to generate multiple streams. You can simply initialise MT with one seed, and then jump ahead by e.g. $1 \cdot 10^{60}$, $2 \cdot 10^...
Jukka Suomela's user avatar
3 votes

Estimate information entropy through Monte Carlo sampling

If I understand what information you have available, what you want is not possible: the information available to you is not enough to determine the entropy. It's not even enough to approximate the ...
D.W.'s user avatar
  • 400
3 votes

Efficient Quadrature Methods for Indicator Functions?

I found that the grid summing method beat out both the Cubature package and the adaptive Monte Carlo schemes from the GSL package (standard, VEGAS, and MISER) when it came to both speed an accuracy (...
Chris Rackauckas's user avatar
3 votes

Monte Carlo Metropolis method - trial step algorithm

Well I guess that this question could take place in both computational science and physics, depending on the kind of physicist or computational scientist stubbling upon it. Yet for your answer, as I ...
G.Clavier's user avatar
  • 323
3 votes
Accepted

Convergence of Monte Carlo integration

Let the MC integral estimate be $$ S_n = \frac{b-a}{n}\sum_{1\leq k\leq n} f(x_k), $$ where $x_k$ are i.u.d. on the interval $[a,b]$. So long as the function $f$ is $L^1$, the mean exists, and $$\...
Kirill's user avatar
  • 11.4k
3 votes

How to choose the number of random points in Monte Carlo simulations?

You may not be able to determine the exact number of points required to obtain 1% error, but you can estimate the order of magnitude of points needed to obtain this accuracy. Monte Carlo converges ...
Paul's user avatar
  • 12k
3 votes

Calculation of Mean Square Displacement for Brownian dynamics system with Lennard Jones interactions in python3

This will not an answer to your problem, more an excessive comment and few things you might consider, when writing such code even for self educational purpose. Constants You asked whether your ...
Bort's user avatar
  • 1,275
3 votes
Accepted

Which are the right configurations in the Markov chain of a Hamiltonian Monte Carlo algorithm?

The algorithm for perfoming a single HMC step is as follows: Input: Some initial configuration $\vec{y}_i$ and momentum $\vec{p}_i$. Output: Next configuration $\vec{y}_{i+1}$ and momentum $\vec{p}_{i+...
cos_theta's user avatar
  • 401
3 votes
Accepted

Different questions about "Inverse Physics problems"

As I understand, your ultimate goal is to solve an inverse problem (i.e., infer some parameters from given data / observations). To this end, you want to apply Bayesian Inference, which relates the ...
cos_theta's user avatar
  • 401
3 votes

Monte Carlo simulation of many-body wave function overlaps

You are right that $\psi_2^\ast\psi_1$ is not a probability distribution (not even a non-normalized one) because it is complex-valued and possibly negative. But $p(r)=|\psi_2(r)^\ast\psi_1(r)|$ can ...
Wolfgang Bangerth's user avatar
2 votes
Accepted

Variational Monte Carlo: Variational energy is lower than ground state energy

The trial wavefunction, $\exp(-1.2r)$, does not respect the cusp condition - the derivatives of the wavefunction need to cancel the $1/r$ Coulomb term. Without a correct cusp condition, the local ...
Mark Dewing's user avatar
2 votes
Accepted

Use of Metropolis-Hasting algorithm for gathering statistics

Your post actually contains two questions: 1) What should you calculate This first question will be answered by defining what you are studying. If it is the magnetic properties of your system (usual ...
G.Clavier's user avatar
  • 323
2 votes

Why are Hamiltonian dynamics used in MCMC?

I'm a little late to reply but I found this review to be really informative. One particularly nice feature of Hamiltonian flows is that they preserve volume in phase space. If we take an infinitesimal ...
Daniel Shapero's user avatar
2 votes
Accepted

Monte Carlo Simulation algorithm

It seems to me you would just be randomly selecting $n$ at each time step, given some distribution you should be sampling $n$ from, and using your dynamics function to propagate the voltage from time $...
spektr's user avatar
  • 3,898
2 votes

Estimate information entropy through Monte Carlo sampling

For the second part of your question (estimation of entropy difference between distributions) you may be able to use the identity $$F = \langle E \rangle - T S,$$ where $\langle E \rangle$ is the ...
Juan M. Bello-Rivas's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible