-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #79 from freude/develop
This large commit includes new docs, significant code refactoring and…
- Loading branch information
Showing
62 changed files
with
4,256 additions
and
1,574 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"cells": [], | ||
"metadata": {}, | ||
"nbformat": 4, | ||
"nbformat_minor": 2 | ||
} |
Oops, something went wrong.