def build_sampler( sampler_class, pe_method, force_method, T = 1.0e-4, \
    dt = 1.0e-1, traj_len = 100, absxmax = 1.0e2, dt_max = None, min_rate = 0.6, \
    max_rate = 0.7, gaussianprior_std = None ):
    """Builds a sampling.Sampler class object of type sampler_class. 
    
    Args:
        sampler_class : Sampler class from module sampling. Eg. sampling.Hmc
        pe_method : A method for evaluating the potential energy.
        force_method : A method for evaluating the forces.
        T (float) : Dimensionless temperature of the system: T=1/beta. (Default 1.0).
        dt (float) : Initial time step (or step size). This will be updated algorithmically, but a 
            good starting point saves time. (Default 1.0e-4).
        traj_len (int) : The number of time steps in a single trajectory. (Default 100).
        absxmax (single float or numpy array of floats, with length 1 or length numdim) : During the 
            main calculation, the sampler is restricted to a region x in [-absxmax,absxmax]. 
            (Default: 1.0e2).
        dt_max (float) : maximum step size (time step). (Default: median(absxmax), which is set in 
            module sampling.)
        min_rate (float) : minimum acceptance rate of trajectories. Used for setting step size (time 
            step). (Default: 0.6. The optimal acceptance rate for HMC on a multivariate Gaussian is 0.65
            http://www.mcmchandbook.net/HandbookChapter5.pdf, section 5.4.4.3).
        max_rate (float) : maximum acceptance rate of trajectories. Used for setting step size (time 
            step). (Default 0.7. The optimal acceptance rate for HMC on a multivariate Gaussian is 0.65
            http://www.mcmchandbook.net/HandbookChapter5.pdf, section 5.4.4.3).
        gaussianprior_std (single float or numpy array of floats, with length 1 or length numdim) : If 
            this is set to a real value then an additional term is applied to (H)MC acceptance/rejection, 
            such that the target distribution is proportional to a multivariate Gaussian with this 
            standard deviation for each dimension. (Default: None.)

    Return:
        sampling.Sampler class object of type sampler_class.

    """

    sampler = sampler_class( pe_method, force_method, dt, traj_len, absxmax, \
        dt_max, 1.0/T, min_rate, max_rate, gaussianprior_std )

    return sampler