Skip to content

Commit

Permalink
Remove unnecessary parallel writing check
Browse files Browse the repository at this point in the history
  • Loading branch information
edan-bainglass committed Feb 18, 2024
1 parent f5be15f commit b09f940
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions examples/coulomb_blockade/pentacene/greens.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
from qtpyt.base.leads import LeadSelfEnergy
from qtpyt.basis import Basis
from qtpyt.block_tridiag import graph_partition
from qtpyt.parallel import comm
from qtpyt.surface.tools import prepare_leads_matrices
from qtpyt.tools import remove_pbc

Expand All @@ -28,6 +27,9 @@ def compute_gf_parameters(
) -> None:
"""docstring"""

output_dir = Path("results")
output_dir.mkdir(exist_ok=True)

basis_leads = Basis.from_dictionary(leads, basis)
basis_device = Basis.from_dictionary(device, basis)

Expand Down Expand Up @@ -67,20 +69,16 @@ def compute_gf_parameters(

self_energies = [(0, se[0]), (len(hs_list_ii) - 1, se[1])]

if comm.rank == 0:
output_dir = Path("results")
output_dir.mkdir(exist_ok=True)

np.save(output_dir / "leads_nao.npy", basis_leads.nao)
np.save(output_dir / "leads_nao.npy", basis_leads.nao)

with open(output_dir / "hamiltonian_ii.pkl", "wb") as file:
pickle.dump(hs_list_ii, file)
with open(output_dir / "hamiltonian_ii.pkl", "wb") as file:
pickle.dump(hs_list_ii, file)

with open(output_dir / "hamiltonian_ij.pkl", "wb") as file:
pickle.dump(hs_list_ij, file)
with open(output_dir / "hamiltonian_ij.pkl", "wb") as file:
pickle.dump(hs_list_ij, file)

with open(output_dir / "self_energies.pkl", "wb") as file:
pickle.dump(self_energies, file)
with open(output_dir / "self_energies.pkl", "wb") as file:
pickle.dump(self_energies, file)


if __name__ == "__main__":
Expand Down

0 comments on commit b09f940

Please sign in to comment.