'Returns ``(g, dummies, msym, v)``, the entries of ``canonicalize``
see ``canonicalize`` in ``tensor_can.py``'

def canon_args(self):

    from sympy.combinatorics.permutations import _af_new
    n = self._ext_rank
    g = (([None] * n) + [n, (n + 1)])
    pos = 0
    vpos = []
    components = self.components
    for t in components:
        vpos.append(pos)
        pos += t._rank
    for (i, (indx, ipos, cpos)) in enumerate(self._get_sorted_free_indices_for_canon()):
        pos = (vpos[cpos] + ipos)
        g[pos] = i
    pos = len(self.free)
    j = len(self.free)
    dummies = []
    prev = None
    a = []
    msym = []
    for (ipos1, ipos2, cpos1, cpos2) in self._get_sorted_dum_indices_for_canon():
        pos1 = (vpos[cpos1] + ipos1)
        pos2 = (vpos[cpos2] + ipos2)
        g[pos1] = j
        g[pos2] = (j + 1)
        j += 2
        typ = components[cpos1].index_types[ipos1]
        if (typ != prev):
            if a:
                dummies.append(a)
            a = [pos, (pos + 1)]
            prev = typ
            msym.append(typ.metric_antisym)
        else:
            a.extend([pos, (pos + 1)])
        pos += 2
    if a:
        dummies.append(a)
    numtyp = []
    prev = None
    for t in components:
        if (t == prev):
            numtyp[(-1)][1] += 1
        else:
            prev = t
            numtyp.append([prev, 1])
    v = []
    for (h, n) in numtyp:
        if ((h._comm == 0) or (h._comm == 1)):
            comm = h._comm
        else:
            comm = TensorManager.get_comm(h._comm, h._comm)
        v.append((h._symmetry.base, h._symmetry.generators, n, comm))
    return (_af_new(g), dummies, msym, v)
