Skip to content

Commit

Permalink
Merge pull request #80 from freude/develop
Browse files Browse the repository at this point in the history
added verbosity setter
  • Loading branch information
freude committed Dec 13, 2019
2 parents b7cf49a + 5d2e720 commit c03b5ef
Show file tree
Hide file tree
Showing 22 changed files with 536 additions and 196 deletions.
64 changes: 64 additions & 0 deletions docs/source/modules.rst
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,76 @@ Module hamiltonian
:private-members:
:no-undoc-members:

Module hamiltonian_sparse
-------------------------

.. automodule:: tb.hamiltonian_sparse
:members:
:private-members:
:no-undoc-members:

Module hamiltonian_initializer
------------------------------

.. automodule:: tb.hamiltonian_initializer
:members:
:private-members:
:no-undoc-members:

Module structure_designer
-------------------------

.. automodule:: tb.structure_designer
:members:
:no-undoc-members:

Module orbitals
---------------

.. automodule:: tb.orbitals
:members:
:private-members:
:no-undoc-members:

Module diatomic_matrix_element
------------------------------

.. automodule:: tb.diatomic_matrix_element
:members:
:private-members:
:no-undoc-members:


Module block_tridiagonalization
-------------------------------

.. automodule:: tb.block_tridiagonalization
:members:
:private-members:
:no-undoc-members:

Module sorting_algorithms
-------------------------

.. automodule:: tb.sorting_algorithms
:members:
:private-members:
:no-undoc-members:


Package negf
************

Module greens_functions
-----------------------
.. automodule:: negf.greens_functions
:members:
:private-members:
:no-undoc-members:

Module recursive_greens_functions
---------------------------------
.. automodule:: negf.recursive_greens_functions
:members:
:private-members:
:no-undoc-members:
8 changes: 1 addition & 7 deletions examples/si_nw.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,7 @@ def sorting(coords, a, b):
hamiltonian.set_periodic_bc(PRIMITIVE_CELL)

hl, h0, hr = hamiltonian.get_hamiltonians()
# subblocks = split_matrix0(h0, left=hl.shape[0], right=hr.shape[0])
# # plt.plot(np.array(subblocks) ** 3)
# print(np.sum(np.array(subblocks) ** 3))1
# h01, hl1, hr1 = cut_in_blocks(h0, subblocks)
from tb.aux_functions import split_into_subblocks
# from tb.slicer import split_into_subblocks
h0, hl, hr, _ = split_into_subblocks(h0, h_l=hl, h_r=hr)
h0, hl, hr, _ = hamiltonian.get_hamiltonians_block_tridiagonal()

num_points = 20
kk = np.linspace(0, 0.57, num_points, endpoint=True)
Expand Down
10 changes: 5 additions & 5 deletions jupyter_notebooks/Untitled.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -106,21 +106,21 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 2",
"display_name": "Python 3",
"language": "python",
"name": "python2"
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 2
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython2",
"version": "2.7.12"
"pygments_lexer": "ipython3",
"version": "3.6.9"
}
},
"nbformat": 4,
Expand Down
6 changes: 0 additions & 6 deletions jupyter_notebooks/Untitled1.ipynb

This file was deleted.

