Procedure | Location | Procedure Type | Description |
---|---|---|---|
cluster_number_density | percolation | Subroutine | Calculate the number density of clusters with different sizes. The cluster number density is defined as \begin{equation} n(s,p) = \sum_{\text{MC-samples}} \frac{\text{number of clusters with size }s} {L^2\cdot\text{number of MC-samples}}. \end{equation} Direct calculations will usually give bad results, as there will be very few clusters with large sizes compared to the numbers of clusters with small sizes. This is circumvented by doing logarithmic binning and averaging, i.e. \begin{equation} n\left([s+\Delta s),p\right) = \sum_{\text{MC-samples}} \frac{\text{number of clusters with size }s \in[s,s+\Delta s)} {\Delta s\cdot L^2\cdot\text{number of MC-samples}}, \label{eq:nsp} \end{equation} where \(\Delta s\) are logarithmically distributed. After execution, bin_mids will contain the centres of the bins. |
create_binary_matrix | percolation | Function | Create a random, binary ( |
find_intersection | utilities | Function | Find the common element in two arrays, given a total of num_labels unique elements. Used by find_spanning_cluster. |
find_random_point | utilities | Subroutine | Find a random position on matrix such that
matrix(i, j) is |
find_sizes | percolation | Function | Count the number of sites belonging to each cluster in the labelled matrix. |
find_spanning_cluster | percolation | Function | Find the label of the percolating cluster, i.e. the one spanning from one side of the system to the opposing side. |
hoshen_kopelman | hk | Function | Hoshen-Kopelman algorithm for labelling clusters on a binary matrix. |
label | percolation | Subroutine | Alternative interface to the Hoshen-Kopelman algorithm from the hk module, which uses a binary matrix created by create_binary_matrix. |
linfit | utilities | Subroutine | Compute a linear fit for the given data, return
the slope and the constant term.
|
linspace | utilities | Function | Create an array of N linearly spaced values (not intervals)
from a to b.
Similar to |
mark_percolating_with_periodic | utilities | Function | Return a |
one_random_walker | randomwalk | Function | Let one random walker do num_steps jumps on the |
periodic_wraparound | utilities | Subroutine | |
probability_distribution | randomwalk | Function | Start num_walkers on the percolating cluster of each of num_systems systems, and compute num_hists histograms of the distribution of particles. |
random_walkers | randomwalk | Function | Start num_walkers on the percolating cluster of each of num_systems systems, and return the averaged displacement. |
spanning_density | percolation | Function | Density of the spanning/percolating cluster, i.e. the number of sites on the percolating cluster divided by \(L^2\). Averaged over num_samples Monte Carlo samples (with OpenMP). |
spanning_probability | percolation | Function | Calculate the probability of having a spanning/percolating cluster, given a system size L and probability for a site to have transport p. |
spanning_probability_inverse | percolation | Function | Find the inverse of spanning_probability by use of the bisection method. |
stringfromint | utilities | Function | Make a string of "correct" length from a positive integer. |
uf_find | hk | Function | Union-Find find algorithm: Find the lowest corresponding label. Relabelling is done when necessary. |
uf_union | hk | Function | Union-Find union algorithm: Merge two labels, return the result. |