Computer Lab: Difference between revisions

From phys824
Jump to navigationJump to search
No edit summary
No edit summary
Line 16: Line 16:


==JUPYTER notebooks for hands-on computer lab sessions==
==JUPYTER notebooks for hands-on computer lab sessions==
 
* [[Media:01 introduction.ipynb|Jupyter Notebook: First steps with Python]]
* [https://drive.google.com/file/d/1dACmfS5hkeeP0TDSQLcauA_EnA3dTBau/view?usp=sharing Jupyter Notebook: Functions and Objects in Python]
* [https://drive.google.com/file/d/1eLcGXrEnorozG6A9PdG73wM2yG0wZFxM/view?usp=sharing Jupyter Notebook: Kwant Introduction]
* [https://drive.google.com/file/d/1AXFtI5gr4ZmebGdNCJFWt7IMOyrb2c69/view?usp=sharing PDF: Kwant Introduction]
* [https://drive.google.com/file/d/1Qas3CFQbfnsXx01Z4T9ACMo65ROOGMoK/view?usp=sharing Jupyter Notebook: Kwant Honeycomb Lattice]
* [https://drive.google.com/file/d/1n0d1eclD70Q0QOGhw1avMQg8xkKuk0yp/view?usp=sharing PDF: Kwant Honeycomb Lattice]
* [https://drive.google.com/file/d/1jQ_wA4yacLi-1qDS6zAxLXV7jMQ2Vkoo/view?usp=sharing Jupyter Notebook: Kwant Solvers]
* [https://drive.google.com/file/d/13nQ4odWtBHoxbnLxhqxX45SuZ3nK71MT/view?usp=sharing PDF: Kwant Solvers]


==Python references==
==Python references==

Revision as of 06:35, 29 August 2020

Python and package installation

conda install -c conda-forge kwant
pip install pythtb --upgrade
pip install --upgrade --user ase
python -m ase test

JUPYTER notebooks for hands-on computer lab sessions

Python references

KWANT references

Density functional theory with GPAW package

How to run GPAW on ulam

GPAW has been installed on ulam with the OS installed python 2.6.

  • in order to use the serial version of GPAW type:
 python your_gpaw_program.py
  • in order to use the parallel version of gpaw use the following syntax (replace 8 with the number of cores you want to use):
 mpirun -np 8 gpaw-python_openmpi your_gpaw_program.py

Getting started with GPAW

from ase import Atoms
from ase.io import write
from ase.optimize import QuasiNewton
from gpaw import GPAW

d = 1.10  # Starting guess for the bond length
atoms = Atoms('CO', positions=((0, 0, 0),
                               (0, 0, d)), pbc=False)
atoms.center(vacuum=4.0)
write('CO.cif', atoms)
calc = GPAW(h=0.20, xc='PBE', txt='CO_relax.txt')
atoms.set_calculator(calc)

relax = QuasiNewton(atoms, trajectory='CO.traj', logfile='qn.log')
relax.run(fmax=0.05)

GPAW Exercises Related to Midterm Project

References

First-principles quantum transport calculations using NEGF+DFT within GPAW package

Theory Background

  • Crash course on NEGF+DFT codes
  • NEGF+DFT within GPAW - see also J. Chen, K. S. Thygesen, and K. W. Jacobsen, Ab initio nonequilibrium quantum transport and forces with the real-space projector augmented wave method, Phys. Rev. B 85, 155140 (2012). [PDF]
  • M. Strange, I. S. Kristensen, K. S. Thygesen, and K. W. Jacobsen, Benchmark density functional theory calculations for nanoscale conductance, J. Chem. Phys. 128, 114714 (2008). [PDF]
  • D. A. Areshkin and B. K. Nikolić, Electron density and transport in top-gated graphene nanoribbon devices: First-principles Green function algorithms for systems containing a large number of atoms, Phys. Rev. B 81, 155450 (2010). [PDF]

GPAW Exercises