The idea is not to overload connectivity parameter in the __init__ method of HamPPP, but instead invoke PPP module to build $\gamma$ matrix directly, and then pass it to the HamPPP . This is very easy for user, and I feel like this is the way we will use it.
We already have a functionality to do this, since we initially separated Rauk in a stand-alone module for this reason. However, there are few changes in API that can make this much more user friendly and structured code-wise.
ToDo:
[x] We need to rename function generate_connectivity_matrix from the api.py file into parse_connectivity . It’s also a good idea to move it into the utils file, since it doesn’t relate to hamiltonians anymore.
def parse_connectivity(system):
r"""
Parse the connectivity of the system given as list of tuples.
Parameters
----------
system: list
list of tuples that specifies sites and bonds between them
For example, for a linear chain of 4 sites, the connectivity
can be specified as [(C1, C2, 1), (C2, C3, 1), (C3, C4, 1)]
Returns
-------
tuple: (list np.ndarray)
First element is a list of atoms in the order they apperar in the attice, second element is matrix that corresponds to the either distance matrix, or adjacency matrix.
"""
[x] The function above should be reused in both hamiltonins.py file and PariserParr.py module. Specifically, function calculate_gamma in PariserParr.py file should either get system as list of tuples, and then call parse_connectivity inside of it or directly gets distance matrix.
[x] Don't use the connectivity name here, instead use the adjacency parameter, that is either provided by user, or build during the initialization from connectivity. Note: connectivity is a list of tuples.
Once this is done, we can easily build $\gamma$ matrix using the PariserParr module such as:
Description
The idea is not to overload
connectivity
parameter in the__init__
method ofHamPPP
, but instead invokePPP
module to build $\gamma$ matrix directly, and then pass it to theHamPPP
. This is very easy for user, and I feel like this is the way we will use it.We already have a functionality to do this, since we initially separated Rauk in a stand-alone module for this reason. However, there are few changes in API that can make this much more user friendly and structured code-wise.
ToDo:
[x] We need to rename function
generate_connectivity_matrix
from theapi.py
file intoparse_connectivity
. It’s also a good idea to move it into the utils file, since it doesn’t relate to hamiltonians anymore.[x] The function above should be reused in both
hamiltonins.py
file andPariserParr.py
module. Specifically, functioncalculate_gamma
inPariserParr.py
file should either get system as list of tuples, and then callparse_connectivity
inside of it or directly gets distance matrix.[x] Move these lines into the
PariserParr.py
file[x] Don't use the connectivity name here, instead use the
adjacency
parameter, that is either provided by user, or build during the initialization fromconnectivity
. Note:connectivity
is a list of tuples.Once this is done, we can easily build $\gamma$ matrix using the
PariserParr
module such as: