I have a vector
>>> import numpy as np >>> v = np.array([1, 2, 3])
in numpy. One uses np.diag to create a diagona
np.diag