PseudoInverse[m] finds the pseudoinverse of a rectangular matrix.
Find the pseudoinverse of an invertible matrix: In[1]:=m=(1 | 2 3 | 4); PseudoInverse[m] Out[1]={{-2, 1}, {3/2, -1/2}} The pseudoinverse is merely the inverse: In[2]:=%==Inverse[m] Out[2]=True Find the pseudoinverse of a singular matrix: In[1]:=m=(1 | 2 | 3 4 | 5 | 6 7 | 8 | 9); p=PseudoInverse[m] Out[1]={{-23/36, -1/6, 11/36}, {-1/18, 0, 1/18}, {19/36, 1/6, -7/36}} The determinant of m is zero, so it does not have a true inverse: In[2]:=Det[m] Out[2]=0 For a pseudoinverse, both m.p.m = m and p.m.p = p: In[3]:=m.p.m==m && p.m.p==p Out[3]=True However, in this particular case neither m.p nor p.m is an identity matrix: In[4]:={m.p//MatrixForm, p.m//MatrixForm} Out[4]={(5/6 | 1/3 | -1/6 1/3 | 1/3 | 1/3 -1/6 | 1/3 | 5/6), (5/6 | 1/3 | -1/6 1/3 | 1/3 | 1/3 -1/6 | 1/3 | 5/6)} Find the pseudoinverse of a rectangular matrix: In[1]:=m=(1 | 2 | 3 4 | 5 | 6); p=PseudoInverse[m] Out[1]={{-17/18, 4/9}, {-1/9, 1/9}, {13/18, -2/9}} In this particular case, m.p is an identity matrix: In[2]:=m.p Out[2]={{1, 0}, {0, 1}} However, p.m is not: In[3]:=p.m Out[3]={{5/6, 1/3, -1/6}, {1/3, 1/3, 1/3}, {-1/6, 1/3, 5/6}}
Tolerance
Tolerance | 0 | 10^(-15)
NonThreadable | Protected | ReadProtected
Inverse | LeastSquares | Fit | SingularValueDecomposition | SingularValueList | DrazinInverse
1543rd most common (1 in 271000 symbols)
1159th most common (1 in 462000 symbols)
2253rd most common (1 in 57900 symbols)
introduced in Version 1 (June 1988) last modified in Version 14.3 (July 2025)