コード例 #1
0
ファイル: tplot.py プロジェクト: mintmemory/pDMET
def save_bands(bands, x, chkfile):
    '''
        Save bandstructure for plotting
    '''
    band_structure = np.hstack((x.reshape(-1, 1), bands))
    bands_dic = {'bands': band_structure}
    save(chkfile, 'bands', bands_dic)
コード例 #2
0
def save_kmf(kmf, chkfile):
    ''' Save a wavefunction'''
    from pyscf.lib.chkfile import save
    kpts = kmf.kpts
    mo_energy_kpts = kmf.mo_energy_kpts
    mo_coeff_kpts = kmf.mo_coeff_kpts

    scf_dic = { 'kpts'          : kpts,
                'mo_energy_kpts': mo_energy_kpts,
                'mo_coeff_kpts' : mo_coeff_kpts}
    save(chkfile, 'scf', scf_dic)
コード例 #3
0
ファイル: pywannier90.py プロジェクト: chrinide/pyscf
def save_kmf(kmf, chkfile):
    ''' Save a wavefunction'''
    from pyscf.lib.chkfile import save
    kpts = kmf.kpts
    mo_energy_kpts = kmf.mo_energy_kpts
    mo_coeff_kpts = kmf.mo_coeff_kpts
    get_ovlp = kmf.get_ovlp()
    
    scf_dic = { 'kpts'          : kpts,
                'mo_energy_kpts': mo_energy_kpts,
                'mo_coeff_kpts' : mo_coeff_kpts}                
    save(chkfile, 'scf', scf_dic)
コード例 #4
0
ファイル: chkfile.py プロジェクト: chrinide/pyscf
def dump_scf(mol, chkfile, e_tot, mo_energy, mo_coeff, mo_occ,
             overwrite_mol=True):
    '''save temporary results'''
    if h5py.is_hdf5(chkfile) and not overwrite_mol:
        with h5py.File(chkfile) as fh5:
            if 'mol' not in fh5:
                fh5['mol'] = mol.dumps()
    else:
        save_mol(mol, chkfile)

    scf_dic = {'e_tot'    : e_tot,
               'mo_energy': mo_energy,
               'mo_occ'   : mo_occ,
               'mo_coeff' : mo_coeff}
    save(chkfile, 'scf', scf_dic)
コード例 #5
0
def dump_scf(mol,
             chkfile,
             e_tot,
             mo_energy,
             mo_coeff,
             mo_occ,
             overwrite_mol=True):
    '''save temporary results'''
    if h5py.is_hdf5(chkfile) and not overwrite_mol:
        with h5py.File(chkfile) as fh5:
            if 'mol' not in fh5:
                fh5['mol'] = mol.dumps()
    else:
        save_mol(mol, chkfile)

    scf_dic = {
        'e_tot': e_tot,
        'mo_energy': mo_energy,
        'mo_occ': mo_occ,
        'mo_coeff': mo_coeff
    }
    save(chkfile, 'scf', scf_dic)