Esempio n. 1
0
 def test_generateNCMCIntegrator(self):
     print('Testing AlchemicalExternalLangevinIntegrator')
     cfg = {
         'nstepsNC': 100,
         'temperature': 100 * unit.kelvin,
         'dt': 0.001 * unit.picoseconds,
         'nprop': 2,
         'propLambda': 0.1,
         'splitting': 'V H R O R H V',
         'alchemical_functions': {
             'lambda_sterics': '1',
             'lambda_electrostatics': '1'
         }
     }
     ncmc_integrator = SimulationFactory.generateNCMCIntegrator(**cfg)
     #Check we made the right integrator
     assert isinstance(ncmc_integrator, AlchemicalExternalLangevinIntegrator)
     #Check that the integrator has taken our Parameters
     assert round(abs(ncmc_integrator.getTemperature()._value - cfg['temperature']._value), 7) == 0
     assert ncmc_integrator.getStepSize() == cfg['dt']
     assert ncmc_integrator._n_steps_neq == cfg['nstepsNC']
     assert ncmc_integrator._n_lambda_steps == \
                      cfg['nstepsNC'] * cfg['nprop']
     assert ncmc_integrator._alchemical_functions == \
                      cfg['alchemical_functions']
     assert ncmc_integrator._splitting == cfg['splitting']
     prop_range = (0.5 - cfg['propLambda'], 0.5 + cfg['propLambda'])
     assert ncmc_integrator._prop_lambda == prop_range
Esempio n. 2
0
 def test_generateNCMCIntegrator(self):
     print('Testing AlchemicalExternalLangevinIntegrator')
     cfg = {
         'nstepsNC': 100,
         'temperature': 100 * unit.kelvin,
         'dt': 0.001 * unit.picoseconds,
         'nprop': 2,
         'propLambda': 0.1,
         'splitting': 'V H R O R H V',
         'alchemical_functions': {
             'lambda_sterics': '1',
             'lambda_electrostatics': '1'
         }
     }
     ncmc_integrator = SimulationFactory.generateNCMCIntegrator(**cfg)
     #Check we made the right integrator
     self.assertIsInstance(ncmc_integrator,
                           AlchemicalExternalLangevinIntegrator)
     #Check that the integrator has taken our Parameters
     self.assertAlmostEqual(ncmc_integrator.getTemperature()._value,
                            cfg['temperature']._value)
     self.assertEqual(ncmc_integrator.getStepSize(), cfg['dt'])
     self.assertEqual(ncmc_integrator._n_steps_neq, cfg['nstepsNC'])
     self.assertEqual(ncmc_integrator._n_lambda_steps,
                      cfg['nstepsNC'] * cfg['nprop'])
     self.assertEqual(ncmc_integrator._alchemical_functions,
                      cfg['alchemical_functions'])
     self.assertEqual(ncmc_integrator._splitting, cfg['splitting'])
     prop_range = (0.5 - cfg['propLambda'], 0.5 + cfg['propLambda'])
     self.assertEqual(ncmc_integrator._prop_lambda, prop_range)
Esempio n. 3
0
def ncmc_integrator(structure, system):
    cfg = {
        'nstepsNC': 10,
        'temperature': 100 * unit.kelvin,
        'dt': 0.001 * unit.picoseconds,
        'nprop': 1,
        'propLambda': 0.3,
        'splitting': 'V H R O R H V',
        'alchemical_functions': {
            'lambda_sterics': '1',
            'lambda_electrostatics': '1'
        }
    }

    ncmc_integrator = SimulationFactory.generateNCMCIntegrator(**cfg)
    return ncmc_integrator
Esempio n. 4
0
def ncmc_integrator(structure, system):
    cfg = {
        'nstepsNC': 10,
        'temperature': 100 * unit.kelvin,
        'dt': 0.001 * unit.picoseconds,
        'nprop': 1,
        'propLambda': 0.3,
        'splitting': 'V H R O R H V',
        'alchemical_functions': {
            'lambda_sterics': '1',
            'lambda_electrostatics': '1'
        }
    }

    ncmc_integrator = SimulationFactory.generateNCMCIntegrator(**cfg)
    return ncmc_integrator