{"action":"created","issue":{"url":"https://api.github.com/repos/pynac/pynac/issues/233","repository_url":"https://api.github.com/repos/pynac/pynac","labels_url":"https://api.github.com/repos/pynac/pynac/issues/233/labels{/name}","comments_url":"https://api.github.com/repos/pynac/pynac/issues/233/comments","events_url":"https://api.github.com/repos/pynac/pynac/issues/233/events","html_url":"https://github.com/pynac/pynac/issues/233","id":213062998,"number":233,"title":"don't call PyNumberPower on some powers","user":{"login":"rwst","id":1146709,"avatar_url":"https://avatars1.githubusercontent.com/u/1146709?v=4","gravatar_id":"","url":"https://api.github.com/users/rwst","html_url":"https://github.com/rwst","followers_url":"https://api.github.com/users/rwst/followers","following_url":"https://api.github.com/users/rwst/following{/other_user}","gists_url":"https://api.github.com/users/rwst/gists{/gist_id}","starred_url":"https://api.github.com/users/rwst/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rwst/subscriptions","organizations_url":"https://api.github.com/users/rwst/orgs","repos_url":"https://api.github.com/users/rwst/repos","events_url":"https://api.github.com/users/rwst/events{/privacy}","received_events_url":"https://api.github.com/users/rwst/received_events","type":"User","site_admin":false},"labels":[{"id":200709304,"url":"https://api.github.com/repos/pynac/pynac/labels/low%20priority","name":"low priority","color":"fad8c7","default":false},{"id":212214103,"url":"https://api.github.com/repos/pynac/pynac/labels/performance","name":"performance","color":"bfe5bf","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-03-09T15:01:14Z","updated_at":"2018-03-07T16:35:41Z","closed_at":null,"author_association":"OWNER","body":"Every time expressions with `I` (or other `NumberFieldElements`) to a rational power are evaluated Sage's `QQbar.radical_expression` is called which uses `poly.roots(SR)` and subsequently Maxima's `solve` every time to solve (e.g. for `I`) `do_not_use_this_name_in_a_polynomial_coefficient^2 + 1`. This all just to get back the symbolic expression `I`.\r\n\r\nThis procedure is done e.g. six times in the course of\r\n```\r\nsage: 1/sqrt(-1-4*I)\r\n(4/17*I - 1/17)*sqrt(-4*I - 1)\r\n```\r\nwhere the output `1/sqrt(-1-4*I)` would have been perfectly sufficient.\r\n\r\nWe should prevent this humdrum by not expanding powers of number field elements automatically, but doing it on demand, i.e. with `expand()`. If this is not feasible then at least caching of the results should be investigated (and if feasible then caching could be a followup ticket)."},"comment":{"url":"https://api.github.com/repos/pynac/pynac/issues/comments/371198567","html_url":"https://github.com/pynac/pynac/issues/233#issuecomment-371198567","issue_url":"https://api.github.com/repos/pynac/pynac/issues/233","id":371198567,"user":{"login":"rwst","id":1146709,"avatar_url":"https://avatars1.githubusercontent.com/u/1146709?v=4","gravatar_id":"","url":"https://api.github.com/users/rwst","html_url":"https://github.com/rwst","followers_url":"https://api.github.com/users/rwst/followers","following_url":"https://api.github.com/users/rwst/following{/other_user}","gists_url":"https://api.github.com/users/rwst/gists{/gist_id}","starred_url":"https://api.github.com/users/rwst/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rwst/subscriptions","organizations_url":"https://api.github.com/users/rwst/orgs","repos_url":"https://api.github.com/users/rwst/repos","events_url":"https://api.github.com/users/rwst/events{/privacy}","received_events_url":"https://api.github.com/users/rwst/received_events","type":"User","site_admin":false},"created_at":"2018-03-07T16:35:41Z","updated_at":"2018-03-07T16:35:41Z","author_association":"OWNER","body":"This has worked out and is reasonably fast, although the first command in a Sage session still takes some time because of the imports. Caching not necessary.\r\n\r\nStill, with creation of a `PYOBJECT` numeric the exact and complex flags can be cached which would speed up those queries anyway. This would allow holding such powers."}}
{"actor":{"display_login":"rwst"}}