def refine_MatMul(expr, assumptions):
    newargs = []
    last = expr.args[0]
    for arg in expr.args[1:]:
        if arg == last.T and ask(Q.orthogonal(arg), assumptions):
            last = Identity(arg.shape[0])
        elif arg == last.conjugate() and ask(Q.unitary(arg), assumptions):
            last = Identity(arg.shape[0])
        else:
            newargs.append(last)
            last = arg
    newargs.append(last)

    return MatMul(*newargs)
Returns the clustering coefficient for the generator.
dataset/ETHPy150Open sympy/sympy/sympy/matrices/expressions/matmul.py/refine_MatMul--crossover with--dataset/ETHPy150Open charanpald/APGL/apgl/generator/ErdosRenyiGenerator.py/ErdosRenyiGenerator.clusteringCoefficient