Module ateams.statistics.observables

Functions

def connectivity(state, model)
def magnetization(state, model)
def occupancy(state, model=None)

Computes the bond occupancy \mathcal N(\sigma, \omega) = \sum_{x \in X} \mathbf 1[ \omega(x) = 1 ] of the state produced by the given model, where \omega is a bond(/plaquette) configuration. (Just counts the number of d-cells included by independent percolation conditioned on a spin configuration \sigma.) Note: at every step of a simulation, each Model returns a binary vector over the d-cells indicating which are in/excluded; the occupancy can be computed (as is done here) by .sum()ming on this vector.

Args

state : tuple
The state from the Markov chain on the given model.
model : Model=None
The Model (e.g. SwendsenWang) from which data is collected. Doesn't do anything here.

Returns

The bond occupancy.

def totalEnergy(state, model)

Computes the total energy (or, more precisely, the net energy) \mathcal E of a given state produced by the given model. The total energy is given by \mathcal E (\sigma) = \sum_{x \in X} (-1)^{1-\mathbf 1\left[ \sigma(\partial x) = 0 \right]} = \sum_{x \in X} \mathbf 1\left[ \sigma(\partial x) = 0 \right] - \sum_{x \in X} \mathbf 1\left[ \sigma(\partial x) \neq 0 \right], where the x \in X are d-cells and \sigma is a spin configuration on (d-1)-cells.

Args

state : tuple
The state from the Markov chain on the given model.
model : Model
The Model (e.g. SwendsenWang) from which data is collected.

Returns

The total (net) energy.