Skip to content

SamuelFoo/NTGF

Repository files navigation

Numerical Tunnelling Green's Function

NTGF was first developed by Kimbell. This repository tries to implement it in Python to be compatible with our lab's existing Python codes. NTGF stands for "Numerical Tunnelling Green's Function". It tries to simulate a material structure with stacked 2D planes, connected by a tunnelling parameter.

Users can specify each layer's parameters with attributes inside the layer class, or the global parameter with attributes inside the GlobalParam class. NTGF will then try to calculate for the band gap under different situations.

Quickstart

The required Python packages are specified in requirements.txt. Install them by running the following command in your Python virtual environment.

pip install -r requirements.txt

Code Structure

Main simulation scripts are:

  • script_layer.py
  • script_single_layer.py
  • script_bilayer.py
  • script_junction.py

script_single_layer.py replicates the results in sections 7.2.9 and 7.2.10 (pages 177 to 180) of Kimbell's thesis. It finds zeroes of the self-consistency equation and generates a phase plot of the residuals for the single layer case. The key functions are GKTH_self_consistency_1S_residual for finding the residual and GKTH_self_consistency_1S_find_root for finding roots where the residual is zero.

script_bilayer.py and script_junction.py replicates the results in sections 7.3.3 and 7.3.4 (pages 185 to 189) of Kimbell's thesis. It simulates the current-phase relationship of superconductor-metal junctions. The key functions are GKTH_self_consistency_2S_taketurns which solves the self-consistency equation for bi-layer junctions, GKTH_Greens_current_radial which finds the current given a specified phase between N layers and GKTH_critical_current which finds the maximum current vs phase for N layers.

These simulation scripts use functions defined in the GKTH directory and save simulation output data to the data directory, which can be read using a SQL database reader or the sqlite3 Python package.

The plots and figures in our presentation slides and report can by obtained by running main.ipynb. It reads data from the data directory and plots them using the functions specified in plotting.py.

The data is managed using sqlite. This allows for multiprocessing and for the simulation to be interrupted and restarted from the last saved data without having to re-run the entire program. This is done by returning immediately if data with the exact initial conditions is available. To forcefully re-run with the same conditions, delete the data entry by using the "drop" commands where available (e.g., drop_lambda).

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors