{"action":"created","comment":{"url":"https://api.github.com/repos/quantumlib/OpenFermion/pulls/comments/212762028","pull_request_review_id":149468798,"id":212762028,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxMjc2MjAyOA==","diff_hunk":"@@ -0,0 +1,290 @@\n+#   Licensed under the Apache License, Version 2.0 (the \"License\");\n+#   you may not use this file except in compliance with the License.\n+#   You may obtain a copy of the License at\n+#\n+#       http://www.apache.org/licenses/LICENSE-2.0\n+#\n+#   Unless required by applicable law or agreed to in writing, software\n+#   distributed under the License is distributed on an \"AS IS\" BASIS,\n+#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+#   See the License for the specific language governing permissions and\n+#   limitations under the License.\n+\n+\"\"\"Code for evaluating Trotter errors for diagonal Coulomb Hamiltonians.\"\"\"\n+\n+import numpy\n+\n+from future.utils import iteritems\n+\n+from openfermion import count_qubits, FermionOperator\n+from openfermion.utils._low_depth_trotter_error import (\n+    simulation_ordered_grouped_low_depth_terms_with_info)\n+from openfermion.utils._commutator_diagonal_coulomb_operator import (\n+    commutator_ordered_diagonal_coulomb_with_two_body_operator)\n+\n+\n+def diagonal_coulomb_potential_and_kinetic_terms_as_arrays(hamiltonian):\n+    \"\"\"Give the potential and kinetic terms of a diagonal Coulomb Hamiltonian\n+    as arrays.\n+\n+    Args:\n+        hamiltonian (FermionOperator): The diagonal Coulomb Hamiltonian to","path":"src/openfermion/utils/_diagonal_coulomb_trotter_error.py","position":31,"original_position":31,"commit_id":"117c2e7f1cbc4b835d22cb79d9e094a2e6955109","original_commit_id":"117c2e7f1cbc4b835d22cb79d9e094a2e6955109","user":{"login":"idk3","id":10775197,"node_id":"MDQ6VXNlcjEwNzc1MTk3","avatar_url":"https://avatars3.githubusercontent.com/u/10775197?v=4","gravatar_id":"","url":"https://api.github.com/users/idk3","html_url":"https://github.com/idk3","followers_url":"https://api.github.com/users/idk3/followers","following_url":"https://api.github.com/users/idk3/following{/other_user}","gists_url":"https://api.github.com/users/idk3/gists{/gist_id}","starred_url":"https://api.github.com/users/idk3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/idk3/subscriptions","organizations_url":"https://api.github.com/users/idk3/orgs","repos_url":"https://api.github.com/users/idk3/repos","events_url":"https://api.github.com/users/idk3/events{/privacy}","received_events_url":"https://api.github.com/users/idk3/received_events","type":"User","site_admin":false},"body":"Modified so it can take both.","created_at":"2018-08-24T21:41:42Z","updated_at":"2018-08-24T21:41:42Z","html_url":"https://github.com/quantumlib/OpenFermion/pull/439#discussion_r212762028","pull_request_url":"https://api.github.com/repos/quantumlib/OpenFermion/pulls/439","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/quantumlib/OpenFermion/pulls/comments/212762028"},"html":{"href":"https://github.com/quantumlib/OpenFermion/pull/439#discussion_r212762028"},"pull_request":{"href":"https://api.github.com/repos/quantumlib/OpenFermion/pulls/439"}},"in_reply_to_id":212708373},"pull_request":{"url":"https://api.github.com/repos/quantumlib/OpenFermion/pulls/439","id":210697805,"node_id":"MDExOlB1bGxSZXF1ZXN0MjEwNjk3ODA1","html_url":"https://github.com/quantumlib/OpenFermion/pull/439","diff_url":"https://github.com/quantumlib/OpenFermion/pull/439.diff","patch_url":"https://github.com/quantumlib/OpenFermion/pull/439.patch","issue_url":"https://api.github.com/repos/quantumlib/OpenFermion/issues/439","number":439,"state":"open","locked":false,"title":"Masking + caching for evaluating errors for different Trotter steps","user":{"login":"idk3","id":10775197,"node_id":"MDQ6VXNlcjEwNzc1MTk3","avatar_url":"https://avatars3.githubusercontent.com/u/10775197?v=4","gravatar_id":"","url":"https://api.github.com/users/idk3","html_url":"https://github.com/idk3","followers_url":"https://api.github.com/users/idk3/followers","following_url":"https://api.github.com/users/idk3/following{/other_user}","gists_url":"https://api.github.com/users/idk3/gists{/gist_id}","starred_url":"https://api.github.com/users/idk3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/idk3/subscriptions","organizations_url":"https://api.github.com/users/idk3/orgs","repos_url":"https://api.github.com/users/idk3/repos","events_url":"https://api.github.com/users/idk3/events{/privacy}","received_events_url":"https://api.github.com/users/idk3/received_events","type":"User","site_admin":false},"body":"Computes Trotter error operators for both the split-operator and fermionic swap network Trotter steps.\r\n\r\nThe fermionic swap network functionality covers the same use cases as in https://github.com/quantumlib/OpenFermion/blob/master/src/openfermion/utils/_low_depth_trotter_error.py, though the new code is quite a bit faster. That code is much simpler, so I'm not sure we should replace it outright, though we probably could. The new split-operator code uses similar tricks to get a comparable speedup, though evaluating the split-operator Trotter error should be easier in general since there are effectively only two terms in the Trotter ordering.","created_at":"2018-08-24T10:13:03Z","updated_at":"2018-08-24T21:41:42Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d93893a2f95ee6530bac6d617b533ca9f004533e","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":923815919,"node_id":"MDU6TGFiZWw5MjM4MTU5MTk=","url":"https://api.github.com/repos/quantumlib/OpenFermion/labels/cla:%20yes","name":"cla: yes","color":"0e8a16","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/quantumlib/OpenFermion/pulls/439/commits","review_comments_url":"https://api.github.com/repos/quantumlib/OpenFermion/pulls/439/comments","review_comment_url":"https://api.github.com/repos/quantumlib/OpenFermion/pulls/comments{/number}","comments_url":"https://api.github.com/repos/quantumlib/OpenFermion/issues/439/comments","statuses_url":"https://api.github.com/repos/quantumlib/OpenFermion/statuses/117c2e7f1cbc4b835d22cb79d9e094a2e6955109","head":{"label":"idk3:masking","ref":"masking","sha":"117c2e7f1cbc4b835d22cb79d9e094a2e6955109","user":{"login":"idk3","id":10775197,"node_id":"MDQ6VXNlcjEwNzc1MTk3","avatar_url":"https://avatars3.githubusercontent.com/u/10775197?v=4","gravatar_id":"","url":"https://api.github.com/users/idk3","html_url":"https://github.com/idk3","followers_url":"https://api.github.com/users/idk3/followers","following_url":"https://api.github.com/users/idk3/following{/other_user}","gists_url":"https://api.github.com/users/idk3/gists{/gist_id}","starred_url":"https://api.github.com/users/idk3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/idk3/subscriptions","organizations_url":"https://api.github.com/users/idk3/orgs","repos_url":"https://api.github.com/users/idk3/repos","events_url":"https://api.github.com/users/idk3/events{/privacy}","received_events_url":"https://api.github.com/users/idk3/received_events","type":"User","site_admin":false},"repo":{"id":115250176,"node_id":"MDEwOlJlcG9zaXRvcnkxMTUyNTAxNzY=","name":"OpenFermion","full_name":"idk3/OpenFermion","owner":{"login":"idk3","id":10775197,"node_id":"MDQ6VXNlcjEwNzc1MTk3","avatar_url":"https://avatars3.githubusercontent.com/u/10775197?v=4","gravatar_id":"","url":"https://api.github.com/users/idk3","html_url":"https://github.com/idk3","followers_url":"https://api.github.com/users/idk3/followers","following_url":"https://api.github.com/users/idk3/following{/other_user}","gists_url":"https://api.github.com/users/idk3/gists{/gist_id}","starred_url":"https://api.github.com/users/idk3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/idk3/subscriptions","organizations_url":"https://api.github.com/users/idk3/orgs","repos_url":"https://api.github.com/users/idk3/repos","events_url":"https://api.github.com/users/idk3/events{/privacy}","received_events_url":"https://api.github.com/users/idk3/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/idk3/OpenFermion","description":"OpenFermion: The Electronic Structure Package For Quantum Computers.","fork":true,"url":"https://api.github.com/repos/idk3/OpenFermion","forks_url":"https://api.github.com/repos/idk3/OpenFermion/forks","keys_url":"https://api.github.com/repos/idk3/OpenFermion/keys{/key_id}","collaborators_url":"https://api.github.com/repos/idk3/OpenFermion/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/idk3/OpenFermion/teams","hooks_url":"https://api.github.com/repos/idk3/OpenFermion/hooks","issue_events_url":"https://api.github.com/repos/idk3/OpenFermion/issues/events{/number}","events_url":"https://api.github.com/repos/idk3/OpenFermion/events","assignees_url":"https://api.github.com/repos/idk3/OpenFermion/assignees{/user}","branches_url":"https://api.github.com/repos/idk3/OpenFermion/branches{/branch}","tags_url":"https://api.github.com/repos/idk3/OpenFermion/tags","blobs_url":"https://api.github.com/repos/idk3/OpenFermion/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/idk3/OpenFermion/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/idk3/OpenFermion/git/refs{/sha}","trees_url":"https://api.github.com/repos/idk3/OpenFermion/git/trees{/sha}","statuses_url":"https://api.github.com/repos/idk3/OpenFermion/statuses/{sha}","languages_url":"https://api.github.com/repos/idk3/OpenFermion/languages","stargazers_url":"https://api.github.com/repos/idk3/OpenFermion/stargazers","contributors_url":"https://api.github.com/repos/idk3/OpenFermion/contributors","subscribers_url":"https://api.github.com/repos/idk3/OpenFermion/subscribers","subscription_url":"https://api.github.com/repos/idk3/OpenFermion/subscription","commits_url":"https://api.github.com/repos/idk3/OpenFermion/commits{/sha}","git_commits_url":"https://api.github.com/repos/idk3/OpenFermion/git/commits{/sha}","comments_url":"https://api.github.com/repos/idk3/OpenFermion/comments{/number}","issue_comment_url":"https://api.github.com/repos/idk3/OpenFermion/issues/comments{/number}","contents_url":"https://api.github.com/repos/idk3/OpenFermion/contents/{+path}","compare_url":"https://api.github.com/repos/idk3/OpenFermion/compare/{base}...{head}","merges_url":"https://api.github.com/repos/idk3/OpenFermion/merges","archive_url":"https://api.github.com/repos/idk3/OpenFermion/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/idk3/OpenFermion/downloads","issues_url":"https://api.github.com/repos/idk3/OpenFermion/issues{/number}","pulls_url":"https://api.github.com/repos/idk3/OpenFermion/pulls{/number}","milestones_url":"https://api.github.com/repos/idk3/OpenFermion/milestones{/number}","notifications_url":"https://api.github.com/repos/idk3/OpenFermion/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/idk3/OpenFermion/labels{/name}","releases_url":"https://api.github.com/repos/idk3/OpenFermion/releases{/id}","deployments_url":"https://api.github.com/repos/idk3/OpenFermion/deployments","created_at":"2017-12-24T08:34:02Z","updated_at":"2018-08-23T17:52:02Z","pushed_at":"2018-08-24T10:54:29Z","git_url":"git://github.com/idk3/OpenFermion.git","ssh_url":"git@github.com:idk3/OpenFermion.git","clone_url":"https://github.com/idk3/OpenFermion.git","svn_url":"https://github.com/idk3/OpenFermion","homepage":"","size":3623,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"quantumlib:master","ref":"master","sha":"9eea8de514edea4fd585244898700cceac151b1d","user":{"login":"quantumlib","id":31279789,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMxMjc5Nzg5","avatar_url":"https://avatars1.githubusercontent.com/u/31279789?v=4","gravatar_id":"","url":"https://api.github.com/users/quantumlib","html_url":"https://github.com/quantumlib","followers_url":"https://api.github.com/users/quantumlib/followers","following_url":"https://api.github.com/users/quantumlib/following{/other_user}","gists_url":"https://api.github.com/users/quantumlib/gists{/gist_id}","starred_url":"https://api.github.com/users/quantumlib/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/quantumlib/subscriptions","organizations_url":"https://api.github.com/users/quantumlib/orgs","repos_url":"https://api.github.com/users/quantumlib/repos","events_url":"https://api.github.com/users/quantumlib/events{/privacy}","received_events_url":"https://api.github.com/users/quantumlib/received_events","type":"Organization","site_admin":false},"repo":{"id":104403768,"node_id":"MDEwOlJlcG9zaXRvcnkxMDQ0MDM3Njg=","name":"OpenFermion","full_name":"quantumlib/OpenFermion","owner":{"login":"quantumlib","id":31279789,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMxMjc5Nzg5","avatar_url":"https://avatars1.githubusercontent.com/u/31279789?v=4","gravatar_id":"","url":"https://api.github.com/users/quantumlib","html_url":"https://github.com/quantumlib","followers_url":"https://api.github.com/users/quantumlib/followers","following_url":"https://api.github.com/users/quantumlib/following{/other_user}","gists_url":"https://api.github.com/users/quantumlib/gists{/gist_id}","starred_url":"https://api.github.com/users/quantumlib/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/quantumlib/subscriptions","organizations_url":"https://api.github.com/users/quantumlib/orgs","repos_url":"https://api.github.com/users/quantumlib/repos","events_url":"https://api.github.com/users/quantumlib/events{/privacy}","received_events_url":"https://api.github.com/users/quantumlib/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/quantumlib/OpenFermion","description":"The electronic structure package for quantum computers.","fork":false,"url":"https://api.github.com/repos/quantumlib/OpenFermion","forks_url":"https://api.github.com/repos/quantumlib/OpenFermion/forks","keys_url":"https://api.github.com/repos/quantumlib/OpenFermion/keys{/key_id}","collaborators_url":"https://api.github.com/repos/quantumlib/OpenFermion/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/quantumlib/OpenFermion/teams","hooks_url":"https://api.github.com/repos/quantumlib/OpenFermion/hooks","issue_events_url":"https://api.github.com/repos/quantumlib/OpenFermion/issues/events{/number}","events_url":"https://api.github.com/repos/quantumlib/OpenFermion/events","assignees_url":"https://api.github.com/repos/quantumlib/OpenFermion/assignees{/user}","branches_url":"https://api.github.com/repos/quantumlib/OpenFermion/branches{/branch}","tags_url":"https://api.github.com/repos/quantumlib/OpenFermion/tags","blobs_url":"https://api.github.com/repos/quantumlib/OpenFermion/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/quantumlib/OpenFermion/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/quantumlib/OpenFermion/git/refs{/sha}","trees_url":"https://api.github.com/repos/quantumlib/OpenFermion/git/trees{/sha}","statuses_url":"https://api.github.com/repos/quantumlib/OpenFermion/statuses/{sha}","languages_url":"https://api.github.com/repos/quantumlib/OpenFermion/languages","stargazers_url":"https://api.github.com/repos/quantumlib/OpenFermion/stargazers","contributors_url":"https://api.github.com/repos/quantumlib/OpenFermion/contributors","subscribers_url":"https://api.github.com/repos/quantumlib/OpenFermion/subscribers","subscription_url":"https://api.github.com/repos/quantumlib/OpenFermion/subscription","commits_url":"https://api.github.com/repos/quantumlib/OpenFermion/commits{/sha}","git_commits_url":"https://api.github.com/repos/quantumlib/OpenFermion/git/commits{/sha}","comments_url":"https://api.github.com/repos/quantumlib/OpenFermion/comments{/number}","issue_comment_url":"https://api.github.com/repos/quantumlib/OpenFermion/issues/comments{/number}","contents_url":"https://api.github.com/repos/quantumlib/OpenFermion/contents/{+path}","compare_url":"https://api.github.com/repos/quantumlib/OpenFermion/compare/{base}...{head}","merges_url":"https://api.github.com/repos/quantumlib/OpenFermion/merges","archive_url":"https://api.github.com/repos/quantumlib/OpenFermion/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/quantumlib/OpenFermion/downloads","issues_url":"https://api.github.com/repos/quantumlib/OpenFermion/issues{/number}","pulls_url":"https://api.github.com/repos/quantumlib/OpenFermion/pulls{/number}","milestones_url":"https://api.github.com/repos/quantumlib/OpenFermion/milestones{/number}","notifications_url":"https://api.github.com/repos/quantumlib/OpenFermion/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/quantumlib/OpenFermion/labels{/name}","releases_url":"https://api.github.com/repos/quantumlib/OpenFermion/releases{/id}","deployments_url":"https://api.github.com/repos/quantumlib/OpenFermion/deployments","created_at":"2017-09-21T22:10:28Z","updated_at":"2018-08-24T19:36:28Z","pushed_at":"2018-08-24T10:54:31Z","git_url":"git://github.com/quantumlib/OpenFermion.git","ssh_url":"git@github.com:quantumlib/OpenFermion.git","clone_url":"https://github.com/quantumlib/OpenFermion.git","svn_url":"https://github.com/quantumlib/OpenFermion","homepage":"","size":3600,"stargazers_count":595,"watchers_count":595,"language":"Python","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":142,"mirror_url":null,"archived":false,"open_issues_count":38,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":142,"open_issues":38,"watchers":595,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/quantumlib/OpenFermion/pulls/439"},"html":{"href":"https://github.com/quantumlib/OpenFermion/pull/439"},"issue":{"href":"https://api.github.com/repos/quantumlib/OpenFermion/issues/439"},"comments":{"href":"https://api.github.com/repos/quantumlib/OpenFermion/issues/439/comments"},"review_comments":{"href":"https://api.github.com/repos/quantumlib/OpenFermion/pulls/439/comments"},"review_comment":{"href":"https://api.github.com/repos/quantumlib/OpenFermion/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/quantumlib/OpenFermion/pulls/439/commits"},"statuses":{"href":"https://api.github.com/repos/quantumlib/OpenFermion/statuses/117c2e7f1cbc4b835d22cb79d9e094a2e6955109"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"idk3"}}