Closed RichRick1 closed 3 months ago
Perhaps have an option for the overlap calculation, where the user can specify s
or p
; then we can indicate in the documentation what these keywords mean, specifically.
A more advanced option would be to support passing a string (here s
or p
) or a function, whereby the user passes their own overlap function. That would add a lot of flexibility, since basically the any overlap function could be used. (Under the hood, the keyword arguments would just call the code with the function as specified here.)
What do you think?
What if instead of the passing a function, we let user pass the overlap matrix for directly? Such approach will provide the same flexibility, but eliminates a problem of restricting formatting for the function that user provides
That's a good idea. We can provide some utilities for constructing the overlap matrix and then pass it.
We need to differentiate computations of overlap between orbitals depending on whether it's 1s-1s or 2p-2p orbitals.
User provides connectivity in the form of [("C1", "C2", 0.5, "pi"), ("C2", "O3(2)", 0.7, "sigma")] where:
atoms
that are connected
Atom
itself composed of:
string
float
(float)
-- number in parenthesis
It may look cumbersome to specify number of an atom, but it's necessary if user wants to specify connectivity that is more complex then linear chains. float
data typestring
data type; allowed values are "sigma"
, "pi"
Aside of connectivity, user can provide:
$$ \beta{X Y}=1.75 S{X Y} \frac{\alpha_X+\alpha_Y}{2} $$
Array that represents one-body term. On the diagonal: $\alpha$ values, non diagonal values are calculated using the formula above.
We need to make a function that resembles rauk.py
file that builds one-body term. Functions in the file:
build_one_body
; returns one-body term and resembles function in therauk.py
filecompute_U
; returns array of potential, computed from Pariser-Parr approximation as$$ \bar{U}_{X Y}=\frac{1}{2}\left(U_X+U_Y\right) $$
compute_gamma
; returns gamma from Pariser-Parr approximation as hamiltonians.py
so it doesn't depend on number of parameters inside the connectivity
list # check if elements in connectivity matrix are integer
connectivity = [("C1", "C2", 0.5, "pi"), ("C2", "C3", 0.5, "sigma")]
elif np.all([isinstance(elem[3], int) for elem in self.connectivity]):
one_body_term = assign_rauk_parameters(
self.connectivity,
self.atom_types,
self.atoms_num,
self.n_sites,
self.atom_dictionary,
self.bond_dictionary
)
# check if elements in connectivity matrix are float
elif np.all([isinstance(elem[3], float) for elem in self.connectivity]):
one_body_term = compute_param_dist_overlap(
self.connectivity,
self.atom_types,
self.atoms_num,
self.n_sites,
self.atoms_dist,
self.atom_dictionary,
self.bond_dictionary
)
compute_param_dist_overlap
to compute_overlap
. This will make code more succinctu_onsite
compute_U
in the rauk module, PariserParr.pyu_onsite
(u_onsite
is None
) or affinity_dct is None
, then function pull information about binding affinity from the Json file. It should also know (or read) atom_dct
gamma
compute_gamma
in the rauk module, PariserParr.pygamma is None
we need to call compute_U
to evaluate $U_x$. Then, we can use the following formula:
When we build Pariser-Parr dictionary, we assume user provides connectivity matrix as ('atomx, 'atomy', 'Rxy'). Where $R_{xy}$ is a distance between atoms x and y.
To compute hopping term $\beta{xy}$ we need to compute overlap between orbitals $S{xy}$: $$\beta{X Y}=1.75 S{X Y} \frac{\alpha_X+\alpha_Y}{2}$$
Problem: computation of $S_{xy}$ depends, among other parameters, on type of orbitals: and
@PaulWAyers what do you think is the best way from API perspective to choose the type of overlap-computations?