You forgot the outer brackets.
A = np.matrix([[1,0,0,a,0,0],[0,1,0,0,a,0],[0,0,1,0,0,a],[0,0,0,b,0,0],[0,0,0,0,b,0],[0,0,0,0,0,b]])
The numpy.matrix
constructor takes a single array-like argument to initialize the matrix, not a sequence of positional arguments representing the rows. (Additional positional arguments set things like the dtype.)