from janus import qm_wrapper, mm_wrapper, qmmm, system import numpy as np import pytest import os water = os.path.join(str('tests/files/test_openmm/water.pdb')) ala = os.path.join(str('tests/files/test_openmm/ala_ala_ala.pdb')) psi4 = qm_wrapper.Psi4Wrapper() psi4_ala = qm_wrapper.Psi4Wrapper(charge=1) om_m = mm_wrapper.OpenMMWrapper(sys_info=water, **{ 'md_ensemble': 'NVT', 'return_info': [] }) om_m.initialize('Mechanical') main_info_m = om_m.get_main_info() om_e = mm_wrapper.OpenMMWrapper(sys_info=water, **{ 'md_ensemble': 'NVT', 'return_info': [] }) om_e.initialize('Electrostatic') main_info_e = om_e.get_main_info() om_ala = mm_wrapper.OpenMMWrapper(sys_info=ala, **{ 'md_ensemble': 'NVT', 'return_info': []
import pytest from janus import qm_wrapper, mm_wrapper, qmmm import numpy as np import os water = os.path.join(str('tests/files/test_openmm/water.pdb')) psi4 = qm_wrapper.Psi4Wrapper() openmm = mm_wrapper.OpenMMWrapper(sys_info=water,**{'md_ensemble':'NVT', 'return_info':[]}) openmm.initialize('Mechanical') main_info_m = openmm.get_main_info() oxs = qmmm.OniomXS(psi4, openmm, sys_info=water, Rmin=3.8, Rmax=4.5) oxs_0 = qmmm.OniomXS(psi4, openmm, sys_info=water, Rmin=2.6, Rmax=2.8) oxs_1 = qmmm.OniomXS(psi4, openmm, sys_info=water, Rmin=2.6, Rmax=3.2) oxs_2 = qmmm.OniomXS(psi4, openmm, sys_info=water, Rmin=2.6, Rmax=3.4) def test_find_buffer_zone(): oxs.find_buffer_zone() oxs_0.find_buffer_zone() oxs_1.find_buffer_zone() oxs_2.find_buffer_zone() assert not oxs.buffer_groups assert not oxs_0.buffer_groups assert oxs_1.buffer_groups[1].atoms == [3, 4, 5] assert (oxs_2.buffer_groups[1].atoms == [3, 4, 5] and oxs_2.buffer_groups[2].atoms == [6, 7, 8]) def test_find_configurations():
from janus import qm_wrapper, mm_wrapper, qmmm # instantiate a Psi4Wrapper object as the high level wrapper hl_wrapper = qm_wrapper.Psi4Wrapper() # instantiate an OpenMMWrapper object as the low level wrapper ll_wrapper = mm_wrapper.OpenMMWrapper(sys_info='water.pdb') # instantiate an OniomXS object, setting Rmin and Rmax to be different values p1 = qmmm.PAP(hl_wrapper, ll_wrapper, sys_info='water.pdb', Rmin=3.5, Rmax=4.0) p2 = qmmm.PAP(hl_wrapper, ll_wrapper, sys_info='water.pdb', Rmin=3.5, Rmax=4.5) p3 = qmmm.PAP(hl_wrapper, ll_wrapper, sys_info='water.pdb', Rmin=4.0, Rmax=5.0) # partition the QM and buffer zone atoms p1.find_buffer_zone() p2.find_buffer_zone() p3.find_buffer_zone() # find QM/MM configurations that arise from buffer zone partitioning p1.find_configurations() p2.find_configurations() p3.find_configurations() #print Rmin, Rmax, number of qm groups, buffer groups, and QM/MM configurations print(p1.Rmin, p1.Rmax, p1.n_qm_groups, p1.n_buffer_groups, p1.n_configs) print(p2.Rmin, p2.Rmax, p2.n_qm_groups, p2.n_buffer_groups, p2.n_configs) print(p3.Rmin, p3.Rmax, p3.n_qm_groups, p3.n_buffer_groups, p3.n_configs)