Procedures

ProcedureLocationProcedure TypeDescription
cluster_number_densitypercolationSubroutine

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_matrixpercolationFunction

Create a random, binary (logical) matrix, which can be used in percolation experiments.

find_intersectionutilitiesFunction

Find the common element in two arrays, given a total of num_labels unique elements. Used by find_spanning_cluster.

find_random_pointutilitiesSubroutine

Find a random position on matrix such that matrix(i, j) is .true..

find_sizespercolationFunction

Count the number of sites belonging to each cluster in the labelled matrix.

find_spanning_clusterpercolationFunction

Find the label of the percolating cluster, i.e. the one spanning from one side of the system to the opposing side.

hoshen_kopelmanhkFunction

Hoshen-Kopelman algorithm for labelling clusters on a binary matrix.

Read more…
labelpercolationSubroutine

Alternative interface to the Hoshen-Kopelman algorithm from the hk module, which uses a binary matrix created by create_binary_matrix.

linfitutilitiesSubroutine

Compute a linear fit for the given data, return the slope and the constant term. dgels from LAPACK solves the linear least squares problem.

linspaceutilitiesFunction

Create an array of N linearly spaced values (not intervals) from a to b. Similar to numpy.linspace(a, b, N).

mark_percolating_with_periodicutilitiesFunction

Return a logical matrix where the .true. values are the sites belonging to the percolating cluster, when periodic boundary conditions are considered.

one_random_walkerrandomwalkFunction

Let one random walker do num_steps jumps on the .true. values of matrix. The initial position is randomly selected.

periodic_wraparoundutilitiesSubroutine
probability_distributionrandomwalkFunction

Start num_walkers on the percolating cluster of each of num_systems systems, and compute num_hists histograms of the distribution of particles.

random_walkersrandomwalkFunction

Start num_walkers on the percolating cluster of each of num_systems systems, and return the averaged displacement.

spanning_densitypercolationFunction

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_probabilitypercolationFunction

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_inversepercolationFunction

Find the inverse of spanning_probability by use of the bisection method.

stringfromintutilitiesFunction

Make a string of "correct" length from a positive integer.

uf_findhkFunction

Union-Find find algorithm: Find the lowest corresponding label. Relabelling is done when necessary.

uf_unionhkFunction

Union-Find union algorithm: Merge two labels, return the result.

call~~graph~~CallGraph proc~find_random_point find_random_point proc~uf_union uf_union proc~uf_find uf_find proc~uf_union->proc~uf_find proc~find_intersection find_intersection proc~linfit linfit dgels dgels proc~linfit->dgels proc~one_random_walker one_random_walker proc~one_random_walker->proc~find_random_point proc~periodic_wraparound periodic_wraparound proc~one_random_walker->proc~periodic_wraparound proc~stringfromint stringfromint proc~spanning_density spanning_density proc~random_walkers random_walkers proc~random_walkers->proc~one_random_walker proc~label label proc~random_walkers->proc~label proc~find_spanning_cluster find_spanning_cluster proc~random_walkers->proc~find_spanning_cluster proc~create_binary_matrix create_binary_matrix proc~random_walkers->proc~create_binary_matrix proc~mark_percolating_with_periodic mark_percolating_with_periodic proc~random_walkers->proc~mark_percolating_with_periodic proc~spanning_probability spanning_probability proc~hoshen_kopelman hoshen_kopelman proc~label->proc~hoshen_kopelman proc~linspace linspace proc~find_spanning_cluster->proc~find_intersection proc~find_sizes find_sizes proc~spanning_probability_inverse spanning_probability_inverse proc~spanning_probability_inverse->proc~spanning_probability proc~hoshen_kopelman->proc~uf_union proc~hoshen_kopelman->proc~uf_find proc~cluster_number_density cluster_number_density proc~cluster_number_density->proc~label proc~cluster_number_density->proc~find_spanning_cluster proc~cluster_number_density->proc~create_binary_matrix proc~cluster_number_density->proc~find_sizes proc~probability_distribution probability_distribution proc~probability_distribution->proc~one_random_walker proc~probability_distribution->proc~label proc~probability_distribution->proc~find_spanning_cluster proc~probability_distribution->proc~create_binary_matrix proc~probability_distribution->proc~mark_percolating_with_periodic
Help