{"action":"created","issue":{"url":"https://api.github.com/repos/qutip/qutip/issues/432","repository_url":"https://api.github.com/repos/qutip/qutip","labels_url":"https://api.github.com/repos/qutip/qutip/issues/432/labels{/name}","comments_url":"https://api.github.com/repos/qutip/qutip/issues/432/comments","events_url":"https://api.github.com/repos/qutip/qutip/issues/432/events","html_url":"https://github.com/qutip/qutip/issues/432","id":133738858,"number":432,"title":"MemoryError when printing","user":{"login":"Phyks","id":3856586,"avatar_url":"https://avatars.githubusercontent.com/u/3856586?v=3","gravatar_id":"","url":"https://api.github.com/users/Phyks","html_url":"https://github.com/Phyks","followers_url":"https://api.github.com/users/Phyks/followers","following_url":"https://api.github.com/users/Phyks/following{/other_user}","gists_url":"https://api.github.com/users/Phyks/gists{/gist_id}","starred_url":"https://api.github.com/users/Phyks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Phyks/subscriptions","organizations_url":"https://api.github.com/users/Phyks/orgs","repos_url":"https://api.github.com/users/Phyks/repos","events_url":"https://api.github.com/users/Phyks/events{/privacy}","received_events_url":"https://api.github.com/users/Phyks/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-02-15T15:20:16Z","updated_at":"2016-02-16T01:34:47Z","closed_at":null,"body":"Hi,\r\n\r\n```python\r\nimport qutip\r\nqutip.tensor(qutip.destroy(20), qutip.destroy(20), qutip.destroy(20))\r\n```\r\nworks fine, but gives a `MemoryError` (in a Jupyter Notebook for instance) as it trying to print the full size matrix.\r\n\r\nMaybe above a given size, it would be better to just display the `.data` (sparse matrix) attribute rather than trying to display the full matrix and raising `MemoryError`? (plus a sparse matrix may give more information than the full matrix)."},"comment":{"url":"https://api.github.com/repos/qutip/qutip/issues/comments/184467556","html_url":"https://github.com/qutip/qutip/issues/432#issuecomment-184467556","issue_url":"https://api.github.com/repos/qutip/qutip/issues/432","id":184467556,"user":{"login":"cgranade","id":31516,"avatar_url":"https://avatars.githubusercontent.com/u/31516?v=3","gravatar_id":"","url":"https://api.github.com/users/cgranade","html_url":"https://github.com/cgranade","followers_url":"https://api.github.com/users/cgranade/followers","following_url":"https://api.github.com/users/cgranade/following{/other_user}","gists_url":"https://api.github.com/users/cgranade/gists{/gist_id}","starred_url":"https://api.github.com/users/cgranade/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cgranade/subscriptions","organizations_url":"https://api.github.com/users/cgranade/orgs","repos_url":"https://api.github.com/users/cgranade/repos","events_url":"https://api.github.com/users/cgranade/events{/privacy}","received_events_url":"https://api.github.com/users/cgranade/received_events","type":"User","site_admin":false},"created_at":"2016-02-16T01:34:47Z","updated_at":"2016-02-16T01:34:47Z","body":"I'm actually a bit confused about why there would be a ``MemoryError`` when outputting in Jupyter Notebook, since ``Qobj._repr_latex_`` currently only converts the first and last five rows and columns. Indeed, when I ran the exact code listed in a Jupyter Notebook, the output was properly truncated to prevent printing a gigantic matrix:\r\n\r\n<img width=\"584\" src=\"https://cloud.githubusercontent.com/assets/31516/13064734/8ba727fe-d4a9-11e5-9a81-134bc2eaccfe.PNG\">"}}