{"action":"created","issue":{"url":"https://api.github.com/repos/scipy/scipy/issues/5336","labels_url":"https://api.github.com/repos/scipy/scipy/issues/5336/labels{/name}","comments_url":"https://api.github.com/repos/scipy/scipy/issues/5336/comments","events_url":"https://api.github.com/repos/scipy/scipy/issues/5336/events","html_url":"https://github.com/scipy/scipy/issues/5336","id":110530755,"number":5336,"title":"sqrtm on a diagonal matrix can warn \"Matrix is singular and may not have a square root.\"","user":{"login":"bubaflub","id":76328,"avatar_url":"https://avatars.githubusercontent.com/u/76328?v=3","gravatar_id":"","url":"https://api.github.com/users/bubaflub","html_url":"https://github.com/bubaflub","followers_url":"https://api.github.com/users/bubaflub/followers","following_url":"https://api.github.com/users/bubaflub/following{/other_user}","gists_url":"https://api.github.com/users/bubaflub/gists{/gist_id}","starred_url":"https://api.github.com/users/bubaflub/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bubaflub/subscriptions","organizations_url":"https://api.github.com/users/bubaflub/orgs","repos_url":"https://api.github.com/users/bubaflub/repos","events_url":"https://api.github.com/users/bubaflub/events{/privacy}","received_events_url":"https://api.github.com/users/bubaflub/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/scipy/scipy/labels/scipy.linalg","name":"scipy.linalg","color":"207de5"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-10-08T20:05:30Z","updated_at":"2015-10-23T16:20:37Z","closed_at":null,"body":"Hello,\r\n\r\nNot sure if this is a real bug, a clarification for the documentation, or simply expected behavior.  This may be related to issue #4866.\r\n\r\nI was using the sqrtm function on a diagonal matrix and I got the warning\r\n\r\n    Matrix is singular and may not have a square root.\r\n\r\nWhile the resulting output is correct, it was a bit surprising to see that warning message.  Calculating the square root of a diagonal matrix is just the square root of every item on the diagonal, right?\r\n\r\nExample:\r\n\r\n    >>> a = scipy.diag([2, 1, 0])\r\n    >>> scipy.linalg.sqrtm(a)\r\n    Matrix is singular and may not have a square root.\r\n    array([[ 1.41421356,  0.        ,  0.        ],\r\n           [ 0.        ,  1.        ,  0.        ],\r\n           [ 0.        ,  0.        ,  0.        ]])\r\n    "},"comment":{"url":"https://api.github.com/repos/scipy/scipy/issues/comments/150624029","html_url":"https://github.com/scipy/scipy/issues/5336#issuecomment-150624029","issue_url":"https://api.github.com/repos/scipy/scipy/issues/5336","id":150624029,"user":{"login":"SoumitraAgarwal","id":9803188,"avatar_url":"https://avatars.githubusercontent.com/u/9803188?v=3","gravatar_id":"","url":"https://api.github.com/users/SoumitraAgarwal","html_url":"https://github.com/SoumitraAgarwal","followers_url":"https://api.github.com/users/SoumitraAgarwal/followers","following_url":"https://api.github.com/users/SoumitraAgarwal/following{/other_user}","gists_url":"https://api.github.com/users/SoumitraAgarwal/gists{/gist_id}","starred_url":"https://api.github.com/users/SoumitraAgarwal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SoumitraAgarwal/subscriptions","organizations_url":"https://api.github.com/users/SoumitraAgarwal/orgs","repos_url":"https://api.github.com/users/SoumitraAgarwal/repos","events_url":"https://api.github.com/users/SoumitraAgarwal/events{/privacy}","received_events_url":"https://api.github.com/users/SoumitraAgarwal/received_events","type":"User","site_admin":false},"created_at":"2015-10-23T16:20:37Z","updated_at":"2015-10-23T16:20:37Z","body":"Adding to what @bubaflub said, I believe that this issue has been raised 2-3 times and thus deserves a sentence in the documentation. Other than that, changing the sqrtm function shouldnt be nessc. as it gives the required output and the warning is only suggestive. "}}