qmctorch.wavefunction.jastrows.elec_elec_nuclei.jastrow_factor_electron_electron_nuclei module
- class qmctorch.wavefunction.jastrows.elec_elec_nuclei.jastrow_factor_electron_electron_nuclei.JastrowFactorElectronElectronNuclei(*args: Any, **kwargs: Any)[source]
Bases:
Module
Jastrow Factor of the elec-elec-nuc term:
\[J = \exp\left( \sum_A \sum_{i<j} K(R_{iA}, r_{jA}, r_{rij}) \right)\]- Parameters:
- get_mask_tri_up()[source]
Get the mask to select the triangular up matrix
- Returns:
mask of the tri up matrix
- Return type:
torch.tensor
- extract_tri_up(inp)[source]
extract the upper triangular elements
- Parameters:
input (torch.tensor) – input matrices (…, nelec, nelec)
- Returns:
triangular up element (…, nelec_pair)
- Return type:
torch.tensor
- extract_elec_nuc_dist(en_dist)[source]
Organize the elec nuc distances
- Parameters:
en_dist (torch.tensor) – electron-nuclei distances nbatch x nelec x natom or nbatch x 3 x nelec x natom (dr)
- Returns:
nbatch x natom x nelec_pair x 2 or torch.tensor: nbatch x 3 x natom x nelec_pair x 2 (dr)
- Return type:
torch.tensor
- assemble_dist(pos)[source]
Assemle the different distances for easy calculations
- Parameters:
pos (torch.tensor) – Positions of the electrons Size : Nbatch, Nelec x Ndim
- Returns:
nbatch, natom, nelec_pair, 3
- Return type:
torch.tensor
- assemble_dist_deriv(pos, derivative=1)[source]
- Assemle the different distances for easy calculations
the output has dimension nbatch, 3 x natom, nelec_pair, 3 the last dimension is composed of [r_{e_1n}, r_{e_2n}, r_{ee}]
- Parameters:
pos (torch.tensor) – Positions of the electrons Size : Nbatch, Nelec x Ndim
- Returns:
nbatch, 3 x natom, nelec_pair, 3
- Return type:
torch.tensor
- forward(pos, derivative=0, sum_grad=True)[source]
Compute the Jastrow factors.
- Parameters:
pos (torch.tensor) – Positions of the electrons Size : Nbatch, Nelec x Ndim
derivative (int, optional) – order of the derivative (0,1,2,). Defaults to 0.
sum_grad (bool, optional) – Return the sum_grad (i.e. the sum of the derivatives) or the individual terms. Defaults to True. False only for derivative=1
- Returns:
- value of the jastrow parameter for all confs
derivative = 0 (Nmo) x Nbatch x 1 derivative = 1 (Nmo) x Nbatch x Nelec (for sum_grad = True) derivative = 1 (Nmo) x Nbatch x Ndim x Nelec (for sum_grad = False) derivative = 2 (Nmo) x Nbatch x Nelec
- Return type:
torch.tensor
- jastrow_factor_derivative(r, dr, jast, sum_grad)[source]
Compute the value of the derivative of the Jastrow factor
- Parameters:
r (torch.tensor) – ee distance matrix Nbatch x Nelec x Nelec
jast (torch.tensor) – values of the jastrow elements Nbatch x Nelec x Nelec
- Returns:
- gradient of the jastrow factors
Nbatch x Nelec x Ndim
- Return type:
torch.tensor
- jastrow_factor_second_derivative(r, dr, d2r, jast)[source]
Compute the value of the pure 2nd derivative of the Jastrow factor
- Parameters:
r (torch.tensor) – ee distance matrix Nbatch x Nelec x Nelec
jast (torch.tensor) – values of the ajstrow elements Nbatch x Nelec x Nelec
- Returns:
- diagonal hessian of the jastrow factors
Nbatch x Nelec x Ndim
- Return type:
torch.tensor
- jastrow_factor_second_derivative_auto(pos, jast=None)[source]
Compute the second derivative of the jastrow factor automatically. This is needed for complicate kernels where the partial derivatives of the kernels are difficult to organize in a total derivaitve e.e Boys-Handy
- Parameters:
pos ([type]) – [description]