qmctorch.wavefunction.jastrows.elec_elec.kernels.pade_jastrow_polynomial_kernel module

class qmctorch.wavefunction.jastrows.elec_elec.kernels.pade_jastrow_polynomial_kernel.PadeJastrowPolynomialKernel(nup, ndown, cuda, order=2, weight_a=None, weight_b=None)[source]

Bases: qmctorch.wavefunction.jastrows.elec_elec.kernels.jastrow_kernel_electron_electron_base.JastrowKernelElectronElectronBase

Computes a polynomial Pade-Jastrow factor

\[B_{ij} = \frac{P_{ij}}{Q_{ij}}\]

with : .. math:

P_{ij} = a_1 r_{i,j} + a_2 r_{ij}^2 + ....

and :

Parameters:
  • nup (int) – number of spin up electons
  • ndow (int) – number of spin down electons
  • order (int) – degree of the polynomial
  • weight_a (torch.tensor, optional) – Value of the weight
  • weight_b (torch.tensor, optional) – Value of the weight
  • cuda (bool, optional) – Turns GPU ON/OFF. Defaults to False.
get_static_weight()[source]

Get the matrix of static weights

Returns:static weight (0.5 (0.25) for parallel(anti) spins
Return type:torch.tensor
set_variational_weights(weight_a, weight_b)[source]

Define the initial values of the variational weights.

Parameters:
  • weight_a (torch.tensor or None) – Value of the weight
  • weight_b (torch.tensor or None) – Value of the weight
forward(r)[source]

Get the jastrow kernel.

\[B_{ij} = \frac{P_{ij}}{Q_{ij}}\]
Parameters:r (torch.tensor) – matrix of the e-e distances Nbatch x Nelec x Nelec
Returns:
matrix of the jastrow kernels
Nbatch x Nelec x Nelec
Return type:torch.tensor
compute_derivative(r, dr)[source]

Get the elements of the derivative of the jastrow kernels wrt to the first electrons

The derivative is given by:

\[\text{out}_{k,i,j} = \frac{P'Q - PQ'}{Q^2}\]

with:

\[P_{ij} = a_1 r_{i,j} + a_2 r_{ij}^2 + .... Q_{ij} = 1 + b_1 r_{i,j} + b_2 r_{ij}^2 +\]

and :

\[P'_{ij} = a_1 dr + a_2 2 r dr + a_r 3 dr r^2 + .... Q'_{ij} = b_1 dr + b_2 2 r dr + b_r 3 dr r^2 + ....\]

Due to the properties of the derivative we have .. math:

\frac{d B_{ij}}{d k_i} =  \frac{d B_{ij}}{d k_j}  = -\frac{d B_{ji}{d k_i}
Parameters:
  • r (torch.tensor) – matrix of the e-e distances Nbatch x Nelec x Nelec
  • dr (torch.tensor) – matrix of the derivative of the e-e distances Nbatch x Ndim x Nelec x Nelec
Returns:

matrix fof the derivative of the jastrow elements

Nbatch x Ndim x Nelec x Nelec

Return type:

torch.tensor

compute_second_derivative(r, dr, d2r)[source]

Get the elements of the pure 2nd derivative of the jastrow kernels wrt to the first electron

Due to the properties of the derivative we have .. math:

\frac{d B_{ij}}{d k_i} =  \frac{d B_{ij}}{d k_j}  = \frac{d B_{ji}{d k_i}
Parameters:
  • r (torch.tensor) – matrix of the e-e distances Nbatch x Nelec x Nelec
  • dr (torch.tensor) – matrix of the derivative of the e-e distances Nbatch x Ndim x Nelec x Nelec
  • d2r (torch.tensor) –
    matrix of the 2nd derivative of
    the e-e distances

    Nbatch x Ndim x Nelec x Nelec

Returns:

matrix fof the pure 2nd derivative of

the jastrow elements Nbatch x Ndim x Nelec x Nelec

Return type:

torch.tensor