Skip to content

Commit

Permalink
Merge pull request #79 from freude/develop
Browse files Browse the repository at this point in the history
This large commit includes new docs, significant code refactoring and…
  • Loading branch information
freude committed Dec 3, 2019
2 parents a2904ff + 4a7f72a commit b7cf49a
Show file tree
Hide file tree
Showing 62 changed files with 4,256 additions and 1,574 deletions.
2 changes: 1 addition & 1 deletion docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ help:
# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
336 changes: 336 additions & 0 deletions docs/source/Hukel_model.ipynb

Large diffs are not rendered by default.

48 changes: 29 additions & 19 deletions docs/source/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# NanoNet
# NanoNet project

[![Codacy Badge](https://api.codacy.com/project/badge/Grade/5186e15b951d4df6b4f20c2365870b7c)](https://app.codacy.com/app/freude/NanoNet?utm_source=github.com&utm_medium=referral&utm_content=freude/NanoNet&utm_campaign=Badge_Grade_Dashboard)
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
Expand All @@ -8,16 +8,15 @@

<img src="https://user-images.githubusercontent.com/4588093/65398380-1f684380-ddfa-11e9-9e87-5aab6cf417b8.png" width="200">

## Introduction

## What is Nanonet?
The project represents an extendable Python framework for
the electronic structure computations based on
the tight-binding method. The code can deal with both finite
and periodic systems translated in one, two or three dimensions.

All computations can be governed by means of the python application programming interface (pyAPI) or the command line interface (CLI).

## Getting Started
## Installation

### Prerequisites

Expand Down Expand Up @@ -52,15 +51,9 @@ All tests may be run by invoking the command:
nosetests --with-doctest
```

### Examples of usage

- [Atomic chain](jupyter_notebooks/atom_chains.ipynb)
- [Huckel model](jupyter_notebooks/Hukel_model.ipynb)
- [Bulk silicon](jupyter_notebooks/bulk_silicon.ipynb)
- [Bulk silicon - initialization via an input file](jupyter_notebooks/bulk_silicon_with_input_file.ipynb)
- [Silicon nanowire](jupyter_notebooks/silicon_nanowire.ipynb)
## Usage and interfaces

### Python interface
### Python application programming interface

Below is a short example demonstrating usage of the `tb` package.
More illustrative examples can be found in the ipython notebooks
Expand Down Expand Up @@ -177,16 +170,33 @@ This script can be used together with the command `mpirun` (below is an example
mpirun -n 8 tbmpi --show=2 --save=1 --xyz=si.xyz --k_points=k_points.txt input.yaml
```

## Authors
## License

- Mykhailo V. Klymenko (mike.klymenko@rmit.edu.au)
- Jackson S. Smith
- Jesse A. Vaitkus
- Jared H. Cole
This project is licensed under the MIT License.

MIT License

Copyright (c) 2019 RMIT

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

## License

This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details

## Acknowledgments

Expand Down
128 changes: 128 additions & 0 deletions docs/source/Untitled.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"import matplotlib.pyplot as plt\n",
"import numpy as np\n",
"import tb"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [
{
"ename": "AttributeError",
"evalue": "'module' object has no attribute 'surface_greens_function'",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mAttributeError\u001b[0m Traceback (most recent call last)",
"\u001b[0;32m<ipython-input-5-84b267da0084>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[1;32m 26\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 27\u001b[0m \u001b[0;32mfor\u001b[0m \u001b[0mE\u001b[0m \u001b[0;32min\u001b[0m \u001b[0menergy\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 28\u001b[0;31m \u001b[0mL\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mR\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0m_\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0m_\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0m_\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mtb\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0msurface_greens_function\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mE\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mh_l\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mh_0\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mh_r\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 29\u001b[0m \u001b[0;31m# L, R = surface_greens_function_poles_Shur(E, h_l, h_0, h_r)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 30\u001b[0m \u001b[0msgf_l\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mappend\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mL\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;31mAttributeError\u001b[0m: 'module' object has no attribute 'surface_greens_function'"
]
}
],
"source": [
"eps0 = 1\n",
"eps_h = 1\n",
"c = 1\n",
"\n",
"omega = np.linspace(1, 5, 100)\n",
"k = eps_h * omega ** 2 / (c**2)\n",
"\n",
"d = 10\n",
"R = 1\n",
"V = 4 * np.pi * R ** 3\n",
"omega_p = 1\n",
"\n",
"# Drude model for particle\n",
"\n",
"alpha = 1 / (eps0 * V) * (1.0/3.0 - omega **2 / omega_p ** 2)\n",
"losses = 1j * k ** 2 / (6 * np.pi * eps0)\n",
"\n",
"# interparticle coupling\n",
"\n",
"def A1(om, n):\n",
" k = eps_h * om ** 2 / (c**2)\n",
" return np.exp(1j*k*np.abs(n*d))/(4.0*np.pi*eps0*np.abs(n*d))*(k**2)\n",
" \n",
"def A2(om, n): \n",
" k = eps_h * om ** 2 / (c**2)\n",
" return np.exp(1j*k*np.abs(n*d))/(4.0*np.pi*eps0*np.abs(n*d))*(1.0/((n*d)**2)-1j*k/np.abs(n*d))\n",
"\n",
"\n",
"x = tb.Atom('x')\n",
"x.add_orbital('s', E_x)\n",
"\n",
"y = tb.Atom('y')\n",
"y.add_orbital('s', E_x)\n",
"\n",
"z = tb.Atom('z')\n",
"z.add_orbital('s', E_x)\n",
"\n",
"tb.Atom.orbital_sets = {'x': ax, 'y': ay,'z': az}\n",
"\n",
"tb.set_tb_params(PARAMS_x_x={'ss_sigma': A1-A2},\n",
" PARAMS_y_y={'ss_sigma': A1-A2},\n",
" PARAMS_z_z={'ss_sigma': 2*A2})\n",
"\n",
"xyz_file = \"\"\"1\n",
"H cell\n",
"x1 0.0000000000 0.0000000000 0.0000000000\n",
"y1 0.0000000000 1.0000000000 0.0000000000\n",
"z1 0.0000000000 2.0000000000 0.0000000000\n",
"\"\"\"\n",
"\n",
"h = tb.Hamiltonian(xyz=xyz_file, nn_distance=1.1)\n",
"h.initialize()\n",
"h.set_periodic_bc([[0, 0, 1.0]])\n",
"h_l, h_0, h_r = h.get_hamiltonians()\n",
"\n",
"energy = np.linspace(-3.0, 1.5, 700)\n",
"\n",
"sgf_l = []\n",
"sgf_r = []\n",
"\n",
"for E in energy:\n",
" L, R, _, _, _ = tb.surface_greens_function(E, h_l, h_0, h_r)\n",
" # L, R = surface_greens_function_poles_Shur(E, h_l, h_0, h_r)\n",
" sgf_l.append(L)\n",
" sgf_r.append(R)\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 2",
"language": "python",
"name": "python2"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 2
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython2",
"version": "2.7.12"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
6 changes: 6 additions & 0 deletions docs/source/Untitled1.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"cells": [],
"metadata": {},
"nbformat": 4,
"nbformat_minor": 2
}

0 comments on commit b7cf49a

Please sign in to comment.