qmctorch.wavefunction.orbitals.spherical_harmonics module
- class qmctorch.wavefunction.orbitals.spherical_harmonics.Harmonics(type, **kwargs)[source]
Bases:
object
Compute spherical or cartesian harmonics and their derivatives
- Parameters:
type (str) – harmonics type (cart or sph)
- Keyword Arguments:
bas_l (torch.tensor) – second quantum numbers (sph)
bas_m (torch.tensor) – third quantum numbers (sph)
bas_kx (torch.tensor) – x exponent (cart)
bas_ky (torch.tensor) – xy exponent (cart)
bas_kz (torch.tensor) – z exponent (cart)
cuda (bool) – use cuda (defaults False)
- Examples::
>>> mol = Molecule('h2.xyz') >>> harm = Harmonics(cart) >>> pos = torch.rand(100,6) >>> hvals = harm(pos) >>> dhvals = harm(pos,derivative=1)
- qmctorch.wavefunction.orbitals.spherical_harmonics.CartesianHarmonics(xyz, k, mask0, mask2, derivative=[0], sum_grad=True, sum_hess=True)[source]
Computes Real Cartesian Harmonics
\[\begin{split}Y = x^{k_x} \\times y^{k_y} \\times z^{k_z}\end{split}\]- Parameters:
xyz (torch.tensor) – distance between sampling points and orbital centers n size : (Nbatch, Nelec, Nbas, Ndim)
k (torch.tensor) – (kx,ky,kz) exponents
mask0 (torch.tensor) – precomputed mask of k=0
mask2 (torch.tensor) – precomputed mask of k=2
derivative (int, optional) – degree of the derivative. Defaults to 0.
sum_grad (bool, optional) – returns the sum of the derivative if True. Defaults to True.
sum_hess (bool, optional) – returns the sum of the 2nd derivative if True. Defaults to True.
- Returns:
values of the harmonics at the sampling points
- Return type:
torch.tensor
- qmctorch.wavefunction.orbitals.spherical_harmonics.SphericalHarmonics(xyz, l, m, derivative=0, sum_grad=True, sum_hess=True)[source]
Compute the Real Spherical Harmonics of the AO.
- Parameters:
xyz (torch.tensor) – distance between sampling points and orbital centers n size : (Nbatch, Nelec, Nbas, Ndim)
l (torch.tensor) – l quantum number
m (torch.tensor) – m quantum number
- Returns:
- value of each harmonics at each points (or derivative) n
size : (Nbatch,Nelec,Nrbf) for sum_grad=True n size : (Nbatch,Nelec,Nrbf, Ndim) for sum_grad=False
- Return type:
Y (torch.tensor)
- qmctorch.wavefunction.orbitals.spherical_harmonics.get_spherical_harmonics(xyz, lval, m, derivative)[source]
Compute the Real Spherical Harmonics of the AO.
- Parameters:
xyz (torch.tensor) – distance between sampling points and orbital centers n size : (Nbatch, Nelec, Nbas, Ndim)
l (torch.tensor) – l quantum number
m (torch.tensor) – m quantum number
- Returns:
- value of each harmonics at each points (or derivative) n
size : (Nbatch,Nelec,Nrbf)
- Return type:
Y (torch.tensor)
- qmctorch.wavefunction.orbitals.spherical_harmonics.get_grad_spherical_harmonics(xyz, lval, m)[source]
Compute the gradient of the Real Spherical Harmonics of the AO.
- Parameters:
xyz (torch.tensor) – distance between sampling points and orbital centers n size : (Nbatch, Nelec, Nbas, Ndim)
l (torch.tensor) – l quantum number
m (torch.tensor) – m quantum number
- Returns:
- value of each harmonics at each points (or derivative) n
size : (Nbatch,Nelec,Nrbf,3)
- Return type:
Y (torch.tensor)