Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

add lower keyword to pinvh

  • Loading branch information...
commit dd25b44f78c389afa65756457d3e0078fc579bae 1 parent 3b86ec5
@jakevdp authored
Showing with 5 additions and 2 deletions.
  1. +5 −2 scipy/linalg/
7 scipy/linalg/
@@ -598,7 +598,7 @@ def pinv2(a, cond=None, rcond=None):
return np.transpose(np.conjugate( * psigma_diag, vh)))
-def pinvh(a, cond=None, rcond=None):
+def pinvh(a, cond=None, rcond=None, lower=True):
"""Compute the (Moore-Penrose) pseudo-inverse of a hermetian matrix.
Calculate a generalized inverse of a symmetric matrix using its
@@ -614,6 +614,9 @@ def pinvh(a, cond=None, rcond=None):
If None or -1, suitable machine precision is used.
+ lower : boolean
+ Whether the pertinent array data is taken from the lower or upper
+ triangle of a. (Default: lower)
@@ -637,7 +640,7 @@ def pinvh(a, cond=None, rcond=None):
a = np.asarray_chkfinite(a)
- s, u = decomp.eigh(a)
+ s, u = decomp.eigh(a, lower=lower)
if rcond is not None:
cond = rcond
Please sign in to comment.
Something went wrong with that request. Please try again.