def scalarMul(a, mul=1):
    """Returns the scalar product of A and n (nA)

    Args
    ----
    A (compulsory)
        A matrix.
    mul (int/float, optional)
        The multiplication factor. Defaults to 1.

    Returns
    -------
    Matrix
        The matrix multiplied with the multiplication factor
    """
    for i in range(len(a)):
        for j in range(len(a[i])):
            a[j][i] *= mul
    return a