def derivative_counts_to_listing(derivative_counts):
    """Convert a derivative count tuple to a derivative listing tuple.

    The derivative d^3 / dy^2 dz is represented
    in counting form as (0, 2, 1) meaning (dx^0, dy^2, dz^1)
    and in listing form as (1, 1, 2) meaning (dy, dy, dz).
    """
    derivatives = []
    for i, d in enumerate(derivative_counts):
        derivatives.extend((i,) * d)
    return tuple(derivatives)
