<commit_before>#!/usr/bin/env python

'''
Showing equivalence between the K-point CCSD and
the gamma-point CCSD for a diamond lattice.
'''

from pyscf.pbc import gto, scf, mpicc
from mpi4py import MPI

comm = MPI.COMM_WORLD
rank = comm.Get_rank()

cell = gto.M(
    unit = 'B',
    a = [[ 0.,          3.37013733,  3.37013733],
         [ 3.37013733,  0.,          3.37013733],
         [ 3.37013733,  3.37013733,  0.        ]],
    gs = [12,]*3,
    atom = '''C 0 0 0
              C 1.68506866 1.68506866 1.68506866''',
    basis = 'gth-szv',
    pseudo = 'gth-pade',
    verbose = 4,
)

nk = [2,2,2]
kpts = cell.make_kpts(nk)

#
# Running HF
#
kpts -= kpts[0]
if rank == 0:
    kmf = scf.KRHF(cell, kpts)
    kmf.kernel()

comm.Barrier()
mo_coeff  = comm.bcast(kmf.mo_coeff,root=0)
mo_energy = comm.bcast(kmf.mo_energy,root=0)
mo_occ    = comm.bcast(kmf.mo_occ,root=0)<commit_msg>small change to mpi example<commit_after>#!/usr/bin/env python

'''
Showing equivalence between the K-point CCSD and
the gamma-point CCSD for a diamond lattice.
'''

from pyscf.pbc import gto, scf, mpicc
from mpi4py import MPI

comm = MPI.COMM_WORLD
rank = comm.Get_rank()

cell = gto.M(
    unit = 'B',
    a = [[ 0.,          3.37013733,  3.37013733],
         [ 3.37013733,  0.,          3.37013733],
         [ 3.37013733,  3.37013733,  0.        ]],
    gs = [12,]*3,
    atom = '''C 0 0 0
              C 1.68506866 1.68506866 1.68506866''',
    basis = 'gth-szv',
    pseudo = 'gth-pade',
    verbose = 4,
)

nk = [2,2,2]
kpts = cell.make_kpts(nk)

#
# Running HF
#
kpts -= kpts[0]
kmf = scf.KRHF(cell, kpts)
if rank == 0:
    kmf.kernel()

comm.Barrier()
mo_coeff  = comm.bcast(kmf.mo_coeff,root=0)
mo_energy = comm.bcast(kmf.mo_energy,root=0)
mo_occ    = comm.bcast(kmf.mo_occ,root=0)
{'fraction_non_alphanumeric': 0.15878378378378377, 'fraction_numerical': 0.11261261261261261, 'mean_word_length': 2.504930966469428, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6629022', 'n_tokens_mistral': 911, 'n_tokens_neox': 787, 'n_words': 169}