{"action":"opened","number":90,"pull_request":{"url":"https://api.github.com/repos/leeping/forcebalance/pulls/90","id":77317049,"html_url":"https://github.com/leeping/forcebalance/pull/90","diff_url":"https://github.com/leeping/forcebalance/pull/90.diff","patch_url":"https://github.com/leeping/forcebalance/pull/90.patch","issue_url":"https://api.github.com/repos/leeping/forcebalance/issues/90","number":90,"state":"open","locked":false,"title":"Simplify abinitio.py code","user":{"login":"leeping","id":1441560,"avatar_url":"https://avatars.githubusercontent.com/u/1441560?v=3","gravatar_id":"","url":"https://api.github.com/users/leeping","html_url":"https://github.com/leeping","followers_url":"https://api.github.com/users/leeping/followers","following_url":"https://api.github.com/users/leeping/following{/other_user}","gists_url":"https://api.github.com/users/leeping/gists{/gist_id}","starred_url":"https://api.github.com/users/leeping/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leeping/subscriptions","organizations_url":"https://api.github.com/users/leeping/orgs","repos_url":"https://api.github.com/users/leeping/repos","events_url":"https://api.github.com/users/leeping/events{/privacy}","received_events_url":"https://api.github.com/users/leeping/received_events","type":"User","site_admin":false},"body":"This code computes the least squares objective function for the energy and force. The most recent revision simplified the code and removed the covariance matrix and dual-weight features in order to make things easier to maintain. \r\n\r\nThe equations have also been simplified.  Previously I normalizing each force component (or triples of components belonging to an atom) separately.   I was also computing the objective function separately from the \"indicators\", which led to confusion regarding why they resulted in different values. The code was structured around computing the objective function by multiplying an Applequist polytensor containing both energy and force with an inverse covariance matrix, but it became apparent over time and experience that the more complicated approach was not worth it, given the opacity that it introduced into how things were computed.\r\n\r\nIn the new code, the objective function is computed in a simple way.  For the energies we compute a weighted sum of squared differences between E_MM and E_QM, minus (optionally) the mean energy gap, for the numerator.  The weighted variance of the QM energies <E_QM^2>-<E_QM>^2 is the denominator.  The user-supplied w_energy option is a prefactor that multiplies this term.  If `w_normalize` is set to True (no longer the default), the prefactor is further divided by the sum of all of the weights. The indicators are set to the square roots of the numerator and denominator above.\r\n\r\nFor the forces we compute the same weighted sum, where each term in the sum is the norm-squared of F_MM - F_QM, with no option to subtract the mean. The denominator is computed in an analogous way using the norm-squared F_QM, and the prefactor is w_force. The same approach is applied if the user asks for net forces and/or torques. The indicators are computed from the square roots of the numerator and denominator, divided by the number of atoms (molecules) for forces (net forces / torques).\r\n\r\nIn equation form, the objective function is given by:\r\n\r\n![image](https://cloud.githubusercontent.com/assets/1441560/16810596/4a893b32-48d9-11e6-91dc-695d223cfefa.png)\r\n\r\nBecause the force component of the objective function is now normalized differently, the objective function now gives a slightly different value, and calculations will also give a slightly different result from before.  For reproducing previous calculations exactly, the old `abinitio.py` has been added to the `src/legacy` folder.","created_at":"2016-07-13T16:09:26Z","updated_at":"2016-07-13T16:09:26Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3b8f35e8614c006f41e1e22cb3ffffe5c3c647b6","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/leeping/forcebalance/pulls/90/commits","review_comments_url":"https://api.github.com/repos/leeping/forcebalance/pulls/90/comments","review_comment_url":"https://api.github.com/repos/leeping/forcebalance/pulls/comments{/number}","comments_url":"https://api.github.com/repos/leeping/forcebalance/issues/90/comments","statuses_url":"https://api.github.com/repos/leeping/forcebalance/statuses/77473475d756b2b765edb5a6bccbd66b206f8c2b","head":{"label":"leeping:newab","ref":"newab","sha":"77473475d756b2b765edb5a6bccbd66b206f8c2b","user":{"login":"leeping","id":1441560,"avatar_url":"https://avatars.githubusercontent.com/u/1441560?v=3","gravatar_id":"","url":"https://api.github.com/users/leeping","html_url":"https://github.com/leeping","followers_url":"https://api.github.com/users/leeping/followers","following_url":"https://api.github.com/users/leeping/following{/other_user}","gists_url":"https://api.github.com/users/leeping/gists{/gist_id}","starred_url":"https://api.github.com/users/leeping/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leeping/subscriptions","organizations_url":"https://api.github.com/users/leeping/orgs","repos_url":"https://api.github.com/users/leeping/repos","events_url":"https://api.github.com/users/leeping/events{/privacy}","received_events_url":"https://api.github.com/users/leeping/received_events","type":"User","site_admin":false},"repo":{"id":11302623,"name":"forcebalance","full_name":"leeping/forcebalance","owner":{"login":"leeping","id":1441560,"avatar_url":"https://avatars.githubusercontent.com/u/1441560?v=3","gravatar_id":"","url":"https://api.github.com/users/leeping","html_url":"https://github.com/leeping","followers_url":"https://api.github.com/users/leeping/followers","following_url":"https://api.github.com/users/leeping/following{/other_user}","gists_url":"https://api.github.com/users/leeping/gists{/gist_id}","starred_url":"https://api.github.com/users/leeping/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leeping/subscriptions","organizations_url":"https://api.github.com/users/leeping/orgs","repos_url":"https://api.github.com/users/leeping/repos","events_url":"https://api.github.com/users/leeping/events{/privacy}","received_events_url":"https://api.github.com/users/leeping/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/leeping/forcebalance","description":"Systematic force field optimization.","fork":false,"url":"https://api.github.com/repos/leeping/forcebalance","forks_url":"https://api.github.com/repos/leeping/forcebalance/forks","keys_url":"https://api.github.com/repos/leeping/forcebalance/keys{/key_id}","collaborators_url":"https://api.github.com/repos/leeping/forcebalance/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/leeping/forcebalance/teams","hooks_url":"https://api.github.com/repos/leeping/forcebalance/hooks","issue_events_url":"https://api.github.com/repos/leeping/forcebalance/issues/events{/number}","events_url":"https://api.github.com/repos/leeping/forcebalance/events","assignees_url":"https://api.github.com/repos/leeping/forcebalance/assignees{/user}","branches_url":"https://api.github.com/repos/leeping/forcebalance/branches{/branch}","tags_url":"https://api.github.com/repos/leeping/forcebalance/tags","blobs_url":"https://api.github.com/repos/leeping/forcebalance/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/leeping/forcebalance/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/leeping/forcebalance/git/refs{/sha}","trees_url":"https://api.github.com/repos/leeping/forcebalance/git/trees{/sha}","statuses_url":"https://api.github.com/repos/leeping/forcebalance/statuses/{sha}","languages_url":"https://api.github.com/repos/leeping/forcebalance/languages","stargazers_url":"https://api.github.com/repos/leeping/forcebalance/stargazers","contributors_url":"https://api.github.com/repos/leeping/forcebalance/contributors","subscribers_url":"https://api.github.com/repos/leeping/forcebalance/subscribers","subscription_url":"https://api.github.com/repos/leeping/forcebalance/subscription","commits_url":"https://api.github.com/repos/leeping/forcebalance/commits{/sha}","git_commits_url":"https://api.github.com/repos/leeping/forcebalance/git/commits{/sha}","comments_url":"https://api.github.com/repos/leeping/forcebalance/comments{/number}","issue_comment_url":"https://api.github.com/repos/leeping/forcebalance/issues/comments{/number}","contents_url":"https://api.github.com/repos/leeping/forcebalance/contents/{+path}","compare_url":"https://api.github.com/repos/leeping/forcebalance/compare/{base}...{head}","merges_url":"https://api.github.com/repos/leeping/forcebalance/merges","archive_url":"https://api.github.com/repos/leeping/forcebalance/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/leeping/forcebalance/downloads","issues_url":"https://api.github.com/repos/leeping/forcebalance/issues{/number}","pulls_url":"https://api.github.com/repos/leeping/forcebalance/pulls{/number}","milestones_url":"https://api.github.com/repos/leeping/forcebalance/milestones{/number}","notifications_url":"https://api.github.com/repos/leeping/forcebalance/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/leeping/forcebalance/labels{/name}","releases_url":"https://api.github.com/repos/leeping/forcebalance/releases{/id}","deployments_url":"https://api.github.com/repos/leeping/forcebalance/deployments","created_at":"2013-07-10T04:46:42Z","updated_at":"2016-06-22T02:40:40Z","pushed_at":"2016-07-13T16:09:26Z","git_url":"git://github.com/leeping/forcebalance.git","ssh_url":"git@github.com:leeping/forcebalance.git","clone_url":"https://github.com/leeping/forcebalance.git","svn_url":"https://github.com/leeping/forcebalance","homepage":"","size":270672,"stargazers_count":30,"watchers_count":30,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":23,"mirror_url":null,"open_issues_count":18,"forks":23,"open_issues":18,"watchers":30,"default_branch":"master"}},"base":{"label":"leeping:master","ref":"master","sha":"2fb85e65e6fd508f37f1265b0aca7f0090fbe7c8","user":{"login":"leeping","id":1441560,"avatar_url":"https://avatars.githubusercontent.com/u/1441560?v=3","gravatar_id":"","url":"https://api.github.com/users/leeping","html_url":"https://github.com/leeping","followers_url":"https://api.github.com/users/leeping/followers","following_url":"https://api.github.com/users/leeping/following{/other_user}","gists_url":"https://api.github.com/users/leeping/gists{/gist_id}","starred_url":"https://api.github.com/users/leeping/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leeping/subscriptions","organizations_url":"https://api.github.com/users/leeping/orgs","repos_url":"https://api.github.com/users/leeping/repos","events_url":"https://api.github.com/users/leeping/events{/privacy}","received_events_url":"https://api.github.com/users/leeping/received_events","type":"User","site_admin":false},"repo":{"id":11302623,"name":"forcebalance","full_name":"leeping/forcebalance","owner":{"login":"leeping","id":1441560,"avatar_url":"https://avatars.githubusercontent.com/u/1441560?v=3","gravatar_id":"","url":"https://api.github.com/users/leeping","html_url":"https://github.com/leeping","followers_url":"https://api.github.com/users/leeping/followers","following_url":"https://api.github.com/users/leeping/following{/other_user}","gists_url":"https://api.github.com/users/leeping/gists{/gist_id}","starred_url":"https://api.github.com/users/leeping/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leeping/subscriptions","organizations_url":"https://api.github.com/users/leeping/orgs","repos_url":"https://api.github.com/users/leeping/repos","events_url":"https://api.github.com/users/leeping/events{/privacy}","received_events_url":"https://api.github.com/users/leeping/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/leeping/forcebalance","description":"Systematic force field optimization.","fork":false,"url":"https://api.github.com/repos/leeping/forcebalance","forks_url":"https://api.github.com/repos/leeping/forcebalance/forks","keys_url":"https://api.github.com/repos/leeping/forcebalance/keys{/key_id}","collaborators_url":"https://api.github.com/repos/leeping/forcebalance/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/leeping/forcebalance/teams","hooks_url":"https://api.github.com/repos/leeping/forcebalance/hooks","issue_events_url":"https://api.github.com/repos/leeping/forcebalance/issues/events{/number}","events_url":"https://api.github.com/repos/leeping/forcebalance/events","assignees_url":"https://api.github.com/repos/leeping/forcebalance/assignees{/user}","branches_url":"https://api.github.com/repos/leeping/forcebalance/branches{/branch}","tags_url":"https://api.github.com/repos/leeping/forcebalance/tags","blobs_url":"https://api.github.com/repos/leeping/forcebalance/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/leeping/forcebalance/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/leeping/forcebalance/git/refs{/sha}","trees_url":"https://api.github.com/repos/leeping/forcebalance/git/trees{/sha}","statuses_url":"https://api.github.com/repos/leeping/forcebalance/statuses/{sha}","languages_url":"https://api.github.com/repos/leeping/forcebalance/languages","stargazers_url":"https://api.github.com/repos/leeping/forcebalance/stargazers","contributors_url":"https://api.github.com/repos/leeping/forcebalance/contributors","subscribers_url":"https://api.github.com/repos/leeping/forcebalance/subscribers","subscription_url":"https://api.github.com/repos/leeping/forcebalance/subscription","commits_url":"https://api.github.com/repos/leeping/forcebalance/commits{/sha}","git_commits_url":"https://api.github.com/repos/leeping/forcebalance/git/commits{/sha}","comments_url":"https://api.github.com/repos/leeping/forcebalance/comments{/number}","issue_comment_url":"https://api.github.com/repos/leeping/forcebalance/issues/comments{/number}","contents_url":"https://api.github.com/repos/leeping/forcebalance/contents/{+path}","compare_url":"https://api.github.com/repos/leeping/forcebalance/compare/{base}...{head}","merges_url":"https://api.github.com/repos/leeping/forcebalance/merges","archive_url":"https://api.github.com/repos/leeping/forcebalance/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/leeping/forcebalance/downloads","issues_url":"https://api.github.com/repos/leeping/forcebalance/issues{/number}","pulls_url":"https://api.github.com/repos/leeping/forcebalance/pulls{/number}","milestones_url":"https://api.github.com/repos/leeping/forcebalance/milestones{/number}","notifications_url":"https://api.github.com/repos/leeping/forcebalance/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/leeping/forcebalance/labels{/name}","releases_url":"https://api.github.com/repos/leeping/forcebalance/releases{/id}","deployments_url":"https://api.github.com/repos/leeping/forcebalance/deployments","created_at":"2013-07-10T04:46:42Z","updated_at":"2016-06-22T02:40:40Z","pushed_at":"2016-07-13T16:09:26Z","git_url":"git://github.com/leeping/forcebalance.git","ssh_url":"git@github.com:leeping/forcebalance.git","clone_url":"https://github.com/leeping/forcebalance.git","svn_url":"https://github.com/leeping/forcebalance","homepage":"","size":270672,"stargazers_count":30,"watchers_count":30,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":23,"mirror_url":null,"open_issues_count":18,"forks":23,"open_issues":18,"watchers":30,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/leeping/forcebalance/pulls/90"},"html":{"href":"https://github.com/leeping/forcebalance/pull/90"},"issue":{"href":"https://api.github.com/repos/leeping/forcebalance/issues/90"},"comments":{"href":"https://api.github.com/repos/leeping/forcebalance/issues/90/comments"},"review_comments":{"href":"https://api.github.com/repos/leeping/forcebalance/pulls/90/comments"},"review_comment":{"href":"https://api.github.com/repos/leeping/forcebalance/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/leeping/forcebalance/pulls/90/commits"},"statuses":{"href":"https://api.github.com/repos/leeping/forcebalance/statuses/77473475d756b2b765edb5a6bccbd66b206f8c2b"}},"merged":false,"mergeable":true,"mergeable_state":"clean","merged_by":null,"comments":0,"review_comments":0,"commits":3,"additions":1662,"deletions":576,"changed_files":4}}
{"actor":{"display_login":"leeping"}}