===== The Frobenius norm is given by [1]_: :math:`||A||_F = [\sum_{i,j} abs(a_{i,j})^2]^{1/2}` The nuclear norm is the sum of the singular values. Both the Frobenius and nuclear norm orders are only defined for matrices. References ---------- .. [1] G. H. Golub and C. F. Van Loan, *Matrix Computations*, Baltimore, MD, Johns Hopkins University Press, 1985, pg. 15 Examples -------- >>> import numpy as np >>> from scipy.linalg import norm >>> a = np.arange(9) - 4.0 >>> a array([-4., -3., -2., -1., 0., 1., 2., 3., 4.]) >>> b = a.reshape((3, 3)) >>> b array([[-4., -3., -2.], [-1., 0., 1.], [ 2., 3., 4.]]) >>> norm(a) 7.745966692414834 >>> norm(b) 7.745966692414834 >>> norm(b, 'fro') 7.745966692414834 >>> norm(a, np.inf) 4.0 >>> norm(b, np.inf) 9.0 >>> norm(a, -np.inf) 0.0 >>> norm(b, -np.inf) 2.0 >>> norm(a, 1) 20.0 >>> norm(b, 1) 7.0 >>> norm(a, -1) -4.6566128774142013e-010 >>> norm(b, -1) 6.0 >>> norm(a, 2) 7.745966692414834 >>> norm(b, 2) 7.3484692283495345 >>> norm(a, -2) 0.0 >>> norm(b, -2) 1.8570331885190563e-016 >>> norm(a, 3) 5.8480354764257312 >>> norm(a, -3) 0.0 Ú