Beispiel #1
0
def load_agf2(chkfile):
    ''' Load the AGF2 data from the chkfile.
    '''

    if mpi_helper.rank == 0:
        dic = chkutil.load(chkfile, 'agf2')
    else:
        dic = None

    mpi_helper.barrier()
    dic = mpi_helper.bcast_dict(dic)

    if 'gf' in dic:
        gf = dic['gf']
        dic['gf'] = GreensFunction(gf['energy'], gf['coupling'], chempot=gf['chempot'])
    elif 'gfa' in dic:
        gfa, gfb = dic['gfa'], dic['gfb']
        dic['gf'] = (GreensFunction(gfa['energy'], gfa['coupling'], chempot=gfa['chempot']),
                     GreensFunction(gfb['energy'], gfb['coupling'], chempot=gfb['chempot']))
        del(dic['gfa'], dic['gfb'])

    if 'se' in dic:
        se = dic['se']
        dic['se'] = SelfEnergy(se['energy'], se['coupling'], chempot=se['chempot'])
    elif 'sea' in dic:
        sea, seb = dic['sea'], dic['seb']
        dic['se'] = (SelfEnergy(sea['energy'], sea['coupling'], chempot=sea['chempot']),
                     SelfEnergy(seb['energy'], seb['coupling'], chempot=seb['chempot']))
        del(dic['sea'], dic['seb'])

    if 'ngf' in dic:
        dic['nmom'] = (dic.get('ngf', None), dic.get('nse', None))
        del(dic['ngf'], dic['nse'])

    return load_mol(chkfile), dic
Beispiel #2
0
def load(chkfile, key):
    ''' Load array(s) from chkfile.

    See pyscf.lib.chkfile
    '''

    if mpi_helper.rank == 0:
        vals = chkutil.load(chkfile, key)
    else:
        vals = None

    mpi_helper.barrier()
    vals = mpi_helper.bcast_dict(vals)

    return vals
Beispiel #3
0
def load_mol(chkfile):
    ''' Load the mol from the chkfile.

    See pyscf.lib.chkfile
    '''

    if mpi_helper.rank == 0:
        mol = chkutil.load_mol(chkfile)
        dumps = mol.dumps()
    else:
        dumps = None

    mpi_helper.barrier()
    dumps = mpi_helper.bcast_dict(dumps)
    mol = gto.loads(dumps)

    return mol