LinearAlgebra - Maple Programming Help

Home : Support : Online Help : Mathematics : Linear Algebra : LinearAlgebra Package : Standard : LinearAlgebra/Norm

LinearAlgebra

 Norm
 compute the p-norm of a Matrix or Vector
 MatrixNorm
 compute the p-norm of a Matrix
 VectorNorm
 compute the p-norm of a Vector

 Calling Sequence Norm(A, p, c) MatrixNorm(A, p, c) VectorNorm(A, p, c)

Parameters

 A - Matrix or Vector p - (optional) non-negative number, infinity, -infinity, Euclidean, or Frobenius; norm selector that is dependent on A c - (optional) BooleanOpt(conjugate); specifies if the result in the 2-norm case for Matrices uses the Hermitian transpose or the result in the p-norm case for Vectors where p is even assumes that the entries of the Vector are real and avoids extra calls to abs.

Description

 • The Norm(A) command computes the infinity norm of A. The Norm(A,p) command computes the p-norm of A.
 If p or c is included in the calling sequence, their value and the resulting norm depends on whether A is a Vector or a Matrix.
 By default, Norm(A) computes the infinity-norm for A.
 Vector Norms
 • If V is a Vector and p is included in the calling sequence, p must be one of a non-negative number, infinity, -infinity, Frobenius, or Euclidean.
 By default, VectorNorm(A) computes the infinity-norm for A.
 The p-norm of a Vector V when $1<=p<\mathrm{infinity}$ is ${\mathrm{add}\left({\left|{V}_{i}\right|}^{p},i=1..\mathrm{Dimension}\left(V\right)\right)}^{\frac{1}{p}}$.
 The infinity-norm of Vector V is $\mathrm{max}\left(\mathrm{seq}\left(\left|{V}_{i}\right|,i=1..\mathrm{Dimension}\left(V\right)\right)\right)$.
 The -infinity-norm of Vector V is $\mathrm{min}\left(\mathrm{seq}\left(\left|{V}_{i}\right|,i=1..\mathrm{Dimension}\left(V\right)\right)\right)$. Note that the -infinity norm is neither a norm nor a metric. The infinity norm returns the maximum absolute value, so by a convention used in some other programs, the same function, Norm, can be used to get the minimum absolute value.
 Maple implements Vector norms for all $0<=p<=\mathrm{infinity}$. For $0 the final p'th root computation is not done ( i.e., the calculation is just $\mathrm{add}\left({\left|{V}_{i}\right|}^{p},i=1..\mathrm{Dimension}\left(V\right)\right)$. This defines a metric on R^n, but the pth root is not a norm and the form computed by VectorNorm in such cases is more useful. The limiting case of p = 0 returns the number of non-zero elements of V (this will be a floating-point number if p or any element of V is a floating-point number).
 For Vectors, the 2-norm can also be specified as either Euclidean or Frobenius.
 Matrix Norms
 • If A is a Matrix and p is included in the calling sequence, p must be one of 1, 2, infinity, Frobenius, or Euclidean.
 By default, MatrixNorm(A) computes the infinity-norm for A.
 The p-norm of a Matrix A is $\mathrm{max}\left(\mathrm{VectorNorm}\left(A\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}.\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}V,p\right)\right)$, where the maximum is taken over all Vectors V with $\mathrm{VectorNorm}\left(V,p\right)=1$.  Maple only implements MatrixNorm(A, p) for p = 1, 2, infinity and the special case p = Frobenius (which is not actually a Matrix norm; the Matrix A is treated as a "folded up" Vector). These norms are defined as the following.
 $\mathrm{MatrixNorm}\left(A,1\right)=\mathrm{max}\left(\mathrm{seq}\left(\mathrm{VectorNorm}\left({A}_{1..-1,j},1\right),j=1..\mathrm{ColumnDimension}\left(A\right)\right)\right)$
 $\mathrm{MatrixNorm}\left(A,\mathrm{\infty }\right)=\mathrm{max}\left(\mathrm{seq}\left(\mathrm{VectorNorm}\left({A}_{i,1..-1},1\right),i=1..\mathrm{RowDimension}\left(A\right)\right)\right)$
 $\mathrm{MatrixNorm}\left(A,2\right)=\sqrt{\mathrm{max}\left(\mathrm{seq}\left({\mathrm{Eigenvalues}\left(A\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}.\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}\mathrm{HermitianTranspose}\left(A\right)\right)}_{i},i=1..\mathrm{RowDimension}\left(A\right)\right)\right)}$
 $\mathrm{MatrixNorm}\left(A,\mathrm{Frobenius}\right)=\sqrt{\mathrm{add}\left(\mathrm{add}\left({\left|{A}_{i,j}\right|}^{2},j=1..\mathrm{ColumnDimension}\left(A\right)\right),i=1..\mathrm{RowDimension}\left(A\right)\right)}$
 For the 2-norm case of a Matrix, c may be included in the calling sequence to select between the transpose and the Hermitian transpose of A. The 2-norm case can also be specified by using Euclidean.
 • This function is part of the LinearAlgebra package, and so it can be used in the form Norm(..) only after executing the command with(LinearAlgebra). However, it can always be accessed through the long form of the command by using LinearAlgebra[Norm](..).

Examples

 > $\mathrm{with}\left(\mathrm{LinearAlgebra}\right):$
 > $A≔⟨⟨1,-1,0⟩|⟨0,1,1⟩|⟨1,0,1⟩⟩$
 ${A}{≔}\left[\begin{array}{rrr}{1}& {0}& {1}\\ {-}{1}& {1}& {0}\\ {0}& {1}& {1}\end{array}\right]$ (1)
 > $\mathrm{Norm}\left(A,2\right)$
 $\sqrt{{3}}$ (2)
 > $B≔⟨⟨10,0,0⟩|⟨0,9,\frac{1}{2}⟩|⟨2,4,1⟩⟩$
 ${B}{≔}\left[\begin{array}{ccc}{10}& {0}& {2}\\ {0}& {9}& {4}\\ {0}& \frac{{1}}{{2}}& {1}\end{array}\right]$ (3)
 > $\mathrm{MatrixNorm}\left(B,1\right)$
 ${10}$ (4)
 > $h≔⟨3|4⟩$
 ${h}{≔}\left[\begin{array}{cc}{3}& {4}\end{array}\right]$ (5)
 > $\mathrm{VectorScalarMultiply}\left(h,\frac{1}{\mathrm{VectorNorm}\left(h,\mathrm{Euclidean}\right)}\right)$
 $\left[\begin{array}{cc}\frac{{3}}{{5}}& \frac{{4}}{{5}}\end{array}\right]$ (6)
 > $\mathrm{VectorNorm}\left(⟨2,0⟩,0.5\right)$
 ${1.414213562}$ (7)
 > $v≔⟨a,b,c⟩$
 ${v}{≔}\left[\begin{array}{c}{a}\\ {b}\\ {c}\end{array}\right]$ (8)
 > $\mathrm{VectorNorm}\left(v,2,\mathrm{conjugate}=\mathrm{false}\right)$
 $\sqrt{{{a}}^{{2}}{+}{{b}}^{{2}}{+}{{c}}^{{2}}}$ (9)
 > $\mathrm{VectorNorm}\left(v,2,\mathrm{conjugate}=\mathrm{true}\right)$
 $\sqrt{{\left|{a}\right|}^{{2}}{+}{\left|{b}\right|}^{{2}}{+}{\left|{c}\right|}^{{2}}}$ (10)

References

 de Boor, Carl. "An Empty Exercise". ACM SIGNUM Newsletter, Vol. 25 No. 2. (1990): 2-6.