Create_transfer_matrix functionality in dolfin-x

I was wondering if there exists similar functionality to PETScDMCollection.create_transfer_matrix in dolfin-x? That is, I need the transfer matrix between two different function spaces.

from dolfinx.fem import Function, FunctionSpace
from dolfinx.mesh import create_unit_square

mesh1 = create_unit_square(MPI.COMM_WORLD, 16, 16, mesh.CellType.triangle)
mesh2 = create_unit_square(MPI.COMM_WORLD, 32, 32, mesh.CellType.triangle)

V1 = FunctionSpace(mesh1, ('DG', 0))
V2 = FunctionSpace(mesh2, ('CG', 1))

f1 = Function(V1)

# This is the functionality I would need from legacy fenics
# A = PETScDMCollection.create_transfer_matrix(V1,V2)

See for instance: Interpolation between different meshes by massimiliano-leoni · Pull Request #1598 · FEniCS/dolfinx · GitHub
Which is a proposed way of interpolating data from one mesh to another.

A similar strategy could be used to create a transfer matrix

Is it possible to provide an example code or any hints to implement the create_transfer_matrix functionality?

See Interpolation matrix with non matching meshes - #14 by bay_swiss