{"action":"created","issue":{"url":"https://api.github.com/repos/scipy/scipy/issues/4866","labels_url":"https://api.github.com/repos/scipy/scipy/issues/4866/labels{/name}","comments_url":"https://api.github.com/repos/scipy/scipy/issues/4866/comments","events_url":"https://api.github.com/repos/scipy/scipy/issues/4866/events","html_url":"https://github.com/scipy/scipy/issues/4866","id":75663430,"number":4866,"title":"Shouldn't scipy.linalg.sqrtm raise an error if matrix is singular?","user":{"login":"Acebulf","id":2665880,"avatar_url":"https://avatars.githubusercontent.com/u/2665880?v=3","gravatar_id":"","url":"https://api.github.com/users/Acebulf","html_url":"https://github.com/Acebulf","followers_url":"https://api.github.com/users/Acebulf/followers","following_url":"https://api.github.com/users/Acebulf/following{/other_user}","gists_url":"https://api.github.com/users/Acebulf/gists{/gist_id}","starred_url":"https://api.github.com/users/Acebulf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Acebulf/subscriptions","organizations_url":"https://api.github.com/users/Acebulf/orgs","repos_url":"https://api.github.com/users/Acebulf/repos","events_url":"https://api.github.com/users/Acebulf/events{/privacy}","received_events_url":"https://api.github.com/users/Acebulf/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-05-12T16:39:13Z","updated_at":"2015-05-12T19:03:52Z","closed_at":null,"body":"I'm a bit confused by scipy.linalg.sqrtm not raising an error if matrix is singular, since it can't compute anything (returns NaN array). Other functions such as scipy.linalg.inv will raise scipy.linalg.LinAlgError if matrix is singular and operation can not be performed. \r\n\r\nWhy are errors ignored here?\r\n\r\n*edit: I was under the assumption that it did not do ANY singular matrices, but it apparently does some of them. Even when it fails it won't raise an error, however."},"comment":{"url":"https://api.github.com/repos/scipy/scipy/issues/comments/101389410","html_url":"https://github.com/scipy/scipy/issues/4866#issuecomment-101389410","issue_url":"https://api.github.com/repos/scipy/scipy/issues/4866","id":101389410,"user":{"login":"argriffing","id":101416,"avatar_url":"https://avatars.githubusercontent.com/u/101416?v=3","gravatar_id":"","url":"https://api.github.com/users/argriffing","html_url":"https://github.com/argriffing","followers_url":"https://api.github.com/users/argriffing/followers","following_url":"https://api.github.com/users/argriffing/following{/other_user}","gists_url":"https://api.github.com/users/argriffing/gists{/gist_id}","starred_url":"https://api.github.com/users/argriffing/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/argriffing/subscriptions","organizations_url":"https://api.github.com/users/argriffing/orgs","repos_url":"https://api.github.com/users/argriffing/repos","events_url":"https://api.github.com/users/argriffing/events{/privacy}","received_events_url":"https://api.github.com/users/argriffing/received_events","type":"User","site_admin":false},"created_at":"2015-05-12T19:03:52Z","updated_at":"2015-05-12T19:03:52Z","body":"> There is already a failflag variable if no square root is found (independent of whether matrix is singular), but it does nothing.\r\n\r\nI just want to confirm that this flag does nothing.  At first I thought it could possibly come into play if `sqrtm` failed in a particular way for a nonsingular input matrix, but now I see that this cannot happen (the square roots of two entries on the diagonal of the Schur form of the input matrix would have to sum to zero, but this can only happen if those entries are both zero, and this would mean the matrix has two eigenvalues that are zero so the matrix would be singular)."}}