# Computing

From phys824

## Contents

- 1 Unix Training
- 2 MATLAB Training
- 3 MATLAB Scripts
- 3.1 Electron density in nanowires using equilibrium density matrix
- 3.2 DOS of disordered nanowire using eigenvalues and Anderson localization of eigenfunctions
- 3.3 Density of states using equilibrium retarded Green function
- 3.4 Subband structure of graphene nanoribbons using tight-binding models
- 3.5 Quantum transport in 1D nanowires using NEGF
- 3.6 Tunneling magnetoresistance in 1D models
- 3.7 Spin-transfer torque in 1D models
- 3.8 Klein tunneling in graphene heterojunctions

- 4 MATLAB functions
- 5 Density functional theory using GPAW

## Unix Training

## MATLAB Training

### Hands-on tutorials by Instructor

### Hands-on Lab tutorials by MathWorks

### Reference

- MATLAB Brief List of Commands
- MATLAB Documentation
- Some Common MATLAB Programming Pitfalls and How to Avoid Them

### Books and notes

- C. Moler:
*Numerical Computing with MATLAB*(SIAM, Philadelphia, 2004). [PDF] - UD Crash Course on Matlab

### Implementation Tools

## MATLAB Scripts

### Electron density in nanowires using equilibrium density matrix

### DOS of disordered nanowire using eigenvalues and Anderson localization of eigenfunctions

### Density of states using equilibrium retarded Green function

### Subband structure of graphene nanoribbons using tight-binding models

- 8zgnr.m (pedestrian code for 8-ZGNR only)

### Quantum transport in 1D nanowires using NEGF

- qt_1d.m (code to compute the conductance and total and local density of states of a 1D nanowire, with possible potential barriers or impurities, attached to two semi-infinite electrodes)

### Tunneling magnetoresistance in 1D models

### Spin-transfer torque in 1D models

### Klein tunneling in graphene heterojunctions

- gnr_cond_recursive.m,bstruct.m, blocktosparse.m, sparsetoblock.m, h_zigzag.m, invnn.m, Self.m, (code to compute the conductance of a finite graphene nanoribbon attached to two semi-infinite graphene electrodes)

## MATLAB functions

- matrix_exp.m (Exponential, or any other function with small changed in the code, of a Hermitian matrix)
- 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): atomCoord.m, atomPosition.m, and constrainView.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)

## Density functional theory using GPAW

### Hands-on tutorials by CAMd at Denmark Technical University

### Hands-on tutorials by Instructor

- Band structure of Fe
- Subbandstructure of graphene nanoribbons
- Subband structure of carbon nanotubes
- Quantum transport through single-molecule nanojunctions