Compare two forms

Good suggestion, as calling

import dolfinx as dfx
import mpi4py.MPI as mpi
import ufl
import ufl.algorithms.renumbering
mesh = dfx.mesh.create_unit_square(mpi.COMM_WORLD, 10, 10)
V = dfx.fem.FunctionSpace(mesh, ('P', 1))
u = dfx.fem.Function(V)
v = ufl.TestFunction(V)

F1 = ufl.dot(2*ufl.grad(u), ufl.grad(v))*ufl.dx
F2 = ufl.dot(2*ufl.grad(u), ufl.grad(v))*ufl.dx

print(F1)
print(F2)
ufl.algorithms.renumbering.renumber_indices(F1).equals( ufl.algorithms.renumbering.renumber_indices(F2))

resolves the issue.