예제 #1
0
def resp_charges(smile, bset="hf/6-31g"):
    # https://github.com/Mishima-syk/psikit

    pk = Psikit.read_from_smiles(smiles_str=smile)

    pk.energy()
    pk.optimize(basis_sets=bset)

    return pk.cal_resp_charges()
예제 #2
0
def calc_FOE(smi, idx):
    pk = Psikit()
    pk.read_from_smiles(smi)
    pk.optimize()
    print(f'H**O: {pk.H**O}, LUMO: {pk.LUMO}')
    with open(f'./psikitout/{idx}.txt', 'w') as outf:
        outf.write(f'{smi}\t{pk.H**O}\t{pk.LUMO}\n')
    return (pk.H**O, pk.LUMO)
예제 #3
0
def test_mul1_energy():
    pk = Psikit()
    pk.read_from_smiles("CO")
    energy = pk.energy(multiplicity=1)
    assert pytest.approx(-115.0421871159, 0.000000005) == energy
예제 #4
0
def test_mul3_energy():
    pk = Psikit()
    pk.read_from_smiles("CO")
    energy = pk.energy(multiplicity=4)
    assert pytest.approx(-40.19996313, 0.000000005) == energy
예제 #5
0
def test_read_from_smiles():
    pk = Psikit()
    pk.read_from_smiles("C")
    assert type(pk.mol) is rdkit.Chem.rdchem.Mol
예제 #6
0
def test_optimize():
    pk = Psikit()
    pk.read_from_smiles("C")
    energy = pk.optimize()
    assert pytest.approx(-40.20171733, 0.000000005) == energy
예제 #7
0
def test_energy_sto3g():
    pk = Psikit()
    pk.read_from_smiles("C")
    energy = pk.energy(basis_sets="scf/sto-3g")
    assert pytest.approx(-39.724747932, 0.000000005) == energy
예제 #8
0
def test_energy():
    pk = Psikit()
    pk.read_from_smiles("C")
    energy = pk.energy()
    assert pytest.approx(-40.19996313, 0.000000005) == energy
예제 #9
0
def test_read_from_molfiles():
    pk = Psikit()
    pk.read_from_molfile("tests/test.mol")
    assert type(pk.mol) is rdkit.Chem.rdchem.Mol
예제 #10
0
    def makeinput(self):
        from psikit import Psikit
        pk = Psikit()
        pk.read_from_molfile(self.molfile)
        self.molname = 'mol'
        self.geom = pk.mol2xyz()

        self.basis = prompt("""Select Basis 
        1: SCF-3G
        2: 6-31G*
        3: 6-31G**
        4: cc-pDZ
        :  """)
        self.scf_type = prompt("""Select scf_type  
        1: pk
        2: df
        :  """)
        self.pcm_scf_type = prompt("""Select pcm_scf_type
        1: total
        2: separate
        :  """)
        self.unit = prompt("""Select Unit 1: Angstrom, 2:AU
        :  """)
        self.SolverType = prompt("""select SolverType  1: IEFPCM, 2: CPCM
        :  """)
        self.Solvent = prompt("""select Solvent listed below
        1:'Water',
        2:'Propylene Carbonate',
        3:'Dimethylsulfoxide',
        4:'Nitromethane',
        5:'Acetonitrile',
        6:'Methanol',
        7:'Ethanol',
        8:'Acetone',
        9:'1,2-Dichloroethane',
        10:'Methylenechloride',
        11:'Tetrahydrofurane',
        12:'Aniline',
        13:'Chlorobenzene',
        14:'Chloroform',
        15:'Toluene',
        16:'1,4-Dioxane',
        17:'Benzene',
        18:'Carbon Tetrachloride',
        19:'Cyclohexane',
        20:'N-heptane',
        21:'Explicit'
        :  """)
        #self.calc_type = prompt("""Select type 1:GePol, 2: Restart
        #:  """)
        self.calc_type = '1'
        self.scaling = prompt("""Scaling ? bool 1:True 2:False
        : """)
        self.area = prompt("""Inpt area default 0.3
        : """)
        self.mode = prompt("""select mode 1:Implicit, 2:Atom, 3:Explicit
        : """)
        data = {
            "name": self.molname,
            "geom": self.geom,
            "basis": BASIS[self.basis],
            "scf_type": SCF_TYPE[self.scf_type],
            "pcm_scf_type": PCM_SCF_TYPE[self.pcm_scf_type],
            "unit": UNITS[self.unit],
            "SolverType": SOLVER_TYPE[self.SolverType],
            "Solvent": SOLVENT[self.Solvent],
            "Type": TYPE[self.calc_type],
            "Scaling": 'true' if self.scaling == '1' else 'false',
            "Area": self.area,
            "Mode": MODE[self.mode]
        }

        env = Environment(loader=FileSystemLoader(self.filepath))
        temp = env.get_template(os.path.join(self.filepath, 'input.tpl'))
        outdata = temp.render(**data)
        with open("input.dat", "w") as output:
            output.write(outdata)
        print("done")
        print("you can run pcm solver with psi4 just type")
        print('psi4 input.dat')