def matrix_multiply(A, B):
    """ 2D matrix multiplication, vectorized """
    (a11, a12), (a21, a22) = A
    (b11, b12), (b21, b22) = B
    return (a11 * b11 + a12 * b21, a11 * b12 + a12 * b22), (a21 * b11 + a22 *
        b21, a21 * b12 + a22 * b22)
