def parallelBiasForceHook(step, time, configuration, local_forces):
    # Add a bias force to the force acting on the first atom
    # in the z-direction.
    # First, check if the first atom is in the local domain.
    if 0 in configuration.localIndices():
        # Get the local index of the atom with first atom.
        local_index = numpy.where(configuration.localIndices() == 0)[0]

        # Get the local coordinates and calculate the bias force.
        local_positions = configuration.localCartesianCoordinates()
        bias_force = -0.5*eV/Ang**2*(local_positions[local_index, 2] - 2.0*Ang)

        # Add the bias force to the local forces vector.
        local_forces[local_index, 2] += bias_force
