• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

NLESC-JCER / QMCTorch / 14791803374

02 May 2025 08:37AM UTC coverage: 83.686%. First build
14791803374

Pull #190

github

web-flow
Merge f2e5d9375 into 20fe7ebf9
Pull Request #190: Fix memory

940 of 1316 branches covered (71.43%)

Branch coverage included in aggregate %.

141 of 231 new or added lines in 21 files covered. (61.04%)

4477 of 5157 relevant lines covered (86.81%)

0.87 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

58.33
/qmctorch/wavefunction/orbitals/backflow/kernels/backflow_kernel_autodiff_inverse.py
1
import torch
1✔
2
from torch import nn
1✔
3
from .backflow_kernel_base import BackFlowKernelBase
1✔
4
from .....scf import Molecule
1✔
5

6
class BackFlowKernelAutoInverse(BackFlowKernelBase):
1✔
7
    def __init__(self, mol: Molecule, cuda: bool, weight: float = 0.0) -> None:
1✔
8
        """Compute the back flow kernel, i.e. the function
9
        f(rij) where rij is the distance between electron i and j
10
        This kernel is used in the backflow transformation
11
        .. math:
12
            q_i = r_i + \\sum_{j\\neq i} f(r_{ij}) (r_i-r_j)
13
        """
14
        super().__init__(mol, cuda)
×
NEW
15
        self.weight = nn.Parameter(torch.as_tensor([weight]))
×
16

17
    def _backflow_kernel(self, ree:torch.Tensor) -> torch.Tensor:
1✔
18
        """Computes the kernel via autodiff
19

20
        Args:
21
            ree ([type]): [description]
22

23
        Returns:
24
            [type]: [description]
25
        """
26
        eye = torch.eye(self.nelec, self.nelec).to(self.device)
×
27
        mask = torch.ones_like(ree) - eye
×
28
        return self.weight * mask * (1.0 / (ree + eye) - eye)
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc