def METHOD_NAME(self):
    """Tests the parameter shift rules for `CommutingEvolution` equal the
    finite difference result for a four term shift rule case."""
    n_wires = 2
    dev = qml.device("default.qubit", wires=n_wires)
    coeffs = [1, -1]
    obs = [qml.PauliX(0) @ qml.PauliY(1), qml.PauliY(0) @ qml.PauliX(1)]
    hamiltonian = qml.Hamiltonian(coeffs, obs)
    frequencies = (2, 4)
    @qml.qnode(dev)
    def circuit(time):
        qml.PauliX(0)
        qml.CommutingEvolution(hamiltonian, time, frequencies)
        return qml.expval(qml.PauliZ(0))
    x_vals = [np.array(x, requires_grad=True) for x in np.linspace(-np.pi, np.pi, num=10)]
    grads_finite_diff = [qml.gradients.finite_diff(circuit)(x) for x in x_vals]
    grads_param_shift = [qml.gradients.param_shift(circuit)(x) for x in x_vals]
    assert all(np.isclose(grads_finite_diff, grads_param_shift, atol=1e-4))