qmctorch.wavefunction.jastrows.elec_elec package

Subpackages

Submodules

Module contents

qmctorch.wavefunction.jastrows.elec_elec.JastrowFactor

alias of JastrowFactorElectronElectron

class qmctorch.wavefunction.jastrows.elec_elec.PadeJastrowKernel(*args: Any, **kwargs: Any)[source]

Bases: JastrowKernelElectronElectronBase

Computes the Simple Pade-Jastrow factor

\[B_{ij} = \frac{w_0 r_{ij}}{1 + w r_{ij}}\]

where \(w_0\) equals 0.5 for parallel spin and 0.25 for antiparallel spin

Parameters:
  • nup (int) – number of spin up electons

  • ndow (int) – number of spin down electons

  • cuda (bool) – Turns GPU ON/OFF.

  • w (float, optional) – Value of the variational parameter. Defaults to 1.

get_static_weight()[source]

Get the matrix of static weights

Returns:

matrix of the static weights

Return type:

torch.tensor

forward(r)[source]

Get the jastrow kernel.

\[B_{ij} = \frac{w_0 r_{i,j}}{1+w r_{i,j}}\]
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

\[\frac{d B_{ij}}{d k_i} = \frac{d B_{ij}}{ d k_j } = - \frac{d B_{ji}}{d k_i}\]
\[\text{out}_{k,i,j} = A1 + A2\]
\[A1_{kij} = w0 \frac{dr_{ij}}{dk_i} \frac{1}{1 + w r_{ij}}\]
\[A2_{kij} = - w0 w' r_{ij} \frac{dr_{ij}}{dk_i} \frac{1}{1 + w r_{ij}}^2\]
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

\[\frac{d^2 B_{ij}}{d k_i^2} = \frac{d^2 B_{ij}}{d k_j^2} = \frac{d^2 B_{ji}}{ d k_i^2}\]
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

class qmctorch.wavefunction.jastrows.elec_elec.FullyConnectedJastrowKernel(*args: Any, **kwargs: Any)[source]

Bases: JastrowKernelElectronElectronBase

Defines a fully connected jastrow factors.

get_var_weight()[source]

define the variational weight.

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

forward(x)[source]

Compute the kernel values

Parameters:

x (torch.tensor) – e-e distance Nbatch, Nele_pairs

Returns:

values of the f_ij

Return type:

torch.tensor

class qmctorch.wavefunction.jastrows.elec_elec.PadeJastrowPolynomialKernel(*args: Any, **kwargs: Any)[source]

Bases: 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