I'm creating a Monte Carlo simulation of the 2D Ising Model for a graduate course in computational materials science. Part of the assignment is to calculate the uncertainty in the calculation of the average magnetization per spin. To do so, we are told to find the correlation time for our data set of average magnetization vs. number of spin flip attempts. We are instructed to do this by using built in methods provided by either Matlab, Mathematica, or in my case numpy since I'm coding in python to provide us with a correlation function which can be used in further steps to calculate the correlation time.(adsbygoogle = window.adsbygoogle || []).push({});

I've take a look at the numpy library and there is a feature called correlate. numpy.correlate that takes in two arrays, and calculates the cross correlation between the two data sets are returns a constant value. I don't see anything in the numpy library that returns a correlation function. Any suggestions on how to proceed? Thanks..

**Physics Forums | Science Articles, Homework Help, Discussion**

Dismiss Notice

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Homework Help: Numpy correlate, Monte Carlo

Tags:

Have something to add?

Draft saved
Draft deleted

**Physics Forums | Science Articles, Homework Help, Discussion**