{"action":"created","issue":{"url":"https://api.github.com/repos/Qiskit/qiskit-terra/issues/911","repository_url":"https://api.github.com/repos/Qiskit/qiskit-terra","labels_url":"https://api.github.com/repos/Qiskit/qiskit-terra/issues/911/labels{/name}","comments_url":"https://api.github.com/repos/Qiskit/qiskit-terra/issues/911/comments","events_url":"https://api.github.com/repos/Qiskit/qiskit-terra/issues/911/events","html_url":"https://github.com/Qiskit/qiskit-terra/pull/911","id":361465280,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE2NDI5OTQ3","number":911,"title":"Add draw() method to QuantumCircuit class","user":{"login":"mtreinish","id":2447371,"node_id":"MDQ6VXNlcjI0NDczNzE=","avatar_url":"https://avatars0.githubusercontent.com/u/2447371?v=4","gravatar_id":"","url":"https://api.github.com/users/mtreinish","html_url":"https://github.com/mtreinish","followers_url":"https://api.github.com/users/mtreinish/followers","following_url":"https://api.github.com/users/mtreinish/following{/other_user}","gists_url":"https://api.github.com/users/mtreinish/gists{/gist_id}","starred_url":"https://api.github.com/users/mtreinish/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mtreinish/subscriptions","organizations_url":"https://api.github.com/users/mtreinish/orgs","repos_url":"https://api.github.com/users/mtreinish/repos","events_url":"https://api.github.com/users/mtreinish/events{/privacy}","received_events_url":"https://api.github.com/users/mtreinish/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":15,"created_at":"2018-09-18T20:14:02Z","updated_at":"2018-10-31T14:06:19Z","closed_at":null,"author_association":"MEMBER","pull_request":{"url":"https://api.github.com/repos/Qiskit/qiskit-terra/pulls/911","html_url":"https://github.com/Qiskit/qiskit-terra/pull/911","diff_url":"https://github.com/Qiskit/qiskit-terra/pull/911.diff","patch_url":"https://github.com/Qiskit/qiskit-terra/pull/911.patch"},"body":"<!--\r\n⚠️ If you do not respect this template, your pull request will be closed.\r\n⚠️ Your pull request title should be short detailed and understandable for all.\r\n⚠️ Also, please add it in the CHANGELOG file under Unreleased section.\r\n⚠️ If your pull request fixes an open issue, please link to the issue.\r\n\r\n✅ I have added the tests to cover my changes.\r\n✅ I have updated the documentation accordingly.\r\n✅ I have read the CONTRIBUTING document.\r\n-->\r\n\r\n### Summary\r\nResolves #1004\r\n\r\nAdd draw() method on QuantumCircuit class.\r\n    \r\nThis PR adds a draw() method to the QuantumCircuit class for\r\nvisualizing the circuit. This is basically just an alternative interface\r\nto qiskit.tools.visualization._circuit_drawer() but is more convenient\r\nbecause it's baked into the quantum circuit. This means users don't have\r\nto import an additional module and can just visualize any circuits after\r\ncreating them.\r\n\r\n### Details and comments\r\n\r\nThere is a lot of complexity in this branch caused by 2 factors in conflict. The first is the use of many class imports in __init__.py which makes import level execution unconditional for any submodules, and the second being maintaining backwards compatibility. These were coming into conflict because we needed to import the visualization code path from qiskit._quantumcircuit to actually draw the circuits. But, because the visualizations relying on an ast representation of the circuit (at least for today) we were encountering a lot of circular imports. However, the code being called didn't directly have the cycle, it was being caused by unrelated class imports in the __init__.py for qiskit.unroll. To maintain backwards compatibility for these while also fixing this issue this had to split things up a bit.\r\n"},"comment":{"url":"https://api.github.com/repos/Qiskit/qiskit-terra/issues/comments/434700125","html_url":"https://github.com/Qiskit/qiskit-terra/pull/911#issuecomment-434700125","issue_url":"https://api.github.com/repos/Qiskit/qiskit-terra/issues/911","id":434700125,"node_id":"MDEyOklzc3VlQ29tbWVudDQzNDcwMDEyNQ==","user":{"login":"mtreinish","id":2447371,"node_id":"MDQ6VXNlcjI0NDczNzE=","avatar_url":"https://avatars0.githubusercontent.com/u/2447371?v=4","gravatar_id":"","url":"https://api.github.com/users/mtreinish","html_url":"https://github.com/mtreinish","followers_url":"https://api.github.com/users/mtreinish/followers","following_url":"https://api.github.com/users/mtreinish/following{/other_user}","gists_url":"https://api.github.com/users/mtreinish/gists{/gist_id}","starred_url":"https://api.github.com/users/mtreinish/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mtreinish/subscriptions","organizations_url":"https://api.github.com/users/mtreinish/orgs","repos_url":"https://api.github.com/users/mtreinish/repos","events_url":"https://api.github.com/users/mtreinish/events{/privacy}","received_events_url":"https://api.github.com/users/mtreinish/received_events","type":"User","site_admin":false},"created_at":"2018-10-31T14:06:19Z","updated_at":"2018-10-31T14:06:19Z","author_association":"MEMBER","body":"This also conflicts with #1172 now. I think we should wait for #1172 to merge before this, since that is a more self contained commit."}}
{"actor":{"display_login":"mtreinish"}}