qmctorch.wavefunction.jastrows.elec_elec.jastrow_factor_electron_electron module
- class qmctorch.wavefunction.jastrows.elec_elec.jastrow_factor_electron_electron.JastrowFactorElectronElectron(*args: Any, **kwargs: Any)[source]
Bases:
Module
Electron-Electron Jastrow factor.
\[J = \prod_{i<j} \exp(\text{Kernel}(r_{ij}))\]- Parameters:
nup (int) – number of spin up electons
ndow (int) – number of spin down electons
jastrow_kernel (kernel) – class of a electron-electron Jastrow kernel
kernel_kwargs (dict, optional) – keyword argument of the kernel. Defaults to {}.
orbital_dependent_kernel (bool, optional) – Make the kernel orbital dependent. Defaults to False.
number_of_orbitals (int, optional) – number of orbitals for orbital dependent kernels. Defaults to None.
scale (bool, optional) – use scaled electron-electron distance. Defaults to False.
scale_factor (float, optional) – scaling factor. Defaults to 0.6.
cuda (bool, optional) – use cuda. Defaults to False.
- 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:
inp (torch.tensor) – input matrices (nbatch, n, n)
- Returns:
triangular up element (nbatch, -1)
- Return type:
torch.tensor
- get_edist_unique(pos, derivative=0)[source]
Get the unique elements of the electron-electron distance matrix.
- Parameters:
pos (torch.tensor) – positions of the electrons (Nbatch, Nelec*3)
derivative (int, optional) – order of the derivative
- Returns:
unique values of the electron-electron distance matrix
- 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) – distance matrix Nbatch x Nelec x Nelec
dr (torch.tensor) – derivative of the distance matrix Nbatch x Nelec x Nelec x 3
jast (torch.tensor) – values of the jastrow elements Nbatch x Nelec x Nelec
sum_grad (bool) – return the sum of the gradient or the individual components
- 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) – distance matrix Nbatch x Nelec x Nelec
dr (torch.tensor) – derivative of the distance matrix Nbatch x Nelec x Nelec x 3
d2r (torch.tensor) – 2nd derivative of the distance matrix Nbatch x Nelec x Nelec x 3
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