{"action":"created","issue":{"url":"https://api.github.com/repos/pandegroup/openmm/issues/1616","repository_url":"https://api.github.com/repos/pandegroup/openmm","labels_url":"https://api.github.com/repos/pandegroup/openmm/issues/1616/labels{/name}","comments_url":"https://api.github.com/repos/pandegroup/openmm/issues/1616/comments","events_url":"https://api.github.com/repos/pandegroup/openmm/issues/1616/events","html_url":"https://github.com/pandegroup/openmm/issues/1616","id":181574343,"number":1616,"title":"Energy Conservation of MTSIntegrator","user":{"login":"kyleabeauchamp","id":1900459,"avatar_url":"https://avatars.githubusercontent.com/u/1900459?v=3","gravatar_id":"","url":"https://api.github.com/users/kyleabeauchamp","html_url":"https://github.com/kyleabeauchamp","followers_url":"https://api.github.com/users/kyleabeauchamp/followers","following_url":"https://api.github.com/users/kyleabeauchamp/following{/other_user}","gists_url":"https://api.github.com/users/kyleabeauchamp/gists{/gist_id}","starred_url":"https://api.github.com/users/kyleabeauchamp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kyleabeauchamp/subscriptions","organizations_url":"https://api.github.com/users/kyleabeauchamp/orgs","repos_url":"https://api.github.com/users/kyleabeauchamp/repos","events_url":"https://api.github.com/users/kyleabeauchamp/events{/privacy}","received_events_url":"https://api.github.com/users/kyleabeauchamp/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":8,"created_at":"2016-10-07T02:48:53Z","updated_at":"2016-10-07T03:58:47Z","closed_at":null,"body":"Is there a canonical way to test the energy conservation performance of our integrators?  I'm finding reduced conservation as compared to Verlet, as measured by the below script.\r\n\r\n```\r\nimport simtk.openmm.app as app\r\nimport simtk.openmm as mm\r\nfrom simtk import unit as u\r\nfrom openmmtools import testsystems\r\n\r\nf = lambda x: (x.getPotentialEnergy(), x.getKineticEnergy(), x.getKineticEnergy() + x.getPotentialEnergy())\r\n\r\ntemperature = 300. * u.kelvin\r\ntestsystem = testsystems.LennardJonesFluid(nparticles=2048)\r\ntimestep = 0.1 * u.femtoseconds\r\n\r\nintegrators = [mm.VerletIntegrator(timestep), mm.MTSIntegrator(timestep, groups=[(0, 1)])]\r\n\r\nfor integrator in integrators:\r\n    print(integrator)\r\n\r\n    simulation = app.Simulation(testsystem.topology, testsystem.system, integrator)\r\n    simulation.context.setPositions(testsystem.positions)\r\n    simulation.context.setVelocitiesToTemperature(temperature)\r\n\r\n    integrator.step(1)  # Do a single step first to apply constraints before we run tests.\r\n\r\n    state1a = simulation.context.getState(getPositions=True, getParameters=True, getEnergy=True, getVelocities=True)\r\n    old = f(state1a)\r\n    print(\"PE, KE, TOTAL\")\r\n    print(old)\r\n    integrator.step(1)\r\n    state1b = simulation.context.getState(getPositions=True, getParameters=True, getEnergy=True, getVelocities=True)\r\n    new = f(state1b)\r\n    print(new)\r\n    print(\"delta = %s\" % (new[-1] - old[-1]))\r\n\r\n\r\n<simtk.openmm.openmm.VerletIntegrator; proxy of <Swig Object of type 'OpenMM::VerletIntegrator *' at 0x7fbcdd422f60> >\r\nPE, KE, TOTAL\r\n(Quantity(value=-220.9337554729007, unit=kilojoule/mole), Quantity(value=7704.49522032775, unit=kilojoule/mole), Quantity(value=7483.561464854849, unit=kilojoule/mole))\r\n(Quantity(value=-220.95013973622264, unit=kilojoule/mole), Quantity(value=7704.512487734668, unit=kilojoule/mole), Quantity(value=7483.562347998445, unit=kilojoule/mole))\r\ndelta = 0.0008831435961837997 kJ/mol\r\n<simtk.openmm.mtsintegrator.MTSIntegrator; proxy of <Swig Object of type 'OpenMM::CustomIntegrator *' at 0x7fbcb9059fc0> >\r\nPE, KE, TOTAL\r\n(Quantity(value=-220.8974362141165, unit=kilojoule/mole), Quantity(value=7677.541015625, unit=kilojoule/mole), Quantity(value=7456.643579410884, unit=kilojoule/mole))\r\n(Quantity(value=-220.8767622218149, unit=kilojoule/mole), Quantity(value=7677.5068359375, unit=kilojoule/mole), Quantity(value=7456.630073715685, unit=kilojoule/mole))\r\ndelta = -0.013505695198546164 kJ/mol\r\n\r\n\r\n```"},"comment":{"url":"https://api.github.com/repos/pandegroup/openmm/issues/comments/252147853","html_url":"https://github.com/pandegroup/openmm/issues/1616#issuecomment-252147853","issue_url":"https://api.github.com/repos/pandegroup/openmm/issues/1616","id":252147853,"user":{"login":"kyleabeauchamp","id":1900459,"avatar_url":"https://avatars.githubusercontent.com/u/1900459?v=3","gravatar_id":"","url":"https://api.github.com/users/kyleabeauchamp","html_url":"https://github.com/kyleabeauchamp","followers_url":"https://api.github.com/users/kyleabeauchamp/followers","following_url":"https://api.github.com/users/kyleabeauchamp/following{/other_user}","gists_url":"https://api.github.com/users/kyleabeauchamp/gists{/gist_id}","starred_url":"https://api.github.com/users/kyleabeauchamp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kyleabeauchamp/subscriptions","organizations_url":"https://api.github.com/users/kyleabeauchamp/orgs","repos_url":"https://api.github.com/users/kyleabeauchamp/repos","events_url":"https://api.github.com/users/kyleabeauchamp/events{/privacy}","received_events_url":"https://api.github.com/users/kyleabeauchamp/received_events","type":"User","site_admin":false},"created_at":"2016-10-07T03:58:47Z","updated_at":"2016-10-07T03:58:47Z","body":"After your patch, I see a much smaller drift:\r\n\r\n```\r\n<simtk.openmm.openmm.VerletIntegrator; proxy of <Swig Object of type 'OpenMM::VerletIntegrator *' at 0x7f47ab104b10> >\r\nPE, KE, TOTAL\r\n(Quantity(value=-221.32956658217887, unit=kilojoule/mole), Quantity(value=7656.888677824289, unit=kilojoule/mole), Quantity(value=7435.55911124211, unit=kilojoule/mole))\r\n(Quantity(value=-221.97040727582225, unit=kilojoule/mole), Quantity(value=7657.528302460909, unit=kilojoule/mole), Quantity(value=7435.557895185087, unit=kilojoule/mole))\r\ndelta = -0.001216057023157191 kJ/mol\r\n<simtk.openmm.mtsintegrator.MTSIntegrator; proxy of <Swig Object of type 'OpenMM::CustomIntegrator *' at 0x7f478b53bcf0> >\r\nPE, KE, TOTAL\r\n(Quantity(value=-219.64110596205376, unit=kilojoule/mole), Quantity(value=7634.296875, unit=kilojoule/mole), Quantity(value=7414.655769037946, unit=kilojoule/mole))\r\n(Quantity(value=-218.5692423799208, unit=kilojoule/mole), Quantity(value=7633.22802734375, unit=kilojoule/mole), Quantity(value=7414.658784963829, unit=kilojoule/mole))\r\ndelta = 0.0030159258831190527 kJ/mol\r\n```"}}
{"actor":{"display_login":"kyleabeauchamp"}}