Computer Lab: Difference between revisions

From phys824
Jump to navigationJump to search
No edit summary
No edit summary
Line 36: Line 36:
*[[Spin Hall effect in four terminal devices]]
*[[Spin Hall effect in four terminal devices]]
*[[Topological Hall effect in four terminal devices]]
*[[Topological Hall effect in four terminal devices]]
===Charge and spin densities in quantum dots via equilibrium density matrix===
*[[Media:charge_density.m|charge_density.m]]
*[[Media:spin_density.m|spin_density.m]]
*[[Media:poisson_schrodinger.m|poisson_schrodinger.m]] and [[Media:Fhalf.m|Fhalf.m]]
===DOS of 1D disordered nanowire using eigenvalues + visualization of Anderson localization of eigenfunctions===
*[[Media:disordered_nanowire.m|disordered_nanowire.m]]
===Density of states using equilibrium Green functions===
*[[Media:dos_negf_closed.m|dos_negf_closed.m]] computes DOS for finite 1D wire
*[[Media:dos_negf_open.m|dos_negf_open.m]] computes DOS for finite 1D wire attached to one or two macroscopic reservoirs
*[[Media:graphene_dos.m|graphene_dos.m]] computes DOS for a supercell of graphene with periodic boundary conditions
===Subband structure of graphene nanoribbons using tight-binding models===
*[http://www.physics.udel.edu/~bnikolic/teaching/phys824/MATLAB/8zgnr.m 8zgnr.m] (poor man's script follows literally the  [http://www.physics.udel.edu/~bnikolic/teaching/phys824/lectures/gnr_and_cnt.pdf lecture slide], so it works only for 8-ZGNR)
===Quantum transport in 1D nanowires using NEGF===
*[[Media:negf_formulas_in_pictures.pdf|How to use NEGF matrix formulas: Step-by-step in pictures]]
*[http://www.physics.udel.edu/~bnikolic/teaching/phys824/MATLAB/qt_1d.m qt_1d.m] (computes conductance, as well as total and local density of states for 1D nanowire modeled as tight-binding chain, with possible potential barriers or impurities, attached to two semi-infinite leads)
===Tunneling magnetoresistance in tight-binding models of magnetic tunnel junctions using NEGF===
* [[Media:mtj_1d.m|mtj_1d.m]] (computes TMR of F/I/F MTJs modeled using 1D tight-binding chain)
* [[Media:mtj_3d.m|mtj_3d.m]] (computes TMR of F/I/F MTJs modeled using mixed real space and k-space tight-binding model of 3D junctions
===Quantum transport in graphene nanostructures via NEGF===
*[[Media:gnr_cond_recursive.m|gnr_cond_recursive.m]],[http://www.physics.udel.edu/~bnikolic/teaching/phys824/MATLAB/bstruct.m bstruct.m], [http://www.physics.udel.edu/~bnikolic/teaching/phys824/MATLAB/blocktosparse.m blocktosparse.m], [http://www.physics.udel.edu/~bnikolic/teaching/phys824/MATLAB/sparsetoblock.m sparsetoblock.m], [http://www.physics.udel.edu/~bnikolic/teaching/phys824/MATLAB/h_zigzag.m h_zigzag.m], [http://www.physics.udel.edu/~bnikolic/teaching/phys824/MATLAB/invnn.m invnn.m], [[Media:Invb.m|Invb.m]]
[http://www.physics.udel.edu/~bnikolic/teaching/phys824/MATLAB/Self.m Self.m], (code to compute the conductance of a finite graphene nanoribbon attached to two semi-infinite graphene electrodes)
== MATLAB functions ==
* [http://www.physics.udel.edu/~bnikolic/teaching/phys824/MATLAB/matrix_exp.m matrix_exp.m] (Exponential, or any other function with small changed in the code, of a Hermitian  matrix)
* [http://www.physics.udel.edu/~bnikolic/teaching/phys824/MATLAB/visual_graphene_H.m visual_graphene_H.m] (For a given tight-binding Hamiltonian on the honeycomb lattice, function plots position of carbon atoms and draws blue lines to represent hoppings between them; red circles to represent on-site potential  between them; and cyan lines to represent the periodic boundary conditions; it can be used to test if the tight-binding Hamiltonian of graphene is set correctly); This function calls another three function which should be placed in the same directory (or in the path): [http://www.physics.udel.edu/~bnikolic/teaching/phys824/MATLAB/atomCoord.m atomCoord.m], [http://www.physics.udel.edu/~bnikolic/teaching/phys824/MATLAB/atomPosition.m atomPosition.m], and [http://www.physics.udel.edu/~bnikolic/teaching/phys824/MATLAB/constrainView.m constrainView.m]
* [http://www.physics.udel.edu/~bnikolic/teaching/phys824/MATLAB/self_energy.m self_energy.m] (Self-energy of the semi-infinite ideal metallic lead modeled on the square tight-binding lattice - the code shows how to convert analytical formulas of the lead surface Green function into a working program)
* [[Media:transmission.m|transmission.m]] (Transmission function for 1D tight-binding chain with spin-dependent terms)


== Density functional theory with GPAW package==
== Density functional theory with GPAW package==

Revision as of 06:34, 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