37 changes: 11 additions & 26 deletions jupyter_notebooks/atom_chains.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
"| |\\ | (_| | | | | (_) | |\\ | __/ |_ \n",
"|_| \\_|\\__,_|_| |_|\\___/|_| \\_|\\___|\\__|\n",
" \n",
"\n"
"\n",
"Vesion 1.0\n"
]
}
],
Expand All @@ -48,7 +49,7 @@
},
{
"cell_type": "code",
"execution_count": 11,
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -58,22 +59,6 @@
"b.add_orbital(title='s', energy=-0.7, )"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Now we define a set of of orbitals for tight-binding computations:"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
"tb.Orbitals.orbital_sets = {'A': a, 'B': b}"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand All @@ -83,7 +68,7 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -103,7 +88,7 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 4,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -120,7 +105,7 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 5,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -168,8 +153,8 @@
"---------------------------------\n",
"\n",
"Unique distances: \n",
" 1. Ang between atoms A and B\n",
" 1. Ang between atoms B and A\n",
" 1. Ang between atoms A and B\n",
"---------------------------------\n",
"\n"
]
Expand All @@ -181,7 +166,7 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": 6,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -221,7 +206,7 @@
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": 7,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -252,7 +237,7 @@
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": 8,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -269,7 +254,7 @@
},
{
"cell_type": "code",
"execution_count": 10,
"execution_count": 9,
"metadata": {},
"outputs": [
{
Expand Down
8 changes: 4 additions & 4 deletions jupyter_notebooks/bismuth_bulk.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
"| |\\ | (_| | | | | (_) | |\\ | __/ |_ \n",
"|_| \\_|\\__,_|_| |_|\\___/|_| \\_|\\___|\\__|\n",
" \n",
"\n"
"\n",
"Vesion 1.0\n"
]
}
],
Expand Down Expand Up @@ -60,8 +61,7 @@
"bi_orb.add_orbital(\"py\", energy=-0.486,\n",
" principal=0, orbital=1, magnetic=1, spin=1)\n",
"bi_orb.add_orbital(\"pz\", energy=-0.486,\n",
" principal=0, orbital=1, magnetic=0, spin=1)\n",
"Orbitals.orbital_sets = {'Bi': bi_orb}"
" principal=0, orbital=1, magnetic=0, spin=1)"
]
},
{
Expand Down Expand Up @@ -225,7 +225,7 @@
{
"data": {
"text/plain": [
"<tb.hamiltonian.Hamiltonian at 0x7f21876f1400>"
"<tb.hamiltonian.Hamiltonian at 0x7f17b588ce48>"
]
},
"execution_count": 8,
Expand Down
7 changes: 4 additions & 3 deletions jupyter_notebooks/bulk_silicon.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@
"| |\\ | (_| | | | | (_) | |\\ | __/ |_ \n",
"|_| \\_|\\__,_|_| |_|\\___/|_| \\_|\\___|\\__|\n",
" \n",
"\n"
"\n",
"Vesion 1.0\n"
]
}
],
Expand Down Expand Up @@ -160,7 +161,7 @@
{
"data": {
"text/plain": [
"<tb.hamiltonian.Hamiltonian at 0x7f810519c208>"
"<tb.hamiltonian.Hamiltonian at 0x7ff9855deb70>"
]
},
"execution_count": 4,
Expand Down Expand Up @@ -308,7 +309,7 @@
},
{
"cell_type": "code",
"execution_count": 12,
"execution_count": 10,
"metadata": {},
"outputs": [
{
Expand Down
2 changes: 1 addition & 1 deletion jupyter_notebooks/silicon_nanowire.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.8"
"version": "3.6.9"
}
},
"nbformat": 4,
Expand Down
11 changes: 0 additions & 11 deletions negf/greens_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,17 +101,6 @@ def group_velocity(eigenvector, eigenvalue, h_r):


def iterate_gf(E, h_0, h_l, h_r, gf, num_iter):
"""
Iterates a self-energy to achieve self-consistency
:param E:
:param h_0:
:param h_l:
:param h_r:
:param gf:
:param num_iter:
:return:
"""

for _ in range(num_iter):
gf = h_r * np.linalg.pinv(E * np.identity(h_0.shape[0]) - h_0 - gf) * h_l
Expand Down
5 changes: 5 additions & 0 deletions negf/recursive_greens_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,20 @@ def recursive_gf(energy, mat_l_list, mat_d_list, mat_u_list, s_in=0, s_out=0):
:param energy: energy
:type energy: numpy array
:param mat_d_list: list of diagonal blocks
:type mat_d_list: list of numpy arrays
:param mat_u_list: list of upper-diagonal blocks
:type mat_u_list: list of numpy arrays
:param mat_l_list: list of lower-diagonal blocks
:type mat_l_list: list of numpy arrays
:return grd, grl, gru, gr_left: retarded Green's
function: block-diagonal,
lower block-diagonal,
upper block-diagonal,
left-connected
:rtype grd, grl, gru, gr_left: list of numpy arrays
"""
# -------------------------------------------------------------------
# ---------- convert input arrays to the matrix data type -----------
Expand Down
4 changes: 2 additions & 2 deletions negf/transport.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ def fermi_window(energy, tempr):

def tr2cond(energy, tr, tempr=300):

tr = np.pad(tr, 'edge')
energy = np.pad(energy, 'linear_ramp')
tr = np.pad(tr, 30000, 'edge')
energy = np.pad(energy, 30000,'linear_ramp')
ans = np.convolve(tr, fermi_window(energy, tempr), mode='same')

return energy, ans
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@


setup(name='nanonet',
version='0.7',
version='1.0',
description='Python framework for tight-binding computations',
author='Mike Klymenko',
author='M. V. Klymenko, J. A. Vaitkus, J. S. Smith, J. H. Cole',
author_email='mike.klymenko@rmit.edu.au',
license='MIT',
packages=['tb', 'negf'],
packages=['tb', 'negf', 'verbosity'],
entry_points={
'console_scripts': ['tb = tb.tb_script:main', 'tbmpi = tb.tbmpi_script:main', 'gf = tb.gf_script:main'],
},
Expand Down
9 changes: 0 additions & 9 deletions tb/abstract_interfaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,6 @@ def qn2ind(self, qn):

@abstractmethod
def ind2qn(self, ind):
"""
The member function trasform a dictionary of quantum numbers into a matrix index
:param ind: index
:type ind: int
:return qn:
:rtype:
"""
pass

@property
Expand Down

0 comments on commit c03b5ef

Please sign in to comment.