def mdot(*args):
    'chained matrix product: mdot(A,B,C,..) = A*B*C*...\n   No attempt is made to optimize the contraction order.'
    r = args[0]
    for a in args[1:]:
        r = dot(r, a)
    return r
chained matrix product: mdot(A,B,C,..) = A*B*C*...
No attempt is made to optimize the contraction order.
def mdot(*args):
    'chained matrix product: mdot(A,B,C,..) = A*B*C*...\n   No attempt is made to optimize the contraction order.'
    r = args[0]
    for a in args[1:]:
        r = dot(r, a)
    return r