qmctorch.wavefunction.wf_base module
- class qmctorch.wavefunction.wf_base.WaveFunction(*args: Any, **kwargs: Any)[source]
Bases:
Module
- forward(x)[source]
Compute the value of the wave function. for a multiple conformation of the electrons
- Parameters:
parameters – variational param of the wf
pos – position of the electrons
Returns: values of psi
- electronic_potential(pos)[source]
Computes the electron-electron term
- Parameters:
x (torch.tensor) – sampling points (Nbatch, 3*Nelec)
- Returns:
values of the electon-electron energy at each sampling points
- Return type:
torch.tensor
- nuclear_potential(pos)[source]
Computes the electron-nuclear term
- Parameters:
x (torch.tensor) – sampling points (Nbatch, 3*Nelec)
- Returns:
values of the electon-nuclear energy at each sampling points
- Return type:
torch.tensor
- nuclear_repulsion()[source]
Computes the nuclear-nuclear repulsion term
- Returns:
values of the nuclear-nuclear energy at each sampling points
- Return type:
torch.tensor
- gradients_autograd(pos, pdf=False)[source]
Computes the gradients of the wavefunction (or density) w.r.t the values of the pos.
- Parameters:
pos (torch.tensor) – positions of the walkers
pdf (bool, optional) – if true compute the grads of the density
- Returns:
values of the gradients
- Return type:
torch.tensor
- kinetic_energy_autograd(pos)[source]
Compute the kinetic energy through the 2nd derivative w.r.t the value of the pos.
- Parameters:
pos (torch.tensor) – positions of the walkers
- Returns:
values of nabla^2 * Psi
- local_energy(pos)[source]
Computes the local energy
\[E = K(R) + V_{ee}(R) + V_{en}(R) + V_{nn}\]- Parameters:
pos (torch.tensor) – sampling points (Nbatch, 3*Nelec)
- Returns:
values of the local enrgies at each sampling points
- 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.local_energy(pos)
Note
by default kinetic_energy refers to kinetic_energy_autograd users can overwrite it to poit to any other methods see kinetic_energy_jacobi in wf_orbital