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

Ruberhauptmann / quant-met / 14759532904

30 Apr 2025 04:31PM UTC coverage: 35.932% (-64.1%) from 100.0%
14759532904

Pull #121

github

web-flow
Merge 885831614 into df44f68e5
Pull Request #121: Start implementing sisl

4 of 44 branches covered (9.09%)

Branch coverage included in aggregate %.

61 of 166 new or added lines in 12 files covered. (36.75%)

31 existing lines in 3 files now uncovered.

102 of 251 relevant lines covered (40.64%)

1.22 hits per line

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

62.5
/src/quant_met/cli/scf.py
1
"""Functions to run self-consistent calculation for the order parameter."""
2

3
import logging
3✔
4
from pathlib import Path
3✔
5

6
from quant_met.parameters import Parameters
3✔
7

8
logger = logging.getLogger(__name__)
3✔
9

10

11
def scf(parameters: Parameters) -> None:
3✔
12
    """Self-consistent calculation for the order parameter.
13

14
    Parameters
15
    ----------
16
    parameters: Parameters
17
        An instance of Parameters containing control settings, the model,
18
        and k-point specifications for the self-consistency calculation.
19
    """
UNCOV
20
    result_path = Path(parameters.control.outdir)
×
UNCOV
21
    result_path.mkdir(exist_ok=True, parents=True)
×
22

NEW
23
    """
×
24
    solved_h = routines.self_consistency_loop(
25
        model=model,
26
        k_space_grid=np.array([1.0, 1.0]),
27
        epsilon=parameters.control.conv_treshold,
28
        max_iter=parameters.control.max_iter,
29
    )
30

31
    logger.info("Self-consistency loop completed successfully.")
32
    logger.debug("Obtained delta values: %s", solved_h.delta_orbital_basis)
33

34
    result_file = result_path / f"{parameters.control.prefix}.hdf5"
35
    solved_h.save(filename=result_file)
36
    logger.info("Results saved to %s", result_file)
37

38
    if parameters.control.calculate_additional is True:
39
        logger.info("Calculating additional things.")
40
        current = solved_h.calculate_current_density(k=k_space_grid)
41
        sf_weight_conv, sf_weight_geom = solved_h.calculate_superfluid_weight(k=k_space_grid)
42

43
        with h5py.File(result_file, "a") as f:
44
            f.attrs["current_x"] = current[0]
45
            f.attrs["current_y"] = current[1]
46
            f.attrs["sf_weight_conv_xx"] = sf_weight_conv[0, 0]
47
            f.attrs["sf_weight_conv_xy"] = sf_weight_conv[0, 1]
48
            f.attrs["sf_weight_conv_yx"] = sf_weight_conv[1, 0]
49
            f.attrs["sf_weight_conv_yy"] = sf_weight_conv[1, 1]
50
            f.attrs["sf_weight_geom_xx"] = sf_weight_geom[0, 0]
51
            f.attrs["sf_weight_geom_xy"] = sf_weight_geom[0, 1]
52
            f.attrs["sf_weight_geom_yx"] = sf_weight_geom[1, 0]
53
            f.attrs["sf_weight_geom_yy"] = sf_weight_geom[1, 1]
54

55
        logger.info("Additional results saved to %s", result_file)
56
    """
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