randomwalk Module


Uses

  • module~~randomwalk~~UsesGraph module~randomwalk randomwalk module~percolation percolation module~randomwalk->module~percolation module~utilities utilities module~randomwalk->module~utilities module~percolation->module~utilities module~hk hk module~percolation->module~hk

Contents


Functions

public function one_random_walker(matrix, num_steps) result(displacement)

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

Arguments

Type IntentOptional AttributesName
logical, intent(in), dimension(:,:):: matrix

Matrix whose .true. values are allowed positions for the random walker.

integer :: num_steps

Number of steps for the random walker to take.

Return Value real(kind=dp), dimension(:,:), allocatable

Array of displacements, which has dimension 2 \(\times\) (num_steps + 1), and should logically have dimension(2,0:num_steps), such that the i'th column contains the displacement after i steps. Averaged over all systems and all walkers.

public function random_walkers(p, L, num_systems, num_walkers, num_steps) result(displacement)

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

Arguments

Type IntentOptional AttributesName
real(kind=dp), intent(in) :: p

The probability for each site to allow transport.

integer, intent(in) :: L

The system size.

integer, intent(in) :: num_systems

The number of systems over which to average.

integer, intent(in) :: num_walkers

The number of random walkers for each system over which to average.

integer, intent(in) :: num_steps

The number of steps which the random walkers take.

Return Value real(kind=dp), dimension(:), allocatable

Array of squared displacements, which has dimension (num_steps + 1), and should logically have dimension(0:num_steps), such that the i'th element contains the displacement after i steps. Averaged over all systems and all walkers.

public function probability_distribution(p, L, num_steps, num_walkers, num_systems, num_hists) result(result_hist)

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

Arguments

Type IntentOptional AttributesName
real(kind=dp), intent(in) :: p

The probability for each site to allow transport.

integer, intent(in) :: L

The system size.

integer, intent(in) :: num_steps

The number of steps which the random walkers take.

integer, intent(in) :: num_walkers

The number of random walkers for each system over which to average.

integer, intent(in) :: num_systems

The number of systems over which to average.

integer, intent(in) :: num_hists

The number of histograms to be returned.

Return Value real(kind=dp), dimension(:,:), allocatable

Array of histograms. The first row contains the centres of the bins, while the remaining num_hists+1 rows each contain one histogram.