qmctorch.wavefunction.slater_jastrow_backflow module

class qmctorch.wavefunction.slater_jastrow_backflow.SlaterJastrowBackFlow(mol, configs='ground_state', kinetic='jacobi', jastrow_kernel=<class 'qmctorch.wavefunction.jastrows.elec_elec.kernels.pade_jastrow_kernel.PadeJastrowKernel'>, jastrow_kernel_kwargs={}, backflow_kernel=<class 'qmctorch.wavefunction.orbitals.backflow.kernels.backflow_kernel_inverse.BackFlowKernelInverse'>, backflow_kernel_kwargs={}, orbital_dependent_backflow=False, cuda=False, include_all_mo=True)[source]

Bases: qmctorch.wavefunction.slater_jastrow_base.SlaterJastrowBase

Slater Jastrow wave function with electron-electron Jastrow factor and backflow

\[\Psi(R_{at}, r) = J(r)\sum_n c_n D^\uparrow_n(q^\uparrow)D^\downarrow_n(q^\downarrow)\]

with

\[J(r) = \exp\left( K_{ee}(r) \right)\]

with K, a kernel function depending only on the electron-eletron distances, and

\[q(r_i) = r_i + \sum){j\neq i} K_{BF}(r_{ij})(r_i-r_j)\]

is a backflow transformation defined by the kernel K_{BF}. Note that different transformation can be used for different orbital via the orbital_dependent_backflow option.

Args: :param mol: a QMCTorch molecule object :type mol: Molecule :param configs: defines the CI configurations to be used. Defaults to ‘ground_state’.

  • ground_state : only the ground state determinant in the wave function
  • single(n,m) : only single excitation with n electrons and m orbitals
  • single_double(n,m) : single and double excitation with n electrons and m orbitals
  • cas(n, m) : all possible configuration using n eletrons and m orbitals
Parameters:
  • kinetic (str, optional) – method to compute the kinetic energy. Defaults to ‘jacobi’. - jacobi : use the Jacobi formula to compute the kinetic energy - auto : use automatic differentiation to compute the kinetic energy
  • jastrow_kernel (JastrowKernelBase, optional) – Class that computes the jastrow kernels
  • jastrow_kernel_kwargs (dict, optional) – keyword arguments for the jastrow kernel contructor
  • backflow_kernel (BackFlowKernelBase, optional) – kernel function of the backflow transformation. - By default an inverse kernel K(r_{ij}) = w/r_{ij} is used
  • backflow_kernel_kwargs (dict, optional) – keyword arguments for the backflow kernel contructor
  • orbital_dependent_backflow (bool, optional) – every orbital has a different transformation if True. Default to False
  • cuda (bool, optional) – turns GPU ON/OFF Defaults to False.
  • include_all_mo (bool, optional) – include either all molecular orbitals or only the ones that are popualted in the configs. Defaults to False
Examples::
>>> from qmctorch.scf import Molecule
>>> from qmctorch.wavefunction import SlaterJastrowBackFlow
>>> mol = Molecule('h2o.xyz', calculator='adf', basis = 'dzp')
>>> wf = SlaterJastrowBackFlow(mol, configs='cas(2,2)')
forward(x, ao=None)[source]

computes the value of the wave function for the sampling points

\[J(R) \Psi(R) = J(R) \sum_{n} c_n D^{u}_n(r^u) \times D^{d}_n(r^d)\]
Parameters:
  • x (torch.tensor) – sampling points (Nbatch, 3*Nelec)
  • ao (torch.tensor, optional) – values of the atomic orbitals (Nbatch, Nelec, Nao)
Returns:

values of the wave functions at each sampling point (Nbatch, 1)

Return type:

torch.tensor

Examples::
>>> mol = Molecule('h2.xyz', calculator='adf', basis = 'dzp')
>>> wf = SlaterJastrow(mol, configs='cas(2,2)')
>>> pos = torch.rand(500,6)
>>> vals = wf(pos)
ao2mo(ao)[source]

transforms AO values in to MO values.

pos2mo(x, derivative=0, sum_grad=True)[source]

Compute the MO vals from the pos

Parameters:
  • x ([type]) – [description]
  • derivative (int, optional) – [description]. Defaults to 0.
  • sum_grad (bool, optional) – [description]. Defaults to True.
Returns:

[description]

Return type:

[type]

kinetic_energy_jacobi(x, **kwargs)[source]

Compute the value of the kinetic enery using the Jacobi Formula.

\[\frac{\Delta (J(R) \Psi(R))}{ J(R) \Psi(R)} = \frac{\Delta J(R)}{J(R)} + 2 \frac{\nabla J(R)}{J(R)} \frac{\nabla \Psi(R)}{\Psi(R)} + \frac{\Delta \Psi(R)}{\Psi(R)}\]

The lapacian of the determinental part is computed via

\[\Delta_i \Psi(R) \sum_n c_n ( \frac{\Delta_i D_n^{u}}{D_n^{u}} + \frac{\Delta_i D_n^{d}}{D_n^{d}} + 2 \frac{\nabla_i D_n^{u}}{D_n^{u}} \frac{\nabla_i D_n^{d}}{D_n^{d}} ) D_n^{u} D_n^{d}\]

Since the backflow orbitals are multi-electronic the laplacian of the determinants are obtained

\[\frac{\Delta det(A)}{det(A)} = Tr(A^{-1} \Delta A) + Tr(A^{-1} \nabla A) Tr(A^{-1} \nabla A) + Tr( (A^{-1} \nabla A) (A^{-1} \nabla A ))\]
Parameters:x (torch.tensor) – sampling points (Nbatch, 3*Nelec)
Returns:values of the kinetic energy at each sampling points
Return type:torch.tensor
gradients_jacobi(x, sum_grad=True)[source]

Computes the gradients of the wf using Jacobi’s Formula

Parameters:x ([type]) – [description]