def create(cls, op, *, derivs, vals=None):
        """Instantiate the derivative by repeatedly calling
        the :meth:`~QuantumExpression._diff` method of `op` and evaluating the
        result at the given `vals`.
        """
        # To ensure stable ordering in Expression._get_instance_key, we explicitly
        # convert `derivs` and `vals` to a tuple structure with a custom sorting key.
        if not isinstance(derivs, tuple):
            derivs = cls._dict_to_ordered_tuple(dict(derivs))
        if not (isinstance(vals, tuple) or vals is None):
            vals = cls._dict_to_ordered_tuple(dict(vals))
        return super().create(op, derivs=derivs, vals=vals)
Instantiate the derivative by repeatedly calling
        the :meth:`~QuantumExpression._diff` method of `op` and evaluating the
        result at the given `vals`.