Dear Adel,
The post by Christoph you are referring to is just a reflection and an invitation to think about parallelization in kwant.
It is not implemented in kwant. As the error message suggests, there is no argument "comm=MPI.COMM_WORLD" in the scattering matrix.
If you want to run your code in parallel, you can do a simple change in your code as follows:
import numpy as np
import kwant
from mpi4py import MPI
comm = MPI.COMM_WORLD
rank = comm.Get_rank()
nprocessor = comm.size
def make_sys():
.....
.....
return sys.finalized()
sys=make_sys()
energies=np.arange(k/nprocessor,(k+1)/nprocessor,20)
T=[]
for energy in energies:
Sm=kwant.smatrix(sys,energy=energy)
T.append(Sm.transmission(0,1))
np.save("Transmission"+str(k)+".npy",np.array(T))
##########
So, your code will return a number "nprocessor" .npy files of the transmission, each one of them is for a range of energies.
I hope this helps
Adel