def _compute_num_derivatives(dimension, suffix=''):
    """Computes the number of derivatives of order 'n' as dimension()^n.

    Dimension will be the element topological dimension for the number
    of derivatives in local coordinates, and the geometric dimension
    for the number of derivatives in phyisical coordinates.
    """
    f_int = format['int']
    f_num_derivs = format['num derivatives'](suffix)
    code = [format['comment']('Compute number of derivatives.')]
    code.append(format['declaration'](format['uint declaration'],
        f_num_derivs, f_int(1)))
    loop_vars = [(format['free indices'][0], 0, format[
        'argument derivative order'])]
    lines = [format['imul'](f_num_derivs, f_int(dimension))]
    code += format['generate loop'](lines, loop_vars)
    return code
