theochem / ModelHamiltonian

Generate 1- and 2-electron integrals so that molecular quantum chemistry software can be used for model Hamiltonians.
https://modelh.qcdevs.org
GNU Lesser General Public License v3.0
27 stars 17 forks source link

Pariser-Parr dictionary #116

Closed RichRick1 closed 3 months ago

RichRick1 commented 5 months ago
  1. 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.

  2. 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: image and

image

@PaulWAyers what do you think is the best way from API perspective to choose the type of overlap-computations?

PaulWAyers commented 5 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?

RichRick1 commented 5 months ago

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

PaulWAyers commented 5 months ago

That's a good idea. We can provide some utilities for constructing the overlap matrix and then pass it.

RichRick1 commented 5 months ago

Just a summary of the workflow for me and @giovanni-br

We need to differentiate computations of overlap between orbitals depending on whether it's 1s-1s or 2p-2p orbitals.

Input format:

User provides connectivity in the form of [("C1", "C2", 0.5, "pi"), ("C2", "O3(2)", 0.7, "sigma")] where:

Aside of connectivity, user can provide:

Hierarchy

$$ \beta{X Y}=1.75 S{X Y} \frac{\alpha_X+\alpha_Y}{2} $$

Output format:

Array that represents one-body term. On the diagonal: $\alpha$ values, non diagonal values are calculated using the formula above.

Code structure

We need to make a function that resembles rauk.py file that builds one-body term. Functions in the file:

  1. build_one_body; returns one-body term and resembles function in therauk.py file
  2. compute_U; returns array of potential, computed from Pariser-Parr approximation as

$$ \bar{U}_{X Y}=\frac{1}{2}\left(U_X+U_Y\right) $$

  1. compute_gamma; returns gamma from Pariser-Parr approximation as

image

  1. Change check of building the one body term based on either Rauk or Pariser Parr approximation inside the 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
            )

Stylistics changes

Long Run:

RichRick1 commented 5 months ago

Two body term

Computing u_onsite

Function name: compute_U in the rauk module, PariserParr.py

  1. For the computation of potential on each site, if user didn't provide u_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
  2. Computation of u_onsite is done by $U_X = \alpha_X - A_X$

Computing gamma

Function name: compute_gamma in the rauk module, PariserParr.py

  1. For the computation of $\gamma_{XY}$ if gamma is None we need to call compute_U to evaluate $U_x$. Then, we can use the following formula: image