From 3f6f877e18fc3ade4d393ea420dd4b405f3e0a4e Mon Sep 17 00:00:00 2001 From: Matteo Giantomassi Date: Fri, 31 Jul 2026 16:35:28 +0200 Subject: [PATCH 01/23] Gstore method for debugging purpose --- abipy/eph/gstore.py | 502 ++++++++++++++++++++++++++++++++++++++- abipy/flowtk/wrappers.py | 356 +++++++++++++++++++++++++++ 2 files changed, 852 insertions(+), 6 deletions(-) diff --git a/abipy/eph/gstore.py b/abipy/eph/gstore.py index c00753262..5f52f2d46 100644 --- a/abipy/eph/gstore.py +++ b/abipy/eph/gstore.py @@ -33,6 +33,10 @@ ) from abipy.tools.typing import Figure, PathLike +GSTORE_KQ_MISSING = 0 # (k, q, spin) has not been computed. +GSTORE_KQ_COMPUTED = 1 # (k, q, spin) has been computed. +GSTORE_KQ_SYMMETRIZED = 2 # (k, q, spin) has been reconstructed by symmetry. + def _allclose(arr_name, array1, array2, verbose: int, rtol=1e-5, atol=1e-8) -> bool: """ @@ -52,6 +56,62 @@ def _allclose(arr_name, array1, array2, verbose: int, rtol=1e-5, atol=1e-8) -> b return False +def _linreg_stats(x, y, wrap: bool = False) -> dict: + """ + Least-squares linear-fit descriptors for a parity plot (y vs x): slope and intercept + of y = slope*x + intercept, the Pearson correlation coefficient, and the RMSE. + + Args: + wrap: True for angle data (in degrees), which is only defined modulo 360: realigns + y to the branch closest to x (y -> x + wrap_to_180(y - x), which does not change + y's physical value) before fitting, so a point straddling the +-180 branch cut + isn't mistaken for a large disagreement. + """ + x = np.asarray(x, dtype=float).ravel() + y = np.asarray(y, dtype=float).ravel() + if wrap: + y = x + (((y - x) + 180.0) % 360.0 - 180.0) + + if x.size > 1 and x.max() > x.min(): + slope, intercept = np.polyfit(x, y, 1) + r = np.corrcoef(x, y)[0, 1] + else: + slope, intercept, r = np.nan, np.nan, np.nan + + rmse = np.sqrt(np.mean((x - y) ** 2)) if x.size > 0 else np.nan + + return dict(slope=slope, intercept=intercept, r=r, rmse=rmse, n=x.size, y=y) + + +def _add_fit_annotation(ax, x, y, xlim, wrap: bool = False, fontsize: int = 8, color: str = "C2") -> dict: + """ + Draw the least-squares linear-fit line (see :func:`_linreg_stats`) across ``xlim`` and + annotate ``ax`` with a text box reporting slope, intercept, Pearson r, RMSE, and the + number of points. ``xlim`` is taken as an explicit argument (rather than ``ax.get_xlim()``) + so the fit line spans the same range as the data regardless of plotting order/autoscaling. + + Returns the stats dict from :func:`_linreg_stats` (with the branch-realigned y, if + ``wrap=True``) in case the caller wants to reuse it. + """ + stats = _linreg_stats(x, y, wrap=wrap) + + if np.isfinite(stats["slope"]): + xs = np.array(xlim, dtype=float) + ax.plot(xs, stats["slope"] * xs + stats["intercept"], "-.", color=color, lw=1.0, zorder=4, + label=f"fit: y = {stats['slope']:.3f}x {stats['intercept']:+.3g}") + + ax.text(0.03, 0.03, + f"N = {stats['n']:,}\n" + f"slope = {stats['slope']:.4f}\n" + f"intercept = {stats['intercept']:.3g}\n" + f"Pearson r = {stats['r']:.5f}\n" + f"RMSE = {stats['rmse']:.3e}", + transform=ax.transAxes, ha="left", va="bottom", fontsize=fontsize, + bbox=dict(boxstyle="round", fc="white", ec="0.8", alpha=0.85), zorder=6) + + return stats + + class GstoreFile(AbinitNcFile, Has_Header, Has_Structure, Has_ElectronBands): """ This file stores the e-ph matrix elements produced by the EPH code of Abinit @@ -164,10 +224,11 @@ def to_string(self, verbose: int = 0) -> str: app(f"use_lgq: {self.r.use_lgq}") for spin in range(self.r.nsppol): - app(f"brange_k_spin[{spin}]: {self.r.brange_k_spin[spin]}") - app(f"brange_kq_spin[{spin}]: {self.r.brange_kq_spin[spin]}") - app(f"erange_spin[{spin}]: {self.r.erange_spin[spin]}") - app(f"glob_spin_nq[{spin}]: {self.r.glob_spin_nq[spin]}") + app(f"For {spin= }") + app(f"\tbrange_k: {self.r.brange_k_spin[spin]}") + app(f"\tbrange_kq: {self.r.brange_kq_spin[spin]}") + app(f"\terange_spin: {self.r.erange_spin[spin]}") + app(f"\tglob_spin_nq: {self.r.glob_spin_nq[spin]}") return "\n".join(lines) @@ -1043,8 +1104,7 @@ def neq(self, ref_basename: str | None = None, verbose: int = 0) -> int: return ierr - @staticmethod - def _neq_two_gstores(self: GstoreFile, gstore2: GstoreFile, verbose: int) -> int: + def _neq_two_gstores(self: GstoreRobot, gstore2: GstoreRobot, verbose: int) -> int: """ Helper function to compare two GSTORE files. """ @@ -1106,3 +1166,433 @@ def write_notebook(self, nbpath=None) -> str: # nb.cells.extend(self.get_ebands_code_cells()) return self._write_nb_nbpath(nb, nbpath) + + @add_fig_kwargs + def compare_gvals_with_reconstruction(self, ax_list=None, tol: float = 1e-6, mag_tol: float = 1e-4, + n_outliers: int = 1, use_hexbin: bool = False, bins: int = 50, + verbose: int = 0, fontsize: int = 8, + **kwargs) -> Figure: + """ + This is a debugging tool. + It reads gvals from two GSTORE files. In one case, the e-ph matrix elements + have been computed in the full BZ both for k and q. In the other + case, the gvals have been computed with k in the IBZ and q in the IBZ_k. + and then reconstructed by symmetry at the end of the run. + The goal of this method is to check that both calculations produce the same results. + by printing some statistics and producing, for each spin, a 2x2 grid of parity plots for + the e-ph matrix elements: |g| (top-left), phase of g in degrees (top-right), Re(g) + (bottom-left), and Im(g) (bottom-right). A single complex matrix element can be wrong in + different ways -- only in magnitude, only in phase, or in a way that's obvious in the + Cartesian (Re, Im) view but not in the polar (|g|, phase) one or vice versa (e.g. a small + |g| with a large phase error can still look fine in Re/Im if both components happen to + be small) -- so looking at |g1 - g2| alone, as the original version of this method did, + cannot distinguish these failure modes; all four views are needed together. + + Only the (k, q) points that were actually reconstructed by symmetry in the first file + (gstore_glob_state_kqs == GSTORE_KQ_SYMMETRIZED) are used for the statistics and the plots. + Including the directly-computed points (trivially expected to agree in both files) and + flattening the whole (glob_nq, glob_nk, natom3, nb_kq, nb_k) array, as done previously, + buries the actual test: e.g. (k, q) points that reconstruct exactly (diff ~1e-15) get + averaged together with (k, q) points that are completely wrong (diff ~O(1)) into a single + "mean |g1-g2|" scalar, and the parity plot is dominated by the many small-magnitude, + off-diagonal-like matrix elements shared by both categories, so a ~30/70 exact/wrong split + can look like an innocuous scatter around y = x. + + All four plots share the same matched/mismatched classification, based on the full complex + difference (magnitude AND phase), so a point that lands on the y = x diagonal in the + magnitude plot but is colored "mismatched" is a pure phase error, and vice versa. + Matrix elements with |g| < mag_tol (in either file) are dropped from the phase plot only, + since the phase of a near-zero complex number is numerically meaningless (Re/Im and |g| + remain well-defined, and are informative, even when |g| is tiny, so they keep every + point). Because phase is an angle, two equal phases can be reported ~360 degrees apart + across the +-180 degree branch cut; three parallel y = x, y = x - 360, y = x + 360 + reference lines are drawn so such wrapped points still show up "on the diagonal" instead + of looking like large, spurious mismatches. + + The worst matrix element(s) (largest |g1 - g2|, e.g. the "Max absolute difference" + printed below) are marked with a black-edged star in ALL FOUR plots and their location + (global q/k indices, perturbation, and bra/ket band) is printed, since with thousands of + tiny (s=1, alpha=0.3) points a lone outlier is otherwise easy to miss by eye even though + it is colored red. + + Each panel is also annotated with a least-squares linear fit (y = slope*x + intercept) + of the pooled (matched + mismatched) points, together with the Pearson correlation + coefficient and RMSE -- a quick, quantitative check on top of the visual parity (a + perfect reconstruction gives slope=1, intercept=0, r=1). For the phase panel the fit is + computed after realigning points across the +-180 degree branch cut (see ``wrap`` in + :func:`_linreg_stats`), so a physically tiny phase difference near the cut doesn't look + like a huge disagreement in the reported slope/RMSE. + + Args: + tol: Tolerance on the per-(k, q) max |g1 - g2| used to classify a symmetrized point + as an exact match. Drives the color-coding in both the magnitude and phase plots. + mag_tol: Matrix elements with |g| below this threshold (in either file) are excluded + from the phase parity plot only. + n_outliers: Number of worst matrix elements (by |g1 - g2|) to mark and print per spin. + use_hexbin: If True, render the (typically large) matched-point cloud in each panel + as a density-colored hexbin plot instead of a scatter plot -- much faster and + more legible when there are many thousands of points. Mismatched points are + always drawn as an explicit scatter overlay (in both modes) since they are the + ones worth inspecting individually. + bins: hexbin grid resolution (only used when ``use_hexbin=True``). + verbose: If > 0, print the state (gstore_glob_state_kqs) of every (spin, q, k) index. + """ + if len(self.abifiles) != 2: + raise ValueError(f"compare_gvals_with_reconstruction requires exactly 2 GSTORE files, got {len(self.abifiles)}") + + g1, g2 = self.abifiles[0], self.abifiles[1] + + if g1.nsppol != g2.nsppol: + raise ValueError("The two GSTORE files must have the same nsppol.") + + # Check dimensions are the same before plotting + for attr in ["glob_nk_spin", "glob_spin_nq"]: + if not np.array_equal(getattr(g1.r, attr), getattr(g2.r, attr)): + cprint(f"Warning: {attr} differs between {g1.basename} and {g2.basename}", "red") + + # Each spin gets its own 2x2 block of rows [2*spin, 2*spin+1]: top row is |g| (col 0) + # and phase (col 1); bottom row is Re(g) (col 0) and Im(g) (col 1). Scales differ a lot + # across the four (linear magnitude/Re/Im vs degrees in [-180, 180]) so axes aren't shared. + ax_mat, fig, plt = get_axarray_fig_plt( + ax_list, nrows=2 * g1.nsppol, ncols=2, sharex=False, sharey=False, squeeze=False, rescale_fig=True + ) + + # Read internal table with the state of (k, q, spin). Shape: (nsppol, glob_nq, glob_nk). + state1_kqs = g1.r.read_value("gstore_glob_state_kqs") + state2_kqs = g2.r.read_value("gstore_glob_state_kqs") + + if verbose: + print("state1_kqs vs state2_kqs") + for idx in np.ndindex(state1_kqs.shape): + print(f"{idx}: {state1_kqs[idx]} {state2_kqs[idx]}") + + for spin in range(g1.nsppol): + gvals1 = g1.gqk_spin[spin].gvals + gvals2 = g2.gqk_spin[spin].gvals + + if gvals1.shape != gvals2.shape: + raise ValueError(f"Shape mismatch for spin {spin}: {gvals1.shape} vs {gvals2.shape}") + + sym_mask = state1_kqs[spin] == GSTORE_KQ_SYMMETRIZED # (glob_nq, glob_nk) + n_sym = int(sym_mask.sum()) + if n_sym == 0: + cprint(f"Spin {spin}: no GSTORE_KQ_SYMMETRIZED (k, q) points found, skipping.", "yellow") + continue + + gvals1_sym = gvals1[sym_mask] # (n_sym, natom3, nb_kq, nb_k) + gvals2_sym = gvals2[sym_mask] + + abs_diff = np.abs(gvals1_sym - gvals2_sym) + max_abs_diff = np.max(abs_diff) + mean_abs_diff = np.mean(abs_diff) + + # Classify each symmetrized (k, q) point on its own worst matrix element. + # This is what actually reveals whether the reconstruction works or not. + per_point_maxdiff = np.max(abs_diff.reshape(n_sym, -1), axis=1) + is_ok = per_point_maxdiff < tol + n_ok = int(np.sum(is_ok)) + + print(f"Spin {spin}: {n_sym} symmetrized (k, q) points " + f"(out of {sym_mask.size} total).") + print(f" Exact matches (per-point max|g1-g2| < {tol:.1e}): " + f"{n_ok}/{n_sym} ({100 * n_ok / n_sym:.1f}%)") + print(f" Max absolute difference |g1 - g2|: {max_abs_diff:.4e}") + print(f" Mean absolute difference |g1 - g2|: {mean_abs_diff:.4e}") + + # Broadcast the per-(k, q) pass/fail flag to every matrix element of that point so + # the split found above is visible in both parity plots. + point_size = gvals1_sym[0].size + matched = np.repeat(is_ok, point_size) + x = np.abs(gvals1_sym).flatten() + y = np.abs(gvals2_sym).flatten() + + # Locate and report the n_outliers matrix elements with the largest |g1 - g2| (flat + # index into abs_diff/x/y/phase1/phase2, which all share abs_diff's element order). + n_show = min(n_outliers, abs_diff.size) + flat_diff = abs_diff.ravel() + outlier_idx = np.argpartition(flat_diff, -n_show)[-n_show:] + outlier_idx = outlier_idx[np.argsort(-flat_diff[outlier_idx])] + sym_qk = np.argwhere(sym_mask) # (n_sym, 2): row i --> (iq_g, ik_g) of gvals*_sym[i] + + for rank, flat_idx in enumerate(outlier_idx, start=1): + i_sym, mu_o, m_o, n_o = np.unravel_index(flat_idx, abs_diff.shape) + iq_g_o, ik_g_o = sym_qk[i_sym] + print(f" Outlier #{rank}: |g1-g2|={flat_diff[flat_idx]:.4e} at " + f"(iq_g={iq_g_o}, ik_g={ik_g_o}, mu={mu_o}, bra_band={m_o}, ket_band={n_o}) " + f"[|g1|={x[flat_idx]:.4e}, |g2|={y[flat_idx]:.4e}]") + + def mark_outliers(ax, valx, valy): + """Star + rank-label the n_show worst matrix elements on ax (shared closure state).""" + ax.scatter(valx[outlier_idx], valy[outlier_idx], s=100, marker="*", facecolors="yellow", + edgecolors="black", linewidths=0.8, zorder=5, label=f"worst {n_show} pt(s)") + for rank, flat_idx in enumerate(outlier_idx, start=1): + ax.annotate(str(rank), (valx[flat_idx], valy[flat_idx]), textcoords="offset points", + xytext=(4, 4), fontsize=fontsize, fontweight="bold", zorder=6) + + # --- Magnitude parity plot -------------------------------------------------- + ax = ax_mat[2 * spin, 0] + + max_val = max(np.max(x), np.max(y)) if len(x) > 0 else 1.0 + + if use_hexbin: + # Density-colored hexbin for the (typically large) full point cloud -- much + # faster to render/save than a per-point scatter. Mismatched points are still + # drawn explicitly on top so they remain individually visible. + h = ax.hexbin(x, y, gridsize=bins, cmap="Blues", mincnt=1, bins="log", + extent=(0, max_val, 0, max_val)) + fig.colorbar(h, ax=ax, shrink=0.85).set_label("point count (log)", fontsize=fontsize) + ax.scatter(x[~matched], y[~matched], s=4, alpha=0.6, color="C3", + label=f"mismatched (k,q): {n_sym - n_ok}/{n_sym}", zorder=4) + else: + # Use rasterized=True to keep vector graphics small if many points + ax.scatter(x[matched], y[matched], s=1, alpha=0.3, rasterized=True, color="C0", + label=f"matched (k,q): {n_ok}/{n_sym}") + ax.scatter(x[~matched], y[~matched], s=1, alpha=0.3, rasterized=True, color="C3", + label=f"mismatched (k,q): {n_sym - n_ok}/{n_sym}") + + ax.plot([0, max_val], [0, max_val], 'k--', lw=0.5, label="y = x") + mark_outliers(ax, x, y) + _add_fit_annotation(ax, x, y, xlim=(0, max_val), fontsize=fontsize) + + ax.set_xlabel(f"$|g|$ from {g1.basename}", fontsize=fontsize) + ax.set_ylabel(f"$|g|$ from {g2.basename}", fontsize=fontsize) + ax.set_title(f"Spin {spin}: |g| parity, symmetrized (k,q) only", fontsize=fontsize) + ax.legend(fontsize=fontsize, loc="lower right") + ax.set_xlim(0, max_val) + ax.set_ylim(0, max_val) + ax.set_aspect("equal", adjustable="box") + + # --- Phase parity plot ------------------------------------------------------- + ax = ax_mat[2 * spin, 1] + + # Phase is meaningless noise when |g| ~ 0 in either file: drop those points here only. + has_signal = (x > mag_tol) | (y > mag_tol) + phase_matched = matched & has_signal + phase_mismatched = (~matched) & has_signal + n_signal = int(np.sum(has_signal)) + + phase1 = np.degrees(np.angle(gvals1_sym)).flatten() + phase2 = np.degrees(np.angle(gvals2_sym)).flatten() + + if use_hexbin: + if n_signal > 0: + # hexbin/colorbar choke on a fully-empty array (can happen if mag_tol + # filters out every point), so only call it when there's something to bin. + h = ax.hexbin(phase1[has_signal], phase2[has_signal], gridsize=bins, cmap="Blues", + mincnt=1, bins="log", extent=(-180, 180, -180, 180)) + fig.colorbar(h, ax=ax, shrink=0.85).set_label("point count (log)", fontsize=fontsize) + else: + ax.text(0.5, 0.5, f"no points with |g| > {mag_tol:.0e}", transform=ax.transAxes, + ha="center", va="center", fontsize=fontsize, color="0.5") + ax.scatter(phase1[phase_mismatched], phase2[phase_mismatched], s=4, alpha=0.6, + color="C3", label=f"mismatched (k,q): {n_sym - n_ok}/{n_sym}", zorder=4) + else: + ax.scatter(phase1[phase_matched], phase2[phase_matched], s=1, alpha=0.3, rasterized=True, + color="C0", label=f"matched (k,q): {n_ok}/{n_sym}") + ax.scatter(phase1[phase_mismatched], phase2[phase_mismatched], s=1, alpha=0.3, rasterized=True, + color="C3", label=f"mismatched (k,q): {n_sym - n_ok}/{n_sym}") + + # +-360 deg helper lines so points wrapped across the +-180 deg branch cut still + # land "on the diagonal" instead of looking like spurious large mismatches. + for offset, ref_label in ((0, "y = x"), (-360, None), (360, None)): + ax.plot([-180, 180], [-180 + offset, 180 + offset], 'k--', lw=0.5, label=ref_label) + mark_outliers(ax, phase1, phase2) + _add_fit_annotation(ax, phase1[has_signal], phase2[has_signal], xlim=(-180, 180), + wrap=True, fontsize=fontsize) + + ax.set_xlim(-180, 180) + ax.set_ylim(-180, 180) + ax.set_xlabel(f"phase(g) [deg] from {g1.basename}", fontsize=fontsize) + ax.set_ylabel(f"phase(g) [deg] from {g2.basename}", fontsize=fontsize) + ax.set_title(f"Spin {spin}: phase parity (|g| > {mag_tol:.0e}, {n_signal} pts)", fontsize=fontsize) + ax.legend(fontsize=fontsize, loc="lower right") + ax.set_aspect("equal", adjustable="box") + + # --- Re(g) parity plot ------------------------------------------------------- + ax = ax_mat[2 * spin + 1, 0] + real1 = gvals1_sym.real.flatten() + real2 = gvals2_sym.real.flatten() + + lim = max(np.max(np.abs(real1)), np.max(np.abs(real2))) if len(real1) > 0 else 1.0 + + if use_hexbin: + h = ax.hexbin(real1, real2, gridsize=bins, cmap="Blues", mincnt=1, bins="log", + extent=(-lim, lim, -lim, lim)) + fig.colorbar(h, ax=ax, shrink=0.85).set_label("point count (log)", fontsize=fontsize) + ax.scatter(real1[~matched], real2[~matched], s=4, alpha=0.6, color="C3", + label=f"mismatched (k,q): {n_sym - n_ok}/{n_sym}", zorder=4) + else: + ax.scatter(real1[matched], real2[matched], s=1, alpha=0.3, rasterized=True, color="C0", + label=f"matched (k,q): {n_ok}/{n_sym}") + ax.scatter(real1[~matched], real2[~matched], s=1, alpha=0.3, rasterized=True, color="C3", + label=f"mismatched (k,q): {n_sym - n_ok}/{n_sym}") + + ax.plot([-lim, lim], [-lim, lim], 'k--', lw=0.5, label="y = x") + mark_outliers(ax, real1, real2) + _add_fit_annotation(ax, real1, real2, xlim=(-lim, lim), fontsize=fontsize) + + ax.set_xlim(-lim, lim) + ax.set_ylim(-lim, lim) + ax.set_xlabel(f"Re(g) from {g1.basename}", fontsize=fontsize) + ax.set_ylabel(f"Re(g) from {g2.basename}", fontsize=fontsize) + ax.set_title(f"Spin {spin}: Re(g) parity", fontsize=fontsize) + ax.legend(fontsize=fontsize, loc="lower right") + ax.set_aspect("equal", adjustable="box") + + # --- Im(g) parity plot ------------------------------------------------------- + ax = ax_mat[2 * spin + 1, 1] + imag1 = gvals1_sym.imag.flatten() + imag2 = gvals2_sym.imag.flatten() + + lim = max(np.max(np.abs(imag1)), np.max(np.abs(imag2))) if len(imag1) > 0 else 1.0 + + if use_hexbin: + h = ax.hexbin(imag1, imag2, gridsize=bins, cmap="Blues", mincnt=1, bins="log", + extent=(-lim, lim, -lim, lim)) + fig.colorbar(h, ax=ax, shrink=0.85).set_label("point count (log)", fontsize=fontsize) + ax.scatter(imag1[~matched], imag2[~matched], s=4, alpha=0.6, color="C3", + label=f"mismatched (k,q): {n_sym - n_ok}/{n_sym}", zorder=4) + else: + ax.scatter(imag1[matched], imag2[matched], s=1, alpha=0.3, rasterized=True, color="C0", + label=f"matched (k,q): {n_ok}/{n_sym}") + ax.scatter(imag1[~matched], imag2[~matched], s=1, alpha=0.3, rasterized=True, color="C3", + label=f"mismatched (k,q): {n_sym - n_ok}/{n_sym}") + + ax.plot([-lim, lim], [-lim, lim], 'k--', lw=0.5, label="y = x") + mark_outliers(ax, imag1, imag2) + _add_fit_annotation(ax, imag1, imag2, xlim=(-lim, lim), fontsize=fontsize) + + ax.set_xlim(-lim, lim) + ax.set_ylim(-lim, lim) + ax.set_xlabel(f"Im(g) from {g1.basename}", fontsize=fontsize) + ax.set_ylabel(f"Im(g) from {g2.basename}", fontsize=fontsize) + ax.set_title(f"Spin {spin}: Im(g) parity", fontsize=fontsize) + ax.legend(fontsize=fontsize, loc="lower right") + ax.set_aspect("equal", adjustable="box") + + return fig + + def compare_gvals_gauge_invariant(self, tol: float = 1e-6, deg_tol: float = 1e-4, verbose: int = 0) -> None: + """ + Gauge-invariant counterpart of ``compare_gvals_with_reconstruction``. + + Individual g_{mn} matrix elements are only defined up to an arbitrary unitary + rotation within each degenerate subspace at k (the n/ket index) and at k+q + (the m/bra index): the analytic reconstruction formula used by gstore_symmetrize + assumes this rotation is the identity, which is exact for isolated non-degenerate + bands but not for degenerate ones. Comparing raw matrix elements therefore flags + many "mismatches" that are not bugs, just a different (equally valid) choice of + basis within a degenerate block. + + This method groups the bra/ket bands into degenerate multiplets (using the IBZ + eigenvalues) and, for each (bra-multiplet, ket-multiplet, perturbation) block, + compares the singular values of the corresponding sub-matrix of g(k,q) instead of + its raw elements. Singular values are invariant under G -> U G V^dagger for any + unitary U, V, i.e. under independent gauge rotations of the bra and ket subspaces, + while still being fully sensitive to genuine errors (including phase errors for + non-degenerate, i.e. 1x1, blocks). + + Args: + tol: Tolerance on the per-(k, q) max singular-value difference used to classify + a symmetrized point as an exact match. + deg_tol: Energy tolerance (eV) used to group bands into degenerate multiplets. + verbose: If > 0, print per-point diagnostics. + """ + if len(self.abifiles) != 2: + raise ValueError(f"compare_gvals_gauge_invariant requires exactly 2 GSTORE files, got {len(self.abifiles)}") + + g1, g2 = self.abifiles[0], self.abifiles[1] + + if g1.nsppol != g2.nsppol: + raise ValueError("The two GSTORE files must have the same nsppol.") + + def find_multiplets(energies: np.ndarray, etol: float) -> list: + """Group band indices (local, 0-based) into degenerate multiplets.""" + order = np.argsort(energies) + groups = [[int(order[0])]] + for i in range(1, len(order)): + if abs(energies[order[i]] - energies[order[i - 1]]) < etol: + groups[-1].append(int(order[i])) + else: + groups.append([int(order[i])]) + return groups + + for spin in range(g1.nsppol): + gqk1, gqk2 = g1.gqk_spin[spin], g2.gqk_spin[spin] + gvals1, gvals2 = gqk1.gvals, gqk2.gvals + + if gvals1.shape != gvals2.shape: + raise ValueError(f"Shape mismatch for spin {spin}: {gvals1.shape} vs {gvals2.shape}") + + state1_kqs = g1.r.read_value("gstore_glob_state_kqs") + sym_mask = state1_kqs[spin] == GSTORE_KQ_SYMMETRIZED # (glob_nq, glob_nk) + if not np.any(sym_mask): + cprint(f"Spin {spin}: no GSTORE_KQ_SYMMETRIZED (k, q) points found, skipping.", "yellow") + continue + + r = g1.r + eigens_ibz = r.read_value("eigenvalues") * 27.211386245988 # Ha --> eV, indexed like r.kibz. + bstart_k, nb_k = gqk1.bstart_k, gqk1.nb_k + bstart_kq, nb_kq = gqk1.bstart_kq, gqk1.nb_kq + + kbz, kbz2ibz, kglob2bz = r.kbz, r.kbz2ibz, r.kglob2bz[spin] + qbz, qglob2bz = r.qbz, r.qglob2bz[spin] + + n_multiplet_cache, m_multiplet_cache = {}, {} + + def get_multiplets(cache: dict, ik_ibz: int, bstart: int, nb: int) -> list: + if ik_ibz not in cache: + e = eigens_ibz[spin, ik_ibz, bstart:bstart + nb] + cache[ik_ibz] = find_multiplets(e, deg_tol) + return cache[ik_ibz] + + def find_kbz_index(kpt: np.ndarray) -> int: + diffs = kbz - kpt[None, :] + diffs -= np.round(diffs) + idx = np.where(np.all(np.abs(diffs) < 1e-6, axis=1))[0] + if len(idx) == 0: + raise ValueError(f"Cannot locate k-point {kpt} in the kbz mesh") + return int(idx[0]) + + natom3 = gvals1.shape[2] + per_point_maxdiff = [] + + for ik_g in range(gqk1.glob_nk): + ik_bz = kglob2bz[ik_g] + ik_ibz = kbz2ibz[ik_bz, 0] + kpt = kbz[ik_bz] + n_mult = get_multiplets(n_multiplet_cache, ik_ibz, bstart_k, nb_k) + + for iq_g in range(gqk1.glob_nq): + if not sym_mask[iq_g, ik_g]: + continue + + qpt = qbz[qglob2bz[iq_g]] + ikq_bz = find_kbz_index(kpt + qpt) + ikq_ibz = kbz2ibz[ikq_bz, 0] + m_mult = get_multiplets(m_multiplet_cache, ikq_ibz, bstart_kq, nb_kq) + + worst = 0.0 + for mu in range(natom3): + G1, G2 = gvals1[iq_g, ik_g, mu], gvals2[iq_g, ik_g, mu] + for mb in m_mult: + for nb_ in n_mult: + block1 = G1[np.ix_(mb, nb_)] + block2 = G2[np.ix_(mb, nb_)] + sv1 = np.linalg.svd(block1, compute_uv=False) + sv2 = np.linalg.svd(block2, compute_uv=False) + worst = max(worst, float(np.max(np.abs(sv1 - sv2)))) + + per_point_maxdiff.append(worst) + if verbose and worst >= tol: + print(f" spin={spin} ik_g={ik_g} iq_g={iq_g}: max singular-value diff = {worst:.4e}") + + per_point_maxdiff = np.array(per_point_maxdiff) + n_tot = len(per_point_maxdiff) + n_ok = int(np.sum(per_point_maxdiff < tol)) + + print(f"Spin {spin}: {n_tot} symmetrized (k, q) points (out of {sym_mask.size} total).") + print(f" Gauge-invariant exact matches (per-point max singular-value diff < {tol:.1e}): " + f"{n_ok}/{n_tot} ({100 * n_ok / n_tot:.1f}%)") + print(f" Max singular-value difference: {per_point_maxdiff.max():.4e}") + print(f" Mean singular-value difference: {per_point_maxdiff.mean():.4e}") diff --git a/abipy/flowtk/wrappers.py b/abipy/flowtk/wrappers.py index 58229c9ec..2bdf9f702 100644 --- a/abipy/flowtk/wrappers.py +++ b/abipy/flowtk/wrappers.py @@ -9,6 +9,9 @@ from monty.string import list_strings from abipy.core.globals import get_workdir +from abipy.tools.numtools import data_from_cplx_mode +from abipy.tools.plotting import add_fig_kwargs +from abipy.tools.typing import Figure __author__ = "Matteo Giantomassi" __copyright__ = "Copyright 2013, The Materials Project" @@ -314,6 +317,359 @@ def merge(self, workdir, pot_files, out_dvdb, delete_source=True) -> str: return out_dvdb + def test_ftinterp(self, dvdb_path, ngqpt, workdir=None, coarse_ngqpt=None, ddb_path="", + dvdb_add_lr=1, rspace_cell=0, symv1scf=0, qdamp=0.1, potfile=None) -> str: + """ + Execute ``mrgdv test_ftinterp`` to test the Fourier interpolation of the DFPT + potentials stored in the DVDB file ``dvdb_path``, dumping the ab-initio and + interpolated V1(r) to a netcdf file for further analysis (see also + :meth:`plot_ftinterp_parity`). + + Args: + dvdb_path: Path to the input DVDB file. + ngqpt: [nx, ny, nz] divisions of the ab-initio q-mesh used to build the DVDB. + workdir: Working directory. If None, a temporary directory is created. + coarse_ngqpt: Optional [nx, ny, nz] coarser sub-mesh, commensurate with ``ngqpt`` + (its IBZ q-points must already be present in the DVDB). If given, also + Fourier-interpolates from this coarser mesh and compares against the literal + (ab-initio) values at every q-point of the dense ``ngqpt`` mesh -- this is the + actual interpolation-accuracy test. If None, only the native-mesh + self-consistency round-trip is performed. + ddb_path: Optional path to a DDB file with Born effective charges/dielectric + tensor, needed to activate the long-range term in the interpolation. + dvdb_add_lr: 1 to include the long-range term (requires ``ddb_path``), 0 to disable it. + rspace_cell: 0 for the default real-space box, 1 for the Wigner-Seitz cell construction. + symv1scf: Symmetrize the interpolated potentials (0, 1 or 2). + qdamp: Gaussian damping parameter for the long-range term. + potfile: Path to the output netcdf file with ab-initio/interpolated V1(r). + If None, a default name is used inside ``workdir``. + + Return: absolute path to the netcdf file with the ab-initio/interpolated potentials. + """ + workdir = get_workdir(workdir) + os.makedirs(workdir, exist_ok=True) + + dvdb_path = os.path.abspath(dvdb_path) + if ddb_path: + ddb_path = os.path.abspath(ddb_path) + + if potfile is None: + potfile = os.path.basename(dvdb_path) + "_FTINTERP.nc" + if not os.path.isabs(potfile): + potfile = os.path.join(os.path.abspath(workdir), potfile) + + # --coarse-ngqpt must always be passed on the command line (even as 0 0 0 to mean + # "disabled") due to how mrgdv's CLI parser handles `want_len` for this option. + coarse_ngqpt = [0, 0, 0] if coarse_ngqpt is None else list(coarse_ngqpt) + + exec_args = [ + "test_ftinterp", dvdb_path, + "--ngqpt", *(str(n) for n in ngqpt), + "--coarse-ngqpt", *(str(n) for n in coarse_ngqpt), + "--dvdb-add-lr", str(dvdb_add_lr), + "--rspace_cell", str(rspace_cell), + "--symv1scf", str(symv1scf), + "--qdamp", str(qdamp), + "--potfile", potfile, + ] + if ddb_path: + exec_args += ["--ddb-path", ddb_path] + + self.stdin_fname = None + self.stdout_fname, self.stderr_fname = map( + os.path.join, 2 * [workdir], ["test_ftinterp.stdout", "test_ftinterp.stderr"]) + + if retcode := self.execute(workdir, exec_args=exec_args): + print("stdout:\n", self.stdout_data) + print("stderr:\n", self.stderr_data) + raise RuntimeError(f"Error while running mrgdv test_ftinterp in {workdir}") + + return potfile + + @add_fig_kwargs + def plot_ftinterp_parity(self, dvdb_path, ngqpt, workdir=None, coarse_ngqpt=None, ddb_path="", + dvdb_add_lr=1, rspace_cell=0, symv1scf=0, qdamp=0.1, potfile=None, + group=None, min_mag_frac=1e-6, bins=200, **kwargs) -> Figure: + """ + Run :meth:`test_ftinterp` and produce a two-panel parity plot comparing ab-initio and + Fourier-interpolated V1(r): |V1(r)| (log-log) and arg(V1(r)) (radians), both ab-initio + (x-axis) vs interpolated (y-axis), as density-colored hexbins with a y=x reference line. + + Args: + dvdb_path, ngqpt, workdir, coarse_ngqpt, ddb_path, dvdb_add_lr, rspace_cell, + symv1scf, qdamp, potfile: See :meth:`test_ftinterp`. + group: "self" (native-mesh round-trip) or "coarse" (the real accuracy test, + requires ``coarse_ngqpt``). If None, defaults to "coarse" if ``coarse_ngqpt`` + is given, else "self". + min_mag_frac: Both panels exclude points with |V1_abinitio| below this fraction of + max|V1_abinitio|: such points are dominated by FFT/roundoff noise rather than + real signal, and phase is meaningless there. + bins: hexbin grid resolution. + + Return: |matplotlib-Figure| + """ + potfile = self.test_ftinterp(dvdb_path, ngqpt, workdir=workdir, coarse_ngqpt=coarse_ngqpt, + ddb_path=ddb_path, dvdb_add_lr=dvdb_add_lr, rspace_cell=rspace_cell, + symv1scf=symv1scf, qdamp=qdamp, potfile=potfile) + + if group is None: + group = "coarse" if coarse_ngqpt is not None else "self" + + import matplotlib.pyplot as plt + + from abipy.iotools import ETSF_Reader + + with ETSF_Reader(potfile) as r: + # (nqpt, natom3, nspden, nfft) -- keep the block structure for the vdiff stats below. + ai_c = r.read_value(f"{group}_v1r_abinitio", cmode="c") + it_c = r.read_value(f"{group}_v1r_interp", cmode="c") + + # Global: pool every point into one L1-relative-error norm over the whole dataset + # (sum|f1-f2| / sum|f2|) -- complements Pearson r, which stays close to 1 even under + # large relative errors because it is dominated by the largest-magnitude points. + global_stats = _vdiff_stats(ai_c.ravel(), it_c.ravel()) + + # Worst single (iqpt, iatom3, ispden) perturbation: reproduces exactly what `mrgdv + # test_ftinterp` itself prints as "Max values over q-points and perturbations". + nfft = ai_c.shape[-1] + block_stats = _vdiff_stats(ai_c.reshape(-1, nfft), it_c.reshape(-1, nfft), axis=-1) + worst_stats = {k: v.max() for k, v in block_stats.items()} + + ai_c, it_c = ai_c.ravel(), it_c.ravel() + mag_ai = data_from_cplx_mode("abs", ai_c) + mag_it = data_from_cplx_mode("abs", it_c) + ang_ai = data_from_cplx_mode("angle", ai_c) + ang_it = data_from_cplx_mode("angle", it_c) + + # Drop the FFT/roundoff noise floor -- see docstring of `min_mag_frac`. + keep = mag_ai >= min_mag_frac * mag_ai.max() + + fig, axes = plt.subplots(1, 2, figsize=(11, 5.6)) + + _hexbin_parity(axes[0], mag_ai[keep], mag_it[keep], bins, log=True, + label=f"|V1(r)| ({group}, |V1|>{min_mag_frac:g}*max)") + axes[0].set_xlabel("ab-initio |V1(r)| (Ha)") + axes[0].set_ylabel("interpolated |V1(r)| (Ha)") + + _hexbin_parity(axes[1], ang_ai[keep], ang_it[keep], bins, log=False, wrap=True, + label=f"arg(V1(r)) ({group}, |V1|>{min_mag_frac:g}*max)") + axes[1].set_xlabel("ab-initio arg(V1(r)) (rad)") + axes[1].set_ylabel("interpolated arg(V1(r)) (rad, branch-aligned)") + + def fmt_row(row_label, s): + return (f"{row_label}: L1_rerr={100*s['l1_rerr']:.2f}% mean|diff|={s['mean_adiff']:.3e} " + f"max|diff|={s['max_adiff']:.3e} stdev|diff|={s['stdev_adiff']:.3e}") + + fig.text(0.5, 0.02, + "V1(r) complex-valued error (ABINIT's vdiff_t convention, L1_rerr = sum|f1-f2| / sum|f2|):\n" + + fmt_row("global, all points pooled ", global_stats) + "\n" + + fmt_row("worst single perturbation (=mrgdv)", worst_stats), + ha="center", va="bottom", fontsize=8, family="monospace") + + fig.suptitle(os.path.basename(potfile)) + fig.tight_layout(rect=[0, 0.14, 1, 0.96]) + + return fig + + def test_symcheck(self, dvdb_path, ngqpt, qpt, workdir=None, ddb_path="", dvdb_add_lr=1, + rspace_cell=0, symv1scf=0, qdamp=0.1, potfile=None) -> str: + """ + Execute ``mrgdv test_symcheck`` to test CROSS-Q-POINT symmetry consistency of the + Fourier interpolation: interpolate at ``qpt`` and, independently, at ``S.qpt`` for + every symmetry ``S`` of the crystal (both directions of time reversal), and compare + against the prediction obtained by rotating the ``qpt`` interpolation with + ``v1phq_rotate`` -- the same formula used throughout ABINIT to expand an IBZ q-point + to the full BZ. Unlike :meth:`test_ftinterp`, this never touches literal/ab-initio + data: both sides being compared are themselves Fourier-interpolated, so it isolates + whether the interpolation is internally consistent with the crystal's own symmetry, + as opposed to :meth:`test_ftinterp`'s literal-ground-truth accuracy question. Dumps + the two compared quantities to a netcdf file for further analysis (see also + :meth:`plot_symcheck_parity`). + + Args: + dvdb_path: Path to the input DVDB file. + ngqpt: [nx, ny, nz] divisions of the ab-initio q-mesh used to build the DVDB. + qpt: [qx, qy, qz] source q-point (reduced coordinates). Need not be on the + ab-initio mesh -- interpolating it is itself a genuine off-grid test. + workdir: Working directory. If None, a temporary directory is created. + ddb_path, dvdb_add_lr, rspace_cell, symv1scf, qdamp: See :meth:`test_ftinterp`. + potfile: Path to the output netcdf file. If None, a default name is used inside + ``workdir``. + + Return: absolute path to the netcdf file with the target/predicted potentials. + """ + workdir = get_workdir(workdir) + os.makedirs(workdir, exist_ok=True) + + dvdb_path = os.path.abspath(dvdb_path) + if ddb_path: + ddb_path = os.path.abspath(ddb_path) + + if potfile is None: + potfile = os.path.basename(dvdb_path) + "_SYMCHECK.nc" + if not os.path.isabs(potfile): + potfile = os.path.join(os.path.abspath(workdir), potfile) + + exec_args = [ + "test_symcheck", dvdb_path, + "--ngqpt", *(str(n) for n in ngqpt), + "--qpt", *(str(q) for q in qpt), + "--dvdb-add-lr", str(dvdb_add_lr), + "--rspace_cell", str(rspace_cell), + "--symv1scf", str(symv1scf), + "--qdamp", str(qdamp), + "--potfile", potfile, + ] + if ddb_path: + exec_args += ["--ddb-path", ddb_path] + + self.stdin_fname = None + self.stdout_fname, self.stderr_fname = map( + os.path.join, 2 * [workdir], ["test_symcheck.stdout", "test_symcheck.stderr"]) + + if retcode := self.execute(workdir, exec_args=exec_args): + print("stdout:\n", self.stdout_data) + print("stderr:\n", self.stderr_data) + raise RuntimeError(f"Error while running mrgdv test_symcheck in {workdir}") + + return potfile + + @add_fig_kwargs + def plot_symcheck_parity(self, dvdb_path, ngqpt, qpt, workdir=None, ddb_path="", dvdb_add_lr=1, + rspace_cell=0, symv1scf=0, qdamp=0.1, potfile=None, + min_mag_frac=1e-6, bins=200, **kwargs) -> Figure: + """ + Run :meth:`test_symcheck` and produce a two-panel parity plot: |V1(r)| (log-log) and + arg(V1(r)) (radians), independently-interpolated target (x-axis) vs the + `v1phq_rotate`-predicted value from the source q-point (y-axis), pooled over every + symmetry operation and both signs of time reversal, as density-colored hexbins with + a y=x reference line. + + Args: + dvdb_path, ngqpt, qpt, workdir, ddb_path, dvdb_add_lr, rspace_cell, symv1scf, + qdamp, potfile: See :meth:`test_symcheck`. + min_mag_frac: Both panels exclude points with |V1_target| below this fraction of + max|V1_target|: such points are dominated by FFT/roundoff noise rather than + real signal, and phase is meaningless there. + bins: hexbin grid resolution. + + Return: |matplotlib-Figure| + """ + potfile = self.test_symcheck(dvdb_path, ngqpt, qpt, workdir=workdir, ddb_path=ddb_path, + dvdb_add_lr=dvdb_add_lr, rspace_cell=rspace_cell, + symv1scf=symv1scf, qdamp=qdamp, potfile=potfile) + + import matplotlib.pyplot as plt + + from abipy.iotools import ETSF_Reader + + with ETSF_Reader(potfile) as r: + # (nsym, ntimrev, natom3, nspden, nfft) -- keep the block structure for vdiff stats. + pred_c = r.read_value("v1r_predicted", cmode="c") + tgt_c = r.read_value("v1r_target", cmode="c") + + # f1=predicted, f2=target, matching dvdb_test_symcheck's own `vd%eval` argument order + # (Fortran's L1_rerr is normalized by f2) so these numbers match mrgdv's own stdout. + global_stats = _vdiff_stats(pred_c.ravel(), tgt_c.ravel()) + nfft = pred_c.shape[-1] + block_stats = _vdiff_stats(pred_c.reshape(-1, nfft), tgt_c.reshape(-1, nfft), axis=-1) + worst_stats = {k: v.max() for k, v in block_stats.items()} + + pred_c, tgt_c = pred_c.ravel(), tgt_c.ravel() + mag_pred, mag_tgt = data_from_cplx_mode("abs", pred_c), data_from_cplx_mode("abs", tgt_c) + ang_pred, ang_tgt = data_from_cplx_mode("angle", pred_c), data_from_cplx_mode("angle", tgt_c) + + # Drop the FFT/roundoff noise floor -- see docstring of `min_mag_frac`. + keep = mag_tgt >= min_mag_frac * mag_tgt.max() + + fig, axes = plt.subplots(1, 2, figsize=(11, 5.6)) + + _hexbin_parity(axes[0], mag_tgt[keep], mag_pred[keep], bins, log=True, + label=f"|V1(r)| (|V1|>{min_mag_frac:g}*max)") + axes[0].set_xlabel("independent interp. (target) |V1(r)| (Ha)") + axes[0].set_ylabel("v1phq_rotate prediction |V1(r)| (Ha)") + + _hexbin_parity(axes[1], ang_tgt[keep], ang_pred[keep], bins, log=False, wrap=True, + label=f"arg(V1(r)) (|V1|>{min_mag_frac:g}*max)") + axes[1].set_xlabel("independent interp. (target) arg(V1(r)) (rad)") + axes[1].set_ylabel("v1phq_rotate prediction arg(V1(r)) (rad, branch-aligned)") + + def fmt_row(row_label, s): + return (f"{row_label}: L1_rerr={100*s['l1_rerr']:.2f}% mean|diff|={s['mean_adiff']:.3e} " + f"max|diff|={s['max_adiff']:.3e} stdev|diff|={s['stdev_adiff']:.3e}") + + fig.text(0.5, 0.02, + "V1(r) complex-valued error (ABINIT's vdiff_t convention, L1_rerr = sum|predicted-target| / sum|target|):\n" + + fmt_row("global, all (isym, itimrev) pooled ", global_stats) + "\n" + + fmt_row("worst single (isym, itimrev) (=mrgdv)", worst_stats), + ha="center", va="bottom", fontsize=8, family="monospace") + + fig.suptitle(os.path.basename(potfile)) + fig.tight_layout(rect=[0, 0.14, 1, 0.96]) + + return fig + + +def _vdiff_stats(f1, f2, axis=-1) -> dict: + """ + Reproduce ABINIT's own ``vdiff_t%eval`` (``m_numeric_tools.F90``) error estimators -- the + same ones printed by ``mrgdv test_ftinterp`` itself -- from complex arrays ``f1`` + (ab-initio) and ``f2`` (interpolated), reducing over ``axis``. ``l1_rerr`` is normalized + by ``|f2|`` (the INTERPOLATED array), matching the Fortran convention exactly (verified + against ``mrgdv``'s own printed output: the block-wise max reproduces it to 5 sig figs). + """ + diff = np.abs(f1 - f2) + num = diff.sum(axis=axis) + den = np.abs(f2).sum(axis=axis) + l1_rerr = np.divide(num, den, out=np.zeros_like(num, dtype=float), where=den != 0) + return dict(l1_rerr=l1_rerr, mean_adiff=diff.mean(axis=axis), max_adiff=diff.max(axis=axis), + min_adiff=diff.min(axis=axis), stdev_adiff=diff.std(axis=axis)) + + +def _hexbin_parity(ax, x, y, bins, log=False, wrap=False, label="") -> None: + """ + Helper for :meth:`Mrgdvdb.plot_ftinterp_parity`: density-colored hexbin parity plot + of ``y`` vs ``x`` with a y=x reference line, Pearson r / RMSE annotated. + + Args: + wrap: True for angle data (radians), which is only defined modulo 2*pi: a + physically tiny difference near the +-pi branch cut (e.g. x=+3.14, y=-3.14) + would otherwise register as a difference of ~2*pi and dominate the Pearson r + / RMSE statistics. Realigns y to the branch closest to x + (y -> x + wrap_to_pi(y - x), which does not change y's physical value) + before doing anything else, so both the plot and the stats reflect the true + agreement. + """ + import matplotlib.pyplot as plt + + if wrap: + y = x + np.angle(np.exp(1j * (y - x))) + + if log: + m = (x > 0) & (y > 0) + x, y = x[m], y[m] + + lo, hi = min(x.min(), y.min()), max(x.max(), y.max()) + kwargs = dict(xscale="log", yscale="log") if log else {} + h = ax.hexbin(x, y, gridsize=bins, cmap="Blues", mincnt=1, bins="log", **kwargs) + ax.plot([lo, hi], [lo, hi], "--", color="0.35", lw=1.2, zorder=3) + ax.set_xlim(lo, hi) + ax.set_ylim(lo, hi) + ax.set_aspect("equal", adjustable="box") + + cb = plt.colorbar(h, ax=ax, shrink=0.85) + cb.set_label("point count (log)") + + ax.grid(True, which="both", ls=":", lw=0.5, color="0.85", zorder=0) + for spine in ("top", "right"): + ax.spines[spine].set_visible(False) + + r = np.corrcoef(x, y)[0, 1] + rmse = np.sqrt(np.mean((x - y) ** 2)) + ax.text(0.03, 0.97, f"{label}\nN = {x.size:,}\nPearson r = {r:.5f}\nRMSE = {rmse:.3e}", + transform=ax.transAxes, ha="left", va="top", fontsize=9, + bbox=dict(boxstyle="round", fc="white", ec="0.8", alpha=0.85)) + class Cut3D(ExecWrapper): """ From 95f6d084204018e24aeb716212a00a7c4c3d9a76 Mon Sep 17 00:00:00 2001 From: Matteo Giantomassi Date: Mon, 3 Aug 2026 11:41:05 +0200 Subject: [PATCH 02/23] GWAN file --- abipy/abilab.py | 4 + abipy/eph/gpath.py | 184 ++++++++-- abipy/eph/gwan.py | 705 +++++++++++--------------------------- abipy/wannier90/abiwan.py | 1 + 4 files changed, 364 insertions(+), 530 deletions(-) diff --git a/abipy/abilab.py b/abipy/abilab.py index 76f93c653..711050628 100644 --- a/abipy/abilab.py +++ b/abipy/abilab.py @@ -104,6 +104,8 @@ from abipy.eph.gkq import GkqFile, GkqRobot from abipy.eph.gpath import GpathFile from abipy.eph.gstore import GstoreFile +from abipy.eph.gwan import GwanFile +from abipy.eph.isome import IsomeFile from abipy.eph.rta import RtaFile, RtaRobot from abipy.eph.sigeph import SigEPhFile, SigEPhRobot from abipy.eph.transportfile import TransportFile @@ -206,6 +208,8 @@ def _straceback(): ("A2F.nc", A2fFile), ("SIGEPH.nc", SigEPhFile), ("GSTORE.nc", GstoreFile), + ("GWAN.nc", GwanFile), + ("ISOME.nc", IsomeFile), ("GPATH.nc", GpathFile), ("TRANSPORT.nc", TransportFile), ("RTA.nc", RtaFile), diff --git a/abipy/eph/gpath.py b/abipy/eph/gpath.py index 3351ca76a..dd7708a83 100644 --- a/abipy/eph/gpath.py +++ b/abipy/eph/gpath.py @@ -6,6 +6,7 @@ from __future__ import annotations from functools import cached_property +import warnings import numpy as np from monty.string import marquee @@ -137,6 +138,34 @@ def _get_which_g_list(which_g: str) -> list[str]: def _get_band_range(self, band_range): return (self.r.bstart, self.r.bstop) if band_range is None else band_range + def _get_wannier_comparison_band_range(self, band_range): + """Select the contiguous ab-initio band range used for a Wannier comparison.""" + if not self.r.has_wannier: + raise ValueError("Wannier-interpolated matrix elements are not available in this GPATH.nc file") + + if band_range is not None: + if band_range[1] - band_range[0] != self.r.nwan: + warnings.warn( + "The ab-initio and Wannier averages use different numbers of bands; " + "their normalizations and electronic subspaces differ.", + stacklevel=3, + ) + return band_range + + if self.r.nwan > self.r.nb_in_g: + raise ValueError(f"Cannot select {self.r.nwan=} bands from {self.r.nb_in_g=}") + + band_range = (int(self.r.bstart), int(self.r.bstart + self.r.nwan)) + if self.r.nwan != self.r.nb_in_g: + warnings.warn( + f"Using contiguous ab-initio bands {band_range} to match {self.r.nwan=}. " + "With disentanglement this is only a diagnostic proxy for the true Wannier subspace; " + "a rigorous comparison requires projecting g with the ABIWAN transformation matrices.", + stacklevel=3, + ) + + return band_range + @add_fig_kwargs def plot_g_qpath( self, @@ -148,6 +177,7 @@ def plot_g_qpath( ph_modes=None, with_phbands=True, with_ebands=False, + with_wannier=False, ax_mat=None, fontsize=8, **kwargs, @@ -157,7 +187,8 @@ def plot_g_qpath( Args: band_range: Band range that will be averaged over (python convention). - If None all bands are considered. + If None, all ab-initio bands are considered unless ``with_wannier`` + is enabled, in which case a contiguous ``nwan``-band range is used. which_g: "avg" to plot the symmetrized ``|g|``, "raw" for unsymmetrized ``|g|``. "all" for both. with_qexp: Multiply ``|g(k, q)|`` by ``|q|^{with_qexp}``. scale: Scaling factor for the marker size used when with_phbands is True. @@ -165,6 +196,12 @@ def plot_g_qpath( ph_modes: List of ph branch indices to show (start from 0). If None all modes are shown. with_phbands: False if phonon bands should now be displayed. with_ebands: False if electron bands should now be displayed. + with_wannier: Overlay Wannier-interpolated results when available. The + Wannier average uses all ``nwan`` bands and its interpolated + eigenvalues to identify electronic degeneracies. If ``band_range`` + is None, the ab-initio average uses the contiguous range + ``[bstart, bstart + nwan)``. With disentanglement this range is only + a diagnostic proxy for the true Wannier subspace. ax_mat: List of |matplotlib-Axes| or None if a new figure should be created. fontsize: fontsize for legends and titles """ @@ -175,7 +212,11 @@ def plot_g_qpath( ax_mat, nrows=nrows, ncols=ncols, sharex=False, sharey=False, squeeze=False ) marker_color = "gold" - band_range = self._get_band_range(band_range) + band_range = ( + self._get_wannier_comparison_band_range(band_range) + if with_wannier + else self._get_band_range(band_range) + ) facts_q = ( np.ones(len(self.phbands.qpoints)) @@ -188,11 +229,15 @@ def plot_g_qpath( for spin in range(self.r.nsppol): g_nuq_avg, g_nuq_raw = self.r.get_gnuq_average_spin(spin, band_range) + if with_wannier: + g_nuq_avg_wan, g_nuq_raw_wan = self.r.get_gnuq_average_spin(spin, None, which="wannier") ax_cnt = -1 for which_g in which_g_list: # Select ys according to which_g and multiply by facts_q g_nuq = dict(avg=g_nuq_avg, raw=g_nuq_raw)[which_g] * facts_q[None, :] + if with_wannier: + g_nuq_wan = dict(avg=g_nuq_avg_wan, raw=g_nuq_raw_wan)[which_g] * facts_q[None, :] # Plot g_nu(q) ax_cnt += 1 @@ -203,7 +248,15 @@ def plot_g_qpath( for nu in range(self.r.natom3): if ph_modes is not None and nu not in ph_modes: continue - ax.plot(g_nuq[nu], label=f"{nu=}") + label = f"{nu=} ab-initio" if with_wannier else f"{nu=}" + line, = ax.plot(g_nuq[nu], linestyle="-", label=label) + if with_wannier: + ax.plot( + g_nuq_wan[nu], + color=line.get_color(), + linestyle="--", + label=f"{nu=} Wannier", + ) self.phbands.decorate_ax(ax, units="meV") g_label = r"$|g^{\text{%s}}_{\mathbf{q}}|$ %s" % (which_g, q_label) set_grid_legend(ax, fontsize, ylabel="%s %s" % (g_label, g_units)) @@ -259,6 +312,7 @@ def plot_g_kpath( scale=1, ph_modes=None, with_ebands=True, + with_wannier=False, ax_mat=None, fontsize=8, **kwargs, @@ -273,6 +327,12 @@ def plot_g_kpath( scale: Scaling factor for the marker size used when with_phbands is True. ph_modes: List of ph branch indices to show (start from 0). If None all modes are show. with_ebands: False if electron bands should now be displayed. + with_wannier: Overlay Wannier-interpolated results when available. The + Wannier average uses all ``nwan`` bands and its interpolated + eigenvalues to identify electronic degeneracies. If ``band_range`` + is None, the ab-initio average uses the contiguous range + ``[bstart, bstart + nwan)``. With disentanglement this range is only + a diagnostic proxy for the true Wannier subspace. ax_mat: List of |matplotlib-Axes| or None if a new figure should be created. fontsize: fontsize for legends and titles """ @@ -283,15 +343,23 @@ def plot_g_kpath( ax_mat, nrows=nrows, ncols=ncols, sharex=False, sharey=False, squeeze=False ) marker_color = "gold" - band_range = self._get_band_range(band_range) + band_range = ( + self._get_wannier_comparison_band_range(band_range) + if with_wannier + else self._get_band_range(band_range) + ) for spin in range(self.r.nsppol): g_nuk_avg, g_nuk_raw = self.r.get_gnuk_average_spin(spin, band_range) + if with_wannier: + g_nuk_avg_wan, g_nuk_raw_wan = self.r.get_gnuk_average_spin(spin, None, which="wannier") ax_cnt = -1 for which_g in which_g_list: # Select ys according to which_g g_nuk = dict(avg=g_nuk_avg, raw=g_nuk_raw)[which_g] + if with_wannier: + g_nuk_wan = dict(avg=g_nuk_avg_wan, raw=g_nuk_raw_wan)[which_g] # Plot g_nu(q) ax_cnt += 1 @@ -299,7 +367,15 @@ def plot_g_kpath( for nu in range(self.r.natom3): if ph_modes is not None and nu not in ph_modes: continue - ax.plot(g_nuk[nu], label=f"{which_g} {nu=}") + label = f"{which_g} {nu=} ab-initio" if with_wannier else f"{which_g} {nu=}" + line, = ax.plot(g_nuk[nu], linestyle="-", label=label) + if with_wannier: + ax.plot( + g_nuk_wan[nu], + color=line.get_color(), + linestyle="--", + label=f"{which_g} {nu=} Wannier", + ) self.ebands_k.decorate_ax(ax, units="meV") set_grid_legend(ax, fontsize, ylabel=r"$|g^{\text{%s}}_{\mathbf{k}}|$ (meV)" % (which_g)) @@ -383,6 +459,20 @@ def __init__(self, filepath: PathLike): self.all_eigens_k = self.read_value("all_eigens_k") self.all_eigens_kq = self.read_value("all_eigens_kq") + # These variables are written only when ABINIT interpolates g(k, q) from + # GWAN.nc. Keep the Wannier eigenvalues separate from the ab-initio ones: + # they belong to the interpolated Hamiltonian and use Wannier band indices + # 0:nwan, without the ab-initio bstart offset. + self.has_wannier = "gkq2_nu_wan" in self.rootgrp.variables + if self.has_wannier: + self.nwan = self.read_dimvalue("nwan") + self.all_eigens_wan_k = self.read_value("all_eigens_wan_k") + self.all_eigens_wan_kq = self.read_value("all_eigens_wan_kq") + else: + self.nwan = 0 + self.all_eigens_wan_k = None + self.all_eigens_wan_kq = None + # Read important variables. self.eph_fix_korq = self.read_string("eph_fix_korq") if self.eph_fix_korq not in {"k", "q"}: @@ -399,6 +489,18 @@ def __init__(self, filepath: PathLike): self.bstop = self.read_value("bstop") self.band_range = [self.bstart, self.bstop] + def _get_gdata(self, which: str): + """Return the dimensions and eigenvalues associated with an e-ph dataset.""" + if which == "abinitio": + return self.nb_in_g, self.bstart, self.all_eigens_k, self.all_eigens_kq, "gkq2_nu" + + if which == "wannier": + if not self.has_wannier: + raise ValueError("Wannier-interpolated matrix elements are not available in this GPATH.nc file") + return self.nwan, 0, self.all_eigens_wan_k, self.all_eigens_wan_kq, "gkq2_nu_wan" + + raise ValueError(f"Invalid {which=}; expected 'abinitio' or 'wannier'") + def read_ebands_which_fixed(self, which_fixed: str): """ Overrides method of superclass as we cannot rely of the etsf-io file format, @@ -467,7 +569,13 @@ def read_phbands(self) -> PhononBands: # zcart=zcart, ) - def get_gnuq_average_spin(self, spin: int, band_range: list | tuple | None, eps_mev: float = 0.01) -> tuple: + def get_gnuq_average_spin( + self, + spin: int, + band_range: list | tuple | None, + eps_mev: float = 0.01, + which: str = "abinitio", + ) -> tuple: """ Average e-matrix elements over phonon modes, and k- k+q electrons when the matrix elements have been computed along a q-path. @@ -476,6 +584,9 @@ def get_gnuq_average_spin(self, spin: int, band_range: list | tuple | None, eps_ spin: spin index band_range: Band range that will be averaged over (python convention). eps_mev: Tolerance in meV used to detect degeneracies for phonons and electrons. + which: Select the ``"abinitio"`` or ``"wannier"`` matrix elements. + Wannier bands use indices in ``[0, nwan)`` and their own interpolated + eigenvalues when constructing the degeneracy masks. Return: tuple with two numpy array @@ -489,13 +600,11 @@ def get_gnuq_average_spin(self, spin: int, band_range: list | tuple | None, eps_ eps_ev = eps_ha * abu.Ha_eV # Number of m, n bands in g_mn, the first band starts at bstart. - nb_in_g = self.nb_in_g - bstart, bstop = self.bstart, self.bstop - nsppol, natom3 = self.nsppol, self.natom3 + nb_in_g, bstart, all_eigens_k, all_eigens_kq, gvar = self._get_gdata(which) + natom3 = self.natom3 # double all_eigens_k(nsppol, nk_path, nband) ; # double all_eigens_kq(nsppol, nq_path, nband) ; - all_eigens_k, all_eigens_kq = self.all_eigens_k, self.all_eigens_kq # eV units phfreqs_ha = self.phfreqs_ha # Ha units # Now read the e-ph matrix elements. On disk we have @@ -507,7 +616,7 @@ def get_gnuq_average_spin(self, spin: int, band_range: list | tuple | None, eps_ # m-index, n-index # In memory we want: (nq_path, natom3, nb_in_g, nb_in_g) - absg = np.sqrt(self.read_variable("gkq2_nu")[spin, 0][:].transpose(0, 1, 3, 2).copy()) * abu.Ha_meV + absg = np.sqrt(self.read_variable(gvar)[spin, 0][:].transpose(0, 1, 3, 2).copy()) * abu.Ha_meV absg_raw = absg.copy() # Average over degenerate phonon modes. @@ -575,15 +684,33 @@ def get_gnuq_average_spin(self, spin: int, band_range: list | tuple | None, eps_ return gavg, graw - def get_gnuk_average_spin(self, spin: int, band_range: list | tuple | None, eps_mev: float = 0.01) -> tuple: + def get_gnuk_average_spin( + self, + spin: int, + band_range: list | tuple | None, + eps_mev: float = 0.01, + which: str = "abinitio", + ) -> tuple: """ - Average g elements over phonon modes, and k- k+q electrons when the matrix elements - have been computed along a k-path. + Average g elements over phonon modes and degenerate k states when the matrix elements + have been computed along a k-path at fixed q. + + ``all_eigens_k`` contains the path-dependent eigenvalues in this case. The + ``all_eigens_kq`` array is q-path dependent and therefore cannot be used to + average k+q degeneracies when k varies. Consequently, this routine currently + averages electronic degeneracies only at k, not at k+q. Supporting the latter + requires changing ABINIT's GPATH.nc format so that it also stores the k+q + eigenvalues along the k-path, e.g. in an array with dimensions + ``(nband, nk_path, nsppol)``. The same extension is required for the + Wannier-interpolated eigenvalues. Args: spin: spin index band_range: Band range that will be averaged over (python convention). eps_mev: Tolerance in meV used to detect degeneracies for phonons and electrons. + which: Select the ``"abinitio"`` or ``"wannier"`` matrix elements. + Wannier bands use indices in ``[0, nwan)`` and their own interpolated + eigenvalues when constructing the degeneracy masks. Return: tuple with two numpy arrays. @@ -597,13 +724,10 @@ def get_gnuk_average_spin(self, spin: int, band_range: list | tuple | None, eps_ eps_ev = eps_ha * abu.Ha_eV # Number of m, n bands in g_mn, the first band starts at bstart. - nb_in_g = self.nb_in_g - bstart, bstop = self.bstart, self.bstop - nsppol, natom3 = self.nsppol, self.natom3 + nb_in_g, bstart, all_eigens_k, _all_eigens_kq, gvar = self._get_gdata(which) + natom3 = self.natom3 # double all_eigens_k(nsppol, nk_path, nband) ; - # double all_eigens_kq(nsppol, nq_path, nband) ; - all_eigens_k, all_eigens_kq = self.all_eigens_k, self.all_eigens_kq # eV units phfreqs_ha = self.phfreqs_ha # Ha units # Now read the e-ph matrix elements. On disk we have @@ -615,7 +739,7 @@ def get_gnuk_average_spin(self, spin: int, band_range: list | tuple | None, eps_ # m-index, n-index # In memory we want: (nk_path, natom3, nb_in_g, nb_in_g) - absg = np.sqrt(self.read_variable("gkq2_nu")[spin, :, 0, :, :, :][:].transpose(0, 1, 3, 2).copy()) * abu.Ha_meV + absg = np.sqrt(self.read_variable(gvar)[spin, :, 0, :, :, :][:].transpose(0, 1, 3, 2).copy()) * abu.Ha_meV absg_raw = absg.copy() # Average over degenerate phonon modes for this q @@ -646,19 +770,13 @@ def get_gnuk_average_spin(self, spin: int, band_range: list | tuple | None, eps_ g2_nu += absg[ik, :, m_kq, bsum_k] ** 2 absg_avg[ik, :, m_kq, n_k] = np.sqrt(g2_nu / nn) - # Average over degenerate k+q electrons taking bstart into account. - absg = absg_avg.copy() - for n_k in range(nb_in_g): - for m_kq in range(nb_in_g): - w_1 = all_eigens_kq[spin, 0, m_kq + bstart] - g2_nu[:], nn = 0.0, 0 - for bsum_kq in range(nb_in_g): - w_2 = all_eigens_kq[spin, 0, bsum_kq + bstart] - if abs(w_2 - w_1) >= eps_ev: - continue - nn += 1 - g2_nu += absg[ik, :, bsum_kq, n_k] ** 2 - absg_avg[ik, :, m_kq, n_k] = np.sqrt(g2_nu / nn) + # TODO: Average over degenerate k+q states as well. This cannot be done with + # the present ABINIT GPATH.nc format: for fixed q, all_eigens_kq has nq_path=1 + # and contains only the spectrum associated with the first k-point. ABINIT + # must first write E_{k+q} for every point of the k-path (and the analogous + # Wannier eigenvalues). Once available, the k+q averaging must be performed + # inside an explicit loop over ik; reusing all_eigens_kq[spin, 0] for every + # ik would apply the wrong degeneracy mask. # Transpose the data: (nk_path, natom3, nb_in_g, nb_in_g) -> (natom3, nk_path, nb_in_g, nb_in_g) absg_avg, absg_raw = absg_avg.transpose(1, 0, 2, 3).copy(), absg_raw.transpose(1, 0, 2, 3).copy() diff --git a/abipy/eph/gwan.py b/abipy/eph/gwan.py index 4ea256fb1..3f64e5dd7 100644 --- a/abipy/eph/gwan.py +++ b/abipy/eph/gwan.py @@ -1,564 +1,275 @@ -""" -This module contains objects for analyzing -the GWAN.nc file with the e-ph vertex in the Wannier representation. - -For a theoretical introduction see :cite:`Giustino2017` -""" +"""Post-processing tools for GWAN.nc files containing the e-ph vertex in real space.""" from __future__ import annotations -import dataclasses - -# import abipy.core.abinit_units as abu +from dataclasses import dataclass from functools import cached_property +from typing import TYPE_CHECKING import numpy as np -import pandas as pd -from monty.string import marquee # , list_strings -from monty.termcolor import cprint - -# from abipy.tools.typing import Figure -from abipy.abio.robots import Robot -from abipy.core.kpoints import kpoints_indices -from abipy.core.mixins import AbinitNcFile, Has_ElectronBands, Has_Header, Has_Structure # , NotebookWriter -from abipy.core.structure import Structure - -# from abipy.tools.plotting import (add_fig_kwargs, get_ax_fig_plt, get_axarray_fig_plt, set_axlims, set_visible, -# rotate_ticklabels, ax_append_title, set_ax_xylabels, linestyles) -# from abipy.tools import duck -from abipy.electrons.ebands import ElectronBands, RobotWithEbands +from monty.string import marquee + +import abipy.core.abinit_units as abu +from abipy.core.mixins import AbinitNcFile, Has_ElectronBands, Has_Header, Has_Structure from abipy.eph.common import BaseEphReader -from abipy.eph.gstore import GstoreFile # , GstoreReader, Gqk -from abipy.tools.numtools import BzRegularGridInterpolator, nparr_to_df -from abipy.tools.typing import PathLike +from abipy.tools.plotting import add_fig_kwargs, get_axarray_fig_plt, set_grid_legend + +if TYPE_CHECKING: + from abipy.core.structure import Structure + from abipy.electrons.ebands import ElectronBands + from abipy.tools.typing import Figure, PathLike + + +@dataclass(frozen=True) +class GwanSpin: + """Real-space Hamiltonian and e-ph vertex for one spin channel.""" + + spin: int + r_h: np.ndarray + r_e: np.ndarray + r_p: np.ndarray + ndegen_h: np.ndarray + ndegen_e: np.ndarray + ndegen_p: np.ndarray + hwan_r: np.ndarray + grpe_wwp: np.ndarray + @property + def nwan(self) -> int: + """Number of Wannier functions.""" + return self.grpe_wwp.shape[1] -class GwanFile(AbinitNcFile, Has_Header, Has_Structure, Has_ElectronBands): # , NotebookWriter): - """ - This file stores the e-ph matrix elements in the wannier representation - and provides methods to analyze and plot results. + @property + def nr_e(self) -> int: + """Number of electronic lattice vectors.""" + return len(self.r_e) - Usage example: + @property + def nr_p(self) -> int: + """Number of phonon lattice vectors.""" + return len(self.r_p) - .. code-block:: python + def get_decay(self) -> tuple[np.ndarray, np.ndarray]: + """ + Return the maximum vertex magnitude associated with each real-space vector. - with GwanFile("out_GWAN.nc") as gwan: - print(gwan) + ``decay_e[ire]`` is ``max_{Rp,m,n,nu} |g(m,n,nu; Re,Rp)|`` and + ``decay_p[irp]`` is ``max_{Re,m,n,nu} |g(m,n,nu; Re,Rp)|``. + The values have the same units as ``grpe_wwp`` (Ha/Bohr in ABINIT). + """ + # In Python: grpe_wwp(natom3, nwan, nwan, nr_e, nr_p). + abs_g = np.abs(self.grpe_wwp) + decay_e = np.max(abs_g, axis=(0, 1, 2, 4)) + decay_p = np.max(abs_g, axis=(0, 1, 2, 3)) + return decay_e, decay_p - for spin in range(gwan.nsppol): - # Extract the object storing the g for this spin. - #gqk = gstore.gqk_spin[spin] - #print(gqk) + def get_hwan_decay(self) -> np.ndarray: + """Return ``max_{m,n}|H_mn(Rh)|`` in Hartree for each Hamiltonian lattice vector.""" + # In Python: hwan_r(nwan, nwan, nr_h). + return np.max(np.abs(self.hwan_r), axis=(0, 1)) - # Get a Dataframe with g(k, q) for all modes and bands. - #df = gqk.get_gdf_at_qpt_kpt([1/2, 0, 0], [0, 0, 0]) - #print(df) - .. rubric:: Inheritance Diagram - .. inheritance-diagram:: GwanFile - """ +class GwanFile(AbinitNcFile, Has_Header, Has_Structure, Has_ElectronBands): + """File containing the e-ph vertex in the real-space Wannier representation.""" @classmethod def from_file(cls, filepath: PathLike) -> GwanFile: - """Initialize the object from a netcdf file.""" + """Initialize the object from a NetCDF file.""" return cls(filepath) def __init__(self, filepath: PathLike): - """ - Args: - filepath: Path to the netcdf file. - """ + """Open ``filepath`` and initialize the GWAN reader.""" super().__init__(filepath) self.r = GwanReader(filepath) @cached_property def ebands(self) -> ElectronBands: - """|ElectronBands| object.""" + """Electronic bands stored in the root group.""" return self.r.read_ebands() @property def structure(self) -> Structure: - """|Structure| object.""" + """Crystalline structure.""" return self.ebands.structure - def close(self) -> None: - """Close the file.""" - self.r.close() - - # @cached_property - # def gqk_spin(self) -> list: - # return [Gqk.from_gstore(self, spin) for spin in range(self.nsppol)] - @cached_property def params(self) -> dict: - """Dict with the convergence parameters, e.g. ``nbsum``.""" - # od = OrderedDict([ - # ("nbsum", self.nbsum), - # ("nqibz", self.r.nqibz), - # ]) - ## Add EPH parameters. - # od.update(self.r.common_eph_params) + """Parameters used by generic convergence-analysis interfaces.""" + return {} - od = {} - return od + @cached_property + def gwan_spin(self) -> tuple[GwanSpin, ...]: + """Real-space Wannier data for each spin channel.""" + return tuple(self.r.read_gwan_spin(spin) for spin in range(self.r.nsppol)) + + def close(self) -> None: + """Close the NetCDF reader.""" + self.r.close() def __str__(self) -> str: return self.to_string() - def to_string(self, verbose=0) -> str: - """String representation with verbosiy level ``verbose``.""" - lines = [] - app = lines.append - - app(marquee("File Info", mark="=")) - app(self.filestat(as_string=True)) - app("") - app(self.structure.to_string(verbose=verbose, title="Structure")) - - app("") - app(self.ebands.to_string(with_structure=False, verbose=verbose, title="Electronic Bands")) + def to_string(self, verbose: int = 0) -> str: + """Return a string summary with verbosity level ``verbose``.""" + lines = [ + marquee("File Info", mark="="), + self.filestat(as_string=True), + "", + self.structure.to_string(verbose=verbose, title="Structure"), + "", + self.ebands.to_string(with_structure=False, verbose=verbose, title="Electronic Bands"), + "", + f"Number of spin channels: {self.r.nsppol}", + ] + for data in self.gwan_spin: + lines.append( + f"Spin {data.spin}: nwan={data.nwan}, nr_h={len(data.r_h)}, " + f"nr_e={data.nr_e}, nr_p={data.nr_p}" + ) if verbose > 1: - app("") - app(self.hdr.to_string(verbose=verbose, title="Abinit Header")) - - app(f"nsppol: {self.r.nsppol}") - app(f"gstore_completed: {bool(self.r.completed)}") - app(f"gstore_cplex: {self.r.cplex}") - app(f"gstore_kptopt: {self.r.kptopt}") - app(f"gstore_qptopt: {self.r.qptopt}") - # for spin in range(self.r.nsppol): - # app(f"gstore_brange_spin[{spin}]: {self.r.brange_spin[spin]}") - # app(f"gstore_erange_spin[{spin}]: {self.r.erange_spin[spin]}") - # app(f"gstore_glob_spin_nq[{spin}]: {self.r.glob_spin_nq[spin]}") - + lines.extend(["", self.hdr.to_string(verbose=verbose, title="Abinit Header")]) return "\n".join(lines) - # def write_epw_hdf5(self, filepath: PathLike) -> None: - - -@dataclasses.dataclass(kw_only=True) -class Gqk: - """ - This object stores the e-ph matrix elements (g or g^2) and the matrix elements - of the velocity operator for a given spin. - """ - - cplex: int # 1 if |g|^2 is stored - # 2 if complex valued g (mind the gauge) - spin: int # Spin index. - nb: int # Number of bands - bstart: int - # bstop: int - - glob_nk: int # Total number of k/q points in global matrix. - glob_nq: int # Note that k-points/q-points can be filtered. - # Use kzone, qzone and kfilter to interpret these dimensions. - - gstore: GstoreFile - - gvals: np.ndarray | None - g2: np.ndarray | None - vk_cart_ibz: np.ndarray | None - vkmat_cart_ibz: np.ndarray | None - - @classmethod - def from_gstore(cls, gstore: GstoreFile, spin: int): - """ - Build an istance from a GstoreFile and the spin index. + @add_fig_kwargs + def plot_decay( + self, + spin: int = 0, + ax_mat=None, + yscale: str = "log", + marker: str = "o", + markersize: float = 3, + fontsize: int = 8, + **kwargs, + ) -> Figure: """ - ncr = gstore.r - path = f"gqk_spin{spin + 1}" - cplex = ncr.read_dimvalue("gstore_cplex") - nb = ncr.read_dimvalue("nb", path=path) - glob_nk = ncr.read_dimvalue("glob_nk", path=path) - glob_nq = ncr.read_dimvalue("glob_nq", path=path) - - # Read e-ph matrix elements - # nctkarr_t("gvals", "dp", "gstore_cplex, nb_kq, nb_k, natom3, glob_nk, glob_nq) - # Have to transpose the (nb_kq, nb_k) submatrix written by Fortran. - g2, gvals = None, None - if cplex == 1: - g2 = ncr.read_value("gvals", path=path).transpose(0, 1, 2, 4, 3, 5).copy() - - elif cplex == 2: - gvals = ncr.read_value("gvals", path=path).transpose(0, 1, 2, 4, 3, 5).copy() - gvals = gvals[..., 0] + 1j * gvals[..., 1] - - vk_cart_ibz, vkmat_cart_ibz = None, None - if ncr.with_vk == 1: - # nctk_def_arrays(spin_ncid, nctkarr_t("vk_cart_ibz", "dp", "three, nb, gstore_nkibz")) - vk_cart_ibz = ncr.read_value("vk_cart_ibz", path=path) - - if ncr.with_vk == 2: - # Full (nb x nb) matrix. - # Have to transpose (nb_kq, nb_k) submatrix written by Fortran. - # nctk_def_arrays(spin_ncid, nctkarr_t("vkmat_cart_ibz", "dp", "two, three, nb, nb, gstore_nkibz")) - vkmat_cart_ibz = ncr.read_value("vkmat_cart_ibz", path=path).transpose(0, 1, 3, 2, 4).copy() - vkmat_cart_ibz = vkmat_cart_ibz[..., 0] + 1j * vkmat_cart_ibz[..., 1] - - # Note conversion between Fortran and python indexing. - bstart = ncr.read_value("bstart", path=path) - 1 - # bstop = ncr.read_value("stop", path=path) - - data = locals() - return cls(**{k: data[k] for k in [field.name for field in dataclasses.fields(Gqk)]}) + Plot the real-space decay of the e-ph vertex for one spin channel. - def __str__(self) -> str: - return self.to_string() + The left panel shows ``max_{Rp,m,n,nu}|g(Re,Rp)|`` versus ``|Re|``; + the right panel shows ``max_{Re,m,n,nu}|g(Re,Rp)|`` versus ``|Rp|``. + This is the same electronic decay measure written by ABINIT to + ``*_spinN_GWAN.txt``, complemented by the phonon-lattice decay. - def to_string(self, verbose=0) -> str: - """String representation with verbosiy level ``verbose``.""" - lines = [] - app = lines.append - - app(marquee(f"Gqk for spin: {self.spin}", mark="=")) - app(f"cplex: {self.cplex}") - app(f"nb: {self.nb}") - app(f"bstart: {self.bstart}") - app(f"glob_nk: {self.glob_nk}") - app(f"glob_nq: {self.glob_nq}") - - return "\n".join(lines) - - @property - def structure(self): - """|Structure| object.""" - return self.gstore.structure - - def get_dataframe(self, what: str = "g2") -> pd.DataFrame: - """ - Build and return a dataframe with all the |g(k,q)|^2 if what == "g2" or - all |v_nk|^2 if what == "v2". + Args: + spin: Zero-based spin index. + ax_mat: Two matplotlib axes or None to create them. + yscale: Scale for the vertical axes, typically ``"log"`` or ``"linear"``. + marker: Matplotlib marker for individual real-space vectors. + markersize: Marker size. + fontsize: Font size used for labels and legends. + **kwargs: Additional options accepted by the plotting decorator. """ - if what == "g2": - g2 = self.g2 if self.g2 is not None else np.abs(self.gvals) ** 2 - df = nparr_to_df("g2", g2, ["iq", "ik", "imode", "m_kq", "n_k"]) - - elif what == "v2": - if self.vk_cart_ibz is None: - raise ValueError("vk_cart_ibz is not available in GSTORE!") - # Compute the squared norm of each vector - v2 = np.sum(self.vk_cart_ibz**2, axis=2) - df = nparr_to_df("v2", v2, ["ik", "n_k"]) - - else: - raise ValueError(f"Invalid {what=}") - - # df["m_kq"] += bstart_mkq - # df["n_k"] += bstart_nk - - return df - - def get_g2q_interpolator_kpoint(self, kpoint, method="linear", check_mesh=1): - """ """ - r = self.gstore.r - - # Find the index of the kpoint. - ik_g, kpoint = r.find_ik_glob_kpoint(kpoint, self.spin) - - # Compute indices of qpoints in the ngqpt mesh. - ngqpt, shifts = r.ngqpt, [0, 0, 0] - q_indices = kpoints_indices(r.qbz, ngqpt, shifts, check_mesh=check_mesh) - - natom3 = 3 * len(self.structure) - nb = self.nb - nx, ny, nz = ngqpt + if not 0 <= spin < self.r.nsppol: + raise ValueError(f"Invalid {spin=}; expected 0 <= spin < {self.r.nsppol}") - # (glob_nq, glob_nk, natom3, m_kq, n_k) - g2 = self.g2 if self.g2 is not None else np.abs(self.gvals) ** 2 - g2_qph_mn = g2[:, ik_g] + data = self.gwan_spin[spin] + decay_e, decay_p = data.get_decay() + lattice = self.structure.lattice.matrix + rmod_e = np.linalg.norm(np.matmul(data.r_e, lattice), axis=1) + rmod_p = np.linalg.norm(np.matmul(data.r_p, lattice), axis=1) - # Insert g2 in g2_grid - g2_grid = np.empty((nb, nb, natom3, nx, ny, nz)) - for nu in range(natom3): - for g2_mn, q_inds in zip(g2_qph_mn[:, nu], q_indices, strict=False): - ix, iy, iz = q_inds - g2_grid[:, :, nu, ix, iy, iz] = g2_mn - - return BzRegularGridInterpolator(self.structure, shifts, g2_grid, method=method) - - def get_g_qpt_kpt(self, qpoint, kpoint, what) -> np.ndarray: + ax_mat, fig, _plt = get_axarray_fig_plt( + ax_mat, nrows=1, ncols=2, sharey=True, squeeze=False, rescale_fig=True + ) + axes = ax_mat.ravel() + for ax, radii, values, symbol, title in zip( + axes, + (rmod_e, rmod_p), + (decay_e, decay_p), + (r"R_e", r"R_p"), + ("Electronic lattice vectors", "Phonon lattice vectors"), + strict=True, + ): + order = np.argsort(radii) + ax.plot(radii[order], values[order], linestyle="none", marker=marker, markersize=markersize) + ax.set_yscale(yscale) + ax.set_title(title) + set_grid_legend(ax, fontsize, xlabel=rf"$|{symbol}|$ (Å)", ylabel=r"max $|g|$ (Ha/Bohr)") + + fig.suptitle(f"Real-space decay of the e-ph vertex, spin {spin}") + return fig + + @add_fig_kwargs + def plot_hwan_decay( + self, + spin: int = 0, + ax=None, + units: str = "eV", + yscale: str = "log", + marker: str = "o", + markersize: float = 3, + fontsize: int = 8, + **kwargs, + ) -> Figure: """ - Return numpy array with e-ph matrix elements the for the given (qpoint, kpoint) pair. + Plot the real-space decay of the Hamiltonian in the Wannier representation. - Args: - what="g2" for |g(k,q)|^2, "g" for g(k,q) - """ - # Find the internal indices of (qpoint, kpoint) - iq_g, qpoint = self.gstore.r.find_iq_glob_qpoint(qpoint, self.spin) - ik_g, kpoint = self.gstore.r.find_ik_glob_kpoint(kpoint, self.spin) - if what == "g2": - g2 = self.g2 if self.g2 is not None else np.abs(self.gvals) ** 2 - return g2[iq_g, ik_g] - if what == "g": - if self.cplex != 2: - raise ValueError("Gstore file stores g2 instead of complex g") - return self.gvals[iq_g, ik_g] - - raise ValueError(f"Invalid {what=}") - - def get_gdf_at_qpt_kpt(self, qpoint, kpoint, what="g2") -> pd.DataFrame: - """ - Build and return a dataframe with the |g(k,q)|^2 for the given (qpoint, kpoint) pair. + The plotted quantity is ``max_{m,n}|H_mn(Rh)|`` for each Hamiltonian + lattice vector. Distances are reported in Å. Args: - what="g2" for |g(k,q)|^2, "g" for g(k,q) - """ - g2_slice = self.get_g_qpt_kpt(qpoint, kpoint, what) - df = nparr_to_df(what, g2_slice, ["imode", "m_kq", "n_k"]) - # df["m_kq"] += bstart_mkq - # df["n_k"] += bstart_nk - - return df - - def neq(self, other: Gqk, verbose: int) -> int: + spin: Zero-based spin index. + ax: Matplotlib axis or None to create one. + units: Energy units, either ``"eV"`` or ``"Ha"``. + yscale: Scale for the vertical axis, typically ``"log"`` or ``"linear"``. + marker: Matplotlib marker for individual real-space vectors. + markersize: Marker size. + fontsize: Font size used for labels and legends. + **kwargs: Additional options accepted by the plotting decorator. """ - Helper function to compare two GQK objects. - """ - # This dimensions must agree in order to have a meaningfull comparison. - # so raise immediately if not equal. - aname_list = ["cplex", "spin", "nb", "glob_nk", "glob_nq"] - - for aname in aname_list: - val1, val2 = getattr(self, aname), getattr(other, aname) - - if isinstance(val1, (str, int, float)): - eq = val1 == val2 - elif isinstance(val1, np.ndarray): - eq = np.allclose(val1, val2) - else: - raise TypeError(f"Don't know how to handle comparison for type: {type(val1)}") - - if not eq: - raise RuntimeError(f"Different values of {aname=}, {val1=}, {val2=}") - - ierr = 0 - kws = dict(verbose=verbose) # , atol= rtol) + if not 0 <= spin < self.r.nsppol: + raise ValueError(f"Invalid {spin=}; expected 0 <= spin < {self.r.nsppol}") + + data = self.gwan_spin[spin] + values = data.get_hwan_decay() + if units == "eV": + values = values * abu.Ha_eV + elif units != "Ha": + raise ValueError(f"Invalid {units=}; expected 'eV' or 'Ha'") + + rmod_h = np.linalg.norm(np.matmul(data.r_h, self.structure.lattice.matrix), axis=1) + ax_mat, fig, _plt = get_axarray_fig_plt(ax, nrows=1, ncols=1) + ax = np.asarray(ax_mat).ravel()[0] + order = np.argsort(rmod_h) + ax.plot(rmod_h[order], values[order], linestyle="none", marker=marker, markersize=markersize) + ax.set_yscale(yscale) + ax.set_title(f"Wannier Hamiltonian decay, spin {spin}") + set_grid_legend(ax, fontsize, xlabel=r"$|R_h|$ (Å)", ylabel=rf"max $|H_{{mn}}|$ ({units})") + return fig - # Compare v_nk or v_mn_k. - if self.vk_cart_ibz is not None: - if not _allclose("vk_cart_ibz", self.vk_cart_ibz, other.vk_cart_ibz, **kws): - ierr += 1 - - if self.vkmat_cart_ibz is not None: - if not _allclose("vkmat_cart_ibz", self.vkmat_cart_ibz, other.vkmat_cart_ibz, **kws): - ierr += 1 - - # Compare g or g^2. - if self.g2 is not None: - if not _allclose("g2", self.g2, other.g2, **kws): - ierr += 1 - - if self.gvals is not None: - if not _allclose("gvals", self.gvals, other.gvals, **kws): - ierr += 1 - - return ierr + def yield_figs(self, **kwargs): # pragma: no cover + """Generate the standard GWAN figures.""" + for spin in range(self.r.nsppol): + yield self.plot_decay(spin=spin, show=False) + yield self.plot_hwan_decay(spin=spin, show=False) class GwanReader(BaseEphReader): - """ - Reads data from file and constructs objects. - - .. rubric:: Inheritance Diagram - .. inheritance-diagram:: GwanReader - """ + """NetCDF reader for the root group and per-spin GWAN groups.""" def __init__(self, filepath: PathLike): - """ - Args: - filepath: Path to the netcdf file. - """ + """Open ``filepath`` and read the root-level dimensions.""" super().__init__(filepath) - - # Read important dimensions. self.nsppol = self.read_dimvalue("number_of_spins") - self.cplex = self.read_dimvalue("gstore_cplex") - self.nkbz = self.read_dimvalue("gstore_nkbz") - self.nkibz = self.read_dimvalue("gstore_nkibz") - self.nqbz = self.read_dimvalue("gstore_nqbz") - self.nqibz = self.read_dimvalue("gstore_nqibz") - - # Read important variables. - self.completed = self.read_value("gstore_completed") - self.done_spin_qbz = self.read_value("gstore_done_qbz_spin") - self.with_vk = self.read_value("gstore_with_vk") - self.qptopt = self.read_value("gstore_qptopt") - self.kptopt = self.read_value("kptopt") - self.kzone = self.read_string("gstore_kzone") - self.qzone = self.read_string("gstore_qzone") - self.kfilter = self.read_string("gstore_kfilter") - self.gmode = self.read_string("gstore_gmode") - - # Note conversion Fortran --> C for the isym index. - self.brange_spin = self.read_value("gstore_brange_spin") - self.brange_spin[:, 0] -= 1 - self.erange_spin = self.read_value("gstore_erange_spin") - # Total number of k/q points for each spin after filtering (if any) - self.glob_spin_nq = self.read_value("gstore_glob_nq_spin") - self.glob_nk_spin = self.read_value("gstore_glob_nk_spin") - - # K-points and q-points in the IBZ - self.kibz = self.read_value("reduced_coordinates_of_kpoints") - self.qibz = self.read_value("gstore_qibz") - - # K-points and q-points in the BZ - self.kbz = self.read_value("gstore_kbz") - self.qbz = self.read_value("gstore_qbz") - self.ngqpt = self.read_value("gstore_ngqpt") - - # Mapping BZ --> IBZ. Note conversion Fortran --> C for the isym index. - # nctkarr_t("gstore_kbz2ibz", "i", "six, gstore_nkbz"), & - # nctkarr_t("gstore_qbz2ibz", "i", "six, gstore_nqbz"), & - self.kbz2ibz = self.read_value("gstore_kbz2ibz") - self.kbz2ibz[:, 0] -= 1 - - self.qbz2ibz = self.read_value("gstore_qbz2ibz") - self.qbz2ibz[:, 0] -= 1 - - # Mapping q/k points in gqk --> BZ. Note conversion Fortran --> C for indexing. - # nctkarr_t("gstore_qglob2bz", "i", "gstore_max_nq, number_of_spins"), & - # nctkarr_t("gstore_kglob2bz", "i", "gstore_max_nk, number_of_spins") & - self.qglob2bz = self.read_value("gstore_qglob2bz") - self.qglob2bz -= 1 - self.kglob2bz = self.read_value("gstore_kglob2bz") - self.kglob2bz -= 1 - - def find_iq_glob_qpoint(self, qpoint, spin: int): - """ - Find the internal index of the qpoint needed to access the gvals array. - """ - qpoint = np.asarray(qpoint) - for iq_g, iq_bz in enumerate(self.qglob2bz[spin]): - if np.allclose(qpoint, self.qbz[iq_bz]): - # print(f"Found {qpoint = } with index {iq_g = }") - return iq_g, qpoint - - raise ValueError(f"Cannot find {qpoint=} in GSTORE.nc") - def find_ik_glob_kpoint(self, kpoint, spin: int): - """Find the internal indices of the kpoint needed to access the gvals array.""" - kpoint = np.asarray(kpoint) - for ik_g, ik_bz in enumerate(self.kglob2bz[spin]): - if np.allclose(kpoint, self.kbz[ik_bz]): - # print(f"Found {kpoint = } with index {ik_g = }") - return ik_g, kpoint - - raise ValueError(f"Cannot find {kpoint=} in GSTORE.nc") - - # TODO: This fix to read groups should be imported in pymatgen. @cached_property def path2group(self) -> dict: - """Dictionary mapping path to group.""" + """Map NetCDF group names to group objects.""" return self.rootgrp.groups - -class GstoreRobot(Robot, RobotWithEbands): - """ - This robot analyzes the results contained in multiple GSTORE.nc files. - - Usage example: - - .. code-block:: python - - robot = GstoreRobot.from_files([ - "t04o_GSTORE.nc", - "t05o_GSTORE.nc", - ]) - - robot.neq(verbose=1) - - .. rubric:: Inheritance Diagram - .. inheritance-diagram:: GstoreRobot - """ - - EXT = "GSTORE" - - def neq(self, ref_basename: str | None = None, verbose: int = 0) -> int: - """ - Compare all GSTORE.nc files stored in the GstoreRobot - """ - # Find reference gstore. By default the first file in the robot is used. - ref_gstore = self._get_ref_abifile_from_basename(ref_basename) - - exc_list = [] - ierr = 0 - for other_gstore in self.abifiles: - if ref_gstore.filepath == other_gstore.filepath: - continue - print("Comparing: ", ref_gstore.basename, " with: ", other_gstore.basename) - try: - ierr += self._neq_two_gstores(ref_gstore, other_gstore, verbose) - cprint("EQUAL", color="green") - except Exception as exc: - exc_list.append(str(exc)) - - for exc in exc_list: - cprint(exc, color="red") - - return ierr - - @staticmethod - def _neq_two_gstores(gstore1: GstoreFile, gstore2: GstoreFile, verbose: int) -> int: - """ - Helper function to compare two GSTORE files. - """ - # These quantities must be the same to have a meaningfull comparison. - aname_list = [ - "structure", - "nsppol", - "cplex", - "nkbz", - "nkibz", - "nqbz", - "nqibz", - "completed", - "kzone", - "qzone", - "kfilter", - "gmode", - "brange_spin", - "erange_spin", - "glob_spin_nq", - "glob_nk_spin", - ] - - for aname in aname_list: - self._compare_attr_name(aname, gstore1, gstore2) - - # Now compare the gkq objects for each spin. - ierr = 0 - for spin in range(gstore1.nsppol): - gqk1, gqk2 = gstore1.gqk_spin[spin], gstore2.gqk_spin[spin] - ierr += gqk1.neq(gqk2, verbose) - - return ierr - - def yield_figs(self, **kwargs): # pragma: no cover - """ - This function *generates* a predefined list of matplotlib figures with minimal input from the user. - Used in abiview.py to get a quick look at the results. - """ - # for fig in self.get_ebands_plotter().yield_figs(): yield fig - - def write_notebook(self, nbpath=None) -> str: - """ - Write a jupyter_ notebook to ``nbpath``. If nbpath is None, a temporary file in the current - working directory is created. Return path to the notebook. - """ - nbformat, nbv, nb = self.get_nbformat_nbv_nb(title=None) - - args = [(l, f.filepath) for l, f in self.items()] - nb.cells.extend( - [ - # nbv.new_markdown_cell("# This is a markdown cell"), - nbv.new_code_cell("robot = abilab.GstoreRobot(*%s)\nrobot.trim_paths()\nrobot" % str(args)), - # nbv.new_code_cell("ebands_plotter = robot.get_ebands_plotter()"), - ] + def read_gwan_spin(self, spin: int) -> GwanSpin: + """Read the real-space arrays for zero-based spin index ``spin``.""" + if not 0 <= spin < self.nsppol: + raise ValueError(f"Invalid {spin=}; expected 0 <= spin < {self.nsppol}") + + path = f"gwan_spin{spin + 1}" + return GwanSpin( + spin=spin, + r_h=self.read_value("r_h", path=path), + r_e=self.read_value("r_e", path=path), + r_p=self.read_value("r_p", path=path), + ndegen_h=self.read_value("ndegen_h", path=path), + ndegen_e=self.read_value("ndegen_e", path=path), + ndegen_p=self.read_value("ndegen_p", path=path), + hwan_r=self.read_value("hwan_r", path=path, cmode="c"), + grpe_wwp=self.read_value("grpe_wwp", path=path, cmode="c"), ) - - # Mixins - # nb.cells.extend(self.get_baserobot_code_cells()) - # nb.cells.extend(self.get_ebands_code_cells()) - - return self._write_nb_nbpath(nb, nbpath) diff --git a/abipy/wannier90/abiwan.py b/abipy/wannier90/abiwan.py index 6ffc30151..06074f0c3 100644 --- a/abipy/wannier90/abiwan.py +++ b/abipy/wannier90/abiwan.py @@ -387,6 +387,7 @@ def plot_with_ebands( """ ebands_kpath = ElectronBands.as_ebands(ebands_kpath) wan_ebands_kpath = self.interpolate_ebands(kpoints=ebands_kpath.kpoints) + #wan_ebands_kpath.set_fermie(ebands_kpath.fermie) key_edos = None if ebands_kmesh is not None: From 5337d8fb60b994e81ee00cf84dd3778ad8b32f0b Mon Sep 17 00:00:00 2001 From: Matteo Giantomassi Date: Sat, 5 Sep 2026 17:08:21 +0200 Subject: [PATCH 03/23] Fix wannier interpolation with exclude_bands and outer window --- abipy/wannier90/abiwan.py | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/abipy/wannier90/abiwan.py b/abipy/wannier90/abiwan.py index 06074f0c3..fdd373fc6 100644 --- a/abipy/wannier90/abiwan.py +++ b/abipy/wannier90/abiwan.py @@ -265,8 +265,10 @@ def hwan(self) -> HWanR: hks = np.diag(eigs_k[self.bands_in[spin]]) v_matrix = uk else: - # Select bands within the outer window - # TODO: Test if bands_in? + # ``lwindow`` is defined over the bands passed to Wannier90, + # whereas ``eigs_k`` contains all the bands stored in ABIWAN. + # Apply exclude_bands first, then select the outer window. + eigs_k = eigs_k[self.bands_in[spin]] mask = self.lwindow[spin, ik] hks = np.diag(eigs_k[mask]) # v_matrix = u_matrix_opt[spin, ik][:num_wan, mask].transpose() @ uk @@ -387,7 +389,7 @@ def plot_with_ebands( """ ebands_kpath = ElectronBands.as_ebands(ebands_kpath) wan_ebands_kpath = self.interpolate_ebands(kpoints=ebands_kpath.kpoints) - #wan_ebands_kpath.set_fermie(ebands_kpath.fermie) + wan_ebands_kpath.set_fermie(ebands_kpath.fermie) key_edos = None if ebands_kmesh is not None: @@ -401,6 +403,7 @@ def plot_with_ebands( raise ValueError("Non diagonal k-meshes are not supported!") wan_ebands_kmesh = self.interpolate_ebands(ngkpt=ngkpt, shiftk=shifts) + wan_ebands_kmesh.set_fermie(ebands_kpath.fermie) edos_kws = dict(method=method, step=step, width=width) edos = ebands_kmesh.get_edos(**edos_kws) @@ -493,6 +496,24 @@ def eval_sk(self, spin: int, kpt, der1=None, der2=None) -> np.ndarray: Interpolate eigenvalues for all bands at a given (spin, k-point). Optionally compute gradients and Hessian matrices. + .. warning:: + + This currently reproduces Wannier90 interpolation with + ``use_ws_distance = false``. Modern Wannier90 versions enable the + WS-distance correction by default and use pair-dependent translated + lattice vectors and degeneracies produced by + ``w90_ws_distance:ws_translate_dist`` (``irdist_ws`` and + ``wdist_ndeg``). A direct comparison for aluminium found differences + of about 0.05 eV on average and up to 0.26 eV along a k-path. + + The present ABIWAN format stores only ``irvec`` and one ``ndegen`` + per lattice vector, so the default Wannier90 result cannot be + reconstructed. A future format should also store the real-space + Hamiltonian and pair-dependent data from Wannier90's ``*_hr.dat`` + and ``*_wsvec.dat`` files (which can be generated with + ``write_hr = true``). ABINIT's ``wan_interp_ham`` has the same + limitation. + Args: spin: Spin index. kpt: K-point in reduced coordinates. From bed2b95d1a6607e9f8fe782d39acaf8f35325f27 Mon Sep 17 00:00:00 2001 From: Matteo Giantomassi Date: Sat, 5 Sep 2026 17:15:38 +0200 Subject: [PATCH 04/23] new version of pip_all.sh --- pip_all.sh | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/pip_all.sh b/pip_all.sh index 515491502..b60428b30 100755 --- a/pip_all.sh +++ b/pip_all.sh @@ -1,10 +1,13 @@ #!/bin/bash set -ev # exit on first error, print each command -pip install -r requirements.txt -pip install -r requirements-optional.txt -pip install -r requirements-panel.txt -pip install -r requirements-tests.txt +# Install all requirements files in ONE pip resolve. Separate `pip install -r` +# calls each resolve independently, so a package pulled in transitively by an +# earlier file (e.g. jinja2 via panel, from requirements-panel.txt) can be left +# behind a later file's own dependency's floor on that same package (e.g. +# pandas' optional jinja2>=3.1.5 requirement for pandas.io.formats.style) -- +# pip never gets a chance to reconcile the two in a single cross-file resolve. +pip install -r requirements.txt -r requirements-optional.txt -r requirements-panel.txt -r requirements-tests.txt python setup.py develop pip install invoke From 17fe684d054142c8a3549f96f288ffaa25726731 Mon Sep 17 00:00:00 2001 From: Matteo Giantomassi Date: Thu, 17 Sep 2026 16:41:58 +0200 Subject: [PATCH 05/23] Support old gstore files when comparing matrix elements --- abipy/eph/gstore.py | 45 ++++++++++++++++++++++++++++++++++++++------- 1 file changed, 38 insertions(+), 7 deletions(-) diff --git a/abipy/eph/gstore.py b/abipy/eph/gstore.py index 5f52f2d46..48e0fc8d7 100644 --- a/abipy/eph/gstore.py +++ b/abipy/eph/gstore.py @@ -1080,6 +1080,26 @@ class GstoreRobot(Robot, RobotWithEbands): EXT = "GSTORE" + @staticmethod + def _read_first_gstore_state_kqs(gstore): + """Read the first-file state table, or return None for legacy GSTORE files.""" + varname = "gstore_glob_state_kqs" + if varname in gstore.r.rootgrp.variables: + return gstore.r.read_value(varname) + + print( + f"{gstore.basename} does not provide the NetCDF variable {varname}. " + "Assuming all its (spin, q, k) entries were computed." + ) + return None + + @staticmethod + def _get_first_gstore_comparison_mask(state_kqs, spin: int, gvals: np.ndarray) -> np.ndarray: + """Select reconstructed entries, or every entry when the legacy state table is absent.""" + if state_kqs is None: + return np.ones(gvals.shape[:2], dtype=bool) + return state_kqs[spin] == GSTORE_KQ_SYMMETRIZED + def neq(self, ref_basename: str | None = None, verbose: int = 0) -> int: """ Compare all GSTORE.nc files stored in the GstoreRobot @@ -1190,6 +1210,8 @@ def compare_gvals_with_reconstruction(self, ax_list=None, tol: float = 1e-6, mag Only the (k, q) points that were actually reconstructed by symmetry in the first file (gstore_glob_state_kqs == GSTORE_KQ_SYMMETRIZED) are used for the statistics and the plots. + If the first file predates the ``gstore_glob_state_kqs`` variable, all of its entries are + assumed to have been computed and are included in the comparison. Including the directly-computed points (trivially expected to agree in both files) and flattening the whole (glob_nq, glob_nk, natom3, nb_kq, nb_k) array, as done previously, buries the actual test: e.g. (k, q) points that reconstruct exactly (diff ~1e-15) get @@ -1258,13 +1280,18 @@ def compare_gvals_with_reconstruction(self, ax_list=None, tol: float = 1e-6, mag ) # Read internal table with the state of (k, q, spin). Shape: (nsppol, glob_nq, glob_nk). - state1_kqs = g1.r.read_value("gstore_glob_state_kqs") + # Legacy GSTORE files do not have this recently added variable. Such files contain + # directly computed entries, so compare all their (q, k) points. + state1_kqs = self._read_first_gstore_state_kqs(g1) state2_kqs = g2.r.read_value("gstore_glob_state_kqs") if verbose: - print("state1_kqs vs state2_kqs") - for idx in np.ndindex(state1_kqs.shape): - print(f"{idx}: {state1_kqs[idx]} {state2_kqs[idx]}") + if state1_kqs is None: + print("state1_kqs is unavailable; all first-file entries are assumed computed.") + else: + print("state1_kqs vs state2_kqs") + for idx in np.ndindex(state1_kqs.shape): + print(f"{idx}: {state1_kqs[idx]} {state2_kqs[idx]}") for spin in range(g1.nsppol): gvals1 = g1.gqk_spin[spin].gvals @@ -1273,7 +1300,7 @@ def compare_gvals_with_reconstruction(self, ax_list=None, tol: float = 1e-6, mag if gvals1.shape != gvals2.shape: raise ValueError(f"Shape mismatch for spin {spin}: {gvals1.shape} vs {gvals2.shape}") - sym_mask = state1_kqs[spin] == GSTORE_KQ_SYMMETRIZED # (glob_nq, glob_nk) + sym_mask = self._get_first_gstore_comparison_mask(state1_kqs, spin, gvals1) n_sym = int(sym_mask.sum()) if n_sym == 0: cprint(f"Spin {spin}: no GSTORE_KQ_SYMMETRIZED (k, q) points found, skipping.", "yellow") @@ -1492,6 +1519,9 @@ def compare_gvals_gauge_invariant(self, tol: float = 1e-6, deg_tol: float = 1e-4 while still being fully sensitive to genuine errors (including phase errors for non-degenerate, i.e. 1x1, blocks). + If the first file predates the ``gstore_glob_state_kqs`` variable, all of its entries are + assumed to have been computed and are included in the comparison. + Args: tol: Tolerance on the per-(k, q) max singular-value difference used to classify a symmetrized point as an exact match. @@ -1517,6 +1547,8 @@ def find_multiplets(energies: np.ndarray, etol: float) -> list: groups.append([int(order[i])]) return groups + state1_kqs = self._read_first_gstore_state_kqs(g1) + for spin in range(g1.nsppol): gqk1, gqk2 = g1.gqk_spin[spin], g2.gqk_spin[spin] gvals1, gvals2 = gqk1.gvals, gqk2.gvals @@ -1524,8 +1556,7 @@ def find_multiplets(energies: np.ndarray, etol: float) -> list: if gvals1.shape != gvals2.shape: raise ValueError(f"Shape mismatch for spin {spin}: {gvals1.shape} vs {gvals2.shape}") - state1_kqs = g1.r.read_value("gstore_glob_state_kqs") - sym_mask = state1_kqs[spin] == GSTORE_KQ_SYMMETRIZED # (glob_nq, glob_nk) + sym_mask = self._get_first_gstore_comparison_mask(state1_kqs, spin, gvals1) if not np.any(sym_mask): cprint(f"Spin {spin}: no GSTORE_KQ_SYMMETRIZED (k, q) points found, skipping.", "yellow") continue From bc8890827a97b744def684b2c97f8ca6137fbbde Mon Sep 17 00:00:00 2001 From: Matteo Giantomassi Date: Sun, 27 Sep 2026 23:38:42 +0200 Subject: [PATCH 06/23] Change needed to support phonopy4 --- abipy/dfpt/converters.py | 11 +++++++---- abipy/embedding/embedding_ifc.py | 7 ++++++- abipy/embedding/tests/test_embedding_ifc.py | 1 + abipy/flowtk/abiphonopy.py | 6 +++++- abipy/flowtk/tests/test_abiphonopy.py | 3 +++ abipy/lumi/lineshape.py | 8 ++++++-- abipy/lumi/tests/test_lineshape.py | 1 + abipy/ml/ml_phonopy.py | 16 ++++++++++------ 8 files changed, 39 insertions(+), 14 deletions(-) diff --git a/abipy/dfpt/converters.py b/abipy/dfpt/converters.py index 6b7ab4a0b..e80785655 100644 --- a/abipy/dfpt/converters.py +++ b/abipy/dfpt/converters.py @@ -15,7 +15,7 @@ from phonopy import Phonopy, load from phonopy.file_IO import parse_BORN, parse_FORCE_CONSTANTS, parse_FORCE_SETS, write_FORCE_CONSTANTS from phonopy.harmonic import force_constants -from phonopy.interface.calculator import get_default_physical_units, get_force_constant_conversion_factor +from phonopy.interface.calculator import get_calculator_physical_units, get_force_constant_conversion_factor from pymatgen.io.phonopy import get_phonopy_structure, get_pmg_structure from pymatgen.io.vasp.inputs import Poscar @@ -334,8 +334,8 @@ def phonopy_to_abinit( pass if calculator: - units = get_default_physical_units(calculator) - fc_factor = get_force_constant_conversion_factor(units["force_constants_unit"], None) + units = get_calculator_physical_units(calculator) + fc_factor = get_force_constant_conversion_factor(units.force_constants_unit, None) phonon.force_constants = phonon.force_constants * fc_factor if pseudos is None: @@ -488,7 +488,10 @@ def get_dm(phonon, qpt_list: list, structure: Structure) -> list: q_cart = rlatt.get_cartesian_coords(q) # the phase exp(-i * q.r) phase = np.exp(-1j * np.einsum("ijk,k", diff_coords, q_cart)) - dm = phonon.get_dynamical_matrix_at_q(q).reshape(natom, 3, natom, 3) + phonon.run_qpoints([q], with_dynamical_matrices=True) + if phonon.qpoints is None or phonon.qpoints.dynamical_matrices is None: + raise RuntimeError(f"Phonopy did not produce a dynamical matrix at q-point {q}") + dm = phonon.qpoints.dynamical_matrices[0].reshape(natom, 3, natom, 3) # the following is rprim * dm[ipert1,:,ipert2,:] * rprim.T dm = np.einsum("ij,kjlm,nm->kiln", rprimd, dm, rprimd) dm = dm * mass_matrix / phase[:, None, :, None] diff --git a/abipy/embedding/embedding_ifc.py b/abipy/embedding/embedding_ifc.py index 291187a9d..341b5786f 100644 --- a/abipy/embedding/embedding_ifc.py +++ b/abipy/embedding/embedding_ifc.py @@ -255,7 +255,12 @@ def get_gamma_freq_with_vec_abipy_fmt(self) -> tuple[np.ndarray, np.ndarray]: Returns: phonons frequencies, phonon eigenvectors """ - ph_freq_phonopy, ph_vec_phonopy = self.get_frequencies_with_eigenvectors(q=[0, 0, 0]) + self.run_qpoints([[0, 0, 0]], with_eigenvectors=True) + if self.qpoints is None or self.qpoints.eigenvectors is None: + raise RuntimeError("Phonopy did not produce Gamma-point eigenvectors") + + ph_freq_phonopy = self.qpoints.frequencies[0] + ph_vec_phonopy = self.qpoints.eigenvectors[0] ph_freq = ph_freq_phonopy / (eV_to_THz) # put it in eV ph_vec = ph_vec_phonopy.transpose().reshape(3 * len(self.supercell), len(self.supercell), 3) diff --git a/abipy/embedding/tests/test_embedding_ifc.py b/abipy/embedding/tests/test_embedding_ifc.py index 74c226328..f29293564 100644 --- a/abipy/embedding/tests/test_embedding_ifc.py +++ b/abipy/embedding/tests/test_embedding_ifc.py @@ -100,6 +100,7 @@ def test_embedding_substitution(self): ph_defect = phonopy.load( supercell_filename=abidata.ref_file("refs/embedding_ifc/SrCl2_Eu_POSCAR"), force_sets_filename=abidata.ref_file("refs/embedding_ifc/SrCl2_Eu_FORCE_SETS"), + primitive_matrix="P", ) ######## diff --git a/abipy/flowtk/abiphonopy.py b/abipy/flowtk/abiphonopy.py index 58d55e00f..c1444aea6 100644 --- a/abipy/flowtk/abiphonopy.py +++ b/abipy/flowtk/abiphonopy.py @@ -90,8 +90,12 @@ def from_gs_input(cls, gs_inp: AbinitInput, scdims, phonopy_kwargs=None, displ_k raise ValueError(f"Expecting 3 int in scdims but got {scdims=}") supercell_matrix = np.diag(scdims) - phonopy_kwargs = phonopy_kwargs if phonopy_kwargs is not None else {} + phonopy_kwargs = dict(phonopy_kwargs) if phonopy_kwargs is not None else {} nac_params = phonopy_kwargs.pop("nac_params", None) + # Phonopy 4 changed the default from the identity matrix to automatic + # primitive-cell detection. Keep the established AbiPy behavior while + # allowing callers to opt into the new behavior with ``"auto"``. + phonopy_kwargs.setdefault("primitive_matrix", "P") new.phonon = phonon = Phonopy(unitcell, supercell_matrix, **phonopy_kwargs) if nac_params is not None: phonon.nac_params = nac_params diff --git a/abipy/flowtk/tests/test_abiphonopy.py b/abipy/flowtk/tests/test_abiphonopy.py index 4bd7af6c9..05062771a 100644 --- a/abipy/flowtk/tests/test_abiphonopy.py +++ b/abipy/flowtk/tests/test_abiphonopy.py @@ -1,5 +1,7 @@ """Tests for abiphonopy module""" +import numpy as np + import abipy.data as abidata import abipy.flowtk.abiphonopy as abiph from abipy import flowtk @@ -27,6 +29,7 @@ def test_phonopy_work(self): self.assert_equal(scdims, phpy_work.scdims) assert hasattr(phpy_work, "phonon") + self.assert_equal(phpy_work.phonon.primitive_matrix, np.eye(3)) assert len(phpy_work.phonopy_tasks) == len(phpy_work) assert len(phpy_work.phonopy_tasks) == 1 assert len(phpy_work.bec_tasks) == 0 diff --git a/abipy/lumi/lineshape.py b/abipy/lumi/lineshape.py index 667ad98ae..5ed001c97 100644 --- a/abipy/lumi/lineshape.py +++ b/abipy/lumi/lineshape.py @@ -77,8 +77,12 @@ def from_phonopy_phonons( Returns: A lineshape object """ - ph_modes = phonopy_ph.get_frequencies_with_eigenvectors(q=[0, 0, 0]) - ph_freq_phonopy, ph_vec_phonopy = ph_modes + phonopy_ph.run_qpoints([[0, 0, 0]], with_eigenvectors=True) + if phonopy_ph.qpoints is None or phonopy_ph.qpoints.eigenvectors is None: + raise RuntimeError("Phonopy did not produce Gamma-point eigenvectors") + + ph_freq_phonopy = phonopy_ph.qpoints.frequencies[0] + ph_vec_phonopy = phonopy_ph.qpoints.eigenvectors[0] freqs = ph_freq_phonopy * (1 / abu.eV_to_THz) # THz to eV vecs = ph_vec_phonopy.transpose() diff --git a/abipy/lumi/tests/test_lineshape.py b/abipy/lumi/tests/test_lineshape.py index f440a697f..820006c2b 100644 --- a/abipy/lumi/tests/test_lineshape.py +++ b/abipy/lumi/tests/test_lineshape.py @@ -45,6 +45,7 @@ def test_deltaSCF(self): ph_defect = phonopy.load( supercell_filename=abidata.ref_file("refs/embedding_ifc/SrCl2_Eu_POSCAR"), force_sets_filename=abidata.ref_file("refs/embedding_ifc/SrCl2_Eu_FORCE_SETS"), + primitive_matrix="P", ) ######## diff --git a/abipy/ml/ml_phonopy.py b/abipy/ml/ml_phonopy.py index b43eeb33e..246a91b13 100644 --- a/abipy/ml/ml_phonopy.py +++ b/abipy/ml/ml_phonopy.py @@ -43,7 +43,7 @@ def get_phonopy( supercell_matrix, calculator: Calculator, distance=0.01, - primitive_matrix=None, + primitive_matrix="P", remove_drift=True, ) -> Phonopy: """ @@ -54,7 +54,10 @@ def get_phonopy( supercell_matrix: Supercell matrix. calculator: ASE calculator to be attached to the atoms. distance: Distance of finite displacements in Angstrom. - primitive_matrix + primitive_matrix: Transformation matrix used to build the primitive + cell. The default ``"P"`` keeps the input unit cell, matching + phonopy 3 behavior. Pass ``"auto"`` to request phonopy 4's + automatic primitive-cell detection. remove_drift: True if the drift in the forces should be removed. Based on a similar implementation available at: https://github.com/modl-uclouvain/randomcarbon/blob/main/randomcarbon/run/phonon.py @@ -82,7 +85,8 @@ def get_phonopy( forces_list.append(forces) print(f"\t{i + 1} of {nsc} completed ...") - phonon.produce_force_constants(forces_list) + phonon.forces = forces_list + phonon.produce_force_constants() return phonon @@ -256,7 +260,7 @@ def _run_nn_name(self, nn_name: str) -> None: # Include non-analytical term if dipoles are available in the DDB file. with Timer(header=f"Calling get_phonopy with {nn_name=}", footer=""): phonon = get_phonopy( - atoms, self.supercell, calculator, distance=self.distance, primitive_matrix=None, remove_drift=True + atoms, self.supercell, calculator, distance=self.distance, primitive_matrix="P", remove_drift=True ) if self.abi_nac_params: print("Including dipolar term in phonopy using BECS and eps_inf taken from DDB.") @@ -463,7 +467,7 @@ def _run_nn_name(self, nn_name: str) -> dict: # Include non-analytical term if dipoles are available in the DDB file. with Timer(header=f"Calling get_phonopy with {nn_name=}", footer=""): phonon = get_phonopy( - atoms, self.supercell, calculator, distance=self.distance, primitive_matrix=None, remove_drift=True + atoms, self.supercell, calculator, distance=self.distance, primitive_matrix="P", remove_drift=True ) plt = phonon.auto_band_structure( @@ -644,7 +648,7 @@ def run(self) -> None: self.supercell, calculator, distance=self.distance, - primitive_matrix=None, + primitive_matrix="P", remove_drift=True, ) From 68649108f6ffbd911783133bc4a34946f1919394 Mon Sep 17 00:00:00 2001 From: Matteo Giantomassi Date: Sun, 27 Sep 2026 23:54:06 +0200 Subject: [PATCH 07/23] Remove requirements files, move to pyproject.toml --- .github/workflows/test.yml | 6 +---- INSTALL | 3 +-- README.rst | 23 +++++++---------- abipy/integration_tests/TODO.md | 2 +- binder/get_newenv.sh | 3 +-- dev_scripts/deploy_abigui.sh | 4 +-- docs/README.rst | 5 ++-- docs/coding_guide.rst | 3 +-- docs/install.sh | 5 +--- docs/installation.rst | 4 +-- docs/requirements.txt | 14 ---------- pip_all.sh | 12 +++------ pyproject.toml | 46 ++++++++++++++++++++++++++++++--- requirements-optional.txt | 17 ------------ requirements-panel.txt | 11 -------- requirements-tests.txt | 7 ----- requirements.txt | 26 ------------------- setup.py | 38 --------------------------- 18 files changed, 67 insertions(+), 162 deletions(-) delete mode 100644 docs/requirements.txt delete mode 100644 requirements-optional.txt delete mode 100644 requirements-panel.txt delete mode 100644 requirements-tests.txt delete mode 100644 requirements.txt diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5da59d49e..296b535a1 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -60,10 +60,7 @@ jobs: git submodule update --remote --init git submodule update --recursive --remote - pip install -r requirements.txt - pip install -r requirements-optional.txt - pip install -r requirements-panel.txt - pip install --editable . + pip install --editable ".[optional,panel,tests]" mkdir -p $HOME/.abinit/abipy/ cp abipy/data/managers/gh_manager.yml $HOME/.abinit/abipy/manager.yml cp abipy/data/managers/gh_scheduler.yml $HOME/.abinit/abipy/scheduler.yml @@ -74,7 +71,6 @@ jobs: - name: pytest run: | conda activate abipy - pip install -r requirements-tests.txt pytest -v . - name: integration_tests diff --git a/INSTALL b/INSTALL index b079a634f..1f751a602 100644 --- a/INSTALL +++ b/INSTALL @@ -32,6 +32,5 @@ Once you have satisfied the requirements detailed above, you can build abipy:: cd abipy python setup.py build - python setup.py install - + python -m pip install . diff --git a/README.rst b/README.rst index 3facfc1b1..e67b7c123 100644 --- a/README.rst +++ b/README.rst @@ -105,10 +105,9 @@ Clone the `github repository `_ with:: git clone https://github.com/abinit/abipy -For pip, use:: +For pip, install AbiPy in editable mode with its optional dependencies:: - pip install -r requirements.txt - pip install -r requirements-optional.txt + python -m pip install --editable ".[optional]" If you are using conda_ (see `Installing conda`_ to install conda itself), create a new environment (``abienv``) with:: @@ -120,21 +119,17 @@ Add ``conda-forge``, and ``abinit`` to your channels with:: conda config --add channels conda-forge conda config --add channels abinit -and install the AbiPy dependencies with:: +Install ABINIT with conda and AbiPy with pip so that dependencies are read from +``pyproject.toml``:: - conda install --file ./requirements.txt - conda install --file ./requirements-optional.txt - -The second command is needed for Jupyter only. -Once the requirements have been installed (either with pip or conda), execute:: - - python setup.py install + conda install abinit -c conda-forge + python -m pip install --editable ".[optional]" -or alternately:: +The ``optional`` extra includes Jupyter and other optional analysis libraries. +For a complete development installation, including tests and Panel applications, use:: - python setup.py develop + ./pip_all.sh -to install the package in developmental mode. This is the recommended approach, especially if you are planning to implement new features. Also note that the BLAS/Lapack libraries provided by conda have multithreading support activated by default. diff --git a/abipy/integration_tests/TODO.md b/abipy/integration_tests/TODO.md index c6098c2ce..3cccd6dc9 100644 --- a/abipy/integration_tests/TODO.md +++ b/abipy/integration_tests/TODO.md @@ -75,7 +75,7 @@ TODO list: eigvec_qp = self.read_variable("eigvec_qp") scales quite badly with nands * Migrate to pyproject.toml. Implement script to generate requirements.yml - Very likely `conda install --file requirements-optional.txt` is now broken to the introduction of `-r`. + Optional dependencies are installed from the extras declared in ``pyproject.toml``. ## Medium priority diff --git a/binder/get_newenv.sh b/binder/get_newenv.sh index 47e70bbe4..1f2fc9286 100644 --- a/binder/get_newenv.sh +++ b/binder/get_newenv.sh @@ -2,7 +2,6 @@ # WARNING: Must be executed on a linux box. conda env remove -n abipy_binder conda create -n abipy_binder python=3.8 -conda install --file ../requirements.txt -y -c conda-forge -conda install --file ../requirements-optional.txt -y -c conda-forge +python -m pip install --editable "../[optional]" conda install abinit -c conda-forge conda env export > environment.yml diff --git a/dev_scripts/deploy_abigui.sh b/dev_scripts/deploy_abigui.sh index ff4e195ab..abeaabe2b 100755 --- a/dev_scripts/deploy_abigui.sh +++ b/dev_scripts/deploy_abigui.sh @@ -13,9 +13,7 @@ conda create -n ${env_name} -y python=3.9 #source activate ${env_name} conda activate ${env_name} -pip install -r ./requirements.txt -pip install -r ./requirements-optional.txt -python setup.py install +python -m pip install --editable ".[optional]" #conda install abinit -c conda-forge diff --git a/docs/README.rst b/docs/README.rst index 6ba50bfba..b1e39c087 100644 --- a/docs/README.rst +++ b/docs/README.rst @@ -36,9 +36,10 @@ statement, such as:: The output produced by Sphinx can be configured by editing the :file:`conf.py` file located in the :file:`docs/`. Before building the documentation, you need to install the sphinx extensions listed -in :file:`abipy/docs/requirements.txt` with:: +in the ``docs`` optional-dependency group in :file:`abipy/pyproject.toml` with:: - pip install -r abipy/docs/requirements.txt + cd abipy + python -m pip install --editable ".[docs]" To build the HTML documentation, install sphinx then type ``make`` that will execute:: diff --git a/docs/coding_guide.rst b/docs/coding_guide.rst index 4006f3dae..5dca1bfcf 100644 --- a/docs/coding_guide.rst +++ b/docs/coding_guide.rst @@ -116,7 +116,7 @@ contains several output files that can be used for writing unit tests and exampl To install pytest with useful plugins, use:: - pip install -r requirements-tests.txt + python -m pip install --editable ".[tests]" in the top-level directory of the package. To run the tests associated to the abio.inputs module, use:: @@ -128,4 +128,3 @@ or use:: pytest -v to run the entire test suite. - diff --git a/docs/install.sh b/docs/install.sh index cb88526d4..fa9a51634 100755 --- a/docs/install.sh +++ b/docs/install.sh @@ -1,8 +1,5 @@ #!/bin/bash set -ev # exit on first error, print each command -pip install -r ./requirements.txt -pip install -r ../requirements-optional.txt -pip install -r ../requirements-panel.txt -pip install -r requirements.txt +python -m pip install --editable "../[optional,panel,docs]" conda install graphviz -c conda-forge --yes diff --git a/docs/installation.rst b/docs/installation.rst index 5a2c9f166..2694f6350 100644 --- a/docs/installation.rst +++ b/docs/installation.rst @@ -125,11 +125,11 @@ You can clone it from our `github repository ` After cloning the repository, type:: - python setup.py install + python -m pip install . or alternately:: - python setup.py develop + python -m pip install --editable . to install the package in developmental mode (Develop mode is the recommended approach if you are planning to implement new features. diff --git a/docs/requirements.txt b/docs/requirements.txt deleted file mode 100644 index 6c277156f..000000000 --- a/docs/requirements.txt +++ /dev/null @@ -1,14 +0,0 @@ -ipython -sphinx -sphinxcontrib-napoleon -sphinxcontrib-programoutput -sphinx-gallery -sphinx-argparse -sphinx_rtd_theme -sphinxcontrib-bibtex -sphinx-autodoc-typehints -#sphinx_click -jupyter-sphinx -#graphviz or python-graphviz if conda -graphviz -scikit-image diff --git a/pip_all.sh b/pip_all.sh index b60428b30..4613a7d9c 100755 --- a/pip_all.sh +++ b/pip_all.sh @@ -1,14 +1,8 @@ #!/bin/bash set -ev # exit on first error, print each command -# Install all requirements files in ONE pip resolve. Separate `pip install -r` -# calls each resolve independently, so a package pulled in transitively by an -# earlier file (e.g. jinja2 via panel, from requirements-panel.txt) can be left -# behind a later file's own dependency's floor on that same package (e.g. -# pandas' optional jinja2>=3.1.5 requirement for pandas.io.formats.style) -- -# pip never gets a chance to reconcile the two in a single cross-file resolve. -pip install -r requirements.txt -r requirements-optional.txt -r requirements-panel.txt -r requirements-tests.txt -python setup.py develop +# Install AbiPy and all development extras in one resolve. Dependency groups +# are defined in pyproject.toml, the single source of package metadata. +python -m pip install --editable ".[optional,panel,tests,dev]" -pip install invoke invoke submodules diff --git a/pyproject.toml b/pyproject.toml index 96e9656c1..0916627e3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -67,14 +67,57 @@ dependencies = [ "pymatgen", "monty", "pyyaml>=3.11", + "ruamel.yaml>=0.16.12", "scipy", "seaborn", "spglib", + "sympy", "tabulate", "tqdm", ] version = "1.0.0" +[project.optional-dependencies] +optional = [ + "ipywidgets", + "jupyter", + "nbformat", + "networkx", + "pygments", + "scikit-image", +] +panel = [ + "bokeh", + "jinja2>=3.1.5", + "panel>=0.13.0", + "param", + "XlsxWriter", +] +tests = [ + "pytest", + "pytest-cov", + "pytest-sugar", + "pytest-xdist", + "python-coveralls", + "scripttest", +] +docs = [ + "graphviz", + "jupyter-sphinx", + "scikit-image", + "sphinx", + "sphinx-argparse", + "sphinx-autodoc-typehints", + "sphinx-gallery", + "sphinx-rtd-theme", + "sphinxcontrib-bibtex", + "sphinxcontrib-napoleon", + "sphinxcontrib-programoutput", +] +dev = [ + "invoke", +] + [project.urls] Homepage = "https://github.com/abinit/abipy" Download = "https://github.com/abinit/abipy" @@ -83,9 +126,6 @@ Repository = "https://github.com/abinit/abipy" Issues = "https://github.com/abinit/abipy/issues" Pypi = "https://pypi.org/project/abipy" -#[project.optional-dependencies] -#abinit = ["netcdf4>=1.7.2"] - #[project.scripts] #pmg = "pymatgen.cli.pmg:main" diff --git a/requirements-optional.txt b/requirements-optional.txt deleted file mode 100644 index f1553583b..000000000 --- a/requirements-optional.txt +++ /dev/null @@ -1,17 +0,0 @@ -# List of all optional dependencies. -# This file includes other requirements-*.txt files providing libraries for specialized target -# so that we can easily select what we need - -jupyter -nbformat -pygments -ipywidgets -networkx -scikit-image -#python-graphviz #graphviz or python-graphviz if conda - -# Libraries required by AbiPy panel applications. -# -r requirements-panel.txt - -# Libraries required for running unit tests. -# -r requirements-tests.txt diff --git a/requirements-panel.txt b/requirements-panel.txt deleted file mode 100644 index 6fe44209b..000000000 --- a/requirements-panel.txt +++ /dev/null @@ -1,11 +0,0 @@ -# Libraries required by AbiPy panel applications. -param -panel >= 0.13.0 -bokeh -XlsxWriter # For DataFrame.to_excel() -# pandas.io.formats.style (used by panel's Tabulator, see abipy/panels/core.py::dfc) -# requires jinja2>=3.1.5 at runtime, but no installed package declares that floor -# in its own metadata (jupyterlab only needs >=3.0.3, bokeh only >=2.9), so pip -# never upgrades past whatever satisfies those and 3.1.5+ must be pinned here. -jinja2>=3.1.5 -#pymdown-extensions diff --git a/requirements-tests.txt b/requirements-tests.txt deleted file mode 100644 index be4f1da7c..000000000 --- a/requirements-tests.txt +++ /dev/null @@ -1,7 +0,0 @@ -# Libraries required for running unit tests. -pytest -python-coveralls -pytest-cov -pytest-xdist -pytest-sugar -scripttest diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index d69c4d1e7..000000000 --- a/requirements.txt +++ /dev/null @@ -1,26 +0,0 @@ -packaging -monty -tabulate -apscheduler<=3.10.4 -pydispatcher>=2.0.5 -tqdm -pyyaml>=3.11 -ruamel.yaml>=0.16.12 -pandas -numpy -sympy -spglib -pymatgen -monty -netCDF4 -matplotlib -seaborn -plotly -ipython -chart-studio -click -phonopy -seekpath -ase -# TODO remove after https://github.com/materialsproject/emmet/issues/768 is fixed -#pydantic<2.0.0 diff --git a/setup.py b/setup.py index b4ee4f9ac..5417e627d 100755 --- a/setup.py +++ b/setup.py @@ -142,43 +142,6 @@ def cleanup(): pass -# List of external packages we rely on. -# Note setup install will download them from Pypi if they are not available. -# with open("requirements.txt", "rt") as fh: -# install_requires = [s.strip() for s in fh] - -install_requires = [ - "packaging", - "tabulate", - "apscheduler<=3.10.4", - "pydispatcher>=2.0.5", - "tqdm", - "pyyaml>=3.11", - "pandas", - "numpy", - #"numpy<2.0.0", - "scipy", - "spglib", - # "pymatgen==v2024.10.29", - # "monty==v2024.10.21", - "pymatgen", - "monty", - "netCDF4", - "matplotlib", - "seaborn", - "plotly", - "ipython", - "chart-studio", - "click", - #"phonopy<=2.31.2", - "phonopy", - "seekpath", - "ase", - # "custodian", - # "pydantic', - # "panel", -] - # --------------------------------------------------------------------------- # Find all the packages, package data, and data_files # --------------------------------------------------------------------------- @@ -200,7 +163,6 @@ def cleanup(): platforms=platforms, keywords=keywords, classifiers=classifiers, - install_requires=install_requires, packages=find_packages(exclude=()), package_data=find_package_data(), exclude_package_data=find_exclude_package_data(), From 69b61a8b86f87410d1eb87ff62056e579fae4086 Mon Sep 17 00:00:00 2001 From: Matteo Giantomassi Date: Sun, 27 Sep 2026 23:58:05 +0200 Subject: [PATCH 08/23] Require phonopy < 4.0 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 0916627e3..95bd155d1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -60,7 +60,7 @@ dependencies = [ "numpy", "packaging", "pandas", - "phonopy", + "phonopy<4.0", "seekpath", "plotly", "pydispatcher>=2.0.5", From e0588174e560235ab8be6a5bff94cc29dfcc00bd Mon Sep 17 00:00:00 2001 From: Matteo Giantomassi Date: Mon, 28 Sep 2026 00:33:00 +0200 Subject: [PATCH 09/23] Continue to fix deprecation warnings --- .pre-commit-config.yaml | 18 +++++------ abipy/core/fields.py | 2 +- abipy/core/gsphere.py | 4 +-- abipy/core/kpoints.py | 3 +- abipy/core/symmetries.py | 10 +++--- abipy/core/tests/test_gsphere.py | 6 ++-- abipy/core/tests/test_mesh3d.py | 3 +- abipy/iotools/__init__.py | 21 +++++-------- abipy/panels/a2f.py | 2 +- abipy/panels/core.py | 54 ++++++++++++++++---------------- abipy/panels/ddb.py | 48 ++++++++++++++-------------- abipy/panels/electrons.py | 4 +-- abipy/panels/fatbands.py | 6 ++-- abipy/panels/flows.py | 16 +++++----- abipy/panels/gsr.py | 4 +-- abipy/panels/hist.py | 10 +++--- abipy/panels/nodes.py | 32 +++++++++---------- abipy/panels/oncvpsp_gui.py | 22 ++++++------- abipy/panels/phonons.py | 6 ++-- abipy/panels/sigeph.py | 6 ++-- abipy/panels/structure.py | 54 ++++++++++++++++---------------- abipy/panels/tasks.py | 4 +-- abipy/panels/viewers.py | 4 +-- 23 files changed, 165 insertions(+), 174 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d07413057..8292b3280 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -32,15 +32,15 @@ repos: # - id: mypy # #additional_dependencies: [numpy>=1.2.5] - - repo: https://github.com/codespell-project/codespell - rev: v2.4.1 - hooks: - - id: codespell - stages: [pre-commit, commit-msg] - exclude_types: [html] - args: [--ignore-words=.codespell.ignore] - additional_dependencies: [tomli] # needed to read pyproject.toml below py3.11 - #exclude: src/pymatgen/analysis/aflow_prototypes.json + #- repo: https://github.com/codespell-project/codespell + # rev: v2.4.1 + # hooks: + # - id: codespell + # stages: [pre-commit, commit-msg] + # exclude_types: [html] + # args: [--ignore-words=.codespell.ignore] + # additional_dependencies: [tomli] # needed to read pyproject.toml below py3.11 + # #exclude: src/pymatgen/analysis/aflow_prototypes.json #- repo: https://github.com/adamchainz/blacken-docs # rev: 1.19.1 diff --git a/abipy/core/fields.py b/abipy/core/fields.py index 2927cddd8..0cd6f8264 100644 --- a/abipy/core/fields.py +++ b/abipy/core/fields.py @@ -1119,7 +1119,7 @@ def from_chgcar_poscar(cls, chgcar, poscar): if isinstance(chgcar, str): chgcar = Chgcar.from_file(chgcar) if isinstance(poscar, str): - poscar = Poscar.from_file(poscar, check_for_POTCAR=False, read_velocities=False) + poscar = Poscar.from_file(poscar, check_for_potcar=False, read_velocities=False) nx, ny, nz = chgcar.dim nspinor = 1 diff --git a/abipy/core/gsphere.py b/abipy/core/gsphere.py index e19175342..3c8f70b2b 100644 --- a/abipy/core/gsphere.py +++ b/abipy/core/gsphere.py @@ -188,7 +188,7 @@ def tofftmesh(self, mesh, arr_on_sphere) -> np.ndarray: if s0 == 1: # Reinstate input shape - arr_on_mesh.shape = mesh.shape + arr_on_mesh = arr_on_mesh.reshape(mesh.shape) return arr_on_mesh @@ -226,7 +226,7 @@ def fromfftmesh(self, mesh, arr_on_mesh) -> np.ndarray: if s0 == 1 and indim == 1: # Reinstate input shape - arr_on_sphere.shape = self.npw + arr_on_sphere = arr_on_sphere.reshape(self.npw) return arr_on_sphere diff --git a/abipy/core/kpoints.py b/abipy/core/kpoints.py index 24cd29825..a96d6436c 100644 --- a/abipy/core/kpoints.py +++ b/abipy/core/kpoints.py @@ -1339,8 +1339,7 @@ def from_vertices_and_names(cls, structure, vertices_names, line_density: int = gmet = structure.lattice.reciprocal_lattice.metric_tensor vnames = [str(vn[1]) for vn in vertices_names] - vertices = np.array([vn[0] for vn in vertices_names], dtype=float) - vertices.shape = (-1, 3) + vertices = np.array([vn[0] for vn in vertices_names], dtype=float).reshape((-1, 3)) dl_vals = [] for ik, k0 in enumerate(vertices[:-1]): diff --git a/abipy/core/symmetries.py b/abipy/core/symmetries.py index 64ff57b0f..cdc58e00b 100644 --- a/abipy/core/symmetries.py +++ b/abipy/core/symmetries.py @@ -889,7 +889,7 @@ def find_little_group(self, kpoint): def get_spglib_hall_number(self, symprec=1e-5): """ - Uses spglib.get_hall_number_from_symmetry to determine the hall number + Uses spglib.get_spacegroup_type_from_symmetry to determine the hall number based on the symmetry operations. Useful when the space group number is not available, but the symmetries are (e.g. the DDB file) @@ -900,7 +900,10 @@ def get_spglib_hall_number(self, symprec=1e-5): Returns: int: the hall number. """ - return spglib.get_hall_number_from_symmetry(self.symrel, self.tnons, symprec=symprec) + spg_type = spglib.get_spacegroup_type_from_symmetry(self.symrel, self.tnons, symprec=symprec) + if spg_type is None: + raise ValueError("Cannot determine the space-group type from the symmetry operations") + return spg_type.hall_number # FIXME To maintain backward compatibility. @@ -1026,8 +1029,7 @@ class LatticeRotation(Operation): def __init__(self, mat): """Initialize the object from a 3x3 matrix.""" - self.mat = np.asarray(mat, dtype=int) - self.mat.shape = (3, 3) + self.mat = np.asarray(mat, dtype=int).reshape((3, 3)) def _find_order_and_rootinv(self): """Returns the order of the rotation and if self is a root of the inverse.""" diff --git a/abipy/core/tests/test_gsphere.py b/abipy/core/tests/test_gsphere.py index 15b2077ef..b5274a5a2 100644 --- a/abipy/core/tests/test_gsphere.py +++ b/abipy/core/tests/test_gsphere.py @@ -13,8 +13,7 @@ class TestGSphere(AbipyTest): def test_base(self): """Basic G-sphere methods""" ecut = 2 - lattice = np.array([1.0, 0, 0, 0, 1, 0, 0, 0, 1]) - lattice.shape = (3, 3) + lattice = np.array([1.0, 0, 0, 0, 1, 0, 0, 0, 1]).reshape((3, 3)) kpoint = [0, 0, 0] gvecs = np.array([[0, 0, 0], [1, 0, 0]]) @@ -44,8 +43,7 @@ def test_base(self): def test_fft(self): """FFT transforms""" - rprimd = np.array([1.0, 0, 0, 0, 1, 0, 0, 0, 1]) - rprimd.shape = (3, 3) + rprimd = np.array([1.0, 0, 0, 0, 1, 0, 0, 0, 1]).reshape((3, 3)) mesh = Mesh3D((12, 3, 5), rprimd) diff --git a/abipy/core/tests/test_mesh3d.py b/abipy/core/tests/test_mesh3d.py index 5aa6764be..a55500e1c 100644 --- a/abipy/core/tests/test_mesh3d.py +++ b/abipy/core/tests/test_mesh3d.py @@ -81,8 +81,7 @@ def test_base(self): def test_fft(self): """Test FFT transforms with mesh3d""" - rprimd = np.array([1.0, 0, 0, 0, 1, 0, 0, 0, 1]) - rprimd.shape = (3, 3) + rprimd = np.array([1.0, 0, 0, 0, 1, 0, 0, 0, 1]).reshape((3, 3)) mesh = Mesh3D((12, 3, 5), rprimd) extra_dims = [(), 1, (2,), (3, 1)] diff --git a/abipy/iotools/__init__.py b/abipy/iotools/__init__.py index 37d8c27dd..39c5dc312 100644 --- a/abipy/iotools/__init__.py +++ b/abipy/iotools/__init__.py @@ -57,20 +57,13 @@ def read_string(self, varname: str): Args: varname: Name of the variable """ - b = self.rootgrp.variables[varname][:] - # print(type(b)) - import netCDF4 - - try: - value = netCDF4.chartostring(b)[()].decode("utf-8") - except Exception: - try: - value = netCDF4.chartostring(b)[()] - except Exception: - try: - value = "".join(c for c in self.read_value(varname)) - except TypeError as exc: - value = "".join(c.decode("utf-8") for c in self.read_value(varname)) + chars = np.asarray(self.rootgrp.variables[varname][:]).ravel() + if chars.dtype.kind == "S": + value = b"".join(chars.tolist()).decode("utf-8") + elif chars.dtype.kind == "U": + value = "".join(chars.tolist()) + else: + value = "".join(str(c) for c in chars) return value.strip() diff --git a/abipy/panels/a2f.py b/abipy/panels/a2f.py index 3f4679fda..a4adc9c6f 100644 --- a/abipy/panels/a2f.py +++ b/abipy/panels/a2f.py @@ -21,7 +21,7 @@ def __init__(self, ncfile, **params): PanelWithElectronBands.__init__(self, ebands=ncfile.ebands, **params) self.ncfile = ncfile - self.a2f_view_btn = pnw.Button(name="Plot a2F", button_type="primary") + self.a2f_view_btn = pnw.Button(label="Plot a2F", color="primary") def get_a2f_view(self) -> pn.Row: """Return Row with widgets to visualize the structure.""" diff --git a/abipy/panels/core.py b/abipy/panels/core.py index e06927d0e..cfc959916 100644 --- a/abipy/panels/core.py +++ b/abipy/panels/core.py @@ -384,7 +384,7 @@ def ply( If everything is properly configured, a new window is automatically created in your browser. """) - btn = pnw.Button(name="Upload figure to chart studio server") + btn = pnw.Button(label="Upload figure to chart studio server") def push_to_cs(event): with ButtonContext(btn): @@ -507,7 +507,7 @@ def to_json(): # return file_download.callback() # FIXME: Menu button occupies less space but the upload does not work - # menu_btn = pnw.MenuButton(name='Export table', items=list(d.keys())) + # menu_btn = pnw.MenuButton(label='Export table', items=list(d.keys())) # menu_btn.on_click(download) # ca(menu_btn) @@ -591,12 +591,12 @@ def __init__(self, btn: pnw.Button): btn: The button to wrap with context. """ self.btn = btn - self.prev_name, self.prev_type = btn.name, btn.button_type + self.prev_name, self.prev_type = btn.label, btn.color def __enter__(self): # Disable the button. - self.btn.name = "Running ..." - self.btn.button_type = "warning" + self.btn.label = "Running ..." + self.btn.color = "warning" self.btn.loading = True self.btn.disabled = True return self.btn @@ -608,12 +608,12 @@ def __exit__(self, exc_type, exc_value, traceback): if exc_type: # Exception --> signal to the user that something went wrong for 2 seconds. - self.btn.name = str(exc_type) - self.btn.button_type = "danger" + self.btn.label = str(exc_type) + self.btn.color = "danger" time.sleep(2) # Back to the original button state. - self.btn.name, self.btn.button_type = self.prev_name, self.prev_type + self.btn.label, self.btn.color = self.prev_name, self.prev_type class Loading: @@ -823,7 +823,7 @@ def wdg_exts_with_get_panel(self, name="File extensions supported:"): from abipy.abilab import extcls_supporting_panel exts = [e[0] for e in extcls_supporting_panel(as_table=False)] - return pnw.Select(name=name, options=exts) + return pnw.Select(label=name, options=exts) @staticmethod def html_with_clipboard_btn(html_str: str, **kwargs): @@ -1069,7 +1069,7 @@ def __init__(self, structure: Structure, **params): # Change the list of allowed visualizers. self.param.structure_viewer.objects = ["jsmol", "crystalk", "ngl", "matplotlib", "plotly", "ase_atoms"] - self.view_structure_btn = pnw.Button(name="View structure", button_type="primary") + self.view_structure_btn = pnw.Button(label="View structure", color="primary") @depends_on_btn_click("view_structure_btn", show_shared_wdg_warning=False) def on_view_structure(self): @@ -1224,7 +1224,7 @@ def __init__(self, ncfile, **params): """ super().__init__(**params) self.ncfile = ncfile - self.netcdf_info_btn = pnw.Button(name="Show info", button_type="primary") + self.netcdf_info_btn = pnw.Button(label="Show info", color="primary") def get_ncfile_view(self) -> pn.Column: """Return a view with netcdf file information.""" @@ -1241,7 +1241,7 @@ def on_netcdf_info_btn(self) -> pn.Column: col = pn.Column(sizing_mode="stretch_width") ca = col.append - # nc_grpname = pnw.Select(name="nc group name", options=["/"]) + # nc_grpname = pnw.Select(label="nc group name", options=["/"]) input_string = self.ncfile.get_input_string() ca("## Input String") ca(bkw.PreText(text=input_string)) @@ -1337,26 +1337,26 @@ def __init__(self, ebands, **params): PanelWithStructure.__init__(self, structure=ebands.structure, **params) # Create buttons - self.plot_ebands_btn = pnw.Button(name="Plot e-bands", button_type="primary") - self.plot_edos_btn = pnw.Button(name="Plot e-DOS", button_type="primary") - self.plot_skw_btn = pnw.Button(name="Plot SKW interpolant", button_type="primary") + self.plot_ebands_btn = pnw.Button(label="Plot e-bands", color="primary") + self.plot_edos_btn = pnw.Button(label="Plot e-DOS", color="primary") + self.plot_skw_btn = pnw.Button(label="Plot SKW interpolant", color="primary") # Fermi surface plotter. # objects = [None, "matplotlib", "xcrysden"] # if self.has_remote_server: objects = [None, "matplotlib"] - # self.plot_fs_viewer_btn = pnw.Button(name="Plot SKW interpolant", button_type='primary') + # self.plot_fs_viewer_btn = pnw.Button(label="Plot SKW interpolant", color='primary') - self.plot_ifermi_btn = pnw.Button(name="Plot Fermi surface", button_type="primary") - # self.ifermi_plane_normal = pnw.LiteralInput(name='Plane normal (list)', value=[0, 0, 0], type=list, + self.plot_ifermi_btn = pnw.Button(label="Plot Fermi surface", color="primary") + # self.ifermi_plane_normal = pnw.LiteralInput(label='Plane normal (list)', value=[0, 0, 0], type=list, # placeholder="Enter normal in reduced coordinates") # self.ifermi_distance = pn.widgets.RangeSlider( - # name='distance', start=0, end=2 * max(ebands.structure.reciprocal_lattice.abc), + # label='distance', start=0, end=2 * max(ebands.structure.reciprocal_lattice.abc), # value=(0, 0), step=0.01) # ebands_kpath_fileinput = pnw.FileInput(accept=".nc") # ebands_kmesh_fileinput = pnw.FileInput(accept=".nc") - self.plot_effmass_btn = pnw.Button(name="Plot effective masses", button_type="primary") + self.plot_effmass_btn = pnw.Button(label="Plot effective masses", color="primary") if ebands.nsppol != 2: self.param.effmass_spin.objects = [0] @@ -1696,8 +1696,8 @@ def __init__(self, robot, **params): params: Parameters passed to the parent class. """ self.robot = robot - self.compare_params_btn = pnw.Button(name="Compare structures", button_type="primary") - self.transpose_params = pnw.Checkbox(name="Transpose table", value=True) + self.compare_params_btn = pnw.Button(label="Compare structures", color="primary") + self.transpose_params = pnw.Checkbox(label="Transpose table", value=True) super().__init__(**params) @@ -1744,14 +1744,14 @@ def __init__(self, robot, **params): # Widgets to plot ebands. self.ebands_plotter_mode = pnw.Select( - name="Plot Mode", value="gridplot", options=["gridplot", "combiplot", "boxplot", "combiboxplot"] + label="Plot Mode", value="gridplot", options=["gridplot", "combiplot", "boxplot", "combiboxplot"] ) # "animate", - self.ebands_plotter_btn = pnw.Button(name="Plot", button_type="primary") - self.ebands_df_checkbox = pnw.Checkbox(name="With Ebands DataFrame", value=False) + self.ebands_plotter_btn = pnw.Button(label="Plot", color="primary") + self.ebands_df_checkbox = pnw.Checkbox(label="With Ebands DataFrame", value=False) # Widgets to plot edos. - self.edos_plotter_mode = pnw.Select(name="Plot Mode", value="gridplot", options=["gridplot", "combiplot"]) - self.edos_plotter_btn = pnw.Button(name="Plot", button_type="primary") + self.edos_plotter_mode = pnw.Select(label="Plot Mode", value="gridplot", options=["gridplot", "combiplot"]) + self.edos_plotter_btn = pnw.Button(label="Plot", color="primary") def get_ebands_plotter_widgets(self) -> pn.Column: """Return a Column with widgets to plot electronic bands.""" diff --git a/abipy/panels/ddb.py b/abipy/panels/ddb.py index c1f93d901..01c768121 100644 --- a/abipy/panels/ddb.py +++ b/abipy/panels/ddb.py @@ -102,18 +102,18 @@ def __init__(self, **params): """ super().__init__(**params) # FIXME - self.nqsmall_list = pnw.LiteralInput(name="nqmall_list (python syntax)", value=[10, 20, 30], type=list) - # nqqpt = pnw.LiteralInput(name='nsmalls (list)', value=[10, 20, 30], type=list) + self.nqsmall_list = pnw.LiteralInput(label="nqmall_list (python syntax)", value=[10, 20, 30], type=list) + # nqqpt = pnw.LiteralInput(label='nsmalls (list)', value=[10, 20, 30], type=list) self.eps0_wrange = pnw.EditableRangeSlider( - name="Frequency range (eV)", value=(0.0, 0.1), start=0.0, end=1.0, step=0.01 + label="Frequency range (eV)", value=(0.0, 0.1), start=0.0, end=1.0, step=0.01 ) - self.temp_range = pnw.EditableRangeSlider(name="T-range in K", value=(100.0, 400), start=0, end=1000, step=50) + self.temp_range = pnw.EditableRangeSlider(label="T-range in K", value=(100.0, 400), start=0, end=1000, step=50) # Base buttons self.plot_without_asr_dipdip_btn = pnw.Button( - name="Compute phonons with/wo ASR and DIPDIP", button_type="primary" + label="Compute phonons with/wo ASR and DIPDIP", color="primary" ) # if self.has_remote_serve: @@ -168,18 +168,18 @@ def __init__(self, ddb: DdbFile, **params): self.ddb = ddb # Add buttons - self.get_epsinf_btn = pnw.Button(name="Compute", button_type="primary") - self.plot_phbands_btn = pnw.Button(name="Plot Bands and DOS", button_type="primary") - self.plot_eps0w_btn = pnw.Button(name="Plot eps0(omega)", button_type="primary") + self.get_epsinf_btn = pnw.Button(label="Compute", color="primary") + self.plot_phbands_btn = pnw.Button(label="Plot Bands and DOS", color="primary") + self.plot_eps0w_btn = pnw.Button(label="Plot eps0(omega)", color="primary") - self.plot_vsound_btn = pnw.Button(name="Calculate speed of sound", button_type="primary") - self.plot_ifc_btn = pnw.Button(name="Compute IFC(R)", button_type="primary") - self.plot_phbands_quad_btn = pnw.Button(name="Plot PHbands with/without quadrupoles", button_type="primary") - self.plot_dos_vs_qmesh_btn = pnw.Button(name="Plot PHDos vs Qmesh", button_type="primary") - self.compute_elastic_btn = pnw.Button(name="Compute Elastic", button_type="primary") + self.plot_vsound_btn = pnw.Button(label="Calculate speed of sound", color="primary") + self.plot_ifc_btn = pnw.Button(label="Compute IFC(R)", color="primary") + self.plot_phbands_quad_btn = pnw.Button(label="Plot PHbands with/without quadrupoles", color="primary") + self.plot_dos_vs_qmesh_btn = pnw.Button(label="Plot PHDos vs Qmesh", color="primary") + self.compute_elastic_btn = pnw.Button(label="Compute Elastic", color="primary") - self.stacked_pjdos = pnw.Checkbox(name="Stacked PJDOS", value=True) - self.with_qpath = pnw.Checkbox(name="Show q-path with plotly", value=True) + self.stacked_pjdos = pnw.Checkbox(label="Stacked PJDOS", value=True) + self.with_qpath = pnw.Checkbox(label="Show q-path with plotly", value=True) def get_becs_view(self) -> pn.Row: """Returns the view for Born effective charges.""" @@ -769,10 +769,10 @@ def __init__(self, use_structure=False, **params): self.file_input = pnw.FileInput(height=60, css_classes=["pnx-file-upload-area"]) self.file_input.param.watch(self.on_file_input, "value") - self.mpid_input = pnw.TextInput(name="mp-id", placeholder="Enter e.g. mp-149 for Silicon and press ⏎") + self.mpid_input = pnw.TextInput(label="mp-id", placeholder="Enter e.g. mp-149 for Silicon and press ⏎") self.mpid_input.param.watch(self.on_mpid_input, "value") self.mpid_err_wdg = pn.pane.Markdown("") - # self.mp_progress = pn.indicators.Progress(name='Fetching data from the MP website', bar_color="warning", + # self.mp_progress = pn.indicators.Progress(label='Fetching data from the MP website', bar_color="warning", # active=False, width=200, height=10, align="center") def on_file_input(self, event) -> None: @@ -869,10 +869,10 @@ def __init__(self, **params): self.file_input = pnw.FileInput(height=60, css_classes=["pnx-file-upload-area"]) self.file_input.param.watch(self.on_file_input, "value") - self.mpid_input = pnw.TextInput(name="mp-id", placeholder="Enter e.g. mp-149 for Silicon and press ⏎") + self.mpid_input = pnw.TextInput(label="mp-id", placeholder="Enter e.g. mp-149 for Silicon and press ⏎") self.mpid_input.param.watch(self.on_mpid_input, "value") self.mpid_err_wdg = pn.pane.Markdown("") - # self.mp_progress = pn.indicators.Progress(name='Fetching data from the MP website', bar_color="warning", + # self.mp_progress = pn.indicators.Progress(label='Fetching data from the MP website', bar_color="warning", # active=False, width=200, height=10, align="center") def on_file_input(self, event) -> None: @@ -938,7 +938,7 @@ def __init__(self, **params): self.file_input.param.watch(self.on_file_input, "value") self.mp_progress = pn.indicators.Progress( - name="Fetching DDB from the MP website", + label="Fetching DDB from the MP website", bar_color="warning", active=False, width=100, @@ -995,9 +995,9 @@ def __init__(self, robot: DdbRobot, **params): PanelWithAnaddbParams.__init__(self) # Buttons - self.plot_combiplot_btn = pnw.Button(name="Compute", button_type="primary") + self.plot_combiplot_btn = pnw.Button(label="Compute", color="primary") self.combiplot_check_btn = pnw.CheckButtonGroup( - name="Check Button Group", value=["combiplot"], options=["combiplot", "gridplot"] + label="Check Button Group", value=["combiplot"], options=["combiplot", "gridplot"] ) def kwargs_for_anaget_phbst_and_phdos_files(self, **extra_kwargs) -> dict: @@ -1131,7 +1131,7 @@ def plot_combiplot(self, **kwargs) -> pn.Column: # #ca(phdos.plot_harmonic_thermo(tstart=temps[0], tstop=temps[1], num=50, **self.mpl_kwargs)) # ca(ply(phdos.plotly_harmonic_thermo(tstart=temps[0], tstop=temps[1], num=50, show=False))) # #msqd_dos.plot_tensor(**self.mpl_kwargs) - # #self.plot_phbands_btn.button_type = "primary" + # #self.plot_phbands_btn.color = "primary" # # Add HTML pane with input # ca("## Anaddb input file") @@ -1335,7 +1335,7 @@ def __init__(self, **params): top = "/Users/gmatteo/git_repos/abipy/abipy/data/refs/mgb2_phonons_nkpt_tsmear" top = "~" self.file_selector = pnw.FileSelector(top) - self.robot_files_btn = pnw.Button(name="Load files", button_type="primary", sizing_mode="stretch_width") + self.robot_files_btn = pnw.Button(label="Load files", color="primary", sizing_mode="stretch_width") self.robot_files_btn.on_click(self.on_load_files) # @depends_on_btn_click("robot_files_btn") diff --git a/abipy/panels/electrons.py b/abipy/panels/electrons.py index ec1b75d8e..e58bf1cef 100644 --- a/abipy/panels/electrons.py +++ b/abipy/panels/electrons.py @@ -38,12 +38,12 @@ def __init__(self, **params): self.main_area = pn.Column(help_md, self.get_alert_data_transfer(), sizing_mode="stretch_width") - self.replot_btn = pnw.Button(name="Replot", button_type="primary") + self.replot_btn = pnw.Button(label="Replot", color="primary") self.file_input = pnw.FileInput(height=60, css_classes=["pnx-file-upload-area"]) self.file_input.param.watch(self.on_file_input, "value") self.mp_progress = pn.indicators.Progress( - name="Fetching data from the MP website", + label="Fetching data from the MP website", bar_color="warning", active=False, width=200, diff --git a/abipy/panels/fatbands.py b/abipy/panels/fatbands.py index 0f074fe41..c7613b76b 100644 --- a/abipy/panels/fatbands.py +++ b/abipy/panels/fatbands.py @@ -24,8 +24,8 @@ def __init__(self, ncfile: FatBandsFile, **params): self.ncfile = ncfile # Create buttons - self.plot_fatbands_btn = pnw.Button(name="Plot fatbands", button_type="primary") - self.plot_fatdos_btn = pnw.Button(name="Plot fatdos", button_type="primary") + self.plot_fatbands_btn = pnw.Button(label="Plot fatbands", color="primary") + self.plot_fatdos_btn = pnw.Button(label="Plot fatdos", color="primary") @depends_on_btn_click("plot_fatbands_btn") def on_plot_fatbands_btn(self) -> pn.Column: @@ -113,7 +113,7 @@ def get_panel(self, as_dict=False, **kwargs): # A Panel to interoperate with multiple GSR files. # """ # -# gsr_dataframe_btn = pnw.Button(name="Compute", button_type='primary') +# gsr_dataframe_btn = pnw.Button(label="Compute", color='primary') # # def __init__(self, robot, **params): # super().__init__(**params) diff --git a/abipy/panels/flows.py b/abipy/panels/flows.py index 46b43bf0a..ed5555bba 100644 --- a/abipy/panels/flows.py +++ b/abipy/panels/flows.py @@ -31,10 +31,10 @@ def __init__(self, flow: Flow, **params): f"w{i} ({work.__class__.__name__}, len: {len(work)})": work for (i, work) in enumerate(flow.works) } options = list(self._wstr2work.keys()) - self.work_select = pnw.Select(name="Select a Work", value=options[0], options=options) + self.work_select = pnw.Select(label="Select a Work", value=options[0], options=options) options = [f"t{i} ({task.__class__.__name__}, {task.status!s})" for (i, task) in enumerate(flow[0])] - self.task_select = pnw.Select(name="Select a Task in the Work", value=options[0], options=options) + self.task_select = pnw.Select(label="Select a Task in the Work", value=options[0], options=options) super().__init__(**params) @@ -72,13 +72,13 @@ def __init__(self, flow: Flow, **params): """ NodeParameterized.__init__(self, node=flow, **params) - self.structures_btn = pnw.Button(name="Show Structures", button_type="primary") + self.structures_btn = pnw.Button(label="Show Structures", color="primary") self.structures_io_checkbox = pnw.CheckBoxGroup( - name="Input/Output Structure", value=["output"], options=["input", "output"], inline=True + label="Input/Output Structure", value=["output"], options=["input", "output"], inline=True ) self.wt_selector = WorkTaskSelector(flow) - self.task_btn = pnw.Button(name="Analyze Task", button_type="primary") + self.task_btn = pnw.Button(label="Analyze Task", color="primary") def get_task_view(self) -> pn.Column: """Return the task view panel.""" @@ -176,11 +176,11 @@ def __init__(self, flow: Flow, template, spectator_mode=True, **kwargs): self.template = template self.wt_selector = WorkTaskSelector(flow) - goto_work_btn = pnw.Button(name="Go to Work", button_type="primary") + goto_work_btn = pnw.Button(label="Go to Work", color="primary") goto_work_btn.on_click(self.on_goto_work_bnt) - goto_task_btn = pnw.Button(name="Go to Task", button_type="primary") + goto_task_btn = pnw.Button(label="Go to Task", color="primary") goto_task_btn.on_click(self.on_goto_task_bnt) - self.new_tab = pnw.Checkbox(value=True, name="Open in new Tab") + self.new_tab = pnw.Checkbox(value=True, label="Open in new Tab") self.js_panel = JsPane() self.sidebar = pn.WidgetBox( diff --git a/abipy/panels/gsr.py b/abipy/panels/gsr.py index c51dda484..1150f6f3e 100644 --- a/abipy/panels/gsr.py +++ b/abipy/panels/gsr.py @@ -70,8 +70,8 @@ def __init__(self, robot: GsrRobot, **params): """ PanelWithEbandsRobot.__init__(self, robot=robot, **params) - self.gsr_dataframe_btn = pnw.Button(name="Compute", button_type="primary") - self.transpose_gsr_dataframe = pnw.Checkbox(name="Transpose GSR dataframe") + self.gsr_dataframe_btn = pnw.Button(label="Compute", color="primary") + self.transpose_gsr_dataframe = pnw.Checkbox(label="Transpose GSR dataframe") @depends_on_btn_click("gsr_dataframe_btn") def on_gsr_dataframe_btn(self) -> pn.Column: diff --git a/abipy/panels/hist.py b/abipy/panels/hist.py index ca3c76987..e0d42c411 100644 --- a/abipy/panels/hist.py +++ b/abipy/panels/hist.py @@ -22,12 +22,12 @@ def __init__(self, hist: HistFile, **params): self.hist = hist _what_list = ["abc", "angles", "energy", "volume", "pressure", "forces"] - self.what_list = pnw.CheckBoxGroup(name="Select", value=_what_list, options=_what_list, inline=False) - self.plot_relax_btn = pnw.Button(name="Plot relaxation", button_type="primary") + self.what_list = pnw.CheckBoxGroup(label="Select", value=_what_list, options=_what_list, inline=False) + self.plot_relax_btn = pnw.Button(label="Plot relaxation", color="primary") - self.appname = pnw.Select(name="Viewer", value="ovito", options=["ovito", "mayavi", "vtk"]) - self.to_unit_cell = pnw.Checkbox(name="To unit cell") - self.view_relax_btn = pnw.Button(name="View relaxation", button_type="primary") + self.appname = pnw.Select(label="Viewer", value="ovito", options=["ovito", "mayavi", "vtk"]) + self.to_unit_cell = pnw.Checkbox(label="To unit cell") + self.view_relax_btn = pnw.Button(label="View relaxation", color="primary") super().__init__(**params) diff --git a/abipy/panels/nodes.py b/abipy/panels/nodes.py index c730e9bd6..b0b6dce23 100644 --- a/abipy/panels/nodes.py +++ b/abipy/panels/nodes.py @@ -84,23 +84,23 @@ def __init__(self, node: Node, **params): raise ValueError(f"Don't know how to handle type: `{type(node)}`") self.engine = pnw.Select( - value="fdp", name="engine", options=["dot", "neato", "twopi", "circo", "fdp", "sfdp", "patchwork", "osage"] + value="fdp", label="engine", options=["dot", "neato", "twopi", "circo", "fdp", "sfdp", "patchwork", "osage"] ) - self.dirtree = pnw.Checkbox(name="Dirtree", value=False) - self.graphviz_btn = pnw.Button(name="Show Graph", button_type="primary") + self.dirtree = pnw.Checkbox(label="Dirtree", value=False) + self.graphviz_btn = pnw.Button(label="Show Graph", color="primary") - self.status_btn = pnw.Button(name="Show Status", button_type="primary") + self.status_btn = pnw.Button(label="Show Status", color="primary") - self.history_btn = pnw.Button(name="Show history", button_type="primary") - self.debug_btn = pnw.Button(name="Debug", button_type="primary") - self.events_btn = pnw.Button(name="Show Events", button_type="primary") - self.corrections_btn = pnw.Button(name="Show Corrections", button_type="primary") - self.handlers_btn = pnw.Button(name="Show Handlers", button_type="primary") + self.history_btn = pnw.Button(label="Show history", color="primary") + self.debug_btn = pnw.Button(label="Debug", color="primary") + self.events_btn = pnw.Button(label="Show Events", color="primary") + self.corrections_btn = pnw.Button(label="Show Corrections", color="primary") + self.handlers_btn = pnw.Button(label="Show Handlers", color="primary") self.vars_text = pnw.TextInput( - name="Abivars", placeholder="Enter list of variables separated by comma e.g. `ecut, natom`" + label="Abivars", placeholder="Enter list of variables separated by comma e.g. `ecut, natom`" ) - self.vars_btn = pnw.Button(name="Show Variables", button_type="primary") - # self.dims_btn = pnw.Button(name="Show Dimensions", button_type='primary') + self.vars_btn = pnw.Button(label="Show Variables", color="primary") + # self.dims_btn = pnw.Button(label="Show Dimensions", color='primary') self.workdir_fileselector = pnw.FileSelector(node.workdir, only_files=True) self.outdir_fileselector = pnw.FileSelector(node.outdir.path) @@ -114,7 +114,7 @@ def __init__(self, node: Node, **params): for where in ("indir", "outdir", "workdir"): directory = Directory(self.node.workdir) if where == "workdir" else getattr(self.node, where) filepaths = directory.list_filepaths() - self.filepath_select_dir[where] = FilePathSelect.from_filepaths(filepaths) # , name=f"Files in {where}") + self.filepath_select_dir[where] = FilePathSelect.from_filepaths(filepaths) # , label=f"Files in {where}") def get_status_view(self) -> pn.Column: """Return the status view panel.""" @@ -329,7 +329,7 @@ def get_files_in_dir_view(self, where): if not select: return None - btn = pnw.Button(name="Analyze", button_type="primary") + btn = pnw.Button(label="Analyze", color="primary") output_area = pn.Column(sizing_mode="stretch_width") from abipy.abilab import abiopen @@ -450,9 +450,9 @@ def __init__(self, df: pd.DataFrame, **params): # Compute this card self.cards["## Task status histogram"].collapsed = False - open_btn = pnw.Button(name="Open all cards", button_type="primary") + open_btn = pnw.Button(label="Open all cards", color="primary") open_btn.on_click(self.open_all_cards) - close_btn = pnw.Button(name="Close all cards", button_type="primary") + close_btn = pnw.Button(label="Close all cards", color="primary") close_btn.on_click(self.close_all_cards) self.layout = pn.Column(pn.Row(open_btn, close_btn), *list(self.cards.values()), sizing_mode="stretch_width") diff --git a/abipy/panels/oncvpsp_gui.py b/abipy/panels/oncvpsp_gui.py index 1b586e067..f283fc0e3 100644 --- a/abipy/panels/oncvpsp_gui.py +++ b/abipy/panels/oncvpsp_gui.py @@ -580,7 +580,7 @@ def __init__(self, oncv_input, plotlyFlag, in_filepath="", **params): # self.out_runtests = pn.Column("## Basic tests:", sizing_mode="stretch_width") # Define buttons - self.execute_btn = pnw.Button(name="Execute", button_type="primary") + self.execute_btn = pnw.Button(label="Execute", color="primary") self.execute_btn.on_click(self.on_execute_btn) # This is the directory used to run oncvpsp when the user clicks execute_btn @@ -588,10 +588,10 @@ def __init__(self, oncv_input, plotlyFlag, in_filepath="", **params): # List storing all the inputs. self.input_history = [] - self.history_btn = pnw.Button(name="Compare", button_type="primary") + self.history_btn = pnw.Button(label="Compare", color="primary") # self.history_btn.on_click(self.on_history_btn) - self.rc_qcut_btn = pnw.Button(name="Execute", button_type="primary") + self.rc_qcut_btn = pnw.Button(label="Execute", color="primary") self.plotlyFlag = plotlyFlag @@ -719,7 +719,7 @@ def on_history_btn(self) -> pn.Column: def get_rc_widgets(self, oncv_input: OncvInput) -> pn.WidgetBox: """Return widgets to change the value of rc(l)""" menu_items = [(f"l = {l}", str(l)) for l in range(oncv_input.lmax + 1)] - menu_button = pnw.MenuButton(name="Change rc(l)", items=menu_items, button_type="primary") + menu_button = pnw.MenuButton(label="Change rc(l)", items=menu_items, color="primary") menu_button.on_click(self.on_change_rc) rc_l = {p.l: p.rc for p in oncv_input.lparams} help_str = f""" @@ -732,7 +732,7 @@ def get_rc_widgets(self, oncv_input: OncvInput) -> pn.WidgetBox: def get_qcut_widgets(self, oncv_input: OncvInput) -> pn.WidgetBox: """Return widgets to change the value of qc(l)""" menu_items = [(f"l = {l}", str(l)) for l in range(oncv_input.lmax + 1)] - menu_button = pnw.MenuButton(name="Change qcut(l)", items=menu_items, button_type="primary") + menu_button = pnw.MenuButton(label="Change qcut(l)", items=menu_items, color="primary") menu_button.on_click(self.on_change_qcut) qc_l = {p.l: p.qcut for p in oncv_input.lparams} help_str = f""" @@ -745,7 +745,7 @@ def get_qcut_widgets(self, oncv_input: OncvInput) -> pn.WidgetBox: def get_debl_widgets(self, oncv_input: OncvInput) -> pn.WidgetBox: """Return widgets to change the value of debl(l)""" menu_items = [(f"l = {l}", str(l)) for l in range(oncv_input.lmax + 1)] - menu_button = pnw.MenuButton(name="Change debl(l)", items=menu_items, button_type="primary") + menu_button = pnw.MenuButton(label="Change debl(l)", items=menu_items, color="primary") menu_button.on_click(self.on_change_debl) help_str = """ Here one can change the value of debl(l) with fixed nproj(l). @@ -754,7 +754,7 @@ def get_debl_widgets(self, oncv_input: OncvInput) -> pn.WidgetBox: def get_rc5_widgets(self, oncv_input: OncvInput) -> pn.WidgetBox: """Return widgets to change the value of rc5""" - btn = pnw.Button(name="Run", button_type="primary") + btn = pnw.Button(label="Run", color="primary") btn.on_click(self.on_change_rc5) help_str = f""" Here one can change the value of rc5 for vloc. @@ -765,7 +765,7 @@ def get_rc5_widgets(self, oncv_input: OncvInput) -> pn.WidgetBox: def get_dvloc0_widgets(self, oncv_input: OncvInput) -> pn.WidgetBox: """Return widgets to change the value of dvloc0""" - btn = pnw.Button(name="Run", button_type="primary") + btn = pnw.Button(label="Run", color="primary") btn.on_click(self.on_change_dvloc0) help_str = f""" Here one can change the value of dvloc0 for vloc. @@ -776,7 +776,7 @@ def get_dvloc0_widgets(self, oncv_input: OncvInput) -> pn.WidgetBox: def get_rhomodel_widgets(self, oncv_input: OncvInput) -> pn.WidgetBox: """Return widgets to change the parameters for the model core charge""" - btn = pnw.Button(name="Run", button_type="primary") + btn = pnw.Button(label="Run", color="primary") btn.on_click(self.on_change_rhomodel) help_str = f""" Here one can change the parameters for the model core charge. @@ -1128,7 +1128,7 @@ def get_rc_qcut_opt_view(self) -> pn.Row: oncv_input = self.get_oncv_input() menu_items = [(f"l = {l}", str(l)) for l in range(oncv_input.lmax + 1)] - menu_button = pnw.MenuButton(name="Change qcut(l)", items=menu_items, button_type="primary") + menu_button = pnw.MenuButton(label="Change qcut(l)", items=menu_items, color="primary") menu_button.on_click(self.on_change_rc_qcut) qc_l = {p.l: p.qcut for p in oncv_input.lparams} rc_l = {p.l: p.rc for p in oncv_input.lparams} @@ -1246,7 +1246,7 @@ def _update_out_area(self, psgen, oncv_input: OncvInput) -> None: else: _m = functools.partial(mpl, with_divider=False, dpi=self.dpi) - save_btn = pnw.Button(name="Save output", button_type="primary") + save_btn = pnw.Button(label="Save output", color="primary") save_btn.on_click(self.on_save_btn) new_rows = [ diff --git a/abipy/panels/phonons.py b/abipy/panels/phonons.py index 2ac57513a..09831b74c 100644 --- a/abipy/panels/phonons.py +++ b/abipy/panels/phonons.py @@ -20,10 +20,10 @@ def __init__(self, plotter, **params): params: Parameters passed to the parent class. """ self.phbands_plotter_mode = pnw.Select( - name="Plot Mode", value="gridplot", options=["gridplot", "combiplot", "boxplot", "combiboxplot"] + label="Plot Mode", value="gridplot", options=["gridplot", "combiplot", "boxplot", "combiboxplot"] ) # "animate", - self.phbands_plotter_units = pnw.Select(name="Units", value="eV", options=["eV", "meV", "Ha", "cm-1", "Thz"]) - self.phbands_plotter_btn = pnw.Button(name="Plot", button_type="primary") + self.phbands_plotter_units = pnw.Select(label="Units", value="eV", options=["eV", "meV", "Ha", "cm-1", "Thz"]) + self.phbands_plotter_btn = pnw.Button(label="Plot", color="primary") self.plotter = plotter super().__init__(**params) diff --git a/abipy/panels/sigeph.py b/abipy/panels/sigeph.py index 6f4a56aaf..09cb74f76 100644 --- a/abipy/panels/sigeph.py +++ b/abipy/panels/sigeph.py @@ -22,13 +22,13 @@ def __init__(self, sigeph: SigEPhFile, **params): PanelWithElectronBands.__init__(self, ebands=sigeph.ebands, **params) self.sigeph = sigeph - self.sigma_spin_select = pnw.Select(name="Spin index", options=list(range(sigeph.nsppol))) + self.sigma_spin_select = pnw.Select(label="Spin index", options=list(range(sigeph.nsppol))) self.sigma_kpoint_select = pnw.Select( - name="Kpoint in Sigma_nk", + label="Kpoint in Sigma_nk", options={"[%d]: %s" % (ik, repr(k)): ik for ik, k in enumerate(sigeph.sigma_kpoints)}, ) - self.plot_qpsolution_btn = pnw.Button(name="Plot Sigma_nk", button_type="primary") + self.plot_qpsolution_btn = pnw.Button(label="Plot Sigma_nk", color="primary") # sigma_band_select = param.ObjectSelector(default=0, objects=[0], doc="Band index in sigma_nk") def plot_lws(self) -> pn.GridSpec: diff --git a/abipy/panels/structure.py b/abipy/panels/structure.py index 1763c35aa..8bfcf16b9 100644 --- a/abipy/panels/structure.py +++ b/abipy/panels/structure.py @@ -63,35 +63,35 @@ def __init__(self, structure: Structure, with_inputs: bool = True, **params): # Convert widgets. self.output_format = pnw.Select( - name="format", value="abinit", options="abinit,cif,xsf,poscar,qe,siesta,wannier90,cssr,json".split(",") + label="format", value="abinit", options="abinit,cif,xsf,poscar,qe,siesta,wannier90,cssr,json".split(",") ) # Spglib widgets - self.spglib_symprec = pnw.Spinner(name="symprec", value=0.01, start=0.0, end=None, step=0.01) - self.spglib_angtol = pnw.Spinner(name="angtol", value=5, start=0.0, end=None, step=1) + self.spglib_symprec = pnw.Spinner(label="symprec", value=0.01, start=0.0, end=None, step=0.01) + self.spglib_angtol = pnw.Spinner(label="angtol", value=5, start=0.0, end=None, step=1) # Abisanitize widgets - self.abisanitize_btn = pnw.Button(name="Run abisanitize", button_type="primary") + self.abisanitize_btn = pnw.Button(label="Run abisanitize", color="primary") self.select_primitive = pnw.Select( - name="Select primitive", options=["primitive", "primitive_standard", "no_primitive"] + label="Select primitive", options=["primitive", "primitive_standard", "no_primitive"] ) # K-path widgets - self.kpath_format = pnw.Select(name="format", value="abinit", options=["abinit", "siesta", "wannier90"]) - self.line_density = pnw.Spinner(name="line density", value=10, step=5, start=0, end=None) - self.plot_kpath = pnw.Checkbox(name="Plot k-path", value=False) + self.kpath_format = pnw.Select(label="format", value="abinit", options=["abinit", "siesta", "wannier90"]) + self.line_density = pnw.Spinner(label="line density", value=10, step=5, start=0, end=None) + self.plot_kpath = pnw.Checkbox(label="Plot k-path", value=False) # MP-match - self.mp_match_btn = pnw.Button(name="Connect to Materials Project", button_type="primary") + self.mp_match_btn = pnw.Button(label="Connect to Materials Project", color="primary") # MP-search - # mp_search_btn = pnw.Button(name="Connect to Materials Project", button_type='primary') + # mp_search_btn = pnw.Button(label="Connect to Materials Project", color='primary') # mp_api_key # Widgets to control the generation of input files. - self.kppra = pnw.Spinner(name="kppra", value=1000, step=500, start=0, end=None) - self.smearing_type = pnw.Select(name="Smearing type", value=None, options=[None, "gaussian", "fermi_dirac"]) - self.tsmear = pnw.Spinner(name="tsmear (Ha)", value=0.01, step=0.002, start=0.0, end=None) + self.kppra = pnw.Spinner(label="kppra", value=1000, step=500, start=0, end=None) + self.smearing_type = pnw.Select(label="Smearing type", value=None, options=[None, "gaussian", "fermi_dirac"]) + self.tsmear = pnw.Spinner(label="tsmear (Ha)", value=0.01, step=0.002, start=0.0, end=None) # TODO: nspinor 2 should trigger a check on the table. from abipy.flowtk.psrepos import get_installed_repos_and_root @@ -100,22 +100,22 @@ def __init__(self, structure: Structure, with_inputs: bool = True, **params): options = [repo.name for repo in installed_repos] default_repo = "ONCVPSP-PBE-SR-PDv0.4" default_repo = None if default_repo not in options else default_repo - self.repos_name = pnw.Select(name="PP repos", value=default_repo, options=options) - self.table_name = pnw.Select(name="Table name", value="standard", options=["standard", "stringent"]) + self.repos_name = pnw.Select(label="PP repos", value=default_repo, options=options) + self.table_name = pnw.Select(label="Table name", value="standard", options=["standard", "stringent"]) # widgets for GS input generator - self.gs_type = pnw.Select(name="GS type", value="scf", options=["scf", "relax"]) - self.gs_input_btn = pnw.Button(name="Generate input", button_type="primary") + self.gs_type = pnw.Select(label="GS type", value="scf", options=["scf", "relax"]) + self.gs_input_btn = pnw.Button(label="Generate input", color="primary") # widgets for e-bands input generator. - self.ebands_input_btn = pnw.Button(name="Generate input", button_type="primary") - self.edos_kppra = pnw.Spinner(name="edos_kppra", value=0, step=500, start=0, end=None) + self.ebands_input_btn = pnw.Button(label="Generate input", color="primary") + self.edos_kppra = pnw.Spinner(label="edos_kppra", value=0, step=500, start=0, end=None) # widgets for DFPT phonons input generator. - self.ph_input_btn = pnw.Button(name="Generate input", button_type="primary") - self.with_becs = pnw.Checkbox(name="BECS and epsilon_inf (semiconductors)", value=False) - # self.dfpt_ngqpt = pnw.LiteralInput(name='ngqpt (python list)', value=[None, None, None], type=list) - # self.dfpt_ngqpt = pnw.LiteralInput(name='ngqpt (python list)', value=[None, None, None], type=list) + self.ph_input_btn = pnw.Button(label="Generate input", color="primary") + self.with_becs = pnw.Checkbox(label="BECS and epsilon_inf (semiconductors)", value=False) + # self.dfpt_ngqpt = pnw.LiteralInput(label='ngqpt (python list)', value=[None, None, None], type=list) + # self.dfpt_ngqpt = pnw.LiteralInput(label='ngqpt (python list)', value=[None, None, None], type=list) self.label2mode = { "unpolarized": "unpolarized", @@ -125,7 +125,7 @@ def __init__(self, structure: Structure, with_inputs: bool = True, **params): "collinear anti-ferromagnetic": "afm", } - self.spin_mode = pnw.Select(name="SpinMode", value="unpolarized", options=list(self.label2mode.keys())) + self.spin_mode = pnw.Select(label="SpinMode", value="unpolarized", options=list(self.label2mode.keys())) @pn.depends("output_format.value") def convert(self): @@ -631,8 +631,8 @@ def __init__(self, **params): super().__init__(**params) # Spglib widgets - # self.spglib_symprec = pnw.Spinner(name="symprec", value=0.01, start=0.0, end=None, step=0.01) - # self.spglib_angtol = pnw.Spinner(name="angtol", value=5, start=0.0, end=None, step=1) + # self.spglib_symprec = pnw.Spinner(label="symprec", value=0.01, start=0.0, end=None, step=0.01) + # self.spglib_angtol = pnw.Spinner(label="angtol", value=5, start=0.0, end=None, step=1) help_md = pn.pane.Markdown(f""" ## Description @@ -645,7 +645,7 @@ def __init__(self, **params): self.file_input = pnw.FileInput(height=60, css_classes=["pnx-file-upload-area"]) self.file_input.param.watch(self.on_file_input, "value") - self.mpid_input = pnw.TextInput(name="mp-id", placeholder="Enter e.g. mp-149 for Silicon and press ⏎") + self.mpid_input = pnw.TextInput(label="mp-id", placeholder="Enter e.g. mp-149 for Silicon and press ⏎") self.mpid_input.param.watch(self.on_mpid_input, "value") self.mpid_err_wdg = pn.pane.Markdown("") diff --git a/abipy/panels/tasks.py b/abipy/panels/tasks.py index 1d7b692fc..ab090988e 100644 --- a/abipy/panels/tasks.py +++ b/abipy/panels/tasks.py @@ -25,9 +25,9 @@ def __init__(self, task: AbinitTask, **params): NodeParameterized.__init__(self, node=task, **params) self.task = task - # self.structures_btn = pnw.Button(name="Show Structures", button_type='primary') + # self.structures_btn = pnw.Button(label="Show Structures", color='primary') # self.structures_io_checkbox = pnw.CheckBoxGroup( - # name='Input/Output Structure', value=['output'], options=['input', 'output'], inline=Tru + # label='Input/Output Structure', value=['output'], options=['input', 'output'], inline=Tru def get_inputs_view(self): """Show the input files of the task: input file, submission script and TaskManager.""" diff --git a/abipy/panels/viewers.py b/abipy/panels/viewers.py index 62517cd62..181f921ae 100644 --- a/abipy/panels/viewers.py +++ b/abipy/panels/viewers.py @@ -26,7 +26,7 @@ def __init__(self, filepath: str, theme="terminal", height=1200, **params): super().__init__(**params) basename = os.path.basename(filepath) - self.open_btn = pnw.Button(name=f"Open {basename}", button_type="primary") + self.open_btn = pnw.Button(label=f"Open {basename}", color="primary") self.open_btn.on_click(self.open_ace_editor) self.ace = pnw.CodeEditor( @@ -49,7 +49,7 @@ def open_ace_editor(self, event) -> None: """Callback to open and read the file into the ACE editor.""" self.ace.visible = True self.ace.value = open(self.filepath).read() - self.open_btn.name = "Reopen %s" % os.path.basename(self.filepath) + self.open_btn.label = "Reopen %s" % os.path.basename(self.filepath) def __panel__(self): return self.layout From e4f32bd29061a6e3dda87c54486f05ec3f4b1b0b Mon Sep 17 00:00:00 2001 From: Matteo Giantomassi Date: Mon, 28 Sep 2026 00:41:41 +0200 Subject: [PATCH 10/23] Fix race condition in Ebands.from_string --- abipy/core/mixins.py | 6 +++--- abipy/electrons/ebands.py | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/abipy/core/mixins.py b/abipy/core/mixins.py index c9d7c731a..33c56d08c 100644 --- a/abipy/core/mixins.py +++ b/abipy/core/mixins.py @@ -183,11 +183,11 @@ def from_binary_string(cls, bstring) -> AbinitNcFile: Build object from a binary string with the netcdf data. Useful for implementing GUIs in which widgets returns binary data. """ - workdir = tempfile.mkdtemp() fd, tmp_path = tempfile.mkstemp(suffix=".nc") - with open(tmp_path, "wb") as fh: + with os.fdopen(fd, "wb") as fh: fh.write(bstring) - return cls.from_file(tmp_path) + + return cls.from_file(tmp_path) # @abc.abstractproperty # def r(self): diff --git a/abipy/electrons/ebands.py b/abipy/electrons/ebands.py index d1be4f8e2..82c03e638 100644 --- a/abipy/electrons/ebands.py +++ b/abipy/electrons/ebands.py @@ -420,11 +420,11 @@ def from_binary_string(cls, bstring) -> ElectronBands: Build object from a binary string with the netcdf data. Useful for implementing GUIs in which widgets returns binary data. """ - workdir = tempfile.mkdtemp() fd, tmp_path = tempfile.mkstemp(suffix=".nc") - with open(tmp_path, "wb") as fh: + with os.fdopen(fd, "wb") as fh: fh.write(bstring) - return cls.from_file(tmp_path) + + return cls.from_file(tmp_path) @classmethod def from_dict(cls, d: dict) -> ElectronBands: From 37ccb41ad86f9bf3ee584462d66460137dce56b2 Mon Sep 17 00:00:00 2001 From: Matteo Giantomassi Date: Mon, 28 Sep 2026 02:19:01 +0200 Subject: [PATCH 11/23] Fix numpy deprecation warnings --- abipy/abio/abivar_database/variables.py | 8 +- abipy/abio/abivars.py | 2 +- abipy/abio/outputs.py | 2 +- abipy/abio/tests/test_abivars.py | 2 +- abipy/core/fields.py | 2 +- abipy/core/structure.py | 6 +- abipy/core/testing.py | 14 ++-- abipy/core/tests/test_structure.py | 2 +- abipy/dfpt/phonons.py | 2 +- abipy/dfpt/tests/test_converters.py | 18 +++- abipy/electrons/denpot.py | 2 +- abipy/electrons/ebands.py | 9 +- abipy/electrons/fold2bloch.py | 2 +- abipy/electrons/gsr.py | 2 +- abipy/electrons/optic.py | 2 +- abipy/electrons/psps.py | 2 +- abipy/electrons/scr.py | 2 +- abipy/electrons/tchim.py | 2 +- abipy/electrons/tests/test_gwr.py | 2 +- abipy/eph/gstore.py | 2 +- abipy/eph/gwan.py | 2 +- abipy/examples/flows/run_atdep.py | 107 +++++++++++++++--------- abipy/flowtk/events.py | 14 +--- abipy/ml/aseml.py | 10 ++- abipy/scripts/abistruct.py | 2 +- abipy/tools/iotools.py | 2 +- abipy/tools/tests/test_numtools.py | 6 +- abipy/wannier90/abiwan.py | 2 +- abipy/waves/pwwave.py | 4 +- abipy/waves/tests/test_pwwave.py | 4 +- abipy/waves/wfkfile.py | 2 +- 31 files changed, 139 insertions(+), 101 deletions(-) diff --git a/abipy/abio/abivar_database/variables.py b/abipy/abio/abivar_database/variables.py index a4fb61e27..1955b86f5 100644 --- a/abipy/abio/abivar_database/variables.py +++ b/abipy/abio/abivar_database/variables.py @@ -935,11 +935,11 @@ class InputVariables(OrderedDict): @classmethod def from_pyfile(cls, filepath): """Initialize the object from python file.""" - # import imp - # module = imp.load_source(filepath, filepath) - from importlib.machinery import SourceFileLoader + import importlib.util - module = SourceFileLoader(filepath, filepath).load_module() + spec = importlib.util.spec_from_file_location(filepath, filepath) + module = importlib.util.module_from_spec(spec) + spec.loader.exec_module(module) vlist = [Variable(**d) for d in module.variables] new = cls() diff --git a/abipy/abio/abivars.py b/abipy/abio/abivars.py index c7b5f6066..f7b7c33c0 100644 --- a/abipy/abio/abivars.py +++ b/abipy/abio/abivars.py @@ -267,7 +267,7 @@ def structure(self) -> Structure: if "rprim" in self: raise ValueError("rprim and angdeg cannot be used together!") angdeg = str2array(self["angdeg"]) - angdeg.shape = 3 + angdeg = angdeg.reshape(3) kwargs["angdeg"] = angdeg else: # Handle structure specified with rprim. diff --git a/abipy/abio/outputs.py b/abipy/abio/outputs.py index a2557ea9a..9f27ab6cd 100644 --- a/abipy/abio/outputs.py +++ b/abipy/abio/outputs.py @@ -438,7 +438,7 @@ def _get_structures(self, what: str) -> list[Structure]: if "symafm" in spgd: symafm = np.array([int(n) for n in spgd["symafm"].split()], dtype=int) - symafm.shape = (nsym,) + symafm = symafm.reshape((nsym,)) else: symafm = np.ones(nsym, dtype=int) diff --git a/abipy/abio/tests/test_abivars.py b/abipy/abio/tests/test_abivars.py index 2a229e0f1..6ddd53d74 100644 --- a/abipy/abio/tests/test_abivars.py +++ b/abipy/abio/tests/test_abivars.py @@ -197,7 +197,7 @@ def test_tricky_inputs(self): self.assert_equal(inp.structure[1].frac_coords, [1 / 4, 1 / 4, 1 / 4]) self.assert_equal(inp.structure[1].specie.symbol, "As") mat = 5.6533 * np.array([0, 1 / 2, 1 / 2, 1 / 2, 0, 1 / 2, 1 / 2, 1 / 2, 0]) - mat.shape = (3, 3) + mat = mat.reshape((3, 3)) self.assert_almost_equal(inp.structure[1].lattice.matrix, mat) # tutorial/input/tbase2_1 diff --git a/abipy/core/fields.py b/abipy/core/fields.py index 0cd6f8264..6d913d8ce 100644 --- a/abipy/core/fields.py +++ b/abipy/core/fields.py @@ -455,7 +455,7 @@ def plot_line_neighbors(self, site_index, radius, num=200, max_nn=10, fontsize=1 fontsize: legend and title fontsize """ site = self.structure[site_index] - nn_list = self.structure.get_neighbors_old(site, radius, include_index=True) + nn_list = self.structure.get_neighbors(site, radius, include_index=True) if not nn_list: cprint("Zero neighbors found for radius %s Ang. Returning None." % radius, "yellow") return None diff --git a/abipy/core/structure.py b/abipy/core/structure.py index 418fc45e5..d1ee355b0 100644 --- a/abipy/core/structure.py +++ b/abipy/core/structure.py @@ -1418,11 +1418,11 @@ def print_neighbors(self, radius=2.0) -> None: print("Finding neighbors for each atom in the unit cell, out to a distance %s (Angstrom)" % radius) print(" ") - ns = self.get_all_neighbors_old(radius, include_index=False) + ns = self.get_all_neighbors(radius) for i, (site, sited_list) in enumerate(zip(self, ns, strict=False)): print("[%s] site %s has %s neighbors:" % (i, repr(site), len(sited_list))) - for s, dist in sorted(sited_list, key=lambda t: t[1]): - print("\t", repr(s), " at distance", dist) + for nn in sorted(sited_list, key=lambda t: t.nn_distance): + print("\t", repr(nn), " at distance", nn.nn_distance) print() @cached_property diff --git a/abipy/core/testing.py b/abipy/core/testing.py index a77b35188..8ab54a5f1 100644 --- a/abipy/core/testing.py +++ b/abipy/core/testing.py @@ -20,10 +20,15 @@ from typing import Optional from functools import wraps from shutil import which -from pymatgen.util.testing import PymatgenTest +try: + from pymatgen.util.testing import MatSciTest -# TODO -# from pymatgen.util.testing import MatSciTest + _AbipyTestBases = (unittest.TestCase, MatSciTest) +except ImportError: + # Old pymatgen versions without MatSciTest. + from pymatgen.util.testing import PymatgenTest + + _AbipyTestBases = (PymatgenTest,) from abipy.core.structure import Structure from abipy.abio.inputs import AbinitInput, MultiDataset from abipy.tools.numtools import is_string @@ -327,8 +332,7 @@ def get_gsinput_alas_ngkpt(ngkpt, usepaw=0, as_task=False): return ScfTask(scf_input) -# class AbipyTest(MatSciTest): -class AbipyTest(PymatgenTest): +class AbipyTest(*_AbipyTestBases): """ Extends MatSciTest with Abinit-specific methods. Several helper functions are implemented as static methods so that we diff --git a/abipy/core/tests/test_structure.py b/abipy/core/tests/test_structure.py index 3f5619020..d42eb562b 100644 --- a/abipy/core/tests/test_structure.py +++ b/abipy/core/tests/test_structure.py @@ -157,7 +157,7 @@ def test_utils(self): self.assert_equal(e.eqmap[0], [0, 1]) for irr_pos in e.irred_pos: assert len(e.eqmap[irr_pos]) > 0 - assert "equivalent_atoms" in e.spgdata + assert hasattr(e.spgdata, "equivalent_atoms") if self.has_matplotlib(): assert si.plot_bz(show=False) diff --git a/abipy/dfpt/phonons.py b/abipy/dfpt/phonons.py index 07cf0a1af..dfe5b8bb6 100644 --- a/abipy/dfpt/phonons.py +++ b/abipy/dfpt/phonons.py @@ -5388,7 +5388,7 @@ def combiboxplot(self, mode_range=None, units="eV", swarm=False, ax=None, **kwar sns.boxplot(x="mode", y=yname, data=data, hue="label", ax=ax, **kwargs) if swarm: - sns.swarmplot(x="mode", y=yname, data=data, hue="label", color=".25", ax=ax) + sns.swarmplot(x="mode", y=yname, data=data, hue="label", palette="dark:.25", ax=ax) return fig diff --git a/abipy/dfpt/tests/test_converters.py b/abipy/dfpt/tests/test_converters.py index 7f28d0ce1..dcb56ff03 100644 --- a/abipy/dfpt/tests/test_converters.py +++ b/abipy/dfpt/tests/test_converters.py @@ -19,6 +19,16 @@ ) from abipy.dfpt.ddb import DdbFile + +def get_phonopy_freqs(phonon, qpoints): + """Compute phonopy frequencies at the given qpoints. Works with both the old and new phonopy API.""" + qpoints_phonon = phonon.run_qpoints([q.frac_coords for q in qpoints]) + if qpoints_phonon is not None: + # phonopy >= 4: run_qpoints returns a QpointsPhonon object. + return qpoints_phonon.frequencies + return phonon.get_qpoints_dict()["frequencies"] + + try: from phonopy import Phonopy from phonopy.file_IO import parse_BORN, parse_FORCE_CONSTANTS @@ -60,7 +70,7 @@ def test_ddb_phonopy_ddb_phfreqs(self): # remove nac_params to be sure that this does not enter into play. # There should be no nac_params anyway here. phonon.nac_params = None - phfreqs_phonopy = np.array([phonon.get_frequencies(q.frac_coords) for q in qpoints]) + phfreqs_phonopy = get_phonopy_freqs(phonon, qpoints) out_ddb_path = os.path.join(tmp_dir, "out_DDB") @@ -109,7 +119,7 @@ def test_ddb_phonopy_ddb_becs(self): nac = phonon.nac_params # remove nac_params to be sure that this does not enter into play. phonon.nac_params = None - phfreqs_phonopy = np.array([phonon.get_frequencies(q.frac_coords) for q in qpoints]) + phfreqs_phonopy = get_phonopy_freqs(phonon, qpoints) out_ddb_path = os.path.join(tmp_dir, "out_DDB") @@ -179,8 +189,8 @@ def test_phonopy_ddb_phonopy(self): phonon_orig = Phonopy(unitcell=phonon_conv.unitcell, supercell_matrix=scm, primitive_matrix=np.eye(3)) phonon_orig.force_constants = orig_fc - phfreqs_phonopy_orig = np.array([phonon_orig.get_frequencies(q.frac_coords) for q in qpoints]) - phfreqs_phonopy_conv = np.array([phonon_conv.get_frequencies(q.frac_coords) for q in qpoints]) + phfreqs_phonopy_orig = get_phonopy_freqs(phonon_orig, qpoints) + phfreqs_phonopy_conv = get_phonopy_freqs(phonon_conv, qpoints) run_ana = os.path.join(tmp_dir, "run_anaddb") phbands = ddb.anaget_phmodes_at_qpoints( diff --git a/abipy/electrons/denpot.py b/abipy/electrons/denpot.py index ba4c9e260..36db488fc 100644 --- a/abipy/electrons/denpot.py +++ b/abipy/electrons/denpot.py @@ -142,7 +142,7 @@ def to_string(self, verbose=0) -> str: if verbose > 1: app("") - app(self.hdr.to_string(verbose=verbose, title="Abinit Header")) + app(self.hdr.to_str(verbose=verbose, title="Abinit Header")) return "\n".join(lines) diff --git a/abipy/electrons/ebands.py b/abipy/electrons/ebands.py index 82c03e638..6a878119a 100644 --- a/abipy/electrons/ebands.py +++ b/abipy/electrons/ebands.py @@ -628,7 +628,7 @@ def __init__( self.nband_sk = np.array(nband_sk) else: self.nband_sk = np.array(self.nsppol * self.nkpt * [self.mband]) - self.nband_sk.shape = (self.nsppol, self.nkpt) + self.nband_sk = self.nband_sk.reshape((self.nsppol, self.nkpt)) self.kpoints = kpoints if self.nkpt != len(self.kpoints): @@ -1431,7 +1431,8 @@ def boxplot(self, ax=None, e0="fermie", brange=None, ene_range=None, swarm=False hue = None if self.nsppol == 1 else "spin" ax = sns.boxplot(x="band", y="eig", data=df, hue=hue, ax=ax, **kwargs) if swarm: - sns.swarmplot(x="band", y="eig", data=df, hue=hue, color=".25", ax=ax) + color_kws = dict(color=".25") if hue is None else dict(palette="dark:.25") + sns.swarmplot(x="band", y="eig", data=df, hue=hue, ax=ax, **color_kws) return fig @@ -4652,7 +4653,7 @@ def combiboxplot(self, e0="fermie", brange=None, swarm=False, ax=None, **kwargs) ax.grid(True) sns.boxplot(x="band", y="eig", data=data, hue="label", ax=ax, **kwargs) if swarm: - sns.swarmplot(x="band", y="eig", data=data, hue="label", color=".25", ax=ax) + sns.swarmplot(x="band", y="eig", data=data, hue="label", palette="dark:.25", ax=ax) else: # Generate two subplots for spin-up / spin-down channels. import matplotlib.pyplot as plt @@ -4665,7 +4666,7 @@ def combiboxplot(self, e0="fermie", brange=None, swarm=False, ax=None, **kwargs) data_spin = data[data["spin"] == spin] sns.boxplot(x="band", y="eig", data=data_spin, hue="label", ax=ax, **kwargs) if swarm: - sns.swarmplot(x="band", y="eig", data=data_spin, hue="label", color=".25", ax=ax) + sns.swarmplot(x="band", y="eig", data=data_spin, hue="label", palette="dark:.25", ax=ax) return fig diff --git a/abipy/electrons/fold2bloch.py b/abipy/electrons/fold2bloch.py index 95d66441a..86818d077 100644 --- a/abipy/electrons/fold2bloch.py +++ b/abipy/electrons/fold2bloch.py @@ -124,7 +124,7 @@ def to_string(self, verbose: int = 0) -> str: app(self.uf_kpoints.to_string(verbose=verbose, title="Unfolded k-points")) if verbose > 2: - app(self.hdr.to_string(verbose=verbose, title="Abinit Header")) + app(self.hdr.to_str(verbose=verbose, title="Abinit Header")) return "\n".join(lines) diff --git a/abipy/electrons/gsr.py b/abipy/electrons/gsr.py index 8c8e9d878..a9cb71ea4 100644 --- a/abipy/electrons/gsr.py +++ b/abipy/electrons/gsr.py @@ -126,7 +126,7 @@ def to_string(self, verbose: int = 0) -> str: if verbose > 1: app("") - app(self.hdr.to_string(verbose=verbose, title="Abinit Header")) + app(self.hdr.to_str(verbose=verbose, title="Abinit Header")) return "\n".join(lines) diff --git a/abipy/electrons/optic.py b/abipy/electrons/optic.py index 227c1937f..81846901b 100644 --- a/abipy/electrons/optic.py +++ b/abipy/electrons/optic.py @@ -212,7 +212,7 @@ def to_string(self, verbose: int = 0) -> str: if verbose > 1: app(marquee("Abinit Header", mark="=")) - app(self.hdr.to_string(verbose=verbose)) + app(self.hdr.to_str(verbose=verbose)) return "\n".join(lines) diff --git a/abipy/electrons/psps.py b/abipy/electrons/psps.py index 0dde944f8..a4bbed6c8 100644 --- a/abipy/electrons/psps.py +++ b/abipy/electrons/psps.py @@ -170,7 +170,7 @@ def to_string(self, verbose: int = 0) -> str: if verbose > 1: app("") - # app(self.hdr.to_string(verbose=verbose, title="Abinit Header")) + # app(self.hdr.to_str(verbose=verbose, title="Abinit Header")) return "\n".join(lines) diff --git a/abipy/electrons/scr.py b/abipy/electrons/scr.py index 76414f5f5..39dfc4e41 100644 --- a/abipy/electrons/scr.py +++ b/abipy/electrons/scr.py @@ -100,7 +100,7 @@ def to_string(self, verbose=0) -> str: if verbose > 1: app("") - app(self.hdr.to_string(verbose=verbose, title="Abinit Header")) + app(self.hdr.to_str(verbose=verbose, title="Abinit Header")) return "\n".join(lines) diff --git a/abipy/electrons/tchim.py b/abipy/electrons/tchim.py index f2e453274..ade803b92 100644 --- a/abipy/electrons/tchim.py +++ b/abipy/electrons/tchim.py @@ -92,7 +92,7 @@ def to_string(self, verbose: int = 0) -> str: app(self.ebands.to_string(with_structure=False, verbose=verbose, title="Electronic Bands")) if verbose > 1: app("") - app(self.hdr.to_string(verbose=verbose, title="Abinit Header")) + app(self.hdr.to_str(verbose=verbose, title="Abinit Header")) # app(f"nsppol: {self.r.nsppol}") # app(f"nqibz: {self.r.nqibz}") diff --git a/abipy/electrons/tests/test_gwr.py b/abipy/electrons/tests/test_gwr.py index c851f0fcf..3c21cbc42 100644 --- a/abipy/electrons/tests/test_gwr.py +++ b/abipy/electrons/tests/test_gwr.py @@ -38,7 +38,7 @@ def test_gwr_file(self): 6.02382E+01 5.21455E+01 1.86465E+00 2.44712E+00""", sep=" ", ) - ref_data.shape = (6, 4) + ref_data = ref_data.reshape((6, 4)) mesh = gwr.minimax_mesh assert mesh.ntau == 6 diff --git a/abipy/eph/gstore.py b/abipy/eph/gstore.py index 48e0fc8d7..b553c7b17 100644 --- a/abipy/eph/gstore.py +++ b/abipy/eph/gstore.py @@ -208,7 +208,7 @@ def to_string(self, verbose: int = 0) -> str: app(self.ebands.to_string(with_structure=False, verbose=verbose, title="Electronic Bands")) if verbose > 1: app("") - app(self.hdr.to_string(verbose=verbose, title="Abinit Header")) + app(self.hdr.to_str(verbose=verbose, title="Abinit Header")) app(marquee("Gstore parameters", mark="=")) app(f"nsppol: {self.r.nsppol}") diff --git a/abipy/eph/gwan.py b/abipy/eph/gwan.py index 3f64e5dd7..481cb3b55 100644 --- a/abipy/eph/gwan.py +++ b/abipy/eph/gwan.py @@ -127,7 +127,7 @@ def to_string(self, verbose: int = 0) -> str: f"nr_e={data.nr_e}, nr_p={data.nr_p}" ) if verbose > 1: - lines.extend(["", self.hdr.to_string(verbose=verbose, title="Abinit Header")]) + lines.extend(["", self.hdr.to_str(verbose=verbose, title="Abinit Header")]) return "\n".join(lines) @add_fig_kwargs diff --git a/abipy/examples/flows/run_atdep.py b/abipy/examples/flows/run_atdep.py index 61a934edb..070343379 100755 --- a/abipy/examples/flows/run_atdep.py +++ b/abipy/examples/flows/run_atdep.py @@ -1,68 +1,95 @@ -from pathlib import Path +#!/usr/bin/env python +r""" +Temperature-dependent phonons with aTDEP +======================================== + +This example shows how to build a flow that computes the temperature-dependent +interatomic force constants of MgO with aTDEP, starting from an AIMD trajectory (HIST.nc file). +The DDB file produced by aTDEP is then passed to anaddb to compute the phonon band structure and DOS. +""" + +import os +import sys import abipy.data as abidata -from abipy.abio.inputs import AtdepInput, AnaddbInput from abipy import flowtk +from abipy.abio.inputs import AnaddbInput, AtdepInput -def main(): - workdir = Path(__file__).name.replace(".py", "").replace("run_", "flow_") +def make_atdep_input(structure): + """Build the input file for aTDEP.""" + inp = AtdepInput(structure) + inp.set_vars( + multiplicity=[[-2, 2, 2], [2, -2, 2], [2, 2, -2]], + nstep_max=20, + nstep_min=1, + temperature=300, + rcut=7.0, + ngqpt1=[2, 2, 2], + ngqpt2=[1, 1, 1], + ) + + return inp - structure = abidata.structure_from_mpid('mp-1265') # MgO - ddb_file = abidata.ref_file('MgO_dfpt_aimd/MgO_DDB.nc') - hist_file = abidata.ref_file('MgO_dfpt_aimd/MgO_HIST.nc') - flow = get_atdep_flow(workdir, structure, hist_file, ddb_file) - flow.build_and_pickle_dump() +def make_anaddb_input(structure): + """Build the anaddb input file to compute phonon bands and DOS from the aTDEP DDB.""" + inp = AnaddbInput.phbands_and_dos( + structure, ngqpt=[2, 2, 2], ndivsm=40, line_density=None, + nqsmall=10, qppa=None, q1shft=(0, 0, 0), qptbounds=None, + asr=2, chneut=1, dipdip=1, dipquad=0, quadquad=0, + dos_method="tetra", lo_to_splitting="automatic", + with_ifc=True, anaddb_kwargs={}, spell_check=False, + ) + + return inp -def get_atdep_flow(workdir, structure, hist_file, ddb_file=None): +def build_flow(options): + # Set working directory (default is the name of the script with '.py' removed and "run_" replaced by "flow_") + if not options.workdir: + options.workdir = os.path.basename(sys.argv[0]).replace(".py", "").replace("run_", "flow_") - atdep_inp = get_atdep_input(structure) - anaddb_inp = get_anaddb_input(structure) + structure = abidata.structure_from_mpid("mp-1265") # MgO + ddb_file = abidata.ref_file("MgO_dfpt_aimd/MgO_DDB.nc") + hist_file = abidata.ref_file("MgO_dfpt_aimd/MgO_HIST.nc") + atdep_inp = make_atdep_input(structure) + anaddb_inp = make_anaddb_input(structure) anaddb_inp.set_vars( - ngqpt = atdep_inp['ngqpt1'], - rifcsph = atdep_inp['rcut'], - ) + ngqpt=atdep_inp["ngqpt1"], + rifcsph=atdep_inp["rcut"], + ) atdep_task = flowtk.AtdepTask(atdep_inp, hist_node=hist_file, ddb_node=ddb_file) anaddb_task = flowtk.AnaddbTask(anaddb_inp, ddb_node=atdep_task) - flow = flowtk.Flow(workdir=workdir) - + flow = flowtk.Flow(workdir=options.workdir, manager=options.manager) flow.register_task(atdep_task) flow.register_task(anaddb_task, deps={atdep_task: "DDB"}) return flow -def get_atdep_input(structure): - - inp = AtdepInput(structure) - inp.set_vars( - multiplicity=[[-2,2,2],[2,-2,2],[2,2,-2]], - nstep_max=20, - nstep_min=1, - temperature=300, - rcut=7.0, - ngqpt1=[2,2,2], - ngqpt2=[1,1,1], - ) - - return inp +# This block generates the thumbnails in the AbiPy gallery. +# You can safely REMOVE this part if you are using this script for production runs. +if os.getenv("READTHEDOCS", False): + __name__ = None + import tempfile -def get_anaddb_input(structure): + options = flowtk.build_flow_main_parser().parse_args(["-w", tempfile.mkdtemp()]) + build_flow(options).graphviz_imshow() - inp = AnaddbInput.phbands_and_dos( - structure, ngqpt=[2,2,2], ndivsm=40, line_density=None, - nqsmall=10, qppa=None, q1shft=(0, 0, 0), qptbounds=None, - asr=2, chneut=1, dipdip=1, dipquad=0, quadquad=0, - dos_method='tetra', lo_to_splitting='automatic', - with_ifc=True, anaddb_kwargs={}, spell_check=False) - return inp +@flowtk.flow_main +def main(options): + """ + This is our main function that will be invoked by the script. + flow_main is a decorator implementing the command line interface. + Command line args are stored in `options`. + """ + return build_flow(options) if __name__ == "__main__": - main() + sys.exit(main()) diff --git a/abipy/flowtk/events.py b/abipy/flowtk/events.py index d5cecaf34..d82b172a9 100644 --- a/abipy/flowtk/events.py +++ b/abipy/flowtk/events.py @@ -26,7 +26,6 @@ from ruamel import yaml from ruamel.yaml import YAML, yaml_object -from abipy.tools.iotools import yaml_unsafe_load from abipy.tools.numtools import is_string from abipy.tools.plotting import add_fig_kwargs, get_ax_fig_plt, get_axarray_fig_plt, rotate_ticklabels, set_grid_legend from abipy.tools.serialization import pmg_serialize @@ -48,7 +47,7 @@ ] -_yaml = YAML() +_yaml = YAML(typ="safe", pure=True) def straceback() -> str: @@ -487,15 +486,8 @@ def parse(self, filename: str, verbose: int = 0) -> EventReport: # print("got doc.tag", doc.tag,"--") try: doc.text = doc.text.replace("\n \n", "\n") - # print(doc.text) - # OLD VERSION - # event = yaml.load(doc.text) # Can't use ruamel safe_load! - - # event = yaml_safe_load(doc.text) # Can't use ruamel safe_load! - event = yaml_unsafe_load(doc.text) # Can't use ruamel safe_load! - # FIXME: This new (recommend) API does not reproduce yaml.load behavior. bug in ruamel? - # event = yaml.YAML(typ='unsafe', pure=True).load(dox.text) - # print(event.yaml_tag, type(event)) + # Use the safe loader in which the event classes are registered via yaml_object. + event = _yaml.load(doc.text) except Exception: # raise # Wrong YAML doc. Check that doc tag and instantiate the proper event. diff --git a/abipy/ml/aseml.py b/abipy/ml/aseml.py index 11921b8d5..e42cf674e 100644 --- a/abipy/ml/aseml.py +++ b/abipy/ml/aseml.py @@ -34,7 +34,11 @@ from ase.md.npt import NPT from ase.md.nptberendsen import Inhomogeneous_NPTBerendsen, NPTBerendsen from ase.md.nvtberendsen import NVTBerendsen -from ase.md.velocitydistribution import MaxwellBoltzmannDistribution +try: + from ase.md.velocitydistribution import thermalize_momenta +except ImportError: + # ase < 3.29 + from ase.md.velocitydistribution import MaxwellBoltzmannDistribution as thermalize_momenta from ase.mep import NEB from ase.optimize.optimize import Optimizer from ase.stress import full_3x3_to_voigt_6_stress, voigt_6_to_full_3x3_stress @@ -2511,8 +2515,8 @@ def run(self) -> None: # forces = self.atoms.get_forces() if not append_trajectory: - print("Setting momenta corresponding to the input temperature using MaxwellBoltzmannDistribution.") - MaxwellBoltzmannDistribution(self.atoms, temperature_K=self.temperature) + print("Setting momenta corresponding to the input temperature using a Maxwell-Boltzmann distribution.") + thermalize_momenta(self.atoms, temperature_K=self.temperature) else: prev_steps = self.steps self.steps = self.steps - (len_traj * self.loginterval) diff --git a/abipy/scripts/abistruct.py b/abipy/scripts/abistruct.py index 0ae68dc83..ea9c16bc5 100755 --- a/abipy/scripts/abistruct.py +++ b/abipy/scripts/abistruct.py @@ -980,7 +980,7 @@ def show_examples_and_exit(err_msg=None, error_code=1): options.scaling_matrix = np.array(options.scaling_matrix) if len(options.scaling_matrix) == 9: - options.scaling_matrix.shape = (3, 3) + options.scaling_matrix = options.scaling_matrix.reshape((3, 3)) if options.verbose: print("scaling matrix: ", options.scaling_matrix) diff --git a/abipy/tools/iotools.py b/abipy/tools/iotools.py index 93310f91e..108218c06 100644 --- a/abipy/tools/iotools.py +++ b/abipy/tools/iotools.py @@ -59,7 +59,7 @@ def yaml_dump(obj: Any): """Dump object in Yaml format""" import io - y = yaml.YAML(typ="unsafe") + y = yaml.YAML(typ="full") stream = io.StringIO() y.dump(obj, stream) stream.seek(0) diff --git a/abipy/tools/tests/test_numtools.py b/abipy/tools/tests/test_numtools.py index f672da36b..3811ca5ce 100644 --- a/abipy/tools/tests/test_numtools.py +++ b/abipy/tools/tests/test_numtools.py @@ -30,7 +30,7 @@ def test_build_mesh(self): def test_transpose_last3dims(self): """Testing transpose_last3dims""" arr = np.arange(120) - arr.shape = (2, 2, 10, 3) + arr = arr.reshape((2, 2, 10, 3)) same_arr = transpose_last3dims(arr) same_arr = transpose_last3dims(same_arr) @@ -43,14 +43,14 @@ def test_add_periodic_replicas(self): new_arr = add_periodic_replicas(arr) assert new_arr[-1] == 1 - arr.shape = (2, 3) + arr = arr.reshape((2, 3)) new_arr = add_periodic_replicas(arr) assert np.all(new_arr[-1] == [1, 2, 3, 1]) assert np.all(new_arr[:, -1] == [1, 4, 1]) # 4D case. arr = np.arange(120) - arr.shape = (2, 2, 10, 3) + arr = arr.reshape((2, 2, 10, 3)) new_arr = add_periodic_replicas(arr) assert np.all(new_arr[:, :-1, :-1, :-1] == arr) diff --git a/abipy/wannier90/abiwan.py b/abipy/wannier90/abiwan.py index fdd373fc6..74594de0b 100644 --- a/abipy/wannier90/abiwan.py +++ b/abipy/wannier90/abiwan.py @@ -199,7 +199,7 @@ def to_string(self, verbose: int = 0) -> str: if verbose > 1: app("") - app(self.hdr.to_string(verbose=verbose, title="Abinit Header")) + app(self.hdr.to_str(verbose=verbose, title="Abinit Header")) if verbose >= 2: app("irvec and ndegen") for r, n in zip(self.irvec, self.ndegen, strict=False): diff --git a/abipy/waves/pwwave.py b/abipy/waves/pwwave.py index 17ec68e8d..e4260fb52 100644 --- a/abipy/waves/pwwave.py +++ b/abipy/waves/pwwave.py @@ -438,13 +438,13 @@ def plot_line_neighbors( Return: |matplotlib-Figure| """ site = self.structure[site_index] - nn_list = self.structure.get_neighbors_old(site, radius, include_index=True) + nn_list = self.structure.get_neighbors(site, radius, include_index=True) if not nn_list: cprint("Zero neighbors found for radius %s Ang. Returning None." % radius, "yellow") return None # Sort sites by distance. - nn_list = sorted(nn_list, key=lambda t: t[1]) + nn_list = sorted(nn_list, key=lambda t: t.nn_distance) if max_nn is not None and len(nn_list) > max_nn: cprint( "For radius %s, found %s neighbors but only max_nn %s sites are show." % (radius, len(nn_list), max_nn), diff --git a/abipy/waves/tests/test_pwwave.py b/abipy/waves/tests/test_pwwave.py index c2c88d9c1..516cbb71d 100644 --- a/abipy/waves/tests/test_pwwave.py +++ b/abipy/waves/tests/test_pwwave.py @@ -13,7 +13,7 @@ class TestPWWave(AbipyTest): def test_base(self): """Basic tests for PWWave""" vectors = np.array([1.0, 0, 0, 0, 1, 0, 0, 0, 1]) - vectors.shape = (3, 3) + vectors = vectors.reshape((3, 3)) mesh_443 = Mesh3D((4, 4, 3), vectors) mesh_444 = Mesh3D((4, 4, 4), vectors) @@ -26,7 +26,7 @@ def test_base(self): def test_fft(self): """FFT transforms""" vectors = np.array([1.0, 0, 0, 0, 1, 0, 0, 0, 1]) - vectors.shape = (3, 3) + vectors = vectors.reshape((3, 3)) mesh = Mesh3D((12, 3, 5), vectors) extra_dims = [(), 1, (2,), (3, 4)] diff --git a/abipy/waves/wfkfile.py b/abipy/waves/wfkfile.py index d733363a9..876701d61 100644 --- a/abipy/waves/wfkfile.py +++ b/abipy/waves/wfkfile.py @@ -122,7 +122,7 @@ def to_string(self, verbose=0) -> str: if verbose > 1: app("") - app(self.hdr.to_string(verbose=verbose, title="Abinit Header")) + app(self.hdr.to_str(verbose=verbose, title="Abinit Header")) return "\n".join(lines) From ecbd927ab14ebbc5ab26dc11e5058f0fbc9ceb27 Mon Sep 17 00:00:00 2001 From: Matteo Giantomassi Date: Mon, 28 Sep 2026 02:22:44 +0200 Subject: [PATCH 12/23] Execute ruff check . --fix --- abipy/abio/abivars.py | 1 - abipy/abio/factories.py | 1 - abipy/abio/inputs.py | 3 +-- abipy/abio/outputs.py | 1 - abipy/abio/robots.py | 2 +- abipy/core/fields.py | 2 +- abipy/core/structure.py | 1 - abipy/core/symmetries.py | 1 - abipy/dfpt/ifc.py | 6 +++--- abipy/dfpt/phonons.py | 2 +- abipy/electrons/bse.py | 1 - abipy/electrons/ebands.py | 2 +- abipy/electrons/gw.py | 1 - abipy/electrons/gwr.py | 15 ++++++--------- abipy/eph/gpath.py | 2 +- abipy/eph/gstore.py | 10 +++++----- abipy/flowtk/events.py | 1 - abipy/flowtk/finitediff.py | 8 ++++---- abipy/flowtk/flows.py | 1 - abipy/flowtk/launcher.py | 1 - abipy/flowtk/nodes.py | 1 - abipy/flowtk/qadapters.py | 1 - abipy/flowtk/qutils.py | 1 - abipy/flowtk/tasks.py | 1 - abipy/ml/aseml.py | 1 + abipy/tools/printing.py | 2 +- 26 files changed, 26 insertions(+), 43 deletions(-) diff --git a/abipy/abio/abivars.py b/abipy/abio/abivars.py index f7b7c33c0..48ebe6393 100644 --- a/abipy/abio/abivars.py +++ b/abipy/abio/abivars.py @@ -15,7 +15,6 @@ from abipy.abio.abivar_database.variables import get_codevars from abipy.core.mixins import Has_Structure, NotebookWriter, TextFile from abipy.core.structure import Structure, dataframes_from_structures -from abipy.tools.numtools import is_string __all__ = [ "AbinitInputFile", diff --git a/abipy/abio/factories.py b/abipy/abio/factories.py index 958bc70b2..880168497 100644 --- a/abipy/abio/factories.py +++ b/abipy/abio/factories.py @@ -17,7 +17,6 @@ # from pymatgen.io.abinit.pseudos import PseudoTable from abipy.core.structure import Structure -from abipy.tools.numtools import is_string from abipy.tools.serialization import pmg_serialize __all__ = [ diff --git a/abipy/abio/inputs.py b/abipy/abio/inputs.py index ec7b1b93b..ec499145c 100644 --- a/abipy/abio/inputs.py +++ b/abipy/abio/inputs.py @@ -37,8 +37,7 @@ from abipy.flowtk import AbinitTask, AnaddbTask, NetcdfReader, ParalHintsParser, Pseudo, PseudoTable from abipy.flowtk import abiobjects as aobj from abipy.flowtk.abiinspect import yaml_read_irred_perts -from abipy.tools import duck -from abipy.tools.numtools import is_diagonal, is_string +from abipy.tools.numtools import is_diagonal from abipy.tools.serialization import pmg_serialize from .enums import GWR_TASK, RUNL # WFK_TASK, diff --git a/abipy/abio/outputs.py b/abipy/abio/outputs.py index 9f27ab6cd..80f43a1b8 100644 --- a/abipy/abio/outputs.py +++ b/abipy/abio/outputs.py @@ -24,7 +24,6 @@ from abipy.core.structure import Structure, dataframes_from_structures from abipy.core.symmetries import AbinitSpaceGroup from abipy.flowtk import D2DEScfCycle, EventsParser, GroundStateScfCycle, NetcdfReader -from abipy.tools.numtools import is_string from abipy.tools.typing import Figure diff --git a/abipy/abio/robots.py b/abipy/abio/robots.py index 0717a1ee6..5a277c928 100644 --- a/abipy/abio/robots.py +++ b/abipy/abio/robots.py @@ -26,7 +26,7 @@ from abipy.core.structure import Structure from abipy.tools import duck from abipy.tools.iotools import make_executable -from abipy.tools.numtools import is_string, sort_and_groupby +from abipy.tools.numtools import sort_and_groupby from abipy.tools.plotting import ( ConvergenceAnalyzer, add_fig_kwargs, diff --git a/abipy/core/fields.py b/abipy/core/fields.py index 6d913d8ce..817786bd0 100644 --- a/abipy/core/fields.py +++ b/abipy/core/fields.py @@ -22,7 +22,7 @@ from abipy.core.structure import Structure from abipy.iotools import ETSF_Reader, Visualizer, cube, xsf from abipy.tools import duck -from abipy.tools.numtools import is_string, transpose_last3dims +from abipy.tools.numtools import transpose_last3dims from abipy.tools.plotting import add_fig_kwargs, get_ax_fig_plt, get_axarray_fig_plt, set_grid_legend from abipy.tools.typing import Figure diff --git a/abipy/core/structure.py b/abipy/core/structure.py index d1ee355b0..a6d992a22 100644 --- a/abipy/core/structure.py +++ b/abipy/core/structure.py @@ -27,7 +27,6 @@ from abipy.core.mixins import NotebookWriter from abipy.core.symmetries import AbinitSpaceGroup from abipy.iotools import Visualizer, as_etsfreader -from abipy.tools.numtools import is_string from abipy.tools.plotting import add_fig_kwargs, add_plotly_fig_kwargs, get_ax_fig_plt, get_axarray_fig_plt from abipy.tools.typing import Figure, PathLike diff --git a/abipy/core/symmetries.py b/abipy/core/symmetries.py index cdc58e00b..aa2b54bc6 100644 --- a/abipy/core/symmetries.py +++ b/abipy/core/symmetries.py @@ -18,7 +18,6 @@ from abipy.core.kpoints import has_timrev_from_kptopt, issamek, wrap_to_ws from abipy.core.mixins import SlotPickleMixin -from abipy.tools.numtools import is_string __all__ = [ "AbinitSpaceGroup", diff --git a/abipy/dfpt/ifc.py b/abipy/dfpt/ifc.py index 3d2060852..0c0f0d920 100644 --- a/abipy/dfpt/ifc.py +++ b/abipy/dfpt/ifc.py @@ -133,21 +133,21 @@ def number_of_neighbours(self) -> int: return np.shape(self.neighbours_indices)[1] @cached_property - def ifc_cart_coord_ewald(self) -> None | np.ndarray: + def ifc_cart_coord_ewald(self) -> np.ndarray | None: """Ewald part of the IFCs in cartesian coordinates.""" if self.ifc_cart_coord_short_range is None: return None return self.ifc_cart_coord - self.ifc_cart_coord_short_range @cached_property - def ifc_local_coord(self) -> None | np.ndarray: + def ifc_local_coord(self) -> np.ndarray | None: """IFCs in local coordinates.""" if self.local_vectors is None: return None return np.einsum("ktli,ktij,ktuj->ktlu", self.local_vectors, self.ifc_cart_coord, self.local_vectors) @cached_property - def ifc_local_coord_short_range(self) -> None | np.ndarray: + def ifc_local_coord_short_range(self) -> np.ndarray | None: """Short range part of the IFCs in cartesian coordinates.""" if self.local_vectors is None: return None diff --git a/abipy/dfpt/phonons.py b/abipy/dfpt/phonons.py index dfe5b8bb6..5c80b8f62 100644 --- a/abipy/dfpt/phonons.py +++ b/abipy/dfpt/phonons.py @@ -30,7 +30,7 @@ from abipy.core.structure import Structure from abipy.iotools import ETSF_Reader from abipy.tools import duck -from abipy.tools.numtools import gaussian, is_string, sort_and_groupby +from abipy.tools.numtools import gaussian, sort_and_groupby from abipy.tools.plotting import ( PlotlyRowColDesc, add_fig_kwargs, diff --git a/abipy/electrons/bse.py b/abipy/electrons/bse.py index d316b84d3..b63896434 100644 --- a/abipy/electrons/bse.py +++ b/abipy/electrons/bse.py @@ -18,7 +18,6 @@ from abipy.electrons.ebands import RobotWithEbands from abipy.iotools import ETSF_Reader from abipy.tools import duck -from abipy.tools.numtools import is_string from abipy.tools.plotting import add_fig_kwargs, get_ax_fig_plt, get_axarray_fig_plt, set_axlims from abipy.tools.typing import Figure diff --git a/abipy/electrons/ebands.py b/abipy/electrons/ebands.py index 6a878119a..af3a025d8 100644 --- a/abipy/electrons/ebands.py +++ b/abipy/electrons/ebands.py @@ -44,7 +44,7 @@ from abipy.tools import duck from abipy.tools.context_managers import Timer from abipy.tools.decorators import memoized_method -from abipy.tools.numtools import gaussian, is_string +from abipy.tools.numtools import gaussian from abipy.tools.plotting import ( PlotlyRowColDesc, add_fig_kwargs, diff --git a/abipy/electrons/gw.py b/abipy/electrons/gw.py index d76799e66..c1ec3a808 100644 --- a/abipy/electrons/gw.py +++ b/abipy/electrons/gw.py @@ -28,7 +28,6 @@ from abipy.iotools import ETSF_Reader from abipy.tools import duck from abipy.tools.iotools import filepath_extract_differences -from abipy.tools.numtools import is_string from abipy.tools.plotting import ( ArrayPlotter, Marker, diff --git a/abipy/electrons/gwr.py b/abipy/electrons/gwr.py index b8eca8a9d..1e12c3b28 100644 --- a/abipy/electrons/gwr.py +++ b/abipy/electrons/gwr.py @@ -390,7 +390,7 @@ def get_pade_data(self, w_vals: np.ndarray, e0: float, pade_method: str) -> Pade def plot_pade( self, pade_methods: list[str], - wmesh: None | np.ndarray = None, + wmesh: np.ndarray | None = None, ref_data: PadeData | None = None, ax_mat=None, fontsize: int = 8, @@ -1033,7 +1033,7 @@ def interpolate( # Read QP energies # varname = "qpz_ene" - egw_rarr = self.r.read_value(varname, cmode="c", path=f"iter{iter}" if iter else '/').real * abu.Ha_eV + egw_rarr = self.r.read_value(varname, cmode="c", path=f"iter{iter}" if iter else "/").real * abu.Ha_eV if ks_ebands_kpath is not None: # Compute QP corrections @@ -1106,14 +1106,11 @@ def interpolate( homos = ks_ebands_kpath.homos if ks_ebands_kpath is not None else self.ebands.homos qp_fermie = self.ebands.fermie - if ks_ebands_kpath is not None: - qp_fermie = max([np.max(eigens_kpath[e.spin, :, e.band]) for e in homos]) - elif self.r.min_bstart == 0: + if ks_ebands_kpath is not None or self.r.min_bstart == 0: qp_fermie = max([np.max(eigens_kpath[e.spin, :, e.band]) for e in homos]) - else: - # Check if all HOMOs are within the GW corrected bands - if all(self.r.min_bstart <= e.band < self.r.min_bstop for e in homos): - qp_fermie = max([np.max(eigens_kpath[e.spin, :, e.band - self.r.min_bstart]) for e in homos]) + # Check if all HOMOs are within the GW corrected bands + elif all(self.r.min_bstart <= e.band < self.r.min_bstop for e in homos): + qp_fermie = max([np.max(eigens_kpath[e.spin, :, e.band - self.r.min_bstart]) for e in homos]) qp_ebands_kpath = ElectronBands( self.structure, diff --git a/abipy/eph/gpath.py b/abipy/eph/gpath.py index dd7708a83..5a55116fd 100644 --- a/abipy/eph/gpath.py +++ b/abipy/eph/gpath.py @@ -5,8 +5,8 @@ from __future__ import annotations -from functools import cached_property import warnings +from functools import cached_property import numpy as np from monty.string import marquee diff --git a/abipy/eph/gstore.py b/abipy/eph/gstore.py index b553c7b17..4f4ecf41f 100644 --- a/abipy/eph/gstore.py +++ b/abipy/eph/gstore.py @@ -646,8 +646,8 @@ def plot_gwpt_vs_ks_scatter( ax.legend(loc="upper left", fontsize=fontsize) if with_inset: - from mpl_toolkits.axes_grid1.inset_locator import inset_axes from matplotlib.patches import Rectangle + from mpl_toolkits.axes_grid1.inset_locator import inset_axes full_max = max(float(x.max()), float(y.max())) * 1.02 @@ -1377,7 +1377,7 @@ def mark_outliers(ax, valx, valy): ax.scatter(x[~matched], y[~matched], s=1, alpha=0.3, rasterized=True, color="C3", label=f"mismatched (k,q): {n_sym - n_ok}/{n_sym}") - ax.plot([0, max_val], [0, max_val], 'k--', lw=0.5, label="y = x") + ax.plot([0, max_val], [0, max_val], "k--", lw=0.5, label="y = x") mark_outliers(ax, x, y) _add_fit_annotation(ax, x, y, xlim=(0, max_val), fontsize=fontsize) @@ -1422,7 +1422,7 @@ def mark_outliers(ax, valx, valy): # +-360 deg helper lines so points wrapped across the +-180 deg branch cut still # land "on the diagonal" instead of looking like spurious large mismatches. for offset, ref_label in ((0, "y = x"), (-360, None), (360, None)): - ax.plot([-180, 180], [-180 + offset, 180 + offset], 'k--', lw=0.5, label=ref_label) + ax.plot([-180, 180], [-180 + offset, 180 + offset], "k--", lw=0.5, label=ref_label) mark_outliers(ax, phase1, phase2) _add_fit_annotation(ax, phase1[has_signal], phase2[has_signal], xlim=(-180, 180), wrap=True, fontsize=fontsize) @@ -1454,7 +1454,7 @@ def mark_outliers(ax, valx, valy): ax.scatter(real1[~matched], real2[~matched], s=1, alpha=0.3, rasterized=True, color="C3", label=f"mismatched (k,q): {n_sym - n_ok}/{n_sym}") - ax.plot([-lim, lim], [-lim, lim], 'k--', lw=0.5, label="y = x") + ax.plot([-lim, lim], [-lim, lim], "k--", lw=0.5, label="y = x") mark_outliers(ax, real1, real2) _add_fit_annotation(ax, real1, real2, xlim=(-lim, lim), fontsize=fontsize) @@ -1485,7 +1485,7 @@ def mark_outliers(ax, valx, valy): ax.scatter(imag1[~matched], imag2[~matched], s=1, alpha=0.3, rasterized=True, color="C3", label=f"mismatched (k,q): {n_sym - n_ok}/{n_sym}") - ax.plot([-lim, lim], [-lim, lim], 'k--', lw=0.5, label="y = x") + ax.plot([-lim, lim], [-lim, lim], "k--", lw=0.5, label="y = x") mark_outliers(ax, imag1, imag2) _add_fit_annotation(ax, imag1, imag2, xlim=(-lim, lim), fontsize=fontsize) diff --git a/abipy/flowtk/events.py b/abipy/flowtk/events.py index d82b172a9..574f33867 100644 --- a/abipy/flowtk/events.py +++ b/abipy/flowtk/events.py @@ -26,7 +26,6 @@ from ruamel import yaml from ruamel.yaml import YAML, yaml_object -from abipy.tools.numtools import is_string from abipy.tools.plotting import add_fig_kwargs, get_ax_fig_plt, get_axarray_fig_plt, rotate_ticklabels, set_grid_legend from abipy.tools.serialization import pmg_serialize from abipy.tools.typing import Figure diff --git a/abipy/flowtk/finitediff.py b/abipy/flowtk/finitediff.py index c9d13e75c..86a46a798 100644 --- a/abipy/flowtk/finitediff.py +++ b/abipy/flowtk/finitediff.py @@ -390,7 +390,7 @@ def get_zeffs_list(self): return zeffs_list def print_eff_charges( - self, elements: None | list[str] = None, iat_list: None | list[int] = None, file=sys.stdout, verbose: int = 0 + self, elements: list[str] | None = None, iat_list: list[int] | None = None, file=sys.stdout, verbose: int = 0 ) -> None: """ Print effective charges to `file`. @@ -447,7 +447,7 @@ def plot_etotal(self, mode="diff", fontsize=8, sharey=False, **kwargs) -> Figure @add_fig_kwargs def plot_forces( - self, elements: None | list[str] = None, iat_list: None | list[int] = None, fontsize=8, sharey=False, **kwargs + self, elements: list[str] | None = None, iat_list: list[int] | None = None, fontsize=8, sharey=False, **kwargs ) -> Figure: """ Plot Cartesian forces as a function of the amplitude of the perturbation. @@ -701,8 +701,8 @@ def find_ip_pert_from_cart_dir(self, field_cart_dir) -> tuple[int, Perturbation] def plot_forces_vs_field( self, field_cart_dir, - elements: None | list[str] = None, - iat_list: None | list[int] = None, + elements: list[str] | None = None, + iat_list: list[int] | None = None, fontsize=8, sharey=False, **kwargs, diff --git a/abipy/flowtk/flows.py b/abipy/flowtk/flows.py index 4fdb6f9f4..939e84630 100644 --- a/abipy/flowtk/flows.py +++ b/abipy/flowtk/flows.py @@ -36,7 +36,6 @@ from abipy.core.globals import get_workdir from abipy.flowtk import wrappers from abipy.tools.iotools import AtomicFile -from abipy.tools.numtools import is_string from abipy.tools.plotting import add_fig_kwargs, get_ax_fig_plt from abipy.tools.printing import print_dataframe from abipy.tools.serialization import mjson_loads, pmg_pickle_dump, pmg_pickle_load, pmg_serialize diff --git a/abipy/flowtk/launcher.py b/abipy/flowtk/launcher.py index a1e10276a..a8e73a6c1 100644 --- a/abipy/flowtk/launcher.py +++ b/abipy/flowtk/launcher.py @@ -19,7 +19,6 @@ from monty.string import boxed from monty.termcolor import cprint -from abipy.tools.numtools import is_string from abipy.tools.iotools import ask_yesno, yaml_safe_load from abipy.tools.typing import TYPE_CHECKING diff --git a/abipy/flowtk/nodes.py b/abipy/flowtk/nodes.py index 22fa61d98..251ca35e7 100644 --- a/abipy/flowtk/nodes.py +++ b/abipy/flowtk/nodes.py @@ -24,7 +24,6 @@ from pydispatch import dispatcher from abipy.tools.iotools import AtomicFile -from abipy.tools.numtools import is_string from abipy.tools.serialization import json_pretty_dump, pmg_serialize # from abipy.tools.typing import TYPE_CHECKING diff --git a/abipy/flowtk/qadapters.py b/abipy/flowtk/qadapters.py index 2ebed53ed..9b6c4a5c5 100644 --- a/abipy/flowtk/qadapters.py +++ b/abipy/flowtk/qadapters.py @@ -35,7 +35,6 @@ from pymatgen.core.units import Memory, UnitError from abipy.tools.iotools import AtomicFile -from abipy.tools.numtools import is_string from . import qutils as qu from .launcher import ScriptEditor diff --git a/abipy/flowtk/qutils.py b/abipy/flowtk/qutils.py index 6fdc77c0d..a556370e0 100644 --- a/abipy/flowtk/qutils.py +++ b/abipy/flowtk/qutils.py @@ -15,7 +15,6 @@ from pymatgen.core.units import Memory, Time, UnitError from abipy.tools import duck -from abipy.tools.numtools import is_string from abipy.tools.text import rm_multiple_spaces from abipy.tools.typing import PathLike diff --git a/abipy/flowtk/tasks.py b/abipy/flowtk/tasks.py index 26ddf576b..1b8e3c52c 100644 --- a/abipy/flowtk/tasks.py +++ b/abipy/flowtk/tasks.py @@ -29,7 +29,6 @@ from abipy.core.globals import get_workdir from abipy.core.structure import Structure from abipy.tools.iotools import yaml_safe_load -from abipy.tools.numtools import is_string from abipy.tools.serialization import json_pretty_dump, pmg_serialize from abipy.tools.typing import TYPE_CHECKING diff --git a/abipy/ml/aseml.py b/abipy/ml/aseml.py index e42cf674e..64c44cf79 100644 --- a/abipy/ml/aseml.py +++ b/abipy/ml/aseml.py @@ -34,6 +34,7 @@ from ase.md.npt import NPT from ase.md.nptberendsen import Inhomogeneous_NPTBerendsen, NPTBerendsen from ase.md.nvtberendsen import NVTBerendsen + try: from ase.md.velocitydistribution import thermalize_momenta except ImportError: diff --git a/abipy/tools/printing.py b/abipy/tools/printing.py index 1eefd5e11..025fc2f66 100644 --- a/abipy/tools/printing.py +++ b/abipy/tools/printing.py @@ -10,7 +10,7 @@ def print_dataframe( df: pd.DataFrame, title=None, precision=6, sortby=None, file=sys.stdout, end=None, display=None -) -> None | str: +) -> str | None: """ Print entire pandas DataFrame. From 5615d44b461ef24d389b60619820517e63ceb5f5 Mon Sep 17 00:00:00 2001 From: Matteo Giantomassi Date: Mon, 28 Sep 2026 02:29:52 +0200 Subject: [PATCH 13/23] ISOME should not be imported --- abipy/abilab.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/abipy/abilab.py b/abipy/abilab.py index 14a41bcea..db7d3e831 100644 --- a/abipy/abilab.py +++ b/abipy/abilab.py @@ -105,7 +105,8 @@ from abipy.eph.gpath import GpathFile from abipy.eph.gstore import GstoreFile from abipy.eph.gwan import GwanFile -from abipy.eph.isome import IsomeFile +# TODO: Under development +# from abipy.eph.isome import IsomeFile from abipy.eph.rta import RtaFile, RtaRobot from abipy.eph.sigeph import SigEPhFile, SigEPhRobot from abipy.eph.transportfile import TransportFile @@ -209,7 +210,7 @@ def _straceback(): ("SIGEPH.nc", SigEPhFile), ("GSTORE.nc", GstoreFile), ("GWAN.nc", GwanFile), - ("ISOME.nc", IsomeFile), + # ("ISOME.nc", IsomeFile), ("GPATH.nc", GpathFile), ("TRANSPORT.nc", TransportFile), ("RTA.nc", RtaFile), From 2b1317d25c376addcb68c53e6aae914a09613925 Mon Sep 17 00:00:00 2001 From: Matteo Giantomassi Date: Mon, 28 Sep 2026 02:44:12 +0200 Subject: [PATCH 14/23] Restrict UCX to shared memory and TCP --- .github/workflows/gh-pages.yml | 3 +++ .github/workflows/test.yml | 7 +++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml index 6bc3f1e7c..67644d32e 100644 --- a/.github/workflows/gh-pages.yml +++ b/.github/workflows/gh-pages.yml @@ -39,6 +39,9 @@ jobs: PMG_MAPI_KEY: ${{ secrets.PMG_MAPI_KEY }} # This is used in the flow scripts to generate the graph with graphviz. READTHEDOCS: 1 + # Restrict UCX (used by the conda-forge MPICH) to shared memory and TCP. Otherwise MPI_Init may fail + # on runners with Azure MANA NICs: "UCX ERROR mana_0: failed to create UD QP ... Operation not supported" + UCX_TLS: self,sm,tcp steps: - name: Check out Abipy repo diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 296b535a1..55aa6e813 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -31,13 +31,16 @@ jobs: python: "3.12" - os: ubuntu-latest python: "3.13" - #- os: ubuntu-latest - # python: "3.14" + - os: ubuntu-latest + python: "3.14" runs-on: ${{ matrix.config.os }} env: PMG_MAPI_KEY: ${{ secrets.PMG_MAPI_KEY }} + # Restrict UCX (used by the conda-forge MPICH) to shared memory and TCP. Otherwise MPI_Init may fail + # on runners with Azure MANA NICs: "UCX ERROR mana_0: failed to create UD QP ... Operation not supported" + UCX_TLS: self,sm,tcp steps: - name: Checkout Abipy repo From 2c66d533837b8f51ab154ebbd87161f5b9dbcf6f Mon Sep 17 00:00:00 2001 From: Matteo Giantomassi Date: Mon, 28 Sep 2026 12:51:41 +0200 Subject: [PATCH 15/23] Skip test_cod_api --- abipy/scripts/tests/test_scripts.py | 1 + 1 file changed, 1 insertion(+) diff --git a/abipy/scripts/tests/test_scripts.py b/abipy/scripts/tests/test_scripts.py index 5d148d5a7..313ae34e1 100644 --- a/abipy/scripts/tests/test_scripts.py +++ b/abipy/scripts/tests/test_scripts.py @@ -285,6 +285,7 @@ def test_oxistate(self): expect_stderr=self.expect_stderr, ) + @pytest.mark.skip(reason="Interface with COD database is not stable") def test_cod_api(self): """Testing abistruct COD methods.""" self.skip_if_not_executable("mysql") From fe05761f2022c1c5a4ded691192c6d6482d77230 Mon Sep 17 00:00:00 2001 From: Matteo Giantomassi Date: Tue, 29 Sep 2026 16:52:02 +0200 Subject: [PATCH 16/23] Improve integration tests --- abipy/core/testing.py | 10 +- abipy/core/tests/test_structure.py | 2 +- abipy/data/tests/test_data.py | 2 +- abipy/dfpt/tests/test_ddb.py | 2 +- abipy/electrons/tests/test_ebands.py | 4 +- abipy/flowtk/qadapters.py | 25 ++- abipy/flowtk/tasks.py | 128 +++++++++++-- abipy/flowtk/utils.py | 3 +- abipy/integration_tests/README.md | 21 ++- abipy/integration_tests/conftest.py | 172 ++++++++++++++++-- abipy/integration_tests/helpers.py | 102 +++++++++++ abipy/integration_tests/itest_ebands.py | 45 +---- .../itest_flows_from_files.py | 11 +- abipy/integration_tests/itest_frohlich_zpr.py | 9 +- abipy/integration_tests/itest_gw.py | 18 +- abipy/integration_tests/itest_handlers.py | 15 +- abipy/integration_tests/itest_optic.py | 13 +- abipy/integration_tests/itest_phonons.py | 17 +- abipy/integration_tests/itest_phonopy.py | 20 +- abipy/integration_tests/itest_relaxations.py | 37 +--- abipy/integration_tests/pytest.ini | 3 + abipy/panels/a2f.py | 2 +- abipy/panels/core.py | 54 +++--- abipy/panels/ddb.py | 48 ++--- abipy/panels/electrons.py | 4 +- abipy/panels/fatbands.py | 6 +- abipy/panels/flows.py | 16 +- abipy/panels/gsr.py | 4 +- abipy/panels/hist.py | 10 +- abipy/panels/nodes.py | 32 ++-- abipy/panels/oncvpsp_gui.py | 22 +-- abipy/panels/phonons.py | 6 +- abipy/panels/sigeph.py | 6 +- abipy/panels/structure.py | 54 +++--- abipy/panels/tasks.py | 4 +- abipy/panels/viewers.py | 4 +- pyproject.toml | 1 + 37 files changed, 605 insertions(+), 327 deletions(-) create mode 100644 abipy/integration_tests/helpers.py diff --git a/abipy/core/testing.py b/abipy/core/testing.py index 8ab54a5f1..8491d3092 100644 --- a/abipy/core/testing.py +++ b/abipy/core/testing.py @@ -358,8 +358,14 @@ def skip_if_abinit_not_ge(self, version: str) -> None: raise unittest.SkipTest("This test requires Abinit version %s %s" % (op, version)) @staticmethod - def test_mprester(): - """Skip MP rester tests.""" + def require_mprester() -> bool: + """ + Skip the test that calls this method since the MPRester tests have been disabled. + Change the implementation to return True to re-enable them. + + Note that the name must not start with `test_` else pytest collects this method + as a test in all the subclasses of AbipyTest. + """ raise unittest.SkipTest("MPRester tests have been disabled") # return True diff --git a/abipy/core/tests/test_structure.py b/abipy/core/tests/test_structure.py index d42eb562b..5fb4fb87a 100644 --- a/abipy/core/tests/test_structure.py +++ b/abipy/core/tests/test_structure.py @@ -234,7 +234,7 @@ def test_utils(self): self.assert_almost_equal(mgb2.lattice.angles, (90.0, 90.0, 120.00000000000001)) self.assert_almost_equal(mgb2.lattice.volume * abu.Ang_Bohr**3, 196.07928976151663) - if self.test_mprester(): + if self.require_mprester(): si = Structure.from_mpid("mp-149") assert si.formula == "Si2" with self.assertRaises(ValueError): diff --git a/abipy/data/tests/test_data.py b/abipy/data/tests/test_data.py index a9d75fd0b..05ed75df5 100644 --- a/abipy/data/tests/test_data.py +++ b/abipy/data/tests/test_data.py @@ -24,7 +24,7 @@ def test_data_api(self): structure = abidata.structure_from_cif("gan2.cif") assert hasattr(structure, "to_abivars") - if self.test_mprester(): + if self.require_mprester(): structure = abidata.structure_from_mpid("mp-4820") assert hasattr(structure, "to_abivars") with self.assertRaises(KeyError): diff --git a/abipy/dfpt/tests/test_ddb.py b/abipy/dfpt/tests/test_ddb.py index 13338128d..847d1e90f 100644 --- a/abipy/dfpt/tests/test_ddb.py +++ b/abipy/dfpt/tests/test_ddb.py @@ -476,7 +476,7 @@ def test_mgb2_ddbs_ngkpt_tsmear(self): def test_ddb_from_mprester(self): """Test creation methods for DdbFile and DdbRobot from MP REST API.""" - if self.test_mprester(): + if self.require_mprester(): with self.assertRaises(ValueError): abilab.DdbFile.from_mpid("foobar") diff --git a/abipy/electrons/tests/test_ebands.py b/abipy/electrons/tests/test_ebands.py index 42f46522b..ed0e04d39 100644 --- a/abipy/electrons/tests/test_ebands.py +++ b/abipy/electrons/tests/test_ebands.py @@ -585,7 +585,7 @@ def test_dataframe_from_ebands(self): class ElectronBandsFromRestApi(AbipyTest): def test_from_mpid(self): """Testing interpolation of SnO2 band energies from MP database.""" - if self.test_mprester(): + if self.require_mprester(): with self.assertRaises(ValueError): abilab.ElectronBands.from_mpid("foobar") @@ -613,7 +613,7 @@ def test_from_mpid(self): def test_ebands_from_mpid_magnetic_semiconductor_nelect_automatically_computed(self): """https://github.com/abinit/abipy/issues/232""" - if self.test_mprester(): + if self.require_mprester(): ebands = ElectronBands.from_mpid("mp-565814") assert ebands.nsppol == 2 self.assert_almost_equal(ebands.direct_gaps[0].energy, 3.6776999999999997) diff --git a/abipy/flowtk/qadapters.py b/abipy/flowtk/qadapters.py index 9b6c4a5c5..8cb48df26 100644 --- a/abipy/flowtk/qadapters.py +++ b/abipy/flowtk/qadapters.py @@ -20,11 +20,12 @@ import logging import math import os +import signal import string import sys from collections import namedtuple from functools import cached_property -from subprocess import PIPE, Popen +from subprocess import DEVNULL, PIPE, Popen from typing import Any from monty.collections import AttrDict @@ -66,6 +67,22 @@ class SubmitResults(namedtuple("SubmitResult", "qid, out, err, process")): """ +def kill_process_group(pid: int, sig=signal.SIGKILL) -> int: + """ + Send signal `sig` to the process group led by `pid` so that children (mpirun, abinit ...) are killed too. + Fall back to killing `pid` alone if the process is not a group leader, to avoid signaling our own group. + Return 0 if success, 1 if the process does not exist or cannot be signaled. + """ + try: + if os.getpgid(pid) == pid: + os.killpg(pid, sig) + else: + os.kill(pid, sig) + return 0 + except OSError: + return 1 + + class MpiRunner: """ This object provides an abstraction for the mpirunner provided @@ -1356,11 +1373,13 @@ class ShellAdapter(QueueAdapter): """ def cancel(self, job_id: int) -> int: - return os.system("kill -9 %d" % job_id) + return kill_process_group(job_id) def _submit_to_queue(self, script_file: str) -> SubmitResults: # Submit the job, return process and pid. - process = Popen(("/bin/bash", script_file), stderr=PIPE) + # stdin is closed so that an executable reading from stdin fails immediately instead of hanging. + # The job runs in a new session so that cancel can kill the whole process tree (mpirun, abinit ...). + process = Popen(("/bin/bash", script_file), stdin=DEVNULL, stderr=PIPE, start_new_session=True) return SubmitResults( qid=process.pid, out="no out in shell submission", err="no err in shell submission", process=process ) diff --git a/abipy/flowtk/tasks.py b/abipy/flowtk/tasks.py index 1b8e3c52c..b75d01104 100644 --- a/abipy/flowtk/tasks.py +++ b/abipy/flowtk/tasks.py @@ -9,6 +9,8 @@ import logging import os import shutil +import signal +import subprocess import time from functools import cached_property from io import StringIO @@ -36,7 +38,7 @@ from . import qutils as qu from .abitimer import AbinitTimerParser from .nodes import FileNode, Node, NodeError, NodeResults, Status -from .qadapters import QueueAdapter, QueueAdapterError, make_qadapter +from .qadapters import QueueAdapter, QueueAdapterError, kill_process_group, make_qadapter # from abipy.abio.enums import GWR_TASK from .utils import Condition, Directory, File, FilepathFixer, SparseHistogram, abi_splitext, irdvars_for_ext @@ -1352,7 +1354,7 @@ class FakeProcess: def poll(self): return None - def wait(self): + def wait(self, timeout=None): raise RuntimeError("Cannot wait a FakeProcess") def communicate(self, input=None): @@ -1851,9 +1853,28 @@ def poll(self) -> int: return self._returncode - def wait(self) -> int: - """Wait for child process to terminate. Set and return returncode attribute.""" - self._returncode = self.process.wait() + def wait(self, timeout: float | None = None) -> int: + """ + Wait for child process to terminate. Set and return returncode attribute. + + Args: + timeout: Max time in seconds to wait. None means wait forever. + If the process does not terminate in time, the process tree is killed, + the task is set to S_ERROR and TaskError is raised. + """ + try: + self._returncode = self.process.wait(timeout=timeout) + except subprocess.TimeoutExpired: + kill_process_group(self.process.pid) + self._returncode = self.process.wait() + msg = f"Task did not complete within {timeout} s. Process tree has been killed." + self.set_status(self.S_ERROR, msg) + raise self.Error(f"{self}: {msg}") + except KeyboardInterrupt: + # The process runs in its own session and would not receive SIGINT from the terminal. + kill_process_group(self.process.pid) + raise + try: self.process.stderr.close() except Exception: @@ -2103,10 +2124,21 @@ def check_status(self) -> Status: black_list = (self.S_LOCKED, self.S_ERROR) # if self.status in black_list: return self.status - # 2) Check the returncode of the job script - if self.returncode != 0: - msg = "job.sh return code: %s\nPerhaps the job was not submitted properly?" % self.returncode - return self.set_status(self.S_QCRITICAL, msg=msg) + # A frozen job killed by abipy stays in S_ERROR until the task is started again. + if self.status == self.S_ERROR and self.__dict__.get("_frozen_killed", False): + return self.status + + # 2) Update the returncode of the job script. + # Poll the process so that we detect jobs that died without leaving a trace in the output files + # (e.g. segmentation fault or SIGKILL from the OOM killer). Without this check, the task stays in S_RUN + # until frozen_timeout, or forever if the output file has not been created. + # For resource managers such as Slurm, the process is the submission command. + # The process is not available if the task has been unpickled, in this case we rely on the files. + # The returncode is checked only after the analysis of the Abinit files so that + # errors reported by Abinit (S_ABICRITICAL) can be handled by the error handlers. + process = self.__dict__.get("_process") + if process is not None: + self._returncode = process.poll() # If we have an abort file produced by Abinit if self.mpiabort_file.exists: @@ -2183,6 +2215,14 @@ def check_status(self) -> Status: msg = "\n".join(map(repr, report.errors)) return self.set_status(self.S_ABICRITICAL, msg=msg) + if self.returncode not in (0, None): + return self._set_status_from_returncode() + + # Check for frozen jobs before step 5, else this check is never performed + # when the resource manager creates the qerr file (e.g. Slurm). + if self._is_frozen(): + return self._set_frozen_status() + # 5) if self.stderr_file.exists and not err_msg: if self.qerr_file.exists and not qerr_info: @@ -2192,6 +2232,9 @@ def check_status(self) -> Status: self.S_RUN, msg="there is output and no errors: job still seems to be running" ) + if self.returncode not in (0, None): + return self._set_status_from_returncode() + # 6) if not self.output_file.exists: # self.history.debug("output_file does not exists") @@ -2253,11 +2296,8 @@ def check_status(self) -> Status: # print('the job still seems to be running maybe it is hanging without producing output... ') # Check time of last modification. - if self.output_file.exists and ( - time.time() - self.output_file.get_stat().st_mtime > self.manager.policy.frozen_timeout - ): - msg = "Task seems to be frozen, last change more than %s [s] ago" % self.manager.policy.frozen_timeout - return self.set_status(self.S_ERROR, msg=msg) + if self._is_frozen(): + return self._set_frozen_status() # Handle weird case in which either run.abo, or run.log have not been produced # if self.status not in (self.S_INIT, self.S_READY) and (not self.output.file.exists or not self.log_file.exits): @@ -2266,6 +2306,61 @@ def check_status(self) -> Status: return self.set_status(self.S_RUN, msg="final option: nothing seems to be wrong, the job must still be running") + def _is_frozen(self) -> bool: + """ + True if the output file exists and neither the output file nor the log file + have been modified in the last `frozen_timeout` seconds. + """ + if not self.output_file.exists: + return False + mtimes = [f.get_stat().st_mtime for f in (self.output_file, self.log_file) if f.exists] + return time.time() - max(mtimes) > self.manager.policy.frozen_timeout + + def _set_frozen_status(self) -> Status: + """ + Kill the job and set the status to S_ERROR for a frozen job. + Note that we don't use self.cancel as this method removes the output files needed for debugging. + """ + msg = "Task seems to be frozen, last change of %s and %s more than %s [s] ago." % ( + self.output_file.basename, + self.log_file.basename, + self.manager.policy.frozen_timeout, + ) + if self.queue_id is not None: + exit_status = self.manager.cancel(self.queue_id) + msg += " Job %s cancelled, exit status: %s" % (self.queue_id, exit_status) + + # Tell check_status to keep S_ERROR, else the non-zero returncode of the killed job would override it. + self._frozen_killed = True + return self.set_status(self.S_ERROR, msg=msg) + + def _set_status_from_returncode(self) -> Status: + """ + Set the status to S_QCRITICAL when the job script terminated with a non-zero returncode + but the Abinit files do not report any error. + """ + rc = self.returncode + # Negative returncode: killed by signal -rc. Shells report 128 + signal number. + signum = -rc if rc < 0 else (rc - 128 if rc > 128 else None) + try: + signame = signal.Signals(signum).name if signum is not None else None + except ValueError: + signame = None + + msg = f"Job script terminated with return code {rc}" + if signame is not None: + msg += f" (killed by {signame})" + msg += ( + " but no error has been reported in the output files.\n" + "Perhaps the executable crashed (segmentation fault, out of memory ...) " + "or the job was not submitted properly." + ) + if self.stderr_file.getsize() != 0: + err = self.stderr_file.read().splitlines() + msg += "\nLast lines of %s:\n%s" % (self.stderr_file.path, "\n".join(err[-10:])) + + return self.set_status(self.S_QCRITICAL, msg=msg) + def reduce_memory_demand(self): """ Method that can be called by the scheduler to decrease the memory demand of a specific task. @@ -2699,6 +2794,7 @@ def start(self, **kwargs) -> int: return 0 # Start the calculation in a subprocess and return. + self._frozen_killed = False self._process = self.manager.launch(self, **kwargs) return 1 @@ -2707,9 +2803,11 @@ def start_and_wait(self, *args, **kwargs) -> int: Helper method to start the task and wait for completion. Mainly used when we are submitting the task via the shell without passing through a queue manager. + Accepts an optional `timeout` in seconds, see `wait`. """ + timeout = kwargs.pop("timeout", None) self.start(*args, **kwargs) - retcode = self.wait() + retcode = self.wait(timeout=timeout) return retcode def get_graphviz(self, engine="automatic", graph_attr=None, node_attr=None, edge_attr=None): diff --git a/abipy/flowtk/utils.py b/abipy/flowtk/utils.py index 547267d90..455760e9c 100644 --- a/abipy/flowtk/utils.py +++ b/abipy/flowtk/utils.py @@ -13,7 +13,6 @@ import numpy as np from monty.collections import dict2namedtuple from monty.fnmatch import WildCard -from monty.shutil import copy_r from monty.string import list_strings from abipy.tools.plotting import add_fig_kwargs, get_ax_fig_plt @@ -227,7 +226,7 @@ def copy_r(self, dst: str) -> None: """ Implements a recursive copy function similar to Unix's "cp -r" command. """ - return copy_r(self.path, dst) + shutil.copytree(self.path, dst, dirs_exist_ok=True) def clean(self) -> None: """Remove all files in the directory tree while preserving the directory""" diff --git a/abipy/integration_tests/README.md b/abipy/integration_tests/README.md index 6463215d1..78c830218 100644 --- a/abipy/integration_tests/README.md +++ b/abipy/integration_tests/README.md @@ -3,8 +3,9 @@ ## Requirements - pytest (framework for unit tests) +- pytest-timeout (each test is killed after the `timeout` given in pytest.ini) - abinit -- abipy with configured manager.yaml +- abipy with configured manager.yaml ## How to run the tests @@ -12,7 +13,21 @@ Change the configuration options for the task manager reported in the file `manager.yaml` Execute pytest in the current directory. -Results are produced in the directory in `_mytests` +Results are produced in the directory `_integration_tests_`. +Use `pytest -v` to print the TaskManager configurations in the header. + +By default, the abipy autoparal is disabled and the tasks are executed with a fixed number +of MPI processes so that the results do not depend on the machine. +Inputs with `paral_kgb 1` and without `np_spkpt`, `npband`, `npfft` get the Abinit variable +`autoparal 1` so that Abinit selects the distribution at runtime. +The following environment variables change this behaviour: + +- `ABIPY_ITEST_MPI_PROCS`: number of MPI processes (default: 2). +- `ABIPY_ITEST_AUTOPARAL=1`: run the tests also with the abipy autoparal. + +Hanging tasks are detected by the scheduler via the `frozen_timeout` policy (2 minutes). +When a test fails, the report includes the flow workdir and the last lines of the files +produced by the tasks that failed. ## How to add a new integration test @@ -20,7 +35,7 @@ The file pytest.ini contains the configuration options passed to py.test Test functions should start with the prefix `itest_` where `i` stands for integration. -Each test function receives the fixture arguments `fwp` and `tvars` defined in conftest.py. +Each test function receives the fixture arguments `fwp` and `tvars` defined in conftest.py. `fwp` contains the parameters used to generate the `AbinitFlow`, whereas `tvars` is a dictionary with the Abinit variables used to generate the input files. pytest will generate multiple test for the each `itest_` function diff --git a/abipy/integration_tests/conftest.py b/abipy/integration_tests/conftest.py index a8f0cffd2..3f5771b79 100644 --- a/abipy/integration_tests/conftest.py +++ b/abipy/integration_tests/conftest.py @@ -3,15 +3,19 @@ from __future__ import annotations import copy +import io import os -from pprint import pformat +from types import SimpleNamespace import pytest from monty.collections import AttrDict from monty.string import marquee +from ruamel.yaml import YAML from abipy import flowtk -from abipy.tools.iotools import yaml_dump, yaml_safe_load_path +from abipy.flowtk.qadapters import ShellAdapter, kill_process_group +from abipy.integration_tests.helpers import collect_task_errors +from abipy.tools.iotools import yaml_safe_load_path # Are we running on travis? @@ -30,37 +34,163 @@ base_conf = yaml_safe_load_path(os.path.join(USER_CONFIG_DIR, "manager.yml")) + +def _to_yaml(d: dict) -> str: + """ + Convert dictionary to YAML string in block style. + Aliases are disabled so that the anchors of manager.yml (e.g. &hardware) are expanded. + """ + yaml = YAML(typ="safe", pure=True) + yaml.default_flow_style = False + yaml.width = 120 + yaml.representer.ignore_aliases = lambda *args: True + stream = io.StringIO() + yaml.dump(d, stream) + return stream.getvalue() + + # Build list of configurations. -_manager_confs = [] +# By default, autoparal is disabled and the tasks are executed with a fixed number of MPI processes +# so that the parallel distribution does not depend on the machine (autoparal may select values of +# npfft that are not compatible with the FFT mesh or lead to deadlocks). +# Use ABIPY_ITEST_MPI_PROCS to change the number of MPI processes and +# ABIPY_ITEST_AUTOPARAL=1 to run the tests with autoparal as well. +ITEST_MPI_PROCS = int(os.environ.get("ABIPY_ITEST_MPI_PROCS", 2)) +_autoparal_list = [0, 1] if os.environ.get("ABIPY_ITEST_AUTOPARAL", "0") == "1" else [0] + +_manager_confs, _manager_ids = [], [] -for autoparal in [1]: # , 1]: +for autoparal in _autoparal_list: newd = copy.deepcopy(base_conf) if "policy" not in newd: newd["policy"] = {} newd["policy"]["autoparal"] = autoparal - _manager_confs.append(newd) + # A task is set to S_ERROR if the output file has not been modified for frozen_timeout. + # The default (1 hour) is too large for the small systems used in the integration tests. + # Keep it below the pytest timeout so that the scheduler detects the problem first. + newd["policy"].setdefault("frozen_timeout", "0-0:2:0") + # mpi_procs is used only if autoparal is disabled. + mpi_procs = None if autoparal else ITEST_MPI_PROCS + _manager_confs.append((_to_yaml(newd), mpi_procs)) + # Short id used in the test names e.g. itest_foo[mpi2-paral_kgb1]. + _manager_ids.append("autoparal" if autoparal else f"mpi{mpi_procs}") + + +# Options of the scheduler that override the values given in the user configuration file. +# Tolerate a few python exceptions (e.g. netcdf file read while Abinit is still writing it). +# The exceptions are still reported as warnings by assert_flow_ok. +SCHEDULER_OVERRIDES = dict(max_num_pyexcs=2) -_manager_confs = [yaml_dump(d) for d in _manager_confs] -# _manager_confs = [base_conf] +def _apply_scheduler_overrides(sched): + for k, v in SCHEDULER_OVERRIDES.items(): + setattr(sched, k, v) + return sched -@pytest.fixture(params=_manager_confs) +@pytest.fixture(params=_manager_confs, ids=_manager_ids) def fwp(tmpdir, request): """ Parameters used to initialize Flows. This fixture allows us to change the |TaskManager| so that we can easily test different configurations. """ - # Temporary working directory - fwp.workdir = str(tmpdir) + conf, mpi_procs = request.param + manager = flowtk.TaskManager.from_string(conf) + if mpi_procs is not None: + manager = manager.new_with_fixed_mpi_omp(mpi_procs, 1) + + return SimpleNamespace( + # Temporary working directory + workdir=str(tmpdir), + manager=manager, + scheduler=_apply_scheduler_overrides( + flowtk.PyFlowScheduler.from_file(os.path.join(USER_CONFIG_DIR, "scheduler.yml")) + ), + abinit_build=flowtk.AbinitBuild(), + ) + + +# Variables defining the MPI distribution when paral_kgb == 1. +_NP_VARS = ("np_spkpt", "npkpt", "npband", "npfft", "npspinor") + + +def _add_abinit_autoparal(abinit_input, input_string: str) -> str: + """ + When the abipy autoparal is disabled, paral_kgb 1 inputs do not specify the MPI distribution + and Abinit aborts if nprocs > 1. In this case we add the Abinit variable autoparal 1 + so that Abinit selects np_spkpt, npband, npfft at runtime. + The distribution depends only on the number of MPI processes hence the tests are reproducible. + """ + if abinit_input.get("paral_kgb", 0) != 1 or "autoparal" in abinit_input: + return input_string + # Abinit accepts autoparal only for GS and DFPT (e.g. GW has its own MPI distribution). + if abinit_input.get("optdriver", 0) not in (0, 1): + return input_string + if any(v in abinit_input for v in _NP_VARS): + return input_string + return input_string + "\n# Added by the integration tests (conftest.py)\nautoparal 1\n" + + +@pytest.fixture(autouse=True) +def _itest_guard(monkeypatch): + """ + - Apply SCHEDULER_OVERRIDES to the schedulers created with flow.make_scheduler(). + - Keep track of the processes launched by the ShellAdapter and kill the ones + that are still running at the end of the test (e.g. after a timeout or a failure). + - Add autoparal 1 to the Abinit input files with paral_kgb 1 and without np* variables, + see _add_abinit_autoparal. + """ + orig_make_input = flowtk.AbinitTask.make_input + + def make_input(self, *args, **kwargs): + s = orig_make_input(self, *args, **kwargs) + return _add_abinit_autoparal(self.input, s) + + monkeypatch.setattr(flowtk.AbinitTask, "make_input", make_input) + + orig_from_user_config = flowtk.PyFlowScheduler.from_user_config.__func__ + + def from_user_config(cls): + return _apply_scheduler_overrides(orig_from_user_config(cls)) + + monkeypatch.setattr(flowtk.PyFlowScheduler, "from_user_config", classmethod(from_user_config)) + + processes = [] + orig_submit = ShellAdapter._submit_to_queue + + def _submit_to_queue(self, script_file): + results = orig_submit(self, script_file) + processes.append(results.process) + return results + + monkeypatch.setattr(ShellAdapter, "_submit_to_queue", _submit_to_queue) + + yield + + for process in processes: + if process.poll() is None: + print(f"Killing leftover process {process.pid} ({process.args})") + kill_process_group(process.pid) + process.wait() + + +@pytest.hookimpl(hookwrapper=True) +def pytest_runtest_makereport(item, call): + """Add the flow workdir and the tail of the files of the failed Abinit tasks to the report.""" + outcome = yield + report = outcome.get_result() + if report.when != "call" or not report.failed: + return - # Create the TaskManager. - fwp.manager = flowtk.TaskManager.from_string(request.param) - fwp.scheduler = flowtk.PyFlowScheduler.from_file(os.path.join(USER_CONFIG_DIR, "scheduler.yml")) - fwp.abinit_build = flowtk.AbinitBuild() + workdir = getattr(item.funcargs.get("fwp"), "workdir", None) + if workdir is None: + return - return fwp + report.sections.append(("Flow workdir", workdir)) + errors = collect_task_errors(workdir) + if errors: + report.sections.append(("Abinit task errors", errors)) # Use tuples instead of dict because pytest require objects to be hashable. @@ -70,7 +200,7 @@ def fwp(tmpdir, request): ] -@pytest.fixture(params=_tvars_list) +@pytest.fixture(params=_tvars_list, ids=["-".join(f"{k}{v}" for k, v in t) for t in _tvars_list]) def tvars(request): """ Abinit variables passed to the test functions. @@ -101,13 +231,17 @@ def pytest_report_header(config): app("\tIn particular, the abinit executable must be in $PATH.") app("\tChange manager.yml according to your platform.") app("\tNumber of TaskManager configurations used: %d" % len(_manager_confs)) + if not config.pluginmanager.hasplugin("timeout"): + app("\tWARNING: pytest-timeout is not installed. Tests may hang forever if Abinit hangs.") if config.option.verbose > 0: - for i, s in enumerate(_manager_confs): + for mid, (s, mpi_procs) in zip(_manager_ids, _manager_confs, strict=True): app(80 * "=") - app("TaskManager #%d" % i) - app(pformat(s)) + app(f"TaskManager [{mid}]") + if mpi_procs is not None: + app(f"autoparal disabled, tasks executed with mpi_procs: {mpi_procs}") app(80 * "=") + app(s) app("") # Print info on Abinit build diff --git a/abipy/integration_tests/helpers.py b/abipy/integration_tests/helpers.py new file mode 100644 index 000000000..5f0489e3d --- /dev/null +++ b/abipy/integration_tests/helpers.py @@ -0,0 +1,102 @@ +"""Helper functions shared by the integration tests.""" + +from __future__ import annotations + +import io +import os +import warnings + +import pytest + +# Files in the task workdir that are useful to understand why a task failed. +_ERROR_FILES = ("run.err", "queue.qerr", "__ABI_MPIABORTFILE__", "run.log", "run.abo") + + +def assert_flow_ok(flow, scheduler=None, check_finalized=True) -> None: + """ + Check that all the tasks in the flow completed successfully. + + If this is not the case, call pytest.fail with a report containing the status of the flow, + the output of flow.debug and the exceptions raised by the scheduler (if any). + Exceptions recorded by the scheduler are only reported as warnings if the flow completed successfully. + + Args: + flow: Flow to check. + scheduler: Scheduler used to run the flow (optional). + check_finalized: True if all the works in the flow should be finalized. + """ + excs = list(scheduler.exceptions) if scheduler is not None else [] + flow.check_status() + + if not flow.all_ok: + buf = io.StringIO() + flow.show_status(stream=buf) + flow.debug(stream=buf) + if excs: + buf.write("\nExceptions raised by the scheduler:\n" + "\n".join(str(e) for e in excs)) + pytest.fail(f"Flow in {flow.workdir} did not complete successfully:\n{buf.getvalue()}", pytrace=False) + + if excs: + warnings.warn( + f"Flow in {flow.workdir} completed but the scheduler recorded {len(excs)} exception(s):\n" + + "\n".join(str(e) for e in excs), + stacklevel=2, + ) + + if check_finalized: + not_finalized = [str(work) for work in flow if not work.finalized] + if not_finalized: + pytest.fail(f"Flow is ok but these works are not finalized: {not_finalized}", pytrace=False) + + +def run_flow(flow, scheduler=None, check_finalized=True): + """ + Run the flow with the scheduler and check that all the tasks completed successfully. + Use flow.make_scheduler() if scheduler is None. Return the scheduler. + """ + if scheduler is None: + scheduler = flow.make_scheduler() + scheduler.start() + assert_flow_ok(flow, scheduler=scheduler, check_finalized=check_finalized) + return scheduler + + +def tail(filepath: str, nlines: int = 40) -> str: + """Return the last `nlines` lines of a text file.""" + with open(filepath, errors="replace") as fh: + return "".join(fh.readlines()[-nlines:]) + + +def collect_task_errors(workdir: str, max_tasks: int = 5, nlines: int = 40) -> str: + """ + Scan the task directories inside `workdir` and return a string with the tail + of the files that signal an error (non-empty stderr, MPI abort file, ERROR/BUG in the log). + """ + sections, ntasks = [], 0 + for dirpath, _, filenames in sorted(os.walk(workdir)): + # Each task directory contains the input file run.abi. + if "run.abi" not in filenames: + continue + + paths = {f: os.path.join(dirpath, f) for f in _ERROR_FILES if f in filenames} + has_error = any( + os.path.getsize(paths[f]) > 0 for f in ("run.err", "queue.qerr", "__ABI_MPIABORTFILE__") if f in paths + ) + if not has_error and "run.log" in paths: + with open(paths["run.log"], errors="replace") as fh: + log = fh.read() + has_error = "--- !ERROR" in log or "--- !BUG" in log + + if not has_error: + continue + + for path in paths.values(): + if os.path.getsize(path) > 0: + sections.append(f"==> {path} <==\n{tail(path, nlines=nlines)}") + + ntasks += 1 + if ntasks >= max_tasks: + sections.append(f"Output truncated after {max_tasks} tasks.") + break + + return "\n".join(sections) diff --git a/abipy/integration_tests/itest_ebands.py b/abipy/integration_tests/itest_ebands.py index d278df7a1..69ae5a1bd 100644 --- a/abipy/integration_tests/itest_ebands.py +++ b/abipy/integration_tests/itest_ebands.py @@ -13,6 +13,7 @@ import abipy.data as abidata from abipy import abilab, flowtk from abipy.core.testing import has_matplotlib +from abipy.integration_tests.helpers import assert_flow_ok hostname = socket.gethostname() @@ -127,10 +128,7 @@ def itest_unconverged_scf(fwp, tvars): t1.check_status() assert t1.status == t1.S_OK - flow.show_status() - if not flow.all_ok: - flow.debug() - raise RuntimeError + assert_flow_ok(flow, check_finalized=False) assert flow.explain(verbose=1) @@ -239,12 +237,7 @@ def itest_bandstructure_flow(fwp, tvars): # aequal(t1.status, t1.S_OK) # afalse(t1.can_run) - flow.show_status() - if not flow.all_ok: - flow.debug() - raise RuntimeError - - assert all(work.finalized for work in flow) + assert_flow_ok(flow) for task in flow.iflat_tasks(): assert len(task.outdir.list_filepaths(wildcard="*GSR.nc")) == 1 @@ -316,17 +309,10 @@ def itest_bandstructure_schedflow(fwp, tvars): with pytest.raises(fwp.scheduler.Error): fwp.scheduler.add_flow(flow) - assert fwp.scheduler.start() == 0 - assert not fwp.scheduler.exceptions + fwp.scheduler.start() + assert_flow_ok(flow, fwp.scheduler) assert fwp.scheduler.nlaunch == 2 - flow.show_status() - if not flow.all_ok: - flow.debug() - raise RuntimeError - - assert all(work.finalized for work in flow) - # The WFK files should have been removed because we called set_garbage_collector for task in flow[0]: assert not task.outdir.has_abiext("WFK") @@ -377,17 +363,10 @@ def itest_htc_bandstructure(fwp, tvars): flow.build_and_pickle_dump(abivalidate=True) fwp.scheduler.add_flow(flow) - assert fwp.scheduler.start() == 0 - assert not fwp.scheduler.exceptions + fwp.scheduler.start() + assert_flow_ok(flow, fwp.scheduler) assert fwp.scheduler.nlaunch == 3 - flow.show_status() - if not flow.all_ok: - flow.debug() - raise RuntimeError - - assert all(work.finalized for work in flow) - # Test if GSR files are produced and are readable. for i, task in enumerate(work): with task.open_gsr() as gsr: @@ -442,12 +421,6 @@ def itest_metagga_ebands_flow(fwp, tvars): flow.build_and_pickle_dump(abivalidate=True) fwp.scheduler.add_flow(flow) - assert fwp.scheduler.start() == 0 - assert not fwp.scheduler.exceptions + fwp.scheduler.start() + assert_flow_ok(flow, fwp.scheduler) # assert fwp.scheduler.nlaunch == 3 - - flow.show_status() - if not flow.all_ok: - flow.debug() - raise RuntimeError - assert all(work.finalized for work in flow) diff --git a/abipy/integration_tests/itest_flows_from_files.py b/abipy/integration_tests/itest_flows_from_files.py index 1b34518d8..1e8fb37f9 100644 --- a/abipy/integration_tests/itest_flows_from_files.py +++ b/abipy/integration_tests/itest_flows_from_files.py @@ -9,6 +9,7 @@ import abipy.data as abidata from abipy import abilab, flowtk from abipy.core.testing import AbipyTest +from abipy.integration_tests.helpers import assert_flow_ok def make_scf_nscf_inputs(paral_kgb=1): @@ -103,16 +104,10 @@ def itest_nscf_from_denfile(fwp, tvars): # Will remove output files (WFK) flow.set_garbage_collector() scheduler = flow.make_scheduler() - assert scheduler.start() == 0 - assert not scheduler.exceptions + scheduler.start() + assert_flow_ok(flow, scheduler) assert scheduler.nlaunch == 1 - flow.check_status(show=True) - if not flow.all_ok: - flow.debug() - raise RuntimeError - assert all(work.finalized for work in flow) - # The WFK files should have been removed because we called set_garbage_collector # but the input DEN.nc should exist for task in flow[0]: diff --git a/abipy/integration_tests/itest_frohlich_zpr.py b/abipy/integration_tests/itest_frohlich_zpr.py index 8f4796613..ed242718f 100644 --- a/abipy/integration_tests/itest_frohlich_zpr.py +++ b/abipy/integration_tests/itest_frohlich_zpr.py @@ -9,6 +9,7 @@ import abipy.data as abidata from abipy import abilab from abipy.dfpt.ddb import DdbFile +from abipy.integration_tests.helpers import assert_flow_ok hostname = socket.gethostname() @@ -78,12 +79,8 @@ def itest_frohlich_zpr_flow(fwp, tvars): ) scheduler = flow.make_scheduler() - assert scheduler.start() == 0 - flow.check_status(show=True) - assert all(work.finalized for work in flow) - if not flow.all_ok: - flow.debug() - raise RuntimeError + scheduler.start() + assert_flow_ok(flow, scheduler) assert flow.on_all_ok_num_calls == 1 # Reconstruct python objects from JSON file. diff --git a/abipy/integration_tests/itest_gw.py b/abipy/integration_tests/itest_gw.py index 461eabc36..b92c5b703 100644 --- a/abipy/integration_tests/itest_gw.py +++ b/abipy/integration_tests/itest_gw.py @@ -8,6 +8,7 @@ import abipy.data as abidata from abipy import abilab, flowtk +from abipy.integration_tests.helpers import assert_flow_ok hostname = socket.gethostname() @@ -111,11 +112,7 @@ def itest_g0w0_flow(fwp, tvars): for task in flow[0]: task.start_and_wait() - flow.check_status(show=True) - assert all(work.finalized for work in flow) - if not flow.all_ok: - flow.debug() - raise RuntimeError + assert_flow_ok(flow) scf_task = flow[0][0] nscf_task = flow[0][1] @@ -208,18 +205,11 @@ def itest_htc_g0w0(fwp, tvars): flow.connect_signals() fwp.scheduler.add_flow(flow) - assert fwp.scheduler.start() == 0 - assert not fwp.scheduler.exceptions + fwp.scheduler.start() + assert_flow_ok(flow, fwp.scheduler) assert fwp.scheduler.nlaunch == 4 # The sigma task should produce a SCR file. assert len(work[2].outdir.list_filepaths(wildcard="*SCR")) == 1 - flow.show_status() - if not flow.all_ok: - flow.debug() - raise RuntimeError - - assert all(work.finalized for work in flow) - # assert flow.validate_json_schema() diff --git a/abipy/integration_tests/itest_handlers.py b/abipy/integration_tests/itest_handlers.py index 52efa9ba9..a6cfc432c 100644 --- a/abipy/integration_tests/itest_handlers.py +++ b/abipy/integration_tests/itest_handlers.py @@ -4,6 +4,7 @@ import abipy.data as abidata from abipy import abilab, flowtk +from abipy.integration_tests.helpers import run_flow def itest_tolsymerror_handler(fwp): @@ -59,12 +60,7 @@ def itest_tolsymerror_handler(fwp): flow.register_task(inp, task_class=flowtk.RelaxTask) flow.allocate() - assert flow.make_scheduler().start() == 0 - - flow.show_status() - if not flow.all_ok: - flow.debug() - raise RuntimeError + run_flow(flow, check_finalized=False) task = flow[0][0] assert len(task.corrections) == 1 @@ -117,12 +113,7 @@ def itest_dilatmxerror_handler(fwp): flow.register_task(inp, task_class=flowtk.RelaxTask) flow.allocate() - assert flow.make_scheduler().start() == 0 - - flow.show_status() - if not flow.all_ok: - flow.debug() - raise RuntimeError + run_flow(flow, check_finalized=False) task = flow[0][0] # Don't check the number of corrections as it's not portable. diff --git a/abipy/integration_tests/itest_optic.py b/abipy/integration_tests/itest_optic.py index d1ebb7192..9f19b2d11 100644 --- a/abipy/integration_tests/itest_optic.py +++ b/abipy/integration_tests/itest_optic.py @@ -6,6 +6,7 @@ import abipy.data as abidata from abipy import abilab, flowtk +from abipy.integration_tests.helpers import assert_flow_ok def make_inputs(tvars): @@ -105,10 +106,7 @@ def itest_optic_flow(fwp, tvars): task.start_and_wait() assert task.status == task.S_DONE - flow.check_status(show=True) - if not flow.all_ok: - flow.debug() - raise RuntimeError + assert_flow_ok(flow, check_finalized=False) # Optic does not support MPI with ncores > 1 hence we have to construct a manager with mpi_procs==1 shell_manager = fwp.manager.to_shell_manager(mpi_procs=1) @@ -146,12 +144,7 @@ def itest_optic_flow(fwp, tvars): optic_task2.start_and_wait() assert optic_task2.status == optic_task2.S_DONE - flow.check_status(show=True) - if not flow.all_ok: - flow.debug() - raise RuntimeError - - assert all(work.finalized for work in flow) + assert_flow_ok(flow) # assert flow.validate_json_schema() diff --git a/abipy/integration_tests/itest_phonons.py b/abipy/integration_tests/itest_phonons.py index a08aa295d..884f99da6 100644 --- a/abipy/integration_tests/itest_phonons.py +++ b/abipy/integration_tests/itest_phonons.py @@ -10,6 +10,7 @@ import abipy.data as abidata from abipy import abilab, flowtk from abipy.core.testing import has_matplotlib +from abipy.integration_tests.helpers import assert_flow_ok, run_flow logger = logging.getLogger(__name__) @@ -103,12 +104,8 @@ def itest_phonon_flow(fwp, tvars): flow = flowtk.PhononFlow.from_scf_input(fwp.workdir, scf_input, ph_ngqpt=ph_ngqpt, with_becs=False) scheduler = flow.make_scheduler() - assert scheduler.start() == 0 - flow.check_status(show=True) - assert all(work.finalized for work in flow) - if not flow.all_ok: - flow.debug() - raise RuntimeError + scheduler.start() + assert_flow_ok(flow, scheduler) with flow.open_final_ddb() as ddb: ddb_path = ddb.filepath @@ -224,13 +221,7 @@ def itest_phonon_restart(fwp): for task in flow.iflat_tasks(): task.manager.qadapter.max_num_launches = 20 - assert flow.make_scheduler().start() == 0 - - flow.check_status(show=True, verbose=1) - assert all(work.finalized for work in flow) - if not flow.all_ok: - flow.debug() - raise RuntimeError + run_flow(flow) assert sum(task.num_restarts for task in flow.iflat_tasks()) > 0 diff --git a/abipy/integration_tests/itest_phonopy.py b/abipy/integration_tests/itest_phonopy.py index 49c225fbe..a47ac5b95 100644 --- a/abipy/integration_tests/itest_phonopy.py +++ b/abipy/integration_tests/itest_phonopy.py @@ -15,6 +15,7 @@ from abipy import flowtk from abipy.abio.factories import gs_input from abipy.core.testing import has_phonopy +from abipy.integration_tests.helpers import assert_flow_ok def itest_phonopy_flow(fwp, tvars): @@ -47,14 +48,8 @@ def itest_phonopy_flow(fwp, tvars): flow.build_and_pickle_dump(abivalidate=True) scheduler = flow.make_scheduler() - assert scheduler.start() == 0 - - assert not scheduler.exceptions - flow.show_status() - if not flow.all_ok: - flow.debug() - raise RuntimeError - assert all(work.finalized for work in flow) + scheduler.start() + assert_flow_ok(flow, scheduler) # The WFK files should have been removed because we called set_garbage_collector for task in flow[0]: @@ -99,13 +94,8 @@ def itest_phonopy_gruneisen_flow(fwp, tvars): flow.build_and_pickle_dump(abivalidate=True) scheduler = flow.make_scheduler() - assert scheduler.start() == 0 - - assert not scheduler.exceptions - flow.show_status() - if not flow.all_ok: - flow.debug() - raise RuntimeError + scheduler.start() + assert_flow_ok(flow, scheduler, check_finalized=False) # Initialial work + 3 phonopy works. assert len(flow) == 4 assert all(work.finalized for work in flow) diff --git a/abipy/integration_tests/itest_relaxations.py b/abipy/integration_tests/itest_relaxations.py index 35dfcaee0..f232e798a 100644 --- a/abipy/integration_tests/itest_relaxations.py +++ b/abipy/integration_tests/itest_relaxations.py @@ -10,6 +10,7 @@ import abipy.data as abidata from abipy import abilab, flowtk from abipy.core.testing import has_matplotlib +from abipy.integration_tests.helpers import assert_flow_ok, run_flow hostname = socket.gethostname() @@ -21,8 +22,10 @@ def ion_relaxation(tvars, ntime=50): structure = abilab.Structure.from_file(abidata.cif_file("si.cif")) - # Perturb the structure (random perturbation of 0.1 Angstrom) - structure.perturb(distance=0.02) + # Perturb the structure (random displacement of 0.02 Angstrom). + # Use a fixed seed so that the test is reproducible: some random displacements + # trigger "Error in group closure" in the Abinit symmetry finder. + structure.perturb(distance=0.02, seed=42) global_vars = dict( ecut=6, @@ -94,11 +97,7 @@ def itest_atomic_relaxation(fwp, tvars): final_structure = t0.get_final_structure() assert final_structure != unconverged_structure - flow.show_status() - assert all(work.finalized for work in flow) - if not flow.all_ok: - flow.debug() - raise RuntimeError + assert_flow_ok(flow) # post-processing tools if has_matplotlib(): @@ -180,13 +179,7 @@ def itest_relaxation_with_restart_from_den(fwp, tvars): relax_work = flowtk.RelaxWork(ion_input, ioncell_input) flow.register_work(relax_work) - assert flow.make_scheduler().start() == 0 - flow.show_status() - - assert all(work.finalized for work in flow) - if not flow.all_ok: - flow.debug() - raise RuntimeError + run_flow(flow) # we should have (0, 1) restarts and no WFK file in outdir. for i, task in enumerate(relax_work): @@ -219,13 +212,7 @@ def itest_dilatmx_error_handler(fwp, tvars): flow.register_work(work) flow.allocate() - assert flow.make_scheduler().start() == 0 - flow.show_status() - - assert all(work.finalized for work in flow) - if not flow.all_ok: - flow.debug() - raise RuntimeError + run_flow(flow) # t0 should have reached S_OK, and we should have DilatmxError in the corrections. t0 = work[0] @@ -249,13 +236,7 @@ def itest_relaxation_with_target_dilatmx(fwp, tvars): relax_work = flowtk.RelaxWork(ion_input, ioncell_input, target_dilatmx=target_dilatmx) flow.register_work(relax_work) - assert flow.make_scheduler().start() == 0 - flow.show_status() - - assert all(work.finalized for work in flow) - if not flow.all_ok: - flow.debug() - raise RuntimeError + run_flow(flow) # assert relax_work.last_dilatmx <= target_dilatmx # we should have (0, 1) restarts diff --git a/abipy/integration_tests/pytest.ini b/abipy/integration_tests/pytest.ini index 9e297f7bb..40474eced 100644 --- a/abipy/integration_tests/pytest.ini +++ b/abipy/integration_tests/pytest.ini @@ -3,5 +3,8 @@ python_files=itest_*.py python_classes=Itest python_functions=itest addopts = -rf --basetemp=_integration_tests_ +# Max time in seconds for a single test (requires pytest-timeout). +# Use @pytest.mark.timeout(seconds) to change the value for a specific test. +timeout = 180 #-f loop on fail mode #looponfailroots (pathlist) directories to check for changes diff --git a/abipy/panels/a2f.py b/abipy/panels/a2f.py index a4adc9c6f..3f4679fda 100644 --- a/abipy/panels/a2f.py +++ b/abipy/panels/a2f.py @@ -21,7 +21,7 @@ def __init__(self, ncfile, **params): PanelWithElectronBands.__init__(self, ebands=ncfile.ebands, **params) self.ncfile = ncfile - self.a2f_view_btn = pnw.Button(label="Plot a2F", color="primary") + self.a2f_view_btn = pnw.Button(name="Plot a2F", button_type="primary") def get_a2f_view(self) -> pn.Row: """Return Row with widgets to visualize the structure.""" diff --git a/abipy/panels/core.py b/abipy/panels/core.py index cfc959916..e06927d0e 100644 --- a/abipy/panels/core.py +++ b/abipy/panels/core.py @@ -384,7 +384,7 @@ def ply( If everything is properly configured, a new window is automatically created in your browser. """) - btn = pnw.Button(label="Upload figure to chart studio server") + btn = pnw.Button(name="Upload figure to chart studio server") def push_to_cs(event): with ButtonContext(btn): @@ -507,7 +507,7 @@ def to_json(): # return file_download.callback() # FIXME: Menu button occupies less space but the upload does not work - # menu_btn = pnw.MenuButton(label='Export table', items=list(d.keys())) + # menu_btn = pnw.MenuButton(name='Export table', items=list(d.keys())) # menu_btn.on_click(download) # ca(menu_btn) @@ -591,12 +591,12 @@ def __init__(self, btn: pnw.Button): btn: The button to wrap with context. """ self.btn = btn - self.prev_name, self.prev_type = btn.label, btn.color + self.prev_name, self.prev_type = btn.name, btn.button_type def __enter__(self): # Disable the button. - self.btn.label = "Running ..." - self.btn.color = "warning" + self.btn.name = "Running ..." + self.btn.button_type = "warning" self.btn.loading = True self.btn.disabled = True return self.btn @@ -608,12 +608,12 @@ def __exit__(self, exc_type, exc_value, traceback): if exc_type: # Exception --> signal to the user that something went wrong for 2 seconds. - self.btn.label = str(exc_type) - self.btn.color = "danger" + self.btn.name = str(exc_type) + self.btn.button_type = "danger" time.sleep(2) # Back to the original button state. - self.btn.label, self.btn.color = self.prev_name, self.prev_type + self.btn.name, self.btn.button_type = self.prev_name, self.prev_type class Loading: @@ -823,7 +823,7 @@ def wdg_exts_with_get_panel(self, name="File extensions supported:"): from abipy.abilab import extcls_supporting_panel exts = [e[0] for e in extcls_supporting_panel(as_table=False)] - return pnw.Select(label=name, options=exts) + return pnw.Select(name=name, options=exts) @staticmethod def html_with_clipboard_btn(html_str: str, **kwargs): @@ -1069,7 +1069,7 @@ def __init__(self, structure: Structure, **params): # Change the list of allowed visualizers. self.param.structure_viewer.objects = ["jsmol", "crystalk", "ngl", "matplotlib", "plotly", "ase_atoms"] - self.view_structure_btn = pnw.Button(label="View structure", color="primary") + self.view_structure_btn = pnw.Button(name="View structure", button_type="primary") @depends_on_btn_click("view_structure_btn", show_shared_wdg_warning=False) def on_view_structure(self): @@ -1224,7 +1224,7 @@ def __init__(self, ncfile, **params): """ super().__init__(**params) self.ncfile = ncfile - self.netcdf_info_btn = pnw.Button(label="Show info", color="primary") + self.netcdf_info_btn = pnw.Button(name="Show info", button_type="primary") def get_ncfile_view(self) -> pn.Column: """Return a view with netcdf file information.""" @@ -1241,7 +1241,7 @@ def on_netcdf_info_btn(self) -> pn.Column: col = pn.Column(sizing_mode="stretch_width") ca = col.append - # nc_grpname = pnw.Select(label="nc group name", options=["/"]) + # nc_grpname = pnw.Select(name="nc group name", options=["/"]) input_string = self.ncfile.get_input_string() ca("## Input String") ca(bkw.PreText(text=input_string)) @@ -1337,26 +1337,26 @@ def __init__(self, ebands, **params): PanelWithStructure.__init__(self, structure=ebands.structure, **params) # Create buttons - self.plot_ebands_btn = pnw.Button(label="Plot e-bands", color="primary") - self.plot_edos_btn = pnw.Button(label="Plot e-DOS", color="primary") - self.plot_skw_btn = pnw.Button(label="Plot SKW interpolant", color="primary") + self.plot_ebands_btn = pnw.Button(name="Plot e-bands", button_type="primary") + self.plot_edos_btn = pnw.Button(name="Plot e-DOS", button_type="primary") + self.plot_skw_btn = pnw.Button(name="Plot SKW interpolant", button_type="primary") # Fermi surface plotter. # objects = [None, "matplotlib", "xcrysden"] # if self.has_remote_server: objects = [None, "matplotlib"] - # self.plot_fs_viewer_btn = pnw.Button(label="Plot SKW interpolant", color='primary') + # self.plot_fs_viewer_btn = pnw.Button(name="Plot SKW interpolant", button_type='primary') - self.plot_ifermi_btn = pnw.Button(label="Plot Fermi surface", color="primary") - # self.ifermi_plane_normal = pnw.LiteralInput(label='Plane normal (list)', value=[0, 0, 0], type=list, + self.plot_ifermi_btn = pnw.Button(name="Plot Fermi surface", button_type="primary") + # self.ifermi_plane_normal = pnw.LiteralInput(name='Plane normal (list)', value=[0, 0, 0], type=list, # placeholder="Enter normal in reduced coordinates") # self.ifermi_distance = pn.widgets.RangeSlider( - # label='distance', start=0, end=2 * max(ebands.structure.reciprocal_lattice.abc), + # name='distance', start=0, end=2 * max(ebands.structure.reciprocal_lattice.abc), # value=(0, 0), step=0.01) # ebands_kpath_fileinput = pnw.FileInput(accept=".nc") # ebands_kmesh_fileinput = pnw.FileInput(accept=".nc") - self.plot_effmass_btn = pnw.Button(label="Plot effective masses", color="primary") + self.plot_effmass_btn = pnw.Button(name="Plot effective masses", button_type="primary") if ebands.nsppol != 2: self.param.effmass_spin.objects = [0] @@ -1696,8 +1696,8 @@ def __init__(self, robot, **params): params: Parameters passed to the parent class. """ self.robot = robot - self.compare_params_btn = pnw.Button(label="Compare structures", color="primary") - self.transpose_params = pnw.Checkbox(label="Transpose table", value=True) + self.compare_params_btn = pnw.Button(name="Compare structures", button_type="primary") + self.transpose_params = pnw.Checkbox(name="Transpose table", value=True) super().__init__(**params) @@ -1744,14 +1744,14 @@ def __init__(self, robot, **params): # Widgets to plot ebands. self.ebands_plotter_mode = pnw.Select( - label="Plot Mode", value="gridplot", options=["gridplot", "combiplot", "boxplot", "combiboxplot"] + name="Plot Mode", value="gridplot", options=["gridplot", "combiplot", "boxplot", "combiboxplot"] ) # "animate", - self.ebands_plotter_btn = pnw.Button(label="Plot", color="primary") - self.ebands_df_checkbox = pnw.Checkbox(label="With Ebands DataFrame", value=False) + self.ebands_plotter_btn = pnw.Button(name="Plot", button_type="primary") + self.ebands_df_checkbox = pnw.Checkbox(name="With Ebands DataFrame", value=False) # Widgets to plot edos. - self.edos_plotter_mode = pnw.Select(label="Plot Mode", value="gridplot", options=["gridplot", "combiplot"]) - self.edos_plotter_btn = pnw.Button(label="Plot", color="primary") + self.edos_plotter_mode = pnw.Select(name="Plot Mode", value="gridplot", options=["gridplot", "combiplot"]) + self.edos_plotter_btn = pnw.Button(name="Plot", button_type="primary") def get_ebands_plotter_widgets(self) -> pn.Column: """Return a Column with widgets to plot electronic bands.""" diff --git a/abipy/panels/ddb.py b/abipy/panels/ddb.py index 01c768121..c1f93d901 100644 --- a/abipy/panels/ddb.py +++ b/abipy/panels/ddb.py @@ -102,18 +102,18 @@ def __init__(self, **params): """ super().__init__(**params) # FIXME - self.nqsmall_list = pnw.LiteralInput(label="nqmall_list (python syntax)", value=[10, 20, 30], type=list) - # nqqpt = pnw.LiteralInput(label='nsmalls (list)', value=[10, 20, 30], type=list) + self.nqsmall_list = pnw.LiteralInput(name="nqmall_list (python syntax)", value=[10, 20, 30], type=list) + # nqqpt = pnw.LiteralInput(name='nsmalls (list)', value=[10, 20, 30], type=list) self.eps0_wrange = pnw.EditableRangeSlider( - label="Frequency range (eV)", value=(0.0, 0.1), start=0.0, end=1.0, step=0.01 + name="Frequency range (eV)", value=(0.0, 0.1), start=0.0, end=1.0, step=0.01 ) - self.temp_range = pnw.EditableRangeSlider(label="T-range in K", value=(100.0, 400), start=0, end=1000, step=50) + self.temp_range = pnw.EditableRangeSlider(name="T-range in K", value=(100.0, 400), start=0, end=1000, step=50) # Base buttons self.plot_without_asr_dipdip_btn = pnw.Button( - label="Compute phonons with/wo ASR and DIPDIP", color="primary" + name="Compute phonons with/wo ASR and DIPDIP", button_type="primary" ) # if self.has_remote_serve: @@ -168,18 +168,18 @@ def __init__(self, ddb: DdbFile, **params): self.ddb = ddb # Add buttons - self.get_epsinf_btn = pnw.Button(label="Compute", color="primary") - self.plot_phbands_btn = pnw.Button(label="Plot Bands and DOS", color="primary") - self.plot_eps0w_btn = pnw.Button(label="Plot eps0(omega)", color="primary") + self.get_epsinf_btn = pnw.Button(name="Compute", button_type="primary") + self.plot_phbands_btn = pnw.Button(name="Plot Bands and DOS", button_type="primary") + self.plot_eps0w_btn = pnw.Button(name="Plot eps0(omega)", button_type="primary") - self.plot_vsound_btn = pnw.Button(label="Calculate speed of sound", color="primary") - self.plot_ifc_btn = pnw.Button(label="Compute IFC(R)", color="primary") - self.plot_phbands_quad_btn = pnw.Button(label="Plot PHbands with/without quadrupoles", color="primary") - self.plot_dos_vs_qmesh_btn = pnw.Button(label="Plot PHDos vs Qmesh", color="primary") - self.compute_elastic_btn = pnw.Button(label="Compute Elastic", color="primary") + self.plot_vsound_btn = pnw.Button(name="Calculate speed of sound", button_type="primary") + self.plot_ifc_btn = pnw.Button(name="Compute IFC(R)", button_type="primary") + self.plot_phbands_quad_btn = pnw.Button(name="Plot PHbands with/without quadrupoles", button_type="primary") + self.plot_dos_vs_qmesh_btn = pnw.Button(name="Plot PHDos vs Qmesh", button_type="primary") + self.compute_elastic_btn = pnw.Button(name="Compute Elastic", button_type="primary") - self.stacked_pjdos = pnw.Checkbox(label="Stacked PJDOS", value=True) - self.with_qpath = pnw.Checkbox(label="Show q-path with plotly", value=True) + self.stacked_pjdos = pnw.Checkbox(name="Stacked PJDOS", value=True) + self.with_qpath = pnw.Checkbox(name="Show q-path with plotly", value=True) def get_becs_view(self) -> pn.Row: """Returns the view for Born effective charges.""" @@ -769,10 +769,10 @@ def __init__(self, use_structure=False, **params): self.file_input = pnw.FileInput(height=60, css_classes=["pnx-file-upload-area"]) self.file_input.param.watch(self.on_file_input, "value") - self.mpid_input = pnw.TextInput(label="mp-id", placeholder="Enter e.g. mp-149 for Silicon and press ⏎") + self.mpid_input = pnw.TextInput(name="mp-id", placeholder="Enter e.g. mp-149 for Silicon and press ⏎") self.mpid_input.param.watch(self.on_mpid_input, "value") self.mpid_err_wdg = pn.pane.Markdown("") - # self.mp_progress = pn.indicators.Progress(label='Fetching data from the MP website', bar_color="warning", + # self.mp_progress = pn.indicators.Progress(name='Fetching data from the MP website', bar_color="warning", # active=False, width=200, height=10, align="center") def on_file_input(self, event) -> None: @@ -869,10 +869,10 @@ def __init__(self, **params): self.file_input = pnw.FileInput(height=60, css_classes=["pnx-file-upload-area"]) self.file_input.param.watch(self.on_file_input, "value") - self.mpid_input = pnw.TextInput(label="mp-id", placeholder="Enter e.g. mp-149 for Silicon and press ⏎") + self.mpid_input = pnw.TextInput(name="mp-id", placeholder="Enter e.g. mp-149 for Silicon and press ⏎") self.mpid_input.param.watch(self.on_mpid_input, "value") self.mpid_err_wdg = pn.pane.Markdown("") - # self.mp_progress = pn.indicators.Progress(label='Fetching data from the MP website', bar_color="warning", + # self.mp_progress = pn.indicators.Progress(name='Fetching data from the MP website', bar_color="warning", # active=False, width=200, height=10, align="center") def on_file_input(self, event) -> None: @@ -938,7 +938,7 @@ def __init__(self, **params): self.file_input.param.watch(self.on_file_input, "value") self.mp_progress = pn.indicators.Progress( - label="Fetching DDB from the MP website", + name="Fetching DDB from the MP website", bar_color="warning", active=False, width=100, @@ -995,9 +995,9 @@ def __init__(self, robot: DdbRobot, **params): PanelWithAnaddbParams.__init__(self) # Buttons - self.plot_combiplot_btn = pnw.Button(label="Compute", color="primary") + self.plot_combiplot_btn = pnw.Button(name="Compute", button_type="primary") self.combiplot_check_btn = pnw.CheckButtonGroup( - label="Check Button Group", value=["combiplot"], options=["combiplot", "gridplot"] + name="Check Button Group", value=["combiplot"], options=["combiplot", "gridplot"] ) def kwargs_for_anaget_phbst_and_phdos_files(self, **extra_kwargs) -> dict: @@ -1131,7 +1131,7 @@ def plot_combiplot(self, **kwargs) -> pn.Column: # #ca(phdos.plot_harmonic_thermo(tstart=temps[0], tstop=temps[1], num=50, **self.mpl_kwargs)) # ca(ply(phdos.plotly_harmonic_thermo(tstart=temps[0], tstop=temps[1], num=50, show=False))) # #msqd_dos.plot_tensor(**self.mpl_kwargs) - # #self.plot_phbands_btn.color = "primary" + # #self.plot_phbands_btn.button_type = "primary" # # Add HTML pane with input # ca("## Anaddb input file") @@ -1335,7 +1335,7 @@ def __init__(self, **params): top = "/Users/gmatteo/git_repos/abipy/abipy/data/refs/mgb2_phonons_nkpt_tsmear" top = "~" self.file_selector = pnw.FileSelector(top) - self.robot_files_btn = pnw.Button(label="Load files", color="primary", sizing_mode="stretch_width") + self.robot_files_btn = pnw.Button(name="Load files", button_type="primary", sizing_mode="stretch_width") self.robot_files_btn.on_click(self.on_load_files) # @depends_on_btn_click("robot_files_btn") diff --git a/abipy/panels/electrons.py b/abipy/panels/electrons.py index e58bf1cef..ec1b75d8e 100644 --- a/abipy/panels/electrons.py +++ b/abipy/panels/electrons.py @@ -38,12 +38,12 @@ def __init__(self, **params): self.main_area = pn.Column(help_md, self.get_alert_data_transfer(), sizing_mode="stretch_width") - self.replot_btn = pnw.Button(label="Replot", color="primary") + self.replot_btn = pnw.Button(name="Replot", button_type="primary") self.file_input = pnw.FileInput(height=60, css_classes=["pnx-file-upload-area"]) self.file_input.param.watch(self.on_file_input, "value") self.mp_progress = pn.indicators.Progress( - label="Fetching data from the MP website", + name="Fetching data from the MP website", bar_color="warning", active=False, width=200, diff --git a/abipy/panels/fatbands.py b/abipy/panels/fatbands.py index c7613b76b..0f074fe41 100644 --- a/abipy/panels/fatbands.py +++ b/abipy/panels/fatbands.py @@ -24,8 +24,8 @@ def __init__(self, ncfile: FatBandsFile, **params): self.ncfile = ncfile # Create buttons - self.plot_fatbands_btn = pnw.Button(label="Plot fatbands", color="primary") - self.plot_fatdos_btn = pnw.Button(label="Plot fatdos", color="primary") + self.plot_fatbands_btn = pnw.Button(name="Plot fatbands", button_type="primary") + self.plot_fatdos_btn = pnw.Button(name="Plot fatdos", button_type="primary") @depends_on_btn_click("plot_fatbands_btn") def on_plot_fatbands_btn(self) -> pn.Column: @@ -113,7 +113,7 @@ def get_panel(self, as_dict=False, **kwargs): # A Panel to interoperate with multiple GSR files. # """ # -# gsr_dataframe_btn = pnw.Button(label="Compute", color='primary') +# gsr_dataframe_btn = pnw.Button(name="Compute", button_type='primary') # # def __init__(self, robot, **params): # super().__init__(**params) diff --git a/abipy/panels/flows.py b/abipy/panels/flows.py index ed5555bba..46b43bf0a 100644 --- a/abipy/panels/flows.py +++ b/abipy/panels/flows.py @@ -31,10 +31,10 @@ def __init__(self, flow: Flow, **params): f"w{i} ({work.__class__.__name__}, len: {len(work)})": work for (i, work) in enumerate(flow.works) } options = list(self._wstr2work.keys()) - self.work_select = pnw.Select(label="Select a Work", value=options[0], options=options) + self.work_select = pnw.Select(name="Select a Work", value=options[0], options=options) options = [f"t{i} ({task.__class__.__name__}, {task.status!s})" for (i, task) in enumerate(flow[0])] - self.task_select = pnw.Select(label="Select a Task in the Work", value=options[0], options=options) + self.task_select = pnw.Select(name="Select a Task in the Work", value=options[0], options=options) super().__init__(**params) @@ -72,13 +72,13 @@ def __init__(self, flow: Flow, **params): """ NodeParameterized.__init__(self, node=flow, **params) - self.structures_btn = pnw.Button(label="Show Structures", color="primary") + self.structures_btn = pnw.Button(name="Show Structures", button_type="primary") self.structures_io_checkbox = pnw.CheckBoxGroup( - label="Input/Output Structure", value=["output"], options=["input", "output"], inline=True + name="Input/Output Structure", value=["output"], options=["input", "output"], inline=True ) self.wt_selector = WorkTaskSelector(flow) - self.task_btn = pnw.Button(label="Analyze Task", color="primary") + self.task_btn = pnw.Button(name="Analyze Task", button_type="primary") def get_task_view(self) -> pn.Column: """Return the task view panel.""" @@ -176,11 +176,11 @@ def __init__(self, flow: Flow, template, spectator_mode=True, **kwargs): self.template = template self.wt_selector = WorkTaskSelector(flow) - goto_work_btn = pnw.Button(label="Go to Work", color="primary") + goto_work_btn = pnw.Button(name="Go to Work", button_type="primary") goto_work_btn.on_click(self.on_goto_work_bnt) - goto_task_btn = pnw.Button(label="Go to Task", color="primary") + goto_task_btn = pnw.Button(name="Go to Task", button_type="primary") goto_task_btn.on_click(self.on_goto_task_bnt) - self.new_tab = pnw.Checkbox(value=True, label="Open in new Tab") + self.new_tab = pnw.Checkbox(value=True, name="Open in new Tab") self.js_panel = JsPane() self.sidebar = pn.WidgetBox( diff --git a/abipy/panels/gsr.py b/abipy/panels/gsr.py index 1150f6f3e..c51dda484 100644 --- a/abipy/panels/gsr.py +++ b/abipy/panels/gsr.py @@ -70,8 +70,8 @@ def __init__(self, robot: GsrRobot, **params): """ PanelWithEbandsRobot.__init__(self, robot=robot, **params) - self.gsr_dataframe_btn = pnw.Button(label="Compute", color="primary") - self.transpose_gsr_dataframe = pnw.Checkbox(label="Transpose GSR dataframe") + self.gsr_dataframe_btn = pnw.Button(name="Compute", button_type="primary") + self.transpose_gsr_dataframe = pnw.Checkbox(name="Transpose GSR dataframe") @depends_on_btn_click("gsr_dataframe_btn") def on_gsr_dataframe_btn(self) -> pn.Column: diff --git a/abipy/panels/hist.py b/abipy/panels/hist.py index e0d42c411..ca3c76987 100644 --- a/abipy/panels/hist.py +++ b/abipy/panels/hist.py @@ -22,12 +22,12 @@ def __init__(self, hist: HistFile, **params): self.hist = hist _what_list = ["abc", "angles", "energy", "volume", "pressure", "forces"] - self.what_list = pnw.CheckBoxGroup(label="Select", value=_what_list, options=_what_list, inline=False) - self.plot_relax_btn = pnw.Button(label="Plot relaxation", color="primary") + self.what_list = pnw.CheckBoxGroup(name="Select", value=_what_list, options=_what_list, inline=False) + self.plot_relax_btn = pnw.Button(name="Plot relaxation", button_type="primary") - self.appname = pnw.Select(label="Viewer", value="ovito", options=["ovito", "mayavi", "vtk"]) - self.to_unit_cell = pnw.Checkbox(label="To unit cell") - self.view_relax_btn = pnw.Button(label="View relaxation", color="primary") + self.appname = pnw.Select(name="Viewer", value="ovito", options=["ovito", "mayavi", "vtk"]) + self.to_unit_cell = pnw.Checkbox(name="To unit cell") + self.view_relax_btn = pnw.Button(name="View relaxation", button_type="primary") super().__init__(**params) diff --git a/abipy/panels/nodes.py b/abipy/panels/nodes.py index b0b6dce23..c730e9bd6 100644 --- a/abipy/panels/nodes.py +++ b/abipy/panels/nodes.py @@ -84,23 +84,23 @@ def __init__(self, node: Node, **params): raise ValueError(f"Don't know how to handle type: `{type(node)}`") self.engine = pnw.Select( - value="fdp", label="engine", options=["dot", "neato", "twopi", "circo", "fdp", "sfdp", "patchwork", "osage"] + value="fdp", name="engine", options=["dot", "neato", "twopi", "circo", "fdp", "sfdp", "patchwork", "osage"] ) - self.dirtree = pnw.Checkbox(label="Dirtree", value=False) - self.graphviz_btn = pnw.Button(label="Show Graph", color="primary") + self.dirtree = pnw.Checkbox(name="Dirtree", value=False) + self.graphviz_btn = pnw.Button(name="Show Graph", button_type="primary") - self.status_btn = pnw.Button(label="Show Status", color="primary") + self.status_btn = pnw.Button(name="Show Status", button_type="primary") - self.history_btn = pnw.Button(label="Show history", color="primary") - self.debug_btn = pnw.Button(label="Debug", color="primary") - self.events_btn = pnw.Button(label="Show Events", color="primary") - self.corrections_btn = pnw.Button(label="Show Corrections", color="primary") - self.handlers_btn = pnw.Button(label="Show Handlers", color="primary") + self.history_btn = pnw.Button(name="Show history", button_type="primary") + self.debug_btn = pnw.Button(name="Debug", button_type="primary") + self.events_btn = pnw.Button(name="Show Events", button_type="primary") + self.corrections_btn = pnw.Button(name="Show Corrections", button_type="primary") + self.handlers_btn = pnw.Button(name="Show Handlers", button_type="primary") self.vars_text = pnw.TextInput( - label="Abivars", placeholder="Enter list of variables separated by comma e.g. `ecut, natom`" + name="Abivars", placeholder="Enter list of variables separated by comma e.g. `ecut, natom`" ) - self.vars_btn = pnw.Button(label="Show Variables", color="primary") - # self.dims_btn = pnw.Button(label="Show Dimensions", color='primary') + self.vars_btn = pnw.Button(name="Show Variables", button_type="primary") + # self.dims_btn = pnw.Button(name="Show Dimensions", button_type='primary') self.workdir_fileselector = pnw.FileSelector(node.workdir, only_files=True) self.outdir_fileselector = pnw.FileSelector(node.outdir.path) @@ -114,7 +114,7 @@ def __init__(self, node: Node, **params): for where in ("indir", "outdir", "workdir"): directory = Directory(self.node.workdir) if where == "workdir" else getattr(self.node, where) filepaths = directory.list_filepaths() - self.filepath_select_dir[where] = FilePathSelect.from_filepaths(filepaths) # , label=f"Files in {where}") + self.filepath_select_dir[where] = FilePathSelect.from_filepaths(filepaths) # , name=f"Files in {where}") def get_status_view(self) -> pn.Column: """Return the status view panel.""" @@ -329,7 +329,7 @@ def get_files_in_dir_view(self, where): if not select: return None - btn = pnw.Button(label="Analyze", color="primary") + btn = pnw.Button(name="Analyze", button_type="primary") output_area = pn.Column(sizing_mode="stretch_width") from abipy.abilab import abiopen @@ -450,9 +450,9 @@ def __init__(self, df: pd.DataFrame, **params): # Compute this card self.cards["## Task status histogram"].collapsed = False - open_btn = pnw.Button(label="Open all cards", color="primary") + open_btn = pnw.Button(name="Open all cards", button_type="primary") open_btn.on_click(self.open_all_cards) - close_btn = pnw.Button(label="Close all cards", color="primary") + close_btn = pnw.Button(name="Close all cards", button_type="primary") close_btn.on_click(self.close_all_cards) self.layout = pn.Column(pn.Row(open_btn, close_btn), *list(self.cards.values()), sizing_mode="stretch_width") diff --git a/abipy/panels/oncvpsp_gui.py b/abipy/panels/oncvpsp_gui.py index f283fc0e3..1b586e067 100644 --- a/abipy/panels/oncvpsp_gui.py +++ b/abipy/panels/oncvpsp_gui.py @@ -580,7 +580,7 @@ def __init__(self, oncv_input, plotlyFlag, in_filepath="", **params): # self.out_runtests = pn.Column("## Basic tests:", sizing_mode="stretch_width") # Define buttons - self.execute_btn = pnw.Button(label="Execute", color="primary") + self.execute_btn = pnw.Button(name="Execute", button_type="primary") self.execute_btn.on_click(self.on_execute_btn) # This is the directory used to run oncvpsp when the user clicks execute_btn @@ -588,10 +588,10 @@ def __init__(self, oncv_input, plotlyFlag, in_filepath="", **params): # List storing all the inputs. self.input_history = [] - self.history_btn = pnw.Button(label="Compare", color="primary") + self.history_btn = pnw.Button(name="Compare", button_type="primary") # self.history_btn.on_click(self.on_history_btn) - self.rc_qcut_btn = pnw.Button(label="Execute", color="primary") + self.rc_qcut_btn = pnw.Button(name="Execute", button_type="primary") self.plotlyFlag = plotlyFlag @@ -719,7 +719,7 @@ def on_history_btn(self) -> pn.Column: def get_rc_widgets(self, oncv_input: OncvInput) -> pn.WidgetBox: """Return widgets to change the value of rc(l)""" menu_items = [(f"l = {l}", str(l)) for l in range(oncv_input.lmax + 1)] - menu_button = pnw.MenuButton(label="Change rc(l)", items=menu_items, color="primary") + menu_button = pnw.MenuButton(name="Change rc(l)", items=menu_items, button_type="primary") menu_button.on_click(self.on_change_rc) rc_l = {p.l: p.rc for p in oncv_input.lparams} help_str = f""" @@ -732,7 +732,7 @@ def get_rc_widgets(self, oncv_input: OncvInput) -> pn.WidgetBox: def get_qcut_widgets(self, oncv_input: OncvInput) -> pn.WidgetBox: """Return widgets to change the value of qc(l)""" menu_items = [(f"l = {l}", str(l)) for l in range(oncv_input.lmax + 1)] - menu_button = pnw.MenuButton(label="Change qcut(l)", items=menu_items, color="primary") + menu_button = pnw.MenuButton(name="Change qcut(l)", items=menu_items, button_type="primary") menu_button.on_click(self.on_change_qcut) qc_l = {p.l: p.qcut for p in oncv_input.lparams} help_str = f""" @@ -745,7 +745,7 @@ def get_qcut_widgets(self, oncv_input: OncvInput) -> pn.WidgetBox: def get_debl_widgets(self, oncv_input: OncvInput) -> pn.WidgetBox: """Return widgets to change the value of debl(l)""" menu_items = [(f"l = {l}", str(l)) for l in range(oncv_input.lmax + 1)] - menu_button = pnw.MenuButton(label="Change debl(l)", items=menu_items, color="primary") + menu_button = pnw.MenuButton(name="Change debl(l)", items=menu_items, button_type="primary") menu_button.on_click(self.on_change_debl) help_str = """ Here one can change the value of debl(l) with fixed nproj(l). @@ -754,7 +754,7 @@ def get_debl_widgets(self, oncv_input: OncvInput) -> pn.WidgetBox: def get_rc5_widgets(self, oncv_input: OncvInput) -> pn.WidgetBox: """Return widgets to change the value of rc5""" - btn = pnw.Button(label="Run", color="primary") + btn = pnw.Button(name="Run", button_type="primary") btn.on_click(self.on_change_rc5) help_str = f""" Here one can change the value of rc5 for vloc. @@ -765,7 +765,7 @@ def get_rc5_widgets(self, oncv_input: OncvInput) -> pn.WidgetBox: def get_dvloc0_widgets(self, oncv_input: OncvInput) -> pn.WidgetBox: """Return widgets to change the value of dvloc0""" - btn = pnw.Button(label="Run", color="primary") + btn = pnw.Button(name="Run", button_type="primary") btn.on_click(self.on_change_dvloc0) help_str = f""" Here one can change the value of dvloc0 for vloc. @@ -776,7 +776,7 @@ def get_dvloc0_widgets(self, oncv_input: OncvInput) -> pn.WidgetBox: def get_rhomodel_widgets(self, oncv_input: OncvInput) -> pn.WidgetBox: """Return widgets to change the parameters for the model core charge""" - btn = pnw.Button(label="Run", color="primary") + btn = pnw.Button(name="Run", button_type="primary") btn.on_click(self.on_change_rhomodel) help_str = f""" Here one can change the parameters for the model core charge. @@ -1128,7 +1128,7 @@ def get_rc_qcut_opt_view(self) -> pn.Row: oncv_input = self.get_oncv_input() menu_items = [(f"l = {l}", str(l)) for l in range(oncv_input.lmax + 1)] - menu_button = pnw.MenuButton(label="Change qcut(l)", items=menu_items, color="primary") + menu_button = pnw.MenuButton(name="Change qcut(l)", items=menu_items, button_type="primary") menu_button.on_click(self.on_change_rc_qcut) qc_l = {p.l: p.qcut for p in oncv_input.lparams} rc_l = {p.l: p.rc for p in oncv_input.lparams} @@ -1246,7 +1246,7 @@ def _update_out_area(self, psgen, oncv_input: OncvInput) -> None: else: _m = functools.partial(mpl, with_divider=False, dpi=self.dpi) - save_btn = pnw.Button(label="Save output", color="primary") + save_btn = pnw.Button(name="Save output", button_type="primary") save_btn.on_click(self.on_save_btn) new_rows = [ diff --git a/abipy/panels/phonons.py b/abipy/panels/phonons.py index 09831b74c..2ac57513a 100644 --- a/abipy/panels/phonons.py +++ b/abipy/panels/phonons.py @@ -20,10 +20,10 @@ def __init__(self, plotter, **params): params: Parameters passed to the parent class. """ self.phbands_plotter_mode = pnw.Select( - label="Plot Mode", value="gridplot", options=["gridplot", "combiplot", "boxplot", "combiboxplot"] + name="Plot Mode", value="gridplot", options=["gridplot", "combiplot", "boxplot", "combiboxplot"] ) # "animate", - self.phbands_plotter_units = pnw.Select(label="Units", value="eV", options=["eV", "meV", "Ha", "cm-1", "Thz"]) - self.phbands_plotter_btn = pnw.Button(label="Plot", color="primary") + self.phbands_plotter_units = pnw.Select(name="Units", value="eV", options=["eV", "meV", "Ha", "cm-1", "Thz"]) + self.phbands_plotter_btn = pnw.Button(name="Plot", button_type="primary") self.plotter = plotter super().__init__(**params) diff --git a/abipy/panels/sigeph.py b/abipy/panels/sigeph.py index 09cb74f76..6f4a56aaf 100644 --- a/abipy/panels/sigeph.py +++ b/abipy/panels/sigeph.py @@ -22,13 +22,13 @@ def __init__(self, sigeph: SigEPhFile, **params): PanelWithElectronBands.__init__(self, ebands=sigeph.ebands, **params) self.sigeph = sigeph - self.sigma_spin_select = pnw.Select(label="Spin index", options=list(range(sigeph.nsppol))) + self.sigma_spin_select = pnw.Select(name="Spin index", options=list(range(sigeph.nsppol))) self.sigma_kpoint_select = pnw.Select( - label="Kpoint in Sigma_nk", + name="Kpoint in Sigma_nk", options={"[%d]: %s" % (ik, repr(k)): ik for ik, k in enumerate(sigeph.sigma_kpoints)}, ) - self.plot_qpsolution_btn = pnw.Button(label="Plot Sigma_nk", color="primary") + self.plot_qpsolution_btn = pnw.Button(name="Plot Sigma_nk", button_type="primary") # sigma_band_select = param.ObjectSelector(default=0, objects=[0], doc="Band index in sigma_nk") def plot_lws(self) -> pn.GridSpec: diff --git a/abipy/panels/structure.py b/abipy/panels/structure.py index 8bfcf16b9..1763c35aa 100644 --- a/abipy/panels/structure.py +++ b/abipy/panels/structure.py @@ -63,35 +63,35 @@ def __init__(self, structure: Structure, with_inputs: bool = True, **params): # Convert widgets. self.output_format = pnw.Select( - label="format", value="abinit", options="abinit,cif,xsf,poscar,qe,siesta,wannier90,cssr,json".split(",") + name="format", value="abinit", options="abinit,cif,xsf,poscar,qe,siesta,wannier90,cssr,json".split(",") ) # Spglib widgets - self.spglib_symprec = pnw.Spinner(label="symprec", value=0.01, start=0.0, end=None, step=0.01) - self.spglib_angtol = pnw.Spinner(label="angtol", value=5, start=0.0, end=None, step=1) + self.spglib_symprec = pnw.Spinner(name="symprec", value=0.01, start=0.0, end=None, step=0.01) + self.spglib_angtol = pnw.Spinner(name="angtol", value=5, start=0.0, end=None, step=1) # Abisanitize widgets - self.abisanitize_btn = pnw.Button(label="Run abisanitize", color="primary") + self.abisanitize_btn = pnw.Button(name="Run abisanitize", button_type="primary") self.select_primitive = pnw.Select( - label="Select primitive", options=["primitive", "primitive_standard", "no_primitive"] + name="Select primitive", options=["primitive", "primitive_standard", "no_primitive"] ) # K-path widgets - self.kpath_format = pnw.Select(label="format", value="abinit", options=["abinit", "siesta", "wannier90"]) - self.line_density = pnw.Spinner(label="line density", value=10, step=5, start=0, end=None) - self.plot_kpath = pnw.Checkbox(label="Plot k-path", value=False) + self.kpath_format = pnw.Select(name="format", value="abinit", options=["abinit", "siesta", "wannier90"]) + self.line_density = pnw.Spinner(name="line density", value=10, step=5, start=0, end=None) + self.plot_kpath = pnw.Checkbox(name="Plot k-path", value=False) # MP-match - self.mp_match_btn = pnw.Button(label="Connect to Materials Project", color="primary") + self.mp_match_btn = pnw.Button(name="Connect to Materials Project", button_type="primary") # MP-search - # mp_search_btn = pnw.Button(label="Connect to Materials Project", color='primary') + # mp_search_btn = pnw.Button(name="Connect to Materials Project", button_type='primary') # mp_api_key # Widgets to control the generation of input files. - self.kppra = pnw.Spinner(label="kppra", value=1000, step=500, start=0, end=None) - self.smearing_type = pnw.Select(label="Smearing type", value=None, options=[None, "gaussian", "fermi_dirac"]) - self.tsmear = pnw.Spinner(label="tsmear (Ha)", value=0.01, step=0.002, start=0.0, end=None) + self.kppra = pnw.Spinner(name="kppra", value=1000, step=500, start=0, end=None) + self.smearing_type = pnw.Select(name="Smearing type", value=None, options=[None, "gaussian", "fermi_dirac"]) + self.tsmear = pnw.Spinner(name="tsmear (Ha)", value=0.01, step=0.002, start=0.0, end=None) # TODO: nspinor 2 should trigger a check on the table. from abipy.flowtk.psrepos import get_installed_repos_and_root @@ -100,22 +100,22 @@ def __init__(self, structure: Structure, with_inputs: bool = True, **params): options = [repo.name for repo in installed_repos] default_repo = "ONCVPSP-PBE-SR-PDv0.4" default_repo = None if default_repo not in options else default_repo - self.repos_name = pnw.Select(label="PP repos", value=default_repo, options=options) - self.table_name = pnw.Select(label="Table name", value="standard", options=["standard", "stringent"]) + self.repos_name = pnw.Select(name="PP repos", value=default_repo, options=options) + self.table_name = pnw.Select(name="Table name", value="standard", options=["standard", "stringent"]) # widgets for GS input generator - self.gs_type = pnw.Select(label="GS type", value="scf", options=["scf", "relax"]) - self.gs_input_btn = pnw.Button(label="Generate input", color="primary") + self.gs_type = pnw.Select(name="GS type", value="scf", options=["scf", "relax"]) + self.gs_input_btn = pnw.Button(name="Generate input", button_type="primary") # widgets for e-bands input generator. - self.ebands_input_btn = pnw.Button(label="Generate input", color="primary") - self.edos_kppra = pnw.Spinner(label="edos_kppra", value=0, step=500, start=0, end=None) + self.ebands_input_btn = pnw.Button(name="Generate input", button_type="primary") + self.edos_kppra = pnw.Spinner(name="edos_kppra", value=0, step=500, start=0, end=None) # widgets for DFPT phonons input generator. - self.ph_input_btn = pnw.Button(label="Generate input", color="primary") - self.with_becs = pnw.Checkbox(label="BECS and epsilon_inf (semiconductors)", value=False) - # self.dfpt_ngqpt = pnw.LiteralInput(label='ngqpt (python list)', value=[None, None, None], type=list) - # self.dfpt_ngqpt = pnw.LiteralInput(label='ngqpt (python list)', value=[None, None, None], type=list) + self.ph_input_btn = pnw.Button(name="Generate input", button_type="primary") + self.with_becs = pnw.Checkbox(name="BECS and epsilon_inf (semiconductors)", value=False) + # self.dfpt_ngqpt = pnw.LiteralInput(name='ngqpt (python list)', value=[None, None, None], type=list) + # self.dfpt_ngqpt = pnw.LiteralInput(name='ngqpt (python list)', value=[None, None, None], type=list) self.label2mode = { "unpolarized": "unpolarized", @@ -125,7 +125,7 @@ def __init__(self, structure: Structure, with_inputs: bool = True, **params): "collinear anti-ferromagnetic": "afm", } - self.spin_mode = pnw.Select(label="SpinMode", value="unpolarized", options=list(self.label2mode.keys())) + self.spin_mode = pnw.Select(name="SpinMode", value="unpolarized", options=list(self.label2mode.keys())) @pn.depends("output_format.value") def convert(self): @@ -631,8 +631,8 @@ def __init__(self, **params): super().__init__(**params) # Spglib widgets - # self.spglib_symprec = pnw.Spinner(label="symprec", value=0.01, start=0.0, end=None, step=0.01) - # self.spglib_angtol = pnw.Spinner(label="angtol", value=5, start=0.0, end=None, step=1) + # self.spglib_symprec = pnw.Spinner(name="symprec", value=0.01, start=0.0, end=None, step=0.01) + # self.spglib_angtol = pnw.Spinner(name="angtol", value=5, start=0.0, end=None, step=1) help_md = pn.pane.Markdown(f""" ## Description @@ -645,7 +645,7 @@ def __init__(self, **params): self.file_input = pnw.FileInput(height=60, css_classes=["pnx-file-upload-area"]) self.file_input.param.watch(self.on_file_input, "value") - self.mpid_input = pnw.TextInput(label="mp-id", placeholder="Enter e.g. mp-149 for Silicon and press ⏎") + self.mpid_input = pnw.TextInput(name="mp-id", placeholder="Enter e.g. mp-149 for Silicon and press ⏎") self.mpid_input.param.watch(self.on_mpid_input, "value") self.mpid_err_wdg = pn.pane.Markdown("") diff --git a/abipy/panels/tasks.py b/abipy/panels/tasks.py index ab090988e..1d7b692fc 100644 --- a/abipy/panels/tasks.py +++ b/abipy/panels/tasks.py @@ -25,9 +25,9 @@ def __init__(self, task: AbinitTask, **params): NodeParameterized.__init__(self, node=task, **params) self.task = task - # self.structures_btn = pnw.Button(label="Show Structures", color='primary') + # self.structures_btn = pnw.Button(name="Show Structures", button_type='primary') # self.structures_io_checkbox = pnw.CheckBoxGroup( - # label='Input/Output Structure', value=['output'], options=['input', 'output'], inline=Tru + # name='Input/Output Structure', value=['output'], options=['input', 'output'], inline=Tru def get_inputs_view(self): """Show the input files of the task: input file, submission script and TaskManager.""" diff --git a/abipy/panels/viewers.py b/abipy/panels/viewers.py index 181f921ae..62517cd62 100644 --- a/abipy/panels/viewers.py +++ b/abipy/panels/viewers.py @@ -26,7 +26,7 @@ def __init__(self, filepath: str, theme="terminal", height=1200, **params): super().__init__(**params) basename = os.path.basename(filepath) - self.open_btn = pnw.Button(label=f"Open {basename}", color="primary") + self.open_btn = pnw.Button(name=f"Open {basename}", button_type="primary") self.open_btn.on_click(self.open_ace_editor) self.ace = pnw.CodeEditor( @@ -49,7 +49,7 @@ def open_ace_editor(self, event) -> None: """Callback to open and read the file into the ACE editor.""" self.ace.visible = True self.ace.value = open(self.filepath).read() - self.open_btn.label = "Reopen %s" % os.path.basename(self.filepath) + self.open_btn.name = "Reopen %s" % os.path.basename(self.filepath) def __panel__(self): return self.layout diff --git a/pyproject.toml b/pyproject.toml index 95bd155d1..68dc12e8a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -97,6 +97,7 @@ tests = [ "pytest", "pytest-cov", "pytest-sugar", + "pytest-timeout", "pytest-xdist", "python-coveralls", "scripttest", From 4339404d54c5ba8ef94809aa0ce24bcc7e81e45c Mon Sep 17 00:00:00 2001 From: Matteo Giantomassi Date: Tue, 29 Sep 2026 17:03:10 +0200 Subject: [PATCH 17/23] Revert panel widget label=/color= rename: panel.widgets uses name=/button_type= --- abipy/panels/a2f.py | 2 +- abipy/panels/core.py | 54 ++++++++++++++++++------------------- abipy/panels/ddb.py | 48 ++++++++++++++++----------------- abipy/panels/electrons.py | 4 +-- abipy/panels/fatbands.py | 6 ++--- abipy/panels/flows.py | 16 +++++------ abipy/panels/gsr.py | 4 +-- abipy/panels/hist.py | 10 +++---- abipy/panels/nodes.py | 32 +++++++++++----------- abipy/panels/oncvpsp_gui.py | 22 +++++++-------- abipy/panels/phonons.py | 6 ++--- abipy/panels/sigeph.py | 6 ++--- abipy/panels/structure.py | 54 ++++++++++++++++++------------------- abipy/panels/tasks.py | 4 +-- abipy/panels/viewers.py | 4 +-- 15 files changed, 136 insertions(+), 136 deletions(-) diff --git a/abipy/panels/a2f.py b/abipy/panels/a2f.py index a4adc9c6f..3f4679fda 100644 --- a/abipy/panels/a2f.py +++ b/abipy/panels/a2f.py @@ -21,7 +21,7 @@ def __init__(self, ncfile, **params): PanelWithElectronBands.__init__(self, ebands=ncfile.ebands, **params) self.ncfile = ncfile - self.a2f_view_btn = pnw.Button(label="Plot a2F", color="primary") + self.a2f_view_btn = pnw.Button(name="Plot a2F", button_type="primary") def get_a2f_view(self) -> pn.Row: """Return Row with widgets to visualize the structure.""" diff --git a/abipy/panels/core.py b/abipy/panels/core.py index cfc959916..e06927d0e 100644 --- a/abipy/panels/core.py +++ b/abipy/panels/core.py @@ -384,7 +384,7 @@ def ply( If everything is properly configured, a new window is automatically created in your browser. """) - btn = pnw.Button(label="Upload figure to chart studio server") + btn = pnw.Button(name="Upload figure to chart studio server") def push_to_cs(event): with ButtonContext(btn): @@ -507,7 +507,7 @@ def to_json(): # return file_download.callback() # FIXME: Menu button occupies less space but the upload does not work - # menu_btn = pnw.MenuButton(label='Export table', items=list(d.keys())) + # menu_btn = pnw.MenuButton(name='Export table', items=list(d.keys())) # menu_btn.on_click(download) # ca(menu_btn) @@ -591,12 +591,12 @@ def __init__(self, btn: pnw.Button): btn: The button to wrap with context. """ self.btn = btn - self.prev_name, self.prev_type = btn.label, btn.color + self.prev_name, self.prev_type = btn.name, btn.button_type def __enter__(self): # Disable the button. - self.btn.label = "Running ..." - self.btn.color = "warning" + self.btn.name = "Running ..." + self.btn.button_type = "warning" self.btn.loading = True self.btn.disabled = True return self.btn @@ -608,12 +608,12 @@ def __exit__(self, exc_type, exc_value, traceback): if exc_type: # Exception --> signal to the user that something went wrong for 2 seconds. - self.btn.label = str(exc_type) - self.btn.color = "danger" + self.btn.name = str(exc_type) + self.btn.button_type = "danger" time.sleep(2) # Back to the original button state. - self.btn.label, self.btn.color = self.prev_name, self.prev_type + self.btn.name, self.btn.button_type = self.prev_name, self.prev_type class Loading: @@ -823,7 +823,7 @@ def wdg_exts_with_get_panel(self, name="File extensions supported:"): from abipy.abilab import extcls_supporting_panel exts = [e[0] for e in extcls_supporting_panel(as_table=False)] - return pnw.Select(label=name, options=exts) + return pnw.Select(name=name, options=exts) @staticmethod def html_with_clipboard_btn(html_str: str, **kwargs): @@ -1069,7 +1069,7 @@ def __init__(self, structure: Structure, **params): # Change the list of allowed visualizers. self.param.structure_viewer.objects = ["jsmol", "crystalk", "ngl", "matplotlib", "plotly", "ase_atoms"] - self.view_structure_btn = pnw.Button(label="View structure", color="primary") + self.view_structure_btn = pnw.Button(name="View structure", button_type="primary") @depends_on_btn_click("view_structure_btn", show_shared_wdg_warning=False) def on_view_structure(self): @@ -1224,7 +1224,7 @@ def __init__(self, ncfile, **params): """ super().__init__(**params) self.ncfile = ncfile - self.netcdf_info_btn = pnw.Button(label="Show info", color="primary") + self.netcdf_info_btn = pnw.Button(name="Show info", button_type="primary") def get_ncfile_view(self) -> pn.Column: """Return a view with netcdf file information.""" @@ -1241,7 +1241,7 @@ def on_netcdf_info_btn(self) -> pn.Column: col = pn.Column(sizing_mode="stretch_width") ca = col.append - # nc_grpname = pnw.Select(label="nc group name", options=["/"]) + # nc_grpname = pnw.Select(name="nc group name", options=["/"]) input_string = self.ncfile.get_input_string() ca("## Input String") ca(bkw.PreText(text=input_string)) @@ -1337,26 +1337,26 @@ def __init__(self, ebands, **params): PanelWithStructure.__init__(self, structure=ebands.structure, **params) # Create buttons - self.plot_ebands_btn = pnw.Button(label="Plot e-bands", color="primary") - self.plot_edos_btn = pnw.Button(label="Plot e-DOS", color="primary") - self.plot_skw_btn = pnw.Button(label="Plot SKW interpolant", color="primary") + self.plot_ebands_btn = pnw.Button(name="Plot e-bands", button_type="primary") + self.plot_edos_btn = pnw.Button(name="Plot e-DOS", button_type="primary") + self.plot_skw_btn = pnw.Button(name="Plot SKW interpolant", button_type="primary") # Fermi surface plotter. # objects = [None, "matplotlib", "xcrysden"] # if self.has_remote_server: objects = [None, "matplotlib"] - # self.plot_fs_viewer_btn = pnw.Button(label="Plot SKW interpolant", color='primary') + # self.plot_fs_viewer_btn = pnw.Button(name="Plot SKW interpolant", button_type='primary') - self.plot_ifermi_btn = pnw.Button(label="Plot Fermi surface", color="primary") - # self.ifermi_plane_normal = pnw.LiteralInput(label='Plane normal (list)', value=[0, 0, 0], type=list, + self.plot_ifermi_btn = pnw.Button(name="Plot Fermi surface", button_type="primary") + # self.ifermi_plane_normal = pnw.LiteralInput(name='Plane normal (list)', value=[0, 0, 0], type=list, # placeholder="Enter normal in reduced coordinates") # self.ifermi_distance = pn.widgets.RangeSlider( - # label='distance', start=0, end=2 * max(ebands.structure.reciprocal_lattice.abc), + # name='distance', start=0, end=2 * max(ebands.structure.reciprocal_lattice.abc), # value=(0, 0), step=0.01) # ebands_kpath_fileinput = pnw.FileInput(accept=".nc") # ebands_kmesh_fileinput = pnw.FileInput(accept=".nc") - self.plot_effmass_btn = pnw.Button(label="Plot effective masses", color="primary") + self.plot_effmass_btn = pnw.Button(name="Plot effective masses", button_type="primary") if ebands.nsppol != 2: self.param.effmass_spin.objects = [0] @@ -1696,8 +1696,8 @@ def __init__(self, robot, **params): params: Parameters passed to the parent class. """ self.robot = robot - self.compare_params_btn = pnw.Button(label="Compare structures", color="primary") - self.transpose_params = pnw.Checkbox(label="Transpose table", value=True) + self.compare_params_btn = pnw.Button(name="Compare structures", button_type="primary") + self.transpose_params = pnw.Checkbox(name="Transpose table", value=True) super().__init__(**params) @@ -1744,14 +1744,14 @@ def __init__(self, robot, **params): # Widgets to plot ebands. self.ebands_plotter_mode = pnw.Select( - label="Plot Mode", value="gridplot", options=["gridplot", "combiplot", "boxplot", "combiboxplot"] + name="Plot Mode", value="gridplot", options=["gridplot", "combiplot", "boxplot", "combiboxplot"] ) # "animate", - self.ebands_plotter_btn = pnw.Button(label="Plot", color="primary") - self.ebands_df_checkbox = pnw.Checkbox(label="With Ebands DataFrame", value=False) + self.ebands_plotter_btn = pnw.Button(name="Plot", button_type="primary") + self.ebands_df_checkbox = pnw.Checkbox(name="With Ebands DataFrame", value=False) # Widgets to plot edos. - self.edos_plotter_mode = pnw.Select(label="Plot Mode", value="gridplot", options=["gridplot", "combiplot"]) - self.edos_plotter_btn = pnw.Button(label="Plot", color="primary") + self.edos_plotter_mode = pnw.Select(name="Plot Mode", value="gridplot", options=["gridplot", "combiplot"]) + self.edos_plotter_btn = pnw.Button(name="Plot", button_type="primary") def get_ebands_plotter_widgets(self) -> pn.Column: """Return a Column with widgets to plot electronic bands.""" diff --git a/abipy/panels/ddb.py b/abipy/panels/ddb.py index 01c768121..c1f93d901 100644 --- a/abipy/panels/ddb.py +++ b/abipy/panels/ddb.py @@ -102,18 +102,18 @@ def __init__(self, **params): """ super().__init__(**params) # FIXME - self.nqsmall_list = pnw.LiteralInput(label="nqmall_list (python syntax)", value=[10, 20, 30], type=list) - # nqqpt = pnw.LiteralInput(label='nsmalls (list)', value=[10, 20, 30], type=list) + self.nqsmall_list = pnw.LiteralInput(name="nqmall_list (python syntax)", value=[10, 20, 30], type=list) + # nqqpt = pnw.LiteralInput(name='nsmalls (list)', value=[10, 20, 30], type=list) self.eps0_wrange = pnw.EditableRangeSlider( - label="Frequency range (eV)", value=(0.0, 0.1), start=0.0, end=1.0, step=0.01 + name="Frequency range (eV)", value=(0.0, 0.1), start=0.0, end=1.0, step=0.01 ) - self.temp_range = pnw.EditableRangeSlider(label="T-range in K", value=(100.0, 400), start=0, end=1000, step=50) + self.temp_range = pnw.EditableRangeSlider(name="T-range in K", value=(100.0, 400), start=0, end=1000, step=50) # Base buttons self.plot_without_asr_dipdip_btn = pnw.Button( - label="Compute phonons with/wo ASR and DIPDIP", color="primary" + name="Compute phonons with/wo ASR and DIPDIP", button_type="primary" ) # if self.has_remote_serve: @@ -168,18 +168,18 @@ def __init__(self, ddb: DdbFile, **params): self.ddb = ddb # Add buttons - self.get_epsinf_btn = pnw.Button(label="Compute", color="primary") - self.plot_phbands_btn = pnw.Button(label="Plot Bands and DOS", color="primary") - self.plot_eps0w_btn = pnw.Button(label="Plot eps0(omega)", color="primary") + self.get_epsinf_btn = pnw.Button(name="Compute", button_type="primary") + self.plot_phbands_btn = pnw.Button(name="Plot Bands and DOS", button_type="primary") + self.plot_eps0w_btn = pnw.Button(name="Plot eps0(omega)", button_type="primary") - self.plot_vsound_btn = pnw.Button(label="Calculate speed of sound", color="primary") - self.plot_ifc_btn = pnw.Button(label="Compute IFC(R)", color="primary") - self.plot_phbands_quad_btn = pnw.Button(label="Plot PHbands with/without quadrupoles", color="primary") - self.plot_dos_vs_qmesh_btn = pnw.Button(label="Plot PHDos vs Qmesh", color="primary") - self.compute_elastic_btn = pnw.Button(label="Compute Elastic", color="primary") + self.plot_vsound_btn = pnw.Button(name="Calculate speed of sound", button_type="primary") + self.plot_ifc_btn = pnw.Button(name="Compute IFC(R)", button_type="primary") + self.plot_phbands_quad_btn = pnw.Button(name="Plot PHbands with/without quadrupoles", button_type="primary") + self.plot_dos_vs_qmesh_btn = pnw.Button(name="Plot PHDos vs Qmesh", button_type="primary") + self.compute_elastic_btn = pnw.Button(name="Compute Elastic", button_type="primary") - self.stacked_pjdos = pnw.Checkbox(label="Stacked PJDOS", value=True) - self.with_qpath = pnw.Checkbox(label="Show q-path with plotly", value=True) + self.stacked_pjdos = pnw.Checkbox(name="Stacked PJDOS", value=True) + self.with_qpath = pnw.Checkbox(name="Show q-path with plotly", value=True) def get_becs_view(self) -> pn.Row: """Returns the view for Born effective charges.""" @@ -769,10 +769,10 @@ def __init__(self, use_structure=False, **params): self.file_input = pnw.FileInput(height=60, css_classes=["pnx-file-upload-area"]) self.file_input.param.watch(self.on_file_input, "value") - self.mpid_input = pnw.TextInput(label="mp-id", placeholder="Enter e.g. mp-149 for Silicon and press ⏎") + self.mpid_input = pnw.TextInput(name="mp-id", placeholder="Enter e.g. mp-149 for Silicon and press ⏎") self.mpid_input.param.watch(self.on_mpid_input, "value") self.mpid_err_wdg = pn.pane.Markdown("") - # self.mp_progress = pn.indicators.Progress(label='Fetching data from the MP website', bar_color="warning", + # self.mp_progress = pn.indicators.Progress(name='Fetching data from the MP website', bar_color="warning", # active=False, width=200, height=10, align="center") def on_file_input(self, event) -> None: @@ -869,10 +869,10 @@ def __init__(self, **params): self.file_input = pnw.FileInput(height=60, css_classes=["pnx-file-upload-area"]) self.file_input.param.watch(self.on_file_input, "value") - self.mpid_input = pnw.TextInput(label="mp-id", placeholder="Enter e.g. mp-149 for Silicon and press ⏎") + self.mpid_input = pnw.TextInput(name="mp-id", placeholder="Enter e.g. mp-149 for Silicon and press ⏎") self.mpid_input.param.watch(self.on_mpid_input, "value") self.mpid_err_wdg = pn.pane.Markdown("") - # self.mp_progress = pn.indicators.Progress(label='Fetching data from the MP website', bar_color="warning", + # self.mp_progress = pn.indicators.Progress(name='Fetching data from the MP website', bar_color="warning", # active=False, width=200, height=10, align="center") def on_file_input(self, event) -> None: @@ -938,7 +938,7 @@ def __init__(self, **params): self.file_input.param.watch(self.on_file_input, "value") self.mp_progress = pn.indicators.Progress( - label="Fetching DDB from the MP website", + name="Fetching DDB from the MP website", bar_color="warning", active=False, width=100, @@ -995,9 +995,9 @@ def __init__(self, robot: DdbRobot, **params): PanelWithAnaddbParams.__init__(self) # Buttons - self.plot_combiplot_btn = pnw.Button(label="Compute", color="primary") + self.plot_combiplot_btn = pnw.Button(name="Compute", button_type="primary") self.combiplot_check_btn = pnw.CheckButtonGroup( - label="Check Button Group", value=["combiplot"], options=["combiplot", "gridplot"] + name="Check Button Group", value=["combiplot"], options=["combiplot", "gridplot"] ) def kwargs_for_anaget_phbst_and_phdos_files(self, **extra_kwargs) -> dict: @@ -1131,7 +1131,7 @@ def plot_combiplot(self, **kwargs) -> pn.Column: # #ca(phdos.plot_harmonic_thermo(tstart=temps[0], tstop=temps[1], num=50, **self.mpl_kwargs)) # ca(ply(phdos.plotly_harmonic_thermo(tstart=temps[0], tstop=temps[1], num=50, show=False))) # #msqd_dos.plot_tensor(**self.mpl_kwargs) - # #self.plot_phbands_btn.color = "primary" + # #self.plot_phbands_btn.button_type = "primary" # # Add HTML pane with input # ca("## Anaddb input file") @@ -1335,7 +1335,7 @@ def __init__(self, **params): top = "/Users/gmatteo/git_repos/abipy/abipy/data/refs/mgb2_phonons_nkpt_tsmear" top = "~" self.file_selector = pnw.FileSelector(top) - self.robot_files_btn = pnw.Button(label="Load files", color="primary", sizing_mode="stretch_width") + self.robot_files_btn = pnw.Button(name="Load files", button_type="primary", sizing_mode="stretch_width") self.robot_files_btn.on_click(self.on_load_files) # @depends_on_btn_click("robot_files_btn") diff --git a/abipy/panels/electrons.py b/abipy/panels/electrons.py index e58bf1cef..ec1b75d8e 100644 --- a/abipy/panels/electrons.py +++ b/abipy/panels/electrons.py @@ -38,12 +38,12 @@ def __init__(self, **params): self.main_area = pn.Column(help_md, self.get_alert_data_transfer(), sizing_mode="stretch_width") - self.replot_btn = pnw.Button(label="Replot", color="primary") + self.replot_btn = pnw.Button(name="Replot", button_type="primary") self.file_input = pnw.FileInput(height=60, css_classes=["pnx-file-upload-area"]) self.file_input.param.watch(self.on_file_input, "value") self.mp_progress = pn.indicators.Progress( - label="Fetching data from the MP website", + name="Fetching data from the MP website", bar_color="warning", active=False, width=200, diff --git a/abipy/panels/fatbands.py b/abipy/panels/fatbands.py index c7613b76b..0f074fe41 100644 --- a/abipy/panels/fatbands.py +++ b/abipy/panels/fatbands.py @@ -24,8 +24,8 @@ def __init__(self, ncfile: FatBandsFile, **params): self.ncfile = ncfile # Create buttons - self.plot_fatbands_btn = pnw.Button(label="Plot fatbands", color="primary") - self.plot_fatdos_btn = pnw.Button(label="Plot fatdos", color="primary") + self.plot_fatbands_btn = pnw.Button(name="Plot fatbands", button_type="primary") + self.plot_fatdos_btn = pnw.Button(name="Plot fatdos", button_type="primary") @depends_on_btn_click("plot_fatbands_btn") def on_plot_fatbands_btn(self) -> pn.Column: @@ -113,7 +113,7 @@ def get_panel(self, as_dict=False, **kwargs): # A Panel to interoperate with multiple GSR files. # """ # -# gsr_dataframe_btn = pnw.Button(label="Compute", color='primary') +# gsr_dataframe_btn = pnw.Button(name="Compute", button_type='primary') # # def __init__(self, robot, **params): # super().__init__(**params) diff --git a/abipy/panels/flows.py b/abipy/panels/flows.py index ed5555bba..46b43bf0a 100644 --- a/abipy/panels/flows.py +++ b/abipy/panels/flows.py @@ -31,10 +31,10 @@ def __init__(self, flow: Flow, **params): f"w{i} ({work.__class__.__name__}, len: {len(work)})": work for (i, work) in enumerate(flow.works) } options = list(self._wstr2work.keys()) - self.work_select = pnw.Select(label="Select a Work", value=options[0], options=options) + self.work_select = pnw.Select(name="Select a Work", value=options[0], options=options) options = [f"t{i} ({task.__class__.__name__}, {task.status!s})" for (i, task) in enumerate(flow[0])] - self.task_select = pnw.Select(label="Select a Task in the Work", value=options[0], options=options) + self.task_select = pnw.Select(name="Select a Task in the Work", value=options[0], options=options) super().__init__(**params) @@ -72,13 +72,13 @@ def __init__(self, flow: Flow, **params): """ NodeParameterized.__init__(self, node=flow, **params) - self.structures_btn = pnw.Button(label="Show Structures", color="primary") + self.structures_btn = pnw.Button(name="Show Structures", button_type="primary") self.structures_io_checkbox = pnw.CheckBoxGroup( - label="Input/Output Structure", value=["output"], options=["input", "output"], inline=True + name="Input/Output Structure", value=["output"], options=["input", "output"], inline=True ) self.wt_selector = WorkTaskSelector(flow) - self.task_btn = pnw.Button(label="Analyze Task", color="primary") + self.task_btn = pnw.Button(name="Analyze Task", button_type="primary") def get_task_view(self) -> pn.Column: """Return the task view panel.""" @@ -176,11 +176,11 @@ def __init__(self, flow: Flow, template, spectator_mode=True, **kwargs): self.template = template self.wt_selector = WorkTaskSelector(flow) - goto_work_btn = pnw.Button(label="Go to Work", color="primary") + goto_work_btn = pnw.Button(name="Go to Work", button_type="primary") goto_work_btn.on_click(self.on_goto_work_bnt) - goto_task_btn = pnw.Button(label="Go to Task", color="primary") + goto_task_btn = pnw.Button(name="Go to Task", button_type="primary") goto_task_btn.on_click(self.on_goto_task_bnt) - self.new_tab = pnw.Checkbox(value=True, label="Open in new Tab") + self.new_tab = pnw.Checkbox(value=True, name="Open in new Tab") self.js_panel = JsPane() self.sidebar = pn.WidgetBox( diff --git a/abipy/panels/gsr.py b/abipy/panels/gsr.py index 1150f6f3e..c51dda484 100644 --- a/abipy/panels/gsr.py +++ b/abipy/panels/gsr.py @@ -70,8 +70,8 @@ def __init__(self, robot: GsrRobot, **params): """ PanelWithEbandsRobot.__init__(self, robot=robot, **params) - self.gsr_dataframe_btn = pnw.Button(label="Compute", color="primary") - self.transpose_gsr_dataframe = pnw.Checkbox(label="Transpose GSR dataframe") + self.gsr_dataframe_btn = pnw.Button(name="Compute", button_type="primary") + self.transpose_gsr_dataframe = pnw.Checkbox(name="Transpose GSR dataframe") @depends_on_btn_click("gsr_dataframe_btn") def on_gsr_dataframe_btn(self) -> pn.Column: diff --git a/abipy/panels/hist.py b/abipy/panels/hist.py index e0d42c411..ca3c76987 100644 --- a/abipy/panels/hist.py +++ b/abipy/panels/hist.py @@ -22,12 +22,12 @@ def __init__(self, hist: HistFile, **params): self.hist = hist _what_list = ["abc", "angles", "energy", "volume", "pressure", "forces"] - self.what_list = pnw.CheckBoxGroup(label="Select", value=_what_list, options=_what_list, inline=False) - self.plot_relax_btn = pnw.Button(label="Plot relaxation", color="primary") + self.what_list = pnw.CheckBoxGroup(name="Select", value=_what_list, options=_what_list, inline=False) + self.plot_relax_btn = pnw.Button(name="Plot relaxation", button_type="primary") - self.appname = pnw.Select(label="Viewer", value="ovito", options=["ovito", "mayavi", "vtk"]) - self.to_unit_cell = pnw.Checkbox(label="To unit cell") - self.view_relax_btn = pnw.Button(label="View relaxation", color="primary") + self.appname = pnw.Select(name="Viewer", value="ovito", options=["ovito", "mayavi", "vtk"]) + self.to_unit_cell = pnw.Checkbox(name="To unit cell") + self.view_relax_btn = pnw.Button(name="View relaxation", button_type="primary") super().__init__(**params) diff --git a/abipy/panels/nodes.py b/abipy/panels/nodes.py index b0b6dce23..c730e9bd6 100644 --- a/abipy/panels/nodes.py +++ b/abipy/panels/nodes.py @@ -84,23 +84,23 @@ def __init__(self, node: Node, **params): raise ValueError(f"Don't know how to handle type: `{type(node)}`") self.engine = pnw.Select( - value="fdp", label="engine", options=["dot", "neato", "twopi", "circo", "fdp", "sfdp", "patchwork", "osage"] + value="fdp", name="engine", options=["dot", "neato", "twopi", "circo", "fdp", "sfdp", "patchwork", "osage"] ) - self.dirtree = pnw.Checkbox(label="Dirtree", value=False) - self.graphviz_btn = pnw.Button(label="Show Graph", color="primary") + self.dirtree = pnw.Checkbox(name="Dirtree", value=False) + self.graphviz_btn = pnw.Button(name="Show Graph", button_type="primary") - self.status_btn = pnw.Button(label="Show Status", color="primary") + self.status_btn = pnw.Button(name="Show Status", button_type="primary") - self.history_btn = pnw.Button(label="Show history", color="primary") - self.debug_btn = pnw.Button(label="Debug", color="primary") - self.events_btn = pnw.Button(label="Show Events", color="primary") - self.corrections_btn = pnw.Button(label="Show Corrections", color="primary") - self.handlers_btn = pnw.Button(label="Show Handlers", color="primary") + self.history_btn = pnw.Button(name="Show history", button_type="primary") + self.debug_btn = pnw.Button(name="Debug", button_type="primary") + self.events_btn = pnw.Button(name="Show Events", button_type="primary") + self.corrections_btn = pnw.Button(name="Show Corrections", button_type="primary") + self.handlers_btn = pnw.Button(name="Show Handlers", button_type="primary") self.vars_text = pnw.TextInput( - label="Abivars", placeholder="Enter list of variables separated by comma e.g. `ecut, natom`" + name="Abivars", placeholder="Enter list of variables separated by comma e.g. `ecut, natom`" ) - self.vars_btn = pnw.Button(label="Show Variables", color="primary") - # self.dims_btn = pnw.Button(label="Show Dimensions", color='primary') + self.vars_btn = pnw.Button(name="Show Variables", button_type="primary") + # self.dims_btn = pnw.Button(name="Show Dimensions", button_type='primary') self.workdir_fileselector = pnw.FileSelector(node.workdir, only_files=True) self.outdir_fileselector = pnw.FileSelector(node.outdir.path) @@ -114,7 +114,7 @@ def __init__(self, node: Node, **params): for where in ("indir", "outdir", "workdir"): directory = Directory(self.node.workdir) if where == "workdir" else getattr(self.node, where) filepaths = directory.list_filepaths() - self.filepath_select_dir[where] = FilePathSelect.from_filepaths(filepaths) # , label=f"Files in {where}") + self.filepath_select_dir[where] = FilePathSelect.from_filepaths(filepaths) # , name=f"Files in {where}") def get_status_view(self) -> pn.Column: """Return the status view panel.""" @@ -329,7 +329,7 @@ def get_files_in_dir_view(self, where): if not select: return None - btn = pnw.Button(label="Analyze", color="primary") + btn = pnw.Button(name="Analyze", button_type="primary") output_area = pn.Column(sizing_mode="stretch_width") from abipy.abilab import abiopen @@ -450,9 +450,9 @@ def __init__(self, df: pd.DataFrame, **params): # Compute this card self.cards["## Task status histogram"].collapsed = False - open_btn = pnw.Button(label="Open all cards", color="primary") + open_btn = pnw.Button(name="Open all cards", button_type="primary") open_btn.on_click(self.open_all_cards) - close_btn = pnw.Button(label="Close all cards", color="primary") + close_btn = pnw.Button(name="Close all cards", button_type="primary") close_btn.on_click(self.close_all_cards) self.layout = pn.Column(pn.Row(open_btn, close_btn), *list(self.cards.values()), sizing_mode="stretch_width") diff --git a/abipy/panels/oncvpsp_gui.py b/abipy/panels/oncvpsp_gui.py index f283fc0e3..1b586e067 100644 --- a/abipy/panels/oncvpsp_gui.py +++ b/abipy/panels/oncvpsp_gui.py @@ -580,7 +580,7 @@ def __init__(self, oncv_input, plotlyFlag, in_filepath="", **params): # self.out_runtests = pn.Column("## Basic tests:", sizing_mode="stretch_width") # Define buttons - self.execute_btn = pnw.Button(label="Execute", color="primary") + self.execute_btn = pnw.Button(name="Execute", button_type="primary") self.execute_btn.on_click(self.on_execute_btn) # This is the directory used to run oncvpsp when the user clicks execute_btn @@ -588,10 +588,10 @@ def __init__(self, oncv_input, plotlyFlag, in_filepath="", **params): # List storing all the inputs. self.input_history = [] - self.history_btn = pnw.Button(label="Compare", color="primary") + self.history_btn = pnw.Button(name="Compare", button_type="primary") # self.history_btn.on_click(self.on_history_btn) - self.rc_qcut_btn = pnw.Button(label="Execute", color="primary") + self.rc_qcut_btn = pnw.Button(name="Execute", button_type="primary") self.plotlyFlag = plotlyFlag @@ -719,7 +719,7 @@ def on_history_btn(self) -> pn.Column: def get_rc_widgets(self, oncv_input: OncvInput) -> pn.WidgetBox: """Return widgets to change the value of rc(l)""" menu_items = [(f"l = {l}", str(l)) for l in range(oncv_input.lmax + 1)] - menu_button = pnw.MenuButton(label="Change rc(l)", items=menu_items, color="primary") + menu_button = pnw.MenuButton(name="Change rc(l)", items=menu_items, button_type="primary") menu_button.on_click(self.on_change_rc) rc_l = {p.l: p.rc for p in oncv_input.lparams} help_str = f""" @@ -732,7 +732,7 @@ def get_rc_widgets(self, oncv_input: OncvInput) -> pn.WidgetBox: def get_qcut_widgets(self, oncv_input: OncvInput) -> pn.WidgetBox: """Return widgets to change the value of qc(l)""" menu_items = [(f"l = {l}", str(l)) for l in range(oncv_input.lmax + 1)] - menu_button = pnw.MenuButton(label="Change qcut(l)", items=menu_items, color="primary") + menu_button = pnw.MenuButton(name="Change qcut(l)", items=menu_items, button_type="primary") menu_button.on_click(self.on_change_qcut) qc_l = {p.l: p.qcut for p in oncv_input.lparams} help_str = f""" @@ -745,7 +745,7 @@ def get_qcut_widgets(self, oncv_input: OncvInput) -> pn.WidgetBox: def get_debl_widgets(self, oncv_input: OncvInput) -> pn.WidgetBox: """Return widgets to change the value of debl(l)""" menu_items = [(f"l = {l}", str(l)) for l in range(oncv_input.lmax + 1)] - menu_button = pnw.MenuButton(label="Change debl(l)", items=menu_items, color="primary") + menu_button = pnw.MenuButton(name="Change debl(l)", items=menu_items, button_type="primary") menu_button.on_click(self.on_change_debl) help_str = """ Here one can change the value of debl(l) with fixed nproj(l). @@ -754,7 +754,7 @@ def get_debl_widgets(self, oncv_input: OncvInput) -> pn.WidgetBox: def get_rc5_widgets(self, oncv_input: OncvInput) -> pn.WidgetBox: """Return widgets to change the value of rc5""" - btn = pnw.Button(label="Run", color="primary") + btn = pnw.Button(name="Run", button_type="primary") btn.on_click(self.on_change_rc5) help_str = f""" Here one can change the value of rc5 for vloc. @@ -765,7 +765,7 @@ def get_rc5_widgets(self, oncv_input: OncvInput) -> pn.WidgetBox: def get_dvloc0_widgets(self, oncv_input: OncvInput) -> pn.WidgetBox: """Return widgets to change the value of dvloc0""" - btn = pnw.Button(label="Run", color="primary") + btn = pnw.Button(name="Run", button_type="primary") btn.on_click(self.on_change_dvloc0) help_str = f""" Here one can change the value of dvloc0 for vloc. @@ -776,7 +776,7 @@ def get_dvloc0_widgets(self, oncv_input: OncvInput) -> pn.WidgetBox: def get_rhomodel_widgets(self, oncv_input: OncvInput) -> pn.WidgetBox: """Return widgets to change the parameters for the model core charge""" - btn = pnw.Button(label="Run", color="primary") + btn = pnw.Button(name="Run", button_type="primary") btn.on_click(self.on_change_rhomodel) help_str = f""" Here one can change the parameters for the model core charge. @@ -1128,7 +1128,7 @@ def get_rc_qcut_opt_view(self) -> pn.Row: oncv_input = self.get_oncv_input() menu_items = [(f"l = {l}", str(l)) for l in range(oncv_input.lmax + 1)] - menu_button = pnw.MenuButton(label="Change qcut(l)", items=menu_items, color="primary") + menu_button = pnw.MenuButton(name="Change qcut(l)", items=menu_items, button_type="primary") menu_button.on_click(self.on_change_rc_qcut) qc_l = {p.l: p.qcut for p in oncv_input.lparams} rc_l = {p.l: p.rc for p in oncv_input.lparams} @@ -1246,7 +1246,7 @@ def _update_out_area(self, psgen, oncv_input: OncvInput) -> None: else: _m = functools.partial(mpl, with_divider=False, dpi=self.dpi) - save_btn = pnw.Button(label="Save output", color="primary") + save_btn = pnw.Button(name="Save output", button_type="primary") save_btn.on_click(self.on_save_btn) new_rows = [ diff --git a/abipy/panels/phonons.py b/abipy/panels/phonons.py index 09831b74c..2ac57513a 100644 --- a/abipy/panels/phonons.py +++ b/abipy/panels/phonons.py @@ -20,10 +20,10 @@ def __init__(self, plotter, **params): params: Parameters passed to the parent class. """ self.phbands_plotter_mode = pnw.Select( - label="Plot Mode", value="gridplot", options=["gridplot", "combiplot", "boxplot", "combiboxplot"] + name="Plot Mode", value="gridplot", options=["gridplot", "combiplot", "boxplot", "combiboxplot"] ) # "animate", - self.phbands_plotter_units = pnw.Select(label="Units", value="eV", options=["eV", "meV", "Ha", "cm-1", "Thz"]) - self.phbands_plotter_btn = pnw.Button(label="Plot", color="primary") + self.phbands_plotter_units = pnw.Select(name="Units", value="eV", options=["eV", "meV", "Ha", "cm-1", "Thz"]) + self.phbands_plotter_btn = pnw.Button(name="Plot", button_type="primary") self.plotter = plotter super().__init__(**params) diff --git a/abipy/panels/sigeph.py b/abipy/panels/sigeph.py index 09cb74f76..6f4a56aaf 100644 --- a/abipy/panels/sigeph.py +++ b/abipy/panels/sigeph.py @@ -22,13 +22,13 @@ def __init__(self, sigeph: SigEPhFile, **params): PanelWithElectronBands.__init__(self, ebands=sigeph.ebands, **params) self.sigeph = sigeph - self.sigma_spin_select = pnw.Select(label="Spin index", options=list(range(sigeph.nsppol))) + self.sigma_spin_select = pnw.Select(name="Spin index", options=list(range(sigeph.nsppol))) self.sigma_kpoint_select = pnw.Select( - label="Kpoint in Sigma_nk", + name="Kpoint in Sigma_nk", options={"[%d]: %s" % (ik, repr(k)): ik for ik, k in enumerate(sigeph.sigma_kpoints)}, ) - self.plot_qpsolution_btn = pnw.Button(label="Plot Sigma_nk", color="primary") + self.plot_qpsolution_btn = pnw.Button(name="Plot Sigma_nk", button_type="primary") # sigma_band_select = param.ObjectSelector(default=0, objects=[0], doc="Band index in sigma_nk") def plot_lws(self) -> pn.GridSpec: diff --git a/abipy/panels/structure.py b/abipy/panels/structure.py index 8bfcf16b9..1763c35aa 100644 --- a/abipy/panels/structure.py +++ b/abipy/panels/structure.py @@ -63,35 +63,35 @@ def __init__(self, structure: Structure, with_inputs: bool = True, **params): # Convert widgets. self.output_format = pnw.Select( - label="format", value="abinit", options="abinit,cif,xsf,poscar,qe,siesta,wannier90,cssr,json".split(",") + name="format", value="abinit", options="abinit,cif,xsf,poscar,qe,siesta,wannier90,cssr,json".split(",") ) # Spglib widgets - self.spglib_symprec = pnw.Spinner(label="symprec", value=0.01, start=0.0, end=None, step=0.01) - self.spglib_angtol = pnw.Spinner(label="angtol", value=5, start=0.0, end=None, step=1) + self.spglib_symprec = pnw.Spinner(name="symprec", value=0.01, start=0.0, end=None, step=0.01) + self.spglib_angtol = pnw.Spinner(name="angtol", value=5, start=0.0, end=None, step=1) # Abisanitize widgets - self.abisanitize_btn = pnw.Button(label="Run abisanitize", color="primary") + self.abisanitize_btn = pnw.Button(name="Run abisanitize", button_type="primary") self.select_primitive = pnw.Select( - label="Select primitive", options=["primitive", "primitive_standard", "no_primitive"] + name="Select primitive", options=["primitive", "primitive_standard", "no_primitive"] ) # K-path widgets - self.kpath_format = pnw.Select(label="format", value="abinit", options=["abinit", "siesta", "wannier90"]) - self.line_density = pnw.Spinner(label="line density", value=10, step=5, start=0, end=None) - self.plot_kpath = pnw.Checkbox(label="Plot k-path", value=False) + self.kpath_format = pnw.Select(name="format", value="abinit", options=["abinit", "siesta", "wannier90"]) + self.line_density = pnw.Spinner(name="line density", value=10, step=5, start=0, end=None) + self.plot_kpath = pnw.Checkbox(name="Plot k-path", value=False) # MP-match - self.mp_match_btn = pnw.Button(label="Connect to Materials Project", color="primary") + self.mp_match_btn = pnw.Button(name="Connect to Materials Project", button_type="primary") # MP-search - # mp_search_btn = pnw.Button(label="Connect to Materials Project", color='primary') + # mp_search_btn = pnw.Button(name="Connect to Materials Project", button_type='primary') # mp_api_key # Widgets to control the generation of input files. - self.kppra = pnw.Spinner(label="kppra", value=1000, step=500, start=0, end=None) - self.smearing_type = pnw.Select(label="Smearing type", value=None, options=[None, "gaussian", "fermi_dirac"]) - self.tsmear = pnw.Spinner(label="tsmear (Ha)", value=0.01, step=0.002, start=0.0, end=None) + self.kppra = pnw.Spinner(name="kppra", value=1000, step=500, start=0, end=None) + self.smearing_type = pnw.Select(name="Smearing type", value=None, options=[None, "gaussian", "fermi_dirac"]) + self.tsmear = pnw.Spinner(name="tsmear (Ha)", value=0.01, step=0.002, start=0.0, end=None) # TODO: nspinor 2 should trigger a check on the table. from abipy.flowtk.psrepos import get_installed_repos_and_root @@ -100,22 +100,22 @@ def __init__(self, structure: Structure, with_inputs: bool = True, **params): options = [repo.name for repo in installed_repos] default_repo = "ONCVPSP-PBE-SR-PDv0.4" default_repo = None if default_repo not in options else default_repo - self.repos_name = pnw.Select(label="PP repos", value=default_repo, options=options) - self.table_name = pnw.Select(label="Table name", value="standard", options=["standard", "stringent"]) + self.repos_name = pnw.Select(name="PP repos", value=default_repo, options=options) + self.table_name = pnw.Select(name="Table name", value="standard", options=["standard", "stringent"]) # widgets for GS input generator - self.gs_type = pnw.Select(label="GS type", value="scf", options=["scf", "relax"]) - self.gs_input_btn = pnw.Button(label="Generate input", color="primary") + self.gs_type = pnw.Select(name="GS type", value="scf", options=["scf", "relax"]) + self.gs_input_btn = pnw.Button(name="Generate input", button_type="primary") # widgets for e-bands input generator. - self.ebands_input_btn = pnw.Button(label="Generate input", color="primary") - self.edos_kppra = pnw.Spinner(label="edos_kppra", value=0, step=500, start=0, end=None) + self.ebands_input_btn = pnw.Button(name="Generate input", button_type="primary") + self.edos_kppra = pnw.Spinner(name="edos_kppra", value=0, step=500, start=0, end=None) # widgets for DFPT phonons input generator. - self.ph_input_btn = pnw.Button(label="Generate input", color="primary") - self.with_becs = pnw.Checkbox(label="BECS and epsilon_inf (semiconductors)", value=False) - # self.dfpt_ngqpt = pnw.LiteralInput(label='ngqpt (python list)', value=[None, None, None], type=list) - # self.dfpt_ngqpt = pnw.LiteralInput(label='ngqpt (python list)', value=[None, None, None], type=list) + self.ph_input_btn = pnw.Button(name="Generate input", button_type="primary") + self.with_becs = pnw.Checkbox(name="BECS and epsilon_inf (semiconductors)", value=False) + # self.dfpt_ngqpt = pnw.LiteralInput(name='ngqpt (python list)', value=[None, None, None], type=list) + # self.dfpt_ngqpt = pnw.LiteralInput(name='ngqpt (python list)', value=[None, None, None], type=list) self.label2mode = { "unpolarized": "unpolarized", @@ -125,7 +125,7 @@ def __init__(self, structure: Structure, with_inputs: bool = True, **params): "collinear anti-ferromagnetic": "afm", } - self.spin_mode = pnw.Select(label="SpinMode", value="unpolarized", options=list(self.label2mode.keys())) + self.spin_mode = pnw.Select(name="SpinMode", value="unpolarized", options=list(self.label2mode.keys())) @pn.depends("output_format.value") def convert(self): @@ -631,8 +631,8 @@ def __init__(self, **params): super().__init__(**params) # Spglib widgets - # self.spglib_symprec = pnw.Spinner(label="symprec", value=0.01, start=0.0, end=None, step=0.01) - # self.spglib_angtol = pnw.Spinner(label="angtol", value=5, start=0.0, end=None, step=1) + # self.spglib_symprec = pnw.Spinner(name="symprec", value=0.01, start=0.0, end=None, step=0.01) + # self.spglib_angtol = pnw.Spinner(name="angtol", value=5, start=0.0, end=None, step=1) help_md = pn.pane.Markdown(f""" ## Description @@ -645,7 +645,7 @@ def __init__(self, **params): self.file_input = pnw.FileInput(height=60, css_classes=["pnx-file-upload-area"]) self.file_input.param.watch(self.on_file_input, "value") - self.mpid_input = pnw.TextInput(label="mp-id", placeholder="Enter e.g. mp-149 for Silicon and press ⏎") + self.mpid_input = pnw.TextInput(name="mp-id", placeholder="Enter e.g. mp-149 for Silicon and press ⏎") self.mpid_input.param.watch(self.on_mpid_input, "value") self.mpid_err_wdg = pn.pane.Markdown("") diff --git a/abipy/panels/tasks.py b/abipy/panels/tasks.py index ab090988e..1d7b692fc 100644 --- a/abipy/panels/tasks.py +++ b/abipy/panels/tasks.py @@ -25,9 +25,9 @@ def __init__(self, task: AbinitTask, **params): NodeParameterized.__init__(self, node=task, **params) self.task = task - # self.structures_btn = pnw.Button(label="Show Structures", color='primary') + # self.structures_btn = pnw.Button(name="Show Structures", button_type='primary') # self.structures_io_checkbox = pnw.CheckBoxGroup( - # label='Input/Output Structure', value=['output'], options=['input', 'output'], inline=Tru + # name='Input/Output Structure', value=['output'], options=['input', 'output'], inline=Tru def get_inputs_view(self): """Show the input files of the task: input file, submission script and TaskManager.""" diff --git a/abipy/panels/viewers.py b/abipy/panels/viewers.py index 181f921ae..62517cd62 100644 --- a/abipy/panels/viewers.py +++ b/abipy/panels/viewers.py @@ -26,7 +26,7 @@ def __init__(self, filepath: str, theme="terminal", height=1200, **params): super().__init__(**params) basename = os.path.basename(filepath) - self.open_btn = pnw.Button(label=f"Open {basename}", color="primary") + self.open_btn = pnw.Button(name=f"Open {basename}", button_type="primary") self.open_btn.on_click(self.open_ace_editor) self.ace = pnw.CodeEditor( @@ -49,7 +49,7 @@ def open_ace_editor(self, event) -> None: """Callback to open and read the file into the ACE editor.""" self.ace.visible = True self.ace.value = open(self.filepath).read() - self.open_btn.label = "Reopen %s" % os.path.basename(self.filepath) + self.open_btn.name = "Reopen %s" % os.path.basename(self.filepath) def __panel__(self): return self.layout From 412b19d7f368fbcff7a8b3b7de5e75abc5c51434 Mon Sep 17 00:00:00 2001 From: Matteo Giantomassi Date: Wed, 30 Sep 2026 16:27:29 +0200 Subject: [PATCH 18/23] Update vars database --- .../abio/abivar_database/variables_abinit.py | 26932 +++++++++------- abipy/abio/abivar_database/variables_aim.py | 902 +- .../abio/abivar_database/variables_anaddb.py | 398 +- abipy/abio/abivar_database/variables_atdep.py | 926 +- .../abivar_database/variables_multibinit.py | 3321 +- abipy/abio/abivar_database/variables_optic.py | 350 +- 6 files changed, 17882 insertions(+), 14947 deletions(-) diff --git a/abipy/abio/abivar_database/variables_abinit.py b/abipy/abio/abivar_database/variables_abinit.py index d9b1dcf91..d597324ee 100644 --- a/abipy/abio/abivar_database/variables_abinit.py +++ b/abipy/abio/abivar_database/variables_abinit.py @@ -1,3 +1,4 @@ + executable = "abinit" try: @@ -9,16 +10,16 @@ Variable = dict variables = [ - Variable( - abivarname="accuracy", - varset="basic", - vartype="integer", - topics=["Planewaves_basic", "SCFControl_basic"], - dimensions="scalar", - defaultval=0, - mnemonics="ACCURACY", - added_in_version="before_v9", - text=r""" +Variable( + abivarname="accuracy", + varset="basic", + vartype="integer", + topics=["Planewaves_basic", "SCFControl_basic"], + dimensions="scalar", + defaultval=0, + mnemonics="ACCURACY", + added_in_version="before_v9", + text=r""" Allows to tune the accuracy of a ground-state or DFPT calculation [[optdriver]]=0 or 1, by setting automatically the variables according to the following table: @@ -57,19 +58,20 @@ so the accuracy has to be tuned by the user (e.g. for GW calculations, perform convergence studies with respect to [[ecuteps]] and other relevant input variables). """, - ), - Variable( - abivarname="acell", - varset="basic", - vartype="real", - topics=["UnitCell_basic"], - dimensions=[3], - defaultval=MultipleValue(number=3, value=1), - mnemonics="CELL lattice vector scaling", - characteristics=["[[EVOLVING]]", "[[LENGTH]]"], - commentdims="represented internally as acell(3,[[nimage]])", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="acell", + varset="basic", + vartype="real", + topics=["UnitCell_basic"], + dimensions=[3], + defaultval=MultipleValue(number=3, value=1), + mnemonics="CELL lattice vector scaling", + characteristics=["[[EVOLVING]]", "[[LENGTH]]"], + commentdims="represented internally as acell(3,[[nimage]])", + added_in_version="before_v9", + text=r""" Gives the length scales by which dimensionless primitive translations ([[rprim]]) are to be multiplied. By default, given in Bohr atomic units (1 Bohr=0.5291772108 Angstroms), although Angstrom can be specified, if @@ -81,18 +83,19 @@ vectors, but the scaling factors of the primitive vectors. Use [[scalecart]] to scale the cartesian coordinates. """, - ), - Variable( - abivarname="adpimd", - varset="rlx", - vartype="integer", - topics=["PIMD_expert"], - dimensions="scalar", - defaultval=0, - mnemonics="ADiabatic Path-Integral Molecular Dynamics", - requires="[[imgmov]] == 9 or [[imgmov]] == 13", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="adpimd", + varset="rlx", + vartype="integer", + topics=["PIMD_expert"], + dimensions="scalar", + defaultval=0, + mnemonics="ADiabatic Path-Integral Molecular Dynamics", + requires="[[imgmov]] == 9 or [[imgmov]] == 13", + added_in_version="before_v9", + text=r""" Controls whether adiabatic Path-Integral Molecular Dynamics is performed or not. The corresponding adiabaticity parameter is given by [[adpimd_gamma]]. @@ -107,32 +110,34 @@ NOT YET USABLE """, - ), - Variable( - abivarname="adpimd_gamma", - varset="rlx", - vartype="real", - topics=["PIMD_expert"], - dimensions="scalar", - defaultval=1, - mnemonics="ADiabatic Path-Integral Molecular Dynamics: GAMMA factor", - requires="[[adpimd]] == 1 and [[imgmov]] in [9,13]", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="adpimd_gamma", + varset="rlx", + vartype="real", + topics=["PIMD_expert"], + dimensions="scalar", + defaultval=1, + mnemonics="ADiabatic Path-Integral Molecular Dynamics: GAMMA factor", + requires="[[adpimd]] == 1 and [[imgmov]] in [9,13]", + added_in_version="before_v9", + text=r""" Adiabaticity parameter to be used in adiabatic Path-Integral Molecular Dynamics. NOT YET USABLE """, - ), - Variable( - abivarname="algalch", - varset="gstate", - vartype="integer", - topics=["AtomTypes_expert"], - dimensions=["[[ntypalch]]"], - defaultval=MultipleValue(number="[[ntypalch]]", value=1), - mnemonics="ALGorithm for generating ALCHemical pseudopotentials", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="algalch", + varset="gstate", + vartype="integer", + topics=["AtomTypes_expert"], + dimensions=["[[ntypalch]]"], + defaultval=MultipleValue(number="[[ntypalch]]", value=1), + mnemonics="ALGorithm for generating ALCHemical pseudopotentials", + added_in_version="before_v9", + text=r""" Used for the generation of alchemical pseudopotentials, that is, when [[ntypalch]] is non-zero. @@ -157,18 +162,19 @@ Note that alchemical mixing cannot be used with PAW. """, - ), - Variable( - abivarname="amu", - varset="rlx", - vartype="real", - topics=["PIMD_useful", "Phonons_useful", "AtomTypes_basic", "Artificial_basic"], - dimensions=["[[ntypat]]"], - mnemonics="Atomic Mass Units", - characteristics=["[[EVOLVING]]"], - commentdefault="Defaults provided by a database of atomic masses.", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="amu", + varset="rlx", + vartype="real", + topics=["PIMD_useful", "Phonons_useful", "AtomTypes_basic", "Artificial_basic"], + dimensions=["[[ntypat]]"], + mnemonics="Atomic Mass Units", + characteristics=["[[EVOLVING]]"], + commentdefault="Defaults provided by a database of atomic masses.", + added_in_version="before_v9", + text=r""" Gives the masses in atomic mass units for each kind of atom in the input cell. These masses are used in performing molecular dynamical atomic motion if [[geoopt]] = "viscous" or "quenched" (corresponding to [[ionmov]] = 1 or 7) or if [[moldyn]] /= "none". @@ -196,18 +202,19 @@ characteristics can thus be considered, and can be made to evolve, e.g. with a genetic algorithm (not coded in v7.0.0 though). """, - ), - Variable( - abivarname="angdeg", - varset="basic", - vartype="real", - topics=["UnitCell_useful"], - dimensions=[3], - mnemonics="ANGles in DEGrees", - characteristics=["[[INPUT_ONLY]]"], - commentdefault="deduced from '[[rprim]]'", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="angdeg", + varset="basic", + vartype="real", + topics=["UnitCell_useful"], + dimensions=[3], + mnemonics="ANGles in DEGrees", + characteristics=["[[INPUT_ONLY]]"], + commentdefault="deduced from '[[rprim]]'", + added_in_version="before_v9", + text=r""" Gives the angles between directions of primitive vectors of the unit cell (in degrees), as an **alternative** to the input array [[rprim]]. Will be used to set up [[rprim]], that, together with the array [[acell]], will be used to define @@ -235,17 +242,18 @@ where each of the vectors is normalized, and form the desired angles with the others. """, - ), - Variable( - abivarname="asr", - varset="dfpt", - vartype="integer", - topics=["DFPT_useful", "Phonons_basic"], - dimensions="scalar", - defaultval=1, - mnemonics="Acoustic Sum Rule", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="asr", + varset="dfpt", + vartype="integer", + topics=["DFPT_useful","Phonons_basic"], + dimensions="scalar", + defaultval=1, + mnemonics="Acoustic Sum Rule", + added_in_version="before_v9", + text=r""" Set the treatment of the Acoustic Sum Rule (ASR) in phonon calculations in the ABINIT code. Same values as the corresponding ANADDB variable [[asr@anaddb]]. Please switch to this description. @@ -261,18 +269,19 @@ See also the variables [[chneut]] and [[chneut@anaddb]], that govern the imposition of the charge neutrality sum rule. """, - ), - Variable( - abivarname="atndlist", - varset="gstate", - vartype="real", - topics=["NMR_basic", "MagField_expert"], - dimensions=["3*[[natnd]]"], - defaultval=MultipleValue(number=None, value=0), - mnemonics="ATom Nuclear Dipole moment LIST", - requires="[[natnd]] > 0 and [[iatnd]]", - added_in_version="v10.5", - text=r""" +), + +Variable( + abivarname="atndlist", + varset="gstate", + vartype="real", + topics=["NMR_basic","MagField_expert"], + dimensions=["3*[[natnd]]"], + defaultval=MultipleValue(number=None, value=0), + mnemonics="ATom Nuclear Dipole moment LIST", + requires="[[natnd]] > 0 and [[iatnd]]", + added_in_version="v10.5", + text=r""" Provides a simplified, alternative input to [[nucdipmom]] for the atoms carrying explicit nuclear dipole moments. The number of atoms in the cell with explicit nuclear dipoles is [[natnd]]; the list of the atoms is [[iatnd]]; and the components @@ -282,19 +291,20 @@ list is converted internally to the full [[nucdipmom]] list; either input format can be used. """, - ), - Variable( - abivarname="atvshift", - varset="ffield", - vartype="real", - topics=["DFT+U_expert"], - dimensions=["[[natvshift]]", "[[nsppol]]", "[[natom]]"], - defaultval=MultipleValue(number=None, value=0.0), - mnemonics="ATomic potential (V) energy SHIFTs", - characteristics=["[[DEVELOP]]"], - requires="[[usepawu]] /= 0 and [[natvshift]] in [5,7]", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="atvshift", + varset="ffield", + vartype="real", + topics=["DFT+U_expert"], + dimensions=["[[natvshift]]", "[[nsppol]]", "[[natom]]"], + defaultval=MultipleValue(number=None, value=0.0), + mnemonics="ATomic potential (V) energy SHIFTs", + characteristics=["[[DEVELOP]]"], + requires="[[usepawu]] /= 0 and [[natvshift]] in [5,7]", + added_in_version="before_v9", + text=r""" Defines for each atom and each spin channel (at present, can only be used with [[nsppol]] = 1 or 2, like the +U scheme), a possible potential shift, for the d (with [[lpawu]] = 2, [[natvshift]] = 5), or f states (with [[lpawu]] = 3, @@ -309,18 +319,19 @@ [[usepawu]] should be non-zero, [[lpawu]] should be 2 or 3. """, - ), - Variable( - abivarname="autoparal", - varset="paral", - vartype="integer", - topics=["parallelism_basic"], - dimensions="scalar", - defaultval=0, - mnemonics="AUTOmatisation of the PARALlelism", - characteristics=["[[DEVELOP]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="autoparal", + varset="paral", + vartype="integer", + topics=["parallelism_basic"], + dimensions="scalar", + defaultval=0, + mnemonics="AUTOmatisation of the PARALlelism", + characteristics=["[[DEVELOP]]"], + added_in_version="before_v9", + text=r""" This input variable controls the automatic determination of input parameters related to parallel work distribution if not specified in input file. @@ -367,17 +378,18 @@ each distribution and the higher this weight is the better the distribution is. After having printed out the weights, the code stops. """, - ), - Variable( - abivarname="auxc_ixc", - varset="gstate", - vartype="integer", - topics=["Hybrids_useful"], - dimensions="scalar", - defaultval=1, - mnemonics="AUxiliary XC functional for hybrid functional, IXC number", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="auxc_ixc", + varset="gstate", + vartype="integer", + topics=["Hybrids_useful"], + dimensions="scalar", + defaultval=1, + mnemonics="AUxiliary XC functional for hybrid functional, IXC number", + added_in_version="before_v9", + text=r""" Specification of an auxiliary exchange-correlation functional, thanks to its [[ixc]] value, to possibly replace the heavy evaluation of an hybrid functional at specific occasions, e.g. when the Fock operator is frozen during @@ -387,17 +399,18 @@ [[fockoptmix]] == 11. If [[gwcalctyp]] == 5, 15 or 25, *auxc_ixc* refers to [[ixc_sigma]] instead of [[ixc]]. """, - ), - Variable( - abivarname="auxc_scal", - varset="gstate", - vartype="real", - topics=["Hybrids_useful"], - dimensions="scalar", - defaultval=1.0, - mnemonics="AUxiliary XC functional for hybrid functional- SCALing factor", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="auxc_scal", + varset="gstate", + vartype="real", + topics=["Hybrids_useful"], + dimensions="scalar", + defaultval=1.0, + mnemonics="AUxiliary XC functional for hybrid functional- SCALing factor", + added_in_version="before_v9", + text=r""" Possible scaling factor for the auxiliary exchange-correlation functional defined by [[auxc_ixc]] that has the goal to replace the Fock operator or hybrid functional when [[fockoptmix]] == 11. @@ -406,18 +419,19 @@ auxiliary functional is used to replace the hybrid functional in SCF loops, a value of 1.5 has been observed to speed up somehow the convergence. """, - ), - Variable( - abivarname="awtr", - varset="gw", - vartype="integer", - topics=["Susceptibility_useful"], - dimensions="scalar", - defaultval=1, - mnemonics=r"evaluate the Adler-Wiser expression of $\chi^{0}_{KS}$ assuming Time-Reversal", - requires="[[optdriver]] == 3", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="awtr", + varset="gw", + vartype="integer", + topics=["Susceptibility_useful"], + dimensions="scalar", + defaultval=1, + mnemonics=r"evaluate the Adler-Wiser expression of $\chi^{0}_{KS}$ assuming Time-Reversal", + requires="[[optdriver]] == 3", + added_in_version="before_v9", + text=r""" This input variable defines whether the irreducible polarizability $\chi^{0}_{KS}$ is evaluated taking advantage of time-reversal symmetry or not. @@ -431,19 +445,20 @@ Note that the parallel algorithm [[gwpara]] = 2 is not compatible with the choice *awtr* = 0. """, - ), - Variable( - abivarname="bandpp", - varset="paral", - vartype="integer", - topics=["parallelism_useful"], - dimensions="scalar", - defaultval=1, - mnemonics="BAND Per Processor", - characteristics=["[[DEVELOP]]"], - requires="[[paral_kgb]] == 1", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="bandpp", + varset="paral", + vartype="integer", + topics=["parallelism_useful"], + dimensions="scalar", + defaultval=1, + mnemonics="BAND Per Processor", + characteristics=["[[DEVELOP]]"], + requires="[[paral_kgb]] == 1", + added_in_version="before_v9", + text=r""" Affect the size of a block in the LOBPCG algorithm. One should use [[nblock_lobpcg]] instead, which sets **bandpp** depending on [[nband]] and [[npband]]. @@ -477,18 +492,19 @@ but keep in mind that the size of the workspace arrays will also increase so the calculation may go out-of-memory if a too large [[bandpp]] is used in systems if many atoms. """, - ), - Variable( - abivarname="bdberry", - varset="ffield", - vartype="integer", - topics=["Berry_basic"], - dimensions=[4], - defaultval=MultipleValue(number=4, value=0), - mnemonics="BanD limits for BERRY phase", - requires="[[berryopt]] in [1, 2, 3] and [[nberry]] > 0", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="bdberry", + varset="ffield", + vartype="integer", + topics=["Berry_basic"], + dimensions=[4], + defaultval=MultipleValue(number=4, value=0), + mnemonics="BanD limits for BERRY phase", + requires="[[berryopt]] in [1, 2, 3] and [[nberry]] > 0", + added_in_version="before_v9", + text=r""" Give the lower band and the upper band of the set of bands for which the Berry phase must be computed. Irrelevant if [[nberry]] is not positive. When [[nsppol]] is 1 (no spin-polarisation), only the two first numbers, giving the @@ -504,18 +520,19 @@ phase calculation with [[berryopt]] = 1, 2, or 3: the above-mentioned default will cause an early exit. """, - ), - Variable( - abivarname="bdeigrf", - varset="dfpt", - vartype="integer", - topics=["TDepES_basic"], - dimensions="scalar", - defaultval=-1, - mnemonics="BanD for second-order EIGenvalues from Response-Function", - requires="[[ieig2rf]] in [1,2,3,4,5]", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="bdeigrf", + varset="dfpt", + vartype="integer", + topics=["TDepES_basic"], + dimensions="scalar", + defaultval=-1, + mnemonics="BanD for second-order EIGenvalues from Response-Function", + requires="[[ieig2rf]] in [1,2,3,4,5]", + added_in_version="before_v9", + text=r""" The variable *bdeigrf* is the maximum number of bands for which the second- order eigenvalues must be calculated: the full number of bands is still used @@ -523,18 +540,19 @@ If *bdeigrf* is set to -1, the code will automatically set *bdeigrf* equal to [[nband]]. """, - ), - Variable( - abivarname="bdgw", - varset="gw", - vartype="integer", - topics=["GW_basic", "SelfEnergy_basic"], - dimensions=[2, "[[nkptgw]]", "[[nsppol]]"], - defaultval=MultipleValue(number=None, value=0), - mnemonics="BanDs for GW calculation", - requires="[[optdriver]] in [4, 7]", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="bdgw", + varset="gw", + vartype="integer", + topics=["GW_basic", "SelfEnergy_basic"], + dimensions=[2, "[[nkptgw]]", "[[nsppol]]"], + defaultval=MultipleValue(number=None, value=0), + mnemonics="BanDs for GW calculation", + requires="[[optdriver]] in [4, 7]", + added_in_version="before_v9", + text=r""" For each k-point with number `ikptgw` in the range (1:[[nkptgw]]) and each spin index `isppol`, **bdgw**(1,`ikptgw`,`isppol`) is the number of the lowest band for which the self-energy computation must be done. @@ -560,17 +578,18 @@ to the same irreducible representation. Only in this case, indeed, the initial symmetries and energy degenerations are preserved. """, - ), - Variable( - abivarname="berryopt", - varset="ffield", - vartype="integer", - topics=["Berry_compulsory"], - dimensions="scalar", - defaultval=0, - mnemonics="BERRY phase OPTions", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="berryopt", + varset="ffield", + vartype="integer", + topics=["Berry_compulsory"], + dimensions="scalar", + defaultval=0, + mnemonics="BERRY phase OPTions", + added_in_version="before_v9", + text=r""" Specifies the use of Berry phase for the computation of either the polarization, the derivatives with respect to the wavevector, or finite electric field calculations. @@ -628,17 +647,18 @@ (*berryopt* = 4,6,7,14,16,17), see also the input variables [[berrysav]], [[dfield]], [[red_dfield]], [[red_efield]], [[ddamp]] """, - ), - Variable( - abivarname="berrysav", - varset="ffield", - vartype="integer", - topics=["Berry_useful"], - dimensions="scalar", - defaultval=0, - mnemonics="BERRY SAVe", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="berrysav", + varset="ffield", + vartype="integer", + topics=["Berry_useful"], + dimensions="scalar", + defaultval=0, + mnemonics="BERRY SAVe", + added_in_version="before_v9", + text=r""" * 0 --> for finite electric field calculation ([[berryopt]] = 4/14), the polarization branch will be chosen on each iteration from (-pi, pi). For finite electric displacement field calculation([[berryopt]] = 6/7/16/17), @@ -651,18 +671,19 @@ Make sure that "POLSAVE" is empty or it does not exist before the calculation, or else that it specifies the desired polarization branch. """, - ), - Variable( - abivarname="berrystep", - varset="ffield", - vartype="integer", - topics=["Berry_expert"], - dimensions="scalar", - defaultval=1, - mnemonics="BERRY phase: multiple STEP", - requires="0 > [[berryopt]]", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="berrystep", + varset="ffield", + vartype="integer", + topics=["Berry_expert"], + dimensions="scalar", + defaultval=1, + mnemonics="BERRY phase: multiple STEP", + requires="0 > [[berryopt]]", + added_in_version="before_v9", + text=r""" If [[berryopt]] is negative, this variable is used to compute berry phases using multiple discrete steps, in order to accelerate convergence. The single- step berry phase is the standard calculation using strings of k-points based @@ -677,47 +698,50 @@ the single-step berry phase. Use with care: while experience is still to be gained with this procedure, the outlook is promising. """, - ), - Variable( - abivarname="bfield", - varset="ffield", - vartype="real", - topics=["MagField_expert"], - dimensions=[3], - defaultval=MultipleValue(number=3, value=0.0), - mnemonics="finite B FIELD calculation", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="bfield", + varset="ffield", + vartype="real", + topics=["MagField_expert"], + dimensions=[3], + defaultval=MultipleValue(number=3, value=0.0), + mnemonics="finite B FIELD calculation", + added_in_version="before_v9", + text=r""" Perform finite magnetic field calculation. !!! important THIS CODE IS UNDER DEVELOPMENT AND IS NOT READY FOR USE. """, - ), - Variable( - abivarname="bmass", - varset="rlx", - vartype="real", - topics=["MolecularDynamics_expert"], - dimensions="scalar", - defaultval=10, - mnemonics="Barostat MASS", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="bmass", + varset="rlx", + vartype="real", + topics=["MolecularDynamics_expert"], + dimensions="scalar", + defaultval=10, + mnemonics="Barostat MASS", + added_in_version="before_v9", + text=r""" bmass is the mass of the barostat when [[moldyn]] = "npt_martyna", "nst_martyna" or "npt_langevin" (corresponding to [[ionmov]] = 13 and 16). """, - ), - Variable( - abivarname="boxcenter", - varset="gstate", - vartype="real", - topics=["TDDFT_basic"], - dimensions=[3], - defaultval=[0.5, 0.5, 0.5], - mnemonics="BOX CENTER", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="boxcenter", + varset="gstate", + vartype="real", + topics=["TDDFT_basic"], + dimensions=[3], + defaultval=[0.5, 0.5, 0.5], + mnemonics="BOX CENTER", + added_in_version="before_v9", + text=r""" Defines the center of the box, in reduced coordinates. At present, this information is only used in the case of Time-Dependent DFT computation of the oscillator strength. One must take *boxcenter* such as to be roughly the center @@ -725,17 +749,18 @@ surrounding the cluster or molecule has xred 0 or 1. On the contrary, when the cluster or molecule is close to the origin, it is better to take *boxcenter* = [0.0, 0.0, 0.0]. """, - ), - Variable( - abivarname="boxcutmin", - varset="gstate", - vartype="real", - topics=["Planewaves_useful", "TuningSpeedMem_basic"], - dimensions="scalar", - defaultval=2.0, - mnemonics="BOX CUT-off MINimum", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="boxcutmin", + varset="gstate", + vartype="real", + topics=["Planewaves_useful", "TuningSpeedMem_basic"], + dimensions="scalar", + defaultval=2.0, + mnemonics="BOX CUT-off MINimum", + added_in_version="before_v9", + text=r""" The box cutoff ratio is the ratio between the radius of the G-sphere that can be inserted in the FFT box (see [[ngfft]]) and the G-sphere used to represent the wavefunctions as computed from the input [[ecut]]. In order for the density to be exact (in the case of the plane wave part, not the PAW on-site terms), @@ -763,18 +788,19 @@ the deterioration in phonon band structures could be alleviated to a large extent by the imposition of the Acoustic Sum Rule [[asr]]. """, - ), - Variable( - abivarname="brvltt", - varset="geo", - vartype="integer", - topics=["UnitCell_useful", "SmartSymm_basic"], - dimensions="scalar", - defaultval=0, - mnemonics="BRaVais LaTTice type", - requires="[[spgroup]] != 0", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="brvltt", + varset="geo", + vartype="integer", + topics=["UnitCell_useful", "SmartSymm_basic"], + dimensions="scalar", + defaultval=0, + mnemonics="BRaVais LaTTice type", + requires="[[spgroup]] != 0", + added_in_version="before_v9", + text=r""" Set the type of Bravais lattice. The cell defined by [[acell]] and [[rprim]] or [[angdeg]] should be the CONVENTIONAL cell. @@ -808,18 +834,19 @@ translations: (2/3, 1/3, 1/3) and (1/3, 2/3, 2/3). For more details see the [[help:spacegroup]]. """, - ), - Variable( - abivarname="bs_algorithm", - varset="bse", - vartype="integer", - topics=["BSE_basic"], - dimensions="scalar", - defaultval=2, - mnemonics="Bethe-Salpeter ALGORITHM", - requires="[[optdriver]] == 99", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="bs_algorithm", + varset="bse", + vartype="integer", + topics=["BSE_basic"], + dimensions="scalar", + defaultval=2, + mnemonics="Bethe-Salpeter ALGORITHM", + requires="[[optdriver]] == 99", + added_in_version="before_v9", + text=r""" This input variable defines the algorithm employed to calculate the macroscopic dielectric function. Possible values are in [1, 2, 3]: @@ -842,18 +869,19 @@ * 3 --> Conjugate-gradient method. This method allows one to find the few first excitonic eigenvalues. Only available for resonant calculations (Tamm-Dancoff approximation). """, - ), - Variable( - abivarname="bs_calctype", - varset="bse", - vartype="integer", - topics=["BSE_expert"], - dimensions="scalar", - defaultval=1, - mnemonics="Bethe-Salpeter CALCulation TYPE", - requires="[[optdriver]] == 99", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="bs_calctype", + varset="bse", + vartype="integer", + topics=["BSE_expert"], + dimensions="scalar", + defaultval=1, + mnemonics="Bethe-Salpeter CALCulation TYPE", + requires="[[optdriver]] == 99", + added_in_version="before_v9", + text=r""" Possible values are in [1, 2, 3]. * 1 --> use the KS eigenvalues and wave functions stored in the WFK file to construct the transition space @@ -862,18 +890,19 @@ Not coded yet because <\psi|r|\psj>^QP should be calculated taking into account the non-locality of the self-energy in the commutator [H,r]. """, - ), - Variable( - abivarname="bs_coulomb_term", - varset="bse", - vartype="integer", - topics=["BSE_expert"], - dimensions="scalar", - defaultval=11, - mnemonics="Bethe-Salpeter COULOMB TERM", - requires="[[optdriver]] == 99", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="bs_coulomb_term", + varset="bse", + vartype="integer", + topics=["BSE_expert"], + dimensions="scalar", + defaultval=11, + mnemonics="Bethe-Salpeter COULOMB TERM", + requires="[[optdriver]] == 99", + added_in_version="before_v9", + text=r""" This variable governs the choice among the different options available for the treatment of Coulomb term of the Bethe-Salpeter Hamiltonian. **bs_coulomb_term** is the concatenation of two digits, labelled (A) and (B). @@ -895,18 +924,19 @@ * 1 --> The Coulomb term is correctly evaluated using the truly non-local screening $W(\rr,\rr')$. """, - ), - Variable( - abivarname="bs_coupling", - varset="bse", - vartype="integer", - topics=["BSE_useful"], - dimensions="scalar", - defaultval=0, - mnemonics="Bethe-Salpeter COUPLING", - requires="[[optdriver]] == 99", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="bs_coupling", + varset="bse", + vartype="integer", + topics=["BSE_useful"], + dimensions="scalar", + defaultval=0, + mnemonics="Bethe-Salpeter COUPLING", + requires="[[optdriver]] == 99", + added_in_version="before_v9", + text=r""" The **bs_coupling** input variable defines the treatment of the coupling block of the Bethe-Salpeter Hamiltonian. Possible values are 0, 1. @@ -917,51 +947,54 @@ * 1 --> The coupling term is included (non Tamm-Dancoff approximation). """, - ), - Variable( - abivarname="bs_eh_cutoff", - varset="bse", - vartype="integer", - topics=["BSE_expert"], - dimensions=[2], - defaultval=["-inf", "inf"], - mnemonics="Bethe-Salpeter Electron-Hole CUTOFF", - requires="[[optdriver]] == 99", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="bs_eh_cutoff", + varset="bse", + vartype="integer", + topics=["BSE_expert"], + dimensions=[2], + defaultval=["-inf", "inf"], + mnemonics="Bethe-Salpeter Electron-Hole CUTOFF", + requires="[[optdriver]] == 99", + added_in_version="before_v9", + text=r""" Used to define a cutoff in the e-h basis set. Only those transitions whose energy is between bs_eh_cutoff(1) and bs_eh_cutoff(2) will be considered in the construction of the e-h Hamiltonian. """, - ), - Variable( - abivarname="bs_exchange_term", - varset="bse", - vartype="integer", - topics=["BSE_expert"], - dimensions="scalar", - defaultval=1, - mnemonics="Bethe-Salpeter EXCHANGE TERM", - requires="[[optdriver]] == 99", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="bs_exchange_term", + varset="bse", + vartype="integer", + topics=["BSE_expert"], + dimensions="scalar", + defaultval=1, + mnemonics="Bethe-Salpeter EXCHANGE TERM", + requires="[[optdriver]] == 99", + added_in_version="before_v9", + text=r""" * 0 --> The exchange term is not calculated. This is equivalent to neglecting local field effects in the macroscopic dielectric function. * 1 --> The exchange term is calculated and added to the excitonic Hamiltonian. """, - ), - Variable( - abivarname="bs_freq_mesh", - varset="bse", - vartype="real", - topics=["BSE_basic"], - dimensions=[3], - defaultval=[0.0, 0.0, 0.01], - mnemonics="Bethe-Salpeter FREQuency MESH", - characteristics=["[[ENERGY]]"], - requires="[[optdriver]] == 99", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="bs_freq_mesh", + varset="bse", + vartype="real", + topics=["BSE_basic"], + dimensions=[3], + defaultval=[0.0, 0.0, 0.01], + mnemonics="Bethe-Salpeter FREQuency MESH", + characteristics=["[[ENERGY]]"], + requires="[[optdriver]] == 99", + added_in_version="before_v9", + text=r""" **bs_freq_mesh(1)** defines the first frequency for the calculation of the macroscopic dielectric function. **bs_freq_mesh(2)** gives the last frequency for the calculation of the @@ -969,18 +1002,19 @@ **bs_freq_mesh(3)** gives the step of the linear mesh used for evaluating the macroscopic dielectric function. """, - ), - Variable( - abivarname="bs_hayd_term", - varset="bse", - vartype="integer", - topics=["BSE_expert"], - dimensions="scalar", - defaultval=1, - mnemonics="Bethe-Salpeter HAYdock TERMinator", - requires="[[optdriver]] == 99 and [[bs_algorithm]] == 2", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="bs_hayd_term", + varset="bse", + vartype="integer", + topics=["BSE_expert"], + dimensions="scalar", + defaultval=1, + mnemonics="Bethe-Salpeter HAYdock TERMinator", + requires="[[optdriver]] == 99 and [[bs_algorithm]] == 2", + added_in_version="before_v9", + text=r""" Defines how to terminate the continued fraction expression for the dielectric function. The terminator reduces the number of iterations needed to converge by smoothing the oscillation in the high energy part of the spectrum @@ -991,35 +1025,37 @@ by their values at $i = \text{niter}$. If the coupling block is included, the terminator function is the one described in [[cite:Rocca2008]]. """, - ), - Variable( - abivarname="bs_haydock_niter", - varset="bse", - vartype="integer", - topics=["BSE_expert"], - dimensions="scalar", - defaultval=100, - mnemonics="Bethe-Salpeter HAYDOCK Number of ITERations", - requires="[[optdriver]] == 99 and [[bs_algorithm]] == 2", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="bs_haydock_niter", + varset="bse", + vartype="integer", + topics=["BSE_expert"], + dimensions="scalar", + defaultval=100, + mnemonics="Bethe-Salpeter HAYDOCK Number of ITERations", + requires="[[optdriver]] == 99 and [[bs_algorithm]] == 2", + added_in_version="before_v9", + text=r""" **bs_haydock_niter** defines the maximum number of iterations used to calculate the macroscopic dielectric function. The iterative algorithm stops when the difference between two consecutive evaluations of the optical spectra is less than [[bs_haydock_tol]]. """, - ), - Variable( - abivarname="bs_haydock_tol", - varset="bse", - vartype="real", - topics=["BSE_expert"], - dimensions=[2], - defaultval=[0.02, 0.0], - mnemonics="Bethe-Salpeter HAYDOCK TOLerance", - requires="[[optdriver]] == 99 and [[bs_algorithm]] == 2", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="bs_haydock_tol", + varset="bse", + vartype="real", + topics=["BSE_expert"], + dimensions=[2], + defaultval=[0.02, 0.0], + mnemonics="Bethe-Salpeter HAYDOCK TOLerance", + requires="[[optdriver]] == 99 and [[bs_algorithm]] == 2", + added_in_version="before_v9", + text=r""" Defines the convergence criterion for the Haydock iterative method. The iterative algorithm stops when the difference between two consecutive evaluations of the macroscopic dielectric function is less than **bs_haydock_tol(1)**. @@ -1036,64 +1072,68 @@ (The latter are real numbers, tolerance is 1.0d-6). """, - ), - Variable( - abivarname="bs_interp_kmult", - varset="bse", - vartype="integer", - topics=["BSE_useful"], - dimensions=[3], - defaultval=[0, 0, 0], - mnemonics="Bethe-Salpeter INTERPolation K-point MULTiplication factors", - requires="[[bs_interp_mode]] > 0 and [[bs_algorithm]] == 2 and [[bs_coupling]] == 0", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="bs_interp_kmult", + varset="bse", + vartype="integer", + topics=["BSE_useful"], + dimensions=[3], + defaultval=[0, 0, 0], + mnemonics="Bethe-Salpeter INTERPolation K-point MULTiplication factors", + requires="[[bs_interp_mode]] > 0 and [[bs_algorithm]] == 2 and [[bs_coupling]] == 0", + added_in_version="before_v9", + text=r""" **bs_interp_kmult** defines the number of divisions used to generate the dense mesh in the interpolation. [[ngkpt]] of the dense mesh = **bs_interp_kmult(:)** * [[ngkpt]] of the coarse mesh. """, - ), - Variable( - abivarname="bs_interp_m3_width", - varset="bse", - vartype="real", - topics=["BSE_useful"], - dimensions="scalar", - defaultval=1.0, - mnemonics="Bethe-Salpeter INTERPolation Method3 WIDTH", - requires="[[bs_interp_mode]] == 3 and [[bs_algorithm]] == 2 and [[bs_coupling]] == 0", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="bs_interp_m3_width", + varset="bse", + vartype="real", + topics=["BSE_useful"], + dimensions="scalar", + defaultval=1.0, + mnemonics="Bethe-Salpeter INTERPolation Method3 WIDTH", + requires="[[bs_interp_mode]] == 3 and [[bs_algorithm]] == 2 and [[bs_coupling]] == 0", + added_in_version="before_v9", + text=r""" Defines the width of the region where divergence treatment is applied for BSE interpolation """, - ), - Variable( - abivarname="bs_interp_method", - varset="bse", - vartype="integer", - topics=["BSE_useful"], - dimensions="scalar", - defaultval=1, - mnemonics="Bethe-Salpeter INTERPolation METHOD", - requires="[[bs_interp_mode]] > 0 and [[bs_algorithm]] == 2 and [[bs_coupling]] == 0", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="bs_interp_method", + varset="bse", + vartype="integer", + topics=["BSE_useful"], + dimensions="scalar", + defaultval=1, + mnemonics="Bethe-Salpeter INTERPolation METHOD", + requires="[[bs_interp_mode]] > 0 and [[bs_algorithm]] == 2 and [[bs_coupling]] == 0", + added_in_version="before_v9", + text=r""" *bs_interp_method* selects the interpolation method:: * 0 --> Interpolate using Y. Gillet technique with 8 neighbours (see [[cite:Gillet2016]]). * 1 --> Interpolation using Rohlfing & Louie technique (see above-mentioned article and [[cite:Rohlfing2000]]) """, - ), - Variable( - abivarname="bs_interp_mode", - varset="bse", - vartype="integer", - topics=["BSE_basic"], - dimensions="scalar", - defaultval=0, - mnemonics="Bethe-Salpeter INTERPolation MODE", - requires="[[bs_interp_mode]] > 0 and [[bs_algorithm]] == 2 and [[bs_coupling]] == 0", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="bs_interp_mode", + varset="bse", + vartype="integer", + topics=["BSE_basic"], + dimensions="scalar", + defaultval=0, + mnemonics="Bethe-Salpeter INTERPolation MODE", + requires="[[bs_interp_mode]] > 0 and [[bs_algorithm]] == 2 and [[bs_coupling]] == 0", + added_in_version="before_v9", + text=r""" *bs_interp_mode* selects the mode of interpolation: * 0 --> No interpolation. Standard Bethe-Salpeter computation is performed @@ -1101,81 +1141,86 @@ * 2 --> Treatment of the divergence on the whole set of dense k-points * 3 --> Treatment of the divergence along the diagonal in k-space and simple interpolation elsewhere. """, - ), - Variable( - abivarname="bs_interp_prep", - varset="bse", - vartype="integer", - topics=["BSE_useful"], - dimensions="scalar", - defaultval=0, - mnemonics="Bethe-Salpeter INTERPolation PREParation", - requires="[[bs_interp_mode]] > 0 and [[bs_algorithm]] == 2 and [[bs_coupling]] == 0", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="bs_interp_prep", + varset="bse", + vartype="integer", + topics=["BSE_useful"], + dimensions="scalar", + defaultval=0, + mnemonics="Bethe-Salpeter INTERPolation PREParation", + requires="[[bs_interp_mode]] > 0 and [[bs_algorithm]] == 2 and [[bs_coupling]] == 0", + added_in_version="before_v9", + text=r""" *bs_interp_prep* allows one to trigger the preparation of the interpolation with method 2 or method 3. It generates the decomposition of BSR in a, b, c coefficients used for the interpolation. """, - ), - Variable( - abivarname="bs_interp_rl_nb", - varset="bse", - vartype="integer", - topics=["BSE_useful"], - dimensions="scalar", - defaultval=1, - mnemonics="Bethe-Salpeter INTERPolation Rohlfing & Louie NeighBour", - requires="[[bs_interp_mode]] > 0 and [[bs_algorithm]] == 2 and [[bs_interp_method]] == 1 and [[bs_coupling]] == 0", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="bs_interp_rl_nb", + varset="bse", + vartype="integer", + topics=["BSE_useful"], + dimensions="scalar", + defaultval=1, + mnemonics="Bethe-Salpeter INTERPolation Rohlfing & Louie NeighBour", + requires="[[bs_interp_mode]] > 0 and [[bs_algorithm]] == 2 and [[bs_interp_method]] == 1 and [[bs_coupling]] == 0", + added_in_version="before_v9", + text=r""" Gives the index of the neighbour that is used in the Rohlfing and Louie method ([[cite:Rohlfing2000]]) """, - ), - Variable( - abivarname="bs_loband", - varset="bse", - vartype="integer", - topics=["BSE_compulsory"], - dimensions=["[[nsppol]]"], - defaultval=0, - mnemonics="Bethe-Salpeter Lowest Occupied BAND", - requires="[[optdriver]] == 99", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="bs_loband", + varset="bse", + vartype="integer", + topics=["BSE_compulsory"], + dimensions=["[[nsppol]]"], + defaultval=0, + mnemonics="Bethe-Salpeter Lowest Occupied BAND", + requires="[[optdriver]] == 99", + added_in_version="before_v9", + text=r""" This variable defines the index of the lowest occupied band used for the construction of the electron-hole basis set. For spin polarized calculations, one must provide two separated indices for spin up and spin down. An additional cutoff energy can be applied by means of the [[bs_eh_cutoff]] input variable. """, - ), - Variable( - abivarname="bs_nstates", - varset="bse", - vartype="integer", - topics=["BSE_basic"], - dimensions="scalar", - defaultval=0, - mnemonics="Bethe-Salpeter Number of STATES", - requires="[[optdriver]] == 99 and [[bs_algorithm]] in [1, 3]", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="bs_nstates", + varset="bse", + vartype="integer", + topics=["BSE_basic"], + dimensions="scalar", + defaultval=0, + mnemonics="Bethe-Salpeter Number of STATES", + requires="[[optdriver]] == 99 and [[bs_algorithm]] in [1, 3]", + added_in_version="before_v9", + text=r""" **bs_nstates** defines the maximum number of excitonic states calculated in the direct diagonalization of the excitonic matrix or in the conjugate-gradient method. The number of states should be sufficiently large for a correct description of the optical properties in the frequency range of interest. """, - ), - Variable( - abivarname="builtintest", - varset="dev", - vartype="integer", - topics=["Control_expert"], - dimensions="scalar", - defaultval=0, - mnemonics="BUILT-IN TEST number", - characteristics=["[[DEVELOP]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="builtintest", + varset="dev", + vartype="integer", + topics=["Control_expert"], + dimensions="scalar", + defaultval=0, + mnemonics="BUILT-IN TEST number", + characteristics=["[[DEVELOP]]"], + added_in_version="before_v9", + text=r""" When [[builtintest]] is non-zero, the input file is a special one, that runs very quickly, and that is accompanied by a specific analysis by ABINIT, at the end of the run, against a hard-coded value of total energy (and possibly @@ -1184,18 +1229,19 @@ fallbacks have been connected or not (bigdft, netcdf, libxc, wannier90). At present, [[builtintest]] = 1... 7 are allowed. See more information in tests/built-in/README. """, - ), - Variable( - abivarname="bxctmindg", - varset="paw", - vartype="real", - topics=["PAW_expert"], - dimensions="scalar", - defaultval=2.0, - mnemonics="BoX CuT-off MINimum for the Double Grid (PAW)", - requires="[[usepaw]] == 1", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="bxctmindg", + varset="paw", + vartype="real", + topics=["PAW_expert"], + dimensions="scalar", + defaultval=2.0, + mnemonics="BoX CuT-off MINimum for the Double Grid (PAW)", + requires="[[usepaw]] == 1", + added_in_version="before_v9", + text=r""" The box cut-off ratio is the ratio between the wavefunction plane wave sphere radius, and the radius of the sphere that can be inserted in the FFT box, in reciprocal space. @@ -1212,34 +1258,36 @@ ratio must be much larger than two for the computation to be converged at the required level of accuracy. """, - ), - Variable( - abivarname="cd_customnimfrqs", - varset="gw", - vartype="integer", - topics=["FrequencyMeshMBPT_expert"], - dimensions="scalar", - defaultval=0, - mnemonics="Contour Deformation CUSTOM IMaginary FReQuencieS", - requires="([[optdriver]] ==3 or [[optdriver]] ==4) and [[gwcalctyp]] in [2,9,12,19,22,29]", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="cd_customnimfrqs", + varset="gw", + vartype="integer", + topics=["FrequencyMeshMBPT_expert"], + dimensions="scalar", + defaultval=0, + mnemonics="Contour Deformation CUSTOM IMaginary FReQuencieS", + requires="([[optdriver]] ==3 or [[optdriver]] ==4) and [[gwcalctyp]] in [2,9,12,19,22,29]", + added_in_version="before_v9", + text=r""" [[cd_customnimfrqs]] lets the user define the grid points along the imaginary axis by hand. Set this to the number of frequencies you want. The frequencies are specified with [[cd_imfrqs]]. """, - ), - Variable( - abivarname="cd_frqim_method", - varset="gw", - vartype="integer", - topics=["FrequencyMeshMBPT_expert"], - dimensions="scalar", - defaultval=1, - mnemonics="Contour Deformation FReQuency integration on IMaginary axis Method", - requires="[[optdriver]] ==4 and [[gwcalctyp]] in [2, 9, 12, 19, 22, 29]", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="cd_frqim_method", + varset="gw", + vartype="integer", + topics=["FrequencyMeshMBPT_expert"], + dimensions="scalar", + defaultval=1, + mnemonics="Contour Deformation FReQuency integration on IMaginary axis Method", + requires="[[optdriver]] ==4 and [[gwcalctyp]] in [2, 9, 12, 19, 22, 29]", + added_in_version="before_v9", + text=r""" [[cd_frqim_method]] defines the choice of integration method along the imaginary frequency axis for Contour Deformation calculations. The default method is very robust, fast and optimal for the vast majority of cases. @@ -1326,18 +1374,19 @@ **once** on the dense mesh for a given convergence study. One can also use the utility to merge independent screening calculations over q-points and frequency sections. """, - ), - Variable( - abivarname="cd_full_grid", - varset="gw", - vartype="integer", - topics=["FrequencyMeshMBPT_expert"], - dimensions="scalar", - defaultval=0, - mnemonics="Contour Deformation FULL GRID in complex plane", - requires="[[optdriver]] == 3 and [[gwcalctyp]] in [2, 9, 12, 19, 22, 29]", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="cd_full_grid", + varset="gw", + vartype="integer", + topics=["FrequencyMeshMBPT_expert"], + dimensions="scalar", + defaultval=0, + mnemonics="Contour Deformation FULL GRID in complex plane", + requires="[[optdriver]] == 3 and [[gwcalctyp]] in [2, 9, 12, 19, 22, 29]", + added_in_version="before_v9", + text=r""" [[cd_full_grid]] enables the calculation of the screening [both chi0 and epsilon^(-1)] on a grid in the first quadrant of the complex plane. The grid is determined by the (tensor) product of the grid in real frequency and the @@ -1354,34 +1403,36 @@ SUS and SCR files can be extracted for visualisation and further analysis with the **Mrgscr** utility. """, - ), - Variable( - abivarname="cd_halfway_freq", - varset="gw", - vartype="real", - topics=["FrequencyMeshMBPT_expert"], - dimensions="scalar", - defaultval=ValueWithUnit(units="eV", value=100.0), - mnemonics="Contour Deformation tangent grid HALFWAY FREQuency", - characteristics=["[[ENERGY]]"], - requires="([[optdriver]] == 3 or [[optdriver]] == 4) and [[gwcalctyp]] in [2,9,12,19,22,29]", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="cd_halfway_freq", + varset="gw", + vartype="real", + topics=["FrequencyMeshMBPT_expert"], + dimensions="scalar", + defaultval=ValueWithUnit(units="eV", value=100.0), + mnemonics="Contour Deformation tangent grid HALFWAY FREQuency", + characteristics=["[[ENERGY]]"], + requires="([[optdriver]] == 3 or [[optdriver]] == 4) and [[gwcalctyp]] in [2,9,12,19,22,29]", + added_in_version="before_v9", + text=r""" [[cd_halfway_freq]] determines the frequency where half of the number of points defined in [[nfreqre]] are used up. The tangent transformed grid is approximately linear up to this point. To be used in conjunction with [[gw_frqre_tangrid]]. """, - ), - Variable( - abivarname="cd_imfrqs", - varset="gw", - vartype="real", - topics=["FrequencyMeshMBPT_expert"], - dimensions=["[[cd_customnimfrqs]]"], - mnemonics="Contour Deformation IMaginary FReQuencieS", - requires="[[optdriver]] == 3 and [[gwcalctyp]] in [2, 9, 12, 19, 22, 29] and [[cd_customnimfrqs]] != 0", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="cd_imfrqs", + varset="gw", + vartype="real", + topics=["FrequencyMeshMBPT_expert"], + dimensions=["[[cd_customnimfrqs]]"], + mnemonics="Contour Deformation IMaginary FReQuencieS", + requires="[[optdriver]] == 3 and [[gwcalctyp]] in [2, 9, 12, 19, 22, 29] and [[cd_customnimfrqs]] != 0", + added_in_version="before_v9", + text=r""" [[cd_imfrqs]] specifies the grid points for the imaginary axis. The number of frequencies is set by the value of [[cd_customnimfrqs]]. For example, @@ -1398,34 +1449,36 @@ of the imaginary grid, but rather the grid along the real axis. The calculation of that point should be controlled by [[nfreqre]] and related variables. """, - ), - Variable( - abivarname="cd_max_freq", - varset="gw", - vartype="real", - topics=["FrequencyMeshMBPT_expert"], - dimensions="scalar", - defaultval=ValueWithUnit(units="eV", value=1000.0), - mnemonics="Contour Deformation grid MAXimum FREQuency", - characteristics=["[[ENERGY]]"], - requires="([[optdriver]] == 3 or [[optdriver]] == 4) and [[gwcalctyp]] in [2,9,12,19,22,29]", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="cd_max_freq", + varset="gw", + vartype="real", + topics=["FrequencyMeshMBPT_expert"], + dimensions="scalar", + defaultval=ValueWithUnit(units="eV", value=1000.0), + mnemonics="Contour Deformation grid MAXimum FREQuency", + characteristics=["[[ENERGY]]"], + requires="([[optdriver]] == 3 or [[optdriver]] == 4) and [[gwcalctyp]] in [2,9,12,19,22,29]", + added_in_version="before_v9", + text=r""" [[cd_max_freq]] determines the frequency where all the points defined in [[nfreqre]] are used up. To be used in conjunction with [[gw_frqre_tangrid]]. """, - ), - Variable( - abivarname="cd_subset_freq", - varset="gw", - vartype="integer", - topics=["FrequencyMeshMBPT_expert"], - dimensions=[2], - defaultval=[1, "[[nfreqre]]"], - mnemonics="Contour Deformation grid calculate SUBSET of FREQuencies", - requires="[[optdriver]] == 3 and [[gwcalctyp]] in [2, 9, 12, 19, 22, 29] and [[gw_frqre_tangrid]] == 0", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="cd_subset_freq", + varset="gw", + vartype="integer", + topics=["FrequencyMeshMBPT_expert"], + dimensions=[2], + defaultval=[1, "[[nfreqre]]"], + mnemonics="Contour Deformation grid calculate SUBSET of FREQuencies", + requires="[[optdriver]] == 3 and [[gwcalctyp]] in [2, 9, 12, 19, 22, 29] and [[gw_frqre_tangrid]] == 0", + added_in_version="before_v9", + text=r""" [[cd_subset_freq]] Specifies that only a subset of the frequencies defined by [[nfreqre]] are to be calculated. The first index is the start and the second the end, with index number 1 always being the origin. For example a @@ -1437,17 +1490,18 @@ Any resulting susceptibility (_SUS) and screening (_SCR) files can then be merged with the **mrgscr** utility. """, - ), - Variable( - abivarname="cellcharge", - varset="gstate", - vartype="real", - topics=["Coulomb_basic"], - dimensions=["[[nimage]]"], - defaultval=MultipleValue(number=None, value=0), - mnemonics="CELL CHARGE", - added_in_version="v9.3.4", - text=r""" +), + +Variable( + abivarname="cellcharge", + varset="gstate", + vartype="real", + topics=["Coulomb_basic"], + dimensions=["[[nimage]]"], + defaultval=MultipleValue(number=None, value=0), + mnemonics="CELL CHARGE", + added_in_version="v9.3.4", + text=r""" Used to establish charge balance between the number of electrons filling the bands and the nominal charge associated with the atomic cores. The code adds up the number of valence electrons provided by the @@ -1468,33 +1522,35 @@ so that [[nelect]] is still a scalar. This is consistent with the pSIC algorithm, see [[cite:Sadigh2015]] and [[cite:Sadigh2015a]]. """, - ), - Variable( - abivarname="charge", - varset="gstate", - vartype="real", - topics=["Coulomb_basic"], - dimensions="scalar", - defaultval=0, - mnemonics="CHARGE", - added_in_version="before_v9, obsolete", - text=r""" +), + +Variable( + abivarname="charge", + varset="gstate", + vartype="real", + topics=["Coulomb_basic"], + dimensions="scalar", + defaultval=0, + mnemonics="CHARGE", + added_in_version="before_v9, obsolete", + text=r""" The [[charge]] input variable is obsolete, and has been replaced by [[cellcharge]]. It is still read during a transitional period, likely up to the end of v9 life cycle. """, - ), - Variable( - abivarname="chebfi_oracle", - varset="gstate", - vartype="integer", - topics=["TuningSpeedMem_expert"], - dimensions="scalar", - defaultval="0", - mnemonics="CHEByshev FIltering algorithm ORACLE", - characteristics=["[[DEVELOP]]"], - added_in_version="10.3.4", - requires="[[wfoptalg]] == 111", - text=r""" +), + +Variable( + abivarname="chebfi_oracle", + varset="gstate", + vartype="integer", + topics=["TuningSpeedMem_expert"], + dimensions="scalar", + defaultval="0", + mnemonics="CHEByshev FIltering algorithm ORACLE", + characteristics=["[[DEVELOP]]"], + added_in_version="10.3.4", + requires="[[wfoptalg]] == 111", + text=r""" For the Chebyshev Filtering algorithm, it is possible to estimate the degree of the polynom needed to reach a given precision on the wave-functions. Indeed, as explained in [[cite:Levitt2015]], after the application of the Chebyshev polynomial of order $n$ (noted $T_n(x)$) followed by a Rayleigh-Ritz procedure, the residual $r_i^n$ of the band $i$ can be estimated as: @@ -1541,18 +1597,20 @@ [[chebfi_oracle]] > 0 is implemented for [[wfoptalg]] = 111, but not for [[wfoptalg]] = 1. It is not implemented for GPUs either (i.e. [[gpu_option]] must be 0 or DISABLE). """, - ), - Variable( - abivarname="chempot", - varset="geo", - vartype="real", - topics=["Artificial_expert"], - dimensions=[3, "[[nzchempot]]", "[[ntypat]]"], - defaultval=0.0, - mnemonics="spatially varying CHEMical POTential", - requires="[[nzchempot]] /= 0", - added_in_version="before_v9", - text=r""" +), + + +Variable( + abivarname="chempot", + varset="geo", + vartype="real", + topics=["Artificial_expert"], + dimensions=[3, "[[nzchempot]]", "[[ntypat]]"], + defaultval=0.0, + mnemonics="spatially varying CHEMical POTential", + requires="[[nzchempot]] /= 0", + added_in_version="before_v9", + text=r""" For each type of atoms, from 1 to [[ntypat]], specifies the spatially varying chemical potential, through the specification of [[nzchempot]] triplets of real numbers. They give data for [[nzchempot]] delimiting planes, all parallel @@ -1573,22 +1631,23 @@ values of z, while the second applies to the adjacent space with higher values of z. When the spatial chemical potential is defined only for one type of atom (and no chemical potential is present for the other atoms), simply set the -related values to *0.0 in the [[chempot]] array. In the present input array, +related values to 0.0 in the [[chempot]] array. In the present input array, reduced positions, energies and derivatives of energies are mixed. Hence, although the chemical potential is an energy, one cannot use the usual energy definitions (i.e. the chemical potential is always to be input in Hartree atomic units). """, - ), - Variable( - abivarname="chkdilatmx", - varset="rlx", - vartype="integer", - topics=["GeoOpt_expert"], - dimensions="scalar", - defaultval=1, - mnemonics="CHecK DILATMX", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="chkdilatmx", + varset="rlx", + vartype="integer", + topics=["GeoOpt_expert"], + dimensions="scalar", + defaultval=1, + mnemonics="CHecK DILATMX", + added_in_version="before_v9", + text=r""" If 0, the code will not stop execution if the threshold of [[dilatmx]] is exceeded, it will simply issue a warning. There will be no rescaling. If 1, after tentative rescaling as described in [[dilatmx]], the code will stop execution. @@ -1603,17 +1662,18 @@ should be followed by a more accurate second run from the better geometry with [[chkdilatmx]]=1 and [[dilatmx]] slightly larger than 1, (possibly 1.05). """, - ), - Variable( - abivarname="chkexit", - varset="gstate", - vartype="integer", - topics=["Control_useful"], - dimensions="scalar", - defaultval=0, - mnemonics="CHecK whether the user want to EXIT", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="chkexit", + varset="gstate", + vartype="integer", + topics=["Control_useful"], + dimensions="scalar", + defaultval=0, + mnemonics="CHecK whether the user want to EXIT", + added_in_version="before_v9", + text=r""" If [[chkexit]] is 1 or 2, ABINIT will check whether the user wants to interrupt the run (using the keyword "exit" on the top of the input file or creating a file named "abinit.exit": see the end of section 3.2 @@ -1625,17 +1685,18 @@ In all cases, the check is performed at most every 2 seconds of CPU time. """, - ), - Variable( - abivarname="chkparal", - varset="gstate", - vartype="integer", - topics=["parallelism_useful"], - dimensions="scalar", - defaultval=1, - mnemonics="CHecK whether the PARALlelism is adequate", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="chkparal", + varset="gstate", + vartype="integer", + topics=["parallelism_useful"], + dimensions="scalar", + defaultval=1, + mnemonics="CHecK whether the PARALlelism is adequate", + added_in_version="before_v9", + text=r""" Not all parallelism types or level are allowed or simply relevant for the different [[optdriver]] values in ABINIT. It has been observed that some users do not understand well their relation. In particular, their expectation of the adequacy of some parallelism for some [[optdriver]] value was not correct, with a large loss of computing resources. @@ -1658,17 +1719,18 @@ The relevance of [[paral_atom]] or [[paral_rf]] or [[gwpara]] is not checked at present. The default values should not yield loss of computing power. """, - ), - Variable( - abivarname="chkprim", - varset="gstate", - vartype="integer", - topics=["crystal_useful", "UnitCell_useful", "SmartSymm_useful"], - dimensions="scalar", - defaultval=1, - mnemonics="CHecK whether the cell is PRIMitive", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="chkprim", + varset="gstate", + vartype="integer", + topics=["crystal_useful", "UnitCell_useful", "SmartSymm_useful"], + dimensions="scalar", + defaultval=1, + mnemonics="CHecK whether the cell is PRIMitive", + added_in_version="before_v9", + text=r""" If the symmetry finder is used (see [[nsym]]), a non-zero value of [[chkprim]] will make the code stop if a non-primitive cell is used. If [[chkprim]] = 0, a warning is issued, but the run does not stop. @@ -1676,18 +1738,19 @@ If you are generating the atomic and cell geometry using [[spgroup]], you might generate a PRIMITIVE cell using [[brvltt]] = -1. """, - ), - Variable( - abivarname="chksymbreak", - varset="gstate", - vartype="integer", - topics=["k-points_useful"], - dimensions="scalar", - defaultval=1, - mnemonics="CHecK SYMmetry BREAKing", - characteristics=["[[INPUT_ONLY]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="chksymbreak", + varset="gstate", + vartype="integer", + topics=["k-points_useful"], + dimensions="scalar", + defaultval=1, + mnemonics="CHecK SYMmetry BREAKing", + characteristics=["[[INPUT_ONLY]]"], + added_in_version="before_v9", + text=r""" This variable governs the behaviour of the code when there is a potential source of symmetry breaking related to the k point grid. @@ -1715,18 +1778,19 @@ If you encounter a problem outlined above, you have some choices: change your k point grid, to make it more symmetric, and/or respect [[nshiftk]]=1, 2, or 4, or ignore the problem, and set **chksymbreak** = 0. """, - ), - Variable( - abivarname="chksymtnons", - varset="gstate", - vartype="integer", - topics=["crystal_useful"], - dimensions="scalar", - defaultval=1, - mnemonics="CHecK SYMmetry of TNONS", - characteristics=["[[INPUT_ONLY]]"], - added_in_version="9.2.0", - text=r""" +), + +Variable( + abivarname="chksymtnons", + varset="gstate", + vartype="integer", + topics=["crystal_useful"], + dimensions="scalar", + defaultval=1, + mnemonics="CHecK SYMmetry of TNONS", + characteristics=["[[INPUT_ONLY]]"], + added_in_version="9.2.0", + text=r""" This variable governs the behaviour of the code when there is a potential symmetry breaking, related to the presence of non-symmorphic translations not leaving the FFT exchange-correlation grid invariant. @@ -1773,17 +1837,19 @@ If **chksymtnons** = 2, ABINIT makes a suggestion of a possible global translation, and corresponding translated atomic positions. """, - ), - Variable( - abivarname="chneut", - varset="dfpt", - vartype="integer", - topics=["Phonons_basic"], - dimensions="scalar", - defaultval=1, - mnemonics="CHarge NEUTrality treatment", - added_in_version="before_v9", - text=r""" +), + + +Variable( + abivarname="chneut", + varset="dfpt", + vartype="integer", + topics=["Phonons_basic"], + dimensions="scalar", + defaultval=1, + mnemonics="CHarge NEUTrality treatment", + added_in_version="before_v9", + text=r""" Set the treatment of the Charge Neutrality requirement for the effective charges in the ABINIT code. Same values as the corresponding ANADDB variable [[chneut@anaddb]]. Please switch to this description. Note however the different default value in abinit (1) and anaddb (0). @@ -1800,17 +1866,18 @@ See also the variables [[asr]] and [[asr@anaddb]], that govern the imposition of the acoustic sum rule. """, - ), - Variable( - abivarname="chrgat", - varset="gstate", - vartype="real", - topics=["ConstrainedDFT_useful"], - dimensions=ValueWithConditions({"[[natrd]]<[[natom]]": "[ [[natrd]] ]", "defaultval": "[ [[natom]] ]"}), - defaultval=0.0, - mnemonics="CHARGE of the AToms", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="chrgat", + varset="gstate", + vartype="real", + topics=["ConstrainedDFT_useful"], + dimensions=ValueWithConditions({"[[natrd]]<[[natom]]": "[ [[natrd]] ]", "defaultval": "[ [[natom]] ]"}), + defaultval=0.0, + mnemonics="CHARGE of the AToms", + added_in_version="before_v9", + text=r""" Gives the target integrated charge in case of constrained DFT calculations, see [[constraint_kind]]. Given in atomic unit of charge (=minus the charge of the electron). Note that this number is the net positive charge inside the sphere: one subtract from the @@ -1820,18 +1887,19 @@ is in this case a bias toward too positive integrated charges. By contrast, if the sphere radius is too large, the spheres will overlap, and the electrons in the interatomic region will be double counted. """, - ), - Variable( - abivarname="cineb_start", - varset="rlx", - vartype="integer", - topics=["TransPath_expert"], - dimensions="scalar", - defaultval=7, - mnemonics="Climbing-Image Nudged Elastic Band: STARTing iteration", - requires="[[imgmov]] == 5 and [[neb_algo]] == 2", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="cineb_start", + varset="rlx", + vartype="integer", + topics=["TransPath_expert"], + dimensions="scalar", + defaultval=7, + mnemonics="Climbing-Image Nudged Elastic Band: STARTing iteration", + requires="[[imgmov]] == 5 and [[neb_algo]] == 2", + added_in_version="before_v9", + text=r""" Gives the index of the first CI-NEB iteration. The CI-NEB method constitutes a small modification to the NEB method allowing a rigorous convergence to the saddle point. As the image with the highest @@ -1839,18 +1907,19 @@ the standard NEB algorithm. The effective CI-NEB begins at the [[cineb_start]] iteration. See [[cite:Henkelman2000a]] for additional details of this method. """, - ), - Variable( - abivarname="constraint_kind", - varset="gstate", - vartype="integer", - topics=["ConstrainedDFT_basic"], - dimensions=["[[ntypat]]"], - defaultval=0, - mnemonics="CONSTRAINT KIND in constrained DFT", - requires="[[iscf]] > 1 and [[iscf]] < 10 and [[ionmov]] /= 4", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="constraint_kind", + varset="gstate", + vartype="integer", + topics=["ConstrainedDFT_basic"], + dimensions=["[[ntypat]]"], + defaultval=0, + mnemonics="CONSTRAINT KIND in constrained DFT", + requires="[[iscf]] > 1 and [[iscf]] < 10 and [[ionmov]] /= 4", + added_in_version="before_v9", + text=r""" If [[constraint_kind]] is non-zero for at least one type of atom, the constrained DFT algorithm [[cite:Gonze2022]] is activated. [[constraint_kind]] defines, for each type of atom, the kind of constraint(s) imposed by constrained DFT. @@ -1893,18 +1962,19 @@ Incidentally, [[ionmov]]==4 is not allowed in the present implementation of constrained DFT because the motion of atoms and simultaneous computation of constraints would be difficult to handle. """, - ), - Variable( - abivarname="cprj_in_memory", - varset="gstate", - vartype="integer", - topics=["TuningSpeedMem_expert"], - dimensions="scalar", - defaultval="0", - mnemonics="C-PRoJectors IN MEMORY", - characteristics=["[[DEVELOP]]"], - added_in_version="10.2.0", - text=r""" +), + +Variable( + abivarname="cprj_in_memory", + varset="gstate", + vartype="integer", + topics=["TuningSpeedMem_expert"], + dimensions="scalar", + defaultval="0", + mnemonics="C-PRoJectors IN MEMORY", + characteristics=["[[DEVELOP]]"], + added_in_version="10.2.0", + text=r""" For systems with many atoms, non-local operations are the most time-consuming part of the computation. The non-local contribution of the wavefunction $\psi$ to the energy writes: @@ -1952,18 +2022,19 @@ For [[cprj_in_memory]] = 2, see [[cprj_update_lvl]] for a fine tuning of "cprj" updates (i.e. when they are computed directly from wavefunctions). """, - ), - Variable( - abivarname="cprj_update_lvl", - varset="dev", - vartype="integer", - topics=["TuningSpeedMem_expert"], - dimensions="scalar", - defaultval=0, - mnemonics="C-PRoJectors UPDATE LeVeL", - characteristics=["[[DEVELOP]]"], - added_in_version="", - text=r""" +), + +Variable( + abivarname="cprj_update_lvl", + varset="dev", + vartype="integer", + topics=["TuningSpeedMem_expert"], + dimensions="scalar", + defaultval=0, + mnemonics="C-PRoJectors UPDATE LeVeL", + characteristics=["[[DEVELOP]]"], + added_in_version="", + text=r""" This variable is used to control the updates of "cprj" coefficients, which are kept in memory during the computation: $$ cprj(a,i) = $$ @@ -2000,19 +2071,20 @@ Places D and E are activated only for negative values of [[cprj_update_lvl]] and should be used only for debugging. One can count the number of non-local operations done in a dataset using [[nonlop_ylm_count]] to precisely measure the effect of [[cprj_update_lvl]]. """, - ), - Variable( - abivarname="cpuh", - varset="gstate", - vartype="real", - topics=["Control_useful"], - dimensions="scalar", - defaultval=0.0, - mnemonics="CPU time limit in Hours", - characteristics=["[[NO_MULTI]]", "[[INPUT_ONLY]]"], - excludes="[[cpum]] or [[cpus]]", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="cpuh", + varset="gstate", + vartype="real", + topics=["Control_useful"], + dimensions="scalar", + defaultval=0.0, + mnemonics="CPU time limit in Hours", + characteristics=["[[NO_MULTI]]", "[[INPUT_ONLY]]"], + excludes="[[cpum]] or [[cpus]]", + added_in_version="before_v9", + text=r""" Only one of the three real parameters [[cpus]], [[cpum]] and [[cpuh]] can be defined in the input file to set up a CPU time limit. When the job reaches that limit, it will try to end smoothly. However, note that this might still @@ -2034,19 +2106,20 @@ Use `abinit --help` for further information. """, - ), - Variable( - abivarname="cpum", - varset="gstate", - vartype="real", - topics=["Control_useful"], - dimensions="scalar", - defaultval=0.0, - mnemonics="CPU time limit in Minutes", - characteristics=["[[NO_MULTI]]", "[[INPUT_ONLY]]"], - excludes="[[cpuh]] or [[cpus]]", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="cpum", + varset="gstate", + vartype="real", + topics=["Control_useful"], + dimensions="scalar", + defaultval=0.0, + mnemonics="CPU time limit in Minutes", + characteristics=["[[NO_MULTI]]", "[[INPUT_ONLY]]"], + excludes="[[cpuh]] or [[cpus]]", + added_in_version="before_v9", + text=r""" Only one of the three real parameters [[cpus]], [[cpum]] and [[cpuh]] can be defined in the input file to set up a CPU time limit. When the job reaches that limit, it will try to end smoothly. However, note that this might still @@ -2055,19 +2128,20 @@ into account should come with experience. A zero value has no action of the job. """, - ), - Variable( - abivarname="cpus", - varset="gstate", - vartype="real", - topics=["Control_useful"], - dimensions="scalar", - defaultval=0.0, - mnemonics="CPU time limit in seconds", - characteristics=["[[NO_MULTI]]", "[[INPUT_ONLY]]"], - excludes="[[cpuh]] or [[cpum]]", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="cpus", + varset="gstate", + vartype="real", + topics=["Control_useful"], + dimensions="scalar", + defaultval=0.0, + mnemonics="CPU time limit in seconds", + characteristics=["[[NO_MULTI]]", "[[INPUT_ONLY]]"], + excludes="[[cpuh]] or [[cpum]]", + added_in_version="before_v9", + text=r""" Only one of the three real parameters [[cpus]], [[cpum]] and [[cpuh]] can be defined in the input file to set up a CPU time limit. When the job reaches that limit, it will try to end smoothly. However, note that this might still @@ -2076,220 +2150,348 @@ into account should come with experience. A zero value has no action of the job. """, - ), - Variable( - abivarname="d3e_pert1_atpol", - varset="dfpt", - vartype="integer", - topics=["nonlinear_basic"], - dimensions=[2], - defaultval=[1, "[[natom]]"], - mnemonics="3rd Derivative of Energy, mixed PERTurbation 1: limits of ATomic POLarisations", - requires="[[optdriver]] == 5 (non-linear response computations)", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="d3e_pert1_atpol", + varset="dfpt", + vartype="integer", + topics=["nonlinear_basic", "ConstrainedDFPT_basic"], + dimensions=[2], + defaultval=[1, "[[natom]]" ], + mnemonics="3rd Derivative of Energy, mixed PERTurbation 1: limits of ATomic POLarisations", + requires="[[optdriver]] == 5 (non-linear response computations)", + added_in_version="before_v9", + text=r""" Controls the range of atoms for which displacements will be considered in non-linear computations (using the 2n+1 theorem), for the 1st perturbation. May take values from 1 to [[natom]], with **d3e_pert1_atpol** (1)<= **d3e_pert1_atpol** (2). See [[rfatpol]] for additional details. """, - ), - Variable( - abivarname="d3e_pert1_dir", - varset="dfpt", - vartype="integer", - topics=["nonlinear_basic"], - dimensions=[3], - defaultval=[1, 1, 1], - mnemonics="3rd Derivative of Energy, mixed PERTurbation 1: DIRections", - requires="[[optdriver]] == 5 (non-linear response computations)", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="d3e_pert1_dir", + varset="dfpt", + vartype="integer", + topics=["nonlinear_basic", "ConstrainedDFPT_basic"], + dimensions=[3], + defaultval=[1, 1, 1], + mnemonics="3rd Derivative of Energy, mixed PERTurbation 1: DIRections", + requires="[[optdriver]] == 5 (non-linear response computations)", + added_in_version="before_v9", + text=r""" Gives the directions to be considered in non-linear computations (using the 2n+1 theorem), for the 1st perturbation. The three elements corresponds to the three primitive vectors, either in real space (atomic displacement), or in reciprocal space (electric field perturbation). See [[rfdir]] for additional details. """, - ), - Variable( - abivarname="d3e_pert1_elfd", - varset="dfpt", - vartype="integer", - topics=["nonlinear_basic"], - dimensions="scalar", - defaultval=0, - mnemonics="3rd Derivative of Energy, mixed PERTurbation 1: ELectric FielD", - requires="[[optdriver]] == 5 (non-linear response computations)", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="d3e_pert1_elfd", + varset="dfpt", + vartype="integer", + topics=["nonlinear_basic", "ConstrainedDFPT_basic"], + dimensions="scalar", + defaultval=0, + mnemonics="3rd Derivative of Energy, mixed PERTurbation 1: ELectric FielD", + requires="[[optdriver]] == 5 (non-linear response computations)", + added_in_version="before_v9", + text=r""" Turns on electric field perturbation in non-linear computation, as 1st perturbation. Actually, such calculations requires first the non-self- consistent calculation of derivatives with respect to k, independently of the electric field perturbation itself. See [[rfelfd]] for additional details. """, - ), - Variable( - abivarname="d3e_pert1_phon", - varset="dfpt", - vartype="integer", - topics=["nonlinear_basic"], - dimensions="scalar", - defaultval=0, - mnemonics="3rd Derivative of Energy, mixed PERTurbation 1: PHONons", - requires="[[optdriver]] == 5 (non-linear response computations)", - added_in_version="before_v9", - text=r""" +), + + +Variable( + abivarname="d3e_pert1_magat", + varset="dfpt", + vartype="integer", + topics=["longwave_expert", "ConstrainedDFPT_expert"], + dimensions=[2], + defaultval=MultipleValue(number=1, value="[[natom]]"), + mnemonics="3rd Derivative of Energy, mixed PERTurbation 1: limits of local MAGnetic fields on ATomic spheres", + requires="[[optdriver]] == 10 and [[timdisp]]==1 (time-dispersion calculation)", + characteristics=["[[DEVELOP]]"], + added_in_version="10.4", + text=r""" +Controls the range of atoms for which local Zeeman fields will be considered in time-dispersion +(Berry curvatures) computation, for the 1st perturbation. +May take values from 1 to [[natom]], with **d3e_pert1_magat** (1)<= +**d3e_pert1_magat** (2). +""", +), + + +Variable( + abivarname="d3e_pert1_magdir", + varset="dfpt", + vartype="integer", + topics=["longwave_expert", "ConstrainedDFPT_expert"], + dimensions=[3], + defaultval=[1, 1, 1], + mnemonics="3rd Derivative of Energy, mixed PERTurbation 1: MAGnetic field DIRections", + requires="[[optdriver]] == 10 and [[timdisp]]==1 (time-dispersion calculation)", + characteristics=["[[DEVELOP]]"], + added_in_version="10.4", + text=r""" +Gives the Cartesian directions to be considered in the time-dispersion (Berry curvatures) computation, +for the 1st perturbation. +""", +), + +Variable( + abivarname="d3e_pert1_magn", + varset="dfpt", + vartype="integer", + topics=["longwave_expert", "ConstrainedDFPT_expert"], + dimensions="scalar", + defaultval=0, + mnemonics="3rd Derivative of Energy, mixed PERTurbation 1: MAGNetic field", + requires="[[optdriver]] == 10 and [[timdisp]]==1 (time-dispersion calculation)", + characteristics=["[[DEVELOP]]"], + added_in_version="10.4", + text=r""" +Turns on magnetic field perturbations in time-dispersion (Berry-curvatures) computation, as 1st +perturbation. Can take two values: + + * 1 --> Uniform Zeeman field perturbation along Cartesian directions set by [[d3e_pert1_magdir]] + * 2 --> Local Zeeman field perturbation to atoms and Cartesian directions set by [[d3e_pert1_magat]] and [[d3e_pert1_magdir]], respectively. +""", +), + +Variable( + abivarname="d3e_pert1_phon", + varset="dfpt", + vartype="integer", + topics=["nonlinear_basic", "ConstrainedDFPT_basic"], + dimensions="scalar", + defaultval=0, + mnemonics="3rd Derivative of Energy, mixed PERTurbation 1: PHONons", + requires="[[optdriver]] == 5 (non-linear response computations)", + added_in_version="before_v9", + text=r""" Turns on atomic displacement perturbation in non-linear computation, as 1st perturbation. See [[rfphon]] for additional details. """, - ), - Variable( - abivarname="d3e_pert2_atpol", - varset="dfpt", - vartype="integer", - topics=["nonlinear_basic"], - dimensions=[2], - defaultval=[1, "[[natom]]"], - mnemonics="3rd Derivative of Energy, mixed PERTurbation 2: limits of ATomic POLarisations", - requires="[[optdriver]] == 5 (non-linear response computations)", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="d3e_pert2_atpol", + varset="dfpt", + vartype="integer", + topics=["nonlinear_basic", "ConstrainedDFPT_basic"], + dimensions=[2], + defaultval=[1, "[[natom]]" ], + mnemonics="3rd Derivative of Energy, mixed PERTurbation 2: limits of ATomic POLarisations", + requires="[[optdriver]] == 5 (non-linear response computations)", + added_in_version="before_v9", + text=r""" Controls the range of atoms for which displacements will be considered in non- linear computations (using the 2n+1 theorem), for the 2nd perturbation. May take values from 1 to [[natom]], with **d3e_pert2_atpol** (1) <= **d3e_pert2_atpol** (2). See [[rfatpol]] for additional details. """, - ), - Variable( - abivarname="d3e_pert2_dir", - varset="dfpt", - vartype="integer", - topics=["nonlinear_basic"], - dimensions=[3], - defaultval=[0, 0, 0], - mnemonics="3rd Derivative of Energy, mixed PERTurbation 2: DIRections", - requires="[[optdriver]] == 5 (non-linear response computations)", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="d3e_pert2_dir", + varset="dfpt", + vartype="integer", + topics=["nonlinear_basic", "ConstrainedDFPT_basic"], + dimensions=[3], + defaultval=[0, 0, 0], + mnemonics="3rd Derivative of Energy, mixed PERTurbation 2: DIRections", + requires="[[optdriver]] == 5 (non-linear response computations)", + added_in_version="before_v9", + text=r""" Gives the directions to be considered in non-linear computations (using the 2n+1 theorem), for the 2nd perturbation. The three elements corresponds to the three primitive vectors, either in real space (atomic displacement), or in reciprocal space (electric field perturbation). See [[rfdir]] for additional details. """, - ), - Variable( - abivarname="d3e_pert2_elfd", - varset="dfpt", - vartype="integer", - topics=["nonlinear_basic"], - dimensions="scalar", - defaultval=0, - mnemonics="3rd Derivative of Energy, mixed PERTurbation 2: ELectric FielD", - requires="[[optdriver]] == 5 (non-linear response computations)", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="d3e_pert2_elfd", + varset="dfpt", + vartype="integer", + topics=["nonlinear_basic"], + dimensions="scalar", + defaultval=0, + mnemonics="3rd Derivative of Energy, mixed PERTurbation 2: ELectric FielD", + requires="[[optdriver]] == 5 (non-linear response computations)", + added_in_version="before_v9", + text=r""" Turns on electric field perturbation in non-linear computation, as 2nd perturbation. Actually, such calculations requires first the non-self- consistent calculation of derivatives with respect to k, independently of the electric field perturbation itself. See [[rfelfd]] for additional details. """, - ), - Variable( - abivarname="d3e_pert2_phon", - varset="dfpt", - vartype="integer", - topics=["nonlinear_basic"], - dimensions="scalar", - defaultval=0, - mnemonics="3rd Derivative of Energy, mixed PERTurbation 2: PHONons", - requires="[[optdriver]] == 5 (non-linear response computations)", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="d3e_pert2_magat", + varset="dfpt", + vartype="integer", + topics=["longwave_expert", "ConstrainedDFPT_expert"], + dimensions=[2], + defaultval=MultipleValue(number=1, value="[[natom]]"), + mnemonics="3rd Derivative of Energy, mixed PERTurbation 2: limits of local MAGnetic fields on ATomic spheres", + requires="[[optdriver]] == 10 and [[timdisp]]==1 (time-dispersion calculation)", + characteristics=["[[DEVELOP]]"], + added_in_version="10.4", + text=r""" +Controls the range of atoms for which local Zeeman fields will be considered in time-dispersion +(Berry curvatures) computation, for the 2nd perturbation. +May take values from 1 to [[natom]], with **d3e_pert2_magat** (1)<= +**d3e_pert2_magat** (2). +""", +), + + +Variable( + abivarname="d3e_pert2_magdir", + varset="dfpt", + vartype="integer", + topics=["longwave_expert", "ConstrainedDFPT_expert"], + dimensions=[3], + defaultval=[1, 1, 1], + mnemonics="3rd Derivative of Energy, mixed PERTurbation 2: MAGnetic field DIRections", + requires="[[optdriver]] == 10 and [[timdisp]]==1 (time-dispersion calculation)", + characteristics=["[[DEVELOP]]"], + added_in_version="10.4", + text=r""" +Gives the Cartesian directions to be considered in the time-dispersion (Berry curvatures) computation, +for the 2nd perturbation. +""", +), + +Variable( + abivarname="d3e_pert2_magn", + varset="dfpt", + vartype="integer", + topics=["longwave_expert", "ConstrainedDFPT_expert"], + dimensions="scalar", + defaultval=0, + mnemonics="3rd Derivative of Energy, mixed PERTurbation 2: MAGNetic field", + requires="[[optdriver]] == 10 and [[timdisp]]==1 (time-dispersion calculation)", + characteristics=["[[DEVELOP]]"], + added_in_version="10.4", + text=r""" +Turns on magnetic field perturbations in time-dispersion (Berry-curvatures) computation, as 2nd +perturbation. Can take two values: + + * 1 --> Uniform Zeeman field perturbation along Cartesian directions set by [[d3e_pert2_magdir]] + * 2 --> Local Zeeman field perturbation to atoms and Cartesian directions set by [[d3e_pert2_magat]] and [[d3e_pert2_magdir]], respectively. +""", +), + +Variable( + abivarname="d3e_pert2_phon", + varset="dfpt", + vartype="integer", + topics=["nonlinear_basic", "ConstrainedDFPT_basic"], + dimensions="scalar", + defaultval=0, + mnemonics="3rd Derivative of Energy, mixed PERTurbation 2: PHONons", + requires="[[optdriver]] == 5 (non-linear response computations)", + added_in_version="before_v9", + text=r""" Turns on atomic displacement perturbation in non-linear computation, as 2nd perturbation. See [[rfphon]] for additional details. """, - ), - Variable( - abivarname="d3e_pert3_atpol", - varset="dfpt", - vartype="integer", - topics=["nonlinear_basic"], - dimensions=[2], - defaultval=[1, "[[natom]]"], - mnemonics="3rd Derivative of Energy, mixed PERTurbation 3: limits of ATomic POLarisations", - requires="[[optdriver]] == 5 (non-linear response computations)", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="d3e_pert3_atpol", + varset="dfpt", + vartype="integer", + topics=["nonlinear_basic"], + dimensions=[2], + defaultval=[1, "[[natom]]" ], + mnemonics="3rd Derivative of Energy, mixed PERTurbation 3: limits of ATomic POLarisations", + requires="[[optdriver]] == 5 (non-linear response computations)", + added_in_version="before_v9", + text=r""" Controls the range of atoms for which displacements will be considered in non- linear computations (using the 2n+1 theorem), for the 3rd perturbation. May take values from 1 to [[natom]], with **d3e_pert3_atpol** (1)<= **d3e_pert3_atpol** (2). See [[rfatpol]] for additional details. """, - ), - Variable( - abivarname="d3e_pert3_dir", - varset="dfpt", - vartype="integer", - topics=["nonlinear_basic"], - dimensions=[3], - defaultval=[0, 0, 0], - mnemonics="3rd Derivative of Energy, mixed PERTurbation 3: DIRections", - requires="[[optdriver]] == 5 (non-linear response computations)", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="d3e_pert3_dir", + varset="dfpt", + vartype="integer", + topics=["nonlinear_basic"], + dimensions=[3], + defaultval=[0, 0, 0], + mnemonics="3rd Derivative of Energy, mixed PERTurbation 3: DIRections", + requires="[[optdriver]] == 5 (non-linear response computations)", + added_in_version="before_v9", + text=r""" Gives the directions to be considered in non-linear computations (using the 2n+1 theorem), for the 3rd perturbation. The three elements corresponds to the three primitive vectors, either in real space (atomic displacement), or in reciprocal space (electric field perturbation). See [[rfdir]] for additional details. """, - ), - Variable( - abivarname="d3e_pert3_elfd", - varset="dfpt", - vartype="integer", - topics=["nonlinear_basic"], - dimensions="scalar", - defaultval=0, - mnemonics="3rd Derivative of Energy, mixed PERTurbation 3: ELectric FielD", - requires="[[optdriver]] == 5 (non-linear response computations)", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="d3e_pert3_elfd", + varset="dfpt", + vartype="integer", + topics=["nonlinear_basic"], + dimensions="scalar", + defaultval=0, + mnemonics="3rd Derivative of Energy, mixed PERTurbation 3: ELectric FielD", + requires="[[optdriver]] == 5 (non-linear response computations)", + added_in_version="before_v9", + text=r""" Turns on electric field perturbation in non-linear computation, as 3rd perturbation. Actually, such calculations requires first the non-self- consistent calculation of derivatives with respect to k, independently of the electric field perturbation itself. See [[rfelfd]] for additional details. """, - ), - Variable( - abivarname="d3e_pert3_phon", - varset="dfpt", - vartype="integer", - topics=["nonlinear_basic"], - dimensions="scalar", - defaultval=0, - mnemonics="3rd Derivative of Energy, mixed PERTurbation 3: PHONons", - requires="[[optdriver]] == 5 (non-linear response computations)", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="d3e_pert3_phon", + varset="dfpt", + vartype="integer", + topics=["nonlinear_basic"], + dimensions="scalar", + defaultval=0, + mnemonics="3rd Derivative of Energy, mixed PERTurbation 3: PHONons", + requires="[[optdriver]] == 5 (non-linear response computations)", + added_in_version="before_v9", + text=r""" Turns on atomic displacement perturbation in non-linear computation, as 3rd perturbation. See [[rfphon]] for additional details. """, - ), - Variable( - abivarname="ddamp", - varset="ffield", - vartype="real", - topics=["Berry_useful"], - dimensions="scalar", - defaultval=0.1, - mnemonics="electric Displacement field DAMPing parameter", - requires="[[berryopt]] in [6, 16]", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="ddamp", + varset="ffield", + vartype="real", + topics=["Berry_useful"], + dimensions="scalar", + defaultval=0.1, + mnemonics="electric Displacement field DAMPing parameter", + requires="[[berryopt]] in [6, 16]", + added_in_version="before_v9", + text=r""" In case [[berryopt]] = 6, the electric field is updated after each SCF iteration according to $E_{n+1}=$[[ddamp]]$(D-4 \pi P_{n})+(1-$[[ddamp]]$)E_{n}$, where $P_{n}$ and $E_{n}$ are the polarization and electric field after $n_{th}$ SCF @@ -2300,47 +2502,50 @@ maxestep. This parameter is used in finite electric displacement field calculations (berryopt=6,16,17). """, - ), - Variable( - abivarname="ddb_ngqpt", - varset="eph", - vartype="integer", - topics=["ElPhonInt_basic"], - dimensions=[3], - defaultval=[0, 0, 0], - mnemonics="Derivative DataBase: Number of Grid points for Q-PoinTs", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="ddb_ngqpt", + varset="eph", + vartype="integer", + topics=["ElPhonInt_basic"], + dimensions=[3], + defaultval=[0, 0, 0], + mnemonics="Derivative DataBase: Number of Grid points for Q-PoinTs", + added_in_version="before_v9", + text=r""" This variable is mandatory when [[optdriver]] == 7. It defines the number of divisions in the (homogeneous) q-mesh used to generate the DDB file. See also the description of the [[getddb]], [[getddb_filepath]] input variables. """, - ), - Variable( - abivarname="ddb_shiftq", - varset="eph", - vartype="real", - topics=["ElPhonInt_expert"], - dimensions=[3], - defaultval=[0.0, 0.0, 0.0], - mnemonics="Derivative DataBase: SHIFT of the Q-points", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="ddb_shiftq", + varset="eph", + vartype="real", + topics=["ElPhonInt_expert"], + dimensions=[3], + defaultval=[0.0, 0.0, 0.0], + mnemonics="Derivative DataBase: SHIFT of the Q-points", + added_in_version="before_v9", + text=r""" Only relevant when [[optdriver]] == 7. It defines the shift in the q-mesh used to generate the DDB file, which is defined by the [[ddb_ngqpt]] input variable. See [[shiftk]] for more information on the definition. """, - ), - Variable( - abivarname="delayperm", - varset="rlx", - vartype="integer", - topics=["MolecularDynamics_expert"], - dimensions="scalar", - defaultval=0, - mnemonics="DELAY between trials to PERMUTE atoms", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="delayperm", + varset="rlx", + vartype="integer", + topics=["MolecularDynamics_expert"], + dimensions="scalar", + defaultval=0, + mnemonics="DELAY between trials to PERMUTE atoms", + added_in_version="before_v9", + text=r""" Delay (number of time steps) between trials to permute two atoms, in view of accelerated search of minima. Still in development. @@ -2348,19 +2553,20 @@ When [[delayperm]] is zero, there are no permutation trials. """, - ), - Variable( - abivarname="densfor_pred", - varset="dev", - vartype="integer", - topics=["SCFAlgorithms_expert", "MolecularDynamics_expert"], - dimensions="scalar", - defaultval=ValueWithConditions({"[[paral_kgb]] == 1": "6", "defaultval": 2}), - mnemonics="DENSity and FORces PREDictor", - characteristics=["[[DEVELOP]]"], - requires="[[iscf]] > 0", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="densfor_pred", + varset="dev", + vartype="integer", + topics=["SCFAlgorithms_expert", "MolecularDynamics_expert"], + dimensions="scalar", + defaultval=ValueWithConditions({"[[paral_kgb]] == 1": "6", "defaultval": 2}), + mnemonics="DENSity and FORces PREDictor", + characteristics=["[[DEVELOP]]"], + requires="[[iscf]] > 0", + added_in_version="before_v9", + text=r""" Used when [[iscf]] > 0, to define: - the way a change of density is derived from a change of atomic position, @@ -2419,18 +2625,19 @@ Also note that, to be efficient, this algorithm requires a minimum convergence of the SCF cycle; Typically, vres2 (or nres2) has to be small enough (let's say smaller than 10e-4). """, - ), - Variable( - abivarname="densty", - varset="dev", - vartype="real", - topics=["xc_expert"], - dimensions=["[[ntypat]]"], - defaultval=0.0, - mnemonics="initial DENSity for each TYpe of atom", - characteristics=["[[DEVELOP]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="densty", + varset="dev", + vartype="real", + topics=["xc_expert"], + dimensions=["[[ntypat]]"], + defaultval=0.0, + mnemonics="initial DENSity for each TYpe of atom", + characteristics=["[[DEVELOP]]"], + added_in_version="before_v9", + text=r""" Gives a rough description of the initial GS density, for each type of atom. This value is used to create the first exchange and correlation potential. Afterwards, it is not used anymore, except in cases related to [[densfor_pred]]. @@ -2439,34 +2646,36 @@ If set to 0.0, a tabulated value is used, announced as a 'decay length' in the log file. No meaning for RF calculations or any calculation in which a starting density is taken as input. """, - ), - Variable( - abivarname="dfield", - varset="ffield", - vartype="real", - topics=["Berry_basic"], - dimensions=[3], - defaultval=MultipleValue(number=3, value=0.0), - mnemonics="Displacement FIELD", - requires="[[berryopt]] == 6 and [[efield]]", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="dfield", + varset="ffield", + vartype="real", + topics=["Berry_basic"], + dimensions=[3], + defaultval=MultipleValue(number=3, value=0.0), + mnemonics="Displacement FIELD", + requires="[[berryopt]] == 6 and [[efield]]", + added_in_version="before_v9", + text=r""" In case [[berryopt]] = 6, [[dfield]] specifies the (unreduced) finite electric displacement field vector, in atomic units, that is to be imposed as a constraint during the calculation. """, - ), - Variable( - abivarname="dfpt_sciss", - varset="dfpt", - vartype="real", - topics=["DFPT_useful"], - dimensions="scalar", - defaultval=0, - mnemonics="DFPT SCISSor operator", - characteristics=["[[ENERGY]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="dfpt_sciss", + varset="dfpt", + vartype="real", + topics=["DFPT_useful"], + dimensions="scalar", + defaultval=0, + mnemonics="DFPT SCISSor operator", + characteristics=["[[ENERGY]]"], + added_in_version="before_v9", + text=r""" It is the value of the "scissors operator" [[cite:Levine1989]], the shift of conduction band eigenvalues, used in response function calculations. Can be specified in Ha (the default), Ry, eV or Kelvin, since [[ecut]] has the @@ -2474,18 +2683,19 @@ Typical use is for response to electric field ([[rfelfd]] = 3), but NOT for d/dk ([[rfelfd]] = 2) and phonon responses. """, - ), - Variable( - abivarname="diecut", - varset="gstate", - vartype="real", - topics=["SCFAlgorithms_expert"], - dimensions="scalar", - defaultval=2.2, - mnemonics="DIElectric matrix energy CUToff", - characteristics=["[[ENERGY]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="diecut", + varset="gstate", + vartype="real", + topics=["SCFAlgorithms_expert"], + dimensions="scalar", + defaultval=2.2, + mnemonics="DIElectric matrix energy CUToff", + characteristics=["[[ENERGY]]"], + added_in_version="before_v9", + text=r""" Kinetic energy cutoff that controls the number of planewaves used to represent the dielectric matrix: $(1/2) [ 2 \pi \GG_{diel,max}]^2$ =[[diecut]] with $\GG_{diel,max}$ being the maximum @@ -2503,18 +2713,19 @@ No meaning for RF calculations yet. """, - ), - Variable( - abivarname="diegap", - varset="gstate", - vartype="real", - topics=["SCFAlgorithms_expert"], - dimensions="scalar", - defaultval=0.1, - mnemonics="DIElectric matrix GAP", - characteristics=["[[ENERGY]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="diegap", + varset="gstate", + vartype="real", + topics=["SCFAlgorithms_expert"], + dimensions="scalar", + defaultval=0.1, + mnemonics="DIElectric matrix GAP", + characteristics=["[[ENERGY]]"], + added_in_version="before_v9", + text=r""" Gives a rough estimation of the dielectric gap between the highest energy level computed in the run, and the set of bands not represented. Used to extrapolate dielectric matrix when [[iprcel]] >= 21. @@ -2523,35 +2734,37 @@ No meaning for RF calculations yet. """, - ), - Variable( - abivarname="dielam", - varset="gstate", - vartype="real", - topics=["SCFAlgorithms_expert"], - dimensions="scalar", - defaultval=0.5, - mnemonics="DIElectric matrix LAMbda", - requires="[[iprcel]] >= 21", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="dielam", + varset="gstate", + vartype="real", + topics=["SCFAlgorithms_expert"], + dimensions="scalar", + defaultval=0.5, + mnemonics="DIElectric matrix LAMbda", + requires="[[iprcel]] >= 21", + added_in_version="before_v9", + text=r""" Gives the amount of occupied states with mean energy given by the highest level computed in the run, included in the extrapolation of the dielectric matrix. No meaning for RF calculations yet. """, - ), - Variable( - abivarname="dielng", - varset="gstate", - vartype="real", - topics=["SCFAlgorithms_useful"], - dimensions="scalar", - defaultval="1.0774841", - mnemonics="model DIElectric screening LeNGth", - characteristics=["[[LENGTH]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="dielng", + varset="gstate", + vartype="real", + topics=["SCFAlgorithms_useful"], + dimensions="scalar", + defaultval="1.0774841", + mnemonics="model DIElectric screening LeNGth", + characteristics=["[[LENGTH]]"], + added_in_version="before_v9", + text=r""" Used for screening length (in Bohr) of the model dielectric function, diagonal in reciprocal space. By default, given in Bohr atomic units (1 Bohr=0.5291772108 Angstrom), although Angstrom can be specified, if preferred, @@ -2580,17 +2793,18 @@ screening will be more effective, so that [[dielng]] has to be decreased by a factor of 2-4. This works for GS and RF calculations. """, - ), - Variable( - abivarname="diemac", - varset="gstate", - vartype="real", - topics=["SCFAlgorithms_useful"], - dimensions="scalar", - defaultval=1000000.0, - mnemonics="model DIElectric MACroscopic constant", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="diemac", + varset="gstate", + vartype="real", + topics=["SCFAlgorithms_useful"], + dimensions="scalar", + defaultval=1000000.0, + mnemonics="model DIElectric MACroscopic constant", + added_in_version="before_v9", + text=r""" A rough knowledge of the macroscopic dielectric constant [[diemac]] of the system is a useful help to speed-up the SCF procedure: a model dielectric function, see the keyword [[dielng]], is used for that purpose. It is @@ -2613,20 +2827,21 @@ For response function calculations, use the same values as for GS. The improvement in speed can be considerable for small (but non-zero) values of the wavevector. """, - ), - Variable( - abivarname="diemix", - varset="gstate", - vartype="real", - topics=["SCFAlgorithms_useful"], - dimensions="scalar", - defaultval=ValueWithConditions( - {"[[usepaw]] == 0 or [[iprcel]] !=0": 1.0, "[[usepaw]] == 1 or [[iprcel]] == 0": 0.7, "defaultval": None} - ), - mnemonics="model DIElectric MIXing factor", - requires="[[diemix]] >= 0.0 and [[diemix]] <= 1.0", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="diemix", + varset="gstate", + vartype="real", + topics=["SCFAlgorithms_useful"], + dimensions="scalar", + defaultval=ValueWithConditions({"[[usepaw]] == 0 or [[iprcel]] !=0": 1.0, + "[[usepaw]] == 1 or [[iprcel]] == 0": 0.7, + "defaultval": None}), + mnemonics="model DIElectric MIXing factor", + requires="[[diemix]] >= 0.0 and [[diemix]] <= 1.0", + added_in_version="before_v9", + text=r""" Gives overall factor of the preconditioned residual density/potential to be transferred in the SCF cycle. It should be between 0.0 and 1.0. @@ -2641,24 +2856,21 @@ compute their own mixing factor for self-consistency. Also note that a different value of diemix can be used for the magnetization (see [[diemixmag]]). """, - ), - Variable( - abivarname="diemixmag", - varset="gstate", - vartype="real", - topics=["spinpolarisation_useful"], - dimensions="scalar", - defaultval=ValueWithConditions( - { - "70 < [[iprcel]] and [[iprcel]] < 80": "[[diemix]]", - "[[iprcel]] == 0": "[[diemix]]", - "[[iscf]]<10": "[[diemix]]", - "defaultval": "-[[diemix]]", - } - ), - mnemonics="model DIElectric MIXing factor for the MAGgnetization", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="diemixmag", + varset="gstate", + vartype="real", + topics=["spinpolarisation_useful"], + dimensions="scalar", + defaultval=ValueWithConditions({"70 < [[iprcel]] and [[iprcel]] < 80": "[[diemix]]", + "[[iprcel]] == 0": "[[diemix]]", + "[[iscf]]<10": "[[diemix]]", + "defaultval": "-[[diemix]]"}), + mnemonics="model DIElectric MIXing factor for the MAGgnetization", + added_in_version="before_v9", + text=r""" Gives overall factor of the preconditioned residual magnetization/magnetic field to be transferred in the SCF cycle (see [[diemix]] for further information). @@ -2672,32 +2884,34 @@ In particular [[diemixmag]] = -4 is a good choice (i.e. [[diemixmag]] = 4, no other preconditioner on magnetization). """, - ), - Variable( - abivarname="diismemory", - varset="rlx", - vartype="integer", - topics=["MolecularDynamics_expert"], - dimensions="scalar", - defaultval=8, - mnemonics="Direct Inversion in the Iterative Subspace MEMORY", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="diismemory", + varset="rlx", + vartype="integer", + topics=["MolecularDynamics_expert"], + dimensions="scalar", + defaultval=8, + mnemonics="Direct Inversion in the Iterative Subspace MEMORY", + added_in_version="before_v9", + text=r""" Gives the maximum number of "time" steps for which the forces and stresses are stored, and taken into account in the DIIS algorithm ([[ionmov]] = 20) to find zero-force and stress configurations. """, - ), - Variable( - abivarname="dilatmx", - varset="rlx", - vartype="real", - topics=["GeoOpt_basic"], - dimensions="scalar", - defaultval=1.0, - mnemonics="lattice DILATation: MaXimal value", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="dilatmx", + varset="rlx", + vartype="real", + topics=["GeoOpt_basic"], + dimensions="scalar", + defaultval=1.0, + mnemonics="lattice DILATation: MaXimal value", + added_in_version="before_v9", + text=r""" [[dilatmx]] is an auxiliary variable used to book additional memory (see detailed description later) for possible on-the-fly enlargement of the plane wave basis set, due to cell volume increase during geometry optimization by ABINIT. Useful only when doing cell optimization, e.g. [[optcell]] /= 0, usually with [[geoopt]] = "bfgs" or "lbfgs" ([[ionmov]] == 2 or 22). @@ -2737,32 +2951,37 @@ and a corresponding increase in CPU time and memory. It is possible to use [[dilatmx]] when [[optcell]] = 0, but a value larger than 1.0 will be a waste. """, - ), - Variable( - abivarname="dipdip", - varset="eph", - vartype="integer", - topics=["Phonons_useful"], - dimensions="scalar", - defaultval=1, - mnemonics="DIPole-DIPole interaction", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="dipdip", + varset="eph", + vartype="integer", + topics=["Phonons_useful"], + dimensions="scalar", + defaultval=1, + mnemonics="DIPole-DIPole interaction", + added_in_version="before_v9", + text=r""" This variable defines the treatment of the dipole-dipole interaction. Same meaning as the corresponding anaddb variable [[dipdip@anaddb]] """, - ), - Variable( - abivarname="dmatpawu", - varset="paw", - vartype="real", - topics=["DFT+U_useful", "ElecDOS_useful"], - dimensions=["2*max([[lpawu]])+1", "2*max([[lpawu]])+1", "max([[nsppol]], [[nspinor]])", "[[natpawu]]"], - defaultval=MultipleValue(number=None, value=-10.0), - mnemonics="initial Density MATrix for PAW+U", - requires="[[usepaw]] == 1 and [[usepawu]] == 1 and [[usedmatpu]] != 0", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="dmatpawu", + varset="paw", + vartype="real", + topics=["DFT+U_useful", "ElecDOS_useful"], + dimensions=["2*max([[lpawu]])+1", + "2*max([[lpawu]])+1", + "max([[nsppol]], [[nspinor]])", + "[[natpawu]]"], + defaultval=MultipleValue(number=None, value=-10.0), + mnemonics="initial Density MATrix for PAW+U", + requires="[[usepaw]] == 1 and [[usepawu]] == 1 and [[usedmatpu]] != 0", + added_in_version="before_v9", + text=r""" For Ground state calculations only. Gives the value of an initial density matrix used in DFT+U and kept fixed during the first abs([[usedmatpu]]) SCF iterations. @@ -2818,18 +3037,19 @@ They contain the "spin-up" and "spin-down" occupations; But, as "spin-up" and "spin-down" are constrained identical, the "spin-down" one is ignored by the code. """, - ), - Variable( - abivarname="dmatpuopt", - varset="paw", - vartype="integer", - topics=["DFT+U_expert"], - dimensions="scalar", - defaultval=2, - mnemonics="Density MATrix for PAW+U OPTion", - requires="[[usepaw]] == 1 and [[usepawu]] == 1", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="dmatpuopt", + varset="paw", + vartype="integer", + topics=["DFT+U_expert"], + dimensions="scalar", + defaultval=2, + mnemonics="Density MATrix for PAW+U OPTion", + requires="[[usepaw]] == 1 and [[usepawu]] == 1", + added_in_version="before_v9", + text=r""" This option governs the way occupations of localized atomic levels are computed: * [[dmatpuopt]] = 1: atomic occupations are projections on atomic orbitals (Eq. (6) of [[cite:Amadon2008a]]). @@ -2844,18 +3064,19 @@ restricted to PAW datasets in which the first atomic wavefunction of the correlated subspace is a normalized atomic eigenfunction. """, - ), - Variable( - abivarname="dmatudiag", - varset="paw", - vartype="integer", - topics=["DFT+U_expert"], - dimensions="scalar", - defaultval=0, - mnemonics="Density MATrix for paw+U, DIAGonalization", - requires="[[usepaw]] == 1 and [[usepawu]] == 1 and [[nspden]] != 4", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="dmatudiag", + varset="paw", + vartype="integer", + topics=["DFT+U_expert"], + dimensions="scalar", + defaultval=0, + mnemonics="Density MATrix for paw+U, DIAGonalization", + requires="[[usepaw]] == 1 and [[usepawu]] == 1 and [[nspden]] != 4", + added_in_version="before_v9", + text=r""" Relevant only for Ground-State calculations. This option can be used to diagonalize the occupation matrix Nocc_{m,m_prime}. Relevant values are: @@ -2865,35 +3086,37 @@ (eigenvectors are also given in the log file). * 2: for testing purpose. """, - ), - Variable( - abivarname="dmft_charge_prec", - varset="dmft", - vartype="real", - topics=["DMFT_expert", "DmftTriqsCthyb_expert"], - dimensions="scalar", - defaultval=1e-06, - mnemonics="Dynamical Mean Field Theory: CHARGE density PRECision", - requires="[[usedmft]] == 1", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="dmft_charge_prec", + varset="dmft", + vartype="real", + topics=["DMFT_expert", "DmftTriqsCthyb_expert"], + dimensions="scalar", + defaultval=1e-06, + mnemonics="Dynamical Mean Field Theory: CHARGE density PRECision", + requires="[[usedmft]] == 1", + added_in_version="before_v9", + text=r""" This variable sets the numerical tolerance used to determine the Fermi level. The root-finding algorithm stops once the calculated electron count matches the target value within this tolerance. A smaller value improves the accuracy of the Fermi level but increases the number of root-finding iterations, which may significantly impact performance for large systems. If you are using noisy solvers (e.g., CT-QMC), it is unnecessary to set a tolerance smaller than the intrinsic noise level of your solver. See [[dmft_fermi_step]] for further tuning of the root-finding algorithm. """, - ), - Variable( - abivarname="dmft_dc", - varset="dmft", - vartype="integer", - topics=["DMFT_basic", "DmftTriqsCthyb_compulsory"], - dimensions="scalar", - defaultval=r"None if [[dmft_solv]] $\in$ [6,7], 1 otherwise", - mnemonics="Dynamical Mean Field Theory: Double Counting", - requires="[[usedmft]] == 1", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="dmft_dc", + varset="dmft", + vartype="integer", + topics=["DMFT_basic", "DmftTriqsCthyb_compulsory"], + dimensions="scalar", + defaultval=r"None if [[dmft_solv]] $\in$ [6,7], 1 otherwise", + mnemonics="Dynamical Mean Field Theory: Double Counting", + requires="[[usedmft]] == 1", + added_in_version="before_v9", + text=r""" Selects the double counting (DC) correction formula used in DFT+DMFT calculations. @@ -2908,43 +3131,45 @@ Besides, we assume that the projection of the correlated orbital [[dmft_orbital]] on the energy window [ [[dmftbandi]],[[dmftbandf]] ] is equal to [[dmft_orbital]] itself (i.e. the closure relation is assumed). Please look at section 7 of the - [[tutorial:dmft_triqs|tutorial on DFT+DMFT with TRIQS/CT-HYB]] for detailed informations on how to use it. + [[tutorial:dmft_triqs|tutorial on DFT+DMFT with TRIQS/CT-HYB]] for detailed information on how to use it. Magnetic formulas ([[dmft_dc]] < 5 ) need to be used with magnetic DFT ([[usepawu]]=10). Non-magnetic formulas ([[dmft_dc]] >= 5 ) need to be used with non-magnetic DFT ([[usepawu]]=14). See [[cite:Park2015]] and [[cite:Chen2016a]] for more details on the non-magnetic treatment. """, - ), - Variable( - abivarname="dmft_entropy", - varset="dmft", - vartype="integer", - topics=["DMFT_expert"], - dimensions="scalar", - defaultval=0, - mnemonics="Dynamical Mean Field Theory: ENTROPY", - requires="[[usedmft]] == 1 and [[dmft_solv]] == 5", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="dmft_entropy", + varset="dmft", + vartype="integer", + topics=["DMFT_expert"], + dimensions="scalar", + defaultval=0, + mnemonics="Dynamical Mean Field Theory: ENTROPY", + requires="[[usedmft]] == 1 and [[dmft_solv]] == 5", + added_in_version="before_v9", + text=r""" If 1, enables the calculation of the entropy within the DMFT framework and so allows one the calculation of the total energy (free energy). In the current implementation, this is only possible with [[dmft_solv]] = 5 (Continuous Time Quantum Monte Carlo). See also the input variable [[dmft_nlambda]]. """, - ), - Variable( - abivarname="dmft_fermi_step", - varset="dmft", - vartype="real", - topics=["DMFT_expert", "DmftTriqsCthyb_expert"], - dimensions="scalar", - defaultval=0.02, - mnemonics="Dynamical Mean Field Theory: FERMI search maximal STEP", - requires="[[usedmft]] == 1", - characteristics=["[[ENERGY]]"], - added_in_version="before_v10.5.6", - text=r""" +), + +Variable( + abivarname="dmft_fermi_step", + varset="dmft", + vartype="real", + topics=["DMFT_expert", "DmftTriqsCthyb_expert"], + dimensions="scalar", + defaultval=0.02, + mnemonics="Dynamical Mean Field Theory: FERMI search maximal STEP", + requires="[[usedmft]] == 1", + characteristics=["[[ENERGY]]"], + added_in_version="before_v10.5.6", + text=r""" During the Fermi level search, the step increment for the Fermi level is capped to [[dmft_fermi_step]]. If this value is too low, the root-finding algorithm will be significantly slowed down. If it is too high, the step increment might become too high and the algorithm might encounter instabilities @@ -2954,33 +3179,66 @@ See [[dmft_charge_prec]] for further tuning of the root-finding algorithm. """, - ), - Variable( - abivarname="dmft_iter", - varset="dmft", - vartype="integer", - topics=["DMFT_compulsory", "DmftTriqsCthyb_compulsory"], - dimensions="scalar", - defaultval=r"None if [[dmft_solv]] $\in$ [6,7], 10 otherwise", - mnemonics="Dynamical Mean Field Theory: number of DMFT ITERations", - requires="[[usedmft]] == 1", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="dmft_full_chipsi", + varset="dmft", + vartype="integer", + topics=["DMFT_expert"], + dimensions="scalar", + defaultval=0, + mnemonics="Dynamical Mean Field Theory: compute full chi psi", + requires="[[usedmft]] == 1 and [[dmft_prtwan]] == 1", + added_in_version="before_v10.8", + text=r""" +Required in order to build the full Wannier function outside the paw sphere. This is relevant +only when using [[dmft_solv]] $\in$ [5,8,10]. +""", +), + +Variable( + abivarname="dmft_hybri_limit", + varset="dmft", + vartype="integer", + topics=["DMFT_expert"], + dimensions="scalar", + defaultval=0, + mnemonics="Dynamical Mean Field Theory: Hybridization asymptotic limit", + requires="[[usedmft]] == 1 and [[dmft_solv]] == 10", + added_in_version="before_v10.7", + text=r""" +Use of the asymptotic limit of the hybridization function to enforce that F(iw_n) -> -C_ij/iw_n +""", +), + +Variable( + abivarname="dmft_iter", + varset="dmft", + vartype="integer", + topics=["DMFT_compulsory", "DmftTriqsCthyb_compulsory"], + dimensions="scalar", + defaultval=r"None if [[dmft_solv]] $\in$ [6,7], 10 otherwise", + mnemonics="Dynamical Mean Field Theory: number of DMFT ITERations", + requires="[[usedmft]] == 1", + added_in_version="before_v9", + text=r""" Number of iterations in the DMFT inner loop, at fixed density. The number of DFT+DMFT cycles (i.e. density updates) is set via [[nstep]], for a total number of [[nstep]] $\times$ [[dmft_iter]] calls to the impurity solver. """, - ), - Variable( - abivarname="dmft_kspectralfunc", - varset="dmft", - vartype="integer", - topics=["DMFT_useful", "DmftTriqsCthyb_useful"], - dimensions="scalar", - defaultval=0, - mnemonics="Dynamical Mean Field Theory: compute K-resolved SPECTRAL FUNCtion", - requires="[[usedmft]] == 1, [[iscf]] in [-3,-2]", - added_in_version="9.0.0", - text=r""" +), + +Variable( + abivarname="dmft_kspectralfunc", + varset="dmft", + vartype="integer", + topics=["DMFT_useful", "DmftTriqsCthyb_useful"], + dimensions="scalar", + defaultval=0, + mnemonics="Dynamical Mean Field Theory: compute K-resolved SPECTRAL FUNCtion", + requires="[[usedmft]] == 1, [[iscf]] in [-3,-2]", + added_in_version="9.0.0", + text=r""" When activated, in conjunction with [[iscf]] = -2 or -3, a calculation of $k$-resolved spectral function (or density of states) is performed. @@ -2991,19 +3249,20 @@ the TRIQS/CT-HYB interface, please have a look at section 6 in the [[tutorial:dmft_triqs|TRIQS/CT-HYB tutorial]]. """, - ), - Variable( - abivarname="dmft_magnfield", - varset="dmft", - vartype="integer", - topics=["DMFT_expert"], - dimensions="scalar", - defaultval=0, - mnemonics="Dynamical Mean Field Theory: Magnetic Field", - requires=r"[[usedmft]] == 1, [[dmft_solv]] $\ne$ [6,7]", - characteristics=["[[DEVELOP]]"], - added_in_version="10.4.0", - text=r""" +), + +Variable( + abivarname="dmft_magnfield", + varset="dmft", + vartype="integer", + topics=["DMFT_expert"], + dimensions="scalar", + defaultval=0, + mnemonics="Dynamical Mean Field Theory: Magnetic Field", + requires=r"[[usedmft]] == 1, [[dmft_solv]] $\ne$ [6,7]", + characteristics=["[[DEVELOP]]"], + added_in_version="10.4.0", + text=r""" Apply a magnetic field in Tesla ($B_z = \mu_0 H_z$) in combination with [[dmft_magnfield_b]] to add the Zeeman contribution to the energy levels. If the applied field is sufficiently small, it can be used to calculate the uniform magnetic susceptibility. The Zeeman contribution in Hartree corresponds to $B_z \mu_B g_e S_z$ when [[nspinor]] == 1. @@ -3014,121 +3273,129 @@ * 2 --> Add the Zeeman contribution to the energy levels of the DMFT local impurity Hamiltonian and not in the Weiss-field. This is a strong approximation. """, - ), - Variable( - abivarname="dmft_magnfield_b", - varset="dmft", - vartype="real", - topics=["DMFT_expert"], - dimensions="scalar", - defaultval=0.0, - mnemonics="Dynamical Mean Field Theory: Magnetic Field Value of Bz", - requires=r"[[usedmft]] == 1, [[dmft_solv]] $\ne$ [6,7]", - characteristics=["[[DEVELOP]]"], - added_in_version="10.4.0", - text=r""" +), + +Variable( + abivarname="dmft_magnfield_b", + varset="dmft", + vartype="real", + topics=["DMFT_expert"], + dimensions="scalar", + defaultval=0.0, + mnemonics="Dynamical Mean Field Theory: Magnetic Field Value of Bz", + requires=r"[[usedmft]] == 1, [[dmft_solv]] $\ne$ [6,7]", + characteristics=["[[DEVELOP]]"], + added_in_version="10.4.0", + text=r""" Value of the magnetic field $B_z$ (in Tesla) applied when [[dmft_magnfield]] is activated. """, - ), - Variable( - abivarname="dmft_mxsf", - varset="dmft", - vartype="real", - topics=["DMFT_useful", "DmftTriqsCthyb_useful"], - dimensions="scalar", - defaultval=0.6, - mnemonics="Dynamical Mean Field Theory: MiXing parameter for the SelF energy", - requires="[[usedmft]] == 1", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="dmft_mxsf", + varset="dmft", + vartype="real", + topics=["DMFT_useful", "DmftTriqsCthyb_useful"], + dimensions="scalar", + defaultval=0.6, + mnemonics="Dynamical Mean Field Theory: MiXing parameter for the SelF energy", + requires="[[usedmft]] == 1", + added_in_version="before_v9", + text=r""" Linear mixing parameter of the self-energy. Most of the time, it can be increased to 0.6-0.8, but you can decrease it if you're having convergence issues. Always try to set it as high as possible to speed up convergence. """, - ), - Variable( - abivarname="dmft_nlambda", - varset="dmft", - vartype="integer", - topics=["DMFT_expert"], - dimensions="scalar", - defaultval=6, - mnemonics="Dynamical Mean Field Theory: Number of LAMBDA points", - characteristics=["[[DEVELOP]]"], - requires="[[usedmft]] == 1 and [[dmft_entropy]] == 1", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="dmft_nlambda", + varset="dmft", + vartype="integer", + topics=["DMFT_expert"], + dimensions="scalar", + defaultval=6, + mnemonics="Dynamical Mean Field Theory: Number of LAMBDA points", + characteristics=["[[DEVELOP]]"], + requires="[[usedmft]] == 1 and [[dmft_entropy]] == 1", + added_in_version="before_v9", + text=r""" [[dmft_nlambda]] gives the number of integration points for the thermodynamic integration in case of free energy calculation within DMFT. Its value must be greater or equal to 3. """, - ), - Variable( - abivarname="dmft_nominal", - varset="dmft", - vartype="integer", - topics=["DMFT_useful", "DmftTriqsCthyb_useful"], - dimensions=["[[natom]]"], - mnemonics="Dynamical Mean Field Theory: NOMINAL occupancies", - requires="[[usedmft]] == 1, [[dmft_dc]] == 7", - added_in_version="before_v10.5.6", - text=r""" +), + +Variable( + abivarname="dmft_nominal", + varset="dmft", + vartype="integer", + topics=["DMFT_useful", "DmftTriqsCthyb_useful"], + dimensions=["[[natom]]"], + mnemonics="Dynamical Mean Field Theory: NOMINAL occupancies", + requires="[[usedmft]] == 1, [[dmft_dc]] == 7", + added_in_version="before_v10.5.6", + text=r""" [[dmft_nominal]] gives the nominal occupancies for each atom, used for the nominal double counting ([[dmft_dc]]=7). For uncorrelated atoms, just set any arbitrary value. """, - ), - Variable( - abivarname="dmft_nwli", - varset="dmft", - vartype="integer", - topics=["DMFT_compulsory"], - dimensions="scalar", - mnemonics="Dynamical Mean Field Theory: Number of frequency omega (W) in the LInear mesh", - requires=r"[[usedmft]] == 1, [[dmft_solv]] $\ne$ [6,7]", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="dmft_nwli", + varset="dmft", + vartype="integer", + topics=["DMFT_compulsory"], + dimensions="scalar", + mnemonics="Dynamical Mean Field Theory: Number of frequency omega (W) in the LInear mesh", + requires=r"[[usedmft]] == 1, [[dmft_solv]] $\ne$ [6,7]", + added_in_version="before_v9", + text=r""" Number of Matsubara frequencies (linear mesh), only for the internal solvers of Abinit. """, - ), - Variable( - abivarname="dmft_nwlo", - varset="dmft", - vartype="integer", - topics=["DMFT_compulsory"], - dimensions="scalar", - defaultval=0, - mnemonics="Dynamical Mean Field Theory: Number of frequency omega (W) in the LOg mesh", - requires=r"[[usedmft]] == 1, [[dmft_solv]] $\ne$ [6,7]", - characteristics=["[[DEVELOP]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="dmft_nwlo", + varset="dmft", + vartype="integer", + topics=["DMFT_compulsory"], + dimensions="scalar", + defaultval=0, + mnemonics="Dynamical Mean Field Theory: Number of frequency omega (W) in the LOg mesh", + requires=r"[[usedmft]] == 1, [[dmft_solv]] $\ne$ [6,7]", + characteristics=["[[DEVELOP]]"], + added_in_version="before_v9", + text=r""" Number of frequencies in the log mesh, only for the internal solvers of Abinit. """, - ), - Variable( - abivarname="dmft_occnd_imag", - varset="dmft", - vartype="integer", - topics=["DMFT_expert"], - dimensions="scalar", - defaultval=1, - mnemonics="Dynamical Mean Field Theory: Occupation non-diagonal imaginary part", - requires="[[usedmft]] == 1", - characteristics=["[[DEVELOP]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="dmft_occnd_imag", + varset="dmft", + vartype="integer", + topics=["DMFT_expert"], + dimensions="scalar", + defaultval=1, + mnemonics="Dynamical Mean Field Theory: Occupation non-diagonal imaginary part", + requires="[[usedmft]] == 1", + characteristics=["[[DEVELOP]]"], + added_in_version="before_v9", + text=r""" When 0 force non-diagonal occupations imaginary parts to be null. Do not use this, it is only for compatibility with old tests. """, - ), - Variable( - abivarname="dmft_orbital", - varset="dmft", - vartype="integer", - topics=["DMFT_useful", "DmftTriqsCthyb_useful"], - dimensions=["[[ntypat]]"], - defaultval=1, - mnemonics="Dynamical Mean Field Theory: correlated ORBITAL", - requires="[[usedmft]] == 1", - added_in_version="before_v10.5.6", - text=r""" +), + +Variable( + abivarname="dmft_orbital", + varset="dmft", + vartype="integer", + topics=["DMFT_useful", "DmftTriqsCthyb_useful"], + dimensions=["[[ntypat]]"], + defaultval=1, + mnemonics="Dynamical Mean Field Theory: correlated ORBITAL", + requires="[[usedmft]] == 1", + added_in_version="before_v10.5.6", + text=r""" Set the reduced radial wavefunction $u_l(r)$ of the correlated orbitals $\frac{u_l(r)}{r} Y_{lm}(\hat{r})$ for each atom type, where $Y_{lm}(\hat{r})$ are the real spherical harmonics. For uncorrelated atom types, simply put any arbitrary value. @@ -3139,17 +3406,18 @@ and being the most bound (default choice). * If set to $i \le$ 0, read an arbitrary radial part from the file specified by [[dmft_orbital_filepath]]. """, - ), - Variable( - abivarname="dmft_orbital_filepath", - varset="dmft", - vartype="string", - topics=["DMFT_useful", "DmftTriqsCthyb_useful"], - dimensions="scalar", - mnemonics="Dynamical Mean Field Theory: correlated ORBITAL FILEPATH", - requires=r"[[usedmft]] == 1, [[dmft_orbital]] $\le$ 0", - added_in_version="before_v10.5.6", - text=r""" +), + +Variable( + abivarname="dmft_orbital_filepath", + varset="dmft", + vartype="string", + topics=["DMFT_useful", "DmftTriqsCthyb_useful"], + dimensions="scalar", + mnemonics="Dynamical Mean Field Theory: correlated ORBITAL FILEPATH", + requires=r"[[usedmft]] == 1, [[dmft_orbital]] $\le$ 0", + added_in_version="before_v10.5.6", + text=r""" Set the root of the filepath for the correlated orbital in the case of a user-provided reduced radial wavefunction $u_l(r)$ ([[dmft_orbital]] $\le$ 0). @@ -3172,52 +3440,55 @@ If you only know the values of your orbital $u_l(r)$ on a specific set of radii, simply use a cubic spline interpolation to extrapolate the values on the extended PAW mesh. """, - ), - Variable( - abivarname="dmft_prt_maxent", - varset="dmft", - vartype="integer", - topics=["DMFT_expert", "DmftTriqsCthyb_expert"], - dimensions="scalar", - defaultval=1, - mnemonics="Dynamical Mean Field Theory: PRinT files for MAXENT", - requires="[[usedmft]] == 1", - added_in_version="before_v10.5.6", - text=r""" +), + +Variable( + abivarname="dmft_prt_maxent", + varset="dmft", + vartype="integer", + topics=["DMFT_expert", "DmftTriqsCthyb_expert"], + dimensions="scalar", + defaultval=1, + mnemonics="Dynamical Mean Field Theory: PRinT files for MAXENT", + requires="[[usedmft]] == 1", + added_in_version="before_v10.5.6", + text=r""" Set to 1 to write useful files for the analytical continuation of the self-energy. This prints the self-energy in the basis that diagonalizes the local electronic levels. The off-diagonal elements are thus minimized, since they are not handled by most analytical continuation codes. The rotation matrix is also printed, as well as the matrix overlap of the Wannier functions. """, - ), - Variable( - abivarname="dmft_prtself", - varset="dmft", - vartype="integer", - topics=["DMFT_expert", "DmftTriqsCthyb_expert"], - dimensions="scalar", - defaultval=0, - mnemonics="Dynamical Mean Field Theory: PRinT SELF-energy", - requires="[[usedmft]] == 1", - added_in_version="before_v10.5.6", - text=r""" +), + +Variable( + abivarname="dmft_prtself", + varset="dmft", + vartype="integer", + topics=["DMFT_expert", "DmftTriqsCthyb_expert"], + dimensions="scalar", + defaultval=0, + mnemonics="Dynamical Mean Field Theory: PRinT SELF-energy", + requires="[[usedmft]] == 1", + added_in_version="before_v10.5.6", + text=r""" Set to 1 to write the self-energy at each iteration in order to see its evolution along the SCF cycle. Otherwise, the self-energy file is overwritten at each iteration to keep the last value only. """, - ), - Variable( - abivarname="dmft_prtwan", - varset="dmft", - vartype="integer", - topics=["DmftTriqsCthyb_expert"], - dimensions="scalar", - defaultval=0, - mnemonics="Dynamical Mean Field Theory: PRinT WANnier functions", - requires=r"[[usedmft]] == 1, [[dmft_solv]] $\in$ [6,7]", - added_in_version="before_v10.5.6", - text=r""" +), + +Variable( + abivarname="dmft_prtwan", + varset="dmft", + vartype="integer", + topics=["DmftTriqsCthyb_expert"], + dimensions="scalar", + defaultval=0, + mnemonics="Dynamical Mean Field Theory: PRinT WANnier functions", + requires=r"[[usedmft]] == 1, [[dmft_solv]] $\in$ [6,7]", + added_in_version="before_v10.5.6", + text=r""" Compute and write on file the reduced radial part $u_l(r)$ of the Wannier functions (i.e. the orthonormalized projection of [[dmft_orbital]] on [ [[dmftbandi]],[[dmftbandf]] ]). This is computed on the same radial mesh as the PAW one, extended up to the radius [[dmft_wanrad]]. @@ -3225,19 +3496,20 @@ [[dmft_orbital]] in the general case (unless your energy window is large enough to have a closure relation). This is only available in the case [[dmft_solv]] $\in$ [6,7]. """, - ), - Variable( - abivarname="dmft_read_occnd", - varset="dev", - vartype="integer", - topics=["DMFT_expert"], - dimensions="scalar", - defaultval=0, - mnemonics="Dynamical Mean Field Theory: READ OCCupations (Non Diagonal)", - requires="[[usedmft]] == 1", - characteristics=["[[DEVELOP]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="dmft_read_occnd", + varset="dev", + vartype="integer", + topics=["DMFT_expert"], + dimensions="scalar", + defaultval=0, + mnemonics="Dynamical Mean Field Theory: READ OCCupations (Non Diagonal)", + requires="[[usedmft]] == 1", + characteristics=["[[DEVELOP]]"], + added_in_version="before_v9", + text=r""" Flag to read/write Occupations as computed in DMFT. This flag is useful to restart a DFT+DMFT calculation with self-consistency over electronic density. The occupations are written each time a DMFT loop is finished. So if the @@ -3253,19 +3525,20 @@ the density file (obtained with [[prtden]] = 1 or [[prtden]] = -1) and the self-energy (see [[dmft_rslf]]). In this case, use [[dmft_read_occnd]]=0. """, - ), - Variable( - abivarname="dmft_rslf", - varset="dmft", - vartype="integer", - topics=["DMFT_expert"], - dimensions="scalar", - defaultval=1, - mnemonics="Dynamical Mean Field Theory: Read SeLF energy", - requires="[[usedmft]] == 1", - characteristics=["[[DEVELOP]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="dmft_rslf", + varset="dmft", + vartype="integer", + topics=["DMFT_expert"], + dimensions="scalar", + defaultval=1, + mnemonics="Dynamical Mean Field Theory: Read SeLF energy", + requires="[[usedmft]] == 1", + characteristics=["[[DEVELOP]]"], + added_in_version="before_v9", + text=r""" Flag to initialize the self-energy at the beginning of each new DMFT loop. If set to 1, the self-energy is read either from the file of the dataset specified by [[getself]] @@ -3282,19 +3555,20 @@ not be used. Note that inside a DMFT loop, the calculation is always self-consistent, regardless of the value of [[dmft_rslf]]. """, - ), - Variable( - abivarname="dmft_shiftself", - varset="dmft", - vartype="real", - topics=["DMFT_expert", "DmftTriqsCthyb_expert"], - dimensions=["[[natom]]"], - defaultval=0, - mnemonics="Dynamical Mean Field Theory: spin SHIFT for the SELF-energy", - requires="[[usedmft]] == 1, [[nsppol]] == 2, [[usepawu]] == 14", - characteristics=["[[ENERGY]]"], - added_in_version="before_v10.5.6", - text=r""" +), + +Variable( + abivarname="dmft_shiftself", + varset="dmft", + vartype="real", + topics=["DMFT_expert", "DmftTriqsCthyb_expert"], + dimensions=["[[natom]]"], + defaultval=0, + mnemonics="Dynamical Mean Field Theory: spin SHIFT for the SELF-energy", + requires="[[usedmft]] == 1, [[nsppol]] == 2, [[usepawu]] == 14", + characteristics=["[[ENERGY]]"], + added_in_version="before_v10.5.6", + text=r""" When you are performing a magnetic calculation with a non-magnetic DFT, the magnetization can take quite some time to arise (especially if it's very low) since you start from a paramagnetic configuration. In this case, it is useful to start directly from a ferromagnetic @@ -3303,18 +3577,19 @@ Can be specified in the unit of your choice (Ha, Ry, eV, K) since it has the [[ENERGY]] characteristics. """, - ), - Variable( - abivarname="dmft_solv", - varset="dmft", - vartype="integer", - topics=["DMFT_basic", "DmftTriqsCthyb_basic"], - dimensions="scalar", - defaultval=5, - mnemonics="Dynamical Mean Field Theory: choice of SOLVer", - requires="[[usedmft]] == 1", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="dmft_solv", + varset="dmft", + vartype="integer", + topics=["DMFT_basic", "DmftTriqsCthyb_basic"], + dimensions="scalar", + defaultval=5, + mnemonics="Dynamical Mean Field Theory: choice of SOLVer", + requires="[[usedmft]] == 1", + added_in_version="before_v9", + text=r""" Choice of solver for the Impurity model. * 0 --> No solver and U=0, J=0 (see [[upawu]] and [[jpawu]]). @@ -3325,6 +3600,7 @@ * 7 --> TRIQS/CTHYB with the full rotationally invariant Slater Hamiltonian. * 8 --> Same as 5, but off-diagonal elements of the hybridization function are taken into account (useful for low symmetry systems or with spin orbit coupling). * 9 --> Python invocation. Give a symbolic link to your python interpreter as an input like 'input-tag'_TRIQS_python_lib and the python script as an input like 'input-tag'_TRIQS_script.py. The inputs for the script will be written in dft_for_triqs.nc and the output as triqs_for_dft.nc. + * 10 --> Internal Abinit CT-Hyb solver in the density-density approximation with the real and imaginary part of the full hybridization function taken into account. The CT Hyb algorithm is described in [[cite:Werner2006]]. For a discussion of density-density approximation with respect with the @@ -3338,33 +3614,35 @@ [[dmftctqmc_mov]], [[dmftctqmc_order]], [[dmftqmc_l]], [[dmftqmc_n]], [[dmftqmc_seed]], [[dmftqmc_therm]] """, - ), - Variable( - abivarname="dmft_t2g", - varset="dmft", - vartype="integer", - topics=["DMFT_expert", "DmftTriqsCthyb_expert"], - dimensions="scalar", - defaultval=0, - mnemonics="Dynamical Mean Field Theory: t2g orbitals", - requires="[[usedmft]] == 1", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="dmft_t2g", + varset="dmft", + vartype="integer", + topics=["DMFT_expert", "DmftTriqsCthyb_expert"], + dimensions="scalar", + defaultval=0, + mnemonics="Dynamical Mean Field Theory: t2g orbitals", + requires="[[usedmft]] == 1", + added_in_version="before_v9", + text=r""" This should be set to 1 only if in cubic symmetry. It enables one to carry a DFT+DMFT calculations on $\text{t}_{2\text{g}}$ orbitals only. """, - ), - Variable( - abivarname="dmft_tolfreq", - varset="dmft", - vartype="real", - topics=["DMFT_expert", "DmftTriqsCthyb_expert"], - dimensions="scalar", - defaultval=0.0001, - mnemonics="Dynamical Mean Field Theory: TOLerance on DFT correlated electron occupation matrix for the definition of the FREQuency grid", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="dmft_tolfreq", + varset="dmft", + vartype="real", + topics=["DMFT_expert", "DmftTriqsCthyb_expert"], + dimensions="scalar", + defaultval=0.0001, + mnemonics="Dynamical Mean Field Theory: TOLerance on DFT correlated electron occupation matrix for the definition of the FREQuency grid", + added_in_version="before_v9", + text=r""" The DFT occupation matrix for correlated electrons can be computed by direct integration of the DFT Green's function. It can be compared to the calculation of the same quantity by downfolding Fermi-Dirac @@ -3373,33 +3651,35 @@ is large enough. If the difference is larger than [[dmft_tolfreq]], then the code stops and an error message is thrown. """, - ), - Variable( - abivarname="dmft_tollc", - varset="dmft", - vartype="real", - topics=["DMFT_useful", "DmftTriqsCthyb_useful"], - dimensions="scalar", - defaultval=1e-05, - mnemonics="Dynamical Mean Field Theory: TOLerance on Local Charge for convergence of the DMFT loop", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="dmft_tollc", + varset="dmft", + vartype="real", + topics=["DMFT_useful", "DmftTriqsCthyb_useful"], + dimensions="scalar", + defaultval=1e-05, + mnemonics="Dynamical Mean Field Theory: TOLerance on Local Charge for convergence of the DMFT loop", + added_in_version="before_v9", + text=r""" Tolerance criterion on the variation of Local Charge for the convergence of the DMFT Loop. However, most of the time, charge self-consistent DFT+DMFT calculations can converge faster using [[dmft_iter]]=1, so that this variable is not required. """, - ), - Variable( - abivarname="dmft_triqs_basis", - varset="dmft", - vartype="integer", - topics=["DmftTriqsCthyb_compulsory"], - dimensions="scalar", - defaultval="None", - mnemonics="Dynamical Mean Field Theory: TRIQS, Continuous Time Quantum Monte Carlo BASIS", - requires=r"[[usedmft]] == 1, [[dmft_solv]] $\in$ [6,7]", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="dmft_triqs_basis", + varset="dmft", + vartype="integer", + topics=["DmftTriqsCthyb_compulsory"], + dimensions="scalar", + defaultval="None", + mnemonics="Dynamical Mean Field Theory: TRIQS, Continuous Time Quantum Monte Carlo BASIS", + requires=r"[[usedmft]] == 1, [[dmft_solv]] $\in$ [6,7]", + added_in_version="before_v9", + text=r""" Choose the basis in which to perform CTQMC calculation. This basis should be carefully selected as it determines the magnitude of the off-diagonal elements as well as the conserved quantum numbers in the atomic Hamiltonian, and can therefore greatly @@ -3423,18 +3703,54 @@ * 4 (only when [[nspinor]]=2) --> JmJ basis. Useful for systems with spin-orbit coupling. Provides a lot of conserved quantum numbers. """, - ), - Variable( - abivarname="dmft_triqs_compute_integral", - varset="dmft", - vartype="integer", - topics=["DmftTriqsCthyb_expert"], - dimensions="scalar", - defaultval=1, - mnemonics="Dynamical Mean Field Theory: TRIQS, COMPUTE thermodynamic INTEGRAL", - requires=r"[[usedmft]] == 1, [[dmft_solv]] $\in$ [6,7], [[dmft_triqs_entropy]] == 1, [[dmft_triqs_measure_density_matrix]] == 1", - added_in_version="before_v10.5.6", - text=r""" +), + +Variable( + abivarname="dmft_triqs_chiloc", + varset="dmft", + vartype="integer", + topics=["DmftTriqsCthyb_expert"], + dimensions="scalar", + defaultval=0, + mnemonics="Dynamical Mean Field Theory: TRIQS compute local susceptibility", + requires=r"[[usedmft]] == 1, [[dmft_solv]] $\in$ [6,7], [[dmft_triqs_measure_density_matrix]] == 1", + added_in_version="before_v10.9", + text=r""" + + * 1 --> Activate the calculation of the local spin susceptibility for the impurity. Only implemented for the case with [[nspinor]] == 1 . + +""", +), + +Variable( + abivarname="dmft_triqs_chiloc_ins", + varset="dmft", + vartype="integer", + topics=["DmftTriqsCthyb_expert"], + dimensions="scalar", + defaultval=10, + mnemonics="Dynamical Mean Field Theory: TRIQS number of insertion operator for local susceptibility", + requires=r"[[usedmft]] == 1, [[dmft_solv]] $\in$ [6,7], [[dmft_triqs_measure_density_matrix]] == 1", + added_in_version="before_v10.9", + text=r""" + +Define the minimal number of insertion operators for the calculation of the local spin susceptibility. + +""", +), + + +Variable( + abivarname="dmft_triqs_compute_integral", + varset="dmft", + vartype="integer", + topics=["DmftTriqsCthyb_expert"], + dimensions="scalar", + defaultval=1, + mnemonics="Dynamical Mean Field Theory: TRIQS, COMPUTE thermodynamic INTEGRAL", + requires=r"[[usedmft]] == 1, [[dmft_solv]] $\in$ [6,7], [[dmft_triqs_entropy]] == 1, [[dmft_triqs_measure_density_matrix]] == 1", + added_in_version="before_v10.5.6", + text=r""" Specify whether to compute the contribution from the impurity entropy when computing the DFT+DMFT entropy (cf [[dmft_triqs_entropy]]). * 0 --> Neglect it. As this is the main bottleneck of a free energy calculation, it can be useful @@ -3447,35 +3763,37 @@ [[dmft_triqs_nsubdivisions]] to set the integration points). At $\lambda$=0, the interaction Hamiltonian is 0 (as the non-interacting limit is known analytically), and the chemical potential is shifted by [[dmft_triqs_shift_mu]]. """, - ), - Variable( - abivarname="dmft_triqs_det_init_size", - varset="dmft", - vartype="integer", - topics=["DmftTriqsCthyb_expert"], - dimensions="scalar", - defaultval=100, - mnemonics="Dynamical Mean Field Theory: TRIQS, DETerminant INITial SIZE", - requires=r"[[usedmft]] == 1, [[dmft_solv]] $\in$ [6,7]", - added_in_version="before_v10.5.6", - text=r""" +), + +Variable( + abivarname="dmft_triqs_det_init_size", + varset="dmft", + vartype="integer", + topics=["DmftTriqsCthyb_expert"], + dimensions="scalar", + defaultval=100, + mnemonics="Dynamical Mean Field Theory: TRIQS, DETerminant INITial SIZE", + requires=r"[[usedmft]] == 1, [[dmft_solv]] $\in$ [6,7]", + added_in_version="before_v10.5.6", + text=r""" For the computation of the determinant of the hybridization matrix during the TRIQS/CTHYB run, some memory is initially reserved for a maximal size of [[dmft_triqs_det_init_size]]. This is automatically resized (x2) when the perturbation order becomes larger, but this can take some time if this happens too often. """, - ), - Variable( - abivarname="dmft_triqs_det_n_operations_before_check", - varset="dmft", - vartype="integer", - topics=["DmftTriqsCthyb_expert"], - dimensions="scalar", - defaultval=10000, - mnemonics="Dynamical Mean Field Theory: TRIQS, DETerminant Number of OPERATIONS BEFORE CHECK", - requires=r"[[usedmft]] == 1, [[dmft_solv]] $\in$ [6,7]", - added_in_version="before_v10.5.6", - text=r""" +), + +Variable( + abivarname="dmft_triqs_det_n_operations_before_check", + varset="dmft", + vartype="integer", + topics=["DmftTriqsCthyb_expert"], + dimensions="scalar", + defaultval=10000, + mnemonics="Dynamical Mean Field Theory: TRIQS, DETerminant Number of OPERATIONS BEFORE CHECK", + requires=r"[[usedmft]] == 1, [[dmft_solv]] $\in$ [6,7]", + added_in_version="before_v10.5.6", + text=r""" At each move, the determinant in TRIQS/CTHYB is updated using the Sherman-Morrison formula. However, this formula can be unstable sometimes, and the determinant is thus recomputed from scratch every [[dmft_triqs_det_n_operations_before_check]] operations where the deviation from the Sherman- @@ -3483,69 +3801,73 @@ value if you notice this takes too much time. If you see that Sherman-Morrison formula is too unstable and you repeatedly get some error messages during this check, you should decrease this value. """, - ), - Variable( - abivarname="dmft_triqs_det_precision_error", - varset="dmft", - vartype="real", - topics=["DmftTriqsCthyb_expert"], - dimensions="scalar", - defaultval=1e-5, - mnemonics="Dynamical Mean Field Theory: TRIQS, DETerminant PRECISION ERROR", - requires=r"[[usedmft]] == 1, [[dmft_solv]] $\in$ [6,7]", - added_in_version="before_v10.5.6", - text=r""" +), + +Variable( + abivarname="dmft_triqs_det_precision_error", + varset="dmft", + vartype="real", + topics=["DmftTriqsCthyb_expert"], + dimensions="scalar", + defaultval=1e-5, + mnemonics="Dynamical Mean Field Theory: TRIQS, DETerminant PRECISION ERROR", + requires=r"[[usedmft]] == 1, [[dmft_solv]] $\in$ [6,7]", + added_in_version="before_v10.5.6", + text=r""" After [[dmft_triqs_det_n_operations_before_check]], the determinant is recomputed from scratch and compared to its current value computed with Sherman-Morrison formula. If the deviation is higher than [[dmft_triqs_det_precision_error]], an error message is thrown. If this happens too often, simply lower the value of [[dmft_triqs_det_n_operations_before_check]]. """, - ), - Variable( - abivarname="dmft_triqs_det_precision_warning", - varset="dmft", - vartype="real", - topics=["DmftTriqsCthyb_expert"], - dimensions="scalar", - defaultval=1e-8, - mnemonics="Dynamical Mean Field Theory: TRIQS, DETerminant PRECISION WARNING", - requires=r"[[usedmft]] == 1, [[dmft_solv]] $\in$ [6,7]", - added_in_version="before_v10.5.6", - text=r""" +), + +Variable( + abivarname="dmft_triqs_det_precision_warning", + varset="dmft", + vartype="real", + topics=["DmftTriqsCthyb_expert"], + dimensions="scalar", + defaultval=1e-8, + mnemonics="Dynamical Mean Field Theory: TRIQS, DETerminant PRECISION WARNING", + requires=r"[[usedmft]] == 1, [[dmft_solv]] $\in$ [6,7]", + added_in_version="before_v10.5.6", + text=r""" After [[dmft_triqs_det_n_operations_before_check]], the determinant is recomputed from scratch and compared to its current value computed with Sherman-Morrison formula. If the deviation is higher than [[dmft_triqs_det_precision_warning]], a warning is printed. If this happens too often, simply lower the value of [[dmft_triqs_det_n_operations_before_check]]. """, - ), - Variable( - abivarname="dmft_triqs_det_singular_threshold", - varset="dmft", - vartype="real", - topics=["DmftTriqsCthyb_expert"], - dimensions="scalar", - defaultval=-1.0, - mnemonics="Dynamical Mean Field Theory: TRIQS, DETerminant SINGULAR matrix THRESHOLD", - requires=r"[[usedmft]] == 1, [[dmft_solv]] $\in$ [6,7]", - added_in_version="before_v10.5.6", - text=r""" +), + +Variable( + abivarname="dmft_triqs_det_singular_threshold", + varset="dmft", + vartype="real", + topics=["DmftTriqsCthyb_expert"], + dimensions="scalar", + defaultval=-1.0, + mnemonics="Dynamical Mean Field Theory: TRIQS, DETerminant SINGULAR matrix THRESHOLD", + requires=r"[[usedmft]] == 1, [[dmft_solv]] $\in$ [6,7]", + added_in_version="before_v10.5.6", + text=r""" Tolerance to check if the hybridization matrix is singular. An error is thrown if that is the case. If [[dmft_triqs_det_singular_threshold]] < 0, this is checked using the std::isnormal function on the absolute value of the determinant. Otherwise, this is checked by looking if the absolute value of the determinant is below [[dmft_triqs_det_singular_threshold]]. """, - ), - Variable( - abivarname="dmft_triqs_dlr_epsilon", - varset="dmft", - vartype="real", - topics=["DmftTriqsCthyb_compulsory"], - dimensions="scalar", - defaultval="None", - mnemonics="Dynamical Mean Field Theory: TRIQS, accuracy (EPSILON) for DLR representation", - requires=r"[[usedmft]] == 1, [[dmft_solv]] $\in$ [6,7], [[dmft_triqs_measure_g_l]] == 0", - added_in_version="before_v10.5.6", - text=r""" +), + +Variable( + abivarname="dmft_triqs_dlr_epsilon", + varset="dmft", + vartype="real", + topics=["DmftTriqsCthyb_compulsory"], + dimensions="scalar", + defaultval="None", + mnemonics="Dynamical Mean Field Theory: TRIQS, accuracy (EPSILON) for DLR representation", + requires=r"[[usedmft]] == 1, [[dmft_solv]] $\in$ [6,7], [[dmft_triqs_measure_g_l]] == 0", + added_in_version="before_v10.5.6", + text=r""" Specify the accuracy parameter $\varepsilon$ for the DLR (Discrete Lehmann representation) frequencies used as a compact representation of the noisy imaginary-time Green's function from the CT-QMC ([[dmft_triqs_measure_g_l]]=0). @@ -3556,18 +3878,19 @@ This parameter should always be higher than the statistical noise of your Green's function, as you want to filter this noise rather than represent it. """, - ), - Variable( - abivarname="dmft_triqs_dlr_wmax", - varset="dmft", - vartype="real", - topics=["DmftTriqsCthyb_compulsory"], - dimensions="scalar", - mnemonics="Dynamical Mean Field Theory: TRIQS, frequency (W) MAXimal", - requires=r"[[usedmft]] == 1, [[dmft_solv]] $\in$ [6,7], [[dmft_triqs_measure_g_l]] == 0", - characteristics=["[[ENERGY]]"], - added_in_version="before_v10.5.6", - text=r""" +), + +Variable( + abivarname="dmft_triqs_dlr_wmax", + varset="dmft", + vartype="real", + topics=["DmftTriqsCthyb_compulsory"], + dimensions="scalar", + mnemonics="Dynamical Mean Field Theory: TRIQS, frequency (W) MAXimal", + requires=r"[[usedmft]] == 1, [[dmft_solv]] $\in$ [6,7], [[dmft_triqs_measure_g_l]] == 0", + characteristics=["[[ENERGY]]"], + added_in_version="before_v10.5.6", + text=r""" Specify the maximal real frequency parameter $\omega_{\mathrm{max}}$ for the DLR (Discrete Lehmann representation) frequencies used as a compact representation of the noisy imaginary-time Green's function from the CT-QMC ([[dmft_triqs_measure_g_l]]=0). @@ -3578,64 +3901,68 @@ Can be specified in the unit of your choice (Ha, Ry, eV, K) since it has the [[ENERGY]] characteristics. """, - ), - Variable( - abivarname="dmft_triqs_entropy", - varset="dmft", - vartype="integer", - topics=["DmftTriqsCthyb_useful"], - dimensions="scalar", - defaultval=0, - mnemonics="Dynamical Mean Field Theory: TRIQS, compute ENTROPY ", - requires=r"[[usedmft]] == 1, [[dmft_solv]] $\in$ [6,7]", - added_in_version="before_v10.5.6", - text=r""" +), + +Variable( + abivarname="dmft_triqs_entropy", + varset="dmft", + vartype="integer", + topics=["DmftTriqsCthyb_useful"], + dimensions="scalar", + defaultval=0, + mnemonics="Dynamical Mean Field Theory: TRIQS, compute ENTROPY ", + requires=r"[[usedmft]] == 1, [[dmft_solv]] $\in$ [6,7]", + added_in_version="before_v10.5.6", + text=r""" Computes the DFT+DMFT entropy from the evaluation of the Baym-Kadanoff functional. """, - ), - Variable( - abivarname="dmft_triqs_gaussorder", - varset="dmft", - vartype="integer", - topics=["DmftTriqsCthyb_useful"], - dimensions="scalar", - defaultval="None", - mnemonics="Dynamical Mean Field Theory: TRIQS, GAUSS-Legendre ORDER", - requires=r"[[usedmft]] == 1, [[dmft_solv]] $\in$ [6,7], [[dmft_triqs_compute_integral]] == 1", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="dmft_triqs_gaussorder", + varset="dmft", + vartype="integer", + topics=["DmftTriqsCthyb_useful"], + dimensions="scalar", + defaultval="None", + mnemonics="Dynamical Mean Field Theory: TRIQS, GAUSS-Legendre ORDER", + requires=r"[[usedmft]] == 1, [[dmft_solv]] $\in$ [6,7], [[dmft_triqs_compute_integral]] == 1", + added_in_version="before_v9", + text=r""" When evaluating the coupling constant integral for the computation of the impurity entropy (cf [[dmft_triqs_compute_integral]]), the integration interval [0,1] is split in [[dmft_triqs_nsubdivisions]] regular subdivisions. Then, each one of these subdivisions is evaluated numerically by Gauss-Legendre quadrature of order [[dmft_triqs_gaussorder]], for a total of [[dmft_triqs_gaussorder]] $\times$ [[dmft_triqs_nsubdivisions]] integration points. """, - ), - Variable( - abivarname="dmft_triqs_imag_threshold", - varset="dmft", - vartype="real", - topics=["DmftTriqsCthyb_expert"], - dimensions="scalar", - defaultval=1e-13, - mnemonics="Dynamical Mean Field Theory: TRIQS, IMAGinary part THRESHOLD", - requires=r"[[usedmft]] == 1, [[dmft_solv]] $\in$ [6,7]", - added_in_version="before_v10.5.6", - text=r""" +), + +Variable( + abivarname="dmft_triqs_imag_threshold", + varset="dmft", + vartype="real", + topics=["DmftTriqsCthyb_expert"], + dimensions="scalar", + defaultval=1e-13, + mnemonics="Dynamical Mean Field Theory: TRIQS, IMAGinary part THRESHOLD", + requires=r"[[usedmft]] == 1, [[dmft_solv]] $\in$ [6,7]", + added_in_version="before_v10.5.6", + text=r""" In the real version of TRIQS/CTHYB, only the hybridization components having a maximal imaginary part below [[dmft_triqs_imag_threshold]] are kept. """, - ), - Variable( - abivarname="dmft_triqs_length_cycle", - varset="dmft", - vartype="integer", - topics=["DmftTriqsCthyb_compulsory"], - dimensions="scalar", - defaultval="None", - mnemonics="Dynamical Mean Field Theory: TRIQS, LENGTH of CYCLE", - requires=r"[[usedmft]] == 1, [[dmft_solv]] $\in$ [6,7]", - added_in_version="before_v10.5.6", - text=r""" +), + +Variable( + abivarname="dmft_triqs_length_cycle", + varset="dmft", + vartype="integer", + topics=["DmftTriqsCthyb_compulsory"], + dimensions="scalar", + defaultval="None", + mnemonics="Dynamical Mean Field Theory: TRIQS, LENGTH of CYCLE", + requires=r"[[usedmft]] == 1, [[dmft_solv]] $\in$ [6,7]", + added_in_version="before_v10.5.6", + text=r""" Sets the number of sweeps in one cycle of TRIQS/CT-HYB. Measurements are only performed at the end of each cycle. @@ -3648,70 +3975,74 @@ If this variable is higher than the autocorrelation time, you will lose statistics. """, - ), - Variable( - abivarname="dmft_triqs_loc_n_max", - varset="dmft", - vartype="integer", - topics=["DmftTriqsCthyb_expert"], - dimensions="scalar", - defaultval=2147483647, - mnemonics="Dynamical Mean Field Theory: TRIQS, LOCal Hilbert space Number MAXimal", - requires=r"[[usedmft]] == 1, [[dmft_solv]] $\in$ [6,7]", - added_in_version="before_v10.5.6", - text=r""" +), + +Variable( + abivarname="dmft_triqs_loc_n_max", + varset="dmft", + vartype="integer", + topics=["DmftTriqsCthyb_expert"], + dimensions="scalar", + defaultval=2147483647, + mnemonics="Dynamical Mean Field Theory: TRIQS, LOCal Hilbert space Number MAXimal", + requires=r"[[usedmft]] == 1, [[dmft_solv]] $\in$ [6,7]", + added_in_version="before_v10.5.6", + text=r""" This allows to truncate the local Hilbert space in TRIQS/CTHYB by keeping only the states with a number of electrons comprised between [ [[dmft_triqs_loc_n_min]],[[dmft_triqs_loc_n_max]] ]. This greatly speed-up the calculation, but can generate ergodicity issues if you filter states with non-negligible contributions. """, - ), - Variable( - abivarname="dmft_triqs_loc_n_min", - varset="dmft", - vartype="integer", - topics=["DmftTriqsCthyb_expert"], - dimensions="scalar", - defaultval=0, - mnemonics="Dynamical Mean Field Theory: TRIQS, LOCal Hilbert space Number MINimal", - requires=r"[[usedmft]] == 1, [[dmft_solv]] $\in$ [6,7]", - added_in_version="before_v10.5.6", - text=r""" +), + +Variable( + abivarname="dmft_triqs_loc_n_min", + varset="dmft", + vartype="integer", + topics=["DmftTriqsCthyb_expert"], + dimensions="scalar", + defaultval=0, + mnemonics="Dynamical Mean Field Theory: TRIQS, LOCal Hilbert space Number MINimal", + requires=r"[[usedmft]] == 1, [[dmft_solv]] $\in$ [6,7]", + added_in_version="before_v10.5.6", + text=r""" This allows to truncate the local Hilbert space in TRIQS/CTHYB by keeping only the states with a number of electrons comprised between [ [[dmft_triqs_loc_n_min]],[[dmft_triqs_loc_n_max]] ]. This greatly speed-up the calculation, but can generate ergodicity issues if you filter states with non-negligible contributions. """, - ), - Variable( - abivarname="dmft_triqs_measure_density_matrix", - varset="dmft", - vartype="integer", - topics=["DmftTriqsCthyb_expert"], - dimensions="scalar", - defaultval="1 if [[dmft_triqs_off_diag]]=0, 0 otherwise", - mnemonics="Dynamical Mean Field Theory: TRIQS, MEASUREment of the DENSITY MATRIX", - requires=r"[[usedmft]] == 1, [[dmft_solv]] $\in$ [6,7], [[dmft_triqs_use_norm_as_weight]] == 1, [[dmft_triqs_off_diag]] == 0", - added_in_version="before_v10.5.6", - text=r""" +), + +Variable( + abivarname="dmft_triqs_measure_density_matrix", + varset="dmft", + vartype="integer", + topics=["DmftTriqsCthyb_expert"], + dimensions="scalar", + defaultval="1 if [[dmft_triqs_off_diag]]=0, 0 otherwise", + mnemonics="Dynamical Mean Field Theory: TRIQS, MEASUREment of the DENSITY MATRIX", + requires=r"[[usedmft]] == 1, [[dmft_solv]] $\in$ [6,7], [[dmft_triqs_use_norm_as_weight]] == 1, [[dmft_triqs_off_diag]] == 0", + added_in_version="before_v10.5.6", + text=r""" Set to 1 to active the measurement of the impurity density matrix in TRIQS/CTHYB. This greatly improves the accuracy of static observables such as the number of electrons, energy... Currently, TRIQS/CTHYB does not support this feature with off-diagonal components. The sampling efficiency of the density matrix can be improved by activating [[dmft_triqs_time_invariance]]. """, - ), - Variable( - abivarname="dmft_triqs_measure_g_l", - varset="dmft", - vartype="integer", - topics=["DmftTriqsCthyb_expert"], - dimensions="scalar", - defaultval=0, - mnemonics="Dynamical Mean Field Theory: TRIQS, MEASUREment of the G_l coefficients for Legendre representation", - requires=r"[[usedmft]] == 1, [[dmft_solv]] $\in$ [6,7]", - added_in_version="before_v10.5.6", - text=r""" +), + +Variable( + abivarname="dmft_triqs_measure_g_l", + varset="dmft", + vartype="integer", + topics=["DmftTriqsCthyb_expert"], + dimensions="scalar", + defaultval=0, + mnemonics="Dynamical Mean Field Theory: TRIQS, MEASUREment of the G_l coefficients for Legendre representation", + requires=r"[[usedmft]] == 1, [[dmft_solv]] $\in$ [6,7]", + added_in_version="before_v10.5.6", + text=r""" Set to 1 if you want to sample the Green's function directly in the Legendre basis (cf [[cite:Boehnke2011]]). Otherwise, if set to 0, the Green's function is sampled on the imaginary time axis, and a constrained fit is then performed to obtain the coefficients of the @@ -3721,122 +4052,130 @@ See [[dmft_triqs_n_l]] to set the parameters of the Legendre representation, and [[dmft_triqs_dlr_epsilon]] and [[dmft_triqs_dlr_wmax]] for the DLR parameters. """, - ), - Variable( - abivarname="dmft_triqs_move_double", - varset="dmft", - vartype="integer", - topics=["DmftTriqsCthyb_expert"], - dimensions="scalar", - defaultval="[[dmft_triqs_off_diag]]", - mnemonics="Dynamical Mean Field Theory: TRIQS, MOVEs DOUBLE", - requires=r"[[usedmft]] == 1, [[dmft_solv]] $\in$ [6,7]", - added_in_version="before_v10.5.6", - text=r""" +), + +Variable( + abivarname="dmft_triqs_move_double", + varset="dmft", + vartype="integer", + topics=["DmftTriqsCthyb_expert"], + dimensions="scalar", + defaultval="[[dmft_triqs_off_diag]]", + mnemonics="Dynamical Mean Field Theory: TRIQS, MOVEs DOUBLE", + requires=r"[[usedmft]] == 1, [[dmft_solv]] $\in$ [6,7]", + added_in_version="before_v10.5.6", + text=r""" Set to 1 to activate the double moves in TRIQS/CTHYB. Go to their website for more information on this move. It can be required for ergodicity in the off-diagonal case. """, - ), - Variable( - abivarname="dmft_triqs_move_shift", - varset="dmft", - vartype="integer", - topics=["DmftTriqsCthyb_expert"], - dimensions="scalar", - defaultval=1, - mnemonics="Dynamical Mean Field Theory: TRIQS, MOVE SHIFT", - requires=r"[[usedmft]] == 1, [[dmft_solv]] $\in$ [6,7]", - added_in_version="before_v10.5.6", - text=r""" +), + +Variable( + abivarname="dmft_triqs_move_shift", + varset="dmft", + vartype="integer", + topics=["DmftTriqsCthyb_expert"], + dimensions="scalar", + defaultval=1, + mnemonics="Dynamical Mean Field Theory: TRIQS, MOVE SHIFT", + requires=r"[[usedmft]] == 1, [[dmft_solv]] $\in$ [6,7]", + added_in_version="before_v10.5.6", + text=r""" Set to 1 to activate the shift move in TRIQS/CTHYB. Go to their website for more information on this move. It is never required for ergodicity, but is quite efficient in lowering the auto-correlation time, and has very high acceptance rates. """, - ), - Variable( - abivarname="dmft_triqs_n_cycles", - varset="dmft", - vartype="integer", - topics=["DmftTriqsCthyb_compulsory"], - dimensions="scalar", - defaultval="None", - mnemonics="Dynamical Mean Field Theory: TRIQS, Number of measurement CYCLES", - requires=r"[[usedmft]] == 1, [[dmft_solv]] $\in$ [6,7]", - added_in_version="before_v10.5.6", - text=r""" +), + +Variable( + abivarname="dmft_triqs_n_cycles", + varset="dmft", + vartype="integer", + topics=["DmftTriqsCthyb_compulsory"], + dimensions="scalar", + defaultval="None", + mnemonics="Dynamical Mean Field Theory: TRIQS, Number of measurement CYCLES", + requires=r"[[usedmft]] == 1, [[dmft_solv]] $\in$ [6,7]", + added_in_version="before_v10.5.6", + text=r""" Number of measurement cycles on each CPU for TRIQS/CT-HYB. This parameter controls the level of statistical noise on your output quantities. """, - ), - Variable( - abivarname="dmft_triqs_n_iw", - varset="dmft", - vartype="integer", - topics=["DmftTriqsCthyb_compulsory"], - dimensions="scalar", - defaultval="None", - mnemonics="Dynamical Mean Field Theory: TRIQS, Number of Imaginary frequencies (W)", - requires=r"[[usedmft]] == 1, [[dmft_solv]] $\in$ [6,7]", - added_in_version="before_v10.5.6", - text=r""" +), + +Variable( + abivarname="dmft_triqs_n_iw", + varset="dmft", + vartype="integer", + topics=["DmftTriqsCthyb_compulsory"], + dimensions="scalar", + defaultval="None", + mnemonics="Dynamical Mean Field Theory: TRIQS, Number of Imaginary frequencies (W)", + requires=r"[[usedmft]] == 1, [[dmft_solv]] $\in$ [6,7]", + added_in_version="before_v10.5.6", + text=r""" Number of linear Matsubara frequencies for the representation of the Green's function (only in the case [[dmft_solv]] $\in$ [6,7]). The high-frequency behavior is taken into account via a moment expansion of the Green's function up to order 5, where the moments are computed analytically in a self-consistent fashion. """, - ), - Variable( - abivarname="dmft_triqs_n_l", - varset="dmft", - vartype="integer", - topics=["DmftTriqsCthyb_useful"], - dimensions="scalar", - mnemonics="Dynamical Mean Field Theory: TRIQS, Number of LEGendre polynomials", - requires=r"[[usedmft]] == 1, [[dmft_solv]] $\in$ [6,7], [[dmft_triqs_measure_g_l]] == 1", - added_in_version="before_v10.5.6", - text=r""" +), + +Variable( + abivarname="dmft_triqs_n_l", + varset="dmft", + vartype="integer", + topics=["DmftTriqsCthyb_useful"], + dimensions="scalar", + mnemonics="Dynamical Mean Field Theory: TRIQS, Number of LEGendre polynomials", + requires=r"[[usedmft]] == 1, [[dmft_solv]] $\in$ [6,7], [[dmft_triqs_measure_g_l]] == 1", + added_in_version="before_v10.5.6", + text=r""" Specify the number of Legendre polynomials used for the calculation of Green's function in TRIQS/CTHYB (cf [[cite:Boehnke2011]]). """, - ), - Variable( - abivarname="dmft_triqs_n_tau", - varset="dmft", - vartype="integer", - topics=["DmftTriqsCthyb_compulsory"], - dimensions="scalar", - mnemonics="Dynamical Mean Field Theory: TRIQS, Number of TAU points", - requires=r"[[usedmft]] == 1, [[dmft_solv]] $\in$ [6,7]", - added_in_version="before_v10.5.6", - text=r""" +), + +Variable( + abivarname="dmft_triqs_n_tau", + varset="dmft", + vartype="integer", + topics=["DmftTriqsCthyb_compulsory"], + dimensions="scalar", + mnemonics="Dynamical Mean Field Theory: TRIQS, Number of TAU points", + requires=r"[[usedmft]] == 1, [[dmft_solv]] $\in$ [6,7]", + added_in_version="before_v10.5.6", + text=r""" Specify the number of imaginary time points for the binned representation of the Green's function and hybridization function on the segment [0, $\beta$] in TRIQS/CT-HYB. """, - ), - Variable( - abivarname="dmft_triqs_n_warmup_cycles_init", - varset="dmft", - vartype="integer", - topics=["DmftTriqsCthyb_compulsory"], - dimensions="scalar", - mnemonics="Dynamical Mean Field Theory: TRIQS, Number of WARMUP CYCLES at INITialization", - requires=r"[[usedmft]] == 1, [[dmft_solv]] $\in$ [6,7]", - added_in_version="before_v10.5.6", - text=r""" +), + +Variable( + abivarname="dmft_triqs_n_warmup_cycles_init", + varset="dmft", + vartype="integer", + topics=["DmftTriqsCthyb_compulsory"], + dimensions="scalar", + mnemonics="Dynamical Mean Field Theory: TRIQS, Number of WARMUP CYCLES at INITialization", + requires=r"[[usedmft]] == 1, [[dmft_solv]] $\in$ [6,7]", + added_in_version="before_v10.5.6", + text=r""" Specify the number of warmup cycles for each CPU when starting from an empty configuration in TRIQS/CT-HYB. This typically needs to be quite high, especially at low temperatures. """, - ), - Variable( - abivarname="dmft_triqs_n_warmup_cycles_restart", - varset="dmft", - vartype="integer", - topics=["DmftTriqsCthyb_compulsory"], - dimensions="scalar", - mnemonics="Dynamical Mean Field Theory: TRIQS, Number of WARMUP CYCLES at RESTART", - requires=r"[[usedmft]] == 1, [[dmft_solv]] $\in$ [6,7]", - added_in_version="before_v10.5.6", - text=r""" +), + +Variable( + abivarname="dmft_triqs_n_warmup_cycles_restart", + varset="dmft", + vartype="integer", + topics=["DmftTriqsCthyb_compulsory"], + dimensions="scalar", + mnemonics="Dynamical Mean Field Theory: TRIQS, Number of WARMUP CYCLES at RESTART", + requires=r"[[usedmft]] == 1, [[dmft_solv]] $\in$ [6,7]", + added_in_version="before_v10.5.6", + text=r""" Specify the number of warmup cycles for each CPU when restarting the TRIQS/CT-HYB simulation from a previous configuration. This typically does not need to be very high, and can even be set to 0 most of the time. @@ -3848,51 +4187,54 @@ The restart feature is only available with our internal version of TRIQS/CT-HYB. """, - ), - Variable( - abivarname="dmft_triqs_nsubdivisions", - varset="dmft", - vartype="integer", - topics=["DmftTriqsCthyb_expert"], - dimensions="scalar", - defaultval="None", - mnemonics="Dynamical Mean Field Theory: TRIQS, Number of SUBDIVISIONS", - requires=r"[[usedmft]] == 1, [[dmft_solv]] $\in$ [6,7], [[dmft_triqs_compute_integral]] == 1", - added_in_version="before_v10.5.6", - text=r""" +), + +Variable( + abivarname="dmft_triqs_nsubdivisions", + varset="dmft", + vartype="integer", + topics=["DmftTriqsCthyb_expert"], + dimensions="scalar", + defaultval="None", + mnemonics="Dynamical Mean Field Theory: TRIQS, Number of SUBDIVISIONS", + requires=r"[[usedmft]] == 1, [[dmft_solv]] $\in$ [6,7], [[dmft_triqs_compute_integral]] == 1", + added_in_version="before_v10.5.6", + text=r""" When evaluating the coupling constant integral for the computation of the impurity entropy (cf [[dmft_triqs_compute_integral]]), the integration interval [0,1] is split in [[dmft_triqs_nsubdivisions]] regular subdivisions. Then, each one of these subdivisions is evaluated numerically by Gauss-Legendre quadrature of order [[dmft_triqs_gaussorder]], for a total of [[dmft_triqs_gaussorder]] $\times$ [[dmft_triqs_nsubdivisions]] integration points. """, - ), - Variable( - abivarname="dmft_triqs_off_diag", - varset="dmft", - vartype="integer", - topics=["DmftTriqsCthyb_compulsory"], - dimensions="scalar", - mnemonics="Dynamical Mean Field Theory: TRIQS, OFF-DIAGonal components", - requires=r"[[usedmft]] == 1, [[dmft_solv]] $\in$ [6,7]", - added_in_version="before_v10.5.6", - text=r""" +), + +Variable( + abivarname="dmft_triqs_off_diag", + varset="dmft", + vartype="integer", + topics=["DmftTriqsCthyb_compulsory"], + dimensions="scalar", + mnemonics="Dynamical Mean Field Theory: TRIQS, OFF-DIAGonal components", + requires=r"[[usedmft]] == 1, [[dmft_solv]] $\in$ [6,7]", + added_in_version="before_v10.5.6", + text=r""" Set to 1 to keep all off-diagonal components of the hybridization and electronic levels for the TRIQS/CT-HYB run. If set to 0, the off-diagonal elements are set to 0 before the Monte-Carlo run (in the basis specified by [[dmft_triqs_basis]]). This allows to use the feature [[dmft_triqs_measure_density_matrix]] for more accurate results, but the calculation is no longer numerically exact. """, - ), - Variable( - abivarname="dmft_triqs_pauli_prob", - varset="dmft", - vartype="real", - topics=["DmftTriqsCthyb_expert"], - dimensions="scalar", - defaultval="0.8 if [[dmft_solv]]=7, 1 if [[dmft_solv]]=6", - mnemonics="Dynamical Mean Field Theory: TRIQS, PAULI PROBability", - requires=r"[[usedmft]] == 1, [[dmft_solv]] $\in$ [6,7]", - added_in_version="before_v10.5.6", - text=r""" +), + +Variable( + abivarname="dmft_triqs_pauli_prob", + varset="dmft", + vartype="real", + topics=["DmftTriqsCthyb_expert"], + dimensions="scalar", + defaultval="0.8 if [[dmft_solv]]=7, 1 if [[dmft_solv]]=6", + mnemonics="Dynamical Mean Field Theory: TRIQS, PAULI PROBability", + requires=r"[[usedmft]] == 1, [[dmft_solv]] $\in$ [6,7]", + added_in_version="before_v10.5.6", + text=r""" For the insert/remove moves, a proportion [[dmft_triqs_pauli_prob]] of the moves will be proposed according to Pauli principle. This means that the two operators will be inserted/removed such that two operators of the same type do not follow each other. The remaining proportion @@ -3904,65 +4246,69 @@ This feature is only available with our internal version of TRIQS/CT-HYB. """, - ), - Variable( - abivarname="dmft_triqs_prt_entropy", - varset="dmft", - vartype="integer", - topics=["DmftTriqsCthyb_expert"], - dimensions="scalar", - defaultval=0, - mnemonics="Dynamical Mean Field Theory: TRIQS, PRinT additional info for ENTROPY", - requires=r"[[usedmft]] == 1, [[dmft_solv]] $\in$ [6,7]", - added_in_version="before_v10.5.6", - text=r""" +), + +Variable( + abivarname="dmft_triqs_prt_entropy", + varset="dmft", + vartype="integer", + topics=["DmftTriqsCthyb_expert"], + dimensions="scalar", + defaultval=0, + mnemonics="Dynamical Mean Field Theory: TRIQS, PRinT additional info for ENTROPY", + requires=r"[[usedmft]] == 1, [[dmft_solv]] $\in$ [6,7]", + added_in_version="before_v10.5.6", + text=r""" Print additional information when performing the thermodynamic integration (cf [[dmft_triqs_compute_integral]]), in order to help you tune your parameters. For each value of the coupling constant $\lambda$, print the occupation numbers, the Green's function, etc. This might increase the measurement time. """, - ), - Variable( - abivarname="dmft_triqs_random_seed_a", - varset="dmft", - vartype="integer", - topics=["DmftTriqsCthyb_expert"], - dimensions="scalar", - defaultval=34788, - mnemonics="Dynamical Mean Field Theory: TRIQS, RANDOM SEED A", - requires=r"[[usedmft]] == 1, [[dmft_solv]] $\in$ [6,7]", - added_in_version="before_v10.5.6", - text=r""" +), + +Variable( + abivarname="dmft_triqs_random_seed_a", + varset="dmft", + vartype="integer", + topics=["DmftTriqsCthyb_expert"], + dimensions="scalar", + defaultval=34788, + mnemonics="Dynamical Mean Field Theory: TRIQS, RANDOM SEED A", + requires=r"[[usedmft]] == 1, [[dmft_solv]] $\in$ [6,7]", + added_in_version="before_v10.5.6", + text=r""" Controls the seed of TRIQS/CTHYB, which is [[dmft_triqs_random_seed_a]] + rank $\times$ [[dmft_triqs_random_seed_b]]. """, - ), - Variable( - abivarname="dmft_triqs_random_seed_b", - varset="dmft", - vartype="integer", - topics=["DmftTriqsCthyb_expert"], - dimensions="scalar", - defaultval=928374, - mnemonics="Dynamical Mean Field Theory: TRIQS, RANDOM SEED B", - requires=r"[[usedmft]] == 1, [[dmft_solv]] $\in$ [6,7]", - added_in_version="before_v10.5.6", - text=r""" +), + +Variable( + abivarname="dmft_triqs_random_seed_b", + varset="dmft", + vartype="integer", + topics=["DmftTriqsCthyb_expert"], + dimensions="scalar", + defaultval=928374, + mnemonics="Dynamical Mean Field Theory: TRIQS, RANDOM SEED B", + requires=r"[[usedmft]] == 1, [[dmft_solv]] $\in$ [6,7]", + added_in_version="before_v10.5.6", + text=r""" Controls the seed of TRIQS/CTHYB, which is [[dmft_triqs_random_seed_a]] + rank $\times$ [[dmft_triqs_random_seed_b]]. """, - ), - Variable( - abivarname="dmft_triqs_read_ctqmcdata", - varset="dmft", - vartype="integer", - topics=["DmftTriqsCthyb_expert"], - dimensions="scalar", - defaultval=1, - mnemonics="Dynamical Mean Field Theory: TRIQS, READ CT-QMC DATA", - requires=r"[[usedmft]] == 1, [[dmft_solv]] $\in$ [6,7]", - added_in_version="before_v10.5.6", - text=r""" +), + +Variable( + abivarname="dmft_triqs_read_ctqmcdata", + varset="dmft", + vartype="integer", + topics=["DmftTriqsCthyb_expert"], + dimensions="scalar", + defaultval=1, + mnemonics="Dynamical Mean Field Theory: TRIQS, READ CT-QMC DATA", + requires=r"[[usedmft]] == 1, [[dmft_solv]] $\in$ [6,7]", + added_in_version="before_v10.5.6", + text=r""" At each CT-HYB run, the initial configuration of the Monte-Carlo is read from file (either the last configuration of the previous iteration or the one specified by [[getctqmcdata]] if this is the first iteration). This greatly speeds up warmup. @@ -3972,18 +4318,19 @@ The restart feature is only available with our internal version of TRIQS/CT-HYB. """, - ), - Variable( - abivarname="dmft_triqs_shift_mu", - varset="dmft", - vartype="real", - topics=["DmftTriqsCthyb_expert"], - dimensions="scalar", - defaultval=0.0, - mnemonics="Dynamical Mean Field Theory: TRIQS, SHIFT of the chemical potential (MU)", - requires=r"[[usedmft]] == 1, [[dmft_solv]] $\in$ [6,7]", - added_in_version="before_v10.5.6", - text=r""" +), + +Variable( + abivarname="dmft_triqs_shift_mu", + varset="dmft", + vartype="real", + topics=["DmftTriqsCthyb_expert"], + dimensions="scalar", + defaultval=0.0, + mnemonics="Dynamical Mean Field Theory: TRIQS, SHIFT of the chemical potential (MU)", + requires=r"[[usedmft]] == 1, [[dmft_solv]] $\in$ [6,7]", + added_in_version="before_v10.5.6", + text=r""" During the thermodynamic integration for the entropy calculation, the coupling constant $\lambda$ can also be set in front of the chemical potential in order to make the CT-HYB run easier. It is set such that the true chemical potential of the system $\mu$ is recovered at $\lambda$=1, @@ -3996,18 +4343,19 @@ as $\lambda$ decreases. Be careful however, as setting a high value of [[dmft_triqs_shift_mu]] will require a higher number of integration points. """, - ), - Variable( - abivarname="dmft_triqs_time_invariance", - varset="dmft", - vartype="integer", - topics=["DmftTriqsCthyb_expert"], - dimensions="scalar", - defaultval="[[dmft_triqs_measure_density_matrix]]", - mnemonics="Dynamical Mean Field Theory: TRIQS, TIME INVARIANCE", - requires=r"[[usedmft]] == 1, [[dmft_solv]] $\in$ [6,7], [[dmft_triqs_measure_density_matrix]] == 1", - added_in_version="before_v10.5.6", - text=r""" +), + +Variable( + abivarname="dmft_triqs_time_invariance", + varset="dmft", + vartype="integer", + topics=["DmftTriqsCthyb_expert"], + dimensions="scalar", + defaultval="[[dmft_triqs_measure_density_matrix]]", + mnemonics="Dynamical Mean Field Theory: TRIQS, TIME INVARIANCE", + requires=r"[[usedmft]] == 1, [[dmft_solv]] $\in$ [6,7], [[dmft_triqs_measure_density_matrix]] == 1", + added_in_version="before_v10.5.6", + text=r""" Set to 1 to activate an improved estimator for the density matrix in TRIQS/CTHYB, based on the time translation invariance of the Hamiltonian. This greatly reduces the statistical noise, but can increase the computation time @@ -4015,51 +4363,54 @@ This feature is only available with our internal version of TRIQS/CT-HYB. """, - ), - Variable( - abivarname="dmft_triqs_tol_block", - varset="dmft", - vartype="real", - topics=["DmftTriqsCthyb_expert"], - dimensions="scalar", - defaultval=1e-12, - mnemonics="Dynamical Mean Field Theory: TRIQS, TOLerance for the BLOCK detection algorithm", - requires=r"[[usedmft]] = 1, [[dmft_solv]] $\in$ [6,7]", - added_in_version="before_v10.5.6", - text=r""" +), + +Variable( + abivarname="dmft_triqs_tol_block", + varset="dmft", + vartype="real", + topics=["DmftTriqsCthyb_expert"], + dimensions="scalar", + defaultval=1e-12, + mnemonics="Dynamical Mean Field Theory: TRIQS, TOLerance for the BLOCK detection algorithm", + requires=r"[[usedmft]] = 1, [[dmft_solv]] $\in$ [6,7]", + added_in_version="before_v10.5.6", + text=r""" Before any CT-HYB run, the code rotates in the basis specified by [[dmft_triqs_basis]]. Then, all the off-diagonal elements below the threshold [[dmft_triqs_tol_block]] are set to 0 in order to try and reveal a compact block structure to reduce the computation time. This block structure is automatically detected. Try not to set this value above numerical noise. """, - ), - Variable( - abivarname="dmft_triqs_use_norm_as_weight", - varset="dmft", - vartype="integer", - topics=["DmftTriqsCthyb_expert"], - dimensions="scalar", - defaultval="[[dmft_triqs_measure_density_matrix]]", - mnemonics="Dynamical Mean Field Theory: TRIQS, USE NORM of the matrix AS atomic WEIGHT", - requires=r"[[usedmft]] == 1, [[dmft_solv]] $\in$ [6,7]", - added_in_version="before_v10.5.6", - text=r""" +), + +Variable( + abivarname="dmft_triqs_use_norm_as_weight", + varset="dmft", + vartype="integer", + topics=["DmftTriqsCthyb_expert"], + dimensions="scalar", + defaultval="[[dmft_triqs_measure_density_matrix]]", + mnemonics="Dynamical Mean Field Theory: TRIQS, USE NORM of the matrix AS atomic WEIGHT", + requires=r"[[usedmft]] == 1, [[dmft_solv]] $\in$ [6,7]", + added_in_version="before_v10.5.6", + text=r""" Set to 1 to use the Frobenius norm of the matrix instead of its trace as atomic weight in TRIQS/CTHYB. This is required when sampling the density matrix in order to have full ergodicity. """, - ), - Variable( - abivarname="dmft_wanorthnorm", - varset="dmft", - vartype="integer", - topics=["DMFT_expert", "DmftTriqsCthyb_expert"], - dimensions="scalar", - defaultval=3, - mnemonics="Dynamical Mean Field Theory: WANnier OrthoNormalization", - requires="[[usedmft]] == 1", - added_in_version="9.4.0", - text=r""" +), + +Variable( + abivarname="dmft_wanorthnorm", + varset="dmft", + vartype="integer", + topics=["DMFT_expert", "DmftTriqsCthyb_expert"], + dimensions="scalar", + defaultval=3, + mnemonics="Dynamical Mean Field Theory: WANnier OrthoNormalization", + requires="[[usedmft]] == 1", + added_in_version="9.4.0", + text=r""" Definition of the orthonormalization scheme for the Wannier functions. As we project the orbitals on a finite energy window [ [[dmftbandi]],[[dmftbandf]] ], they might no longer be orthonormal, so it is necessary to orthonormalize them in order to build true @@ -4079,77 +4430,82 @@ or [[dmft_solv]] $\in$ [6,7] as this is the only rigorous choice to compare energies between different systems. """, - ), - Variable( - abivarname="dmft_wanrad", - varset="dmft", - vartype="real", - topics=["DmftTriqsCthyb_expert"], - dimensions="scalar", - mnemonics="Dynamical Mean Field Theory: WANnier functions radius", - requires=r"[[usedmft]] == 1, [[dmft_solv]] $\in$ [6,7], [[dmft_prtwan]] == 1", - characteristics=["[[LENGTH]]"], - added_in_version="before_v10.5.6", - text=r""" +), + +Variable( + abivarname="dmft_wanrad", + varset="dmft", + vartype="real", + topics=["DmftTriqsCthyb_expert"], + dimensions="scalar", + mnemonics="Dynamical Mean Field Theory: WANnier functions radius", + requires=r"[[usedmft]] == 1, [[dmft_solv]] $\in$ [6,7], [[dmft_prtwan]] == 1", + characteristics=["[[LENGTH]]"], + added_in_version="before_v10.5.6", + text=r""" Set the maximal radius up to which the Wannier functions are computed when [[dmft_prtwan]]=1. The PAW grid is extended if needed. Can be specified in the unit of your choice (Bohr, Angstrom) as it has the [[LENGTH]] characteristics. """, - ), - Variable( - abivarname="dmft_x2my2d", - varset="dmft", - vartype="integer", - topics=["DMFT_expert", "DmftTriqsCthyb_expert"], - dimensions="scalar", - defaultval=0, - mnemonics="Dynamical Mean Field Theory: x2my2d orbital", - requires="[[usedmft]] == 1", - added_in_version="before_v10.5.6", - text=r""" +), + +Variable( + abivarname="dmft_x2my2d", + varset="dmft", + vartype="integer", + topics=["DMFT_expert", "DmftTriqsCthyb_expert"], + dimensions="scalar", + defaultval=0, + mnemonics="Dynamical Mean Field Theory: x2my2d orbital", + requires="[[usedmft]] == 1", + added_in_version="before_v10.5.6", + text=r""" Set to 1 to apply DMFT to the $d_{x^2-y^2}$ orbital only. """, - ), - Variable( - abivarname="dmft_yukawa_epsilon", - varset="dmft", - vartype="real", - topics=["DMFT_expert", "DmftTriqsCthyb_expert"], - dimensions="scalar", - mnemonics="Dynamical Mean Field Theory: dielectric constant (EPSILON) for YUKAWA potential", - requires="[[usedmft]] == 1, [[dmft_yukawa_param]] == 4", - added_in_version="before_v10.5.6", - text=r""" +), + +Variable( + abivarname="dmft_yukawa_epsilon", + varset="dmft", + vartype="real", + topics=["DMFT_expert", "DmftTriqsCthyb_expert"], + dimensions="scalar", + mnemonics="Dynamical Mean Field Theory: dielectric constant (EPSILON) for YUKAWA potential", + requires="[[usedmft]] == 1, [[dmft_yukawa_param]] == 4", + added_in_version="before_v10.5.6", + text=r""" Set the value of the dielectric constant $\varepsilon$ for the Yukawa screened potential (cf [[dmft_yukawa_param]]). """, - ), - Variable( - abivarname="dmft_yukawa_lambda", - varset="dmft", - vartype="real", - topics=["DMFT_expert", "DmftTriqsCthyb_expert"], - dimensions="scalar", - mnemonics="Dynamical Mean Field Theory: inverse screening length (LAMBDA) for YUKAWA potential", - requires="[[usedmft]] == 1, [[dmft_yukawa_param]] == 4", - added_in_version="before_v10.5.6", - text=r""" +), + +Variable( + abivarname="dmft_yukawa_lambda", + varset="dmft", + vartype="real", + topics=["DMFT_expert", "DmftTriqsCthyb_expert"], + dimensions="scalar", + mnemonics="Dynamical Mean Field Theory: inverse screening length (LAMBDA) for YUKAWA potential", + requires="[[usedmft]] == 1, [[dmft_yukawa_param]] == 4", + added_in_version="before_v10.5.6", + text=r""" Set the value of the inverse screening length $\lambda$ (in atomic units) for the Yukawa screened potential (cf [[dmft_yukawa_param]]). """, - ), - Variable( - abivarname="dmft_yukawa_param", - varset="dmft", - vartype="integer", - topics=["DMFT_expert", "DmftTriqsCthyb_expert"], - dimensions="scalar", - defaultval=1, - mnemonics="Dynamical Mean Field Theory: YUKAWA potential PARAMetrization", - requires="[[usedmft]] == 1, [[dmft_dc]] == 8", - added_in_version="before_v10.5.6", - text=r""" +), + +Variable( + abivarname="dmft_yukawa_param", + varset="dmft", + vartype="integer", + topics=["DMFT_expert", "DmftTriqsCthyb_expert"], + dimensions="scalar", + defaultval=1, + mnemonics="Dynamical Mean Field Theory: YUKAWA potential PARAMetrization", + requires="[[usedmft]] == 1, [[dmft_dc]] == 8", + added_in_version="before_v10.5.6", + text=r""" When activating [[dmft_dc]]=8, the screened potential is assumed to have the form of a Yukawa potential with a dielectric constant: $V_{\text{scr}}(r) = \frac{e^{-\lambda r}}{\varepsilon r}$. The variable [[dmft_yukawa_param]] controls how @@ -4163,63 +4519,67 @@ [[dmft_yukawa_lambda]] and [[dmft_yukawa_epsilon]]. """, - ), - Variable( - abivarname="dmftbandf", - varset="dmft", - vartype="integer", - topics=["DMFT_compulsory", "DmftTriqsCthyb_compulsory"], - dimensions="scalar", - mnemonics="Dynamical Mean Field Theory: BAND: Final", - requires="[[usedmft]] == 1", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="dmftbandf", + varset="dmft", + vartype="integer", + topics=["DMFT_compulsory", "DmftTriqsCthyb_compulsory"], + dimensions="scalar", + mnemonics="Dynamical Mean Field Theory: BAND: Final", + requires="[[usedmft]] == 1", + added_in_version="before_v9", + text=r""" [[dmftbandf]] is the last band taken into account in the Projected Local Orbitals scheme of DFT+DMFT. With [[dmftbandi]], they define the energy window used to define Wannier Functions (see [[cite:Amadon2008]]). """, - ), - Variable( - abivarname="dmftbandi", - varset="dmft", - vartype="integer", - topics=["DMFT_compulsory", "DmftTriqsCthyb_compulsory"], - dimensions="scalar", - mnemonics="Dynamical Mean Field Theory: BAND: Initial", - requires="[[usedmft]] == 1", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="dmftbandi", + varset="dmft", + vartype="integer", + topics=["DMFT_compulsory", "DmftTriqsCthyb_compulsory"], + dimensions="scalar", + mnemonics="Dynamical Mean Field Theory: BAND: Initial", + requires="[[usedmft]] == 1", + added_in_version="before_v9", + text=r""" [[dmftbandi]] is the first band taken into account in the Projected Local Orbitals scheme of DFT+DMFT. With [[dmftbandf]], they define the energy window used to define Wannier Functions (see [[cite:Amadon2008]]). """, - ), - Variable( - abivarname="dmftcheck", - varset="dmft", - vartype="integer", - topics=["DMFT_expert"], - dimensions="scalar", - defaultval=0, - mnemonics="Dynamical Mean Field Theory: CHECKs", - requires="[[usedmft]] == 1", - characteristics=["[[DEVELOP]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="dmftcheck", + varset="dmft", + vartype="integer", + topics=["DMFT_expert"], + dimensions="scalar", + defaultval=0, + mnemonics="Dynamical Mean Field Theory: CHECKs", + requires="[[usedmft]] == 1", + characteristics=["[[DEVELOP]]"], + added_in_version="before_v9", + text=r""" Only for developer purposes. """, - ), - Variable( - abivarname="dmftctqmc_basis", - varset="dmft", - vartype="integer", - topics=["DMFT_basic"], - dimensions="scalar", - defaultval=1, - mnemonics="Dynamical Mean Field Theory: Continuous Time Quantum Monte Carlo BASIS", - requires="[[usedmft]] == 1, [[dmft_solv]] == 5", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="dmftctqmc_basis", + varset="dmft", + vartype="integer", + topics=["DMFT_basic"], + dimensions="scalar", + defaultval=1, + mnemonics="Dynamical Mean Field Theory: Continuous Time Quantum Monte Carlo BASIS", + requires="[[usedmft]] == 1, [[dmft_solv]] == 5", + added_in_version="before_v9", + text=r""" Choose the basis to perform ABINIT/CTQMC calculation. * 0 --> Use the local basis in the spherical harmonics basis. @@ -4230,19 +4590,20 @@ * 2 --> Diagonalise the local correlated occupation matrix. Can lead to non diagonal Hamiltonian that cannot be handled by CTQMC. This option should be thus avoided. """, - ), - Variable( - abivarname="dmftctqmc_check", - varset="dmft", - vartype="integer", - topics=["DMFT_expert"], - dimensions="scalar", - defaultval=0, - mnemonics="Dynamical Mean Field Theory: Continuous Time Quantum Monte Carlo CHECK", - characteristics=["[[DEVELOP]]"], - requires="[[dmft_solv]] == 5", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="dmftctqmc_check", + varset="dmft", + vartype="integer", + topics=["DMFT_expert"], + dimensions="scalar", + defaultval=0, + mnemonics="Dynamical Mean Field Theory: Continuous Time Quantum Monte Carlo CHECK", + characteristics=["[[DEVELOP]]"], + requires="[[dmft_solv]] == 5", + added_in_version="before_v9", + text=r""" Check the fast calculations during the Monte Carlo simulation with very slow but robust methods. Should only be used for debugging. @@ -4251,73 +4612,77 @@ * 2 --> Check the update of M matrix calculation (Bath operator). * 3 --> Check both. """, - ), - Variable( - abivarname="dmftctqmc_correl", - varset="dmft", - vartype="integer", - topics=["DMFT_expert"], - dimensions="scalar", - defaultval=0, - mnemonics="Dynamical Mean Field Theory: Continuous Time Quantum Monte Carlo CORRELations", - characteristics=["[[DEVELOP]]"], - requires="[[dmft_solv]] == 5", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="dmftctqmc_correl", + varset="dmft", + vartype="integer", + topics=["DMFT_expert"], + dimensions="scalar", + defaultval=0, + mnemonics="Dynamical Mean Field Theory: Continuous Time Quantum Monte Carlo CORRELations", + characteristics=["[[DEVELOP]]"], + requires="[[dmft_solv]] == 5", + added_in_version="before_v9", + text=r""" Flag to compute statistics about segments and anti-segments during the simulation. Slow down the simulation. * 0 --> Nothing done * 1 --> Calculations performed and written in "Correlation.dat" file """, - ), - Variable( - abivarname="dmftctqmc_gmove", - varset="dmft", - vartype="integer", - topics=["DMFT_useful"], - dimensions="scalar", - defaultval=0, - mnemonics="Dynamical Mean Field Theory: Continuous Time Quantum Monte Carlo Global MOVEs", - characteristics=["[[DEVELOP]]"], - requires="[[dmft_solv]] == 5", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="dmftctqmc_gmove", + varset="dmft", + vartype="integer", + topics=["DMFT_useful"], + dimensions="scalar", + defaultval=0, + mnemonics="Dynamical Mean Field Theory: Continuous Time Quantum Monte Carlo Global MOVEs", + characteristics=["[[DEVELOP]]"], + requires="[[dmft_solv]] == 5", + added_in_version="before_v9", + text=r""" Default is no global moves. The value of this variable is the modulo used to try a global move. A value of 5000 means that a global move is tried every 5000 Monte Carlo sweep. """, - ), - Variable( - abivarname="dmftctqmc_grnns", - varset="dmft", - vartype="integer", - topics=["DMFT_expert"], - dimensions="scalar", - defaultval=0, - mnemonics="Dynamical Mean Field Theory: Continuous Time Quantum Monte Carlo GReeNs NoiSe", - characteristics=["[[DEVELOP]]"], - requires="[[dmft_solv]] == 5", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="dmftctqmc_grnns", + varset="dmft", + vartype="integer", + topics=["DMFT_expert"], + dimensions="scalar", + defaultval=0, + mnemonics="Dynamical Mean Field Theory: Continuous Time Quantum Monte Carlo GReeNs NoiSe", + characteristics=["[[DEVELOP]]"], + requires="[[dmft_solv]] == 5", + added_in_version="before_v9", + text=r""" Compute the statistical noise for each time slice of each green function. This is a good approximation only if there is enough Monte Carlo sweeps per cpu. * 0 --> Nothing * 1 --> Do it and write the noise in the "Gtau.dat" file. """, - ), - Variable( - abivarname="dmftctqmc_localprop", - varset="dmft", - vartype="integer", - topics=["DMFT_expert"], - dimensions="scalar", - defaultval=0, - mnemonics="Dynamical Mean Field Theory: CTQMC: calculation of local properties", - characteristics=["[[DEVELOP]]"], - requires="[[dmft_solv]] in [5, 8]", - added_in_version="9.5.0", - text=r""" +), + +Variable( + abivarname="dmftctqmc_localprop", + varset="dmft", + vartype="integer", + topics=["DMFT_expert"], + dimensions="scalar", + defaultval=0, + mnemonics="Dynamical Mean Field Theory: CTQMC: calculation of local properties", + characteristics=["[[DEVELOP]]"], + requires="[[dmft_solv]] in [5, 8]", + added_in_version="9.5.0", + text=r""" Compute properties of the local impurity during the CTQMC calculations. * 0 --> Nothing done @@ -4330,34 +4695,36 @@ * 3 --> Add the calculation of local charge susceptibility. """, - ), - Variable( - abivarname="dmftctqmc_meas", - varset="dmft", - vartype="integer", - topics=["DMFT_basic"], - dimensions="scalar", - defaultval=1, - mnemonics="Dynamical Mean Field Theory: Continuous Time Quantum Monte Carlo MEASurements", - requires="[[usedmft]] == 1, [[dmft_solv]] == 5", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="dmftctqmc_meas", + varset="dmft", + vartype="integer", + topics=["DMFT_basic"], + dimensions="scalar", + defaultval=1, + mnemonics="Dynamical Mean Field Theory: Continuous Time Quantum Monte Carlo MEASurements", + requires="[[usedmft]] == 1, [[dmft_solv]] == 5", + added_in_version="before_v9", + text=r""" The modulo used to measure the interaction energy and the number of electrons. Example: 2 means the measure is perform every two sweeps. """, - ), - Variable( - abivarname="dmftctqmc_mov", - varset="dmft", - vartype="integer", - topics=["DMFT_expert"], - dimensions="scalar", - defaultval=0, - mnemonics="Dynamical Mean Field Theory: Continuous Time Quantum Monte Carlo MOVie", - characteristics=["[[DEVELOP]]"], - requires="[[dmft_solv]] == 5", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="dmftctqmc_mov", + varset="dmft", + vartype="integer", + topics=["DMFT_expert"], + dimensions="scalar", + defaultval=0, + mnemonics="Dynamical Mean Field Theory: Continuous Time Quantum Monte Carlo MOVie", + characteristics=["[[DEVELOP]]"], + requires="[[dmft_solv]] == 5", + added_in_version="before_v9", + text=r""" Print a latex file per cpu displaying the full simulation. This option should only be use with very small number (<1000) of Monte Carlo sweeps since it requires a lot of I/O band width. @@ -4365,136 +4732,144 @@ * 0 --> Nothing * 1 --> Write the "Movie_id.dat" file where id is the MPI rank of each process """, - ), - Variable( - abivarname="dmftctqmc_mrka", - varset="dmft", - vartype="integer", - topics=["DMFT_expert"], - dimensions="scalar", - defaultval=0, - mnemonics="Dynamical Mean Field Theory: Continuous Time Quantum Monte Carlo MARKov Analysis", - characteristics=["[[DEVELOP]]"], - requires="[[dmft_solv]] == 5", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="dmftctqmc_mrka", + varset="dmft", + vartype="integer", + topics=["DMFT_expert"], + dimensions="scalar", + defaultval=0, + mnemonics="Dynamical Mean Field Theory: Continuous Time Quantum Monte Carlo MARKov Analysis", + characteristics=["[[DEVELOP]]"], + requires="[[dmft_solv]] == 5", + added_in_version="before_v9", + text=r""" Measure the time evolution of the number of electrons for each orbital and perform a fourier transform. The result can be plotted using the "Markov_id.dat" file * 0 --> Nothing * 1 --> Do it and write the noise in the "Markov_id.dat" file where id is the rank of each MPI process. """, - ), - Variable( - abivarname="dmftctqmc_chains", - varset="dmft", - vartype="integer", - topics=["DMFT_useful"], - dimensions="scalar", - defaultval="number of [[OPENMP]] threads", - mnemonics="Dynamical Mean Field Theory: Continuous Time Quantum Monte Carlo Number of per-MPI tasks Chains", - characteristics=["[[DEVELOP]]"], - requires="[[dmft_solv]] == 5", - added_in_version="10.7", - text=r""" +), + +Variable( + abivarname="dmftctqmc_chains", + varset="dmft", + vartype="integer", + topics=["DMFT_useful"], + dimensions="scalar", + defaultval="number of [[OPENMP]] threads", + mnemonics="Dynamical Mean Field Theory: Continuous Time Quantum Monte Carlo Number of per-MPI tasks Chains", + characteristics=["[[DEVELOP]]"], + requires="[[dmft_solv]] == 5", + added_in_version="10.7", + text=r""" Number of chains each MPI task will run. Those chains will be parallelised using OpenMP threads. Default behaviour is that each MPI task run as many chains as OpenMP threads are defined. Therefore, user is expected to manage this parallelisation level through `OMP_NUM_THREADS` environment variable, while this variable is here for tuning or troubleshooting purposes. Implemented only for dmft_solv == 5. """, - ), - Variable( - abivarname="dmftctqmc_order", - varset="dmft", - vartype="integer", - topics=["DMFT_useful"], - dimensions="scalar", - defaultval=0, - mnemonics="Dynamical Mean Field Theory: Continuous Time Quantum Monte Carlo perturbation ORDER", - characteristics=["[[DEVELOP]]"], - requires="[[dmft_solv]] == 5", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="dmftctqmc_order", + varset="dmft", + vartype="integer", + topics=["DMFT_useful"], + dimensions="scalar", + defaultval=0, + mnemonics="Dynamical Mean Field Theory: Continuous Time Quantum Monte Carlo perturbation ORDER", + characteristics=["[[DEVELOP]]"], + requires="[[dmft_solv]] == 5", + added_in_version="before_v9", + text=r""" Print a file containing the statistic distribution of the number of segments per orbital. The maximal order taken into account [[dmftctqmc_order]]: 50 means that we have the statistic distribution from 0 to 50 segments. The result is written in the "Perturbation.dat" file. """, - ), - Variable( - abivarname="dmftqmc_l", - varset="dmft", - vartype="integer", - topics=["DMFT_compulsory"], - dimensions="scalar", - mnemonics="Dynamical Mean Field Theory: Quantum Monte Carlo time sLices", - requires=r"[[dmft_solv]] >= 5, [[dmft_solv]] $\ne$ [6,7]", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="dmftqmc_l", + varset="dmft", + vartype="integer", + topics=["DMFT_compulsory"], + dimensions="scalar", + mnemonics="Dynamical Mean Field Theory: Quantum Monte Carlo time sLices", + requires=r"[[dmft_solv]] >= 5, [[dmft_solv]] $\ne$ [6,7]", + added_in_version="before_v9", + text=r""" Number of time slices used to represent the time green function. This value should be carefully chosen according to Niquist frequency and the [[tsmear]] value. This is only used for ABINIT internal solvers. """, - ), - Variable( - abivarname="dmftqmc_n", - varset="dmft", - vartype="real", - topics=["DMFT_compulsory"], - dimensions="scalar", - mnemonics="Dynamical Mean Field Theory: Quantum Monte Carlo Number of sweeps", - requires=r"[[dmft_solv]] >= 5, [[dmft_solv]] $\ne$ [6,7]", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="dmftqmc_n", + varset="dmft", + vartype="real", + topics=["DMFT_compulsory"], + dimensions="scalar", + mnemonics="Dynamical Mean Field Theory: Quantum Monte Carlo Number of sweeps", + requires=r"[[dmft_solv]] >= 5, [[dmft_solv]] $\ne$ [6,7]", + added_in_version="before_v9", + text=r""" Number of Monte Carlo sweeps. Should be at least 106. This is only used for ABINIT internal solvers. """, - ), - Variable( - abivarname="dmftqmc_seed", - varset="dmft", - vartype="integer", - topics=["DMFT_useful"], - dimensions="scalar", - defaultval="[[jdtset]]", - mnemonics="Dynamical Mean Field Theory: Quantum Monte Carlo SEED", - characteristics=["[[DEVELOP]]"], - requires=r"[[dmft_solv]] >= 5, [[dmft_solv]] $\ne$ [6,7]", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="dmftqmc_seed", + varset="dmft", + vartype="integer", + topics=["DMFT_useful"], + dimensions="scalar", + defaultval="[[jdtset]]", + mnemonics="Dynamical Mean Field Theory: Quantum Monte Carlo SEED", + characteristics=["[[DEVELOP]]"], + requires=r"[[dmft_solv]] >= 5, [[dmft_solv]] $\ne$ [6,7]", + added_in_version="before_v9", + text=r""" Seed to initialize the random number generator. Should not be relevant except for testing purpose. NOTE: If the CT-QMC ([[dmft_solv]] = 5) is used on many CPUs, each CPU initializes its random number generator with dmftqmc_seed+rank where rank is the rank of the cpu in the MPI communicator. """, - ), - Variable( - abivarname="dmftqmc_therm", - varset="dmft", - vartype="integer", - topics=["DMFT_compulsory"], - dimensions="scalar", - mnemonics="Dynamical Mean Field Theory: Quantum Monte Carlo THERMalization", - requires="[[dmft_solv]] == 5", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="dmftqmc_therm", + varset="dmft", + vartype="integer", + topics=["DMFT_compulsory"], + dimensions="scalar", + mnemonics="Dynamical Mean Field Theory: Quantum Monte Carlo THERMalization", + requires="[[dmft_solv]] == 5", + added_in_version="before_v9", + text=r""" Number of Monte Carlo sweeps for the thermalization. This is only used for ABINIT internal solvers. """, - ), - Variable( - abivarname="dosdeltae", - varset="gstate", - vartype="real", - topics=["printing_prdos", "ElecDOS_useful"], - dimensions="scalar", - defaultval=0.0, - mnemonics="DOS DELTA in Energy", - characteristics=["[[ENERGY]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="dosdeltae", + varset="gstate", + vartype="real", + topics=["printing_prdos", "ElecDOS_useful"], + dimensions="scalar", + defaultval=0.0, + mnemonics="DOS DELTA in Energy", + characteristics=["[[ENERGY]]"], + added_in_version="before_v9", + text=r""" Defines the linear grid resolution (energy increment) to be used for the computation of the Density-Of-States, when [[prtdos]] is non-zero. If [[dosdeltae]] is set to zero (the default value), the actual increment is @@ -4503,18 +4878,19 @@ smearing technique gives a quite smooth DOS, while the DOS from the tetrahedron method is rapidly varying. """, - ), - Variable( - abivarname="dtele", - varset="rttddft", - vartype="real", - topics=["RTTDDFT_basic"], - dimensions="scalar", - requires="[[optdriver]] is 9", - defaultval=0.1, - mnemonics="Delta Time for ELEctrons", - added_in_version="10", - text=r""" +), + +Variable( + abivarname="dtele", + varset="rttddft", + vartype="real", + topics=["RTTDDFT_basic"], + dimensions="scalar", + requires="[[optdriver]] is 9", + defaultval=0.1, + mnemonics="Delta Time for ELEctrons", + added_in_version="10", + text=r""" Defines the electron time step in atomic units of time, used to integrate the time-dependent Kohn-Sham equations in real-time TDDFT [[topic:RTTDDFT]] if [optdriver]] is 9. (One atomic time unit is 2.418884e-17 seconds). @@ -4525,17 +4901,18 @@ The user should try several values in order to find the one allowing for a stable and efficient integration. """, - ), - Variable( - abivarname="dtion", - varset="rlx", - vartype="real", - topics=["PIMD_compulsory", "MolecularDynamics_compulsory", "GeoOpt_compulsory"], - dimensions="scalar", - defaultval=100, - mnemonics="Delta Time for IONs", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="dtion", + varset="rlx", + vartype="real", + topics=["PIMD_compulsory", "MolecularDynamics_compulsory", "GeoOpt_compulsory"], + dimensions="scalar", + defaultval=100, + mnemonics="Delta Time for IONs", + added_in_version="before_v9", + text=r""" Used for controlling ion time steps. If [[geoopt]] is set to "viscous", "quenched" or "fire" ([[ionmov]] is set to 1, 7 or 15), or if [[moldyn]] /= "none", then molecular dynamics is used to update atomic positions in response to forces. @@ -4557,18 +4934,19 @@ It is also used in geometric relaxation calculation with the FIRE algorithm ([[geoopt]] = "fire"), where the time is virtual. A small dtion should be set, for example 0.03. """, - ), - Variable( - abivarname="dynimage", - varset="rlx", - vartype="integer", - topics=["PIMD_expert", "TransPath_expert"], - dimensions=["[[nimage]]"], - defaultval=MultipleValue(number=None, value=1), - mnemonics="list of DYNamic IMAGEs", - commentdefault="if [[imgmov]] in [2,5] (String Method, NEB), dynimage(1)=0 and dynimage([[nimage]])=0.", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="dynimage", + varset="rlx", + vartype="integer", + topics=["PIMD_expert", "TransPath_expert"], + dimensions=["[[nimage]]"], + defaultval=MultipleValue(number=None, value=1), + mnemonics="list of DYNamic IMAGEs", + commentdefault="if [[imgmov]] in [2,5] (String Method, NEB), dynimage(1)=0 and dynimage([[nimage]])=0.", + added_in_version="before_v9", + text=r""" This input variable is relevant when sets of images are activated (see [[imgmov]]). Not all images might be required to evolve from one time step to the other. Indeed, in the String Method or the Nudged Elastic Band, one might @@ -4580,17 +4958,18 @@ In order to save CPU time, the computation of properties of static images ([[dynimage]](iimage)=0) can be avoided: see [[istatimg]] keyword. """, - ), - Variable( - abivarname="ecut", - varset="basic", - vartype="real", - topics=["Planewaves_compulsory"], - dimensions="scalar", - mnemonics="Energy CUToff", - characteristics=["[[ENERGY]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="ecut", + varset="basic", + vartype="real", + topics=["Planewaves_compulsory"], + dimensions="scalar", + mnemonics="Energy CUToff", + characteristics=["[[ENERGY]]"], + added_in_version="before_v9", + text=r""" Used to define the kinetic energy cutoff which controls the number of planewaves at given k point. The allowed plane waves are those with kinetic energy lower than **ecut**, which translates to the following constraint on the planewave vector $\vec{G}$ in reciprocal space @@ -4620,19 +4999,20 @@ See the input variable [[ecutsm]], for the smoothing of the kinetic energy, needed to optimize unit cell parameters. """, - ), - Variable( - abivarname="ecuteps", - varset="gw", - vartype="real", - topics=["Susceptibility_compulsory", "RandStopPow_compulsory"], - dimensions="scalar", - defaultval=0.0, - mnemonics="Energy CUT-off for EPSilon (the dielectric matrix)", - characteristics=["[[ENERGY]]"], - requires="[[optdriver]] in [3, 4]", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="ecuteps", + varset="gw", + vartype="real", + topics=["Susceptibility_compulsory", "RandStopPow_compulsory"], + dimensions="scalar", + defaultval=0.0, + mnemonics="Energy CUT-off for EPSilon (the dielectric matrix)", + characteristics=["[[ENERGY]]"], + requires="[[optdriver]] in [3, 4]", + added_in_version="before_v9", + text=r""" [[ecuteps]] determines the cut-off energy of the planewave set used to represent the independent-particle susceptibility $\chi^{0}_{KS}$, the dielectric matrix $\epsilon$, and its inverse. @@ -4643,19 +5023,20 @@ always) leads to converged results (at the level of 0.01 eV for the energy gap). In any case, a convergence study is worth. """, - ), - Variable( - abivarname="ecutsigx", - varset="gw", - vartype="real", - topics=["SelfEnergy_basic"], - dimensions="scalar", - defaultval=0.0, - mnemonics="Energy CUT-off for SIGma eXchange", - characteristics=["[[ENERGY]]"], - requires="[[optdriver]] == 4", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="ecutsigx", + varset="gw", + vartype="real", + topics=["SelfEnergy_basic"], + dimensions="scalar", + defaultval=0.0, + mnemonics="Energy CUT-off for SIGma eXchange", + characteristics=["[[ENERGY]]"], + requires="[[optdriver]] == 4", + added_in_version="before_v9", + text=r""" [[ecutsigx]] determines the cut-off energy of the planewave set used to generate the exchange part of the self-energy operator. Theoretically, we need [[ecutsigx]] = 4 [[ecut]] to have an exact treatment of $\Sigma_x$. @@ -4667,18 +5048,19 @@ [[ecutsigx]] is actually used to initialize the internal variable [[npwsigx]]. """, - ), - Variable( - abivarname="ecutsm", - varset="rlx", - vartype="real", - topics=["Planewaves_basic"], - dimensions="scalar", - defaultval=0.0, - mnemonics="Energy CUToff SMearing", - characteristics=["[[ENERGY]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="ecutsm", + varset="rlx", + vartype="real", + topics=["Planewaves_basic"], + dimensions="scalar", + defaultval=0.0, + mnemonics="Energy CUToff SMearing", + characteristics=["[[ENERGY]]"], + added_in_version="before_v9", + text=r""" This input variable is important when performing relaxation of unit cell size and shape (non-zero [[optcell]]). Using a non-zero [[ecutsm]], the total energy curves as a function of [[ecut]], or [[acell]], can be smoothed, @@ -4709,19 +5091,20 @@ largely enough for [[ecut]] between 2Ha and 6Ha, to get smooth curves. It is likely that this value is OK as soon as [[ecut]] is larger than 4Ha. """, - ), - Variable( - abivarname="ecutwfn", - varset="gw", - vartype="real", - topics=["Susceptibility_expert", "SelfEnergy_expert"], - dimensions="scalar", - defaultval=ValueWithConditions({"[[optdriver]] in [3, 4]": "[[ecut]]", "defaultval": 0.0}), - mnemonics="Energy CUT-off for WaveFunctioNs", - characteristics=["[[ENERGY]]"], - requires=" [[optdriver]] in [3, 4, 6]", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="ecutwfn", + varset="gw", + vartype="real", + topics=["Susceptibility_expert", "SelfEnergy_expert"], + dimensions="scalar", + defaultval=ValueWithConditions({"[[optdriver]] in [3, 4]": "[[ecut]]", "defaultval": 0.0}), + mnemonics="Energy CUT-off for WaveFunctioNs", + characteristics=["[[ENERGY]]"], + requires=" [[optdriver]] in [3, 4, 6]", + added_in_version="before_v9", + text=r""" [[ecutwfn]] determines the cut-off energy of the planewave set used to represent the wavefunctions in the formula that generates the independent- particle susceptibility $\chi^{0}_{KS}$ (for [[optdriver]] = 3), or the self- @@ -4740,34 +5123,36 @@ The size of this set of planewaves is [[npwwfn]]. """, - ), - Variable( - abivarname="effmass_free", - varset="dev", - vartype="real", - topics=["Artificial_expert"], - dimensions="scalar", - defaultval=1, - mnemonics="EFFective MASS for the FREE electron", - characteristics=["[[DEVELOP]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="effmass_free", + varset="dev", + vartype="real", + topics=["Artificial_expert"], + dimensions="scalar", + defaultval=1, + mnemonics="EFFective MASS for the FREE electron", + characteristics=["[[DEVELOP]]"], + added_in_version="before_v9", + text=r""" This parameter allows one to change the free electron mass, with respect to its experimental value. The electron mass is simply changed in the Schrodinger equation. Only for testing purposes, of course. """, - ), - Variable( - abivarname="efield", - varset="ffield", - vartype="real", - topics=["Berry_basic"], - dimensions=[3], - defaultval=MultipleValue(number=3, value=0.0), - mnemonics="Electric FIELD", - requires="[[berryopt]] in [4, 6]", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="efield", + varset="ffield", + vartype="real", + topics=["Berry_basic"], + dimensions=[3], + defaultval=MultipleValue(number=3, value=0.0), + mnemonics="Electric FIELD", + requires="[[berryopt]] in [4, 6]", + added_in_version="before_v9", + text=r""" In case [[berryopt]] = 4, a finite electric field calculation is performed. The value of this electric field, and its direction is determined by [[efield]]. It must be given in atomic units (1 a.u. of electric field= 514220624373.482 @@ -4789,17 +5174,18 @@ electric constant (8.854187817d-12 F/m), and $a_0$ is the Bohr radius in meter (0.5291772108$^{-10}$). """, - ), - Variable( - abivarname="efmas", - varset="dfpt", - vartype="integer", - topics=["EffectiveMass_compulsory"], - dimensions="scalar", - defaultval=0, - mnemonics="EFfective MASs", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="efmas", + varset="dfpt", + vartype="integer", + topics=["EffectiveMass_compulsory"], + dimensions="scalar", + defaultval=0, + mnemonics="EFfective MASs", + added_in_version="before_v9", + text=r""" Turns on effective mass tensor calculations. Such calculations requires the non-self-consistent calculation of derivatives with respect to k, in the same dataset. It must therefore be used with [[rfelfd]] = 2 (or 1). @@ -4815,34 +5201,36 @@ NC SO calculations are NOT currently supported. Also, for both NC and PAW, [[nspden]] /= 1 and [[nsppol]] /= 1 are NOT supported. """, - ), - Variable( - abivarname="efmas_bands", - varset="dfpt", - vartype="integer", - topics=["EffectiveMass_useful"], - dimensions=[2, "[[nkpt]]"], - defaultval="The full range of band available in the calculation for each k-point.", - mnemonics="EFfective MASs, BANDS to be treated.", - requires="[[efmas]] == 1", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="efmas_bands", + varset="dfpt", + vartype="integer", + topics=["EffectiveMass_useful"], + dimensions=[2, "[[nkpt]]"], + defaultval="The full range of band available in the calculation for each k-point.", + mnemonics="EFfective MASs, BANDS to be treated.", + requires="[[efmas]] == 1", + added_in_version="before_v9", + text=r""" This variable controls the range of bands for which the effective mass is to be calculated. If a band is degenerate, all other bands of the degenerate group will automatically be treated, even if they were not part of the user specified range. """, - ), - Variable( - abivarname="efmas_calc_dirs", - varset="dfpt", - vartype="integer", - topics=["EffectiveMass_useful"], - dimensions="scalar", - defaultval=0, - mnemonics="EFfective MASs, CALCulate along DIRectionS", - requires="[[efmas]] == 1", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="efmas_calc_dirs", + varset="dfpt", + vartype="integer", + topics=["EffectiveMass_useful"], + dimensions="scalar", + defaultval=0, + mnemonics="EFfective MASs, CALCulate along DIRectionS", + requires="[[efmas]] == 1", + added_in_version="before_v9", + text=r""" Allows the user to calculate the scalar effective mass of all bands specified by [[efmas_bands]] along specific directions in reciprocal space. This is particularly useful when considering degenerate bands, which are usually @@ -4858,52 +5246,55 @@ coordinates, respectively. In the case [[efmas_calc_dirs]] == 3, 2 real values per directions are read, whereas 3 real values are read in the two other cases. """, - ), - Variable( - abivarname="efmas_deg", - varset="dfpt", - vartype="integer", - topics=["EffectiveMass_expert"], - dimensions="scalar", - defaultval=1, - mnemonics="EFfective MASs, activate DEGenerate formalism", - requires="[[efmas]] > 0", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="efmas_deg", + varset="dfpt", + vartype="integer", + topics=["EffectiveMass_expert"], + dimensions="scalar", + defaultval=1, + mnemonics="EFfective MASs, activate DEGenerate formalism", + requires="[[efmas]] > 0", + added_in_version="before_v9", + text=r""" Activate (==1) or not (==0) the treatment of degenerate bands (criterion [[efmas_deg_tol]] is used to determine whether bands are degenerate). Also compute the transport equivalent effective mass (see [[cite:Mecholsky2014]]). [[efmas]] = 0 should only be used for testing purposes. """, - ), - Variable( - abivarname="efmas_deg_tol", - varset="dfpt", - vartype="real", - topics=["EffectiveMass_useful"], - dimensions="scalar", - defaultval=1e-05, - mnemonics="EFfective MASs, DEGeneracy TOLerance", - requires="[[efmas_deg]] == 1", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="efmas_deg_tol", + varset="dfpt", + vartype="real", + topics=["EffectiveMass_useful"], + dimensions="scalar", + defaultval=1e-05, + mnemonics="EFfective MASs, DEGeneracy TOLerance", + requires="[[efmas_deg]] == 1", + added_in_version="before_v9", + text=r""" Energy difference below which 2 bands are considered degenerate (and treated using the formalism activated with [[efmas_deg]] == 1). [[efmas_deg_tol]] has the [[ENERGY]] characteristics. """, - ), - Variable( - abivarname="efmas_dim", - varset="dfpt", - vartype="integer", - topics=["EffectiveMass_useful"], - dimensions="scalar", - defaultval=3, - mnemonics="EFfective MASs, DIMension of the effective mass tensor", - requires="[[efmas]] == 1", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="efmas_dim", + varset="dfpt", + vartype="integer", + topics=["EffectiveMass_useful"], + dimensions="scalar", + defaultval=3, + mnemonics="EFfective MASs, DIMension of the effective mass tensor", + requires="[[efmas]] == 1", + added_in_version="before_v9", + text=r""" For 2D or 1D systems, the band dispersion goes to 0 perpendicular to the system, which causes the inverse effective mass to be singular, i.e. the effective mass to be NaN. This keyword circumvents the problem by eliminating @@ -4918,48 +5309,51 @@ the 'transport equivalent' effective mass tensor is output separately on the line immediately after the effective mass. """, - ), - Variable( - abivarname="efmas_dirs", - varset="dfpt", - vartype="real", - topics=["EffectiveMass_basic"], - dimensions=["3 or 2", "[[efmas_n_dirs]]"], - defaultval=0, - mnemonics="EFfective MASs, DIRectionS to be calculated", - requires="[[efmas_calc_dirs]] > 0", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="efmas_dirs", + varset="dfpt", + vartype="real", + topics=["EffectiveMass_basic"], + dimensions=["3 or 2", "[[efmas_n_dirs]]"], + defaultval=0, + mnemonics="EFfective MASs, DIRectionS to be calculated", + requires="[[efmas_calc_dirs]] > 0", + added_in_version="before_v9", + text=r""" List of [[efmas_n_dirs]] directions to be considered according to the value of [[efmas_calc_dirs]]. The directions are specified by 3 real values if [[efmas_calc_dirs]] == 1 or 2 and by 2 real values if [[efmas_calc_dirs]] == 3. """, - ), - Variable( - abivarname="efmas_n_dirs", - varset="dfpt", - vartype="integer", - topics=["EffectiveMass_basic"], - dimensions="scalar", - defaultval=0, - mnemonics="EFfective MASs, Number of DIRectionS", - requires="[[efmas_calc_dirs]] > 0", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="efmas_n_dirs", + varset="dfpt", + vartype="integer", + topics=["EffectiveMass_basic"], + dimensions="scalar", + defaultval=0, + mnemonics="EFfective MASs, Number of DIRectionS", + requires="[[efmas_calc_dirs]] > 0", + added_in_version="before_v9", + text=r""" Number of directions in [[efmas_dirs]], to be considered according to [[efmas_calc_dirs]]. """, - ), - Variable( - abivarname="efmas_ntheta", - varset="dfpt", - vartype="integer", - topics=["EffectiveMass_basic"], - dimensions="scalar", - defaultval=1000, - mnemonics="EFfective MASs, Number of points for integration w/r to THETA", - requires="[[efmas]] == 1 and [[efmas_bands]] == (degenerate band index)", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="efmas_ntheta", + varset="dfpt", + vartype="integer", + topics=["EffectiveMass_basic"], + dimensions="scalar", + defaultval=1000, + mnemonics="EFfective MASs, Number of points for integration w/r to THETA", + requires="[[efmas]] == 1 and [[efmas_bands]] == (degenerate band index)", + added_in_version="before_v9", + text=r""" When a band is degenerate, the usual definition of effective mass becomes invalid. However, it is still possible to define a 'transport equivalent mass tensor' that reproduces the contribution of the band to the conductivity @@ -4968,17 +5362,18 @@ and twice [[efmas_ntheta]] points for the phi coordinate. The default value gives a tensor accurate to the 4th decimal in Ge. """, - ), - Variable( - abivarname="einterp", - varset="basic", - vartype="real", - topics=["ElecBandStructure_useful", "SelfEnergy_expert"], - dimensions=[4], - defaultval=[0, 0, 0, 0], - mnemonics="Electron bands INTERPolation", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="einterp", + varset="basic", + vartype="real", + topics=["ElecBandStructure_useful", "SelfEnergy_expert"], + dimensions=[4], + defaultval=[0, 0, 0, 0], + mnemonics="Electron bands INTERPolation", + added_in_version="before_v9", + text=r""" This variable activates the interpolation of the electronic eigenvalues. It can be used to interpolate KS eigenvalues at the end of the GS run or to interpolate GW energies in sigma calculations ([[optdriver]] = 4). The k-path @@ -4999,39 +5394,41 @@ * einterp(4): Used if einterp(3) /= 0. It defines rsigma in Eq. 9 """, - ), - Variable( - abivarname="elph2_imagden", - varset="dfpt", - vartype="real", - topics=["TDepES_basic"], - dimensions="scalar", - defaultval=0.0, - mnemonics="ELectron-PHonon interaction at 2nd order: IMAGinary shift of the DENominator", - characteristics=["[[ENERGY]]"], - requires="[[ieig2rf]] != 0", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="elph2_imagden", + varset="dfpt", + vartype="real", + topics=["TDepES_basic"], + dimensions="scalar", + defaultval=0.0, + mnemonics="ELectron-PHonon interaction at 2nd order: IMAGinary shift of the DENominator", + characteristics=["[[ENERGY]]"], + requires="[[ieig2rf]] != 0", + added_in_version="before_v9", + text=r""" The variable [[elph2_imagden]] determines the imaginary shift of the denominator of the sum-over-states in the perturbation, -$(e_{nk}-e_{n'k'}+i$[[elph2_imagden]]). +$(e_{nk}-e_{n'k'} + i $[[elph2_imagden]]). One should use a width comparable with the Debye frequency or the maximum phonon frequency. Can be specified in Ha (the default), Ry, eV or Kelvin, since [[elph2_imagden]] has the [[ENERGY]] characteristics (1 Ha = 27.2113845 eV). """, - ), - Variable( - abivarname="enunit", - varset="gstate", - vartype="integer", - topics=["Output_useful", "ElecBandStructure_useful"], - dimensions="scalar", - defaultval=0, - mnemonics="ENergy UNITs", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="enunit", + varset="gstate", + vartype="integer", + topics=["Output_useful","ElecBandStructure_useful"], + dimensions="scalar", + defaultval=0, + mnemonics="ENergy UNITs", + added_in_version="before_v9", + text=r""" Governs the units to be used for output of eigenvalues (and if any, phonon frequencies) * 0 --> print eigenvalues in hartree; @@ -5044,69 +5441,73 @@ * 1 --> phonon frequencies in eV and THz; * 2 --> phonon frequencies in hartree, eV, cm-1, Thz and Kelvin. """, - ), - Variable( - abivarname="eph_ahc_type", - varset="eph", - vartype="integer", - topics=["ElPhonInt_useful"], - dimensions="scalar", - defaultval=1, - mnemonics="Electron-PHonon: Allen-Heine-Cardona type", - added_in_version="9.11.6", - text=r""" -Only relevant for [[optdriver]]=7 and [[eph_task]]=4. +), + +Variable( + abivarname="eph_ahc_type", + varset="eph", + vartype="integer", + topics=["ElPhonInt_useful"], + dimensions="scalar", + defaultval=1, + mnemonics="Electron-PHonon: Allen-Heine-Cardona type", + added_in_version="9.11.6", + text=r""" +Only relevant for [[optdriver]] = 7 and [[eph_task]] = 4 or 24. If set to 0, use the adiabatic version of the Allen-Heine-Cardona equation to compute the zero-point renormalisation as well as temperature dependence. If set to 1 (default), use the non-adiabatic version of the Allen-Heine-Cardona equation to compute the zero-point renormalisation as well as temperature dependence. Note: The use of [[eph_ahc_type]]=0 is not recommended in IR-active materials. """, - ), - Variable( - abivarname="eph_extrael", - varset="eph", - vartype="real", - topics=["ElPhonInt_expert"], - dimensions="scalar", - defaultval=0.0, - mnemonics="Electron-PHonon: EXTRA ELectrons", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="eph_extrael", + varset="eph", + vartype="real", + topics=["ElPhonInt_expert"], + dimensions="scalar", + defaultval=0.0, + mnemonics="Electron-PHonon: EXTRA ELectrons", + added_in_version="before_v9", + text=r""" Number of electrons per unit cell to be added/subtracted to the initial value computed from the pseudopotentials and the unit cell. Can be used to simulate doping within the rigid band approximation. Require metallic occupation scheme [[occopt]] e.g. Fermi-Dirac. See also [[eph_doping]] to specify the same quantity in terms of charge/cm^3 """, - ), - Variable( - abivarname="eph_fermie", - varset="eph", - vartype="real", - topics=["ElPhonInt_expert"], - dimensions="scalar", - defaultval=0.0, - mnemonics="Electron-PHonon: FERMI Energy", - characteristics=["[[ENERGY]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="eph_fermie", + varset="eph", + vartype="real", + topics=["ElPhonInt_expert"], + dimensions="scalar", + defaultval=0.0, + mnemonics="Electron-PHonon: FERMI Energy", + characteristics=["[[ENERGY]]"], + added_in_version="before_v9", + text=r""" This variable can be used to change artificially the value of the Fermi level when performing e-ph calculations. The variable has effect only if set to a non-zero value. This option is mutually exclusive with [[eph_extrael]] and [[eph_doping]]. When [[eph_fermie]] is used the number of temperatures specified by [[tmesh]] cannot be greater than one. """, - ), - Variable( - abivarname="eph_frohlichm", - varset="eph", - vartype="integer", - topics=["ElPhonInt_useful"], - dimensions="scalar", - defaultval=0, - mnemonics="Electron-PHonon: FROHLICH Model", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="eph_frohlichm", + varset="eph", + vartype="integer", + topics=["ElPhonInt_useful"], + dimensions="scalar", + defaultval=0, + mnemonics="Electron-PHonon: FROHLICH Model", + added_in_version="before_v9", + text=r""" Only relevant for [[optdriver]]=7 and [[eph_task]] = 6 or 10. If set to 1, use the dynamical matrix at Gamma, the Born effective charges, the dielectric tensor, as well as the effective masses (must give a _EFMAS file as input, see [[prtefmas]] and [[getefmas]] or [[irdefmas]]), @@ -5115,70 +5516,74 @@ using second-order time-dependent perturbation theory. Can deliver (approximate) zero-point renormalisation as well as temperature dependence. """, - ), - Variable( - abivarname="eph_frohl_ntheta", - varset="eph", - vartype="integer", - topics=["ElPhonInt_useful"], - dimensions="scalar", - defaultval=0, - mnemonics="Electron-PHonon: FROHLIich Number of THETA points", - added_in_version="9.8.0", - text=r""" -Only relevant for [[optdriver]] = 7 and [[eph_task]] = 4 i.e. computation of the e-ph self-energy. +), + +Variable( + abivarname="eph_frohl_ntheta", + varset="eph", + vartype="integer", + topics=["ElPhonInt_useful"], + dimensions="scalar", + defaultval=0, + mnemonics="Electron-PHonon: FROHLIich Number of THETA points", + added_in_version="9.8.0", + text=r""" +Relevant for the computation of the e-ph self-energy or the Variational Polaron Equations. This variable defines the angular mesh for the spherical integration of the Frohlich divergence in the microzone around the Gamma point to accelerate the convergence with the number of q-points. Set it to zero to disable the correction for testing purposes. """, - ), - Variable( - abivarname="eph_fsewin", - varset="eph", - vartype="real", - topics=["ElPhonInt_expert"], - dimensions="scalar", - defaultval="0.04 Hartree", - mnemonics="Electron-Phonon: Fermi Surface Energy WINdow", - characteristics=["[[ENERGY]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="eph_fsewin", + varset="eph", + vartype="real", + topics=["ElPhonInt_expert"], + dimensions="scalar", + defaultval="0.04 Hartree", + mnemonics="Electron-Phonon: Fermi Surface Energy WINdow", + characteristics=["[[ENERGY]]"], + added_in_version="before_v9", + text=r""" This variable defines the energy window around the Fermi level used for e-ph calculations ([[optdriver]] = 7). Only states located in the energy range [efermi - eph_fsewin, efermi + eph_fsewin] are included in the e-ph calculation. Related input variables: [[eph_intmeth]], [[eph_fsmear]], [[eph_extrael]] and [[eph_fermie]]. """, - ), - Variable( - abivarname="eph_fsmear", - varset="eph", - vartype="real", - topics=["ElPhonInt_expert"], - dimensions="scalar", - defaultval="0.01 Hartree", - mnemonics="Electron-PHonon: Fermi surface SMEARing", - characteristics=["[[ENERGY]]"], - requires="[[eph_intmeth]] == 1", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="eph_fsmear", + varset="eph", + vartype="real", + topics=["ElPhonInt_expert"], + dimensions="scalar", + defaultval="0.01 Hartree", + mnemonics="Electron-PHonon: Fermi surface SMEARing", + characteristics=["[[ENERGY]]"], + requires="[[eph_intmeth]] == 1", + added_in_version="before_v9", + text=r""" This variable defines the gaussian broadening used for the integration of the double delta over the Fermi surface when [[eph_intmeth]] == 1. A negative value, activates the adaptive gaussian broadening proposed in [[cite:Li2015]] in which the broadening is automatically computed from the group velocities. """, - ), - Variable( - abivarname="eph_intmeth", - varset="eph", - vartype="integer", - topics=["ElPhonInt_expert"], - dimensions="scalar", - defaultval="2 (tetra) except when [[eph_task]] = 4 and when ([[eph_task]] = -4 and symsigma == 0), where 1 is used as default.", - mnemonics="Electron-Phonon: INTegration METHod", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="eph_intmeth", + varset="eph", + vartype="integer", + topics=["ElPhonInt_expert"], + dimensions="scalar", + defaultval="2 (tetra) except when [[eph_task]] = 4 and when ([[eph_task]] = -4 and symsigma == 0), where 1 is used as default.", + mnemonics="Electron-Phonon: INTegration METHod", + added_in_version="before_v9", + text=r""" This variable defines the technique for the integration over the Brillouin zone in the EPH code. * 1 --> Gaussian technique with broadening factor. @@ -5205,31 +5610,57 @@ : The default is [[eph_intmeth]] == 2, Tetrahedron method by [[cite:Bloechl1994]] except when [[symsigma]] == 0, where it is [[eph_intmeth]] == 1. """, - ), - Variable( - abivarname="eph_mustar", - varset="eph", - vartype="real", - topics=["ElPhonInt_expert"], - dimensions="scalar", - defaultval=0.1, - mnemonics="Electron-PHonon: MU STAR (electron-electron interaction strength)", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="eph_mustar", + varset="eph", + vartype="real", + topics=["ElPhonInt_expert"], + dimensions="scalar", + defaultval=0.1, + mnemonics="Electron-PHonon: MU STAR (electron-electron interaction strength)", + added_in_version="before_v9", + text=r""" Average electron-electron interaction strength, for the computation of the superconducting Tc using Mc-Millan's formula. """, - ), - Variable( - abivarname="eph_ngqpt_fine", - varset="eph", - vartype="integer", - topics=["ElPhonInt_useful"], - dimensions=[3], - defaultval=[0, 0, 0], - mnemonics="Electron-PHonon: Number of Grid Q-PoinTs in FINE grid.", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="eph_ngkpt_fine", + varset="eph", + vartype="integer", + topics=["ElPhonInt_useful"], + dimensions=[3], + defaultval=[0, 0, 0], + requires="[[optdriver]] == 7", + mnemonics="Electron-PHonon: Number of Grid K-PoinTs in FINE grid", + added_in_version="10.9.1", + text=r""" +Defines the divisions of the dense homogeneous k-mesh used to interpolate +electronic eigenvalues and electron-phonon matrix elements with Wannier +functions in the EPH code. + +The shifts of the dense mesh are specified by [[eph_nshiftk_fine]] and +[[eph_shiftk_fine]]. The default value, `[0, 0, 0]`, disables the dense +Wannier k-mesh and preserves the k-mesh associated with the input WFK file. + +This variable is intended for calculations that read both `ABIWAN.nc` and +`GWAN.nc`. It does not change the k-mesh stored in the input WFK file. +""", +), + +Variable( + abivarname="eph_ngqpt_fine", + varset="eph", + vartype="integer", + topics=["ElPhonInt_useful"], + dimensions=[3], + defaultval=[0, 0, 0], + mnemonics="Electron-PHonon: Number of Grid Q-PoinTs in FINE grid.", + added_in_version="before_v9", + text=r""" This variable activates the **interpolation** of the first-order variation of the self-consistent potential in the electron-phonon code ([[optdriver]] == 7). @@ -5248,18 +5679,60 @@ The code can interpolate DFPT potentials but is not able to interpolate KS wavefunctions, and will stop if ${\bf k + q}$ is not found in the WFK file. """, - ), - Variable( - abivarname="eph_task", - varset="eph", - vartype="integer", - topics=["ElPhonInt_basic"], - dimensions="scalar", - defaultval=1, - requires="[[optdriver]] == 7", - mnemonics="Electron-PHonon: Task", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="eph_nshiftk_fine", + varset="eph", + vartype="integer", + topics=["ElPhonInt_useful"], + dimensions="scalar", + defaultval=1, + requires="[[optdriver]] == 7", + mnemonics="Electron-PHonon: Number of SHIFTs for the FINE K grid", + added_in_version="10.9.1", + text=r""" +Gives the number of shifted grids used to construct the dense Wannier +k-mesh defined by [[eph_ngkpt_fine]]. The shift vectors are specified by +[[eph_shiftk_fine]]. + +The allowed range is from 1 to `MAX_NSHIFTK`. +""", +), + +Variable( + abivarname="eph_shiftk_fine", + varset="eph", + vartype="real", + topics=["ElPhonInt_useful"], + dimensions=[3, "[[eph_nshiftk_fine]]"], + defaultval=[0.0, 0.0, 0.0], + requires="[[optdriver]] == 7", + mnemonics="Electron-PHonon: SHIFTs for the FINE K grid", + added_in_version="10.9.1", + text=r""" +Defines the shifts of the dense homogeneous k-mesh used for Wannier +interpolation in the EPH code. The number of vectors is given by +[[eph_nshiftk_fine]], and the mesh divisions are specified by +[[eph_ngkpt_fine]]. + +The convention is the same as for [[shiftk]]: each vector is expressed in +the reduced coordinates of the reciprocal-space sampling lattice. The +default is a single unshifted grid. +""", +), + +Variable( + abivarname="eph_task", + varset="eph", + vartype="integer", + topics=["ElPhonInt_basic"], + dimensions="scalar", + defaultval=1, + requires="[[optdriver]] == 7", + mnemonics="Electron-PHonon: Task", + added_in_version="before_v9", + text=r""" Select the electron-phonon task to be performed when [[optdriver]] == 7. The choice is among: @@ -5284,7 +5757,7 @@ * 11 --> Compute e-ph matrix elements on homogeneous k- and q-meshes. Save results in GSTORE.nc file (requires netcdf library with MPI-IO support). The k-mesh must be equal to the one associated to the input WFK file, the q-mesh is specified - by [[eph_ngqpt_fine]] (NB: the q-mesh must be a sub-mesh of the k-mesh or equal). + by [[eph_ngqpt_fine]] and must be a sub-mesh of the k-mesh or equal. * 12 --> Migdal-Eliashberg equations (isotropic case). * -12 --> Migdal-Eliashberg equations (anisotropic case). UNDER DEVELOPMENT. * 13 --> Variational polaron equations. Requires GSTORE file specified via [[getgstore_filepath]] @@ -5297,10 +5770,11 @@ An array D(R) with the decay of the W(R,r) as a function of R is computed and saved to file In the second case (-15) the q-points are taken directly from the DVDB file. * 16, -16 --> test_phrotation TO BE DOCUMENTED. -* 17 --> Compute e-ph matrix elements with the GWPT formalism Produce GSTORE file. +* 17 --> Compute e-ph matrix elements with the GWPT formalism Produce GSTORE.nc file. Requires netcdf library with MPI-IO support. * 18 --> Compute e-ph matrix g(k,q) along a high-symmetry path. See [[eph_fix_wavevec]] and other related variables. -* 19 --> Compute matrix elements of the screened interaction W between two Cooper pairs. +* 19 --> Compute matrix elements of the screened interaction W between two Cooper pairs (UNDER DEVELOPMENT). +* 20 --> Convert GSTORE.nc file to other formats. Requires [[gstore_convert]]. * 24 --> Compute electron self-energy (Fan-Migdal + Debye-Waller) and QP corrections, also possibly the spectral function. Similar to [[eph_task]] 4 but requires GSTORE file specified via [[getgstore_filepath]] @@ -5310,52 +5784,55 @@ Also, calculations with [[nspinor]] = 2 require [[nspden]] 1 in all the EPH tasks in which the interpolation of the DFPT scattering potentials is needed. """, - ), - Variable( - abivarname="eph_transport", - varset="eph", - vartype="integer", - topics=["ElPhonInt_expert"], - dimensions="scalar", - defaultval=0, - mnemonics="Electron-PHonon: TRANSPORT flag", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="eph_transport", + varset="eph", + vartype="integer", + topics=["ElPhonInt_expert"], + dimensions="scalar", + defaultval=0, + mnemonics="Electron-PHonon: TRANSPORT flag", + added_in_version="before_v9", + text=r""" NB - this does not work yet. This variable can be used to turn on the calculation of transport quantities in the eph module of abinit. Value of 1 corresponds to elastic LOVA as in [[cite:Savrasov1996]]. """, - ), - Variable( - abivarname="eshift", - varset="dev", - vartype="real", - topics=["SCFAlgorithms_expert"], - dimensions="scalar", - defaultval=0, - mnemonics="Energy SHIFT", - characteristics=["[[DEVELOP]]", "[[ENERGY]]"], - requires="[[wfoptalg]] == 3", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="eshift", + varset="dev", + vartype="real", + topics=["SCFAlgorithms_expert"], + dimensions="scalar", + defaultval=0, + mnemonics="Energy SHIFT", + characteristics=["[[DEVELOP]]", "[[ENERGY]]"], + requires="[[wfoptalg]] == 3", + added_in_version="before_v9", + text=r""" [[eshift]] gives the shift of the energy used in the shifted Hamiltonian squared. The algorithm will determine eigenvalues and eigenvectors centered on [[eshift]]. Can be specified in Ha (the default), Ry, eV or Kelvin, since [[eshift]] has the [[ENERGY]] characteristics. (1 Ha = 27.2113845 eV) """, - ), - Variable( - abivarname="esmear", - varset="dfpt", - vartype="real", - topics=["TDepES_useful"], - dimensions="scalar", - defaultval=0.01, - mnemonics="Eigenvalue SMEARing", - characteristics=["[[ENERGY]]"], - requires="[[smdelta]] != 0", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="esmear", + varset="dfpt", + vartype="real", + topics=["TDepES_useful"], + dimensions="scalar", + defaultval=0.01, + mnemonics="Eigenvalue SMEARing", + characteristics=["[[ENERGY]]"], + requires="[[smdelta]] != 0", + added_in_version="before_v9", + text=r""" The variable [[esmear]] determines the width of the functions approximating the delta function, $\delta(e_{nk}-e_{n'k'})$, present in the expression of the lifetimes. One should use a width comparable with the Debye frequency or the @@ -5363,50 +5840,53 @@ Can be specified in Ha (the default), Ry, eV or Kelvin, since [[ecut]] has the [[ENERGY]] characteristics (1 Ha = 27.2113845 eV). """, - ), - Variable( - abivarname="exchmix", - varset="dev", - vartype="real", - topics=["xc_useful"], - dimensions="scalar", - defaultval=0.25, - mnemonics="EXCHange MIXing", - characteristics=["[[DEVELOP]]"], - requires="[[useexexch]] == 1", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="exchmix", + varset="dev", + vartype="real", + topics=["xc_useful"], + dimensions="scalar", + defaultval=0.25, + mnemonics="EXCHange MIXing", + characteristics=["[[DEVELOP]]"], + requires="[[useexexch]] == 1", + added_in_version="before_v9", + text=r""" [[exchmix]] allows one to tune the ratio of exact exchange when [[useexexch]] is used. The default value of 0.25 corresponds to PBE0. """, - ), - Variable( - abivarname="exchn2n3d", - varset="dev", - vartype="integer", - topics=["TuningSpeedMem_expert"], - dimensions="scalar", - defaultval=0, - mnemonics="EXCHange N2 and N3 Dimensions", - characteristics=["[[DEVELOP]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="exchn2n3d", + varset="dev", + vartype="integer", + topics=["TuningSpeedMem_expert"], + dimensions="scalar", + defaultval=0, + mnemonics="EXCHange N2 and N3 Dimensions", + characteristics=["[[DEVELOP]]"], + added_in_version="before_v9", + text=r""" If [[exchn2n3d]] is 1, the internal representation of the FFT arrays in reciprocal space will be array(n1,n3,n2), where the second and third dimensions have been switched. This is to allow to be coherent with the [[exchn2n3d]] = 4xx FFT treatment. """, - ), - Variable( - abivarname="expert_user", - varset="gstate", - vartype="integer", - topics=["UnitCell_expert", "crystal_expert", "SmartSymm_expert", "GeoOpt_expert", "k-points_expert"], - dimensions="scalar", - defaultval=0, - mnemonics="EXPERTise of the USER", - added_in_version="9.2.2", - text=r""" +), + +Variable( + abivarname="expert_user", + varset="gstate", + vartype="integer", + topics=["UnitCell_expert","crystal_expert","SmartSymm_expert","GeoOpt_expert","k-points_expert"], + dimensions="scalar", + defaultval=0, + mnemonics="EXPERTise of the USER", + added_in_version="9.2.2", + text=r""" If set to 0, the checking provided by ABINIT is maximum (default values of [[chkprim]], [[chksymbreak]], [[chksymtnons]], [[chkdilatmx]], [[chkparal]]). If non-zero (up to three), the above-mentioned checking input variables are all disabled (set to zero) @@ -5414,19 +5894,20 @@ In the future, the level three will always be the maximum allowed value, with all checks set to zero, while a more refined behaviour might be implemented for [[expert_user]]==1 or 2). """, - ), - Variable( - abivarname="extrapwf", - varset="dev", - vartype="integer", - topics=["TuningSpeedMem_expert", "MolecularDynamics_expert"], - dimensions="scalar", - defaultval=0, - mnemonics="flag - EXTRAPolation of the Wave-Functions", - characteristics=["[[DEVELOP]]"], - requires="[[densfor_pred]] in [5, 6]", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="extrapwf", + varset="dev", + vartype="integer", + topics=["TuningSpeedMem_expert", "MolecularDynamics_expert"], + dimensions="scalar", + defaultval=0, + mnemonics="flag - EXTRAPolation of the Wave-Functions", + characteristics=["[[DEVELOP]]"], + requires="[[densfor_pred]] in [5, 6]", + added_in_version="before_v9", + text=r""" This flag activates the extrapolation of wave-functions from one Molecular Dynamics (or Structural Relaxation) step to another. The wave functions are extrapolated using 2nd-order algorithm of [[cite:Arias1992]]. @@ -5436,51 +5917,57 @@ extrapolation is activated (see [[densfor_pred]]). ABINIT 7.10: this option is **under development** and might give wrong results. """, - ), - Variable( - abivarname="f4of2_sla", - varset="paw", - vartype="real", - topics=["DFT+U_expert"], - dimensions="scalar", - defaultval=ValueWithConditions({"d electrons": 0.625, "f electrons": 0.6681, "defaultval": 0}), - mnemonics="F4 Over F2 ratio of Slater integrals", - requires="[[usepaw]] == 1 and ([[usepawu]] == 1 or [[usedmft]] == 1)", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="f4of2_sla", + varset="paw", + vartype="real", + topics=["DFT+U_expert"], + dimensions="scalar", + defaultval=ValueWithConditions({"d electrons": 0.625, + "f electrons": 0.6681, + "defaultval": 0}), + mnemonics="F4 Over F2 ratio of Slater integrals", + requires="[[usepaw]] == 1 and ([[usepawu]] == 1 or [[usedmft]] == 1)", + added_in_version="before_v9", + text=r""" This gives the ratio of Slater Integrals F4 and F2. It is used in DFT+U or DFT+DMFT for the calculation of the orbital dependent screened coulomb interaction. """, - ), - Variable( - abivarname="f6of2_sla", - varset="paw", - vartype="real", - topics=["DFT+U_expert"], - dimensions="scalar", - defaultval=0.4943, - mnemonics="F6 Over F2 ratio of Slater integrals", - requires="([[usepawu]] == 1 or [[usedmft]] == 1) and [[lpawu]] == 3", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="f6of2_sla", + varset="paw", + vartype="real", + topics=["DFT+U_expert"], + dimensions="scalar", + defaultval=0.4943, + mnemonics="F6 Over F2 ratio of Slater integrals", + requires="([[usepawu]] == 1 or [[usedmft]] == 1) and [[lpawu]] == 3", + added_in_version="before_v9", + text=r""" Gives the ratio of Slater Integrals F6 and F2. It is used with [[f4of2_sla]] == 3 in DFT+U or DFT+DMFT for the calculation of the orbital dependent screened coulomb interaction. """, - ), - Variable( - abivarname="fband", - varset="gstate", - vartype="real", - topics=["BandOcc_useful"], - dimensions="scalar", - defaultval=ValueWithConditions( - {"[[occopt]] == 1": 0.125, "[[occopt]] > 2": 0.5, "[[usewvl]] == 1": 0.0, "defaultval": 0.0} - ), - mnemonics="Factor for the number of BANDs", - characteristics=["[[INPUT_ONLY]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="fband", + varset="gstate", + vartype="real", + topics=["BandOcc_useful"], + dimensions="scalar", + defaultval=ValueWithConditions({"[[occopt]] == 1": 0.125, + "[[occopt]] > 2": 0.5, + "[[usewvl]] == 1": 0.0, + "defaultval": 0.0}), + mnemonics="Factor for the number of BANDs", + characteristics=["[[INPUT_ONLY]]"], + added_in_version="before_v9", + text=r""" Governs the number of bands to be used in the code in the case the parameter [[nband]] is not defined in the input file (which means that [[occopt]] is not equal to 0 or 2). @@ -5502,32 +5989,34 @@ small enough such as to neglect higher bands. It is difficult to automate this, so a fixed default value has been chosen. """, - ), - Variable( - abivarname="fermie_nest", - varset="dev", - vartype="real", - topics=["printing_prfermi"], - dimensions="scalar", - defaultval=0, - mnemonics="FERMI Energy for printing the NESTing function", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="fermie_nest", + varset="dev", + vartype="real", + topics=["printing_prfermi"], + dimensions="scalar", + defaultval=0, + mnemonics="FERMI Energy for printing the NESTing function", + added_in_version="before_v9", + text=r""" This input variable is only effective when [[prtnest]] = 1. The energy is relative to the calculated Fermi energy. """, - ), - Variable( - abivarname="ffnl_lw", - varset="dfpt", - vartype="integer", - topics=["longwave_expert"], - dimensions="scalar", - defaultval=0, - mnemonics="NonLocal Form Factors in LongWave calculation", - characteristics=["[[DEVELOP]]"], - added_in_version="v9.9", - text=r""" +), + +Variable( + abivarname="ffnl_lw", + varset="dfpt", + vartype="integer", + topics=["longwave_expert"], + dimensions="scalar", + defaultval=0, + mnemonics="NonLocal Form Factors in LongWave calculation", + characteristics=["[[DEVELOP]]"], + added_in_version="v9.9", + text=r""" In a longwave calculation, the nonlocal form factors and their derivatives are by default computed for all k points and atom types at an initial step and then specifically used for each type of perturbation. Depending on the calculation @@ -5539,20 +6028,20 @@ This option saves virtual memory but makes the computation of spatial-dispersion tensors slower. """, - ), - Variable( - abivarname="fftalg", - varset="dev", - vartype="integer", - topics=["TuningSpeedMem_useful"], - dimensions="scalar", - defaultval=ValueWithConditions( - {"[[FFTW3]] and [[usedmft]] == 0": 312, "[[paral_kgb]] == 1": 401, "defaultval": 112} - ), - mnemonics="Fast Fourier Transform ALGorithm", - characteristics=["[[DEVELOP]]"], - added_in_version="before_v9", - text=r""" +), + + +Variable( + abivarname="fftalg", + varset="dev", + vartype="integer", + topics=["TuningSpeedMem_useful"], + dimensions="scalar", + defaultval=ValueWithConditions({"[[FFTW3]] and [[usedmft]] == 0": 312, "[[paral_kgb]] == 1": 401, "defaultval": 112}), + mnemonics="Fast Fourier Transform ALGorithm", + characteristics=["[[DEVELOP]]"], + added_in_version="before_v9", + text=r""" Allows to choose the implementation for performing Fast Fourier Transforms. These have to be used when applied to wavefunctions (routine `fourwf`), as well as when applied to densities and potentials (routine `fourdp.F90`). @@ -5591,34 +6080,36 @@ This keyword is **ignored** when Fast Fourier Transforms are done using **Graphics Processing Units** (GPU), i.e. when [[gpu_option]] > 0. """, - ), - Variable( - abivarname="fftcache", - varset="dev", - vartype="integer", - topics=["TuningSpeedMem_expert"], - dimensions="scalar", - defaultval=16, - mnemonics="Fast Fourier Transform CACHE size", - characteristics=["[[DEVELOP]]"], - commentdefault="todo: Not yet machine-dependent", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="fftcache", + varset="dev", + vartype="integer", + topics=["TuningSpeedMem_expert"], + dimensions="scalar", + defaultval=16, + mnemonics="Fast Fourier Transform CACHE size", + characteristics=["[[DEVELOP]]"], + commentdefault="todo: Not yet machine-dependent", + added_in_version="before_v9", + text=r""" Gives the cache size of the current machine, in Kbytes. Internal representation as [[ngfft]](8). """, - ), - Variable( - abivarname="fft_count", - varset="dev", - vartype="integer", - topics=["TuningSpeedMem_expert"], - dimensions="scalar", - defaultval=0, - mnemonics="Fast Fourier Transform COUNTer", - characteristics=["[[DEVELOP]]"], - added_in_version="", - text=r""" +), + +Variable( + abivarname="fft_count", + varset="dev", + vartype="integer", + topics=["TuningSpeedMem_expert"], + dimensions="scalar", + defaultval=0, + mnemonics="Fast Fourier Transform COUNTer", + characteristics=["[[DEVELOP]]"], + added_in_version="", + text=r""" This variable is similar than [[nonlop_ylm_count]], but for FFT operations instead of non-local ones. FFT operations are one of the most time-consumming operations, especially for systems with few atoms. @@ -5651,18 +6142,19 @@ The total count (TC) corresponds to the number of calls of the routine. NB is the total number of bands, including the empty ones, summed over the k-points. """, - ), - Variable( - abivarname="fftgw", - varset="gw", - vartype="integer", - topics=["GW_expert", "Susceptibility_expert", "SelfEnergy_expert"], - dimensions="scalar", - defaultval=21, - mnemonics="FFT for GW calculation", - requires=" [[optdriver]] in [3, 4]", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="fftgw", + varset="gw", + vartype="integer", + topics=["GW_expert", "Susceptibility_expert", "SelfEnergy_expert"], + dimensions="scalar", + defaultval=21, + mnemonics="FFT for GW calculation", + requires=" [[optdriver]] in [3, 4]", + added_in_version="before_v9", + text=r""" The basic ingredients needed to perform both a screening and a sigma calculation are the so-called oscillator matrix elements defined as @@ -5698,35 +6190,38 @@ The behaviour of ABINIT before v5.5 corresponds to the default value 11. """, - ), - Variable( - abivarname="field_red", - varset="ffield", - vartype="real", - topics=[], - dimensions=[3], - defaultval=MultipleValue(number=3, value=0.0), - mnemonics="FIELD in REDuced coordinates", - requires="[[berryopt]] in [4, 6, 14, 16, 17]", - added_in_version="v9.11.2", - text=r""" +), + +Variable( + abivarname="field_red", + varset="ffield", + vartype="real", + topics=["Berry_basic"], + dimensions=[3], + defaultval=MultipleValue(number=3, value=0.0), + mnemonics="FIELD in REDuced coordinates", + requires="[[berryopt]] in [4, 6, 14, 16, 17]", + added_in_version="v9.11.2", + text=r""" Stores the field direction in reduced coordinates, deduced from [[dfield]], [[efield]], [[red_efieldbar]], [[red_dfield]], [[red_efield]], and/or [[jfielddir]], depending on the value of [[berryopt]], for the purpose of computing the symmetries of the system placed in such field. """, - ), - Variable( - abivarname="fockdownsampling", - varset="gstate", - vartype="integer", - topics=["Hybrids_useful"], - dimensions=[3], - defaultval="3*1", - mnemonics="FOCK operator, k-grid DOWNSAMPLING", - requires="[[usefock]] == 1", - added_in_version="before_v9", - text=r""" +), + + +Variable( + abivarname="fockdownsampling", + varset="gstate", + vartype="integer", + topics=["Hybrids_useful"], + dimensions=[3], + defaultval="3*1", + mnemonics="FOCK operator, k-grid DOWNSAMPLING", + requires="[[usefock]] == 1", + added_in_version="before_v9", + text=r""" The k wavevector grid used to compute the Fock operator in the full Brillouin Zone might be a subset of the full Brillouin Zone of the k point grid used for the wavefunctions (see [[kptopt]] for its definition). [[fockdownsampling]] @@ -5759,17 +6254,18 @@ which case the corresponding direction is sampled by only one layer of points (if two are zero, a line of points is obtained). """, - ), - Variable( - abivarname="fock_icutcoul", - varset="gstate", - vartype="integer", - topics=["Hybrids_useful", "Coulomb_useful"], - dimensions="scalar", - defaultval=3, - mnemonics="Integer that governs the CUT-off for COULomb interaction", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="fock_icutcoul", + varset="gstate", + vartype="integer", + topics=["Hybrids_useful","Coulomb_useful"], + dimensions="scalar", + defaultval=3, + mnemonics="Integer that governs the CUT-off for COULomb interaction", + added_in_version="before_v9", + text=r""" !!!Under development!!! Electronic structure calculations for isolated systems, 1D and 2D systems present a slow convergence with respect to the size of the supercell due to the @@ -5805,18 +6301,19 @@ which is automatically calculated so that the volume enclosed in the sphere is equal to the volume of the solid. """, - ), - Variable( - abivarname="fockoptmix", - varset="gstate", - vartype="integer", - topics=["Hybrids_basic"], - dimensions="scalar", - defaultval=0, - mnemonics="FOCK operator: OPTions for MIXing", - requires="[[usefock]] == 1", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="fockoptmix", + varset="gstate", + vartype="integer", + topics=["Hybrids_basic"], + dimensions="scalar", + defaultval=0, + mnemonics="FOCK operator: OPTions for MIXing", + requires="[[usefock]] == 1", + added_in_version="before_v9", + text=r""" Governs the mixing algorithm at the level of the Fock operator, i.e. how to mix it, and how the underlying SCF calculation is to be performed. It is the most relevant when the Fock operator is not updated at each SCF step ([[nnsclohf]]/=0). @@ -5838,18 +6335,19 @@ The third-to-last (hundreds) digit governs the mixing of the Fock operator itself with its previous occurrences. Irrelevant when the unit digit is 0. """, - ), - Variable( - abivarname="freqim_alpha", - varset="gw", - vartype="real", - topics=["SelfEnergy_expert"], - dimensions="scalar", - defaultval=5.0, - mnemonics="FREQuencies along the IMaginary axis ALPHA parameter", - requires="[[optdriver]] == 4", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="freqim_alpha", + varset="gw", + vartype="real", + topics=["SelfEnergy_expert"], + dimensions="scalar", + defaultval=5.0, + mnemonics="FREQuencies along the IMaginary axis ALPHA parameter", + requires="[[optdriver]] == 4", + added_in_version="before_v9", + text=r""" [[freqim_alpha]] is used only for numerical integration of the GW self-energy ([[gwcalctyp]] in [2, 12, 22, 9, 19, 29]). [[freqim_alpha]] determines the location of the maximum frequency point along @@ -5859,38 +6357,40 @@ (this can be set by hand by using the variable [[ppmfrq]]). See the section on grids in the descriptive text for [[cd_frqim_method]] for a detailed """, - ), - Variable( - abivarname="freqremax", - varset="gw", - vartype="real", - topics=["FrequencyMeshMBPT_basic"], - dimensions="scalar", - defaultval=0.0, - mnemonics="FREQuencies along the Real axis MAXimum", - characteristics=["[[ENERGY]]"], - requires="[[optdriver]] == 3", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="freqremax", + varset="gw", + vartype="real", + topics=["FrequencyMeshMBPT_basic"], + dimensions="scalar", + defaultval=0.0, + mnemonics="FREQuencies along the Real axis MAXimum", + characteristics=["[[ENERGY]]"], + requires="[[optdriver]] == 3", + added_in_version="before_v9", + text=r""" [[freqremax]] is used only for numerical integration of the GW self-energy ([[gwcalctyp]] in [2, 12, 22, 9, 19, 29]). [[freqremax]] sets the maximum real frequency used to calculate the dielectric matrix in order to perform the numerical integration of the GW self-energy. [[freqremax]], [[freqremin]] and [[nfreqre]] define the spacing of the frequency mesh along the real axis. """, - ), - Variable( - abivarname="freqremin", - varset="gw", - vartype="real", - topics=["FrequencyMeshMBPT_basic"], - dimensions="scalar", - defaultval=0.0, - mnemonics="FREQuencies along the Real axis MINimum", - characteristics=["[[ENERGY]]"], - requires="[[optdriver]] == 3", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="freqremin", + varset="gw", + vartype="real", + topics=["FrequencyMeshMBPT_basic"], + dimensions="scalar", + defaultval=0.0, + mnemonics="FREQuencies along the Real axis MINimum", + characteristics=["[[ENERGY]]"], + requires="[[optdriver]] == 3", + added_in_version="before_v9", + text=r""" [[freqremin]] is used only for numerical integration of the GW self-energy ([[gwcalctyp]] in [2, 12, 22, 9, 19, 29]). [[freqremin]] sets the minimum real frequency used to calculate the dielectric @@ -5902,54 +6402,57 @@ [[freqremax]], [[freqremin]] and [[nfreqre]] define the spacing of the frequency mesh along the real axis. """, - ), - Variable( - abivarname="freqspmax", - varset="gw", - vartype="real", - topics=["SelfEnergy_basic"], - dimensions="scalar", - defaultval=0.0, - mnemonics="FREQuencies for the SPectral function MAXimum", - characteristics=["[[ENERGY]]"], - requires="[[optdriver]] == 4", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="freqspmax", + varset="gw", + vartype="real", + topics=["SelfEnergy_basic"], + dimensions="scalar", + defaultval=0.0, + mnemonics="FREQuencies for the SPectral function MAXimum", + characteristics=["[[ENERGY]]"], + requires="[[optdriver]] == 4", + added_in_version="before_v9", + text=r""" [[freqspmax]] sets the maximum real frequency used to calculate the spectral function $A_\nk(\ww)$ from the GW Green's function. [[freqspmin]], [[freqspmax]] and [[nfreqsp]] define the spacing of an equidistant frequency mesh along the real axis. Alternatively, the variables [[gw_customnfreqsp]] and [[gw_freqsp]] can be used to make a user-defined grid. """, - ), - Variable( - abivarname="freqspmin", - varset="gw", - vartype="real", - topics=["SelfEnergy_basic"], - dimensions="scalar", - defaultval="-[[freqspmax]]", - mnemonics="FREQuencies for the SPectral function MINimum", - characteristics=["[[ENERGY]]"], - requires="[[optdriver]] == 4", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="freqspmin", + varset="gw", + vartype="real", + topics=["SelfEnergy_basic"], + dimensions="scalar", + defaultval="-[[freqspmax]]", + mnemonics="FREQuencies for the SPectral function MINimum", + characteristics=["[[ENERGY]]"], + requires="[[optdriver]] == 4", + added_in_version="before_v9", + text=r""" [[freqspmin]] sets the minimum real frequency used to calculate the spectral function from the GW Green's function. [[freqspmin]] is set to -[[freqspmax]] if left undefined. [[freqspmin]], [[freqspmax]], and [[nfreqsp]] define the spacing of an equidistant frequency mesh along the real axis. Alternatively, the variables [[gw_customnfreqsp]] and [[gw_freqsp]] can be used to make a user-defined grid. """, - ), - Variable( - abivarname="friction", - varset="rlx", - vartype="real", - topics=["PIMD_basic", "MolecularDynamics_useful"], - dimensions="scalar", - defaultval=0.001, - mnemonics="internal FRICTION coefficient", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="friction", + varset="rlx", + vartype="real", + topics=["PIMD_basic","MolecularDynamics_useful"], + dimensions="scalar", + defaultval=0.001, + mnemonics="internal FRICTION coefficient", + added_in_version="before_v9", + text=r""" Gives the internal friction coefficient (atomic units) for Langevin dynamics (when [[moldyn]] = "nvt_langevin" or "npt_langevin" or [[ionmov]] = 16 or [[imgmov]] = 9): fixed temperature simulations with random forces. @@ -5958,79 +6461,84 @@ where $F_{random,I}$ is a Gaussian random force with average zero and variance [[friction]]$*2M_IkT/$[[dtion]]. The atomic unit of [[friction]] is Hartree*Electronic mass*(atomic unit of Time)/Bohr^2. See [[cite:Chelikowsky2000]] and [[cite:Quigley2004]] for additional information. """, - ), - Variable( - abivarname="frictionbar", - varset="rlx", - vartype="real", - topics=["MolecularDynamics_useful"], - dimensions="scalar", - defaultval=0.001, - mnemonics="internal FRICTION coefficient of the BARostat", - added_in_version="v10.2", - text=r""" +), + +Variable( + abivarname="frictionbar", + varset="rlx", + vartype="real", + topics=["MolecularDynamics_useful"], + dimensions="scalar", + defaultval=0.001, + mnemonics="internal FRICTION coefficient of the BARostat", + added_in_version="v10.2", + text=r""" Gives the internal friction coefficient (atomic units) of the barostat for Langevin dynamics (when [[moldyn]] = "npt_langevin" ([[ionmov]] = 16 and [[optcell]] = 2). The mass of the barostat ([[bmass]]) must be given in addition. See [[cite:Quigley2004]] and [[cite:Quigley2005]] for additional information. """, - ), - Variable( - abivarname="frzfermi", - varset="dfpt", - vartype="integer", - topics=["DFPT_expert"], - dimensions="scalar", - defaultval=0, - mnemonics="FReeZe FERMI energy", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="frzfermi", + varset="dfpt", + vartype="integer", + topics=["DFPT_expert"], + dimensions="scalar", + defaultval=0, + mnemonics="FReeZe FERMI energy", + added_in_version="before_v9", + text=r""" Can be used to suppress artificially the first-order change of Fermi energy, in case of Response Function calculation for metals at Q=0. If the input variable [[frzfermi]] is set to 1, this contribution is suppressed, even though this is incorrect. """, - ), - Variable( - abivarname="fxcartfactor", - varset="rlx", - vartype="real", - topics=["TransPath_expert", "GeoOpt_expert"], - dimensions="scalar", - defaultval=ValueWithUnit(units="(Bohr^2)/Hartree", value=1), - mnemonics="Forces to (X) CARTesian coordinates FACTOR", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="fxcartfactor", + varset="rlx", + vartype="real", + topics=["TransPath_expert", "GeoOpt_expert"], + dimensions="scalar", + defaultval=ValueWithUnit(units="(Bohr^2)/Hartree", value=1), + mnemonics="Forces to (X) CARTesian coordinates FACTOR", + added_in_version="before_v9", + text=r""" The forces multiplied by [[fxcartfactor]] will be treated like difference in cartesian coordinates in the process of optimization. This is a simple preconditioner. TO BE UPDATED See ([[geoopt]] = "bfgs" or "lbfgs", non-zero [[optcell]]). For example, the stopping criterion defined by [[tolmxf]] relates to these scaled stresses. """, - ), - Variable( - abivarname="ga_algor", - varset="rlx", - vartype="integer", - topics=["GeoOpt_expert"], - dimensions="scalar", - defaultval=1, - mnemonics="Genetic Algorithm - ALGOrithm selection", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="ga_algor", + varset="rlx", + vartype="integer", + topics=["GeoOpt_expert"], + dimensions="scalar", + defaultval=1, + mnemonics="Genetic Algorithm - ALGOrithm selection", + added_in_version="before_v9", + text=r""" Choosing method to make the structure selection. Only the enthalpy is used now but we plan to include, energy, electronic band gap and alchemical potentials. Right now only value of 1 (enthalpy) works. """, - ), - Variable( - abivarname="ga_fitness", - varset="rlx", - vartype="integer", - topics=["GeoOpt_expert"], - dimensions="scalar", - defaultval=1, - mnemonics="Genetic Algorithm FITNESS function selection", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="ga_fitness", + varset="rlx", + vartype="integer", + topics=["GeoOpt_expert"], + dimensions="scalar", + defaultval=1, + mnemonics="Genetic Algorithm FITNESS function selection", + added_in_version="before_v9", + text=r""" Different methodologies to perform the roulette-wheel selection of parents. Even though, the objective function is the crystalline enthalpy (H_i), the weight of the population elements to be chosen from in a roulette-wheel @@ -6040,44 +6548,47 @@ 2. F = exp(-(H_i-H_min)) / Sum exp(-(H_i-H_min)) 3. F = (1/n_i) / Sum (1/n_i). Where n_i is the position in the ordered list of enthalpies """, - ), - Variable( - abivarname="ga_n_rules", - varset="rlx", - vartype="integer", - topics=["GeoOpt_expert"], - dimensions="scalar", - defaultval=1, - mnemonics="Genetic Algorithm Number of RULES", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="ga_n_rules", + varset="rlx", + vartype="integer", + topics=["GeoOpt_expert"], + dimensions="scalar", + defaultval=1, + mnemonics="Genetic Algorithm Number of RULES", + added_in_version="before_v9", + text=r""" Different genetic rules have been implemented and the user has the change to choose between any of them. Right now we have 4 rules. See [[ga_rules]] """, - ), - Variable( - abivarname="ga_opt_percent", - varset="rlx", - vartype="real", - topics=["GeoOpt_expert"], - dimensions="scalar", - defaultval=0.2, - mnemonics="Genetic Algorithm OPTimal PERCENT", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="ga_opt_percent", + varset="rlx", + vartype="real", + topics=["GeoOpt_expert"], + dimensions="scalar", + defaultval=0.2, + mnemonics="Genetic Algorithm OPTimal PERCENT", + added_in_version="before_v9", + text=r""" Percentage of the population that according to the fitness function passes to the following iteration. """, - ), - Variable( - abivarname="ga_rules", - varset="rlx", - vartype="integer", - topics=["GeoOpt_expert"], - dimensions="scalar", - defaultval=1, - mnemonics="Genetic Algorithm RULES", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="ga_rules", + varset="rlx", + vartype="integer", + topics=["GeoOpt_expert"], + dimensions="scalar", + defaultval=1, + mnemonics="Genetic Algorithm RULES", + added_in_version="before_v9", + text=r""" Different genetic rules have been implemented and the user has the change to choose between any of them. The chosen number of rules have been defined in [[ga_n_rules]] @@ -6092,17 +6603,18 @@ 3) Random strain. A random anisotropic deformation is given to the unit cell. 4) Coordinates mutation of 1/4 of the whole coordinates. """, - ), - Variable( - abivarname="genafm", - varset="geo", - vartype="real", - topics=["spinpolarisation_useful", "SmartSymm_useful"], - dimensions=[3], - defaultval=MultipleValue(number=3, value=0), - mnemonics="GENerator of the translation for Anti-FerroMagnetic space group", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="genafm", + varset="geo", + vartype="real", + topics=["spinpolarisation_useful", "SmartSymm_useful"], + dimensions=[3], + defaultval=MultipleValue(number=3, value=0), + mnemonics="GENerator of the translation for Anti-FerroMagnetic space group", + added_in_version="before_v9", + text=r""" This input variable might be used to define a Shubnikov type IV magnetic space group (anti-ferromagnetic space group). The user is advised to consult [[cite:Bradley1972]] A Shubnikov type IV magnetic space group might be defined by its Fedorov space @@ -6113,17 +6625,18 @@ both [[spgroup]] and [[genafm]]. Alternatively, one might define [[spgroup]] and [[spgroupma]], or define by hand the set of symmetries, using [[symrel]], [[tnons]] and [[symafm]]. """, - ), - Variable( - abivarname="geoopt", - varset="rlx", - vartype="string", - topics=["GeoOpt_compulsory"], - dimensions="scalar", - defaultval="none", - mnemonics="GEOmetry OPTimization", - added_in_version="10.3", - text=r""" +), + +Variable( + abivarname="geoopt", + varset="rlx", + vartype="string", + topics=["GeoOpt_compulsory"], + dimensions="scalar", + defaultval="none", + mnemonics="GEOmetry OPTimization", + added_in_version="10.3", + text=r""" Choice of algorithm to control the displacements of ions for geometry optimization, and possibly changes of cell shape and size (see [[optcell]]). No meaning for RF calculations. @@ -6181,17 +6694,18 @@ **Purpose:** Structural optimization **Cell optimization:** Yes (if [[optcell]]/=0) """, - ), - Variable( - abivarname="get1den", - varset="files", - vartype="integer", - topics=["nonlinear_useful", "ElPhonInt_useful"], - dimensions="scalar", - defaultval=0, - mnemonics="GET the first-order density from _1DEN file", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="get1den", + varset="files", + vartype="integer", + topics=["nonlinear_useful", "ElPhonInt_useful"], + dimensions="scalar", + defaultval=0, + mnemonics="GET the first-order density from _1DEN file", + added_in_version="before_v9", + text=r""" Relevant only for non self consistent RF calculations (e.g. to get electron phonon matrix elements) or for non linear RF calculations (to get mixed higher order derivatives you need several perturbed densities and wave functions). @@ -6209,17 +6723,18 @@ to find the needed data (once again, going back beyond the first dataset is equivalent to using a zero get variable). """, - ), - Variable( - abivarname="get1wf", - varset="files", - vartype="integer", - topics=["multidtset_useful"], - dimensions="scalar", - defaultval=0, - mnemonics="GET the first-order wavefunctions from _1WF file", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="get1wf", + varset="files", + vartype="integer", + topics=["multidtset_useful"], + dimensions="scalar", + defaultval=0, + mnemonics="GET the first-order wavefunctions from _1WF file", + added_in_version="before_v9", + text=r""" Eventually used when [[ndtset]] > 0 (in the multi-dataset mode), to indicate starting wavefunctions, as an alternative to [[ird1wf]]. One should first read the explanations given for these latter variables. @@ -6240,17 +6755,18 @@ See also discussion in [[getwfk]]. """, - ), - Variable( - abivarname="getbscoup", - varset="files", - vartype="integer", - topics=["multidtset_useful"], - dimensions="scalar", - defaultval=0, - mnemonics="GET the Bethe-Salpeter COUPling block from...", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="getbscoup", + varset="files", + vartype="integer", + topics=["multidtset_useful"], + dimensions="scalar", + defaultval=0, + mnemonics="GET the Bethe-Salpeter COUPling block from...", + added_in_version="before_v9", + text=r""" Eventually used when [[ndtset]] > 0 (multi-dataset mode), in the case of a Bethe-Salpeter calculation, to indicate that the starting coupling block of the excitonic Hamiltonian will be taken from the output of a previous dataset. It @@ -6268,17 +6784,18 @@ to find the needed data (once again, going back beyond the first dataset is equivalent to using a zero get variable). """, - ), - Variable( - abivarname="getbseig", - varset="files", - vartype="integer", - topics=["multidtset_useful"], - dimensions="scalar", - defaultval=0, - mnemonics="GET the Bethe-Salpeter EIGenstates from...", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="getbseig", + varset="files", + vartype="integer", + topics=["multidtset_useful"], + dimensions="scalar", + defaultval=0, + mnemonics="GET the Bethe-Salpeter EIGenstates from...", + added_in_version="before_v9", + text=r""" Eventually used when [[ndtset]] > 0 (multi-dataset mode), in the case of a Bethe-Salpeter calculation, to indicate that the starting excitonic eigenstates are to be taken from the output of a previous dataset. It is used to chain the @@ -6296,17 +6813,18 @@ to find the needed data (once again, going back beyond the first dataset is equivalent to using a zero get variable). """, - ), - Variable( - abivarname="getbsreso", - varset="files", - vartype="integer", - topics=["multidtset_useful"], - dimensions="scalar", - defaultval=0, - mnemonics="GET the Bethe-Salpeter RESOnant block from...", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="getbsreso", + varset="files", + vartype="integer", + topics=["multidtset_useful"], + dimensions="scalar", + defaultval=0, + mnemonics="GET the Bethe-Salpeter RESOnant block from...", + added_in_version="before_v9", + text=r""" Eventually used when [[ndtset]] > 0 (multi-dataset mode), in the case of a Bethe-Salpeter calculation, to indicate that the starting resonant block of the excitonic Hamiltonian will be taken from the output of a previous dataset. It @@ -6324,17 +6842,18 @@ to find the needed data (once again, going back beyond the first dataset is equivalent to using a zero get variable). """, - ), - Variable( - abivarname="getcell", - varset="rlx", - vartype="integer", - topics=["multidtset_useful"], - dimensions="scalar", - defaultval=0, - mnemonics="GET CELL parameters from...", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="getcell", + varset="rlx", + vartype="integer", + topics=["multidtset_useful"], + dimensions="scalar", + defaultval=0, + mnemonics="GET CELL parameters from...", + added_in_version="before_v9", + text=r""" This variable is typically used to chain the calculations, in the multi- dataset mode ([[ndtset]] > 0). It describes from which dataset the output [[acell]] and [[rprim]] are to be taken (implicitly also [[scalecart]]), as input of the present dataset. @@ -6351,18 +6870,19 @@ to find the needed data (once again, going back beyond the first dataset is equivalent to using a zero get variable). """, - ), - Variable( - abivarname="getctqmcdata", - varset="dmft", - vartype="integer", - topics=["DmftTriqsCthyb_useful"], - dimensions="scalar", - defaultval=0, - mnemonics="GET CTQMC DATA from...", - requires=r"[[usedmft]] == 1, [[dmft_solv]] $\in$ [6,7]", - added_in_version="before v10.5.6", - text=r""" +), + +Variable( + abivarname="getctqmcdata", + varset="dmft", + vartype="integer", + topics=["DmftTriqsCthyb_useful"], + dimensions="scalar", + defaultval=0, + mnemonics="GET CTQMC DATA from...", + requires=r"[[usedmft]] == 1, [[dmft_solv]] $\in$ [6,7]", + added_in_version="before v10.5.6", + text=r""" Eventually used when [[ndtset]] > 0 (multi-dataset mode) to indicate that the starting CT-HYB configuration is to be taken from the output of a previous dataset. It is used to chain the calculations and greatly speed-up warmup, since it describes from which @@ -6380,17 +6900,18 @@ * If [[getctqmcdata]] is a negative number, it indicates the number of datasets to go backward to find the needed file. Going back beyond the first dataset is equivalent to using zero for the get variable. """, - ), - Variable( - abivarname="getddb", - varset="files", - vartype="integer", - topics=["ElPhonInt_basic", "TDepES_useful"], - dimensions="scalar", - defaultval=0, - mnemonics="GET the DDB from...", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="getddb", + varset="files", + vartype="integer", + topics=["ElPhonInt_basic", "TDepES_useful"], + dimensions="scalar", + defaultval=0, + mnemonics="GET the DDB from...", + added_in_version="before_v9", + text=r""" This variable should be used when performing electron-phonon or temperature-dependent calculations in semiconductors with the legacy implementation that computes the e-ph matrix elements at the end of the DFPT run (for the new EPH code, see [[eph_task]]). @@ -6418,17 +6939,18 @@ Note also that, starting Abinit v9, one can also use [[getddb_filepath]] to specify the path of the file directly. """, - ), - Variable( - abivarname="getddk", - varset="files", - vartype="integer", - topics=["multidtset_useful"], - dimensions="scalar", - defaultval=0, - mnemonics="GET the DDK wavefunctions from _1WF file", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="getddk", + varset="files", + vartype="integer", + topics=["multidtset_useful"], + dimensions="scalar", + defaultval=0, + mnemonics="GET the DDK wavefunctions from _1WF file", + added_in_version="before_v9", + text=r""" Eventually used when [[ndtset]] > 0 (in the multi-dataset mode), to indicate starting DDK wavefunctions, as an alternative to [[irdddk]]. One should first read the explanations given for the latter variable. @@ -6452,17 +6974,18 @@ value of the current dataset (i.e. getddk3 3 ) - this is a bit strange and should be changed in the future. """, - ), - Variable( - abivarname="getdelfd", - varset="files", - vartype="integer", - topics=["multidtset_useful"], - dimensions="scalar", - defaultval=0, - mnemonics="GET the 1st derivative of wavefunctions with respect to ELectric FielD, from _1WF file", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="getdelfd", + varset="files", + vartype="integer", + topics=["multidtset_useful"], + dimensions="scalar", + defaultval=0, + mnemonics="GET the 1st derivative of wavefunctions with respect to ELectric FielD, from _1WF file", + added_in_version="before_v9", + text=r""" Eventually used when [[ndtset]] > 0 (in the multi-dataset mode), to indicate starting wavefunctions for the 1st derivative of wavefunctions with respect to ELectric FielD, from _1WF file. The [[getdelfd]] variable is @@ -6481,17 +7004,18 @@ backward to find the needed wavefunction file. Going back beyond the first dataset is equivalent to using zero for the get variable. """, - ), - Variable( - abivarname="getden", - varset="files", - vartype="integer", - topics=["multidtset_useful"], - dimensions="scalar", - defaultval=0, - mnemonics="GET the DENsity from...", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="getden", + varset="files", + vartype="integer", + topics=["multidtset_useful"], + dimensions="scalar", + defaultval=0, + mnemonics="GET the DENsity from...", + added_in_version="before_v9", + text=r""" Eventually used when [[ndtset]] > 0 (multi-dataset mode) and, in the case of a ground-state calculation, if [[iscf]]<0 (non-SCF calculation), to indicate that the starting density is to be taken from the output of a previous @@ -6515,17 +7039,18 @@ not have the proper name (it has a "TIM" indication) for use as an input of an [[iscf]]<0 calculation. One should use the output density of a [[ionmov]] == 0 run. """, - ), - Variable( - abivarname="getdkde", - varset="files", - vartype="integer", - topics=["multidtset_useful"], - dimensions="scalar", - defaultval=0, - mnemonics="GET the mixed 2nd derivative of wavefunctions with respect to K and electric field, from _1WF file", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="getdkde", + varset="files", + vartype="integer", + topics=["multidtset_useful"], + dimensions="scalar", + defaultval=0, + mnemonics="GET the mixed 2nd derivative of wavefunctions with respect to K and electric field, from _1WF file", + added_in_version="before_v9", + text=r""" Eventually used when [[ndtset]] > 0 (in the multi-dataset mode), to indicate starting DKDE wavefunctions. The [[getdkde]] variable is @@ -6544,17 +7069,18 @@ backward to find the needed wavefunction file. Going back beyond the first dataset is equivalent to using zero for the get variable. """, - ), - Variable( - abivarname="getdkdk", - varset="files", - vartype="integer", - topics=["multidtset_useful"], - dimensions="scalar", - defaultval=0, - mnemonics="GET the 2nd derivative of wavefunctions with respect to K, from _1WF file", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="getdkdk", + varset="files", + vartype="integer", + topics=["multidtset_useful"], + dimensions="scalar", + defaultval=0, + mnemonics="GET the 2nd derivative of wavefunctions with respect to K, from _1WF file", + added_in_version="before_v9", + text=r""" Eventually used when [[ndtset]] > 0 (in the multi-dataset mode), to indicate starting DKDK wavefunctions. The [[getdkdk]] variable is @@ -6573,17 +7099,18 @@ backward to find the needed wavefunction file. Going back beyond the first dataset is equivalent to using zero for the get variable. """, - ), - Variable( - abivarname="getdvdb", - varset="files", - vartype="integer", - topics=["ElPhonInt_useful"], - dimensions="scalar", - defaultval=0, - mnemonics="GET the DVDB from...", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="getdvdb", + varset="files", + vartype="integer", + topics=["ElPhonInt_useful"], + dimensions="scalar", + defaultval=0, + mnemonics="GET the DVDB from...", + added_in_version="before_v9", + text=r""" This variable can be used when performing electron-phonon calculations with [[optdriver]] = 7 to read a DVDB file (derivative of potential) produced in a previous dataset. For example, one can concatenate a dataset in which an initial set of DFPT potentials @@ -6602,18 +7129,19 @@ backward to find the needed file. Going back beyond the first dataset is equivalent to using zero for the get variable. Note also that, starting Abinit v9, one can also use [[getdvdb_filepath]] to specify the path of the file directly. -""", - ), - Variable( - abivarname="getefmas", - varset="files", - vartype="integer", - topics=["multidtset_useful"], - dimensions="scalar", - defaultval=0, - mnemonics="GET the EFfective MASses from...", - added_in_version="before_v9", - text=r""" +""" +), + +Variable( + abivarname="getefmas", + varset="files", + vartype="integer", + topics=["multidtset_useful"], + dimensions="scalar", + defaultval=0, + mnemonics="GET the EFfective MASses from...", + added_in_version="before_v9", + text=r""" Eventually used when [[ndtset]] > 0 (multi-dataset mode). Only relevant for [[optdriver]]=7 and [[eph_task]]=6. 10. If set to 1, take the data from a _EFMAS file as input. The latter must have been produced using [[prtefmas]]. @@ -6631,18 +7159,19 @@ backward to find the needed file. Going back beyond the first dataset is equivalent to using zero for the get variable. """, - ), - Variable( - abivarname="getgam_eig2nkq", - varset="dev", - vartype="integer", - topics=["multidtset_useful", "TDepES_useful"], - dimensions="scalar", - defaultval=0, - mnemonics="GET the GAMma phonon data EIG2NKQ from dataset", - requires="[[ieig2rf]] != 0 and [[qpt]] != (0.0, 0.0, 0.0)", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="getgam_eig2nkq", + varset="dev", + vartype="integer", + topics=["multidtset_useful", "TDepES_useful"], + dimensions="scalar", + defaultval=0, + mnemonics="GET the GAMma phonon data EIG2NKQ from dataset", + requires="[[ieig2rf]] != 0 and [[qpt]] != (0.0, 0.0, 0.0)", + added_in_version="before_v9", + text=r""" Relevant for second-order eigenvalue calculations using response-functions ([[ieig2rf]] != 0), and only for non-zero wavevectors [[qpt]]. From the electron-phonon matrix elements at some wavevector only, it is not @@ -6652,17 +7181,18 @@ second-order derivatives of the eigenvalues for q=Gamma from the dataset where the calculation at Gamma was done, to the datasets for other wavevectors. """, - ), - Variable( - abivarname="gethaydock", - varset="files", - vartype="integer", - topics=["multidtset_useful"], - dimensions="scalar", - defaultval=0, - mnemonics="GET the HAYDOCK restart file from...", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="gethaydock", + varset="files", + vartype="integer", + topics=["multidtset_useful"], + dimensions="scalar", + defaultval=0, + mnemonics="GET the HAYDOCK restart file from...", + added_in_version="before_v9", + text=r""" Eventually used when [[ndtset]] > 0 (multi-dataset mode) and, in the case of a Bethe-Salpeter calculation to indicate that the Haydock iterative technique will be restarted from the output of a previous dataset. @@ -6677,17 +7207,18 @@ * If [[gethaydock]] is a negative number, it indicates the number of datasets to go backward to find the needed file. Going back beyond the first dataset is equivalent to using zero for the get variable. """, - ), - Variable( - abivarname="getkden", - varset="files", - vartype="integer", - topics=["multidtset_useful"], - dimensions="scalar", - defaultval="[[getden]]", - mnemonics="GET the Kinetic energy DENsity from...", - added_in_version="9.10.4", - text=r""" +), + +Variable( + abivarname="getkden", + varset="files", + vartype="integer", + topics=["multidtset_useful"], + dimensions="scalar", + defaultval="[[getden]]", + mnemonics="GET the Kinetic energy DENsity from...", + added_in_version="9.10.4", + text=r""" Only relevant when [[usekden]]=1 (meta GGA exchange-correlation functionals). Eventually used when [[ndtset]] > 0 (multi-dataset mode) and, in the case of a ground-state calculation, if [[iscf]]<0 (non-SCF calculation), to indicate @@ -6707,17 +7238,18 @@ * If [[getkden]] is a negative number, it indicates the number of datasets to go backward to find the needed file. Going back beyond the first dataset is equivalent to using zero for the get variable. """, - ), - Variable( - abivarname="getocc", - varset="files", - vartype="integer", - topics=["multidtset_useful"], - dimensions="scalar", - defaultval=0, - mnemonics="GET OCC parameters from...", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="getocc", + varset="files", + vartype="integer", + topics=["multidtset_useful"], + dimensions="scalar", + defaultval=0, + mnemonics="GET OCC parameters from...", + added_in_version="before_v9", + text=r""" This variable is typically used to chain the calculations, in the multi- dataset mode ([[ndtset]] > 0), since it describes from which dataset the array [[occ]] is to be taken, as input of the present dataset. The occupation @@ -6740,17 +7272,18 @@ numbers of bands must be identical to the numbers of bands of the dataset from which [[occ]] will be copied. The same is true for the number of k points. """, - ), - Variable( - abivarname="getqps", - varset="files", - vartype="integer", - topics=["multidtset_useful", "GW_useful", "Susceptibility_useful", "SelfEnergy_useful"], - dimensions="scalar", - defaultval=0, - mnemonics="GET QuasiParticle Structure", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="getqps", + varset="files", + vartype="integer", + topics=["multidtset_useful", "GW_useful", "Susceptibility_useful", "SelfEnergy_useful"], + dimensions="scalar", + defaultval=0, + mnemonics="GET QuasiParticle Structure", + added_in_version="before_v9", + text=r""" Used when [[ndtset]] > 0 (multi-dataset mode) and [[optdriver]] = 3, or 4 (screening or sigma step of a GW calculation), to indicate that the eigenvalues and possibly the wavefunctions have to be taken from a previous @@ -6769,17 +7302,18 @@ * If [[getqps]] is a negative number, it indicates the number of datasets to go backward to find the needed data. Going back beyond the first dataset is equivalent to using zero for the get variable. """, - ), - Variable( - abivarname="getscr", - varset="files", - vartype="integer", - topics=["multidtset_useful", "GW_useful", "SelfEnergy_useful"], - dimensions="scalar", - defaultval=0, - mnemonics="GET SCReening (the inverse dielectric matrix) from...", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="getscr", + varset="files", + vartype="integer", + topics=["multidtset_useful", "GW_useful", "SelfEnergy_useful"], + dimensions="scalar", + defaultval=0, + mnemonics="GET SCReening (the inverse dielectric matrix) from...", + added_in_version="before_v9", + text=r""" Used when [[ndtset]] > 0 (multi-dataset mode) and [[optdriver]] = 4 (sigma step of a GW calculation), to indicate that the dielectric matrix (_SCR file) is to be taken from the output of a previous dataset. It is used to chain the @@ -6799,18 +7333,19 @@ * If [[getscr]] is a negative number, it indicates the number of datasets to go backward to find the needed data. Going back beyond the first dataset is equivalent to using zero for the get variable. """, - ), - Variable( - abivarname="getself", - varset="dmft", - vartype="integer", - topics=["DMFT_useful", "DmftTriqsCthyb_useful"], - dimensions="scalar", - defaultval=0, - mnemonics="GET SELF-energy from...", - requires="[[usedmft]]=1", - added_in_version="before v10.5.6", - text=r""" +), + +Variable( + abivarname="getself", + varset="dmft", + vartype="integer", + topics=["DMFT_useful","DmftTriqsCthyb_useful"], + dimensions="scalar", + defaultval=0, + mnemonics="GET SELF-energy from...", + requires="[[usedmft]]=1", + added_in_version="before v10.5.6", + text=r""" Eventually used when [[ndtset]] > 0 (multi-dataset mode) to indicate that the starting DMFT self-energy is to be taken from the output of a previous dataset. It is used to chain the calculations, since it describes from which @@ -6828,17 +7363,18 @@ * If [[getself]] is a negative number, it indicates the number of datasets to go backward to find the needed file. Going back beyond the first dataset is equivalent to using zero for the get variable. """, - ), - Variable( - abivarname="getsuscep", - varset="files", - vartype="integer", - topics=["multidtset_useful", "GW_useful", "SelfEnergy_useful"], - dimensions="scalar", - defaultval=0, - mnemonics="GET SUSCEPtibility (the irreducible polarizability) from...", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="getsuscep", + varset="files", + vartype="integer", + topics=["multidtset_useful", "GW_useful", "SelfEnergy_useful"], + dimensions="scalar", + defaultval=0, + mnemonics="GET SUSCEPtibility (the irreducible polarizability) from...", + added_in_version="before_v9", + text=r""" Used when [[ndtset]] > 0 (multi-dataset mode) and [[optdriver]] = 4 (sigma step of a GW calculation), to indicate that the irreducible polarizability (_SUSC file) is to be taken from the output of a previous dataset. It is used to @@ -6864,17 +7400,18 @@ * If [[getsuscep]] is a negative number, it indicates the number of datasets to go backward to find the needed data. Going back beyond the first dataset is equivalent to using zero for the get variable """, - ), - Variable( - abivarname="getvel", - varset="rlx", - vartype="integer", - topics=["multidtset_useful"], - dimensions="scalar", - defaultval=0, - mnemonics="GET VEL from...", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="getvel", + varset="rlx", + vartype="integer", + topics=["multidtset_useful"], + dimensions="scalar", + defaultval=0, + mnemonics="GET VEL from...", + added_in_version="before_v9", + text=r""" This variable is typically used to chain the calculations, in the multi- dataset mode ([[ndtset]] > 0) since they describe from which dataset the corresponding output variables are to be taken, as input of the present @@ -6895,17 +7432,18 @@ Note: The use of [[getvel]] with [[getxred]] is allowed, despite the different coordinate system. """, - ), - Variable( - abivarname="getwfk", - varset="files", - vartype="integer", - topics=["multidtset_useful"], - dimensions="scalar", - defaultval=0, - mnemonics="GET the wavefunctions from _WFK file", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="getwfk", + varset="files", + vartype="integer", + topics=["multidtset_useful"], + dimensions="scalar", + defaultval=0, + mnemonics="GET the wavefunctions from _WFK file", + added_in_version="before_v9", + text=r""" Eventually used when [[ndtset]] > 0 (in the multi-dataset mode), to indicate starting wavefunctions, as an alternative to [[irdwfk]]. Note also that, starting Abinit v9, one can also use [[getwfk_filepath]] to specify the path of the file directly. @@ -6943,17 +7481,18 @@ refers to dataset 2 when dataset 4 is initialized. """, - ), - Variable( - abivarname="getwfkfine", - varset="dev", - vartype="integer", - topics=["multidtset_useful", "DFPT_useful", "TDepES_useful"], - dimensions="scalar", - defaultval=0, - mnemonics="GET the fine grid wavefunctions from _WFK file", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="getwfkfine", + varset="dev", + vartype="integer", + topics=["multidtset_useful", "DFPT_useful", "TDepES_useful"], + dimensions="scalar", + defaultval=0, + mnemonics="GET the fine grid wavefunctions from _WFK file", + added_in_version="before_v9", + text=r""" Eventually used when [[ndtset]] > 0 (in the multi-dataset mode), to indicate starting wavefunctions, as an alternative to [[irdwfkfine]]. One should first read the explanations given for this latter variable. @@ -6990,34 +7529,55 @@ **This variable is experimental. In development.** """, - ), - Variable( - abivarname="getwfq", - varset="files", - vartype="integer", - topics=["multidtset_useful"], - dimensions="scalar", - defaultval=0, - mnemonics="GET the wavefunctions from _WFQ file", - added_in_version="before_v9", - text=r""" +), + + +Variable( + abivarname="getwfmq", + varset="files", + vartype="integer", + topics=["multidtset_useful"], + dimensions="scalar", + defaultval=0, + mnemonics="GET the wavefunctions from _WFQ file at k-q", + added_in_version="10.4", + text=r""" +Eventually used when [[ndtset]] > 0 (in the multi-dataset mode) and [[tim1rev]]=0, to indicate +starting k-q wavefunctions, as an alternative to [[irdwfmq]]. +Note also that, starting Abinit v9, one can also use [[getwfmq_filepath]] to specify the path of the file directly. + +Similar to [[getwfk]] input variable, but will be used to initialize the wavefunctions at k-q. +""", +), + +Variable( + abivarname="getwfq", + varset="files", + vartype="integer", + topics=["multidtset_useful"], + dimensions="scalar", + defaultval=0, + mnemonics="GET the wavefunctions from _WFQ file", + added_in_version="before_v9", + text=r""" Eventually used when [[ndtset]] > 0 (in the multi-dataset mode), to indicate starting k+q wavefunctions, as an alternative to [[irdwfq]]. Note also that, starting Abinit v9, one can also use [[getwfq_filepath]] to specify the path of the file directly. Similar to [[getwfk]] input variable, but will be used to initialize the wavefunctions at k+q. """, - ), - Variable( - abivarname="getxcart", - varset="rlx", - vartype="integer", - topics=["multidtset_useful"], - dimensions="scalar", - defaultval=0, - mnemonics="GET XCART from...", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="getxcart", + varset="rlx", + vartype="integer", + topics=["multidtset_useful"], + dimensions="scalar", + defaultval=0, + mnemonics="GET XCART from...", + added_in_version="before_v9", + text=r""" This variable is typically used to chain the calculations, in the multi- dataset mode ([[ndtset]] > 0) since it describes from which dataset the corresponding output variables are to be taken, as input of the present @@ -7044,17 +7604,18 @@ same dataset. On the other hand the use of [[getvel]] with [[getxred]] is allowed, despite the different coordinate system. """, - ), - Variable( - abivarname="getxred", - varset="rlx", - vartype="integer", - topics=["multidtset_useful"], - dimensions="scalar", - defaultval=0, - mnemonics="GET XRED from...", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="getxred", + varset="rlx", + vartype="integer", + topics=["multidtset_useful"], + dimensions="scalar", + defaultval=0, + mnemonics="GET XRED from...", + added_in_version="before_v9", + text=r""" This variable is typically used to chain the calculations, in the multi- dataset mode ([[ndtset]] > 0) since it describes from which dataset the corresponding output variables are to be taken, as input of the present @@ -7081,17 +7642,35 @@ same dataset. On the other hand the use of [[getvel]] with [[getxred]] is allowed, despite the different coordinate system. """, - ), - Variable( - abivarname="goprecon", - varset="rlx", - vartype="integer", - topics=["GeoOpt_expert"], - dimensions="scalar", - defaultval=0, - mnemonics="Geometry Optimization PRECONditioner equations", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="ggtrcut", + varset="dfpt", + vartype="real", + topics=["printing_prngs", "Output_useful"], + dimensions="scalar", + defaultval=0.001, + mnemonics="GauGe TRansform CUToff", + added_in_version="10.9.0", + text=r""" +Cutoff value to use in computing gauge change from parallel transport to diagonal. +Expert use only, do not change unless you've studied the source code and know exactly +what you are doing and expecting. +""", +), + + +Variable( + abivarname="goprecon", + varset="rlx", + vartype="integer", + topics=["GeoOpt_expert"], + dimensions="scalar", + defaultval=0, + mnemonics="Geometry Optimization PRECONditioner equations", + added_in_version="before_v9", + text=r""" Set the kind of preconditioner to be used for Geometry Optimization (Note: Under development now (2011.05.20)) @@ -7099,33 +7678,35 @@ * [[goprecon]] = [1-9]: Linear preconditioner * [[goprecon]] = [11-19]: Non-linear preconditioner """, - ), - Variable( - abivarname="goprecprm", - varset="rlx", - vartype="real", - topics=["GeoOpt_expert"], - dimensions=[3], - defaultval=0, - mnemonics="Geometry Optimization PREconditioner PaRaMeters equations", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="goprecprm", + varset="rlx", + vartype="real", + topics=["GeoOpt_expert"], + dimensions=[3], + defaultval=0, + mnemonics="Geometry Optimization PREconditioner PaRaMeters equations", + added_in_version="before_v9", + text=r""" Set the parameters use by the preconditioner to be used for Geometry Optimization (Note: Under development now (2011.06.06)) """, - ), - Variable( - abivarname="gpu_devices", - varset="paral", - vartype="integer", - topics=["parallelism_expert"], - dimensions=[12], - defaultval=12 * (-1), - mnemonics="GPU: choice of DEVICES on one node", - requires="[[gpu_option]] > 0 and [[CUDA]] (Nvidia GPU)", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="gpu_devices", + varset="paral", + vartype="integer", + topics=["GPU_expert"], + dimensions=[12], + defaultval=12*(-1), + mnemonics="GPU: choice of DEVICES on one node", + requires="[[gpu_option]] > 0 and [[CUDA]] (Nvidia GPU)", + added_in_version="before_v9", + text=r""" @legacy This variable is intended to be used when several GPU devices are present on each node, assuming the same number of devices on all nodes. @@ -7150,36 +7731,38 @@ GPU card are numbered starting from 0; to get the GPU devices list, type f.i. (Nvidia): "nvidia-smi" or "lspci | grep -i nvidia". """, - ), - Variable( - abivarname="gpu_kokkos_nthrd", - varset="paral", - vartype="integer", - topics=["parallelism_expert"], - dimensions="scalar", - defaultval="number of [[OPENMP]] threads", - mnemonics="GPU KOKKOS implementation: Number of THReaDs", - requires="[[gpu_option]] == 3 ([[KOKKOS]] GPU implementation)", - added_in_version="v9.12", - text=r""" +), + +Variable( + abivarname="gpu_kokkos_nthrd", + varset="paral", + vartype="integer", + topics=["GPU_expert"], + dimensions="scalar", + defaultval="number of [[OPENMP]] threads", + mnemonics="GPU KOKKOS implementation: Number of THReaDs", + requires="[[gpu_option]] == 3 ([[KOKKOS]] GPU implementation)", + added_in_version="v9.12", + text=r""" When GPU acceleration is enabled (via [[KOKKOS]] implementation), OpenMP parallelism on CPU cores is not fully supported. ABINIT will ignore `OMP_NUM_THREADS` value, using 1 instead. But we may locally increase the number of OpenMP threads to speed-up some specific parts of the code. In that case we use [[gpu_kokkos_nthrd]] to specify the number of OpenMP threads. """, - ), - Variable( - abivarname="gpu_linalg_limit", - varset="paral", - vartype="integer", - topics=["parallelism_expert"], - dimensions="scalar", - defaultval=2000000, - mnemonics="GPU: LINear ALGebra LIMIT", - requires="[[gpu_option]] == 1 and [[CUDA]] (Nvidia GPU, old CUDA implementation)", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="gpu_linalg_limit", + varset="paral", + vartype="integer", + topics=["GPU_expert"], + dimensions="scalar", + defaultval=2000000, + mnemonics="GPU: LINear ALGebra LIMIT", + requires="[[gpu_option]] == 1 and [[CUDA]] (Nvidia GPU, old CUDA implementation)", + added_in_version="before_v9", + text=r""" @legacy This variable is obsolete and is only intended to be used with the old 2013 cuda implementation of ABINIT on GPU ([[gpu_option]]=1). @@ -7192,18 +7775,42 @@ to 14 which corresponds to the use of the legacy LOBPCG algorithm for the calculation of the eigenstates. """, - ), - Variable( - abivarname="gpu_nl_distrib", - varset="paral", - vartype="integer", - topics=["parallelism_expert"], - dimensions="scalar", - defaultval=0, - mnemonics="GPU: Non-Local operator, DISTRIBute projections", - requires="[[gpu_option]] == 2 ([[OPENMP_OFFLOAD]])", - added_in_version="9.12", - text=r""" +), + +Variable( + abivarname="gpu_nfft_blocks", + varset="paral", + vartype="integer", + topics=["GPU_expert"], + dimensions="scalar", + defaultval=1, + mnemonics="GPU: Number of Fast Fourier Transform Blocks", + requires="[[gpu_option]] == 2 ([[OPENMP_OFFLOAD]])", + added_in_version="10.8", + text=r""" +When using GPU acceleration, Fast Fourier Transforms (FFT) are computed on bands in parallel according +to the value of either [[bandpp]] or [[nblock_lobpcg]]. +[[gpu_nfft_blocks]] defines the number of blocks used to split these FFT operations to +save GPU memory usage. +In standard executions, the distribution is only needed on large use cases to address +the high memory needs. ABINIT automatically assess memory consumption and enable splitting +to fit in memory if needed. +As its heuristic to assess memory may be error-prone, user may use this parameter to force a +specific number of blocks. +""", +), + +Variable( + abivarname="gpu_nl_distrib", + varset="paral", + vartype="integer", + topics=["GPU_expert"], + dimensions="scalar", + defaultval=0, + mnemonics="GPU: Non-Local operator, DISTRIBute projections", + requires="[[gpu_option]] == 2 ([[OPENMP_OFFLOAD]])", + added_in_version="9.12", + text=r""" When using GPU acceleration, the wave-function projections ($<\tilde{p}_i|\Psi_{nk}> (used in the non-local operator) are all stored on all GPU devices. [[gpu_nl_distrib]] enable the distribution of these projections in slices on several GPU devices. @@ -7217,18 +7824,19 @@ It is recommended to use it with a GPU-aware MPI and enable its use when compiling ABINIT (`--enable-mpi-gpu-aware`). """, - ), - Variable( - abivarname="gpu_nl_splitsize", - varset="paral", - vartype="integer", - topics=["parallelism_expert"], - dimensions="scalar", - defaultval=1, - mnemonics="GPU: Non-Local operator SPLITting SIZE", - requires="[[gpu_option]] == 2 ([[OPENMP_OFFLOAD]])", - added_in_version="9.12", - text=r""" +), + +Variable( + abivarname="gpu_nl_splitsize", + varset="paral", + vartype="integer", + topics=["GPU_expert"], + dimensions="scalar", + defaultval=1, + mnemonics="GPU: Non-Local operator SPLITting SIZE", + requires="[[gpu_option]] == 2 ([[OPENMP_OFFLOAD]])", + added_in_version="9.12", + text=r""" When using GPU acceleration, the wave-function projections ($<\tilde{p}_i|\Psi_{nk}> (used in the non-local operator) are all stored on all GPU devices. [[gpu_nl_splitsize]] defines the number of slices used to split these projections to @@ -7242,64 +7850,60 @@ As its heuristic to assess memory may be error-prone, user may to use this parameter to force a specific splitting size. """, - ), - Variable( - abivarname="gpu_option", - varset="paral", - vartype="integer or string", - topics=["parallelism_useful"], - dimensions="scalar", - defaultval=ValueWithConditions({"[[OPENMP_OFFLOAD]]": 2, "[[KOKKOS]]": 3, "[[CUDA]]": 1, "defaultval": 0}), - mnemonics="GPU: OPTION to choose the implementation", - added_in_version="v9.12", - text=r""" -Only relevant for Ground-State calculations ([[optdriver]] == 0). -This option is only available if ABINIT executable has been compiled for the purpose -of being used with GPU accelerators. It allows to choose between the different -GPU programming models available in ABINIT: +), + +Variable( + abivarname="gpu_option", + varset="paral", + vartype="integer or string", + topics=["GPU_useful"], + dimensions="scalar", + defaultval=ValueWithConditions({"[[OPENMP_OFFLOAD]]": 2, "[[KOKKOS]]": 3, "[[CUDA]]": 1, "defaultval": 0}), + mnemonics="GPU: OPTION to choose the implementation", + added_in_version="v9.12", + text=r""" +Only relevant for Ground-State ([[optdriver]] == 0) or Response-Function ([[optdriver]] == 1) calculations. + +This option is only available if ABINIT executable has been compiled with support for GPU accelerators enabled (see [here](../INSTALL_gpu.md)). + +It allows to choose between the different GPU programming models available in ABINIT: - [[gpu_option]]= "GPU_DISABLED" or [[gpu_option]] = 0: no use of GPU (even if compiled for GPU). +- [[gpu_option]]= "GPU_OPENMP" or [[gpu_option]] = 2: use of the [[OPENMP_OFFLOAD]] GPU implementation. + This implementation works on NVIDIA and AMD GPU accelerators and is the only one being actively developped. + It offers the broadest support of GPU accelerated usecases (GS+Fock, DFPT, DMFT...). + - [[gpu_option]]= "GPU_LEGACY" or [[gpu_option]] = 1: use the "legacy" 2013 implementation of GPU. This is a partial [[CUDA]] - implementation, using the `nvcc` [[CUDA]] compiler. The old LOBPCG algorithm is automatically + implementation, using [[CUDA]] kernels. The old LOBPCG algorithm is automatically used to compute the eigenstates ([[wfoptalg]]=14). The external linear algebra library `MAGMA can also be linked to ABINIT to improve performances on large systems (see [[gpu_linalg_limit]]). -- [[gpu_option]]= "GPU_OPENMP" or [[gpu_option]] = 2: use of the [[OPENMP_OFFLOAD]] programming model to execute time consuming - parts of the code on GPU. This implementation works on NVidia accelerators, if ABINIT has been - compiled with a [[CUDA]] compatible compiler and linked with NVidia FFT/linear algebra - libraries ([cuFFT](https://docs.nvidia.com/cuda/cufft), - [cuBLAS](https://docs.nvidia.com/cuda/cublas) and - [cuSOLVER](https://docs.nvidia.com/cuda/cusolvermp)). - It also works on `AMD accelerators (EXPERIMENTAL), - if ABINIT has been compiled with a AMD compatible compiler and linked with NVidia - FFT/linear algebra libraries ([ROCm](https://www.amd.com/fr/graphics/servers-solutions-rocm) - or [HIP](https://github.com/ROCm/HIP)). - -- [[gpu_option]]= "GPU_KOKKOS" or [[gpu_option]] = 3: use of the [[KOKKOS]]+[[CUDA]] programming model to execute time consuming - parts of the code on GPU. This implementation -- at present -- is only compatible with - NVidia accelerators. It required that ABINIT has been linked to the +- [[gpu_option]]= "GPU_KOKKOS" or [[gpu_option]] = 3: use of the [[KOKKOS]]+[[CUDA]] GPU implementation. + This implementation -- at present -- is only compatible with + NVIDIA accelerators and only works on Ground-State calculation with [[wfoptalg]]=111 (ChebFI). + It required that ABINIT has been linked to the [Kokkos](https://github.com/kokkos/kokkos) and [YAKL](https://github.com/mrnorman/YAKL) - performance libraries. It also uses NVidia FFT/linear algebra libraries - ([cuFFT](https://docs.nvidia.com/cuda/cufft), [cuBLAS](https://docs.nvidia.com/cuda/cublas)). + performance libraries, along with NVIDIA CUDA libraries. The [[KOKKOS]] GPU implementation can be used in conjunction with openMP threads on CPU (see [[gpu_kokkos_nthrd]]). -For an expert use of ABINIT on [[GPU]], some additional keywords can be used. See [[gpu_nl_distrib]], [[gpu_nl_splitsize]]. -""", - ), - Variable( - abivarname="gpu_thread_limit", - varset="paral", - vartype="integer", - topics=["parallelism_expert"], - dimensions="scalar", - defaultval="Minimum between 4 and number of [[OPENMP]] threads, if GPU is enabled, 0 otherwise.", - mnemonics="GPU: Thread Limit", - requires="[[gpu_option]] /= 0 ", - added_in_version="10.4", - text=r""" +For an expert use of ABINIT on [[GPU]], some additional keywords can be used. See [[gpu_nl_distrib]], [[gpu_nl_splitsize]], [[gpu_nfft_blocks]], [[gpu_thread_limit]]. +""", +), + +Variable( + abivarname="gpu_thread_limit", + varset="paral", + vartype="integer", + topics=["GPU_expert"], + dimensions="scalar", + defaultval="Minimum between 4 and number of [[OPENMP]] threads, if GPU is enabled, 0 otherwise.", + mnemonics="GPU: Thread Limit", + requires="[[gpu_option]] /= 0 ", + added_in_version="10.4", + text=r""" When using GPU acceleration, some parts still runs on CPU and are parallelised using MPI distribution or OpenMP threads. Usually, GPU runs with one MPI task per GPU, which limits MPI-based parallelism, but with more OpenMP threads per tasks, which favors OpenMP parallelism. @@ -7307,34 +7911,36 @@ hence ABINIT limit the number of threads in those select regions, to 4 threads by default, if GPU is enabled. This parameter allows to change this limit, for tuning purposes. """, - ), - Variable( - abivarname="gw_customnfreqsp", - varset="gw", - vartype="integer", - topics=["FrequencyMeshMBPT_expert"], - dimensions="scalar", - defaultval=0, - mnemonics="GW CUSTOM FREQuencies for SPectral function", - requires="[[optdriver]] == 4 and [[gwcalctyp]] in [2, 9, 12, 19, 22, 29]", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="gw_customnfreqsp", + varset="gw", + vartype="integer", + topics=["FrequencyMeshMBPT_expert"], + dimensions="scalar", + defaultval=0, + mnemonics="GW CUSTOM FREQuencies for SPectral function", + requires="[[optdriver]] == 4 and [[gwcalctyp]] in [2, 9, 12, 19, 22, 29]", + added_in_version="before_v9", + text=r""" [[gw_customnfreqsp]] lets the user define the grid points along the real frequency axis by hand for the calculation of the self-energy along the real axis. Set this to the number of frequencies you want. The frequencies are specified with [[gw_freqsp]]. """, - ), - Variable( - abivarname="gw_freqsp", - varset="gw", - vartype="real", - topics=["FrequencyMeshMBPT_expert"], - dimensions=["[[gw_customnfreqsp]]"], - defaultval=Range({"start": 1, "stop": "[[gw_customnfreqsp]]"}), - mnemonics="GW SPectral FREQuencies", - requires="[[optdriver]] == 4 and [[gw_customnfreqsp]] > 0", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="gw_freqsp", + varset="gw", + vartype="real", + topics=["FrequencyMeshMBPT_expert"], + dimensions=["[[gw_customnfreqsp]]"], + defaultval=Range({"start": 1, "stop": "[[gw_customnfreqsp]]"}), + mnemonics="GW SPectral FREQuencies", + requires="[[optdriver]] == 4 and [[gw_customnfreqsp]] > 0", + added_in_version="before_v9", + text=r""" [[gw_freqsp]] specifies the grid points for the real frequency axis when the real and imaginary (spectral function) parts of sigma are calculated explicitly for post-processing or plotting. Only activated if [[gw_customnfreqsp]] is not @@ -7347,18 +7953,19 @@ If [[nfreqsp]] is not equal to [[gw_customnfreqsp]] a warning will be issued. """, - ), - Variable( - abivarname="gw_frqim_inzgrid", - varset="gw", - vartype="integer", - topics=["FrequencyMeshMBPT_expert"], - dimensions="scalar", - defaultval=0, - mnemonics="GW Contour Deformation FReQuencies on IMaginary axis Inverse Z Grid", - requires="[[optdriver]] in [3,4] and [[gwcalctyp]] in [2, 9, 12, 19, 22, 29]", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="gw_frqim_inzgrid", + varset="gw", + vartype="integer", + topics=["FrequencyMeshMBPT_expert"], + dimensions="scalar", + defaultval=0, + mnemonics="GW Contour Deformation FReQuencies on IMaginary axis Inverse Z Grid", + requires="[[optdriver]] in [3,4] and [[gwcalctyp]] in [2, 9, 12, 19, 22, 29]", + added_in_version="before_v9", + text=r""" [[gw_frqim_inzgrid]] creates grid points along the **imaginary** frequency axis by using an equidistant grid in the variable $z \subset [0,1]$ where the transform is: @@ -7369,18 +7976,19 @@ [[ppmfrq]]). The equidistant grid in z is determined uniquely by [[nfreqim]]) and the points are distributed so that half of them lie below the plasma frequency. """, - ), - Variable( - abivarname="gw_frqre_inzgrid", - varset="gw", - vartype="integer", - topics=["FrequencyMeshMBPT_expert"], - dimensions="scalar", - defaultval=0, - mnemonics="GW Contour Deformation FReQuencies on REal axis Inverse Z Grid", - requires="[[optdriver]] in [3, 4] and [[gwcalctyp]] in [2, 9, 12, 19, 22, 29]", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="gw_frqre_inzgrid", + varset="gw", + vartype="integer", + topics=["FrequencyMeshMBPT_expert"], + dimensions="scalar", + defaultval=0, + mnemonics="GW Contour Deformation FReQuencies on REal axis Inverse Z Grid", + requires="[[optdriver]] in [3, 4] and [[gwcalctyp]] in [2, 9, 12, 19, 22, 29]", + added_in_version="before_v9", + text=r""" [[gw_frqre_inzgrid]] creates grid points along the **real** frequency axis by using an equidistant grid in the variable $z \subset [0, 1]$ where the transform is: @@ -7399,18 +8007,19 @@ needed along the real frequency axis is output in the logfile during Contour Deformation sigma calculations. """, - ), - Variable( - abivarname="gw_frqre_tangrid", - varset="gw", - vartype="integer", - topics=["FrequencyMeshMBPT_expert"], - dimensions="scalar", - defaultval=0, - mnemonics="GW Contour Deformation FReQuencies on REal axis - Use Tangent Grid", - requires="[[optdriver]] in [3,4] and [[gwcalctyp]] in [2,9,12,19,22,29]", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="gw_frqre_tangrid", + varset="gw", + vartype="integer", + topics=["FrequencyMeshMBPT_expert"], + dimensions="scalar", + defaultval=0, + mnemonics="GW Contour Deformation FReQuencies on REal axis - Use Tangent Grid", + requires="[[optdriver]] in [3,4] and [[gwcalctyp]] in [2,9,12,19,22,29]", + added_in_version="before_v9", + text=r""" [[gw_frqre_tangrid]] defines a nonuniform grid to be used in frequency, with stepsize increasing proportional to $\tan(x)$. This makes the grid approximately linear to start with, with a rapid increase towards the end. Also, this is the @@ -7418,18 +8027,19 @@ function which decays as $1/x^2$. To be used in conjunction with [[nfreqre]], [[cd_max_freq]] and [[cd_halfway_freq]] which determine the parameters of the transformed grid. """, - ), - Variable( - abivarname="gw_icutcoul", - varset="gw", - vartype="integer", - topics=["GWls_compulsory", "Susceptibility_basic", "Coulomb_useful", "SelfEnergy_basic"], - dimensions="scalar", - defaultval=6, - mnemonics="GW CUT-off for COULomb interaction", - requires="[[optdriver]] in [3,4]", - added_in_version="9.1", - text=r""" +), + +Variable( + abivarname="gw_icutcoul", + varset="gw", + vartype="integer", + topics=["GWls_compulsory", "Susceptibility_basic", "Coulomb_useful", "SelfEnergy_basic"], + dimensions="scalar", + defaultval=6, + mnemonics="GW CUT-off for COULomb interaction", + requires="[[optdriver]] in [3,4]", + added_in_version="9.1", + text=r""" Many-body calculations for fully periodic systems are problematic due to the presence of the integrable Coulomb singularity at $\mathbf{G}=0$ that hinders the convergence with respect to the number of q-points used to sample the @@ -7459,18 +8069,19 @@ which is the current default. However, the initialization might take time. """, - ), - Variable( - abivarname="gw_invalid_freq", - varset="gw", - vartype="integer", - topics=["Susceptibility_expert", "SelfEnergy_expert"], - dimensions="scalar", - defaultval=0, - mnemonics="GW treatment of INVALID FREQuency for Hybertsen-Louie PPM", - requires="[[optdriver]] in [3,4] and [[ppmodel]] in [2]", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="gw_invalid_freq", + varset="gw", + vartype="integer", + topics=["Susceptibility_expert", "SelfEnergy_expert"], + dimensions="scalar", + defaultval=0, + mnemonics="GW treatment of INVALID FREQuency for Hybertsen-Louie PPM", + requires="[[optdriver]] in [3,4] and [[ppmodel]] in [2]", + added_in_version="before_v9", + text=r""" [[gw_invalid_freq]] sets the procedure to follow when a PPM frequency is invalid (negative or imaginary). @@ -7478,18 +8089,19 @@ * [[gw_invalid_freq]] = 1: Set them to 1 hartree, as done for the PPM of Godby-Needs [[cite:Godby1989]]. * [[gw_invalid_freq]] = 2: Set them to infinity. """, - ), - Variable( - abivarname="gw_nqlwl", - varset="gw", - vartype="integer", - topics=["GW_expert", "BSE_expert", "Susceptibility_expert", "SelfEnergy_expert"], - dimensions="scalar", - defaultval=1, - mnemonics="GW, Number of Q-points for the Long Wave-Length Limit", - requires="[[optdriver]] in [3,4,99]", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="gw_nqlwl", + varset="gw", + vartype="integer", + topics=["GW_expert", "BSE_expert", "Susceptibility_expert", "SelfEnergy_expert"], + dimensions="scalar", + defaultval=1, + mnemonics="GW, Number of Q-points for the Long Wave-Length Limit", + requires="[[optdriver]] in [3,4,99]", + added_in_version="before_v9", + text=r""" Only relevant if [[optdriver]] = 3,4,99 that is, screening, sigma or Bethe- Salpeter calculations, although the actual meaning of the variable depends on the particular run-level (see discussion below). @@ -7516,69 +8128,73 @@ dielectric function using six different directions in q-space (the three basis vectors of the reciprocal lattice and the three Cartesian axis). """, - ), - Variable( - abivarname="gwr_nstep", - varset="gwr", - vartype="integer", - topics=["GWR_basic"], - dimensions="scalar", - defaultval=50, - mnemonics="GWR Number of self-consistent STEPs", - requires="[[optdriver]] == 6", - added_in_version="9.9.0", - text=r""" +), + +Variable( + abivarname="gwr_nstep", + varset="gwr", + vartype="integer", + topics=["GWR_basic"], + dimensions="scalar", + defaultval=50, + mnemonics="GWR Number of self-consistent STEPs", + requires="[[optdriver]] == 6", + added_in_version="9.9.0", + text=r""" Maximum number of self-consistent iterations in which G and/or W are be updated until the quasi-particle energies are converged within [[gwr_tolqpe]]. [[gwr_task]] defines the self-consistency type. """, - ), - # Variable( - # abivarname="gwr_fit", - # varset="gwr", - # vartype="integer", - # topics=['GWR_basic'], - # dimensions="scalar", - # defaultval=0, - # mnemonics="GWR FIT", - # requires="[[optdriver]] == 6", - # added_in_version="10.3.4", - # text=r""" - # A non-zero value activates the fit of the polarizabily and of the inverse dielectric matrix - # in order to accelerate the convergence of the GWR results wrt the number of points in the minimax mesh. - # - # NOTE: This feature is still under development - # """, - # ), - Variable( - abivarname="gw_qlwl", - varset="gw", - vartype="real", - topics=["Susceptibility_expert", "SelfEnergy_expert", "BSE_expert"], - dimensions=[3, "[[gw_nqlwl]]"], - defaultval=[1e-05, 2e-05, 3e-05], - mnemonics="GW, Q-points for the Long Wave-Length limit", - requires="[[optdriver]] in [3,4,99]", - added_in_version="before_v9", - text=r""" +), + +#Variable( +# abivarname="gwr_fit", +# varset="gwr", +# vartype="integer", +# topics=['GWR_basic'], +# dimensions="scalar", +# defaultval=0, +# mnemonics="GWR FIT", +# requires="[[optdriver]] == 6", +# added_in_version="10.3.4", +# text=r""" +#A non-zero value activates the fit of the polarizabily and of the inverse dielectric matrix +#in order to accelerate the convergence of the GWR results wrt the number of points in the minimax mesh. +# +#NOTE: This feature is still under development +#""", +#), + +Variable( + abivarname="gw_qlwl", + varset="gw", + vartype="real", + topics=["Susceptibility_expert", "SelfEnergy_expert", "BSE_expert"], + dimensions=[3, "[[gw_nqlwl]]"], + defaultval=[1e-05, 2e-05, 3e-05], + mnemonics="GW, Q-points for the Long Wave-Length limit", + requires="[[optdriver]] in [3,4,99]", + added_in_version="before_v9", + text=r""" When [[optdriver]] = 3, [[gw_qlwl]] defines the set of q-points around Gamma in reduced coordinates of the reciprocal lattice that are considered during the evaluation of the non-analytical behaviour of the dielectric matrix. Optical spectra (with and without non-local field effects) are evaluated for each direction specified by [[gw_qlwl]]. """, - ), - Variable( - abivarname="gw_qprange", - varset="gw", - vartype="integer", - topics=["SelfEnergy_useful"], - dimensions="scalar", - defaultval=0, - mnemonics="GW QuasiParticle RANGE policy", - requires="[[optdriver]] == 4", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="gw_qprange", + varset="gw", + vartype="integer", + topics=["SelfEnergy_useful"], + dimensions="scalar", + defaultval=0, + mnemonics="GW QuasiParticle RANGE policy", + requires="[[optdriver]] == 4", + added_in_version="before_v9", + text=r""" [[gw_qprange]] is active only when [[nkptgw]] is equal to zero (default value). This variable simplifies the specification of the list of $\kk$-points and of the band range to be used for the computation of the QP corrections. @@ -7605,18 +8221,19 @@ If you want to select manually the list of $\kk$-points and bands, you have to provide the three variables [[nkptgw]], [[kptgw]], and [[bdgw]]. """, - ), - Variable( - abivarname="gw_sigxcore", - varset="gw", - vartype="integer", - topics=["SelfEnergy_expert"], - dimensions="scalar", - defaultval=0, - mnemonics="GW, SIGma (self-energy) for the CORE contribution", - requires="[[optdriver]] == 4 and [[usepaw]] == 1", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="gw_sigxcore", + varset="gw", + vartype="integer", + topics=["SelfEnergy_expert"], + dimensions="scalar", + defaultval=0, + mnemonics="GW, SIGma (self-energy) for the CORE contribution", + requires="[[optdriver]] == 4 and [[usepaw]] == 1", + added_in_version="before_v9", + text=r""" Only available for PAW and relevant if [[optdriver]] = 4 that is, sigma calculations. Theoretical introduction: GW calculations performed on top of electronic @@ -7639,36 +8256,38 @@ * 0, standard approach, the core contribution is approximated with vxc. * 1, the core term is approximated with the Fock operator inside the PAW spheres. """, - ), - Variable( - abivarname="gwr_tolqpe", - varset="gwr", - vartype="real", - topics=["GWR_basic"], - dimensions="scalar", - defaultval=ValueWithUnit(units="eV", value=0.01), - mnemonics="GWR TOLerance on the difference of the QP Energies", - characteristics=["[[ENERGY]]"], - requires="[[optdriver]] == 6", - added_in_version="9.6.2", - text=r""" +), + +Variable( + abivarname="gwr_tolqpe", + varset="gwr", + vartype="real", + topics=["GWR_basic"], + dimensions="scalar", + defaultval=ValueWithUnit(units="eV", value=0.01), + mnemonics="GWR TOLerance on the difference of the QP Energies", + characteristics=["[[ENERGY]]"], + requires="[[optdriver]] == 6", + added_in_version="9.6.2", + text=r""" Sets a tolerance for absolute differences of QP energies between two consecutive iterations that will cause the self-consistent GWR cycle to stop. It can be specified in Ha (the default), Ry, eV or Kelvin, since **gwr_tolqpe** has the [[ENERGY]] characteristics (1 Ha = 27.2113845 eV). """, - ), - Variable( - abivarname="gw1rdm", - varset="gw", - vartype="integer", - topics=["GW_expert", "SelfEnergy_expert"], - dimensions="scalar", - defaultval=0, - mnemonics="GW 1-Reduced Density Matrix", - requires="[[optdriver]] == 4", - added_in_version="9.4.0", - text=r""" +), + +Variable( + abivarname="gw1rdm", + varset="gw", + vartype="integer", + topics=["GW_expert", "SelfEnergy_expert"], + dimensions="scalar", + defaultval=0, + mnemonics="GW 1-Reduced Density Matrix", + requires="[[optdriver]] == 4", + added_in_version="9.4.0", + text=r""" [[gw1rdm]] governs the calculation of the density matrix within the linearized GW approximation. It must be used with [[gwcalctyp]]=21. @@ -7676,35 +8295,37 @@ * 1: Compute the update of the density matrix for the k-point list specified by [[kptgw]]. * 2: Same as 1 but also compute the correction to the Fock operator and update total energies. """, - ), - Variable( - abivarname="gwaclowrank", - varset="gw", - vartype="integer", - topics=["GW_useful", "SelfEnergy_useful"], - dimensions="scalar", - defaultval=0, - mnemonics="GW Analytic Continuation LOW RANK approximation", - requires="[[optdriver]] == 4", - added_in_version="9.2.0", - text=r""" +), + +Variable( + abivarname="gwaclowrank", + varset="gw", + vartype="integer", + topics=["GW_useful", "SelfEnergy_useful"], + dimensions="scalar", + defaultval=0, + mnemonics="GW Analytic Continuation LOW RANK approximation", + requires="[[optdriver]] == 4", + added_in_version="9.2.0", + text=r""" **gwaclowrank** governs the number of eigenvectors of epsm1(iw') that will be retained in the calculation. The default value **gwaclowrank** = 0 means all eigenvectors are retained and therefore no approximation is made. **gwaclowrank** is by definition lower than the number of planewaves used for epsm1, which is set by [[npweps]] or indirectly by [[ecuteps]]. The lower **gwaclowrank**, the faster the calculation. """, - ), - Variable( - abivarname="gwcalctyp", - varset="gw", - vartype="integer", - topics=["GW_basic", "SelfEnergy_basic", "RPACorrEn_compulsory"], - dimensions="scalar", - defaultval=0, - mnemonics="GW CALCulation TYPe", - requires="[[optdriver]] in [3,4]", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="gwcalctyp", + varset="gw", + vartype="integer", + topics=["GW_basic", "SelfEnergy_basic", "RPACorrEn_compulsory"], + dimensions="scalar", + defaultval=0, + mnemonics="GW CALCulation TYPe", + requires="[[optdriver]] in [3,4]", + added_in_version="before_v9", + text=r""" **gwcalctyp** governs the choice between the different capabilities of the GW code. * 0 <= **gwcalctyp** <= 9: standard "1 shot" quasi-particle method. @@ -7720,18 +8341,19 @@ * **gwcalctyp** = 8, 18, or 28: model GW calculation following [[cite:Faleev2004]] using a Plasmon-Pole model. * **gwcalctyp** = 9, 19, or 29: model GW calculation following [[cite:Faleev2004]] using numerical integration (contour deformation method). """, - ), - Variable( - abivarname="gwcomp", - varset="gw", - vartype="integer", - topics=["SelfEnergy_useful"], - dimensions="scalar", - defaultval=0, - mnemonics="GW COMPleteness", - requires="[[optdriver]] in [3,4]", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="gwcomp", + varset="gw", + vartype="integer", + topics=["SelfEnergy_useful"], + dimensions="scalar", + defaultval=0, + mnemonics="GW COMPleteness", + requires="[[optdriver]] in [3,4]", + added_in_version="before_v9", + text=r""" [[gwcomp]] governs the use of an extrapolar approximation. If [[gwcomp]] == 1, one improves the completeness in a truncated sum over states. In practice, this permits one to reduce quite much the number of bands required in the @@ -7739,36 +8361,38 @@ needed in the extrapolar approximation is set by [[gwencomp]]. See [[cite:Bruneval2008]] for a description of the methodology. """, - ), - Variable( - abivarname="gwencomp", - varset="gw", - vartype="real", - topics=["SelfEnergy_useful", "Susceptibility_useful"], - dimensions="scalar", - defaultval=2.0, - mnemonics="GW ENergy for COMPleteness", - requires="[[optdriver]] in [3,4] and [[gwcomp]] == 1", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="gwencomp", + varset="gw", + vartype="real", + topics=["SelfEnergy_useful", "Susceptibility_useful"], + dimensions="scalar", + defaultval=2.0, + mnemonics="GW ENergy for COMPleteness", + requires="[[optdriver]] in [3,4] and [[gwcomp]] == 1", + added_in_version="before_v9", + text=r""" [[gwencomp]] sets the energy parameter used in the extrapolar approximation used to improve completeness and make the convergence against the number of bands much faster. See [[cite:Bruneval2008]] for a description of the methodology. """, - ), - Variable( - abivarname="gwgamma", - varset="gw", - vartype="integer", - topics=["Susceptibility_expert", "SelfEnergy_expert"], - dimensions="scalar", - defaultval=0, - mnemonics="GW GAMMA", - requires="[[optdriver]] = 3 or 4 (Sigma calculations)", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="gwgamma", + varset="gw", + vartype="integer", + topics=["Susceptibility_expert", "SelfEnergy_expert"], + dimensions="scalar", + defaultval=0, + mnemonics="GW GAMMA", + requires="[[optdriver]] = 3 or 4 (Sigma calculations)", + added_in_version="before_v9", + text=r""" If [[gwgamma]] is 1, the vertex correction will be included leading to what is known as "GW-Gamma" approximation. see R. Del Sole, L. Reining, and R. W. Godby, Phys. Rev. B 49, 8024 (1994). Note that, in order to include the vertex @@ -7790,49 +8414,94 @@ At present, the renormalization factor Z is fixed at 0.78, which is sufficiently accurate for most semiconductors and insulators. """, - ), - Variable( - abivarname="gwgmcorr", - varset="gw", - vartype="integer", - topics=["RPACorrEn_expert", "GW_expert", "SelfEnergy_expert"], - dimensions="scalar", - defaultval=0, - mnemonics="GW Galitskii-Migdal CORRelation energy", - requires="[[optdriver]] == 3", - added_in_version="9.4.0", - text=r""" +), + +Variable( + abivarname="gwpt_wmode", + varset="eph", + vartype="integer", + topics=["ElPhonInt_expert"], + dimensions="scalar", + defaultval=2, + mnemonics="GWPT omega MODE", + added_in_version="10.7.1", + text=r""" +This variable controls the treatment of the frequency-dependence in the computation +of the GWPT e-ph matrix elements when [[eph_task]] == 17. + +1 -> Use the original treatment as in [[cite:Li2019]] in which the + frequency convolution is evaluated at $\ee_\nk$ and $\ee_\mkq$ and the average is taken. + +2 -> Evaluate the convolution at $\ee_\nk$. + This is the **recommended** approach when computing the ZPR of the band gap. +""", +), + +Variable( + abivarname="gwpt_g2mode", + varset="eph", + vartype="integer", + topics=["ElPhonInt_expert"], + dimensions="scalar", + defaultval=1, + mnemonics="GWPT G-MODE", + added_in_version="10.7.1", + text=r""" +This variable controls the treatment of the e-ph matrix elements +in the computation of the e-ph self-energy when one starts from a GSTORE.nc file +containing both the GWPT and the KS matrix elements. + +1 -> Use |g|^2 where g is either GWPT or KS depending on [[gstore_gname]]. + +2 -> Use the real part of $g{KS}^* g_{\GWPT}$. +""", +), + + +Variable( + abivarname="gwgmcorr", + varset="gw", + vartype="integer", + topics=["RPACorrEn_expert","GW_expert", "SelfEnergy_expert"], + dimensions="scalar", + defaultval=0, + mnemonics="GW Galitskii-Migdal CORRelation energy", + requires="[[optdriver]] == 3", + added_in_version="9.4.0", + text=r""" [[gwgmcorr]]==1 allows to compute the GW correlation energy with the Galitskii-Migdal (GM) formula. It must be used with [[gwrpacorr]]>0. For [[gwrpacorr]]=1 it will be obtained for free, while for [[gwrpacorr]]>1 it will require an extra inversion of the polarizability matrix. """, - ), - Variable( - abivarname="gwls_band_index", - varset="gw", - vartype="integer", - topics=["GWls_expert"], - dimensions="scalar", - defaultval=1, - mnemonics="GWLS BAND INDEX", - requires="[[optdriver]] == 66", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="gwls_band_index", + varset="gw", + vartype="integer", + topics=["GWls_expert"], + dimensions="scalar", + defaultval=1, + mnemonics="GWLS BAND INDEX", + requires="[[optdriver]] == 66", + added_in_version="before_v9", + text=r""" Governs the DFT eigenstate $|e\rangle$ in which the self-energy will be evaluated, as shown in Eq. (7) of [[cite:Laflamme2015]]. That is, it is the state to be corrected in the G0W0 scheme. """, - ), - Variable( - abivarname="gwls_correlation", - varset="gw", - vartype="integer", - topics=["GWls_expert"], - dimensions="scalar", - defaultval=3, - mnemonics="GWLS CORRELATION", - requires="[[optdriver]] == 66", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="gwls_correlation", + varset="gw", + vartype="integer", + topics=["GWls_expert"], + dimensions="scalar", + defaultval=3, + mnemonics="GWLS CORRELATION", + requires="[[optdriver]] == 66", + added_in_version="before_v9", + text=r""" Governs the use of a dielectric model (as explained in Sec. V of [[cite:Laflamme2015]] and the use of the Lanczos scheme to solve Eqs. (30) and (35) of the same reference at all external [[gw_freqsp]] and integration (as @@ -7848,48 +8517,51 @@ should be kept by the user. Option 1, 2 and 5 are deprecated and will be removed. """, - ), - Variable( - abivarname="gwls_diel_model", - varset="gw", - vartype="integer", - topics=["GWls_expert"], - dimensions="scalar", - defaultval=2, - mnemonics="GWLS dielectric model", - requires="[[optdriver]] == 66", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="gwls_diel_model", + varset="gw", + vartype="integer", + topics=["GWls_expert"], + dimensions="scalar", + defaultval=2, + mnemonics="GWLS dielectric model", + requires="[[optdriver]] == 66", + added_in_version="before_v9", + text=r""" Not used yet. """, - ), - Variable( - abivarname="gwls_exchange", - varset="gw", - vartype="integer", - topics=["GWls_expert"], - dimensions="scalar", - defaultval=1, - mnemonics="GWLS exact EXCHANGE", - requires="[[optdriver]] == 66", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="gwls_exchange", + varset="gw", + vartype="integer", + topics=["GWls_expert"], + dimensions="scalar", + defaultval=1, + mnemonics="GWLS exact EXCHANGE", + requires="[[optdriver]] == 66", + added_in_version="before_v9", + text=r""" Governs whether the exact exchange for the state to be corrected ([[gwls_band_index]]) is calculated ([[gwls_exchange]] == 1) or not ([[gwls_exchange]] = =0). """, - ), - Variable( - abivarname="gwls_first_seed", - varset="gw", - vartype="integer", - topics=["GWls_expert"], - dimensions="scalar", - defaultval="[[gwls_band_index]]", - mnemonics="GWLS FIRST SEED vector", - requires="[[optdriver]] == 66", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="gwls_first_seed", + varset="gw", + vartype="integer", + topics=["GWls_expert"], + dimensions="scalar", + defaultval="[[gwls_band_index]]", + mnemonics="GWLS FIRST SEED vector", + requires="[[optdriver]] == 66", + added_in_version="before_v9", + text=r""" This variable sets the band index to be used to generate the first seed vector to be used in the construction of the Lanczos basis for the (static) dielectric matrix in a GWLS calculation. See Sec. IV of [[cite:Laflamme2015]]. @@ -7902,35 +8574,37 @@ has been thoroughly tested and seems to be the most performant. Users should therefore keep the default value. """, - ), - Variable( - abivarname="gwls_kmax_analytic", - varset="gw", - vartype="integer", - topics=["GWls_expert"], - dimensions="scalar", - defaultval=8, - mnemonics="GWLS KMAX for the ANALYTIC term", - requires="[[optdriver]] == 66", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="gwls_kmax_analytic", + varset="gw", + vartype="integer", + topics=["GWls_expert"], + dimensions="scalar", + defaultval=8, + mnemonics="GWLS KMAX for the ANALYTIC term", + requires="[[optdriver]] == 66", + added_in_version="before_v9", + text=r""" Governs the number of iterations to be done in the shift Lanczos solution of Eq. (35) of [[cite:Laflamme2015]] to solve it at all external frequencies requested by the user ([[gw_freqsp]]). The default value is converged to a few 10s of meV for all molecules studied so far. """, - ), - Variable( - abivarname="gwls_kmax_complement", - varset="gw", - vartype="integer", - topics=["GWls_expert"], - dimensions="scalar", - defaultval=1, - mnemonics="GWLS KMAX for the COMPLEMENT space.", - requires="[[optdriver]] == 66", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="gwls_kmax_complement", + varset="gw", + vartype="integer", + topics=["GWls_expert"], + dimensions="scalar", + defaultval=1, + mnemonics="GWLS KMAX for the COMPLEMENT space.", + requires="[[optdriver]] == 66", + added_in_version="before_v9", + text=r""" The G0W0 formalism involves the calculation of a summation conceptually linked to the trace of the dielectric matrix [see Eq. (38) of [[cite:Laflamme2015]]\]. Since the eigenvalues spectrum of the dielectric matrix of formed by a @@ -7946,18 +8620,19 @@ For more information on the exact role of these bases and on the model dielectric operator used, see Sec. V of [[cite:Laflamme2015]]. """, - ), - Variable( - abivarname="gwls_kmax_numeric", - varset="gw", - vartype="integer", - topics=["GWls_expert"], - dimensions="scalar", - defaultval=16, - mnemonics="GWLS KMAX for the NUMERIC term", - requires="[[optdriver]] == 66", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="gwls_kmax_numeric", + varset="gw", + vartype="integer", + topics=["GWls_expert"], + dimensions="scalar", + defaultval=16, + mnemonics="GWLS KMAX for the NUMERIC term", + requires="[[optdriver]] == 66", + added_in_version="before_v9", + text=r""" Governs the number of iterations to be done in the shift Lanczos solution of Eq. (30) of [[cite:Laflamme2015]] to solve it simultaneously at all integration frequencies (generated automatically by the number of points @@ -7965,18 +8640,19 @@ frequencies requested by the user ([[gw_freqsp]]). The default value is converged to a few 10s of meV for all molecules studied so far. """, - ), - Variable( - abivarname="gwls_kmax_poles", - varset="gw", - vartype="integer", - topics=["GWls_expert"], - dimensions="scalar", - defaultval=4, - mnemonics="GWLS KMAX for the calculation of the POLES residue", - requires="[[optdriver]] == 66", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="gwls_kmax_poles", + varset="gw", + vartype="integer", + topics=["GWls_expert"], + dimensions="scalar", + defaultval=4, + mnemonics="GWLS KMAX for the calculation of the POLES residue", + requires="[[optdriver]] == 66", + added_in_version="before_v9", + text=r""" The contour deformation technique, in the G0W0 context, will involve the calculation of pole residues associated to states lying between the one corrected ([[gwls_band_index]]) and the Fermi level. These residues take the @@ -7991,18 +8667,19 @@ For more information on the Lanczos basis constructed for the calculation of the residues, see Sec. IV of [[cite:Laflamme2015]]. """, - ), - Variable( - abivarname="gwls_list_proj_freq", - varset="gw", - vartype="real", - topics=["GWls_expert"], - dimensions=["[[gwls_n_proj_freq]]"], - defaultval="*0.0", - mnemonics="GWLS LIST of the PROJection FREQuencies", - requires="[[optdriver]] == 66", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="gwls_list_proj_freq", + varset="gw", + vartype="real", + topics=["GWls_expert"], + dimensions=["[[gwls_n_proj_freq]]"], + defaultval="*0.0", + mnemonics="GWLS LIST of the PROJection FREQuencies", + requires="[[optdriver]] == 66", + added_in_version="before_v9", + text=r""" This variable sets the frequencies to be used to construct the basis in which the Hamiltonian is projected to accelerate the solution of the Sternheimer equations involved by the construction of the dielectric matrix at finite @@ -8011,19 +8688,20 @@ computational cost, [[gwls_n_proj_freq]] == 0 (which means no ADDITIONAL frequency is to be used) is fine and no frequencies need to be picked up. """, - ), - Variable( - abivarname="gwls_model_parameter", - varset="gw", - vartype="real", - topics=["GWls_expert"], - dimensions="scalar", - defaultval=1.0, - mnemonics="GWLS MODEL PARAMETER", - characteristics=["[[ENERGY]]"], - requires="[[optdriver]] == 66", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="gwls_model_parameter", + varset="gw", + vartype="real", + topics=["GWls_expert"], + dimensions="scalar", + defaultval=1.0, + mnemonics="GWLS MODEL PARAMETER", + characteristics=["[[ENERGY]]"], + requires="[[optdriver]] == 66", + added_in_version="before_v9", + text=r""" This is the width of the lorentzian, in Ha, used to model the frequency dependence of the dielectric matrix in the GWLS calculation [see Eqs. (12-16) and (34) of [[cite:Laflamme2015]]\]. More @@ -8040,18 +8718,19 @@ ([[gwls_npt_gauss_quad]]), but no impact on the converged result of the GWLS calculation. Typically, the default ([[gwls_model_parameter]] == 1.0) is optimal. """, - ), - Variable( - abivarname="gwls_n_proj_freq", - varset="gw", - vartype="integer", - topics=["GWls_expert"], - dimensions="scalar", - defaultval=0, - mnemonics="GWLS Number of PROJection FREQuencies", - requires="[[optdriver]] == 66", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="gwls_n_proj_freq", + varset="gw", + vartype="integer", + topics=["GWls_expert"], + dimensions="scalar", + defaultval=0, + mnemonics="GWLS Number of PROJection FREQuencies", + requires="[[optdriver]] == 66", + added_in_version="before_v9", + text=r""" This variable sets the number of frequencies, on top of $\infty$ and 0.0 (if [[gwls_recycle]] > 0), to be used for the construction of the basis in which the Hamiltonian is projected to accelerate the solution of the Sternheimer @@ -8059,66 +8738,70 @@ frequencies. See Sec. VI of [[cite:Laflamme2015]]. For most cases, the default ([[gwls_n_proj_freq]] == 0) is fine. """, - ), - Variable( - abivarname="gwls_npt_gauss_quad", - varset="gw", - vartype="integer", - topics=["GWls_expert"], - dimensions="scalar", - defaultval=10, - mnemonics="GWLS Number of PoinTs to use for the GAUSSian QUADrature", - requires="[[optdriver]] == 66", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="gwls_npt_gauss_quad", + varset="gw", + vartype="integer", + topics=["GWls_expert"], + dimensions="scalar", + defaultval=10, + mnemonics="GWLS Number of PoinTs to use for the GAUSSian QUADrature", + requires="[[optdriver]] == 66", + added_in_version="before_v9", + text=r""" This variable defines the number of points used for the numerical integration of the self-energy over frequencies in GWLS computations [see Eq. (12) of [[cite:Laflamme2015]]\]. The default is fine for most cases. """, - ), - Variable( - abivarname="gwls_nseeds", - varset="gw", - vartype="integer", - topics=["GWls_expert"], - dimensions="scalar", - defaultval=1, - mnemonics="GWLS Number of SEED vectorS", - requires="[[optdriver]] == 66", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="gwls_nseeds", + varset="gw", + vartype="integer", + topics=["GWls_expert"], + dimensions="scalar", + defaultval=1, + mnemonics="GWLS Number of SEED vectorS", + requires="[[optdriver]] == 66", + added_in_version="before_v9", + text=r""" This variable sets the number of seed vectors to be used in the construction of the Lanczos basis for the (static) dielectric matrix in a GWLS calculation. See Sec. IV of [[cite:Laflamme2015]]. Only [[gwls_nseeds]] == 1 has been tested for now and users should keep this value. """, - ), - Variable( - abivarname="gwls_print_debug", - varset="gw", - vartype="integer", - topics=["GWls_expert"], - dimensions="scalar", - defaultval=0, - mnemonics="GWLS PRINT level for DEBUGging", - requires="[[optdriver]] == 66", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="gwls_print_debug", + varset="gw", + vartype="integer", + topics=["GWls_expert"], + dimensions="scalar", + defaultval=0, + mnemonics="GWLS PRINT level for DEBUGging", + requires="[[optdriver]] == 66", + added_in_version="before_v9", + text=r""" Influences the level of verbosity for debugging purposes in a GWLS calculation. Users should keep its value at the default. """, - ), - Variable( - abivarname="gwls_recycle", - varset="gw", - vartype="integer", - topics=["GWls_expert"], - dimensions="scalar", - defaultval=2, - mnemonics="GWLS RECYCLE", - requires="[[optdriver]] == 66", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="gwls_recycle", + varset="gw", + vartype="integer", + topics=["GWls_expert"], + dimensions="scalar", + defaultval=2, + mnemonics="GWLS RECYCLE", + requires="[[optdriver]] == 66", + added_in_version="before_v9", + text=r""" This variable let the user choose if and how he wants to recycle the solutions of the Sternheimer equations involved in the construction of the static dielectric matrix. @@ -8141,35 +8824,37 @@ calculations, since each processor need only his own solutions in the construction of the basis. """, - ), - Variable( - abivarname="gwls_stern_kmax", - varset="gw", - vartype="integer", - topics=["GWls_expert"], - dimensions="scalar", - defaultval=1, - mnemonics="GWLS Kmax", - requires="[[optdriver]] == 66", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="gwls_stern_kmax", + varset="gw", + vartype="integer", + topics=["GWls_expert"], + dimensions="scalar", + defaultval=1, + mnemonics="GWLS Kmax", + requires="[[optdriver]] == 66", + added_in_version="before_v9", + text=r""" This variable sets the dimension of the dielectric matrix used in a GWLS calculation [see Sec. IV of [[cite:Laflamme2015]]\]. Typically converged at a value of a few hundreds to a few thousands for a convergence criterion of 50 meV on the eigenenergies. """, - ), - Variable( - abivarname="gwmem", - varset="gw", - vartype="integer", - topics=["Susceptibility_expert", "SelfEnergy_expert", "GW_expert", "TuningSpeedMem_expert"], - dimensions="scalar", - defaultval=11, - mnemonics="GW MEMory", - requires="[[optdriver]] in [3,4]", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="gwmem", + varset="gw", + vartype="integer", + topics=["Susceptibility_expert", "SelfEnergy_expert", "GW_expert", "TuningSpeedMem_expert"], + dimensions="scalar", + defaultval=11, + mnemonics="GW MEMory", + requires="[[optdriver]] in [3,4]", + added_in_version="before_v9", + text=r""" [[gwmem]] governs the memory strategy during a screening and/or a sigma run. * [[gwmem]] = 1x, the screening matrix are read for all q-vectors and stored in the memory. @@ -8188,19 +8873,20 @@ with a subsequent slowdown. Use this option if you really need it and make sure the sysadmin won't complain about an abnormal IO activity of your jobs. """, - ), - Variable( - abivarname="gwpara", - varset="paral", - vartype="integer", - topics=["parallelism_useful", "GW_basic", "Susceptibility_basic", "SelfEnergy_basic"], - dimensions="scalar", - defaultval=2, - mnemonics="GW PARAllelization level", - commentdefault="The default value has been changed in v8, from 1 to 2.", - requires="[[optdriver]] in [3,4]", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="gwpara", + varset="paral", + vartype="integer", + topics=["parallelism_useful", "GW_basic", "Susceptibility_basic", "SelfEnergy_basic"], + dimensions="scalar", + defaultval=2, + mnemonics="GW PARAllelization level", + commentdefault="The default value has been changed in v8, from 1 to 2.", + requires="[[optdriver]] in [3,4]", + added_in_version="before_v9", + text=r""" gwpara is used to choose between the two different parallelization levels available in the GW code. The available options are: @@ -8223,18 +8909,19 @@ The MPI computation of the correlation part is efficient when the number of processors divides [[nband]]. Optimal scaling in the exchange part is obtained only when each node possesses the full set of occupied states. """, - ), - Variable( - abivarname="gwrpacorr", - varset="gw", - vartype="integer", - topics=["RPACorrEn_compulsory"], - dimensions="scalar", - defaultval=0, - mnemonics="GW RPA CORRelation energy", - requires="[[optdriver]] == 3 and [[gwcalctyp]] in [1,11,21]", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="gwrpacorr", + varset="gw", + vartype="integer", + topics=["RPACorrEn_compulsory"], + dimensions="scalar", + defaultval=0, + mnemonics="GW RPA CORRelation energy", + requires="[[optdriver]] == 3 and [[gwcalctyp]] in [1,11,21]", + added_in_version="before_v9", + text=r""" [[gwrpacorr]] governs the calculation of the RPA correlation energy. * [[gwrpacorr]] = 0, no RPA correlation energy is calculated. @@ -8243,46 +8930,49 @@ * [[gwrpacorr]] = $n$ > 1, the RPA correlation energy is calculated using $n$ values for the coupling constant: it requires $n$ inversions of the polarizability matrix. """, - ), - Variable( - abivarname="hmctt", - varset="rlx", - vartype="integer", - topics=["MolecularDynamics_expert"], - dimensions="scalar", - defaultval=0, - mnemonics="Hybrid Monte Carlo Trial Trajectory", - requires="[[ionmov]] == 25", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="hmctt", + varset="rlx", + vartype="integer", + topics=["MolecularDynamics_expert"], + dimensions="scalar", + defaultval=0, + mnemonics="Hybrid Monte Carlo Trial Trajectory", + requires="[[ionmov]] == 25", + added_in_version="before_v9", + text=r""" Number of steps per MC trial trajectory, for the Hybrid Monte Carlo algorithm [[ionmov]]=25. """, - ), - Variable( - abivarname="hmcsst", - varset="rlx", - vartype="integer", - topics=["MolecularDynamics_expert"], - dimensions="scalar", - defaultval=0, - mnemonics="Hybrid Monte Carlo Strain Step Trajectory", - requires="[[ionmov]] == 25", - added_in_version="before_v9", - text=r""" -Number of strain teps per MC trial trajectory, for the Hybrid Monte Carlo algorithm [[ionmov]]=25. -""", - ), - Variable( - abivarname="hspinfield", - varset="ffield", - vartype="real", - topics=["MagField_basic"], - dimensions=[3], - defaultval=0, - mnemonics="H-magnetic SPIN FIELD", - characteristics=["[[MAGNETIC_FIELD]]"], - added_in_version="10.6.0", - text=r""" +), + +Variable( + abivarname="hmcsst", + varset="rlx", + vartype="integer", + topics=["MolecularDynamics_expert"], + dimensions="scalar", + defaultval=0, + mnemonics="Hybrid Monte Carlo Strain Step Trajectory", + requires="[[ionmov]] == 25", + added_in_version="before_v9", + text=r""" +Number of strain steps per MC trial trajectory, for the Hybrid Monte Carlo algorithm [[ionmov]]=25. +""", +), + +Variable( + abivarname="hspinfield", + varset="ffield", + vartype="real", + topics=["MagField_basic"], + dimensions=[3], + defaultval=0, + mnemonics="H-magnetic SPIN FIELD", + characteristics=["[[MAGNETIC_FIELD]]"], + added_in_version="10.6.0", + text=r""" Give the value of the magnetic field, $H$, acting on the spin/spinorial wavefunctions (so, not on the orbital part). As usual, the default is atomic units. @@ -8290,58 +8980,89 @@ Note that Tesla are admitted, despite the fact that this is not the proper unit for a $H$ field. Actually, if you specify "Tesla", ABINIT will set $\mu_0H$ in Tesla, so that H will be in Amperes/metre. +The three components are expressed in the spin-axis basis defined by [[spinaxis]]. +For the default value [[spinaxis]] = (0 0 1), this basis coincides with the Cartesian reference frame, so that [[hspinfield]] is equivalent to [[hspinfield_cart]]. + +When [[spinaxis]] is not aligned with the Cartesian z axis, it is recommended to use +[[hspinfield_cart]] instead of [[hspinfield]], in order to specify the magnetic field directly in Cartesian coordinates. + REPLACES the obsolete zeemanfield input variable. """, - ), - Variable( - abivarname="hyb_mixing", - varset="gstate", - vartype="real", - topics=["Hybrids_expert"], - dimensions="scalar", - defaultval="-999.0", - mnemonics="HYBrid MIXING coefficient for unscreened fock operator", - commentdefault="With the default, [[hyb_mixing]] is initialized from [[ixc]].", - requires="[[usefock]] > 0", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="hspinfield_cart", + varset="ffield", + vartype="real", + topics=["MagField_basic"], + dimensions=[3], + defaultval=0, + mnemonics="H-magnetic SPIN FIELD in CARTesian coordinates", + characteristics=["[[MAGNETIC_FIELD]]"], + added_in_version="10.6.0", + text=r""" +Give the value of the magnetic field, $H$, acting on the spin/spinorial wavefunctions in **Cartesian** coordinates. +This variable is the Cartesian-coordinate counterpart of [[hspinfield]] and uses the same units. +As usual, the default is atomic units. + +Unlike [[hspinfield]], this variable is always interpreted in the Cartesian reference frame, regardless of the value of [[spinaxis]]. +When [[spinaxis]] differs from its default value, it is recommended to specify the magnetic field in Cartesian coordinates using [[hspinfield_cart]]. + +Note that Tesla are admitted, despite the fact that this is not the proper unit for a $H$ field. +Actually, if you specify "Tesla", ABINIT will set $\mu_0H$ in Tesla, so that H will be in Amperes/metre. + +""", +), + +Variable( + abivarname="hyb_mixing", + varset="gstate", + vartype="real", + topics=["Hybrids_expert"], + dimensions="scalar", + defaultval="-999.0", + mnemonics="HYBrid MIXING coefficient for unscreened fock operator", + commentdefault="With the default, [[hyb_mixing]] is initialized from [[ixc]].", + requires="[[usefock]] > 0", + added_in_version="before_v9", + text=r""" Mixing coefficient for the unscreened Fock operator in case of hybrid functionals. Hartree-Fock corresponds to 1.0, PBE0 to 0.25, and B3LYP to 0.2. ABINIT knows the correct value from [[ixc]]. Experts might nevertheless tune this mixing coefficient. """, - ), - Variable( - abivarname="hyb_mixing_sr", - varset="gstate", - vartype="real", - topics=["Hybrids_expert"], - dimensions="scalar", - defaultval="-999.0", - mnemonics="HYBrid MIXING coefficient for Short-Range screened fock operator", - commentdefault="With the default, [[hyb_mixing_sr]] is initialized from [[ixc]].", - requires="[[usefock]] > 0", - added_in_version="before_v9", - text=r""" -Mixing coefficient for the screened Fock operator in case of hybrid -functionals. HSE has 0.25. - -ABINIT knows the correct value from [[ixc]]. Experts might nevertheless tune -this mixing coefficient. -""", - ), - Variable( - abivarname="hyb_range_dft", - varset="gstate", - vartype="real", - topics=["Hybrids_expert"], - dimensions="scalar", - defaultval="-999.0 or [[hyb_range_fock]] if it is defined by the user", - mnemonics="HYBrid RANGE for the DFT leftover from the screened fock operator", - commentdefault="With the default=-999.0, [[hyb_range_dft]] is initialized from [[ixc]].", - requires="[[usefock]] > 0", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="hyb_mixing_sr", + varset="gstate", + vartype="real", + topics=["Hybrids_expert"], + dimensions="scalar", + defaultval="-999.0", + mnemonics="HYBrid MIXING coefficient for Short-Range screened fock operator", + commentdefault="With the default, [[hyb_mixing_sr]] is initialized from [[ixc]].", + requires="[[usefock]] > 0", + added_in_version="before_v9", + text=r""" +Mixing coefficient for the screened Fock operator in case of hybrid functionals. HSE has 0.25. + +ABINIT knows the correct value from [[ixc]]. Experts might nevertheless tune this mixing coefficient. +""", +), + +Variable( + abivarname="hyb_range_dft", + varset="gstate", + vartype="real", + topics=["Hybrids_expert"], + dimensions="scalar", + defaultval="-999.0 or [[hyb_range_fock]] if it is defined by the user", + mnemonics="HYBrid RANGE for the DFT leftover from the screened fock operator", + commentdefault="With the default=-999.0, [[hyb_range_dft]] is initialized from [[ixc]].", + requires="[[usefock]] > 0", + added_in_version="before_v9", + text=r""" Range of the DFT leftover from the screened Fock operator in case of hybrid functionals (actually, coefficient of the distance appearing in the erf function, thus it has the dimension of an inverse distance). @@ -8354,19 +9075,20 @@ a noticeable exception, the HSE03 from the original paper (not the HSE03 from VASP), for which [[hyb_range_dft]] = 0.188988 while [[hyb_range_fock]] = 0.106066. """, - ), - Variable( - abivarname="hyb_range_fock", - varset="gstate", - vartype="real", - topics=["Hybrids_expert"], - dimensions="scalar", - defaultval="-999.0 or [[hyb_range_dft]] if it is defined by the user", - mnemonics="HYBrid RANGE for the screened FOCK operator", - commentdefault="With the default=-999.0, [[hyb_range_fock]] is initialized from [[ixc]].", - requires="[[usefock]] > 0", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="hyb_range_fock", + varset="gstate", + vartype="real", + topics=["Hybrids_expert"], + dimensions="scalar", + defaultval="-999.0 or [[hyb_range_dft]] if it is defined by the user", + mnemonics="HYBrid RANGE for the screened FOCK operator", + commentdefault="With the default=-999.0, [[hyb_range_fock]] is initialized from [[ixc]].", + requires="[[usefock]] > 0", + added_in_version="before_v9", + text=r""" Range of the screened Fock operator in case of hybrid functionals (actually, coefficient of the distance appearing in the erf function, thus it has the dimension of an inverse distance). @@ -8381,34 +9103,36 @@ The HSE03 value from LibCX is 0.106066 ($=0.15/\sqrt{2})$), the one of VASP is 0.1587531 (=0.3 $\AA^{-1}$). """, - ), - Variable( - abivarname="iatcon", - varset="rlx", - vartype="integer", - topics=["GeoConstraints_useful"], - dimensions=["[[natcon]]", "[[nconeq]]"], - defaultval=0, - mnemonics="Indices of AToms in CONstraint equations", - characteristics=["[[NO_MULTI]]", "[[INPUT_ONLY]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="iatcon", + varset="rlx", + vartype="integer", + topics=["GeoConstraints_useful"], + dimensions=["[[natcon]]", "[[nconeq]]"], + defaultval=0, + mnemonics="Indices of AToms in CONstraint equations", + characteristics=["[[NO_MULTI]]", "[[INPUT_ONLY]]"], + added_in_version="before_v9", + text=r""" Gives the indices of the atoms appearing in each of the [[nconeq]] independent equations constraining the motion of atoms during structural optimization or molecular dynamics (see [[nconeq]], [[natcon]], and [[wtatcon]]). (Note: combined with [[wtatcon]] to give internal representation of the latter) """, - ), - Variable( - abivarname="iatfix", - varset="rlx", - vartype="integer", - topics=["GeoConstraints_basic"], - dimensions=["[[natfix]]"], - mnemonics="Indices of AToms that are FIXed", - requires="[[natfix]] > 0", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="iatfix", + varset="rlx", + vartype="integer", + topics=["GeoConstraints_basic"], + dimensions=["[[natfix]]"], + mnemonics="Indices of AToms that are FIXed", + requires="[[natfix]] > 0", + added_in_version="before_v9", + text=r""" Give the index (in the range 1 to [[natom]] ) of each atom which is to be held fixed for structural optimization or molecular dynamics. The variable [[iatfix]] lists those fixed in the three directions, while the variables @@ -8433,18 +9157,19 @@ preprocessed set of atoms, generated by the atom manipulator. The user must thus foresee the effect of this atom manipulator (see [[objarf]]). """, - ), - Variable( - abivarname="iatfixx", - varset="rlx", - vartype="integer", - topics=["GeoConstraints_basic"], - dimensions=["[[natfixx]]"], - mnemonics="Indices of AToms that are FIXed along the X direction", - characteristics=["[[INPUT_ONLY]]"], - requires="[[natfixx]] > 0", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="iatfixx", + varset="rlx", + vartype="integer", + topics=["GeoConstraints_basic"], + dimensions=["[[natfixx]]"], + mnemonics="Indices of AToms that are FIXed along the X direction", + characteristics=["[[INPUT_ONLY]]"], + requires="[[natfixx]] > 0", + added_in_version="before_v9", + text=r""" Give the index (in the range 1 to [[natom]] ) of each atom which is to be held fixed ALONG THE X direction for structural optimization or molecular dynamics. The variable [[iatfix]] lists those fixed in the three directions, while the @@ -8452,18 +9177,19 @@ along x, y or z directions, or a combination of these. See the variable [[iatfix]] for more information. """, - ), - Variable( - abivarname="iatfixy", - varset="rlx", - vartype="integer", - topics=["GeoConstraints_basic"], - dimensions=["[[natfixy]]"], - mnemonics="Indices of AToms that are FIXed along the Y direction", - characteristics=["[[INPUT_ONLY]]"], - requires="[[natfixy]] > 0", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="iatfixy", + varset="rlx", + vartype="integer", + topics=["GeoConstraints_basic"], + dimensions=["[[natfixy]]"], + mnemonics="Indices of AToms that are FIXed along the Y direction", + characteristics=["[[INPUT_ONLY]]"], + requires="[[natfixy]] > 0", + added_in_version="before_v9", + text=r""" Give the index (in the range 1 to [[natom]] ) of each atom which is to be held fixed ALONG THE Y direction for structural optimization or molecular dynamics. The variable [[iatfix]] lists those fixed in the three directions, while the @@ -8471,18 +9197,19 @@ along x, y or z directions, or a combination of these. See the variable [[iatfix]] for more information. """, - ), - Variable( - abivarname="iatfixz", - varset="rlx", - vartype="integer", - topics=["GeoConstraints_basic"], - dimensions=["[[natfixz]]"], - mnemonics="Indices of AToms that are FIXed along the Z direction", - characteristics=["[[INPUT_ONLY]]"], - requires="[[natfixz]] > 0", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="iatfixz", + varset="rlx", + vartype="integer", + topics=["GeoConstraints_basic"], + dimensions=["[[natfixz]]"], + mnemonics="Indices of AToms that are FIXed along the Z direction", + characteristics=["[[INPUT_ONLY]]"], + requires="[[natfixz]] > 0", + added_in_version="before_v9", + text=r""" Give the index (in the range 1 to [[natom]] ) of each atom which is to be held fixed ALONG THE Z direction for structural optimization or molecular dynamics. The variable [[iatfix]] lists those fixed in the three directions, while the @@ -8490,18 +9217,19 @@ along x, y or z directions, or a combination of these. See the variable [[iatfix]] for more information. """, - ), - Variable( - abivarname="iatnd", - varset="gstate", - vartype="integer", - topics=["NMR_basic", "MagField_expert"], - dimensions=["[[natnd]]"], - defaultval=0, - mnemonics="list of AToms with Nuclear Dipole moment", - requires="[[natnd]] > 0", - added_in_version="v10.5", - text=r""" +), + +Variable( + abivarname="iatnd", + varset="gstate", + vartype="integer", + topics=["NMR_basic","MagField_expert"], + dimensions=["[[natnd]]"], + defaultval=0, + mnemonics="list of AToms with Nuclear Dipole moment", + requires="[[natnd]] > 0", + added_in_version="v10.5", + text=r""" Together with [[natnd]], provides a simplified, alternative input to [[nucdipmom]] for the atoms carrying explicit nuclear dipole moments. The number of atoms in the cell with explicit nuclear dipoles is [[natnd]]; the list of the atoms is [[iatnd]]; and the components @@ -8509,51 +9237,55 @@ list is converted internally to the full [[nucdipmom]] list; either input format can be used. """, - ), - Variable( - abivarname="iatsph", - varset="gstate", - vartype="integer", - topics=["printing_prdos", "ElecBandStructure_useful", "ElecDOS_useful", "AtomCentered_compulsory"], - dimensions=["[[natsph]]"], - defaultval=Range(start=1, stop="[[natsph]]"), - mnemonics="Index for the ATomic SPHeres of the atom-projected density-of-states", - requires="[[prtdos]] == 3 or 4 or [[pawfatbnd]] in [1,2]", - added_in_version="before_v9", - text=r""" +), + + +Variable( + abivarname="iatsph", + varset="gstate", + vartype="integer", + topics=["printing_prdos", "ElecBandStructure_useful", "ElecDOS_useful", "AtomCentered_compulsory"], + dimensions=["[[natsph]]"], + defaultval=Range(start=1, stop="[[natsph]]"), + mnemonics="Index for the ATomic SPHeres of the atom-projected density-of-states", + requires="[[prtdos]] == 3 or 4 or [[pawfatbnd]] in [1,2]", + added_in_version="before_v9", + text=r""" [[iatsph]] gives the number of the [[natsph]] atoms around which the sphere for atom-projected density-of-states will be build, in the [[prtdos]] = 3 or 4 cases. The radius of these spheres is given by [[ratsph]]. If [[pawfatbnd]] = 1 or 2, it gives the number of the [[natsph]] atoms around which atom-projected band structure will be built. """, - ), - Variable( - abivarname="iboxcut", - varset="paw", - vartype="integer", - topics=["TuningSpeedMem_expert"], - dimensions="scalar", - defaultval=0, - mnemonics="Integer governing the internal use of BOXCUT - not a very good choice of variable name", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="iboxcut", + varset="paw", + vartype="integer", + topics=["TuningSpeedMem_expert"], + dimensions="scalar", + defaultval=0, + mnemonics="Integer governing the internal use of BOXCUT - not a very good choice of variable name", + added_in_version="before_v9", + text=r""" Concern all summations in the reciprocal space and is allowed in PAW and norm-conserving. * if set to 0 all reciprocal space summations are done in a sphere contained in the FFT box. * if set to 1 all reciprocal space summations are done in the whole FFT box (useful for tests). """, - ), - Variable( - abivarname="icoulomb", - varset="gstate", - vartype="integer", - topics=["Coulomb_expert"], - dimensions="scalar", - defaultval=0, - mnemonics="Index for the COULOMB treatment", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="icoulomb", + varset="gstate", + vartype="integer", + topics=["Coulomb_expert"], + dimensions="scalar", + defaultval=0, + mnemonics="Index for the COULOMB treatment", + added_in_version="before_v9", + text=r""" Defines the type of computation (reciprocal space or real space) used for Hartree potential, local part of pseudo-potential and ion-ion interaction: @@ -8563,17 +9295,18 @@ real space expressions of pseudo-potentials are involved (restricted to GTH pseudo-potentials) and simple coulomb interaction gives the ion-ion energy. The wavelet Coulomb solver is used in this case. """, - ), - Variable( - abivarname="icutcoul", - varset="gstate", - vartype="integer", - topics=["Coulomb_basic"], - dimensions="scalar", - defaultval=3, - mnemonics="Integer that governs the CUT-off for COULomb interaction", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="icutcoul", + varset="gstate", + vartype="integer", + topics=["Coulomb_basic"], + dimensions="scalar", + defaultval=3, + mnemonics="Integer that governs the CUT-off for COULomb interaction", + added_in_version="before_v9", + text=r""" Electronic structure calculations for isolated systems, 1D and 2D systems present a slow convergence with respect to the size of the supercell due to the long ranged Coulomb interaction and the high degree of non-locality of the @@ -8597,27 +9330,34 @@ * 0 --> Sphere (molecules, but also 3D-crystals, see below). See [[rcut]]. * 1 --> (W.I.P.) cylinder (nanowires, nanotubes). See [[vcutgeo]] and [[rcut]]. * 2 --> Surface. See [[vcutgeo]] and [[rcut]]. + * 22 --> Short-range 2D Coulomb interaction introduced in Ref. [[cite:Royo2021]]. * 3 --> 3D crystal (Coulomb interaction without cut-off). * 4 --> ERF, long-range only Coulomb interaction. * 5 --> ERFC, short-range only Coulomb interaction (e.g. as used in the HSE functional). (W.I.P.) + * 55 --> Pick, Cohen and Martin (PCM) short-range 3D Coulomb interaction (see [[cite:Pick1970]]). Note that Spencer and Alavi showed that the spherical cutoff can efficiently be used also for 3D systems [[cite:Spencer2008]]. In the latter case, use a negative value for the cutoff radius of the sphere ([[rcut]]<0), which is automatically calculated so that the volume enclosed in the sphere is equal to the volume of the solid. -""", - ), - Variable( - abivarname="ieig2rf", - varset="dfpt", - vartype="integer", - topics=["TDepES_compulsory"], - dimensions="scalar", - defaultval=0, - mnemonics="Integer for second-order EIGenvalues from Response-Function", - added_in_version="before_v9", - text=r""" + +Starting from version 10.4, the use of Coulomb cutoffs has been extended to the linear-response +driver for all perturbations except strain. However, only the [[icutcoul]] = 2, 22, or 55 options +have been validated so far. +""", +), + +Variable( + abivarname="ieig2rf", + varset="dfpt", + vartype="integer", + topics=["TDepES_compulsory"], + dimensions="scalar", + defaultval=0, + mnemonics="Integer for second-order EIGenvalues from Response-Function", + added_in_version="before_v9", + text=r""" If [[ieig2rf]] is greater than 0, the code will produce a file, named with the suffix _EIGR2D, containing the second-order electronic eigenvalues for the perturbation. These files are used in the calculation of the thermal @@ -8655,17 +9395,18 @@ Related variables: [[bdeigrf]], [[elph2_imagden]], [[getgam_eig2nkq]], [[smdelta]] """, - ), - Variable( - abivarname="imgmov", - varset="rlx", - vartype="integer", - topics=["CrossingBarriers_useful", "PIMD_compulsory", "TransPath_compulsory"], - dimensions="scalar", - defaultval=0, - mnemonics="IMaGe MOVEs", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="imgmov", + varset="rlx", + vartype="integer", + topics=["CrossingBarriers_useful", "PIMD_compulsory", "TransPath_compulsory"], + dimensions="scalar", + defaultval=0, + mnemonics="IMaGe MOVEs", + added_in_version="before_v9", + text=r""" Control the collective changes of images (see [[nimage]],[[npimage]], [[dynimage]], [[ntimimage]], [[tolimg]], [[istatimg]], [[prtvolimg]]). Similar to [[ionmov]] in spirit, although here, a population of self-consistent @@ -8738,18 +9479,19 @@ No meaning for RF calculations. """, - ), - Variable( - abivarname="imgwfstor", - varset="rlx", - vartype="integer", - topics=["CrossingBarriers_useful", "PIMD_useful", "TransPath_useful"], - dimensions="scalar", - defaultval=0, - mnemonics="IMaGe WaveFunction STORage", - requires="[[extrapwf]] == 0 and [[ntimimage]] > 0", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="imgwfstor", + varset="rlx", + vartype="integer", + topics=["CrossingBarriers_useful", "PIMD_useful", "TransPath_useful"], + dimensions="scalar", + defaultval=0, + mnemonics="IMaGe WaveFunction STORage", + requires="[[extrapwf]] == 0 and [[ntimimage]] > 0", + added_in_version="before_v9", + text=r""" Govern the storage of wavefunctions at the level of the loop over images, see [[ntimimage]]. Possible values of [[imgwfstor]] are 0 or 1. If [[imgwfstor]] is 1, the wavefunctions for each image are stored in a big array of @@ -8766,18 +9508,19 @@ For algorithms of the molecular dynamics type, [[imgmov]]==9 or 13, the expected gain is smaller. Of course, with adequate memory resources, [[imgwfstor]]==1 should always be preferred. """, - ), - Variable( - abivarname="inclvkb", - varset="gw", - vartype="integer", - topics=["Susceptibility_expert", "BSE_expert"], - dimensions="scalar", - defaultval=2, - mnemonics="INCLude VKB", - requires="[[optdriver]] in [3,99]", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="inclvkb", + varset="gw", + vartype="integer", + topics=["Susceptibility_expert", "BSE_expert"], + dimensions="scalar", + defaultval=2, + mnemonics="INCLude VKB", + requires="[[optdriver]] in [3,99]", + added_in_version="before_v9", + text=r""" Possible values of [[inclvkb]] are 0,2. If [[inclvkb]] is 2, the commutator of the non-local part of the pseudopotential with the position operator is correctly included in the q --> 0 contribution. This is unfortunately time-consuming. @@ -8793,18 +9536,19 @@ The use of [[inclvkb]] = 2 is strongly recommended for the calculation of optical properties. """, - ), - Variable( - abivarname="intxc", - varset="dev", - vartype="integer", - topics=["xc_expert"], - dimensions="scalar", - defaultval=0, - mnemonics="INTerpolation for eXchange-Correlation", - characteristics=["[[DEVELOP]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="intxc", + varset="dev", + vartype="integer", + topics=["xc_expert"], + dimensions="scalar", + defaultval=0, + mnemonics="INTerpolation for eXchange-Correlation", + characteristics=["[[DEVELOP]]"], + added_in_version="before_v9", + text=r""" * 0 --> do "usual" xc quadrature on fft grid * 1 --> do higher accuracy xc quadrature using fft grid and additional points at the centers of each cube (doubles number of grid points)--the high accuracy version is only valid for boxcut>=2. If boxcut < 2, the code stops. @@ -8819,35 +9563,37 @@ Other targets are priority. You will notice that many automatic tests use [[intxc]] = 1. Please, do not follow this historical choice for your production runs. """, - ), - Variable( - abivarname="invovl_blksliced", - varset="dev", - vartype="integer", - topics=["parallelism_expert"], - dimensions="scalar", - mnemonics="INVerse OVerLap: BLocK-diagonal matrix applied SLICED", - added_in_version="9.7.2", - defaultval=ValueWithConditions({"[[gpu_option]] > 0": "0", "defaultval": 1}), - text=r""" +), + +Variable( + abivarname="invovl_blksliced", + varset="dev", + vartype="integer", + topics=["parallelism_expert"], + dimensions="scalar", + mnemonics="INVerse OVerLap: BLocK-diagonal matrix applied SLICED", + added_in_version="9.7.2", + defaultval=ValueWithConditions({"[[gpu_option]] > 0": "0", "defaultval": 1}), + text=r""" Only relevant if [[wfoptalg]] == 1 or 111 (WF optimization by Chebyshev filtering algorithm). In the Chebyshev-filtered subspace method (iterative diagonalization algorithm)) one needs to apply the inverse of the overlap matrix. [[invovl_blksliced]] allows one to choose between two variants, sliced (1) or non-sliced (0). Default value is different for an execution on GPU. """, - ), - Variable( - abivarname="iomode", - varset="dev", - vartype="integer", - topics=["parallelism_expert"], - dimensions="scalar", - defaultval=ValueWithConditions({"[[MPI_IO]] and [[paral_kgb]] == 1": 1, "defaultval": 0}), - mnemonics="Input-Output MODE", - characteristics=["[[DEVELOP]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="iomode", + varset="dev", + vartype="integer", + topics=["parallelism_expert"], + dimensions="scalar", + defaultval=ValueWithConditions({"[[MPI_IO]] and [[paral_kgb]] == 1": 1, "defaultval": 0}), + mnemonics="Input-Output MODE", + characteristics=["[[DEVELOP]]"], + added_in_version="before_v9", + text=r""" This option selects the format used to produce "large" binary files such as the output wavefunction files, the files with densities and potentials (DEN, POT) as well as the SCR file produced by the GW code. Other "small" netcdf files such as the GSR.nc are always produced independently of the value of **iomode**. @@ -8885,18 +9631,19 @@ The netcdf files, however, are still written following the ETSF-IO specifications [[cite:Gonze2008]] and extended with Abinit-specific quantities. """, - ), - Variable( - abivarname="ionmov", - varset="dev", - vartype="integer", - topics=["MolecularDynamics_expert", "GeoOpt_expert"], - dimensions="scalar", - defaultval=0, - mnemonics="IONic MOVEs", - characteristics=["[[DEVELOP]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="ionmov", + varset="dev", + vartype="integer", + topics=["MolecularDynamics_expert", "GeoOpt_expert"], + dimensions="scalar", + defaultval=0, + mnemonics="IONic MOVEs", + characteristics=["[[DEVELOP]]"], + added_in_version="before_v9", + text=r""" Choice of algorithm to control the displacements of ions, and possibly changes of cell shape and size (see [[optcell]]). No meaning for RF calculations. @@ -9102,62 +9849,72 @@ **Purpose:** Structural optimization driver by the server (MD runs are not yet supported) **Cell optimization:** Yes (provide [[optcell]] > 0 in the initial input) """, - ), - Variable( - abivarname="iprcel", - varset="gstate", - vartype="integer", - topics=["SCFAlgorithms_expert"], - dimensions="scalar", - defaultval=0, - mnemonics="Integer for PReConditioning of ELectron response", - added_in_version="before_v9", - text=r""" -Used when [[iscf]] > 0, to define the SCF preconditioning scheme. Potential- -based preconditioning schemes for the SCF loop (electronic part) are still a -subject of active research. The present parameter (electronic part) describes -the way the change of potential is derived from the residual. -The possible values of [[iprcel]] correspond to: - - * 0 --> model dielectric function described by [[diemac]], [[dielng]] and [[diemix]]. - * larger or equal to 21 --> will compute the dielectric matrix according to [[diecut]], [[dielam]], [[diegap]]. This methodology is described in [[cite:Anglade2008]]. - * Between 21 and 29 --> for the first few steps uses the same as option 0 then compute RPA dielectric function, and use it as such. - * Between 31 and 39 --> for the first few steps uses the same as option 0 then compute RPA dielectric function, and use it, with the mixing factor [[diemix]]. - * Between 41 and 49 --> compute the RPA dielectric matrix at the first step, and recompute it at a later step, and take into account the mixing factor [[diemix]]. - * Between 51 and 59 --> same as between 41 and 49, but compute the RPA dielectric matrix by another mean - * Between 61 and 69 --> same as between 41 and 49, but compute the electronic dielectric matrix instead of the RPA one. - * Between 71 and 78 --> STILL UNDER DEVELOPMENT -- NOT USABLE; Use the modified Kerker preconditioner with a real-space formulation (basic formulation is shown at [[dielng]]). The dielectric matrix is approximated thanks to [[diemac]] and [[dielng]]. Note that [[diemix]] is also used. - * 79 --> STILL UNDER DEVELOPMENT -- NOT USABLE; same as previous but with an alternate algorithm. - * 141 to 169 --> same as Between 41 and 69 (but, the dielectric matrix is also recomputed every iprcel modulo 10 step). - -The computation of the dielectric matrix (for 0 [100]< [[iprcel]] < 70 [100]) -is based on the **extrapolar** approximation, see [[cite:Anglade2008]]. This approximation can be tuned -with [[diecut]], [[dielam]], and [[diegap]]. Yet its accuracy mainly depends -on the number of conduction bands included in the system. Having 2 to 10 empty -bands in the calculation is usually enough (use [[nband]]). - -NOTES: - - * The step at which the dielectric matrix is computed or recomputed is determined by modulo([[iprcel]],10). The recomputation happens just once in the calculation for [[iprcel]] < 100. - * For non-homogeneous relatively large cells [[iprcel]] = 45 will likely give a large improvement over [[iprcel]] = 0. - * In case of PAW and [[iprcel]] > 0, see [[pawsushat]] input variable. By default, an approximation (which can be suppressed) is done for the computation of susceptibility matrix. - * For extremely large inhomogeneous cells where computation of the full dielectric matrix takes too many weeks, 70 < [[iprcel]] < 80 is advised. - * For [[nsppol]] = 2 or [[nspinor]] = 2 with metallic [[occopt]], only **mod(iprcel,100)** <50 is allowed. - * No meaning for RF calculations yet. - * The exchange term in the full dielectric matrix diverges for vanishing densities. Therefore the values of [[iprcel]] beyond 60 must not be used for cells containing vacuum, unless ones computes this matrix for every step ([[iprcel]] = 161). -""", - ), - Variable( - abivarname="iprcfc", - varset="dev", - vartype="integer", - topics=["GeoOpt_useful"], - dimensions="scalar", - defaultval=0, - mnemonics="Integer for PReConditioner of Force Constants", - characteristics=["[[DEVELOP]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="iprcel", + varset="gstate", + vartype="integer", + topics=["SCFAlgorithms_expert"], + dimensions="scalar", + defaultval=0, + mnemonics="Integer for PReConditioning of ELectron response", + added_in_version="before_v9", + text=r""" +Used when [[iscf]] > 0, to define the SCF preconditioning scheme. + +The preconditioner $P$ is used to compute the preconditioned density/potential residuals +$$ r_n = P(x_n^\mathrm{in} - x_n^\mathrm{out}) $$ +that are then used in the mixing scheme. +When potential mixing ($x=\rho$) is used, the preconditioner is an approximation of the inverse dielectric matrix $\varepsilon$. +When density mixing ($x=V$) is used, the preconditioner is an approximation of the inverse adjoint dielectric matrix $\varepsilon^\dagger$. + +The possible values of [[iprcel]] are: + + * 0 --> Model dielectric function described by [[diemac]], [[dielng]] and [[diemix]]. + + * Between 21 and 169 --> Model dielectric matrix computed with the extrapolar approximation described in [[cite:Anglade2008]]. This approximation can be adjusted using the parameters [[diecut]], [[dielam]] and [[diegap]]. The accuracy of this model largely depends on the number of conduction bands included in the system. Having 2 to 10 empty bands in the calculation is usually enough (use [[nband]]). + * Between 21 and 29 --> Use the same as [[iprcel]] = 0 for the first few steps, then compute the RPA dielectric matrix, and use it as such. + * Between 31 and 39 --> Use the same as [[iprcel]] = 0 for the first few steps, then compute the RPA dielectric matrix, and use it with the mixing factor [[diemix]]. + * Between 41 and 49 --> Compute the RPA dielectric matrix at the first step, and recompute it at a later step, taking into account the mixing factor [[diemix]]. + * Between 51 and 59 --> Same as between 41 and 49, but compute the RPA dielectric matrix by another mean. + * Between 61 and 69 --> Same as between 41 and 49, but compute the electronic dielectric matrix instead of the RPA one. + * Between 141 and 169 --> Same as Between 41 and 69, but the dielectric matrix is also recomputed every mod([[iprcel]], 10) step. + + > Notes : + > * The step at which the dielectric matrix is computed or recomputed is determined by modulo([[iprcel]],10). The recomputation happens just once in the calculation for [[iprcel]] < 100. + > * For non-homogeneous relatively large cells, [[iprcel]] = 45 will likely give a large improvement over [[iprcel]] = 0. + > * In case of PAW and [[iprcel]] > 0, see [[pawsushat]] input variable. By default, an approximation (which can be suppressed) is done for the computation of the susceptibility matrix. + > * For extremely large inhomogeneous cells where computation of the full dielectric matrix takes too many weeks, 70 < [[iprcel]] < 80 is advised. + > * For [[nsppol]] = 2 or [[nspinor]] = 2 with metallic [[occopt]], only mod([[iprcel]],10) < 50 is allowed. + > * No meaning for RF calculations yet. + > * The exchange term in the full dielectric matrix diverges for vanishing densities. Therefore the values of [[iprcel]] beyond 60 must not be used for cells containing vacuum, unless ones computes this matrix for every step ([[iprcel]] = 161). + + * Between 200 and 299 --> Model dielectric operator $\varepsilon^\mathrm{model}$ based of a model non-interacting susceptibility $\chi_0^\mathrm{model}$: $$ \varepsilon^\mathrm{model} = I - K \chi_0^\mathrm{model} $$ where $K$ is a potential kernel (the Coulomb kernel $K_H$ and/or the exchange-correlation kernel $K_\mathrm{XC}$). +The preconditioner, $P = (\varepsilon^\mathrm{model})^{-1}$ for potential mixing or $P = ((\varepsilon^\mathrm{model})^\dagger)^{-1}$ for density mixing, is applied using an iterative linear solver (GMRES) to invert the model dielectric matrix or its adjoint. +Available models are : + * 200 --> LDOS-preconditioner [[cite:Herbst2020]]: $$ \varepsilon^\mathrm{LDOS} = I - K_H \chi_0^\mathrm{LDOS} .$$ This preconditioner is well suited for metallic system in large homogeneous or inhomogeneous systems. It requires a smooth smearing function ([[occopt]] = 3 to 7) and we suggest using it as a **default** for such cases. + * 201 --> DOS-preconditioner: $$\varepsilon^\mathrm{DOS} = I - DK_\mathrm{H}$$ with $D$ the (scalar) density of state at the Fermi-level. This is a parameter-free version of the Kerker preconditioner (suggested in [[cite:Herbst2020]]). + * 202 --> Hybrid preconditioner for ferromagnetism: $$\varepsilon^\mathrm{hybrid} = I - K_H \chi_0^\mathrm{LDOS} - K_\mathrm{XC}\chi_0^\mathrm{diag} .$$ This preconditioner is designed for ferromagnetic systems and we suggest trying it in ferromagnetic systems with convergence issues. The parameter [[precon_tsmear]] may need to be adjusted for this preconditioner to work properly. + + > Notes : + > * The mixing factor [[diemix]] is used and [[diemixmag]] is ignored. + > * The preconditioner can be tuned with the parameters [[precon_ls_maxite]], [[precon_ls_rtol]], [[precon_verbose]], [[precon_tsmear]] and [[precon_in_memory]]. + > * In PAW, this is only compatible with [[pawmixdg]] = 1. +""", +), + +Variable( + abivarname="iprcfc", + varset="dev", + vartype="integer", + topics=["GeoOpt_useful"], + dimensions="scalar", + defaultval=0, + mnemonics="Integer for PReConditioner of Force Constants", + characteristics=["[[DEVELOP]]"], + added_in_version="before_v9", + text=r""" Used when [[iscf]] > 0, to define the SCF preconditioning scheme. Potential- based preconditioning schemes for the SCF loop are still under development. The present parameter (force constant part) describes the way a change of @@ -9172,18 +9929,19 @@ No meaning for RF calculations. """, - ), - Variable( - abivarname="iqpt", - varset="gstate", - vartype="integer", - topics=["q-points_basic"], - dimensions="scalar", - defaultval=0, - mnemonics="Index for QPoinT generation", - characteristics=["[[INPUT_ONLY]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="iqpt", + varset="gstate", + vartype="integer", + topics=["q-points_basic"], + dimensions="scalar", + defaultval=0, + mnemonics="Index for QPoinT generation", + characteristics=["[[INPUT_ONLY]]"], + added_in_version="before_v9", + text=r""" Only used if [[nqpt]] = 1, and [[qptopt]] = 1 to 4. Defines the index of the Q point to be selected in the list of q points @@ -9195,18 +9953,19 @@ with [[iqpt]] = 0 or 1 (so through the definition of **iqpt:** ), and increasing it by one for each dataset (thanks to **iqpt+** ). """, - ), - Variable( - abivarname="irandom", - varset="dev", - vartype="integer", - topics=["PIMD_expert", "MolecularDynamics_expert"], - dimensions="scalar", - defaultval=3, - mnemonics="Integer for the choice of the RANDOM number generator", - characteristics=["[[DEVELOP]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="irandom", + varset="dev", + vartype="integer", + topics=["PIMD_expert","MolecularDynamics_expert"], + dimensions="scalar", + defaultval=3, + mnemonics="Integer for the choice of the RANDOM number generator", + characteristics=["[[DEVELOP]]"], + added_in_version="before_v9", + text=r""" For the time being, only used when [[imgmov]] = 9 (Langevin Path-Integral Molecular Dynamics), or [[moldyn]] = "nvt_langevin" or "npt_langevin" ([[ionmov]] = 16). @@ -9222,17 +9981,18 @@ [[irandom]] = 3 is strongly advised when performing Molecular Dynamics restarts (avoids bias). """, - ), - Variable( - abivarname="ird1den", - varset="files", - vartype="integer", - topics=["nonlinear_useful"], - dimensions="scalar", - defaultval=ValueWithConditions({"[[iscf]] < 0": 1, "defaultval": 0}), - mnemonics="Integer that governs the ReaDing of 1st-order DEN file", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="ird1den", + varset="files", + vartype="integer", + topics=["nonlinear_useful"], + dimensions="scalar", + defaultval=ValueWithConditions({"[[iscf]] < 0": 1, "defaultval": 0}), + mnemonics="Integer that governs the ReaDing of 1st-order DEN file", + added_in_version="before_v9", + text=r""" If the first-order density is needed in single dataset mode (for example in nonlinear optical response), use [[ird1den]] = 1 to read first-order densities from _DENx files produced in other calculations. In multi-dataset mode use [[get1den]]. @@ -9242,17 +10002,18 @@ A non-zero value of **ird1den** is treated in the same way as other "ird" variables. For further information about the naming of files in ABINIT, consult the [[help:abinit#files-file]]. """, - ), - Variable( - abivarname="ird1wf", - varset="files", - vartype="integer", - topics=["DFPT_useful"], - dimensions="scalar", - defaultval=0, - mnemonics="Integer that governs the ReaDing of _1WF files", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="ird1wf", + varset="files", + vartype="integer", + topics=["DFPT_useful"], + dimensions="scalar", + defaultval=0, + mnemonics="Integer that governs the ReaDing of _1WF files", + added_in_version="before_v9", + text=r""" Indicates possible starting wavefunctions. As alternative, one can use the input variable [[get1wf]]. It is relevant only for Response-function calculation. @@ -9280,72 +10041,77 @@ For further information about the naming of files in ABINIT, consult the [[help:abinit#files-file]]. """, - ), - Variable( - abivarname="irdbscoup", - varset="files", - vartype="integer", - topics=["BSE_useful"], - dimensions="scalar", - defaultval=0, - mnemonics="Integer that governs the ReaDing of COUPling block", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="irdbscoup", + varset="files", + vartype="integer", + topics=["BSE_useful"], + dimensions="scalar", + defaultval=0, + mnemonics="Integer that governs the ReaDing of COUPling block", + added_in_version="before_v9", + text=r""" If 1, will start the Bethe-Salpeter calculation from the BSC file containing the coupling block produced in a previous run. """, - ), - Variable( - abivarname="irdbseig", - varset="files", - vartype="integer", - topics=["BSE_useful"], - dimensions="scalar", - defaultval=0, - mnemonics="Integer that governs the ReaDing of BS_EIG file", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="irdbseig", + varset="files", + vartype="integer", + topics=["BSE_useful"], + dimensions="scalar", + defaultval=0, + mnemonics="Integer that governs the ReaDing of BS_EIG file", + added_in_version="before_v9", + text=r""" If 1, will tart the Bethe-Salpeter calculation from the BS_EIG containing the exciton eigenvectors produced in a previous run. """, - ), - Variable( - abivarname="irdbsreso", - varset="files", - vartype="integer", - topics=["BSE_useful"], - dimensions="scalar", - defaultval=0, - mnemonics="Integer that governs the ReaDing of RESOnant block", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="irdbsreso", + varset="files", + vartype="integer", + topics=["BSE_useful"], + dimensions="scalar", + defaultval=0, + mnemonics="Integer that governs the ReaDing of RESOnant block", + added_in_version="before_v9", + text=r""" If 1, will start the Bethe-Salpeter calculation from the BSR file containing the resonant block produced in a previous run. """, - ), - Variable( - abivarname="irdchkprdm", - varset="files", - vartype="integer", - topics=["GW_expert", "SelfEnergy_expert"], - dimensions="scalar", - defaultval=0, - mnemonics="Integer that governs ReaDing of CHecK-Point files for the GW 1-RDM", - requires="[[optdriver]] == 4", - added_in_version="9.4.0", - text=r""" +), + +Variable( + abivarname="irdchkprdm", + varset="files", + vartype="integer", + topics=["GW_expert", "SelfEnergy_expert"], + dimensions="scalar", + defaultval=0, + mnemonics="Integer that governs ReaDing of CHecK-Point files for the GW 1-RDM", + requires="[[optdriver]] == 4", + added_in_version="9.4.0", + text=r""" [[irdchkprdm]]==1 triggers the reading of binary checkpoint files when updating the density matrix for the the linearized GW approximation. It is only meaningful when [[gw1rdm]]>0. The files that are read use the usual ABINIT input files naming convention with extension _CHKP_RDM_1. """, - ), - Variable( - abivarname="irdddb", - varset="files", - vartype="integer", - topics=["ElPhonInt_useful"], - dimensions="scalar", - defaultval=ValueWithConditions({"[[iscf]] < 0": "1", "defaultval": 0}), - mnemonics="Integer that governs the ReaDing of DDB file", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="irdddb", + varset="files", + vartype="integer", + topics=["ElPhonInt_useful"], + dimensions="scalar", + defaultval=ValueWithConditions({"[[iscf]] < 0": "1", "defaultval": 0}), + mnemonics="Integer that governs the ReaDing of DDB file", + added_in_version="before_v9", + text=r""" This variable should be used when performing electron-phonon or temperature- dependence calculations. The Born effective charge as well as the dielectric tensor will be read from a previous DFPT calculations of the electric field at @@ -9361,17 +10127,19 @@ The input variable [[getddb]] is an alternative to [[irdddb]], in the multidataset case. Note also that, starting Abinit v9, one can also use [[getddb_filepath]] to specify the path of the DDB file directly. """, - ), - Variable( - abivarname="irdddk", - varset="files", - vartype="integer", - topics=["DFPT_useful"], - dimensions="scalar", - defaultval=0, - mnemonics="Integer that governs the ReaDing of DDK wavefunctions, in _1WF files", - added_in_version="before_v9", - text=r""" + +), + +Variable( + abivarname="irdddk", + varset="files", + vartype="integer", + topics=["DFPT_useful"], + dimensions="scalar", + defaultval=0, + mnemonics="Integer that governs the ReaDing of DDK wavefunctions, in _1WF files", + added_in_version="before_v9", + text=r""" Indicates whether ABINIT should read the DDK wavefunctions as possible starting wavefunctions. As alternative, one can use the input variable [[getddk]]. @@ -9384,17 +10152,18 @@ For further information about the naming of files in ABINIT, consult the [[help:abinit#files-file]]. """, - ), - Variable( - abivarname="irdden", - varset="files", - vartype="integer", - topics=["multidtset_useful"], - dimensions="scalar", - defaultval=ValueWithConditions({"[[iscf]] < 0": "1", "defaultval": 0}), - mnemonics="Integer that governs the ReaDing of density DEN file", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="irdden", + varset="files", + vartype="integer", + topics=["multidtset_useful"], + dimensions="scalar", + defaultval=ValueWithConditions({"[[iscf]] < 0": "1", "defaultval": 0}), + mnemonics="Integer that governs the ReaDing of density DEN file", + added_in_version="before_v9", + text=r""" If 1, will start the ground-state calculation from the density file of a previous run. When [[iscf]] < 0, the reading of a DEN file is always enforced. Alternative to [[getden_filepath]] and [[getden]]. @@ -9402,17 +10171,18 @@ A non-zero value of [[irdden]] is treated in the same way as other "ird" variables. For further information about the naming of files in ABINIT, consult the [[help:abinit#files-file]]. """, - ), - Variable( - abivarname="irdkden", - varset="files", - vartype="integer", - topics=["multidtset_useful"], - dimensions="scalar", - defaultval=ValueWithConditions({"[[iscf]] < 0": "1", "defaultval": "[[irdden]]"}), - mnemonics="Integer that governs the ReaDing of Kinetic energy density KDEN file", - added_in_version="9.10.4", - text=r""" +), + +Variable( + abivarname="irdkden", + varset="files", + vartype="integer", + topics=["multidtset_useful"], + dimensions="scalar", + defaultval=ValueWithConditions({"[[iscf]] < 0": "1", "defaultval": "[[irdden]]"}), + mnemonics="Integer that governs the ReaDing of Kinetic energy density KDEN file", + added_in_version="9.10.4", + text=r""" Only relevant when [[usekden]]=1 (meta GGA exchange-correlation functionals). If 1, will start the ground-state calculation from the **kinetic energy density** file of a previous run. @@ -9422,118 +10192,128 @@ A non-zero value of [[irdkden]] is treated in the same way as other "ird" variables. For further information about the naming of files in ABINIT, consult the [[help:abinit#files-file]]. """, - ), - Variable( - abivarname="irddelfd", - varset="files", - vartype="integer", - topics=["multidtset_useful"], - dimensions="scalar", - defaultval=0, - mnemonics="Integer that governs the ReaDing of the the 1st derivative of wavefunctions with respect to ELectric FielD, from _1WF file", - added_in_version="10.5", - text=r""" +), + +Variable( + abivarname="irddelfd", + varset="files", + vartype="integer", + topics=["multidtset_useful"], + dimensions="scalar", + defaultval=0, + mnemonics="Integer that governs the ReaDing of the the 1st derivative of wavefunctions with respect to ELectric FielD, from _1WF file", + added_in_version="10.5", + text=r""" Eventually used when [[ndtset]] > 0 (in the multi-dataset mode), to indicate starting wavefunctions for the 1st derivative of wavefunctions with respect to ELectric FielD, from _1WF file. As alternative, one can use the input variable [[getdelfd]], they are mutually exclusive. See [[getdelfd]] as well as the similar [[irdddk]] for more information """, - ), - Variable( - abivarname="irddkde", - varset="files", - vartype="integer", - topics=["multidtset_useful"], - dimensions="scalar", - defaultval=0, - mnemonics="Integer that governs the ReaDing of the mixed 2nd derivative of wavefunctions with respect to K and electric field, from _1WF file", - added_in_version="10.5", - text=r""" +), + + +Variable( + abivarname="irddkde", + varset="files", + vartype="integer", + topics=["multidtset_useful"], + dimensions="scalar", + defaultval=0, + mnemonics="Integer that governs the ReaDing of the mixed 2nd derivative of wavefunctions with respect to K and electric field, from _1WF file", + added_in_version="10.5", + text=r""" Eventually used when [[ndtset]] > 0 (in the multi-dataset mode), to indicate starting DKDE wavefunctions. As alternative, one can use the input variable [[getdkde]], they are mutually exclusive. See [[getdkde]] as well as the similar [[irdddk]] for more information """, - ), - Variable( - abivarname="irddkdk", - varset="files", - vartype="integer", - topics=["multidtset_useful"], - dimensions="scalar", - defaultval=0, - mnemonics="Integer that governs the ReaDing of the 2nd derivative of wavefunctions with respect to K, from _1WF file", - added_in_version="10.5", - text=r""" +), + + +Variable( + abivarname="irddkdk", + varset="files", + vartype="integer", + topics=["multidtset_useful"], + dimensions="scalar", + defaultval=0, + mnemonics="Integer that governs the ReaDing of the 2nd derivative of wavefunctions with respect to K, from _1WF file", + added_in_version="10.5", + text=r""" Eventually used when [[ndtset]] > 0 (in the multi-dataset mode), to indicate starting DKDK wavefunctions. As alternative, one can use the input variable [[getdkdk]], they are mutually exclusive. See [[getdkdk]] as well as the similar [[irdddk]] for more information """, - ), - Variable( - abivarname="irddvdb", - varset="files", - vartype="integer", - topics=["ElPhonInt_useful"], - dimensions="scalar", - mnemonics="Integer that governs the ReaDing of DVDB file", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="irddvdb", + varset="files", + vartype="integer", + topics=["ElPhonInt_useful"], + dimensions="scalar", + mnemonics="Integer that governs the ReaDing of DVDB file", + added_in_version="before_v9", + text=r""" This variable can be used when performing electron-phonon calculations with [[optdriver]] = 7. Set to 1, an *input* DVDB file will be read. See also [[getdvdb]] """, - ), - Variable( - abivarname="irdefmas", - varset="files", - vartype="integer", - topics=["multidtset_useful"], - dimensions="scalar", - defaultval=0, - mnemonics="Integer to ReaD the EFfective MASses from...", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="irdefmas", + varset="files", + vartype="integer", + topics=["multidtset_useful"], + dimensions="scalar", + defaultval=0, + mnemonics="Integer to ReaD the EFfective MASses from...", + added_in_version="before_v9", + text=r""" Eventually used when [[ndtset]] > 0 (multi-dataset mode). Only relevant for [[optdriver]]=7 and [[eph_task]]=6, 10. If set to 1, take the data from a _EFMAS file as input. The latter must have been produced using [[prtefmas]] in another run. """, - ), - Variable( - abivarname="irdhaydock", - varset="files", - vartype="integer", - topics=["BSE_useful"], - dimensions="scalar", - defaultval=0, - mnemonics="Integer that governs the ReaDing of the HAYDOCK restart file", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="irdhaydock", + varset="files", + vartype="integer", + topics=["BSE_useful"], + dimensions="scalar", + defaultval=0, + mnemonics="Integer that governs the ReaDing of the HAYDOCK restart file", + added_in_version="before_v9", + text=r""" If 1, will re-start the Haydock iterative technique from the HAYDR_SAVE file produced in a previous run. """, - ), - Variable( - abivarname="irdqps", - varset="files", - vartype="integer", - topics=["GW_useful", "multidtset_useful", "Susceptibility_useful", "SelfEnergy_useful"], - dimensions="scalar", - defaultval=0, - mnemonics="Integer that governs the ReaDing of QuasiParticle Structure", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="irdqps", + varset="files", + vartype="integer", + topics=["GW_useful", "multidtset_useful", "Susceptibility_useful", "SelfEnergy_useful"], + dimensions="scalar", + defaultval=0, + mnemonics="Integer that governs the ReaDing of QuasiParticle Structure", + added_in_version="before_v9", + text=r""" Relevant only when [[optdriver]] = 3 or 4. If 1, indicate that the eigenvalues and possibly the wavefunctions must be obtained, in order to achieve a self-consistent quasi-particle calculations. See also [[getqps]] """, - ), - Variable( - abivarname="irdscr", - varset="files", - vartype="integer", - topics=["GW_useful", "multidtset_useful", "SelfEnergy_useful"], - dimensions="scalar", - defaultval=0, - mnemonics="Integer that governs the ReaDing of the SCReening", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="irdscr", + varset="files", + vartype="integer", + topics=["GW_useful", "multidtset_useful", "SelfEnergy_useful"], + dimensions="scalar", + defaultval=0, + mnemonics="Integer that governs the ReaDing of the SCReening", + added_in_version="before_v9", + text=r""" Relevant only when [[optdriver]] = 4. If non-zero, indicate that the dielectric matrix must be obtained from an existing file. As alternative, one can use the input variable [[getscr]]. When [[optdriver]] = 4, at least one of [[irdscr]] or [[getscr]] (alternatively, @@ -9542,17 +10322,18 @@ A non-zero value of [[irdscr]] is treated in the same way as other "ird" variables. For further information about the naming of files in ABINIT, consult the [[help:abinit#files-file]]. """, - ), - Variable( - abivarname="irdsuscep", - varset="files", - vartype="integer", - topics=["GW_useful", "multidtset_useful", "SelfEnergy_useful"], - dimensions="scalar", - defaultval=0, - mnemonics="Integer that governs the ReaDing of the SUSCEPtibility", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="irdsuscep", + varset="files", + vartype="integer", + topics=["GW_useful", "multidtset_useful", "SelfEnergy_useful"], + dimensions="scalar", + defaultval=0, + mnemonics="Integer that governs the ReaDing of the SUSCEPtibility", + added_in_version="before_v9", + text=r""" Relevant only when [[optdriver]] = 4. If non-zero, indicate that the irreducible polarizability must be obtained from an existing file. As alternative, one can use the input variable [[getsuscep]]. @@ -9562,35 +10343,37 @@ A non-zero value of [[irdsuscep]] is treated in the same way as other "ird" variables. For further information about the naming of files in ABINIT, consult the [[help:abinit#files-file]]. """, - ), - Variable( - abivarname="irdvdw", - varset="vdw", - vartype="integer", - topics=["vdw_useful"], - dimensions="scalar", - defaultval=0, - mnemonics="Integer that governs the ReaDing of _VDW files", - characteristics=["[[DEVELOP]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="irdvdw", + varset="vdw", + vartype="integer", + topics=["vdw_useful"], + dimensions="scalar", + defaultval=0, + mnemonics="Integer that governs the ReaDing of _VDW files", + characteristics=["[[DEVELOP]]"], + added_in_version="before_v9", + text=r""" Used when [[vdw_xc]] > 0, to read previously calculated vdW-DF variables. Supported values: * 0: do not read vdW-DF variables * 1: read vdW-DF variables """, - ), - Variable( - abivarname="irdwfk", - varset="files", - vartype="integer", - topics=["multidtset_useful"], - dimensions="scalar", - defaultval=0, - mnemonics="Integer that governs the ReaDing of _WFK files", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="irdwfk", + varset="files", + vartype="integer", + topics=["multidtset_useful"], + dimensions="scalar", + defaultval=0, + mnemonics="Integer that governs the ReaDing of _WFK files", + added_in_version="before_v9", + text=r""" Indicates possible starting wavefunctions. As alternative, one can use the input variables [[irdwfq]], [[ird1wf]] or [[irdddk]], as well as they getXXX counterparts. Here follows a global description of the usage of these input variables. @@ -9624,17 +10407,18 @@ For further information about the naming of files in ABINIT, consult the [[help:abinit#files-file]]. """, - ), - Variable( - abivarname="irdwfkfine", - varset="dev", - vartype="integer", - topics=["multidtset_useful", "TDepES_useful"], - dimensions="scalar", - defaultval=0, - mnemonics="Integer that governs the ReaDing of the grid _WFK file on the FINE grid", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="irdwfkfine", + varset="dev", + vartype="integer", + topics=["multidtset_useful", "TDepES_useful"], + dimensions="scalar", + defaultval=0, + mnemonics="Integer that governs the ReaDing of the grid _WFK file on the FINE grid", + added_in_version="before_v9", + text=r""" If 1, will restart from existing wavefunctions on the fine grid. As alternative, one can use the input variables [[getwfkfine]]. Ground-state calculation: @@ -9662,32 +10446,49 @@ **This variable is experimental. In development.** """, - ), - Variable( - abivarname="irdwfq", - varset="files", - vartype="integer", - topics=["DFPT_useful"], - dimensions="scalar", - defaultval=0, - mnemonics="Integer that governs the ReaDing of _WFQ files", - added_in_version="before_v9", - text=r""" -See detailed description at [[irdwfq]]. +), + +Variable( + abivarname="irdwfmq", + varset="files", + vartype="integer", + topics=["DFPT_useful"], + dimensions="scalar", + defaultval=0, + mnemonics="Integer that governs the ReaDing of k-q _WFQ files", + added_in_version="10.4", + text=r""" +See detailed description at [[irdwfk]]. +As alternative, one can use the input variable [[getwfmq]]. +""", +), + +Variable( + abivarname="irdwfq", + varset="files", + vartype="integer", + topics=["DFPT_useful"], + dimensions="scalar", + defaultval=0, + mnemonics="Integer that governs the ReaDing of _WFQ files", + added_in_version="before_v9", + text=r""" +See detailed description at [[irdwfk]]. As alternative, one can use the input variable [[getwfq]]. """, - ), - Variable( - abivarname="iscf", - varset="basic", - vartype="integer", - topics=["SCFAlgorithms_basic", "TDDFT_compulsory", "ElecBandStructure_basic"], - dimensions="scalar", - defaultval=ValueWithConditions({"[[usepaw]] == 1": 17, "[[usewvl]] == 1": 0, "defaultval": 7}), - mnemonics="Integer for Self-Consistent-Field cycles", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="iscf", + varset="basic", + vartype="integer", + topics=["SCFAlgorithms_basic", "TDDFT_compulsory", "ElecBandStructure_basic"], + dimensions="scalar", + defaultval=ValueWithConditions({"[[usepaw]] == 1": 17, "[[usewvl]] == 1": 0, "defaultval": 7}), + mnemonics="Integer for Self-Consistent-Field cycles", + added_in_version="before_v9", + text=r""" Controls the self-consistency algorithm. Positive values correspond to the usual choice for doing the usual ground state @@ -9782,18 +10583,19 @@ this corresponds to the same functional (LDA - Perdew Wang 1992) as [[ixc]]=7, and you should specify [[ixc]]=7. """, - ), - Variable( - abivarname="isecur", - varset="dev", - vartype="integer", - topics=["SCFAlgorithms_expert"], - dimensions="scalar", - defaultval=0, - mnemonics="Integer for level of SECURity choice", - characteristics=["[[DEVELOP]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="isecur", + varset="dev", + vartype="integer", + topics=["SCFAlgorithms_expert"], + dimensions="scalar", + defaultval=0, + mnemonics="Integer for level of SECURity choice", + characteristics=["[[DEVELOP]]"], + added_in_version="before_v9", + text=r""" In the presently used algorithms, there is a compromise between speed and robustness, that can be tuned by using [[isecur]]. If [[isecur]] =0, an extrapolation of out-of-line data is allowed, and might @@ -9807,17 +10609,18 @@ non-SCF computation per line minimisation. No meaning for RF calculations yet. """, - ), - Variable( - abivarname="istatimg", - varset="rlx", - vartype="integer", - topics=["PIMD_expert"], - dimensions="scalar", - defaultval=1, - mnemonics="Integer governing the computation of STATic IMaGes", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="istatimg", + varset="rlx", + vartype="integer", + topics=["PIMD_expert"], + dimensions="scalar", + defaultval=1, + mnemonics="Integer governing the computation of STATic IMaGes", + added_in_version="before_v9", + text=r""" This input variable is relevant when sets of images are activated (see [[imgmov]]). Not all images might be required to evolve from one time step to the other (see[[dynimage]]): these are static images. @@ -9826,53 +10629,56 @@ This can be useful to save CPU time. If [[istatimg]] = 1, the total energy of static images is computed. """, - ), - Variable( - abivarname="istatr", - varset="dev", - vartype="integer", - topics=["printing_prmisc"], - dimensions="scalar", - defaultval=0, - mnemonics="Integer for STATus file rate", - characteristics=["[[DEVELOP]]", "[[NO_MULTI]]"], - commentdefault="Values lower than 10 may not work on some machines.", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="istatr", + varset="dev", + vartype="integer", + topics=["printing_prmisc"], + dimensions="scalar", + defaultval=0, + mnemonics="Integer for STATus file rate", + characteristics=["[[DEVELOP]]", "[[NO_MULTI]]"], + commentdefault="Values lower than 10 may not work on some machines.", + added_in_version="before_v9", + text=r""" Govern the rate of output of the status file. This status file is written when the number of the call to the status subroutine is equal to [[istatshft]] modulo [[istatr]], so that it is written once every [[istatr]] call. When [[istatr]] = 0, there is no writing of a status file (which is the default). """, - ), - Variable( - abivarname="istatshft", - varset="dev", - vartype="integer", - topics=["printing_prmisc"], - dimensions="scalar", - defaultval=1, - mnemonics="Integer for STATus file SHiFT", - characteristics=["[[DEVELOP]]", "[[NO_MULTI]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="istatshft", + varset="dev", + vartype="integer", + topics=["printing_prmisc"], + dimensions="scalar", + defaultval=1, + mnemonics="Integer for STATus file SHiFT", + characteristics=["[[DEVELOP]]", "[[NO_MULTI]]"], + added_in_version="before_v9", + text=r""" Govern the rate of output of the status file. This status file is written when the number of the call to the status subroutine is equal to '[[istatshft]]' modulo ' **istatr** ', so that it is written once every ' **istatr** ' call. There is also a writing for each of the 5 first calls, and the 10th call. """, - ), - Variable( - abivarname="istwfk", - varset="dev", - vartype="integer", - topics=["k-points_useful", "TuningSpeedMem_basic"], - dimensions=["[[nkpt]]"], - defaultval=MultipleValue(number=None, value=0), - mnemonics="Integer for choice of STorage of WaveFunction at each k point", - commentdefault="For RF calculations, the Default is not used: **istwfk** is forced to be 1 deep inside the code, for all k points. For spin-orbit calculations ([[nspinor]] = 2), **istwfk** is also forced to be 1, for all k points.", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="istwfk", + varset="dev", + vartype="integer", + topics=["k-points_useful", "TuningSpeedMem_basic"], + dimensions=["[[nkpt]]"], + defaultval=MultipleValue(number=None, value=0), + mnemonics="Integer for choice of STorage of WaveFunction at each k point", + commentdefault="For RF calculations, the Default is not used: **istwfk** is forced to be 1 deep inside the code, for all k points. For spin-orbit calculations ([[nspinor]] = 2), **istwfk** is also forced to be 1, for all k points.", + added_in_version="before_v9", + text=r""" Control the way the wavefunction for each k-point is stored inside ABINIT, in reciprocal space. For the GS calculations, in the "cg" array containing the wavefunction coefficients, there is for each k-point and each band, a segment @@ -9901,18 +10707,19 @@ * 0 --> (preprocessed) for each k point, choose automatically the appropriate time-reversal option when it is allowed, and chose **istwfk** = 1 for all the other k-points. """, - ), - Variable( - abivarname="ivalence", - varset="gstate", - vartype="integer", - dimensions="scalar", - topics=["BandOcc_useful", "DeltaSCF_expert"], - defaultval=0, - mnemonics="Index of the highest VALENCE band", - characteristics=["[[INPUT_ONLY]]"], - added_in_version="v9", - text=r""" +), + +Variable( + abivarname="ivalence", + varset="gstate", + vartype="integer", + dimensions="scalar", + topics=["BandOcc_useful","DeltaSCF_expert"], + defaultval=0, + mnemonics="Index of the highest VALENCE band", + characteristics=["[[INPUT_ONLY]]"], + added_in_version="v9", + text=r""" Only used if [[occopt] = 9. When [[occopt]]==9, the lowest [[ivalence]] bands are considered to be @@ -9921,18 +10728,19 @@ considered to be conduction bands, and [[nqfd]] electrons are constrained there. See [[cite:Paillard2019]] for more details about the general method implemented. """, - ), - Variable( - abivarname="ixc", - varset="basic", - vartype="integer", - topics=["xc_basic", "Hybrids_compulsory", "TDDFT_useful"], - dimensions="scalar", - defaultval=1, - mnemonics="Index of eXchange-Correlation functional", - commentdefault="Default corresponds to Teter parametrization. However, if all the pseudopotentials have the same value of pspxc, the initial value of ixc will be that common value", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="ixc", + varset="basic", + vartype="integer", + topics=["xc_basic", "Hybrids_compulsory", "TDDFT_useful"], + dimensions="scalar", + defaultval=1, + mnemonics="Index of eXchange-Correlation functional", + commentdefault="Default corresponds to Teter parametrization. However, if all the pseudopotentials have the same value of pspxc, the initial value of ixc will be that common value", + added_in_version="before_v9", + text=r""" Controls the choice of exchange and correlation (xc). The list of XC functionals is given below. Positive values are for ABINIT native library of XC functionals, while negative values are for calling the much wider set of @@ -10270,19 +11078,20 @@ * 456 --> XC_HYB_GGA_XC_PBE0_13 PBE0-1/3 [[cite:Cortona2012]] """, - ), - Variable( - abivarname="ixc_sigma", - varset="gw", - vartype="integer", - topics=["xc_expert", "Hybrids_expert"], - dimensions="scalar", - defaultval=1, - mnemonics="Index of eXchange-Correlation functional used for self-energy calculations (SIGMA)", - commentdefault="Default corresponds to Teter parametrization.", - requires="mod([[gwcalctyp]],10)==5", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="ixc_sigma", + varset="gw", + vartype="integer", + topics=["xc_expert", "Hybrids_expert"], + dimensions="scalar", + defaultval=1, + mnemonics="Index of eXchange-Correlation functional used for self-energy calculations (SIGMA)", + commentdefault="Default corresponds to Teter parametrization.", + requires="mod([[gwcalctyp]],10)==5", + added_in_version="before_v9", + text=r""" When [[gwcalctyp]] == 5, 15 or 25, [[ixc_sigma]] gives the identifier of the advanced functional (usually a hybrid) that is used perturbatively or self- consistently to obtain the improved electronic structure. @@ -10303,19 +11112,20 @@ [[hyb_mixing]], [[hyb_mixing_sr]], [[hyb_range_fock]] and [[hyb_range_dft]] to define the parameters of the hybrid functional. """, - ), - Variable( - abivarname="ixcpositron", - varset="gstate", - vartype="integer", - topics=["positron_basic"], - dimensions="scalar", - defaultval=1, - mnemonics="Integer for the eXchange-Correlation applied to the electron-POSITRON interaction", - commentdefault="(Teter parameterization). However, if all the pseudopotentials have the same value of pspxc, the initial value of ixc will be that common value", - requires="[[positron]]/=0", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="ixcpositron", + varset="gstate", + vartype="integer", + topics=["positron_basic"], + dimensions="scalar", + defaultval=1, + mnemonics="Integer for the eXchange-Correlation applied to the electron-POSITRON interaction", + commentdefault="(Teter parameterization). However, if all the pseudopotentials have the same value of pspxc, the initial value of ixc will be that common value", + requires="[[positron]]/=0", + added_in_version="before_v9", + text=r""" Relevant only when [[positron]]/=0. Define the type of electron-positron correlation that is used in case of a electron-positron two-component DFT calculation. @@ -10343,17 +11153,18 @@ * ixcpositron=3: Boronski and Nieminen full modelisation and RPA limit [[cite:Arponen1979a]], with GGA corrections * ixcpositron=31: Sterne and Kaiser [[cite:Boronski1986]], with GGA corrections """, - ), - Variable( - abivarname="ixcrot", - varset="dfpt", - vartype="integer", - topics=["DFPT_expert", "xc_expert"], - dimensions="scalar", - defaultval=1, - mnemonics="Index of the XC ROTation method used to calculate first-order exchange-correlation potential in non-collinear DFPT calculations", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="ixcrot", + varset="dfpt", + vartype="integer", + topics=["DFPT_expert", "xc_expert"], + dimensions="scalar", + defaultval=1, + mnemonics="Index of the XC ROTation method used to calculate first-order exchange-correlation potential in non-collinear DFPT calculations", + added_in_version="before_v9", + text=r""" Method of calculation of the 1st order XC potential in non-collinear DFPT calculations. The possible values 1,2 and 3 correspond to the following methods: @@ -10374,18 +11185,19 @@ For non-zero perturbation wavevector ([[qpt]]/=0), only the [[ixcrot]]=3 implementation is currently available. The code will stop with the default [[ixcrot]] value for non-zero perturbation wavevector. The user should then set [[ixcrot]]=3 and restart. """, - ), - Variable( - abivarname="jdtset", - varset="basic", - vartype="integer", - topics=["multidtset_basic"], - dimensions=["[[ndtset]]"], - defaultval=Range({"start": 1, "stop": "[[ndtset]]"}), - mnemonics="index -J- for DaTaSETs", - characteristics=["[[NO_MULTI]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="jdtset", + varset="basic", + vartype="integer", + topics=["multidtset_basic"], + dimensions=["[[ndtset]]"], + defaultval=Range({"start": 1, "stop": "[[ndtset]]"}), + mnemonics="index -J- for DaTaSETs", + characteristics=["[[NO_MULTI]]"], + added_in_version="before_v9", + text=r""" Gives the dataset index of each of the datasets. This index will be used: * to determine which input variables are specific to each dataset, since the variable names for this dataset will be made from the bare variable name concatenated with this index, and only if such a composite variable name does not exist, the code will consider the bare variable name, or even, the Default; @@ -10398,17 +11210,18 @@ name appended with a digit is allowed. This array might be initialized thanks to the use of the input variable [[udtset]]. In this case, [[jdtset]] cannot be used. """, - ), - Variable( - abivarname="jellslab", - varset="gstate", - vartype="integer", - topics=["Artificial_expert"], - dimensions="scalar", - defaultval=0, - mnemonics="include a JELLium SLAB in the cell", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="jellslab", + varset="gstate", + vartype="integer", + topics=["Artificial_expert"], + dimensions="scalar", + defaultval=0, + mnemonics="include a JELLium SLAB in the cell", + added_in_version="before_v9", + text=r""" If set to 1, a slab of uniform positive background charge density, that is, a jellium slab, is included in the calculation cell. A portion of the unit cell is filled with such positive charge density distribution which is equal to a @@ -10420,18 +11233,19 @@ [[slabwsrad]], while the position of the slab edges along z is defined through the input variables [[slabzbeg]] and [[slabzend]]. """, - ), - Variable( - abivarname="jfielddir", - varset="ffield", - vartype="integer", - topics=["Berry_basic"], - dimensions=[3], - defaultval=MultipleValue(number=3, value=0), - mnemonics="electric/displacement FIELD DIRection", - requires="[[berryopt]] = 17", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="jfielddir", + varset="ffield", + vartype="integer", + topics=["Berry_basic"], + dimensions=[3], + defaultval=MultipleValue(number=3, value=0), + mnemonics="electric/displacement FIELD DIRection", + requires="[[berryopt]] = 17", + added_in_version="before_v9", + text=r""" When specifying mixed electric field boundary conditions ( [[berryopt]] = 17), [[jfielddir]] controls whether reduced electric field ([[jfielddir]] = 1) or reduced electric displacement field ([[jfielddir]] = 2) is chosen to be fixed, in each @@ -10450,35 +11264,37 @@ ebar calculation ([[red_efieldbar]] = (0 0 0)), from the final results you will have $d_1$,$d_2$, these are good guesses for b, c. """, - ), - Variable( - abivarname="jpawu", - varset="paw", - vartype="real", - topics=["DFT+U_compulsory", "DMFT_compulsory", "DmftTriqsCthyb_compulsory"], - dimensions=["[[ntypat]]"], - defaultval=MultipleValue(number=None, value=0), - mnemonics="value of J for PAW+U", - characteristics=["[[ENERGY]]"], - requires="[[usepaw]] == 1 and [[usepawu]] > 0", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="jpawu", + varset="paw", + vartype="real", + topics=["DFT+U_compulsory", "DMFT_compulsory", "DmftTriqsCthyb_compulsory"], + dimensions=["[[ntypat]]"], + defaultval=MultipleValue(number=None, value=0), + mnemonics="value of J for PAW+U", + characteristics=["[[ENERGY]]"], + requires="[[usepaw]] == 1 and [[usepawu]] > 0", + added_in_version="before_v9", + text=r""" Gives the value of the screened exchange interaction between correlated electrons corresponding to [[lpawu]] for each species. In the case where [[lpawu]] =-1, the value is not used. """, - ), - Variable( - abivarname="kberry", - varset="ffield", - vartype="integer", - topics=["Berry_basic"], - dimensions=[3, "[[nberry]]"], - defaultval=MultipleValue(number=None, value=0), - mnemonics="K wavevectors for BERRY phase computation", - requires="[[berryopt]] = 1, 2, or 3", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="kberry", + varset="ffield", + vartype="integer", + topics=["Berry_basic"], + dimensions=[3, "[[nberry]]"], + defaultval=MultipleValue(number=None, value=0), + mnemonics="K wavevectors for BERRY phase computation", + requires="[[berryopt]] = 1, 2, or 3", + added_in_version="before_v9", + text=r""" Used for values of [[berryopt]] = 1, 2, or 3. This array defines, for each Berry phase calculation (the number of such @@ -10500,18 +11316,19 @@ converged wavefunctions in the entire Brillouin zone, by reading them to initialize the [[kptopt]] = 3 computation. """, - ), - Variable( - abivarname="kpt", - varset="basic", - vartype="real", - topics=["k-points_useful"], - dimensions=[3, "[[nkpt]]"], - defaultval=[0, 0, 0], - mnemonics="K - PoinTs", - commentdefault="Adequate for one molecule in a supercell", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="kpt", + varset="basic", + vartype="real", + topics=["k-points_useful"], + dimensions=[3, "[[nkpt]]"], + defaultval=[0, 0, 0], + mnemonics="K - PoinTs", + commentdefault="Adequate for one molecule in a supercell", + added_in_version="before_v9", + text=r""" Contains the k points in terms of reciprocal space primitive translations (NOT in cartesian coordinates!). Needed ONLY if [[kptopt]] = 0, otherwise deduced from other input variables. @@ -10533,17 +11350,18 @@ Note: a global shift can be provided by [[qptn]] Not read if [[kptopt]]/=0. """, - ), - Variable( - abivarname="kptbounds", - varset="gstate", - vartype="real", - topics=["k-points_useful", "ElecBandStructure_basic"], - dimensions=[3, "abs([[kptopt]])+1)"], - mnemonics="K PoinT BOUNDarieS", - characteristics=["[[INPUT_ONLY]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="kptbounds", + varset="gstate", + vartype="real", + topics=["k-points_useful", "ElecBandStructure_basic"], + dimensions=[3, "abs([[kptopt]])+1)"], + mnemonics="K PoinT BOUNDarieS", + characteristics=["[[INPUT_ONLY]]"], + added_in_version="before_v9", + text=r""" It is used to generate the circuit to be followed by the band structure, when [[kptopt]] is negative (it is not read if [[kptopt]] is zero or positive). @@ -10752,18 +11570,19 @@ $l$(L-Gamma)=$\sqrt{4/(a^2)+1/(c^2)}/3$ \n $l$(Gamma-X)=$2\sqrt{1/(a^2)+1/(c^2)}/3$ \n """, - ), - Variable( - abivarname="kptgw", - varset="gw", - vartype="real", - topics=["SelfEnergy_basic"], - dimensions=[3, "[[nkptgw]]"], - defaultval=MultipleValue(number=None, value=0.0), - mnemonics="K-PoinTs for GW calculations", - requires="[[optdriver]] in [4, 7]", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="kptgw", + varset="gw", + vartype="real", + topics=["SelfEnergy_basic"], + dimensions=[3, "[[nkptgw]]"], + defaultval=MultipleValue(number=None, value=0.0), + mnemonics="K-PoinTs for GW calculations", + requires="[[optdriver]] in [4, 7]", + added_in_version="before_v9", + text=r""" For each k-point with number igwpt in the range (1:[[nkptgw]]), [[kptgw]](1,igwpt) is the reduced coordinate of the k-point where the self-energy corrections are required while [[bdgw]] (1:2,igwpt) specifies the range of @@ -10773,17 +11592,18 @@ k-point grid defined with the same repetition parameters ( [[kptrlatt]], or [[ngkpt]] ) than the GS one, but **without** any shift, are allowed. """, - ), - Variable( - abivarname="kptnrm", - varset="basic", - vartype="real", - topics=["k-points_useful"], - dimensions="scalar", - defaultval=1, - mnemonics="K - PoinTs NoRMalization", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="kptnrm", + varset="basic", + vartype="real", + topics=["k-points_useful"], + dimensions="scalar", + defaultval=1, + mnemonics="K - PoinTs NoRMalization", + added_in_version="before_v9", + text=r""" Establishes a normalizing denominator for each k point. Needed only if [[kptopt]]<=0, otherwise deduced from other input variables. The k point coordinates as fractions of reciprocal lattice translations are @@ -10791,17 +11611,18 @@ ignored by the user. It is introduced to avoid the need for many digits in representing numbers such as 1/3. It cannot be smaller than 1.0 """, - ), - Variable( - abivarname="kptns", - varset="internal", - vartype="real", - topics=["k-points_internal"], - dimensions=[3, "[[nkpt]]"], - mnemonics="K-PoinTs re-Normalized and Shifted", - characteristics=["[[INTERNAL_ONLY]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="kptns", + varset="internal", + vartype="real", + topics=["k-points_internal"], + dimensions=[3, "[[nkpt]]"], + mnemonics="K-PoinTs re-Normalized and Shifted", + characteristics=["[[INTERNAL_ONLY]]"], + added_in_version="before_v9", + text=r""" If [[nqpt]] = 0, or if one is doing a response calculation, this internal variable is derived from [[kpt]] and [[kptnrm]]: [[kptns]](1:3,:)= [[kpt]](1:3,:)/ [[kptnrm]], so that it is [[kpt]] renormalized by [[kptnrm]]. @@ -10811,31 +11632,33 @@ [[kpt]](1:3,:)/ [[kptnrm]]+ [[qptn]](1:3), so that it is [[kpt]] renormalized by [[kptnrm]], then shifted by [[qptn]](1:3). """, - ), - Variable( - abivarname="kptns_hf", - varset="internal", - vartype="real", - topics=["k-points_internal"], - dimensions=[3, "[[nkpthf]]"], - mnemonics="K-PoinTs re-Normalized and Shifted, for the Hartree-Fock operator", - characteristics=["[[INTERNAL_ONLY]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="kptns_hf", + varset="internal", + vartype="real", + topics=["k-points_internal"], + dimensions=[3, "[[nkpthf]]"], + mnemonics="K-PoinTs re-Normalized and Shifted, for the Hartree-Fock operator", + characteristics=["[[INTERNAL_ONLY]]"], + added_in_version="before_v9", + text=r""" [[kptns_hf]] is the subset of the full Brillouin Zone k point grid for wavefunctions, used to build the Fock operator, see [[fockdownsampling]]. """, - ), - Variable( - abivarname="kptopt", - varset="basic", - vartype="integer", - topics=["k-points_basic", "ElecBandStructure_basic"], - dimensions="scalar", - defaultval=ValueWithConditions({"[[nspden]] == 4": 4, "defaultval": 1}), - mnemonics="KPoinTs OPTion", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="kptopt", + varset="basic", + vartype="integer", + topics=["k-points_basic", "ElecBandStructure_basic"], + dimensions="scalar", + defaultval=ValueWithConditions({"[[nspden]] == 4": 4, "defaultval": 1}), + mnemonics="KPoinTs OPTion", + added_in_version="before_v9", + text=r""" Controls the set up of the k-points list. The aim will be to initialize, by straight reading or by a preprocessing approach based on other input variables, the following input variables, giving the k points, their number, @@ -10877,18 +11700,19 @@ In the case of a grid of k points, the auxiliary variables [[kptrlen]], [[ngkpt]] and [[prtkpt]] might help you to select the optimal grid. """, - ), - Variable( - abivarname="kptrlatt", - varset="gstate", - vartype="integer", - topics=["k-points_useful"], - dimensions=[3, 3], - defaultval=MultipleValue(number=None, value=0), - mnemonics="K - PoinTs grid: Real space LATTice", - excludes="[[ngkpt]]", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="kptrlatt", + varset="gstate", + vartype="integer", + topics=["k-points_useful"], + dimensions=[3, 3], + defaultval=MultipleValue(number=None, value=0), + mnemonics="K - PoinTs grid: Real space LATTice", + excludes="[[ngkpt]]", + added_in_version="before_v9", + text=r""" This input variable is used only when [[kptopt]] is positive. It partially defines the k point grid. The other piece of information is contained in [[shiftk]]. [[kptrlatt]] cannot be used together with [[ngkpt]]. @@ -10903,17 +11727,18 @@ [[kptrlatt]] and [[shiftk]] that allows one to reach a sufficient value of [[kptrlen]]. See this latter variable for a complete description of this procedure. """, - ), - Variable( - abivarname="kptrlen", - varset="gstate", - vartype="real", - topics=["k-points_useful"], - dimensions="scalar", - defaultval=30.0, - mnemonics="K - PoinTs grid: Real space LENgth", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="kptrlen", + varset="gstate", + vartype="real", + topics=["k-points_useful"], + dimensions="scalar", + defaultval=30.0, + mnemonics="K - PoinTs grid: Real space LENgth", + added_in_version="before_v9", + text=r""" This input variable is used only when [[kptopt]] is positive and non-zero. Preliminary explanation: @@ -10947,17 +11772,18 @@ dimensional k point grid will be generated. For a cluster, this procedure will only generate the Gamma point. """, - ), - Variable( - abivarname="kssform", - varset="files", - vartype="integer", - topics=["Susceptibility_expert", "SelfEnergy_expert"], - dimensions="scalar", - defaultval=1, - mnemonics="Kohn Sham Structure file FORMat", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="kssform", + varset="files", + vartype="integer", + topics=["Susceptibility_expert", "SelfEnergy_expert"], + dimensions="scalar", + defaultval=1, + mnemonics="Kohn Sham Structure file FORMat", + added_in_version="before_v9", + text=r""" Governs the choice of the format for the file that contains the Kohn-Sham electronic structure information, for use in GW calculations, see the input variables [[optdriver]] and [[nbandkss]]. @@ -10969,17 +11795,18 @@ For the time being, [[istwfk]] must be 1 for all the k-points. """, - ), - Variable( - abivarname="lambsig", - varset="paw", - vartype="real", - topics=["NMR_basic", "MagField_expert"], - dimensions=["[[ntypat]]"], - defaultval=MultipleValue(number=None, value=0), - mnemonics="LAMB shielding SIGma", - added_in_version="v9", - text=r""" +), + +Variable( + abivarname="lambsig", + varset="paw", + vartype="real", + topics=["NMR_basic","MagField_expert"], + dimensions=["[[ntypat]]"], + defaultval=MultipleValue(number=None, value=0), + mnemonics="LAMB shielding SIGma", + added_in_version="v9", + text=r""" Chemical shielding at each nucleus due to the core electrons. This quantity is input as an array of values, one for each type, see [[ntypat]]. In calculations where the orbital magnetic moment is requested in the presence of a nuclear magnetic @@ -10989,48 +11816,52 @@ The value to be used here can be obtained from the PAW core wavefunctions and the Lamb formula [[cite:Abragam1961]]. """, - ), - Variable( - abivarname="ldaminushalf", - varset="paw", - vartype="integer", - topics=["LDAminushalf_compulsory"], - dimensions=["[[ntypat]]"], - defaultval=MultipleValue(number=None, value=0), - mnemonics="LDA minus half", - added_in_version="before_v9", - text=r""" +), + + +Variable( + abivarname="ldaminushalf", + varset="paw", + vartype="integer", + topics=["LDAminushalf_compulsory"], + dimensions=["[[ntypat]]"], + defaultval=MultipleValue(number=None, value=0), + mnemonics="LDA minus half", + added_in_version="before_v9", + text=r""" For each type of atom, gives whether a LDA-${\frac{1}{2}}$ calculation is to be performed. **ldaminushalf** =0: the LDA-$\frac{1}{2}$ approach is not used. **ldaminushalf** =1: the LDA-$\frac{1}{2}$ approach is used. """, - ), - Variable( - abivarname="lexexch", - varset="paw", - vartype="integer", - topics=["xc_useful"], - dimensions=["[[ntypat]]"], - defaultval=-1, - mnemonics="value of angular momentum L for EXact EXCHange", - requires="[[useexexch]] == 1", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="lexexch", + varset="paw", + vartype="integer", + topics=["xc_useful"], + dimensions=["[[ntypat]]"], + defaultval=-1, + mnemonics="value of angular momentum L for EXact EXCHange", + requires="[[useexexch]] == 1", + added_in_version="before_v9", + text=r""" Give for each species the value of the angular momentum on which to apply the exact exchange correction. """, - ), - Variable( - abivarname="localrdwf", - varset="paral", - vartype="integer", - topics=["parallelism_expert"], - dimensions="scalar", - defaultval=1, - mnemonics="LOCAL ReaD WaveFunctions", - characteristics=["[[DEVELOP]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="localrdwf", + varset="paral", + vartype="integer", + topics=["parallelism_expert"], + dimensions="scalar", + defaultval=1, + mnemonics="LOCAL ReaD WaveFunctions", + characteristics=["[[DEVELOP]]"], + added_in_version="before_v9", + text=r""" This input variable is used only when running abinit in parallel. If [[localrdwf]] = 1, the input wavefunction disk file or the KSS/SCR file in case of GW calculations, is read locally by each processor, while if @@ -11048,94 +11879,100 @@ machine, the input wavefunction file must be available on all nodes if [[localrdwf]] = 1, while it is needed only for the master node if [[localrdwf]] = 0. """, - ), - Variable( - abivarname="lotf_classic", - varset="dev", - vartype="integer", - topics=["LOTF_expert"], - dimensions="scalar", - defaultval=5, - mnemonics="LOTF CLASSIC model for glue model", - characteristics=["[[DEVELOP]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="lotf_classic", + varset="dev", + vartype="integer", + topics=["LOTF_expert"], + dimensions="scalar", + defaultval=5, + mnemonics="LOTF CLASSIC model for glue model", + characteristics=["[[DEVELOP]]"], + added_in_version="before_v9", + text=r""" Glue model used in LOTF. For the moment it is imposed to be 5. """, - ), - Variable( - abivarname="lotf_nitex", - varset="dev", - vartype="integer", - topics=["LOTF_expert"], - dimensions="scalar", - defaultval=10, - mnemonics="LOTF Number of ITerations", - characteristics=["[[DEVELOP]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="lotf_nitex", + varset="dev", + vartype="integer", + topics=["LOTF_expert"], + dimensions="scalar", + defaultval=10, + mnemonics="LOTF Number of ITerations", + characteristics=["[[DEVELOP]]"], + added_in_version="before_v9", + text=r""" Set the number of Molecular Dynamics iterations which are computed by LOTF. """, - ), - Variable( - abivarname="lotf_nneigx", - varset="dev", - vartype="integer", - topics=["LOTF_expert"], - dimensions="scalar", - defaultval=5, - mnemonics="LOTF max Number of NEIGhbours", - characteristics=["[[DEVELOP]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="lotf_nneigx", + varset="dev", + vartype="integer", + topics=["LOTF_expert"], + dimensions="scalar", + defaultval=5, + mnemonics="LOTF max Number of NEIGhbours", + characteristics=["[[DEVELOP]]"], + added_in_version="before_v9", + text=r""" Set the max number of Neighbours used in the LOTF method. For the moment it is imposed to be 40. """, - ), - Variable( - abivarname="lotf_version", - varset="dev", - vartype="integer", - topics=["LOTF_expert"], - dimensions="scalar", - defaultval=2, - mnemonics="LOTF VERSION of MD algorithm", - characteristics=["[[DEVELOP]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="lotf_version", + varset="dev", + vartype="integer", + topics=["LOTF_expert"], + dimensions="scalar", + defaultval=2, + mnemonics="LOTF VERSION of MD algorithm", + characteristics=["[[DEVELOP]]"], + added_in_version="before_v9", + text=r""" Set the MD algorithm in the LOTF method. For the moment it is imposed to be 2. """, - ), - Variable( - abivarname="lpawu", - varset="paw", - vartype="integer", - topics=["DFT+U_compulsory", "DMFT_compulsory", "DmftTriqsCthyb_compulsory"], - dimensions=["[[ntypat]]"], - defaultval=MultipleValue(number=None, value=-1), - mnemonics="value of angular momentum L for PAW+U", - requires="[[usepawu]] == 1 or 2", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="lpawu", + varset="paw", + vartype="integer", + topics=["DFT+U_compulsory", "DMFT_compulsory", "DmftTriqsCthyb_compulsory"], + dimensions=["[[ntypat]]"], + defaultval=MultipleValue(number=None, value=-1), + mnemonics="value of angular momentum L for PAW+U", + requires="[[usepawu]] == 1 or 2", + added_in_version="before_v9", + text=r""" Give for each species the value of the angular momentum on which to apply the DFT+U/DFT+DMFT correction. * If equal to 0 (s-orbitals), 1 (p-orbitals), 2 (d-orbitals) or 3 (f-orbitals), values of [[upawu]] and [[jpawu]] are used in the calculation. * If equal to -1: do not apply DFT+U/DFT+DMFT correction on the species. """, - ), - Variable( - abivarname="lw_flexo", - varset="dfpt", - vartype="integer", - topics=["longwave_compulsory"], - dimensions="scalar", - defaultval=0, - mnemonics="LongWave calculation of FLEXOelectricity related spatial dispersion tensors", - requires="[[optdriver]] = 10", - characteristics=["[[DEVELOP]]"], - added_in_version="v9", - text=r""" +), + +Variable( + abivarname="lw_flexo", + varset="dfpt", + vartype="integer", + topics=["longwave_compulsory"], + dimensions="scalar", + defaultval=0, + mnemonics="LongWave calculation of FLEXOelectricity related spatial dispersion tensors", + requires="[[optdriver]] = 10", + characteristics=["[[DEVELOP]]"], + added_in_version="v9", + text=r""" Used to run the calculation of spatial dispersion tensorial quantities needed to build the bulk flexoelectric tensor (the clamped-ion flexoelectric tensor is directly calculated by abinit whereas the mixed and lattice-mediated ones are obtained through a postprocessing anaddb calculation, @@ -11165,19 +12002,20 @@ Requires precomputed linear response functions and densities: ddk, atomic displacement and strain. """, - ), - Variable( - abivarname="lw_natopt", - varset="dfpt", - vartype="integer", - topics=["longwave_compulsory"], - dimensions="scalar", - defaultval=0, - mnemonics="LongWave calculation of NATural OPTical activity tensor", - requires="[[optdriver]] = 10", - characteristics=["[[DEVELOP]]"], - added_in_version="v9", - text=r""" +), + +Variable( + abivarname="lw_natopt", + varset="dfpt", + vartype="integer", + topics=["longwave_compulsory"], + dimensions="scalar", + defaultval=0, + mnemonics="LongWave calculation of NATural OPTical activity tensor", + requires="[[optdriver]] = 10", + characteristics=["[[DEVELOP]]"], + added_in_version="v9", + text=r""" Used to run natural optical activity tensor calculation. * 0 --> No natural optical activity tensor is calculated. @@ -11189,19 +12027,20 @@ to be explicitly precomputed can be reduced via symmetry arguments selecting the appropriate value of the [[prepalw]] variable. """, - ), - Variable( - abivarname="lw_qdrpl", - varset="dfpt", - vartype="integer", - topics=["longwave_compulsory"], - dimensions="scalar", - defaultval=0, - mnemonics="LongWave calculation of dynamical QuaDRuPoLes tensor", - requires="[[optdriver]] = 10", - characteristics=["[[DEVELOP]]"], - added_in_version="v9", - text=r""" +), + +Variable( + abivarname="lw_qdrpl", + varset="dfpt", + vartype="integer", + topics=["longwave_compulsory"], + dimensions="scalar", + defaultval=0, + mnemonics="LongWave calculation of dynamical QuaDRuPoLes tensor", + requires="[[optdriver]] = 10", + characteristics=["[[DEVELOP]]"], + added_in_version="v9", + text=r""" Used to run dynamical quadrupoles tensor calculation (e.g., needed to include dipole-quadrupole and/or quadrupole-quadrupole electrostatic interactions in the anaddb calculation of phonons. See [[dipquad@anaddb]] and [[quadquad@anaddb]]). @@ -11217,18 +12056,20 @@ to be explicitly precomputed can be reduced via symmetry arguments selecting the appropriate value of the [[prepalw]] variable. """, - ), - Variable( - abivarname="macro_uj", - varset="dev", - vartype="integer", - topics=["DFT+U_expert"], - dimensions="scalar", - defaultval=0, - mnemonics="MACRO variable that activates the determination of the U and J parameter (for the PAW+U calculations)", - characteristics=["[[DEVELOP]]"], - added_in_version="before_v9", - text=r""" +), + + +Variable( + abivarname="macro_uj", + varset="dev", + vartype="integer", + topics=["DFT+U_expert"], + dimensions="scalar", + defaultval=0, + mnemonics="MACRO variable that activates the determination of the U and J parameter (for the PAW+U calculations)", + characteristics=["[[DEVELOP]]"], + added_in_version="before_v9", + text=r""" Sets proper input values for the determination of U and J i.e. for [[pawujat]] (first atom treated with PAW+U), [[irdwfk]] (=1), [[tolvrs]] (=10^(-8)), [[nstep]] (=255), [[diemix]] (=0.45), [[atvshift]] ([[pawujat]]) [[pawujv]]). @@ -11245,17 +12086,18 @@ concerned atom as a separate atomic species or shift concerned atom from ideal position). """, - ), - Variable( - abivarname="magcon_lambda", - varset="gstate", - vartype="real", - topics=["MagMom_useful"], - dimensions="scalar", - defaultval=0.01, - mnemonics="MAGnetization CONstraint LAMBDA parameter", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="magcon_lambda", + varset="gstate", + vartype="real", + topics=["MagMom_useful"], + dimensions="scalar", + defaultval=0.01, + mnemonics="MAGnetization CONstraint LAMBDA parameter", + added_in_version="before_v9", + text=r""" This variable gives the amplitude of the penalty function imposed on the magnetization vectors on each atom (turned on with flag variable [[magconon]]=1 to 3). Typical values for [[magcon_lambda]] are 0.001 to 0.1. The SCF convergence @@ -11265,17 +12107,18 @@ to start with a small value of [[magcon_lambda]] and to increase it by reading the wavefunction obtained with a lower [[magcon_lambda]] value. See variable [[magconon]] for more details. """, - ), - Variable( - abivarname="magconon", - varset="gstate", - vartype="integer", - topics=["MagMom_useful"], - dimensions="scalar", - defaultval=0, - mnemonics="turn MAGnetization CONstraint ON", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="magconon", + varset="gstate", + vartype="integer", + topics=["MagMom_useful"], + dimensions="scalar", + defaultval=0, + mnemonics="turn MAGnetization CONstraint ON", + added_in_version="before_v9", + text=r""" Turns on the imposition of a constraint on the magnetization, using a penalty function. For each atom, the magnetization is calculated in a sphere (radius [[ratsph]]) and a penalty function is applied to bring it to the input values of [[spinat]]. @@ -11292,97 +12135,127 @@ while if [[nspden]]==4, then the axis of magnetization is constraint (the actual direction is not imposed, both directions are equivalent). This might be confusing. """, - ), - Variable( - abivarname="max_ncpus", - varset="paral", - vartype="integer", - topics=["parallelism_useful"], - dimensions="scalar", - defaultval=0, - mnemonics="MAXimum Number of CPUS", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="magpen", + varset="dfpt", + vartype="real", + topics=["DFPT_expert", "ConstrainedDFPT_expert"], + dimensions="scalar", + defaultval=0.0, + mnemonics="MAGnetic PENalty DFPT parameter", + characteristics=["[[DEVELOP]]"], + added_in_version="10.4", + text=r""" +This variable sets the amplitude of the penalty function applied to the first-order local magnetic moments in a constrained DFPT +calculation (see Ref. [[cite:Royo2019]]). Larger values of [[magpen]] shift the spin-wave excitations that hinder self-consistent +convergence to higher energies. However, the magnitude of this shift is limited by a material-dependent threshold associated with +the onset of cross-gap electronic excitations. Using values of [[magpen]] beyond this limit may be inefficient, as they can introduce +numerical instabilities. Typical values for insulators such as CrI$_3$ or Cr$_2$O$_3$ are on the order of 0.05. The factor-of-four +difference with respect to the values reported in Ref. [[cite:Royo2019]] arises from a different criterion used to define the magnetic moments. + +The size and boundary shape of the atomic spheres wherein the magnetic penalty is applied are specified by [[ratsph]] and [[ratsm]]. +The penalized ions and directions are specified by [[mpatpol]] and [[mpdir]], respectively. +""", +), + + +Variable( + abivarname="max_ncpus", + varset="paral", + vartype="integer", + topics=["parallelism_useful"], + dimensions="scalar", + defaultval=0, + mnemonics="MAXimum Number of CPUS", + added_in_version="before_v9", + text=r""" If [[autoparal]] > 1 and [[max_ncpus]] is greater than 0, ABINIT analyzes the efficiency of the process distribution for each possible number of processors from 2 to [[max_ncpus]]. After having printed out the efficiency, the code stops. """, - ), - Variable( - abivarname="maxestep", - varset="ffield", - vartype="real", - topics=["Berry_useful"], - dimensions="scalar", - defaultval=0.005, - mnemonics="MAXimum Electric field STEP", - requires="[[berryopt]] = 6, 16, or 17", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="maxestep", + varset="ffield", + vartype="real", + topics=["Berry_useful"], + dimensions="scalar", + defaultval=0.005, + mnemonics="MAXimum Electric field STEP", + requires="[[berryopt]] = 6, 16, or 17", + added_in_version="before_v9", + text=r""" This variable controls the maximum change of electric field when updating the electric field after each SCF iteration. When the calculation is difficult to converge, try reducing this value or reducing [[ddamp]]. This variable is used in finite electric displacement field calculations ([[berryopt]] = 6,16,17). """, - ), - Variable( - abivarname="maxnsym", - varset="dev", - vartype="integer", - topics=["crystal_expert"], - dimensions="scalar", - defaultval=384, - mnemonics="MAXimum Number of SYMetries", - characteristics=["[[DEVELOP]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="maxnsym", + varset="dev", + vartype="integer", + topics=["crystal_expert"], + dimensions="scalar", + defaultval=384, + mnemonics="MAXimum Number of SYMetries", + characteristics=["[[DEVELOP]]"], + added_in_version="before_v9", + text=r""" Gives the maximum number of spatial symmetries allowed in the memory. The default value is sufficient for most applications. It might have to be increased in the case of the use of a supercell (unit cell identically repeated). """, - ), - Variable( - abivarname="mband", - varset="internal", - vartype="integer", - topics=["BandOcc_internal"], - dimensions="scalar", - mnemonics="Maximum number of BANDs", - characteristics=["[[INTERNAL_ONLY]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="mband", + varset="internal", + vartype="integer", + topics=["BandOcc_internal"], + dimensions="scalar", + mnemonics="Maximum number of BANDs", + characteristics=["[[INTERNAL_ONLY]]"], + added_in_version="before_v9", + text=r""" This internal variable derives the maximum number of bands over all k-points and spin-polarisation from [[nband]](1:nkpt*nsppol). """, - ), - Variable( - abivarname="mbpt_sciss", - varset="gw", - vartype="real", - topics=["GW_useful", "Susceptibility_useful", "SelfEnergy_useful", "ElPhonInt_expert"], - dimensions="scalar", - defaultval=0.0, - mnemonics="Many Body Perturbation Theory SCISSor operator", - characteristics=["[[ENERGY]]"], - requires="[[optdriver]] in [3,4,7,99]", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="mbpt_sciss", + varset="gw", + vartype="real", + topics=["GW_useful", "Susceptibility_useful", "SelfEnergy_useful", "ElPhonInt_expert"], + dimensions="scalar", + defaultval=0.0, + mnemonics="Many Body Perturbation Theory SCISSor operator", + characteristics=["[[ENERGY]]"], + requires="[[optdriver]] in [3,4,7,99]", + added_in_version="before_v9", + text=r""" The scissor operator energy added to the conductions states [[cite:Levine1989]]. In some cases, it mimics a second iteration self-consistent GW calculation. """, - ), - Variable( - abivarname="mdeg_filter", - varset="gstate", - vartype="integer", - topics=["SCFControl_expert"], - dimensions="scalar", - defaultval=ValueWithConditions({"[[wfoptalg]] == 1 or 111 ": 6, "defaultval": 6}), - mnemonics="Maximum DEGree of the polynomial for spectrum FILTERing algorithms", - commentdefault="6 for chebyshev filtering algorithm", - added_in_version="v10", - text=r""" +), + +Variable( + abivarname="mdeg_filter", + varset="gstate", + vartype="integer", + topics=["SCFControl_expert"], + dimensions="scalar", + defaultval=ValueWithConditions({"[[wfoptalg]] == 1 or 111 ": 6, "defaultval": 6}), + mnemonics="Maximum DEGree of the polynomial for spectrum FILTERing algorithms", + commentdefault="6 for chebyshev filtering algorithm", + added_in_version="v10", + text=r""" For spectrum-filtering based algorithms (e.g. Chebyshev filtering ([[wfoptalg]]=1 or 11) or spectrum slicing ([[wfoptalg]]=TODO). The parameter [[mdeg_filter]] defines the maximum degree of the Chebyshev polynomial used in spectrum-filtering algorithms, such as Chebyshev filtering or spectrum slicing. These algorithms are employed to optimize the wavefunctions during the self-consistent cycle. Increasing the degree improves the effectiveness of the filtering, reducing the number of self-consistent iterations required. However, a high polynomial degree is computationally expensive. Conversely, using a degree that is too low (e.g., <5) often leads to inefficient convergence or even incorrect results. @@ -11398,34 +12271,36 @@ > > * Previously, [[nline]] was used to adjust the degree of the filtering polynomial. In the absence of [[mdeg_filter]], the value of [[nline]], if specified, is still used.” """, - ), - Variable( - abivarname="mdf_epsinf", - varset="gw", - vartype="real", - topics=["BSE_useful"], - dimensions="scalar", - defaultval=0.0, - mnemonics="Model Dielectric Function, EPSilon INFinity", - requires="[[optdriver]] == 99 and [[bs_coulomb_term]] in [20,21] (Bethe-Salpeter calculations with a model dielectric function", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="mdf_epsinf", + varset="gw", + vartype="real", + topics=["BSE_useful"], + dimensions="scalar", + defaultval=0.0, + mnemonics="Model Dielectric Function, EPSilon INFinity", + requires="[[optdriver]] == 99 and [[bs_coulomb_term]] in [20,21] (Bethe-Salpeter calculations with a model dielectric function", + added_in_version="before_v9", + text=r""" [[mdf_epsinf]] specifies the value of the macroscopic dielectric function used to model the screening function (see [[cite:Bechstedt1992]]). The proper spatial symmetry of the screening $W(\mathbf{r},\mathbf{r}^\prime)$ is enforced using Eq. (7) of [[cite:VonDerLinden1988]]. """, - ), - Variable( - abivarname="mdtemp", - varset="rlx", - vartype="real", - topics=["PIMD_compulsory", "MolecularDynamics_compulsory"], - dimensions=[2], - defaultval=[300, 300], - mnemonics="Molecular Dynamics TEMPeratures", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="mdtemp", + varset="rlx", + vartype="real", + topics=["PIMD_compulsory", "MolecularDynamics_compulsory"], + dimensions=[2], + defaultval=[300, 300], + mnemonics="Molecular Dynamics TEMPeratures", + added_in_version="before_v9", + text=r""" Give the initial and final temperature of the Nose-Hoover thermostat [[moldyn]] = "nvt_nose" ([[ionmov]] = 8), Langevin dynamics [[moldyn]] = "nvt_langevin" ([[ionmov]] = 16), Martyna thermostats [[moldyn]] = "npt_martyna" or "nst_martyna" ([[ionmov]] = 13), in Kelvin. This @@ -11437,18 +12312,19 @@ However **mdtemp(2)** is not used (even if it must be defined to please the parser). If some velocities are non-zero, **mdtemp** is not used, the kinetic energy computed from the velocities is kept constant during the run. """, - ), - Variable( - abivarname="mdwall", - varset="rlx", - vartype="real", - topics=["MolecularDynamics_expert"], - dimensions="scalar", - defaultval=10000.0, - mnemonics="Molecular Dynamics WALL location", - commentdefault="the walls are extremely far away", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="mdwall", + varset="rlx", + vartype="real", + topics=["MolecularDynamics_expert"], + dimensions="scalar", + defaultval=10000.0, + mnemonics="Molecular Dynamics WALL location", + commentdefault="the walls are extremely far away", + added_in_version="before_v9", + text=r""" Gives the location (atomic units) of walls on which the atoms will bounce back when [[geoopt]] = "quenched" or [[moldyn]] = "nve_verlet" (also when [[ionmov]] = 6, 7, 8 or 9). For each cartesian direction idir=1, 2 or 3, there is a pair of walls with coordinates xcart(idir)=-wall and @@ -11457,36 +12333,38 @@ By default, given in Bohr atomic units (1 Bohr=0.5291772108 Angstroms), although Angstrom can be specified, if preferred, since [[mdwall]] has the [[LENGTH]] characteristics. """, - ), - Variable( - abivarname="mem_test", - varset="dev", - vartype="integer", - topics=["Control_expert"], - dimensions="scalar", - defaultval=1, - mnemonics="MEMory TEST", - characteristics=["[[DEVELOP]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="mem_test", + varset="dev", + vartype="integer", + topics=["Control_expert"], + dimensions="scalar", + defaultval=1, + mnemonics="MEMory TEST", + characteristics=["[[DEVELOP]]"], + added_in_version="before_v9", + text=r""" This variable controls the memory test done in the `memana` routine. Possible values: * 0 no test on the available memory is performed * 1 the routine tries to allocate the estimated memory, for testing purposes, and if a failure occurs, the routine stops. * 2 like 1, but before stopping, the routine will provide an estimation of the available memory. """, - ), - Variable( - abivarname="mep_mxstep", - varset="rlx", - vartype="real", - topics=["TransPath_useful"], - dimensions="scalar", - defaultval=ValueWithConditions({"[[imgmov]] == 5": 0.4, "defaultval": 100.0}), - mnemonics="Minimal Energy Path search: MaXimum allowed STEP size", - characteristics=["[[LENGTH]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="mep_mxstep", + varset="rlx", + vartype="real", + topics=["TransPath_useful"], + dimensions="scalar", + defaultval=ValueWithConditions({"[[imgmov]] == 5": 0.4, "defaultval": 100.0}), + mnemonics="Minimal Energy Path search: MaXimum allowed STEP size", + characteristics=["[[LENGTH]]"], + added_in_version="before_v9", + text=r""" Relevant only when [[imgmov]] = 1 (Steepest-Descent), 2 (String Method) or 5 (Nudged Elastic Band). The optimizer used to solve the Ordinary Differential Equation (ODE) can be @@ -11496,16 +12374,17 @@ Note that the step size is defined for each image as _step = SQRT[SUM(R_i dot R_i)]_ where the _R_i_ are the positions of the atoms in the cell. """, - ), - Variable( - abivarname="mep_solver", - varset="rlx", - vartype="integer", - topics=["TransPath_basic"], - dimensions="scalar", - mnemonics="Minimal Energy Path ordinary differential equation SOLVER", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="mep_solver", + varset="rlx", + vartype="integer", + topics=["TransPath_basic"], + dimensions="scalar", + mnemonics="Minimal Energy Path ordinary differential equation SOLVER", + added_in_version="before_v9", + text=r""" Relevant only when [[imgmov]] = 2 (String Method) or 5 (Nudged Elastic Band). Gives the algorithm used to solve the Ordinary Differential Equation (ODE) when searching for a Minimal Energy Path (MEP). @@ -11537,18 +12416,19 @@ each image; see [[mep_mxstep]]. This is by default the case of the Nudged Elastic Band ([[imgmov]] = 5). """, - ), - Variable( - abivarname="mixprec", - varset="dev", - vartype="integer", - topics=["TuningSpeedMem_useful"], - dimensions="scalar", - defaultval=0, - mnemonics="MIXed PRECision", - characteristics=["[[DEVELOP]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="mixprec", + varset="dev", + vartype="integer", + topics=["TuningSpeedMem_useful"], + dimensions="scalar", + defaultval=0, + mnemonics="MIXed PRECision", + characteristics=["[[DEVELOP]]"], + added_in_version="before_v9", + text=r""" This variable activates FFT transforms in single precision. The code thus works in mixed-precision mode in the sense that all the high-level operations are done in double-precision while the FFT of wavefunctions, densities and potentials @@ -11561,43 +12441,46 @@ At present ( |today| ), only selected kernels support mixed-precision, in particular MPI-FFTs in mixed precision **are not yet supported**. """, - ), - Variable( - abivarname="mgfft", - varset="internal", - vartype="integer", - topics=["Planewaves_internal"], - dimensions="scalar", - mnemonics="Maximum of nGFFT", - characteristics=["[[INTERNAL_ONLY]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="mgfft", + varset="internal", + vartype="integer", + topics=["Planewaves_internal"], + dimensions="scalar", + mnemonics="Maximum of nGFFT", + characteristics=["[[INTERNAL_ONLY]]"], + added_in_version="before_v9", + text=r""" This internal variable contains the maximum of [[ngfft]](1:3). """, - ), - Variable( - abivarname="mgfftdg", - varset="internal", - vartype="integer", - topics=["Planewaves_internal"], - dimensions="scalar", - mnemonics="Maximum of nGFFT for the Double Grid", - characteristics=["[[INTERNAL_ONLY]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="mgfftdg", + varset="internal", + vartype="integer", + topics=["Planewaves_internal"], + dimensions="scalar", + mnemonics="Maximum of nGFFT for the Double Grid", + characteristics=["[[INTERNAL_ONLY]]"], + added_in_version="before_v9", + text=r""" This internal variable contains the maximum of [[ngfftdg]](1:3). """, - ), - Variable( - abivarname="mixalch", - varset="gstate", - vartype="real", - topics=["AtomTypes_useful"], - dimensions=["[[npspalch]]", "[[ntypalch]]"], - mnemonics="MIXing coefficients for ALCHemical potentials", - characteristics=["[[EVOLVING]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="mixalch", + varset="gstate", + vartype="real", + topics=["AtomTypes_useful"], + dimensions=["[[npspalch]]", "[[ntypalch]]"], + mnemonics="MIXing coefficients for ALCHemical potentials", + characteristics=["[[EVOLVING]]"], + added_in_version="before_v9", + text=r""" Used for the generation of alchemical pseudoatoms, that is, when [[ntypalch]] is non-zero. This array gives, for each type of alchemical pseudo-atom (there are @@ -11656,33 +12539,35 @@ this possibility: the value of [[ziontypat]] for the atoms that are mixed should be identical. """, - ), - Variable( - abivarname="mixesimgf", - varset="rlx", - vartype="real", - topics=["CrossingBarriers_useful"], - dimensions=["[[nimage]]"], - mnemonics="MIXing Electronic Structure IMAGE Factors", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="mixesimgf", + varset="rlx", + vartype="real", + topics=["CrossingBarriers_useful"], + dimensions=["[[nimage]]"], + mnemonics="MIXing Electronic Structure IMAGE Factors", + added_in_version="before_v9", + text=r""" Used in the algorithm Linear Combination of Constrained DFT Energies, that is, when [[imgmov]]==6. This array gives, for each one of the [[nimage]] images, the factor by which the total energies for systems with same geometry but different electronic structures (occupation numbers) are linearly combined. The sum of these factors must equal 1. """, - ), - Variable( - abivarname="moldyn", - varset="rlx", - vartype="string", - topics=["MolecularDynamics_compulsory"], - dimensions="scalar", - defaultval="none", - mnemonics="MOLecular DYNamics", - added_in_version="10.3", - text=r""" +), + +Variable( + abivarname="moldyn", + varset="rlx", + vartype="string", + topics=["MolecularDynamics_compulsory"], + dimensions="scalar", + defaultval="none", + mnemonics="MOLecular DYNamics", + added_in_version="10.3", + text=r""" Choice of algorithm for the molecular dynamics simulation, and possibly changes of cell shape and size (see [[optcell]]). * "none" --> Do not move ions (**default behaviour**) @@ -11758,145 +12643,191 @@ **Cell optimization:** No (Use [[optcell]] = 0 only) **Related variables:** time step [[dtion]] """, - ), - Variable( - abivarname="mpw", - varset="internal", - vartype="integer", - topics=["Planewaves_internal"], - dimensions="scalar", - mnemonics="Maximum number of Plane Waves", - characteristics=["[[INTERNAL_ONLY]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="mpatpol", + varset="dfpt", + vartype="integer", + topics=["DFPT_expert", "ConstrainedDFPT_expert"], + dimensions=[2], + defaultval=MultipleValue(number=1, value="[[natom]]"), + mnemonics="Magnetic Penalty: ATomic POLarisation", + characteristics=["[[DEVELOP]]"], + added_in_version="10.4", + text=r""" +This variable specifies the range of atoms to which a magnetic penalty is applied on the +first-order local magnetic moments. It may take values between 1 to [[natom]], with [[mpatpol]](1)<=[[mpatpol]](2). +In practice, the penalty is typically applied only to the magnetic ions. + +As a side technical information, the value [[mpatpol]](1)=-1 is admitted, and transformed +immediately to [[mpatpol]](1)=1, while [[mpatpol]](2)=-1 is transformed to [[mpatpol]](2)=[[natom]]. +""", +), + +Variable( + abivarname="mpdir", + varset="dfpt", + vartype="integer", + topics=["DFPT_expert", "ConstrainedDFPT_expert"], + dimensions=[3], + defaultval=[1, 1, 1], + mnemonics="Magnetic Penalty: DIRections", + characteristics=["[[DEVELOP]]"], + added_in_version="10.4", + text=r""" +Gives the Cartesian directions along which the first-order magnetic moments +are constrained during a linear-response calculatiuon when [[magpen]]/= 0.0. +""", +), + + +Variable( + abivarname="mpw", + varset="internal", + vartype="integer", + topics=["Planewaves_internal"], + dimensions="scalar", + mnemonics="Maximum number of Plane Waves", + characteristics=["[[INTERNAL_ONLY]]"], + added_in_version="before_v9", + text=r""" This internal variable gives the maximum of the number of plane waves over all k-points. It is computed from [[ecut]] and the description of the cell, provided by [[acell]], [[rprim]], and/or [[angdeg]]. """, - ), - Variable( - abivarname="mqgrid", - varset="dev", - vartype="integer", - topics=["Planewaves_expert"], - dimensions="scalar", - defaultval=3001, - mnemonics="Maximum number of Q-space GRID points for pseudopotentials", - characteristics=["[[DEVELOP]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="mqgrid", + varset="dev", + vartype="integer", + topics=["Planewaves_expert"], + dimensions="scalar", + defaultval=3001, + mnemonics="Maximum number of Q-space GRID points for pseudopotentials", + characteristics=["[[DEVELOP]]"], + added_in_version="before_v9", + text=r""" Govern the size of the one-dimensional information related to pseudopotentials, in reciprocal space: potentials, or projector functions. """, - ), - Variable( - abivarname="mqgriddg", - varset="paw", - vartype="integer", - topics=["PAW_expert"], - dimensions="scalar", - defaultval=3001, - mnemonics="Maximum number of Q-wavevectors for the 1-dimensional GRID for the Double Grid in PAW", - characteristics=["[[DEVELOP]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="mqgriddg", + varset="paw", + vartype="integer", + topics=["PAW_expert"], + dimensions="scalar", + defaultval=3001, + mnemonics="Maximum number of Q-wavevectors for the 1-dimensional GRID for the Double Grid in PAW", + characteristics=["[[DEVELOP]]"], + added_in_version="before_v9", + text=r""" Maximum number of wavevectors used to sample the local part of the potential, in PAW. Actually referred to as mqgrid_vl internally. Should change name to the latter. See also [[mqgrid]]. """, - ), - Variable( - abivarname="natcon", - varset="rlx", - vartype="integer", - topics=["GeoConstraints_useful"], - dimensions=["[[nconeq]]"], - defaultval=0, - mnemonics="Number of AToms in CONstraint equations", - characteristics=["[[NO_MULTI]]", "[[INPUT_ONLY]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="natcon", + varset="rlx", + vartype="integer", + topics=["GeoConstraints_useful"], + dimensions=["[[nconeq]]"], + defaultval=0, + mnemonics="Number of AToms in CONstraint equations", + characteristics=["[[NO_MULTI]]", "[[INPUT_ONLY]]"], + added_in_version="before_v9", + text=r""" Gives the number of atoms appearing in each of the [[nconeq]] independent equations constraining the motion of atoms during structural optimization or molecular dynamics (see [[nconeq]], [[iatcon]], and [[wtatcon]]). """, - ), - Variable( - abivarname="natfix", - varset="rlx", - vartype="integer", - topics=["GeoConstraints_basic"], - dimensions="scalar", - defaultval=0, - mnemonics="Number of Atoms that are FIXed", - characteristics=["[[INPUT_ONLY]]"], - commentdefault="(no atoms held fixed)", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="natfix", + varset="rlx", + vartype="integer", + topics=["GeoConstraints_basic"], + dimensions="scalar", + defaultval=0, + mnemonics="Number of Atoms that are FIXed", + characteristics=["[[INPUT_ONLY]]"], + commentdefault="(no atoms held fixed)", + added_in_version="before_v9", + text=r""" Gives the number of atoms (not to exceed [[natom]]) which are to be held fixed during a structural optimization or molecular dynamics. When [[natfix]] > 0, [[natfix]] entries should be provided in array [[iatfix]] . """, - ), - Variable( - abivarname="natfixx", - varset="rlx", - vartype="integer", - topics=["GeoConstraints_basic"], - dimensions="scalar", - defaultval=0, - mnemonics="Number of Atoms that are FIXed along the X direction", - characteristics=["[[INPUT_ONLY]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="natfixx", + varset="rlx", + vartype="integer", + topics=["GeoConstraints_basic"], + dimensions="scalar", + defaultval=0, + mnemonics="Number of Atoms that are FIXed along the X direction", + characteristics=["[[INPUT_ONLY]]"], + added_in_version="before_v9", + text=r""" Gives the number of atoms (not to exceed [[natom]]) which are to be held fixed along the X direction during a structural optimization or molecular dynamics. When [[natfixx]] > 0, [[natfixx]] entries should be provided in array [[iatfixx]]. """, - ), - Variable( - abivarname="natfixy", - varset="rlx", - vartype="integer", - topics=["GeoConstraints_basic"], - dimensions="scalar", - defaultval=0, - mnemonics="Number of Atoms that are FIXed along the Y direction", - characteristics=["[[INPUT_ONLY]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="natfixy", + varset="rlx", + vartype="integer", + topics=["GeoConstraints_basic"], + dimensions="scalar", + defaultval=0, + mnemonics="Number of Atoms that are FIXed along the Y direction", + characteristics=["[[INPUT_ONLY]]"], + added_in_version="before_v9", + text=r""" Gives the number of atoms (not to exceed [[natom]]) which are to be held fixed along the Y direction during a structural optimization or molecular dynamics. When [[natfixy]] > 0, [[natfixy]] entries should be provided in array [[iatfixy]] """, - ), - Variable( - abivarname="natfixz", - varset="rlx", - vartype="integer", - topics=["GeoConstraints_basic"], - dimensions="scalar", - defaultval=0, - mnemonics="Number of Atoms that are FIXed along the Z direction", - characteristics=["[[INPUT_ONLY]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="natfixz", + varset="rlx", + vartype="integer", + topics=["GeoConstraints_basic"], + dimensions="scalar", + defaultval=0, + mnemonics="Number of Atoms that are FIXed along the Z direction", + characteristics=["[[INPUT_ONLY]]"], + added_in_version="before_v9", + text=r""" Gives the number of atoms (not to exceed [[natom]]) which are to be held fixed along the Z direction during a structural optimization or molecular dynamics. When [[natfixz]] > 0, [[natfixz]] entries should be provided in array [[iatfixz]]. """, - ), - Variable( - abivarname="natnd", - varset="gstate", - vartype="integer", - topics=["NMR_basic", "MagField_expert"], - dimensions="scalar", - defaultval=0, - mnemonics="Number of AToms with Nuclear Dipole moment", - added_in_version="v10.5", - text=r""" +), + +Variable( + abivarname="natnd", + varset="gstate", + vartype="integer", + topics=["NMR_basic","MagField_expert"], + dimensions="scalar", + defaultval=0, + mnemonics="Number of AToms with Nuclear Dipole moment", + added_in_version="v10.5", + text=r""" Provides a simplified, alternative input to [[nucdipmom]] for the atoms carrying explicit nuclear dipole moments. The number of atoms in the cell with explicit nuclear dipoles is [[natnd]]; the list of the atoms is [[iatnd]]; and the components @@ -11904,17 +12835,19 @@ list is converted internally to the full [[nucdipmom]] list; either input format can be used. """, - ), - Variable( - abivarname="natom", - varset="basic", - vartype="integer", - topics=["crystal_basic", "SmartSymm_basic"], - dimensions="scalar", - defaultval=1, - mnemonics="Number of ATOMs", - added_in_version="before_v9", - text=r""" +), + + +Variable( + abivarname="natom", + varset="basic", + vartype="integer", + topics=["crystal_basic", "SmartSymm_basic"], + dimensions="scalar", + defaultval=1, + mnemonics="Number of ATOMs", + added_in_version="before_v9", + text=r""" Gives the total number of atoms in the unit cell. Default is 1 but you will obviously want to input this value explicitly. Note that [[natom]] refers to all atoms in the unit cell, not only to the @@ -11922,68 +12855,72 @@ allows one to recover all atoms). If you want to specify only the irreducible set of atoms, use the symmetriser, see the input variable [[natrd]]. """, - ), - Variable( - abivarname="natpawu", - varset="internal", - vartype="integer", - topics=["DFT+U_internal"], - dimensions="scalar", - mnemonics="Number of AToms on which PAW+U is applied", - characteristics=["[[INTERNAL_ONLY]]"], - requires="[[usepawu]] == 1", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="natpawu", + varset="internal", + vartype="integer", + topics=["DFT+U_internal"], + dimensions="scalar", + mnemonics="Number of AToms on which PAW+U is applied", + characteristics=["[[INTERNAL_ONLY]]"], + requires="[[usepawu]] == 1", + added_in_version="before_v9", + text=r""" This internal variable gives the number of atoms on which the DFT+U method is applied. This value is determined from [[lpawu]]. """, - ), - Variable( - abivarname="natrd", - varset="geo", - vartype="integer", - topics=["AtomManipulator_basic", "SmartSymm_basic"], - dimensions="scalar", - defaultval="[[natom]]", - mnemonics="Number of AToms ReaD", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="natrd", + varset="geo", + vartype="integer", + topics=["AtomManipulator_basic", "SmartSymm_basic"], + dimensions="scalar", + defaultval="[[natom]]", + mnemonics="Number of AToms ReaD", + added_in_version="before_v9", + text=r""" Gives the number of atoms to be read from the input file, in the case the atom manipulator or the smart symmetriser is used. In this case, [[natrd]] is also used to dimension the array [[typat]], and the arrays [[xred]] and [[xcart]]. Must take into account the vacancies (see [[vacnum]] and [[vaclst]]). Despite possible vacancies, cannot be bigger than [[natom]]. """, - ), - Variable( - abivarname="natsph", - varset="gstate", - vartype="integer", - topics=["printing_prdos", "ElecBandStructure_useful", "ElecDOS_useful", "AtomCentered_compulsory"], - dimensions="scalar", - defaultval="[[natom]]", - mnemonics="Number of ATomic SPHeres for the atom-projected density-of-states", - requires="[[prtdos]] == 3 or 4 or [[pawfatbnd]] in [1,2]", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="natsph", + varset="gstate", + vartype="integer", + topics=["printing_prdos", "ElecBandStructure_useful", "ElecDOS_useful","AtomCentered_compulsory"], + dimensions="scalar", + defaultval="[[natom]]", + mnemonics="Number of ATomic SPHeres for the atom-projected density-of-states", + requires="[[prtdos]] == 3 or 4 or [[pawfatbnd]] in [1,2]", + added_in_version="before_v9", + text=r""" [[natsph]] gives the number of atoms around which the sphere for atom-projected density-of-states will be built, in the [[prtdos]] = 3 or 4 case. The indices of these atoms are given by [[iatsph]]. The radius of these spheres is given by [[ratsph]]. If [[pawfatbnd]] = 1 or 2, it gives the number of atoms around which atom-projected band structure will be built (the indices of these atoms are given by [[iatsph]]). """, - ), - Variable( - abivarname="natsph_extra", - varset="gstate", - vartype="integer", - topics=["printing_prdos", "AtomCentered_compulsory"], - dimensions="scalar", - defaultval=0, - mnemonics="Number of ATomic SPHeres for the l-projected density-of-states in EXTRA set", - requires="[[prtdos]] == 3 or 4 or [[pawfatbnd]] in [1,2]", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="natsph_extra", + varset="gstate", + vartype="integer", + topics=["printing_prdos","AtomCentered_compulsory"], + dimensions="scalar", + defaultval=0, + mnemonics="Number of ATomic SPHeres for the l-projected density-of-states in EXTRA set", + requires="[[prtdos]] == 3 or 4 or [[pawfatbnd]] in [1,2]", + added_in_version="before_v9", + text=r""" [[natsph_extra]] gives the number of extra spheres for which the angular- momentum-projected density-of-states will be built, in the [[prtdos]] = 3 or 4 case. The radius of these spheres is given by [[ratsph_extra]]. This simulates the @@ -11993,34 +12930,36 @@ band structure will be built. The position of the spheres is given by the [[xredsph_extra]] variable. """, - ), - Variable( - abivarname="natvshift", - varset="ffield", - vartype="integer", - topics=["DFT+U_expert"], - dimensions="scalar", - defaultval=0, - mnemonics="Number of ATomic potential (V) energy SHIFTs (per atom)", - requires="[[usepawu]] /= 0, [[atvshift]]", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="natvshift", + varset="ffield", + vartype="integer", + topics=["DFT+U_expert"], + dimensions="scalar", + defaultval=0, + mnemonics="Number of ATomic potential (V) energy SHIFTs (per atom)", + requires="[[usepawu]] /= 0, [[atvshift]]", + added_in_version="before_v9", + text=r""" Number of atomic potential energy shifts (per atom), to be used to define the array [[atvshift]]. If non-zero, only two possibilities exist: 5 for d states (with [[lpawu]] = 2), and 7 for f states (with [[lpawu]] = 3). If non-zero, one should define [[usepawu]], [[lpawu]] and [[atvshift]]. """, - ), - Variable( - abivarname="nband", - varset="basic", - vartype="integer", - topics=["BandOcc_basic", "GW_basic", "RPACorrEn_basic", "Susceptibility_basic"], - dimensions="scalar", - mnemonics="Number of BANDs", - commentdefault=" the estimated number of occupied bands +1 (TODO provide the mathematical formulation)", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="nband", + varset="basic", + vartype="integer", + topics=["BandOcc_basic", "GW_basic", "RPACorrEn_basic", "Susceptibility_basic"], + dimensions="scalar", + mnemonics="Number of BANDs", + commentdefault=" the estimated number of occupied bands +1 (TODO provide the mathematical formulation)", + added_in_version="before_v9", + text=r""" Gives number of bands, occupied plus possibly unoccupied, for which wavefunctions are being computed along with eigenvalues. Note: if the parameter [[occopt]] (see below) is not set to 2, [[nband]] is a @@ -12039,31 +12978,33 @@ dielectric matrix), as well as the self-energy. However, to generate the _KSS file (see [[kssform]]) the relevant number of bands is given by [[nbandkss]]. """, - ), - Variable( - abivarname="nbandhf", - varset="basic", - vartype="integer", - topics=["Hybrids_useful"], - dimensions="scalar", - mnemonics="Number of BANDs for (Hartree)-Fock exact exchange", - commentdefault="the estimated number of occupied bands (TODO: provide the mathematical formulation)", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="nbandhf", + varset="basic", + vartype="integer", + topics=["Hybrids_useful"], + dimensions="scalar", + mnemonics="Number of BANDs for (Hartree)-Fock exact exchange", + commentdefault="the estimated number of occupied bands (TODO: provide the mathematical formulation)", + added_in_version="before_v9", + text=r""" Gives the maximum number of occupied bands with which Fock exact exchange is being computed for the wavefunctions. """, - ), - Variable( - abivarname="nbandkss", - varset="gw", - vartype="integer", - topics=["GW_useful", "Susceptibility_useful", "SelfEnergy_useful"], - dimensions="scalar", - defaultval=0, - mnemonics="Number of BANDs in the KSS file", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="nbandkss", + varset="gw", + vartype="integer", + topics=["GW_useful", "Susceptibility_useful", "SelfEnergy_useful"], + dimensions="scalar", + defaultval=0, + mnemonics="Number of BANDs in the KSS file", + added_in_version="before_v9", + text=r""" This input variable is used for the preparation of a GW calculation: it is used in a GS run (where [[optdriver]] = 0) to generate a _KSS file. In this run, [[nbandkss]] should be non-zero. The generated _KSS file can be subsequently @@ -12086,40 +13027,38 @@ For the time being, [[istwfk]] must be 1 for all the k-points in order to generate a _KSS file. """, - ), - Variable( - abivarname="nbdblock", - varset="dev", - vartype="integer", - topics=["TuningSpeedMem_expert"], - dimensions="scalar", - defaultval=1, - mnemonics="Number of BanDs in a BLOCK", - characteristics=["[[DEVELOP]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="nbdblock", + varset="dev", + vartype="integer", + topics=["TuningSpeedMem_expert"], + dimensions="scalar", + defaultval=1, + mnemonics="Number of BanDs in a BLOCK", + characteristics=["[[DEVELOP]]"], + added_in_version="before_v9", + text=r""" In case of non-standard, blocked algorithms for the optimization of the wavefunctions (that is, if [[wfoptalg]] = 4): * if [[wfoptalg]] = 4, [[nbdblock]] defines the number of blocks (the number of bands in the block is then [[nband]]/[[nbdblock]] ). """, - ), - Variable( - abivarname="nbdbuf", - varset="gstate", - vartype="integer", - topics=["SCFControl_useful", "BandOcc_useful"], - dimensions="scalar", - defaultval=ValueWithConditions( - { - "[[optdriver]] == 0 and [[iscf]]<0": "2*[[nspinor]]", - "[[optdriver]] == 1 and 3<=[[occopt]] and [[occopt]]<= 8": "2*[[nspinor]]", - "defaultval": 0, - } - ), - mnemonics="Number of BanDs for the BUFfer", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="nbdbuf", + varset="gstate", + vartype="integer", + topics=["SCFControl_useful", "BandOcc_useful"], + dimensions="scalar", + defaultval=ValueWithConditions({"[[optdriver]] == 0 and [[iscf]]<0": "2*[[nspinor]]", + "[[optdriver]] == 1 and 3<=[[occopt]] and [[occopt]]<= 8": "2*[[nspinor]]", + "defaultval": 0}), + mnemonics="Number of BanDs for the BUFfer", + added_in_version="before_v9", + text=r""" [[nbdbuf]] gives the number of bands, the highest in energy, that, among the [[nband]] bands, are to be considered as part of a buffer. A negative value (between -1 and -100) is interpreted as percentage of [[nband]] (added in v9). The value -101 is special, as described below. @@ -12181,18 +13120,19 @@ At last, we note that the convergence criteria for the diagonalization algorithm (see [[tolwfr_diago]]) is also affected by [[nbdbuf]]. """, - ), - Variable( - abivarname="nberry", - varset="ffield", - vartype="integer", - topics=["Berry_basic"], - dimensions="scalar", - defaultval=1, - mnemonics="Number of BERRY phase computations", - requires="[[berryopt]] = 1, 2, or 3", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="nberry", + varset="ffield", + vartype="integer", + topics=["Berry_basic"], + dimensions="scalar", + defaultval=1, + mnemonics="Number of BERRY phase computations", + requires="[[berryopt]] = 1, 2, or 3", + added_in_version="before_v9", + text=r""" Gives the number of Berry phase computations of polarisation, or finite- difference estimations of the derivative of wavefunctions with respect to the wavevector, each of which might be characterized by a different change of @@ -12212,18 +13152,19 @@ For the [[berryopt]] = 1, 2, and 3 cases, spinor wavefunctions are not allowed, nor are parallel computations. """, - ), - Variable( - abivarname="nblock_lobpcg", - varset="gstate", - vartype="integer", - topics=["SCFAlgorithms_useful"], - dimensions="scalar", - defaultval=1, - mnemonics="Number of BLOCKs in the LOBPCG algorithm", - requires="[[wfoptalg]] = 4, 14, or 114", - added_in_version="v9.11.6", - text=r""" +), + +Variable( + abivarname="nblock_lobpcg", + varset="gstate", + vartype="integer", + topics=["SCFAlgorithms_useful"], + dimensions="scalar", + defaultval=1, + mnemonics="Number of BLOCKs in the LOBPCG algorithm", + requires="[[wfoptalg]] = 4, 14, or 114", + added_in_version="v9.11.6", + text=r""" This variable controls the number of blocks in the LOBPCG algorithm. It has to be a divisor of [[nband]]. Contrary to the simple conjugate gradient, which is a band-by-band algorithm, LOBPCG can work on blocks of wavefunctions. @@ -12250,19 +13191,20 @@ So [[npband]] has to be a divisor of [[nband]] / **nblock_lobpcg** and [[bandpp]] is internally set to [[nband]] / (**nblock_lobpcg** * [[npband]]). **nblock_lobpcg** and [[bandpp]] cannot be used simultaneously, one should prefer **nblock_lobpcg**. """, - ), - Variable( - abivarname="nc_xccc_gspace", - varset="dev", - vartype="integer", - topics=["Planewaves_expert"], - dimensions="scalar", - defaultval=ValueWithConditions({"[[usepaw]] == 0": 0, "[[usepaw]] == 1": 1, "defaultval": 0}), - mnemonics="Norm-Conserving pseudopotentials - use XC Core-Correction in G-SPACE", - characteristics=["[[DEVELOP]]"], - commentdefault="0 when [[usepaw]] = 0, 1 when [[usepaw]] = 1", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="nc_xccc_gspace", + varset="dev", + vartype="integer", + topics=["Planewaves_expert"], + dimensions="scalar", + defaultval=ValueWithConditions({"[[usepaw]] == 0": 0, "[[usepaw]] == 1": 1, "defaultval": 0}), + mnemonics="Norm-Conserving pseudopotentials - use XC Core-Correction in G-SPACE", + characteristics=["[[DEVELOP]]"], + commentdefault="0 when [[usepaw]] = 0, 1 when [[usepaw]] = 1", + added_in_version="before_v9", + text=r""" Historically, Abinit treats the model core charge used for the non-linear core correction in real space. Alternatively, it is possible to instruct the code to compute the core charge in G-space following the same approach used in the @@ -12276,47 +13218,51 @@ for the G-space formalism and users are strongly invited to perform convergence studies with respect to [[ecut]] before activating this option in production runs. """, - ), - Variable( - abivarname="nconeq", - varset="rlx", - vartype="integer", - topics=["GeoConstraints_useful"], - dimensions="scalar", - defaultval=0, - mnemonics="Number of CONstraint EQuations", - characteristics=["[[NO_MULTI]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="nconeq", + varset="rlx", + vartype="integer", + topics=["GeoConstraints_useful"], + dimensions="scalar", + defaultval=0, + mnemonics="Number of CONstraint EQuations", + characteristics=["[[NO_MULTI]]"], + added_in_version="before_v9", + text=r""" Gives the number of independent equations constraining the motion of atoms during structural optimization or molecular dynamics (see [[natcon]], [[iatcon]], and [[wtatcon]]). """, - ), - Variable( - abivarname="ncout", - varset="files", - vartype="integer", - topics=["printing_prgs"], - dimensions="scalar", - defaultval=1, - mnemonics="Print netCDF output files", - added_in_version="9.11.0", - text=r""" +), + +Variable( + abivarname="ncout", + varset="files", + vartype="integer", + topics=["printing_prgs"], + dimensions="scalar", + defaultval=1, + mnemonics="Print netCDF output files", + added_in_version="9.11.0", + text=r""" If set to 1, ABINIT will produce a netCDF output file up to 10 datasets calculations. If set to 0, said files will not be printed. """, - ), - Variable( - abivarname="nctime", - varset="dev", - vartype="integer", - topics=["MolecularDynamics_useful"], - dimensions="scalar", - defaultval=0, - mnemonics="NetCdf TIME between output of molecular dynamics information", - characteristics=["[[DEVELOP]]"], - added_in_version="before_v9", - text=r""" +), + + +Variable( + abivarname="nctime", + varset="dev", + vartype="integer", + topics=["MolecularDynamics_useful"], + dimensions="scalar", + defaultval=0, + mnemonics="NetCdf TIME between output of molecular dynamics information", + characteristics=["[[DEVELOP]]"], + added_in_version="before_v9", + text=r""" When [[nctime]] is non-zero, the molecular dynamics information is output in NetCDF format, every [[nctime]] time step. Here is the content of an example file: @@ -12348,20 +13294,21 @@ } ``` """, - ), - Variable( - abivarname="ndivk", - varset="gstate", - vartype="integer", - topics=["k-points_useful", "ElecBandStructure_useful"], - dimensions=["abs([[kptopt]])"], - mnemonics="Number of DIVisions of K lines", - characteristics=["[[INPUT_ONLY]]"], - commentdefault="Will be generated automatically from [[ndivsm]] if the latter is defined, which is much more convenient.", - excludes="[[ndivsm]]", - requires="[[kptopt]] < 0", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="ndivk", + varset="gstate", + vartype="integer", + topics=["k-points_useful", "ElecBandStructure_useful"], + dimensions=["abs([[kptopt]])"], + mnemonics="Number of DIVisions of K lines", + characteristics=["[[INPUT_ONLY]]"], + commentdefault="Will be generated automatically from [[ndivsm]] if the latter is defined, which is much more convenient.", + excludes="[[ndivsm]]", + requires="[[kptopt]] < 0", + added_in_version="before_v9", + text=r""" Gives the number of divisions of each of the segments of the band structure, whose path is determined by [[kptopt]] and [[kptbounds]]. In this case, the absolute value of [[kptopt]] is the number of such segments. @@ -12386,17 +13333,18 @@ just specifying the number of divisions for the smallest segment. See the related input variable [[ndivsm]]. This is much more convenient than using [[ndivk]]. """, - ), - Variable( - abivarname="ndivsm", - varset="gstate", - vartype="integer", - topics=["k-points_useful", "ElecBandStructure_basic"], - dimensions="scalar", - mnemonics="Number of DIVisions for the SMallest segment", - characteristics=["[[INPUT_ONLY]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="ndivsm", + varset="gstate", + vartype="integer", + topics=["k-points_useful", "ElecBandStructure_basic"], + dimensions="scalar", + mnemonics="Number of DIVisions for the SMallest segment", + characteristics=["[[INPUT_ONLY]]"], + added_in_version="before_v9", + text=r""" This variable defines the number of divisions used to sample the smallest segment of the circuit employed in a band structure calculations (see related input variables [[kptopt]] and [[kptbounds]]). If [[ndivsm]] is given in the @@ -12407,52 +13355,55 @@ only when [[kptopt]] is negative. In this case, the absolute value of [[kptopt]] is the number of such segments. """, - ), - Variable( - abivarname="ndtset", - varset="basic", - vartype="integer", - topics=["multidtset_compulsory"], - dimensions="scalar", - defaultval=0, - mnemonics="Number of DaTaSETs", - characteristics=["[[NO_MULTI]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="ndtset", + varset="basic", + vartype="integer", + topics=["multidtset_compulsory"], + dimensions="scalar", + defaultval=0, + mnemonics="Number of DaTaSETs", + characteristics=["[[NO_MULTI]]"], + added_in_version="before_v9", + text=r""" Gives the number of data sets to be treated. If 0, means that the multi-data set treatment is not used, so that the root filenames will not be appended with _DSx, where 'x' is the dataset index defined by the input variable [[jdtset]], and also that input names with a dataset index are not allowed. Otherwise, [[ndtset]] = 0 is equivalent to [[ndtset]] = 1. """, - ), - Variable( - abivarname="ndynimage", - varset="internal", - vartype="integer", - topics=["PIMD_internal"], - dimensions="scalar", - mnemonics="Number of DYNamical IMAGEs", - characteristics=["[[INTERNAL_ONLY]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="ndynimage", + varset="internal", + vartype="integer", + topics=["PIMD_internal"], + dimensions="scalar", + mnemonics="Number of DYNamical IMAGEs", + characteristics=["[[INTERNAL_ONLY]]"], + added_in_version="before_v9", + text=r""" This internal variable gives the number of dynamical images, immediately deduced from the number of non-zero values present in [[dynimage]]. It is used to dimension many memory-consuming arrays (one copy for each image), e.g. the wavefunction array (cg), the density array (rho), etc. """, - ), - Variable( - abivarname="neb_algo", - varset="rlx", - vartype="integer", - topics=["TransPath_useful"], - dimensions="scalar", - defaultval=1, - mnemonics="Nudged Elastic Band ALGOrithm", - requires="[[imgmov]] == 5", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="neb_algo", + varset="rlx", + vartype="integer", + topics=["TransPath_useful"], + dimensions="scalar", + defaultval=1, + mnemonics="Nudged Elastic Band ALGOrithm", + requires="[[imgmov]] == 5", + added_in_version="before_v9", + text=r""" Gives the variant of the NEB method used. Possible values can be: * 0 --> **Original NEB method**. @@ -12478,18 +13429,19 @@ allowing it to vary between 2 values (to have higher resolution close to the saddle point). All these methods are also compatible with the variable cell NEB (evolution of lattice vectors along the path), which can be applied using [[neb_cell_algo]]. """, - ), - Variable( - abivarname="neb_cell_algo", - varset="rlx", - vartype="integer", - topics=["TransPath_useful"], - dimensions="scalar", - defaultval=1, - mnemonics="Nudged Elastic Band variable CELL ALGOrithm", - requires="[[imgmov]] == 5", - added_in_version="v10", - text=r""" +), + +Variable( + abivarname="neb_cell_algo", + varset="rlx", + vartype="integer", + topics=["TransPath_useful"], + dimensions="scalar", + defaultval=1, + mnemonics="Nudged Elastic Band variable CELL ALGOrithm", + requires="[[imgmov]] == 5", + added_in_version="v10", + text=r""" This variable must be enabled to perform Variable Cell Nudged Elastic Band (NEB) calculations, i.e. to allow the primitive cell vectors evolve along the path. The possible values are: @@ -12506,23 +13458,20 @@ > Note: variable-cell NEB is only compatible with the steepest-descent Minimum Energy Path search algorithm ([[mep_solver]]=0). """, - ), - Variable( - abivarname="neb_spring", - varset="rlx", - vartype="real", - topics=["TransPath_useful"], - dimensions=[2], - defaultval=ValueWithConditions( - { - "[[neb_algo]] == 2": ValueWithUnit(units="Hartree/Bohr^2", value=[0.02, 0.15]), - "defaultval": ValueWithUnit(units="Hartree/Bohr^2", value=[0.05, 0.05]), - } - ), - mnemonics="Nudged Elastic Band: SPRING constant", - requires="[[imgmov]] == 5", - added_in_version="before_v9", - text=r""" +), + + +Variable( + abivarname="neb_spring", + varset="rlx", + vartype="real", + topics=["TransPath_useful"], + dimensions=[2], + defaultval=ValueWithConditions({"[[neb_algo]] == 2": ValueWithUnit(units="Hartree/Bohr^2", value=[0.02, 0.15]), "defaultval": ValueWithUnit(units="Hartree/Bohr^2", value=[0.05, 0.05])}), + mnemonics="Nudged Elastic Band: SPRING constant", + requires="[[imgmov]] == 5", + added_in_version="before_v9", + text=r""" Gives the minimal and maximal values (in Hartree/Bohr^2) of the spring constant connecting images for the NEB method. In the standard "Nudged Elastic Band" method, the spring constant is constant @@ -12530,18 +13479,19 @@ point, it can be better to have stronger springs close to it. See [[cite:Henkelman2000a]] """, - ), - Variable( - abivarname="nelect", - varset="internal", - vartype="real", - topics=["BandOcc_internal"], - dimensions="scalar", - defaultval="[[AUTO_FROM_PSP]]", - mnemonics="Number of ELECTrons", - characteristics=["[[INTERNAL_ONLY]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="nelect", + varset="internal", + vartype="real", + topics=["BandOcc_internal"], + dimensions="scalar", + defaultval="[[AUTO_FROM_PSP]]", + mnemonics="Number of ELECTrons", + characteristics=["[[INTERNAL_ONLY]]"], + added_in_version="before_v9", + text=r""" This internal variable gives the number of electrons per unit cell, as computed from the sum of the valence electrons related to each atom (given in the pseudopotential, where it is called "zion"), and the input variable [[cellcharge]]: @@ -12550,17 +13500,18 @@ When there are several images, although [[cellcharge]] is an array, [[nelect]] is initialized with the first image, namely [[nelect]] = zion-[[cellcharge]](1). """, - ), - Variable( - abivarname="nfft", - varset="internal", - vartype="integer", - topics=["Planewaves_internal"], - dimensions="scalar", - mnemonics="Number of FFT points", - characteristics=["[[INTERNAL_ONLY]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="nfft", + varset="internal", + vartype="integer", + topics=["Planewaves_internal"], + dimensions="scalar", + mnemonics="Number of FFT points", + characteristics=["[[INTERNAL_ONLY]]"], + added_in_version="before_v9", + text=r""" If space parallelization is not used (that is, if [[paral_kgb]] == 0), this internal variable gives the number of Fast Fourier Transform points in the grid generated by [[ngfft]](1:3). It is simply the product of the three @@ -12572,17 +13523,18 @@ a number usually close to this product divided by the number of processors on which the space is shared. """, - ), - Variable( - abivarname="nfftdg", - varset="internal", - vartype="integer", - topics=["Planewaves_internal"], - dimensions="scalar", - mnemonics="Number of FFT points for the Double Grid", - characteristics=["[[INTERNAL_ONLY]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="nfftdg", + varset="internal", + vartype="integer", + topics=["Planewaves_internal"], + dimensions="scalar", + mnemonics="Number of FFT points for the Double Grid", + characteristics=["[[INTERNAL_ONLY]]"], + added_in_version="before_v9", + text=r""" If space parallelisation is not used (that is, if [[paral_kgb]] == 0), this internal variable gives the number of Fast Fourier Transform points in the (double) grid generated by [[ngfftdg]](1:3). It is simply the product of the @@ -12594,18 +13546,19 @@ a number usually close to this product divided by the number of processors on which the space is shared. """, - ), - Variable( - abivarname="nfreqim", - varset="gw", - vartype="integer", - topics=["FrequencyMeshMBPT_basic", "RPACorrEn_compulsory"], - dimensions="scalar", - defaultval=0, - mnemonics="Number of FREQuencies along the IMaginary axis", - requires="[[optdriver]] == 3 and [[gwcalctyp]] in [x1, x2, x9]", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="nfreqim", + varset="gw", + vartype="integer", + topics=["FrequencyMeshMBPT_basic", "RPACorrEn_compulsory"], + dimensions="scalar", + defaultval=0, + mnemonics="Number of FREQuencies along the IMaginary axis", + requires="[[optdriver]] == 3 and [[gwcalctyp]] in [x1, x2, x9]", + added_in_version="before_v9", + text=r""" [[nfreqim]] sets the number of pure imaginary frequencies used to calculate the dielectric matrix in order to perform the numerical integration of the GW self-energy. @@ -12618,18 +13571,19 @@ Note that the AC grid is not log as required by the CD thus AC and CD cannot use the same SCR file. """, - ), - Variable( - abivarname="nfreqim_conv", - varset="gw", - vartype="integer", - topics=["FrequencyMeshMBPT_basic"], - dimensions="scalar", - defaultval=0, - mnemonics="Number of FREQuencies along the IMaginary axis for CONVolution", - requires="[[optdriver]] == 4 and [[gwcalctyp]] in [x1]", - added_in_version="10.5.1", - text=r""" +), + +Variable( + abivarname="nfreqim_conv", + varset="gw", + vartype="integer", + topics=["FrequencyMeshMBPT_basic"], + dimensions="scalar", + defaultval=0, + mnemonics="Number of FREQuencies along the IMaginary axis for CONVolution", + requires="[[optdriver]] == 4 and [[gwcalctyp]] in [x1]", + added_in_version="10.5.1", + text=r""" [[nfreqim_conv]] defines the number of imaginary frequency points used to interpolate the convolution between G and W when computing the self-energy with the analytic continuation (AC) method (i.e., when [[gwcalctyp]] = x1). This setting enables a more accurate evaluation of the self-energy for a given SCR file containing [[nfreqim]] imaginary frequencies. @@ -12652,17 +13606,18 @@ Therefore, it is important to test the stability of the results with respect to this parameter. Fortunately, increasing [[nfreqim_conv]] does not substantially increase the computational cost. """, - ), - Variable( - abivarname="nfreqmidm", - varset="gw", - vartype="integer", - topics=["FrequencyMeshMBPT_basic"], - dimensions="scalar", - mnemonics="Nth FREQuency Moment of the Imaginary part of the Dielectric Matrix", - requires="[[optdriver]] == 4", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="nfreqmidm", + varset="gw", + vartype="integer", + topics=["FrequencyMeshMBPT_basic"], + dimensions="scalar", + mnemonics="Nth FREQuency Moment of the Imaginary part of the Dielectric Matrix", + requires="[[optdriver]] == 4", + added_in_version="before_v9", + text=r""" Depending on the value of [[nfreqmidm]] will calculate the frequency moment of the dielectric matrix or its inverse, @@ -12672,18 +13627,19 @@ See [[cite:Taut1985]]. """, - ), - Variable( - abivarname="nfreqre", - varset="gw", - vartype="integer", - topics=["FrequencyMeshMBPT_basic"], - dimensions="scalar", - defaultval=0, - mnemonics="Number of FREQuencies along the REal axis", - requires="[[optdriver]] == 3 and [[gwcalctyp]] in [2,12,22,9,19,29]", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="nfreqre", + varset="gw", + vartype="integer", + topics=["FrequencyMeshMBPT_basic"], + dimensions="scalar", + defaultval=0, + mnemonics="Number of FREQuencies along the REal axis", + requires="[[optdriver]] == 3 and [[gwcalctyp]] in [2,12,22,9,19,29]", + added_in_version="before_v9", + text=r""" [[nfreqre]] sets the number of real frequencies used to calculate the dielectric matrix in order to perform the numerical integration of the GW self-energy. @@ -12699,33 +13655,35 @@ ppmodel to use, then s/he is not advised to use this input variable. Using the default values, one must be able to get a screening file that can be used with any [[ppmodel]]. """, - ), - Variable( - abivarname="nfreqsp", - varset="gw", - vartype="integer", - topics=["SelfEnergy_basic"], - dimensions="scalar", - defaultval=0, - mnemonics="Number of FREQuencies for the SPectral function", - requires="[[optdriver]] == 4", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="nfreqsp", + varset="gw", + vartype="integer", + topics=["SelfEnergy_basic"], + dimensions="scalar", + defaultval=0, + mnemonics="Number of FREQuencies for the SPectral function", + requires="[[optdriver]] == 4", + added_in_version="before_v9", + text=r""" [[nfreqsp]] defines the number of real frequencies used to calculate the spectral function $A_nk(\ww)$ of the GW Green's function. """, - ), - Variable( - abivarname="ngfft", - varset="gstate", - vartype="integer", - topics=["Planewaves_useful"], - dimensions=[3], - defaultval=[0, 0, 0], - mnemonics="Number of Grid points for Fast Fourier Transform", - commentdefault="(automatic selection of optimal values)", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="ngfft", + varset="gstate", + vartype="integer", + topics=["Planewaves_useful"], + dimensions=[3], + defaultval=[0, 0, 0], + mnemonics="Number of Grid points for Fast Fourier Transform", + commentdefault="(automatic selection of optimal values)", + added_in_version="before_v9", + text=r""" Gives the size of fast Fourier transform (FFT) grid in three dimensions. Each number must be composed of the factors 2, 3, and 5 to be consistent with the radices available in our FFT. @@ -12766,36 +13724,38 @@ The number of points stored by this processor in real space is n1*n2*n3proc, while in reciprocal space, it is n1*n2proc*n3. """, - ), - Variable( - abivarname="ngfftdg", - varset="paw", - vartype="integer", - topics=["PAW_useful"], - dimensions=[3], - defaultval=[0, 0, 0], - mnemonics="Number of Grid points for Fast Fourier Transform: Double Grid", - requires="[[usepaw]] == 1", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="ngfftdg", + varset="paw", + vartype="integer", + topics=["PAW_useful"], + dimensions=[3], + defaultval=[0, 0, 0], + mnemonics="Number of Grid points for Fast Fourier Transform: Double Grid", + requires="[[usepaw]] == 1", + added_in_version="before_v9", + text=r""" This variable has the same meaning as ngfft (gives the size of fast Fourier transform (fft) grid in three dimensions) but concerns the "double grid" only used for PAW calculations. """, - ), - Variable( - abivarname="ngkpt", - varset="basic", - vartype="integer", - topics=["k-points_basic"], - dimensions=[3], - defaultval=[0, 0, 0], - mnemonics="Number of Grid points for K PoinTs generation", - characteristics=["[[INPUT_ONLY]]"], - excludes="[[kptrlatt]]", - requires="[[kptopt]] >=0,", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="ngkpt", + varset="basic", + vartype="integer", + topics=["k-points_basic"], + dimensions=[3], + defaultval=[0, 0, 0], + mnemonics="Number of Grid points for K PoinTs generation", + characteristics=["[[INPUT_ONLY]]"], + excludes="[[kptrlatt]]", + requires="[[kptopt]] >=0,", + added_in_version="before_v9", + text=r""" Used when [[kptopt]] >= 0, if [[kptrlatt]] has not been defined ([[kptrlatt]] and [[ngkpt]] are exclusive of each other). Its three positive components give the number of k points of Monkhorst-Pack @@ -12815,20 +13775,21 @@ integer numbers are even. For a measure of the efficiency, see the input variable [[kptrlen]]. """, - ), - Variable( - abivarname="ngqpt", - varset="gstate", - vartype="integer", - topics=["q-points_basic"], - dimensions=[3], - defaultval=[0, 0, 0], - mnemonics="Number of Grid points for Q PoinTs generation", - characteristics=["[[INPUT_ONLY]]"], - excludes="[[qptrlatt]]", - requires="[[nqpt]] == 1 and [[kptopt]] >= 0", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="ngqpt", + varset="gstate", + vartype="integer", + topics=["q-points_basic"], + dimensions=[3], + defaultval=[0, 0, 0], + mnemonics="Number of Grid points for Q PoinTs generation", + characteristics=["[[INPUT_ONLY]]"], + excludes="[[qptrlatt]]", + requires="[[nqpt]] == 1 and [[kptopt]] >= 0", + added_in_version="before_v9", + text=r""" WARNING: Only used if [[nqpt]] = 1. If [[nqpt]]=0 (which is the default value of [[nqpt]]), no reading of [[ngqpt]] is done, and the default value of [[ngqpt]] is kept. @@ -12842,17 +13803,18 @@ For more information on Monkhorst-Pack grids, see [[ngkpt]]. """, - ), - Variable( - abivarname="nimage", - varset="rlx", - vartype="integer", - topics=["PIMD_compulsory", "TransPath_compulsory"], - dimensions="scalar", - defaultval=1, - mnemonics="Number of IMAGEs", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="nimage", + varset="rlx", + vartype="integer", + topics=["PIMD_compulsory", "TransPath_compulsory"], + dimensions="scalar", + defaultval=1, + mnemonics="Number of IMAGEs", + added_in_version="before_v9", + text=r""" Give the number of images (or replicas) of the system, for which the forces and stresses might be computed independently, in the context of string or NEB method, genetic algorithm, hyperdynamics, Path-Integral Molecular @@ -12911,17 +13873,18 @@ contrast, there is no problem if some other image has more symmetries than those of the second image. """, - ), - Variable( - abivarname="nkpath", - varset="basic", - vartype="integer", - topics=["k-points_useful"], - dimensions="scalar", - defaultval=0, - mnemonics="Number of K-points defining the PATH", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="nkpath", + varset="basic", + vartype="integer", + topics=["k-points_useful"], + dimensions="scalar", + defaultval=0, + mnemonics="Number of K-points defining the PATH", + added_in_version="before_v9", + text=r""" This variable is used to define the number of high-symmetry k-points in the [[kptbounds]] array when [[kptopt]] > 0. Historically, [[kptbounds]] is used in conjunction with a negative value of [[kptopt]] when performing a NSCF band @@ -12935,17 +13898,18 @@ unlike [[kptopt]], nkpath represents the total number of points in the [[kptbounds]] array. """, - ), - Variable( - abivarname="nkpt", - varset="basic", - vartype="integer", - topics=["k-points_useful"], - dimensions="scalar", - defaultval=ValueWithConditions({"[[kptopt]] == 0": 1, "defaultval": 0}), - mnemonics="Number of K - Points", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="nkpt", + varset="basic", + vartype="integer", + topics=["k-points_useful"], + dimensions="scalar", + defaultval=ValueWithConditions({"[[kptopt]] == 0": 1, "defaultval": 0}), + mnemonics="Number of K - Points", + added_in_version="before_v9", + text=r""" If non-zero, [[nkpt]] gives the number of k points in the k point array [[kpt]]. These points are used either to sample the Brillouin zone, or to build a band structure along specified lines. @@ -12971,48 +13935,51 @@ will have three segments; supposing [[ndivk]] is 10 12 17, the total number of k points of the circuit will be 10+12+17+1(for the final point)=40. """, - ), - Variable( - abivarname="nkptgw", - varset="gw", - vartype="integer", - topics=["SelfEnergy_basic"], - dimensions="scalar", - defaultval=0, - mnemonics="Number of K-PoinTs for GW corrections", - requires="[[optdriver]] == 4", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="nkptgw", + varset="gw", + vartype="integer", + topics=["SelfEnergy_basic"], + dimensions="scalar", + defaultval=0, + mnemonics="Number of K-PoinTs for GW corrections", + requires="[[optdriver]] == 4", + added_in_version="before_v9", + text=r""" [[nkptgw]] gives the number of k-points for which the GW calculation must be done. It is used to dimension [[kptgw]]. """, - ), - Variable( - abivarname="nkpthf", - varset="basic", - vartype="integer", - topics=["Hybrids_expert"], - dimensions="scalar", - mnemonics="Number of K - Points for (Hartree) Fock exact exchange", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="nkpthf", + varset="basic", + vartype="integer", + topics=["Hybrids_expert"], + dimensions="scalar", + mnemonics="Number of K - Points for (Hartree) Fock exact exchange", + added_in_version="before_v9", + text=r""" [[nkpthf]] gives the number of k points used to sample the full Brillouin zone for the Fock exact exchange contribution. It is obtained from the specification of the wavefunction k point grid (see [[kptopt]]), possibly downfolded as specified by [[fockdownsampling]]. """, - ), - Variable( - abivarname="nline", - varset="gstate", - vartype="integer", - topics=["SCFControl_expert"], - dimensions="scalar", - defaultval=ValueWithConditions({"[[wfoptalg]] == 1 or 111 ": "[[mdeg_filter]]", "defaultval": 4}), - mnemonics="Number of LINE minimizations", - commentdefault="Default is 4 line minimizations for conjugate-gradient-based algorithms, the degree of the polynomial filter for spectrum-filtering-based algorithms", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="nline", + varset="gstate", + vartype="integer", + topics=["SCFControl_expert"], + dimensions="scalar", + defaultval=ValueWithConditions({"[[wfoptalg]] == 1 or 111 ": "[[mdeg_filter]]", "defaultval": 4}), + mnemonics="Number of LINE minimizations", + commentdefault="Default is 4 line minimizations for conjugate-gradient-based algorithms, the degree of the polynomial filter for spectrum-filtering-based algorithms", + added_in_version="before_v9", + text=r""" Allows one to adjust the number of "iterations" used to optimize the wavefunctions. With the input variable [[nnsclo]], [[nline]] governs the convergence of the @@ -13032,18 +13999,19 @@ The default value ([[nline]] = 6) provides sufficient filtering quality for most cases. > Note however that the use of [[nline]] is **outdated**, replaced by [[mdeg_filter]]. """, - ), - Variable( - abivarname="nloc_alg", - varset="dev", - vartype="integer", - topics=["TuningSpeedMem_expert"], - dimensions="scalar", - defaultval=4, - mnemonics="Non LOCal ALGorithm", - characteristics=["[[DEVELOP]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="nloc_alg", + varset="dev", + vartype="integer", + topics=["TuningSpeedMem_expert"], + dimensions="scalar", + defaultval=4, + mnemonics="Non LOCal ALGorithm", + characteristics=["[[DEVELOP]]"], + added_in_version="before_v9", + text=r""" Allows to choose the algorithm for non-local operator application. The default value is [[nloc_alg]] = 4, and the meaning of this variable depends on [[useylm]]. @@ -13114,18 +14082,19 @@ [[nloc_mem]] for the tuning of the memory used in the non-local operator application. """, - ), - Variable( - abivarname="nloc_mem", - varset="dev", - vartype="integer", - topics=["TuningSpeedMem_expert"], - dimensions="scalar", - defaultval=ValueWithConditions({"[[usepaw]] == 1": 2, "defaultval": 1}), - mnemonics="Non LOCal MEMOry", - characteristics=["[[DEVELOP]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="nloc_mem", + varset="dev", + vartype="integer", + topics=["TuningSpeedMem_expert"], + dimensions="scalar", + defaultval=ValueWithConditions({"[[usepaw]] == 1": 2, "defaultval": 1}), + mnemonics="Non LOCal MEMOry", + characteristics=["[[DEVELOP]]"], + added_in_version="before_v9", + text=r""" Controls the memory use for the application of the non-local operator. More detailed explanations: @@ -13142,34 +14111,36 @@ abs([[nloc_mem]])-1 is stored in `dtset%nloalg(3)`. See also [[nloc_alg]] for the algorithm for the non-local operator application. """, - ), - Variable( - abivarname="nnos", - varset="rlx", - vartype="integer", - topics=["PIMD_basic", "MolecularDynamics_basic"], - dimensions="scalar", - defaultval=0, - mnemonics="Number of NOSe masses", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="nnos", + varset="rlx", + vartype="integer", + topics=["PIMD_basic", "MolecularDynamics_basic"], + dimensions="scalar", + defaultval=0, + mnemonics="Number of NOSe masses", + added_in_version="before_v9", + text=r""" Gives the number of thermostats in the chain of oscillators thermostats as proposed in [[cite:Martyna1996]]. The thermostat chains can be used either to performMolecular Dynamics (MD) ([[moldyn]] = "nvt_nose", "npt_martyna" or "nst_martyna") or to perform Path Integral Molecular Dynamics (PIMD) ([[imgmov]] = 13). The mass of these thermostats is given by [[qmass]]. """, - ), - Variable( - abivarname="nonlop_ylm_count", - varset="dev", - vartype="integer", - topics=["TuningSpeedMem_expert"], - dimensions="scalar", - defaultval=0, - mnemonics="NON LOcal Operator (YLM version) COUNTer", - characteristics=["[[DEVELOP]]"], - added_in_version="", - text=r""" +), + +Variable( + abivarname="nonlop_ylm_count", + varset="dev", + vartype="integer", + topics=["TuningSpeedMem_expert"], + dimensions="scalar", + defaultval=0, + mnemonics="NON LOcal Operator (YLM version) COUNTer", + characteristics=["[[DEVELOP]]"], + added_in_version="", + text=r""" This variable is similar than [[fft_count]], but for non-local operations instead of FFT ones. The non-local contribution of the wave-function $\psi$ to the energy writes: @@ -13231,18 +14202,19 @@ As shown in the example, several versions of "opernla_ylm" and "opernlb_ylm" routines are implemented. The choice of the implementation has an effect on performances and is controlled by [[nloc_alg]]. """, - ), - Variable( - abivarname="nnsclo", - varset="dev", - vartype="integer", - topics=["SCFControl_expert"], - dimensions="scalar", - defaultval=0, - mnemonics="Number of Non-Self Consistent LOops", - characteristics=["[[DEVELOP]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="nnsclo", + varset="dev", + vartype="integer", + topics=["SCFControl_expert"], + dimensions="scalar", + defaultval=0, + mnemonics="Number of Non-Self Consistent LOops", + characteristics=["[[DEVELOP]]"], + added_in_version="before_v9", + text=r""" Gives the maximum number of non-self-consistent loops of [[nline]] line minimisations, in the SCF case (when [[iscf]] >0). In the case [[iscf]] <=0, the number of non-self-consistent loops is determined by [[nstep]]. @@ -13261,35 +14233,37 @@ consistent loop. """, - ), - Variable( - abivarname="nnsclohf", - varset="dev", - vartype="integer", - topics=["Hybrids_expert"], - dimensions="scalar", - defaultval=ValueWithConditions({"[[usefock]] == 1": 1, "defaultval": 0}), - mnemonics="Number of Non-Self Consistent LOops for (Hartree)-Fock exact exchange", - characteristics=["[[DEVELOP]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="nnsclohf", + varset="dev", + vartype="integer", + topics=["Hybrids_expert"], + dimensions="scalar", + defaultval=ValueWithConditions({"[[usefock]] == 1": 1, "defaultval": 0}), + mnemonics="Number of Non-Self Consistent LOops for (Hartree)-Fock exact exchange", + characteristics=["[[DEVELOP]]"], + added_in_version="before_v9", + text=r""" Gives the maximum number of loops with non-self-consistent occupied states used to calculate Fock exact exchange, in the SCF case. The Default value is 0 when [[usefock]] = 0. Default value is 1 when [[usefock]] = 1 and correspond to update occupied wavefunctions at each self-consistent loop. """, - ), - Variable( - abivarname="nobj", - varset="geo", - vartype="integer", - topics=["AtomManipulator_compulsory"], - dimensions="scalar", - defaultval=0, - mnemonics="Number of OBJects", - characteristics=["[[INPUT_ONLY]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="nobj", + varset="geo", + vartype="integer", + topics=["AtomManipulator_compulsory"], + dimensions="scalar", + defaultval=0, + mnemonics="Number of OBJects", + characteristics=["[[INPUT_ONLY]]"], + added_in_version="before_v9", + text=r""" Gives the number of 'objects' to be used by the atom manipulator in order to find the full set of atoms. At present, only one or two objects can be defined, identified as objects 'a' and 'b'. @@ -13318,19 +14292,20 @@ You should look at the other variables for more information. Go to [[objan]], for example. """, - ), - Variable( - abivarname="nomegasf", - varset="gw", - vartype="integer", - topics=["Susceptibility_basic"], - dimensions="scalar", - defaultval=0, - mnemonics="Number of OMEGA to evaluate the Spectral Function", - characteristics=["[[ENERGY]]"], - requires="[[optdriver]] == 3 and [[spmeth]]!=0", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="nomegasf", + varset="gw", + vartype="integer", + topics=["Susceptibility_basic"], + dimensions="scalar", + defaultval=0, + mnemonics="Number of OMEGA to evaluate the Spectral Function", + characteristics=["[[ENERGY]]"], + requires="[[optdriver]] == 3 and [[spmeth]]!=0", + added_in_version="before_v9", + text=r""" [[nomegasf]] defines the number of real frequencies used to describe the spectral function associated to the irreducible polarizability $\chi^{(0)}_{KS}$. The frequency mesh will cover the interval between 0 and @@ -13342,18 +14317,19 @@ of $\chi^{(0)}_{KS}$ requires an extremely dense frequency mesh. It should be kept in mind, however, that the memory required grows fast with the value of [[nomegasf]]. """, - ), - Variable( - abivarname="nomegasi", - varset="gw", - vartype="integer", - topics=["SelfEnergy_basic"], - dimensions="scalar", - defaultval=12, - mnemonics="Number of OMEGA(S) along the Imaginary axis", - requires="[[optdriver]] == 4 and [[gwcalctyp]] == 1", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="nomegasi", + varset="gw", + vartype="integer", + topics=["SelfEnergy_basic"], + dimensions="scalar", + defaultval=12, + mnemonics="Number of OMEGA(S) along the Imaginary axis", + requires="[[optdriver]] == 4 and [[gwcalctyp]] == 1", + added_in_version="before_v9", + text=r""" [[nomegasi]] defines the number of frequency points used to sample the self-energy along the imaginary axis when the AC method is used. @@ -13373,34 +14349,36 @@ Conversely, [[nomegasi]] and [[omegasimax]] define the set of imaginary frequencies $\omega$ in $\Sigma$. (cfr. Eq. 43). """, - ), - Variable( - abivarname="nomegasrd", - varset="gw", - vartype="integer", - topics=["SelfEnergy_useful"], - dimensions="scalar", - defaultval=9, - mnemonics="Number of OMEGA to evaluate the Sigma Real axis Derivative", - requires="[[optdriver]] == 4", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="nomegasrd", + varset="gw", + vartype="integer", + topics=["SelfEnergy_useful"], + dimensions="scalar", + defaultval=9, + mnemonics="Number of OMEGA to evaluate the Sigma Real axis Derivative", + requires="[[optdriver]] == 4", + added_in_version="before_v9", + text=r""" The number of real frequencies around the KS energy where the self-energy $\Sigma$ is evaluated. From these values, the derivative of $\Sigma$ at the KS energy is numerically estimated through linear interpolation. """, - ), - Variable( - abivarname="nonlinear_info", - varset="dfpt", - vartype="integer", - topics=["nonlinear_expert"], - dimensions="scalar", - defaultval=0, - mnemonics="Output NON-LINEAR INFOrmation", - requires="[[optdriver]] == 5 and [[usepead]] == 0, or [[rf2_dkdk]]/=0 or [[rf2_dkde]]/=0", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="nonlinear_info", + varset="dfpt", + vartype="integer", + topics=["nonlinear_expert"], + dimensions="scalar", + defaultval=0, + mnemonics="Output NON-LINEAR INFOrmation", + requires="[[optdriver]] == 5 and [[usepead]] == 0, or [[rf2_dkdk]]/=0 or [[rf2_dkde]]/=0", + added_in_version="before_v9", + text=r""" Control the output of the non-linear implementation (only when [[usepead]] == 0). The default value, [[nonlinear_info]] == 0 does nothing. If [[nonlinear_info]] == 1, different contributions of 3rd derivatives of the energy are written in the @@ -13417,36 +14395,38 @@ for each test that does not pass, otherwise nothing is printed. However, more information concerning the tests is always printed in the **standard** output file. """, - ), - Variable( - abivarname="normpawu", - varset="dev", - vartype="integer", - topics=["DFT+U_expert"], - dimensions=["[[ntypat]]"], - defaultval=0, - mnemonics="NORMalize atomic PAW+U projector", - characteristics=["[[DEVELOP]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="normpawu", + varset="dev", + vartype="integer", + topics=["DFT+U_expert"], + dimensions=["[[ntypat]]"], + defaultval=0, + mnemonics="NORMalize atomic PAW+U projector", + characteristics=["[[DEVELOP]]"], + added_in_version="before_v9", + text=r""" Defines whether the atomic wave function (used as projectors in PAW+U) should be renormalized to 1 within PAW sphere. * [[normpawu]] = 0: leave projector * [[normpawu]] = 1: renormalize """, - ), - Variable( - abivarname="noseinert", - varset="rlx", - vartype="real", - topics=["MolecularDynamics_useful"], - dimensions="scalar", - defaultval=100000, - mnemonics="NOSE thermostat INERTia factor", - requires="[[ionmov]] == 8", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="noseinert", + varset="rlx", + vartype="real", + topics=["MolecularDynamics_useful"], + dimensions="scalar", + defaultval=100000, + mnemonics="NOSE thermostat INERTia factor", + requires="[[ionmov]] == 8", + added_in_version="before_v9", + text=r""" Give the inertia factor WT of the Nose-Hoover thermostat (when [[ionmov]] = 8), in atomic units of weight*length2, that is (electron mass)*(Bohr)2. The equations of motion are: MI d2RI/dt2= FI - dX/dt MI dRI/dt and WT d2X/dt2= @@ -13455,19 +14435,20 @@ [[xcart]]), dX/dt is a dynamical friction coefficient, and T is the temperature of the thermostat (see [[mdtemp]]). """, - ), - Variable( - abivarname="np_slk", - varset="paral", - vartype="integer", - topics=["parallelism_expert"], - dimensions="scalar", - defaultval=1000000, - mnemonics="Number of mpi Processors used for ScaLapacK calls", - characteristics=["[[DEVELOP]]"], - requires="[[optdriver]] == 1 and [[paral_kgb]] == 1 (Ground-state calculations with LOBPCG algorithm)", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="np_slk", + varset="paral", + vartype="integer", + topics=["parallelism_expert"], + dimensions="scalar", + defaultval=1000000, + mnemonics="Number of mpi Processors used for ScaLapacK calls", + characteristics=["[[DEVELOP]]"], + requires="[[optdriver]] == 1 and [[paral_kgb]] == 1 (Ground-state calculations with LOBPCG algorithm)", + added_in_version="before_v9", + text=r""" When using Scalapack (or any similar Matrix Algebra library such as ELPA), the efficiency of the eigenproblem solver saturates as the number of CPU cores increases. In this case, it is more efficient to use a smaller number of CPUs for the LINALG calls. @@ -13486,18 +14467,19 @@ Due to legacy behaviour, although it is not mandatory in theory, this value *must* divide [[npband]]*[[npfft]]*[[npspinor]]. See also [[slk_rankpp]] for a better tuning instead of this variable. """, - ), - Variable( - abivarname="npband", - varset="paral", - vartype="integer", - topics=["parallelism_useful"], - dimensions="scalar", - defaultval=1, - mnemonics="Number of Processors at the BAND level", - requires="[[paral_kgb]] == 1", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="npband", + varset="paral", + vartype="integer", + topics=["parallelism_useful"], + dimensions="scalar", + defaultval=1, + mnemonics="Number of Processors at the BAND level", + requires="[[paral_kgb]] == 1", + added_in_version="before_v9", + text=r""" Relevant only for the band/FFT parallelisation (see the [[paral_kgb]] input variable). [[npband]] gives the number of processors among which the work load over the band level is shared. [[npband]], [[npfft]], [[np_spkpt]] and [[npspinor]] are @@ -13509,18 +14491,19 @@ Note: an optimal value for this parameter can be automatically found by using the [[autoparal]] input keyword. """, - ), - Variable( - abivarname="npfft", - varset="paral", - vartype="integer", - topics=["parallelism_useful"], - dimensions="scalar", - defaultval=1, - mnemonics="Number of Processors at the FFT level", - requires="[[paral_kgb]] == 1", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="npfft", + varset="paral", + vartype="integer", + topics=["parallelism_useful"], + dimensions="scalar", + defaultval=1, + mnemonics="Number of Processors at the FFT level", + requires="[[paral_kgb]] == 1", + added_in_version="before_v9", + text=r""" Relevant only for the band/FFT/k-point parallelisation (see the [[paral_kgb]] input variable). [[npfft]] gives the number of processors among which the work load over the @@ -13536,17 +14519,18 @@ Note: an optimal value for this parameter can be automatically found by using the [[autoparal]] input keyword. """, - ), - Variable( - abivarname="nphf", - varset="paral", - vartype="integer", - topics=["Hybrids_useful", "parallelism_useful"], - dimensions="scalar", - defaultval=1, - mnemonics="Number of Processors for (Hartree)-Fock exact exchange", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="nphf", + varset="paral", + vartype="integer", + topics=["Hybrids_useful", "parallelism_useful"], + dimensions="scalar", + defaultval=1, + mnemonics="Number of Processors for (Hartree)-Fock exact exchange", + added_in_version="before_v9", + text=r""" Relevant only for the k-point/fock parallelisation (option [[paral_kgb]] input variable). [[nphf]] gives the number of processors among which the work load over the @@ -13557,17 +14541,18 @@ the number of bands for exact exchange ([[nkpthf]] $\times$ [[nbandhf]]) in order to have the better load-balancing and efficiency. """, - ), - Variable( - abivarname="npimage", - varset="paral", - vartype="integer", - topics=["parallelism_useful", "PIMD_useful", "TransPath_useful"], - dimensions="scalar", - defaultval=1, - mnemonics="Number of Processors at the IMAGE level", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="npimage", + varset="paral", + vartype="integer", + topics=["parallelism_useful", "PIMD_useful", "TransPath_useful"], + dimensions="scalar", + defaultval=1, + mnemonics="Number of Processors at the IMAGE level", + added_in_version="before_v9", + text=r""" Relevant only when sets of images are activated (see [[imgmov]] and [[nimage]] ). [[npimage]] gives the number of processors among which the work load over the @@ -13579,36 +14564,38 @@ See [[paral_kgb]], [[np_spkpt]], [[npband]], [[npfft]] and [[npspinor]] for the additional information on the use of k-point/band/FFT parallelisation. """, - ), - Variable( - abivarname="npkpt", - varset="paral", - vartype="integer", - topics=["parallelism_expert"], - dimensions="scalar", - defaultval=1, - mnemonics="Number of Processors at the SPin and K-Point Level", - requires="[[paral_kgb]] == 1", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="npkpt", + varset="paral", + vartype="integer", + topics=["parallelism_expert"], + dimensions="scalar", + defaultval=1, + mnemonics="Number of Processors at the SPin and K-Point Level", + requires="[[paral_kgb]] == 1", + added_in_version="before_v9", + text=r""" This input variable has been superseded by [[np_spkpt]]. For the time being, for backward compatibility with AbiPy, [[npkpt]] is still recognized, with the same meaning than [[np_spkpt]], despite the incorrect lack of mention of the spin parallelism in the name [[npkpt]]. Please, stop using [[npkpt]] as soon as possible. """, - ), - Variable( - abivarname="np_spkpt", - varset="paral", - vartype="integer", - topics=["parallelism_useful"], - dimensions="scalar", - defaultval=1, - mnemonics="Number of Processors at the SPin and K-Point Level", - requires="[[paral_kgb]] == 1", - added_in_version="9.4.0", - text=r""" +), + +Variable( + abivarname="np_spkpt", + varset="paral", + vartype="integer", + topics=["parallelism_useful"], + dimensions="scalar", + defaultval=1, + mnemonics="Number of Processors at the SPin and K-Point Level", + requires="[[paral_kgb]] == 1", + added_in_version="9.4.0", + text=r""" Relevant only for the band/FFT/k-point parallelisation (see the [[paral_kgb]] input variable). [[np_spkpt]] gives the number of processors among which the work load over the @@ -13626,35 +14613,37 @@ Note: an optimal value for this parameter can be automatically found by using the [[autoparal]] input keyword. """, - ), - Variable( - abivarname="nppert", - varset="paral", - vartype="integer", - topics=["parallelism_useful"], - dimensions="scalar", - defaultval=1, - mnemonics="Number of Processors at the PERTurbation level", - requires="[[paral_rf]] == 1", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="nppert", + varset="paral", + vartype="integer", + topics=["parallelism_useful"], + dimensions="scalar", + defaultval=1, + mnemonics="Number of Processors at the PERTurbation level", + requires="[[paral_rf]] == 1", + added_in_version="before_v9", + text=r""" This parameter is used in connection to the parallelization over perturbations (see [[paral_rf]] ), for a linear response calculation. [[nppert]] gives the number of processors among which the work load over the perturbation level is shared. It can even be specified separately for each dataset. """, - ), - Variable( - abivarname="npsp", - varset="gstate", - vartype="integer", - topics=["AtomTypes_useful", "PseudosPAW_expert"], - dimensions="scalar", - defaultval="[[ntypat]]", - mnemonics="Number of PSeudoPotentials to be read", - characteristics=["[[NO_MULTI]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="npsp", + varset="gstate", + vartype="integer", + topics=["AtomTypes_useful", "PseudosPAW_expert"], + dimensions="scalar", + defaultval="[[ntypat]]", + mnemonics="Number of PSeudoPotentials to be read", + characteristics=["[[NO_MULTI]]"], + added_in_version="before_v9", + text=r""" Usually, the number of pseudopotentials to be read, [[npsp]], is equal to the number of type of atoms, [[ntypat]]. However, in the case an alchemical mixing of pseudopotential is used, [[npsp]] will be bigger than [[ntypat]]. @@ -13667,37 +14656,39 @@ variables, especially [[mixalch]], to understand how to use alchemical potentials in ABINIT. """, - ), - Variable( - abivarname="npspalch", - varset="gstate", - vartype="integer", - topics=["AtomTypes_internal"], - dimensions="scalar", - defaultval="[[npsp]]-[[ntyppure]]", - mnemonics='Number of PSeudoPotentials that are "ALCHemical"', - characteristics=["[[INTERNAL_ONLY]]"], - requires="[[ntypalch]]>0", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="npspalch", + varset="gstate", + vartype="integer", + topics=["AtomTypes_internal"], + dimensions="scalar", + defaultval="[[npsp]]-[[ntyppure]]", + mnemonics='Number of PSeudoPotentials that are "ALCHemical"', + characteristics=["[[INTERNAL_ONLY]]"], + requires="[[ntypalch]]>0", + added_in_version="before_v9", + text=r""" Gives the number of pseudopotentials that are used for alchemical mixing (when [[ntypalch]] is non-zero): [[npspalch]] = [[npsp]]-[[ntyppure]] When alchemical mixing of potentials is used (that is, when [[ntypalch]]>0), then [[npspalch]] must be greater than 0. """, - ), - Variable( - abivarname="npspinor", - varset="paral", - vartype="integer", - topics=["parallelism_useful"], - dimensions="scalar", - defaultval=1, - mnemonics="Number of Processors at the SPINOR level", - requires="[[paral_kgb]] == 1", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="npspinor", + varset="paral", + vartype="integer", + topics=["parallelism_useful"], + dimensions="scalar", + defaultval=1, + mnemonics="Number of Processors at the SPINOR level", + requires="[[paral_kgb]] == 1", + added_in_version="before_v9", + text=r""" Can be 1 or 2 (if [[nspinor]] = 2). Relevant only for the band/FFT/k-point parallelisation (see the [[paral_kgb]] input variable). @@ -13711,67 +14702,71 @@ See [[np_spkpt]], [[npband]], [[npfft]], and [[paral_kgb]] for the additional information on the use of band/FFT/k-point parallelisation. """, - ), - Variable( - abivarname="npulayit", - varset="dev", - vartype="integer", - topics=["SCFAlgorithms_useful"], - dimensions="scalar", - defaultval=7, - mnemonics="Number of PULAY ITerations for SC mixing", - characteristics=["[[DEVELOP]]"], - requires="[[iscf]] in [7,17]", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="npulayit", + varset="dev", + vartype="integer", + topics=["SCFAlgorithms_useful"], + dimensions="scalar", + defaultval=7, + mnemonics="Number of PULAY ITerations for SC mixing", + characteristics=["[[DEVELOP]]"], + requires="[[iscf]] in [7,17]", + added_in_version="before_v9", + text=r""" Gives the number of previous iterations involved in Pulay mixing (mixing during electronic SC iterations). """, - ), - Variable( - abivarname="npvel", - varset="gw", - vartype="integer", - topics=["RandStopPow_compulsory"], - dimensions="scalar", - defaultval=0, - mnemonics="Number of Particle VELocities", - requires="[[optdriver]] == 3", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="npvel", + varset="gw", + vartype="integer", + topics=["RandStopPow_compulsory"], + dimensions="scalar", + defaultval=0, + mnemonics="Number of Particle VELocities", + requires="[[optdriver]] == 3", + added_in_version="before_v9", + text=r""" In the context of the electronic stopping power of impinging ion in matter, [[npvel]] sets the number of the ion velocities to be calculated via linear response. When [[npvel]] = 0, no stopping power calculation is performed. The direction and the velocity maximum are set with the input variable [[pvelmax]]. Note that the results are output for a $Z=1$ impinging ion, i.e. a proton. """, - ), - Variable( - abivarname="npweps", - varset="internal", - vartype="integer", - topics=["Susceptibility_internal"], - dimensions="scalar", - mnemonics="Number of PlaneWaves for EPSilon (the dielectric matrix)", - characteristics=["[[INTERNAL_ONLY]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="npweps", + varset="internal", + vartype="integer", + topics=["Susceptibility_internal"], + dimensions="scalar", + mnemonics="Number of PlaneWaves for EPSilon (the dielectric matrix)", + characteristics=["[[INTERNAL_ONLY]]"], + added_in_version="before_v9", + text=r""" [[npweps]] determines the size of the planewave set used to represent the independent-particle susceptibility $\chi^{(0)}_{KS}$, the dielectric matrix $\epsilon$ and its inverse. It is an internal variable, determined from [[ecuteps]]. """, - ), - Variable( - abivarname="npwkss", - varset="gw", - vartype="integer", - topics=["Susceptibility_expert", "SelfEnergy_expert"], - dimensions="scalar", - defaultval=0, - mnemonics="Number of PlaneWaves in the KSS file", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="npwkss", + varset="gw", + vartype="integer", + topics=["Susceptibility_expert", "SelfEnergy_expert"], + dimensions="scalar", + defaultval=0, + mnemonics="Number of PlaneWaves in the KSS file", + added_in_version="before_v9", + text=r""" This input variable is used for the preparation of a GW calculation: the GS run (where [[optdriver]] = 1 and [[nbandkss]]/=0) should be followed with a run where [[optdriver]] = 3. Also, if [[nbandkss]] = 0, no use of [[npwkss]]. @@ -13788,47 +14783,50 @@ For the time being, [[istwfk]] must be 1 for all the k points. """, - ), - Variable( - abivarname="npwsigx", - varset="internal", - vartype="integer", - topics=["SelfEnergy_internal"], - dimensions="scalar", - mnemonics="Number of PlaneWaves for SIGma eXchange", - characteristics=["[[INTERNAL_ONLY]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="npwsigx", + varset="internal", + vartype="integer", + topics=["SelfEnergy_internal"], + dimensions="scalar", + mnemonics="Number of PlaneWaves for SIGma eXchange", + characteristics=["[[INTERNAL_ONLY]]"], + added_in_version="before_v9", + text=r""" [[npwsigx]] determines the cut-off energy of the planewave set used to generate the exchange part of the self-energy operator. It is an internal variable, determined from the largest of [[ecutsigx]] or [[ecutwfn]]. """, - ), - Variable( - abivarname="npwwfn", - varset="internal", - vartype="integer", - topics=["Susceptibility_internal", "SelfEnergy_internal"], - dimensions="scalar", - mnemonics="Number of PlaneWaves for WaveFunctioNs", - characteristics=["[[INTERNAL_ONLY]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="npwwfn", + varset="internal", + vartype="integer", + topics=["Susceptibility_internal", "SelfEnergy_internal"], + dimensions="scalar", + mnemonics="Number of PlaneWaves for WaveFunctioNs", + characteristics=["[[INTERNAL_ONLY]]"], + added_in_version="before_v9", + text=r""" [[npwwfn]] is the size of the planewave set used to represent the wavefunctions in the formula that generates the independent-particle susceptibility $\chi^{(0)}_{KS}$. It is an internal variable, determined from [[ecutwfn]]. """, - ), - Variable( - abivarname="nqpt", - varset="gstate", - vartype="integer", - topics=["q-points_basic"], - dimensions="scalar", - defaultval=0, - mnemonics="Number of Q - POINTs", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="nqpt", + varset="gstate", + vartype="integer", + topics=["q-points_basic"], + dimensions="scalar", + defaultval=0, + mnemonics="Number of Q - POINTs", + added_in_version="before_v9", + text=r""" Determines whether one q point must be read (See the variable [[qptn]]). Can be either 0 or 1. @@ -13839,18 +14837,19 @@ For further information about the naming of files in ABINIT, consult the [[help:abinit#files-file]]. """, - ), - Variable( - abivarname="nqfd", - varset="gstate", - vartype="real", - dimensions="scalar", - defaultval=0.0, - topics=["BandOcc_useful", "DeltaSCF_expert"], - mnemonics="Number of Quasi Fermi-Dirac excited carriers", - characteristics=["[[INPUT_ONLY]]"], - added_in_version="v9", - text=r""" +), + +Variable( + abivarname="nqfd", + varset="gstate", + vartype="real", + dimensions="scalar", + defaultval=0.0, + topics=["BandOcc_useful","DeltaSCF_expert"], + mnemonics="Number of Quasi Fermi-Dirac excited carriers", + characteristics=["[[INPUT_ONLY]]"], + added_in_version="v9", + text=r""" Only used if [[occopt] = 9. Controls the numbers of electrons per cell constrained in conduction bands with index @@ -13858,18 +14857,19 @@ valence bands with index between 1 and [[ivalence]]. Internal variables ne_qFD (number of electrons) and nh_qFD (number of holes) are presently initialized to [[nqfd]], which is NOT INTERNAL. """, - ), - Variable( - abivarname="nqptdm", - varset="gw", - vartype="integer", - topics=["Susceptibility_useful"], - dimensions="scalar", - defaultval=0, - mnemonics="Number of Q-PoinTs for the Dielectric Matrix", - requires="[[optdriver]] == 3", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="nqptdm", + varset="gw", + vartype="integer", + topics=["Susceptibility_useful"], + dimensions="scalar", + defaultval=0, + mnemonics="Number of Q-PoinTs for the Dielectric Matrix", + requires="[[optdriver]] == 3", + added_in_version="before_v9", + text=r""" If [[nqptdm]] is equal to 0, the set of q points for computing the dielectric matrix is determined automatically considering all the possible differences between the k-points contained in the _KSS file. When [[nqptdm]] is non-zero, @@ -13879,34 +14879,36 @@ merged thanks to the **Mrgscr** utility. If [[nqptdm]] is equal to -1, the code reports the list of q-points in the log file (YAML format) and then stops. """, - ), - Variable( - abivarname="nscforder", - varset="dev", - vartype="integer", - topics=["Coulomb_expert"], - dimensions="scalar", - defaultval=16, - mnemonics="Nth - SCaling Function ORDER", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="nscforder", + varset="dev", + vartype="integer", + topics=["Coulomb_expert"], + dimensions="scalar", + defaultval=16, + mnemonics="Nth - SCaling Function ORDER", + added_in_version="before_v9", + text=r""" This variable controls the order of used scaling functions when the Hartree potential is computed using the Poisson solver (see [[icoulomb]] input variable). This variable is of seldom use since the default value is large enough. Nonetheless, possible values are 8, 14, 16, 20, 24, 30, 40, 50, 60, 100. Values greater than 20 are included in ABINIT for test purposes only. """, - ), - Variable( - abivarname="nshiftk", - varset="basic", - vartype="integer", - topics=["k-points_useful"], - dimensions="scalar", - defaultval=1, - mnemonics="Number of SHIFTs for K point grids", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="nshiftk", + varset="basic", + vartype="integer", + topics=["k-points_useful"], + dimensions="scalar", + defaultval=1, + mnemonics="Number of SHIFTs for K point grids", + added_in_version="before_v9", + text=r""" This parameter gives the number of shifted grids to be used concurrently to generate the full grid of k points. It can be used with primitive grids defined either from [[ngkpt]] or [[kptrlatt]]. The maximum allowed value of @@ -13916,18 +14918,19 @@ description of [[shiftk]]. The other values are either for debugging purposes by experts, or can indicate an error. Such other values are allowed only if [[chksymbreak]]=0. """, - ), - Variable( - abivarname="nshiftq", - varset="gstate", - vartype="integer", - topics=["q-points_useful"], - dimensions="scalar", - defaultval=1, - mnemonics="Number of SHIFTs for Q point grids", - characteristics=["[[INPUT_ONLY]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="nshiftq", + varset="gstate", + vartype="integer", + topics=["q-points_useful"], + dimensions="scalar", + defaultval=1, + mnemonics="Number of SHIFTs for Q point grids", + characteristics=["[[INPUT_ONLY]]"], + added_in_version="before_v9", + text=r""" WARNING: Only used if [[nqpt]] = 1. If [[nqpt]]=0 (which is the default value of [[nqpt]]), no reading of [[nshiftq]] is done, and the default value of [[nshiftq]] is kept. @@ -13936,17 +14939,18 @@ defined either from [[ngqpt]] or [[qptrlatt]]. The maximum allowed value of [[nshiftq]] is 8. The values of the shifts are given by [[shiftq]]. """, - ), - Variable( - abivarname="nspden", - varset="gstate", - vartype="integer", - topics=["spinpolarisation_basic"], - dimensions="scalar", - defaultval="[[nsppol]]", - mnemonics="Number of SPin-DENsity components", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="nspden", + varset="gstate", + vartype="integer", + topics=["spinpolarisation_basic"], + dimensions="scalar", + defaultval="[[nsppol]]", + mnemonics="Number of SPin-DENsity components", + added_in_version="before_v9", + text=r""" If [[nspden]] = 1, no spin-magnetization the density matrix is diagonal, with same values spin-up and spin-down (compatible with [[nsppol]] = 1 only, for both [[nspinor]] = 1 or 2) @@ -13969,17 +14973,18 @@ The default ([[nspden]] = [[nsppol]]) does not suit the case of vector magnetization. Note that the choice of [[nspden]] has an influence on the treatment of symmetries. See [[symafm]]. """, - ), - Variable( - abivarname="nspinor", - varset="gstate", - vartype="integer", - topics=["spinpolarisation_basic"], - dimensions="scalar", - defaultval=ValueWithConditions({"[[pawspnorb]] == 1": 2, "defaultval": 1}), - mnemonics="Number of SPINORial components of the wavefunctions", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="nspinor", + varset="gstate", + vartype="integer", + topics=["spinpolarisation_basic"], + dimensions="scalar", + defaultval=ValueWithConditions({"[[pawspnorb]] == 1": 2, "defaultval": 1}), + mnemonics="Number of SPINORial components of the wavefunctions", + added_in_version="before_v9", + text=r""" If [[nspinor]] = 1, usual case: scalar wavefunction (compatible with ([[nsppol]] = 1, [[nspden]] = 1) as well as ([[nsppol]] = 2, [[nspden]] = 2) ) @@ -13989,17 +14994,18 @@ When [[nspinor]] is 2, the values of [[istwfk]] are automatically set to 1. Also, the number of bands, for each k-point, should be even. """, - ), - Variable( - abivarname="nsppol", - varset="basic", - vartype="integer", - topics=["spinpolarisation_basic"], - dimensions="scalar", - defaultval=1, - mnemonics="Number of SPin POLarization", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="nsppol", + varset="basic", + vartype="integer", + topics=["spinpolarisation_basic"], + dimensions="scalar", + defaultval=1, + mnemonics="Number of SPin POLarization", + added_in_version="before_v9", + text=r""" Give the number of INDEPENDENT spin polarisations, for which there are non- related wavefunctions. Can take the values 1 or 2. @@ -14024,17 +15030,18 @@ See also the input variable [[nspden]] for the components of the density matrix with respect to the spin-polarization. """, - ), - Variable( - abivarname="nstep", - varset="basic", - vartype="integer", - topics=["SCFControl_basic"], - dimensions="scalar", - defaultval=30, - mnemonics="Number of (non-)self-consistent field STEPS", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="nstep", + varset="basic", + vartype="integer", + topics=["SCFControl_basic"], + dimensions="scalar", + defaultval=30, + mnemonics="Number of (non-)self-consistent field STEPS", + added_in_version="before_v9", + text=r""" Gives the maximum number of cycles (or "iterations") in a SCF or non-SCF run. Full convergence from random numbers is usually achieved in 12-20 SCF iterations. Each can take from minutes to hours. In certain difficult cases, @@ -14058,17 +15065,18 @@ One can output the density by using [[prtden]]. The forces and stress tensor are computed with [[nstep]] = 0. """, - ), - Variable( - abivarname="nsym", - varset="basic", - vartype="integer", - topics=["crystal_useful", "GW_useful"], - dimensions="scalar", - defaultval=0, - mnemonics="Number of SYMmetry operations", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="nsym", + varset="basic", + vartype="integer", + topics=["crystal_useful", "GW_useful"], + dimensions="scalar", + defaultval=0, + mnemonics="Number of SYMmetry operations", + added_in_version="before_v9", + text=r""" Gives number of space group symmetries to be applied in this problem. Symmetries will be input in array "[[symrel]]" and (nonsymmorphic) translations vectors will be input in array "[[tnons]]". If there is no @@ -14107,17 +15115,18 @@ whose non-symmorphic translation vector [[tnons]] is zero. This can be done with the help of the input variable [[symmorphi]] """, - ), - Variable( - abivarname="ntime", - varset="rlx", - vartype="integer", - topics=["MolecularDynamics_basic", "GeoOpt_basic", "RTTDDFT_basic"], - dimensions="scalar", - defaultval="0 if ionmvov == 0, set to 1000 if ionvmov != 0 and imgmov != 0 and the variable is not specified.", - mnemonics="Number of TIME steps", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="ntime", + varset="rlx", + vartype="integer", + topics=["MolecularDynamics_basic", "GeoOpt_basic", "RTTDDFT_basic"], + dimensions="scalar", + defaultval="0 if ionmvov == 0, set to 1000 if ionvmov != 0 and imgmov != 0 and the variable is not specified.", + mnemonics="Number of TIME steps", + added_in_version="before_v9", + text=r""" Gives the maximum number of molecular dynamics or electron dynamics time steps or structural optimization steps to be done if [[geoopt]] or [[moldyn]] are not "none" or [[optdriver]] is 9 (real-time TDDFT). @@ -14135,17 +15144,18 @@ initialisation of other [[geoopt]] or [[moldyn]] values is only one SCF call. Note that **ntime** is ignored if [[geoopt]] or [[moldyn]] are set to "none" ([[ionmov]] = 0). """, - ), - Variable( - abivarname="ntimimage", - varset="rlx", - vartype="integer", - topics=["PIMD_compulsory", "TransPath_compulsory"], - dimensions="scalar", - defaultval=1, - mnemonics="Number of TIME steps for IMAGE propagation", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="ntimimage", + varset="rlx", + vartype="integer", + topics=["PIMD_compulsory", "TransPath_compulsory"], + dimensions="scalar", + defaultval=1, + mnemonics="Number of TIME steps for IMAGE propagation", + added_in_version="before_v9", + text=r""" Gives the maximal number of molecular dynamics time steps or structural optimization steps to be done for the set of images, referred to as 'image- timesteps'. At each image-timestep, all the images are propagated @@ -14153,17 +15163,18 @@ the usual accompanying input variables, and then the next positions and velocities for each image are determined from the set of results obtained for all images. """, - ), - Variable( - abivarname="ntypalch", - varset="gstate", - vartype="integer", - topics=["AtomTypes_useful"], - dimensions="scalar", - defaultval=0, - mnemonics='Number of TYPe of atoms that are "ALCHemical"', - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="ntypalch", + varset="gstate", + vartype="integer", + topics=["AtomTypes_useful"], + dimensions="scalar", + defaultval=0, + mnemonics='Number of TYPe of atoms that are "ALCHemical"', + added_in_version="before_v9", + text=r""" Used for the generation of alchemical pseudopotentials: when **ntypalch** is non-zero, alchemical mixing will be used. @@ -14178,18 +15189,19 @@ input variables, especially [[mixalch]], to understand how to use alchemical potentials in ABINIT. """, - ), - Variable( - abivarname="ntypat", - varset="basic", - vartype="integer", - topics=["AtomTypes_compulsory", "PseudosPAW_compulsory", "crystal_basic"], - dimensions="scalar", - defaultval=1, - mnemonics="Number of TYPes of AToms", - characteristics=["[[NO_MULTI]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="ntypat", + varset="basic", + vartype="integer", + topics=["AtomTypes_compulsory", "PseudosPAW_compulsory", "crystal_basic"], + dimensions="scalar", + defaultval=1, + mnemonics="Number of TYPes of AToms", + characteristics=["[[NO_MULTI]]"], + added_in_version="before_v9", + text=r""" Gives the number of types of atoms in the unit cell. E.g. for a homopolar system (e.g. pure Si) **ntypat** is 1. @@ -14200,35 +15212,37 @@ the number of atomic types will differ from the number of pseudopotentials. See [[mixalch]], [[npsp]], [[ntypalch]] and [[npspalch]]. """, - ), - Variable( - abivarname="ntyppure", - varset="gstate", - vartype="integer", - topics=["AtomTypes_internal"], - dimensions="scalar", - defaultval="[[ntypat]]-[[ntypalch]]", - mnemonics='Number of TYPe of atoms that are "PURE"', - characteristics=["[[INTERNAL_ONLY]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="ntyppure", + varset="gstate", + vartype="integer", + topics=["AtomTypes_internal"], + dimensions="scalar", + defaultval="[[ntypat]]-[[ntypalch]]", + mnemonics='Number of TYPe of atoms that are "PURE"', + characteristics=["[[INTERNAL_ONLY]]"], + added_in_version="before_v9", + text=r""" Gives the number of type of atoms that are "pure" when alchemical mixing is used ([[ntypalch]] /= 0): [[ntyppure]] = [[ntypat]] - [[ntypalch]] """, - ), - Variable( - abivarname="nucdipmom", - varset="gstate", - vartype="real", - topics=["NMR_basic", "MagField_expert"], - dimensions=[3, "[[natom]]"], - defaultval=0.0, - mnemonics="NUClear DIPole MOMents", - requires="[[usepaw]] = 1; [[pawcpxocc]] = 2; [[optforces]] = 0; [[optstress]] = 0; [[kptopt]] = 0, 4, or 3", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="nucdipmom", + varset="gstate", + vartype="real", + topics=["NMR_basic","MagField_expert"], + dimensions=[3, "[[natom]]"], + defaultval=0.0, + mnemonics="NUClear DIPole MOMents", + requires="[[usepaw]] = 1; [[pawcpxocc]] = 2; [[optforces]] = 0; [[optstress]] = 0; [[kptopt]] = 0, 4, or 3", + added_in_version="before_v9", + text=r""" Places an array of nuclear magnetic dipole moments on the atomic positions, useful for computing the magnetization in the presence of nuclear dipoles and thus the chemical shielding by the converse method (see [[orbmag]], @@ -14241,18 +15255,19 @@ A simplified input to these values is provided by the variables [[natnd]], [[iatnd]], and [[atndlist]]. """, - ), - Variable( - abivarname="nucefg", - varset="paw", - vartype="integer", - topics=["EFG_basic"], - dimensions="scalar", - defaultval=0, - mnemonics="NUClear site Electric Field Gradient", - requires="[[usepaw]] == 1", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="nucefg", + varset="paw", + vartype="integer", + topics=["EFG_basic"], + dimensions="scalar", + defaultval=0, + mnemonics="NUClear site Electric Field Gradient", + requires="[[usepaw]] == 1", + added_in_version="before_v9", + text=r""" If nonzero, calculate the electric field gradient at each atomic site in the unit cell. Values will be written to the main output file (search for Electric Field Gradient). If nucefg=1, the electric field gradient in both atomic units and SI units is given, @@ -14265,35 +15280,37 @@ The option nucefg is compatible with spin polarized calculations (see [[nspden]]) and also DFT+U (see [[usepawu]]). """, - ), - Variable( - abivarname="nucfc", - varset="paw", - vartype="integer", - topics=["EFG_basic"], - dimensions="scalar", - defaultval=0, - mnemonics="NUClear site Fermi Contact term", - requires="[[usepaw]] == 1", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="nucfc", + varset="paw", + vartype="integer", + topics=["EFG_basic"], + dimensions="scalar", + defaultval=0, + mnemonics="NUClear site Fermi Contact term", + requires="[[usepaw]] == 1", + added_in_version="before_v9", + text=r""" * If set to 1, print the Fermi contact interaction at each nuclear site, that is, the electron density at each site. The result appears in the main output file (search for FC). Note that this calculation is different than what is done by cut3d, because it also computes the PAW on-site corrections in addition to the contribution from the valence pseudo-wavefunctions. """, - ), - Variable( - abivarname="nwfshist", - varset="gstate", - vartype="integer", - topics=["Wavelets_useful"], - dimensions="scalar", - defaultval=0, - mnemonics="Number of WaveFunctionS HISTory", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="nwfshist", + varset="gstate", + vartype="integer", + topics=["Wavelets_useful"], + dimensions="scalar", + defaultval=0, + mnemonics="Number of WaveFunctionS HISTory", + added_in_version="before_v9", + text=r""" In the wavelet basis set, the ground state is found by direct minimisation. The algorithm used can be either the steepest descent or the DIIS (Direct Inversion of Iteration Space). When [[nwfshist]] = 0, the steepest descent is used ( _i.e._ there is no history storage of the previous iterations). @@ -14302,32 +15319,34 @@ a DIIS increases the memory required by the program since N previous wavefunctions are stored during the electronic minimisation. """, - ), - Variable( - abivarname="nzchempot", - varset="geo", - vartype="integer", - topics=["Artificial_expert"], - dimensions="scalar", - mnemonics="Number of Z reduced coordinates that define the spatial CHEMical POTential", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="nzchempot", + varset="geo", + vartype="integer", + topics=["Artificial_expert"], + dimensions="scalar", + mnemonics="Number of Z reduced coordinates that define the spatial CHEMical POTential", + added_in_version="before_v9", + text=r""" Defines the number of z reduced coordinates that defines the spatially varying chemical potential. See the input variable [[chempot]], of which [[nzchempot]] is the second dimension. """, - ), - Variable( - abivarname="objaat", - varset="geo", - vartype="integer", - topics=["AtomManipulator_basic"], - dimensions=["[[objan]]"], - mnemonics="OBJect A: list of AToms", - characteristics=["[[INPUT_ONLY]]"], - requires="'[[nobj]] == 1'", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="objaat", + varset="geo", + vartype="integer", + topics=["AtomManipulator_basic"], + dimensions=["[[objan]]"], + mnemonics="OBJect A: list of AToms", + characteristics=["[[INPUT_ONLY]]"], + requires="'[[nobj]] == 1'", + added_in_version="before_v9", + text=r""" Gives the list of atoms in object a. This list is specified by giving, for each atom, its index in the list of coordinates ([[xred]] or [[xcart]]), that also corresponds to a type of atom (given by the array type). @@ -14335,19 +15354,20 @@ molecules, to be repeated, rotated and translated to generate the full set of atoms. Look at [[objarf]] for further explanations. """, - ), - Variable( - abivarname="objaax", - varset="geo", - vartype="real", - topics=["AtomManipulator_useful"], - dimensions=[6], - mnemonics="OBJect A: AXis", - characteristics=["[[INPUT_ONLY]]", "[[LENGTH]]"], - commentdefault="""[[objaax]] must be provided if ([[nobj]] == 1 and one component of [[objaro]] != 0). Moreover, +), + +Variable( + abivarname="objaax", + varset="geo", + vartype="real", + topics=["AtomManipulator_useful"], + dimensions=[6], + mnemonics="OBJect A: AXis", + characteristics=["[[INPUT_ONLY]]", "[[LENGTH]]"], + commentdefault="""[[objaax]] must be provided if ([[nobj]] == 1 and one component of [[objaro]] != 0). Moreover, [[objaax]] AND [[objbax]] must be provided if ( [[nobj]] == 2 and one component of [[objbro]] != 0 ).""", - added_in_version="before_v9", - text=r""" + added_in_version="before_v9", + text=r""" Gives, for each object, the cartesian coordinates of two points (first point: [[objaax]](1:3) second point: [[objaax]](4:6). By default, given in Bohr atomic units (1 Bohr=0.5291772108 Angstroms), although Angstrom can be @@ -14358,33 +15378,35 @@ clockwise when looking to it along the axis, from point 1 (coordinates 1:3) toward point 2 (coordinates 4:6). """, - ), - Variable( - abivarname="objan", - varset="geo", - vartype="integer", - topics=["AtomManipulator_basic"], - dimensions="scalar", - mnemonics="OBJect A: Number of atoms", - characteristics=["[[INPUT_ONLY]]"], - commentdefault=""" [[objan]] MUST be provided if [[nobj]] == 1. +), + +Variable( + abivarname="objan", + varset="geo", + vartype="integer", + topics=["AtomManipulator_basic"], + dimensions="scalar", + mnemonics="OBJect A: Number of atoms", + characteristics=["[[INPUT_ONLY]]"], + commentdefault=""" [[objan]] MUST be provided if [[nobj]] == 1. [[objan]] and [[objbn]] MUST be provided if [[nobj]] == 2.""", - added_in_version="before_v9", - text=r""" + added_in_version="before_v9", + text=r""" Gives the number of atoms in object a. The list of atoms is given by the variables [[objaat]]. """, - ), - Variable( - abivarname="objarf", - varset="geo", - vartype="integer", - topics=["AtomManipulator_basic"], - dimensions=[3], - defaultval=[1, 1, 1], - mnemonics="OBJect A: Repetition Factors", - characteristics=["[[INPUT_ONLY]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="objarf", + varset="geo", + vartype="integer", + topics=["AtomManipulator_basic"], + dimensions=[3], + defaultval=[1, 1, 1], + mnemonics="OBJect A: Repetition Factors", + characteristics=["[[INPUT_ONLY]]"], + added_in_version="before_v9", + text=r""" Gives three repetition factors of the objects a. This gives the opportunity to generate a three-dimensional set of repeated objects, although a simple one-dimensional repetition will be easily obtained @@ -14405,19 +15427,20 @@ If the atom manipulator is only used to rotate or translate an object, without repeating it, simply use `1 1 1`, which is also the Default value. """, - ), - Variable( - abivarname="objaro", - varset="geo", - vartype="real", - topics=["AtomManipulator_useful"], - dimensions=[4], - defaultval=MultipleValue(number=4, value=0.0), - mnemonics="OBJect A: ROtations", - characteristics=["[[INPUT_ONLY]]"], - commentdefault="(no rotation)", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="objaro", + varset="geo", + vartype="real", + topics=["AtomManipulator_useful"], + dimensions=[4], + defaultval=MultipleValue(number=4, value=0.0), + mnemonics="OBJect A: ROtations", + characteristics=["[[INPUT_ONLY]]"], + commentdefault="(no rotation)", + added_in_version="before_v9", + text=r""" Give, for each object, the angles of rotation in degrees to be applied to the corresponding object. The rotation is applied before the translation, and the axis is defined by the @@ -14430,19 +15453,20 @@ repetition factor (resp.). This allows one to generate 3D arrays of molecules with different rotation angles. """, - ), - Variable( - abivarname="objatr", - varset="geo", - vartype="real", - topics=["AtomManipulator_useful"], - dimensions=[12], - defaultval=MultipleValue(number=12, value=0.0), - mnemonics="OBJect A: TRanslations", - characteristics=["[[INPUT_ONLY]]", "[[LENGTH]]"], - commentdefault="(no translation)", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="objatr", + varset="geo", + vartype="real", + topics=["AtomManipulator_useful"], + dimensions=[12], + defaultval=MultipleValue(number=12, value=0.0), + mnemonics="OBJect A: TRanslations", + characteristics=["[[INPUT_ONLY]]", "[[LENGTH]]"], + commentdefault="(no translation)", + added_in_version="before_v9", + text=r""" Give, for each object, the vectors of translations, in cartesian coordinates, to be applied to the corresponding object. By default, given in Bohr atomic units (1 Bohr=0.5291772108 Angstroms), although Angstrom can be specified, if @@ -14459,18 +15483,19 @@ which case, only rotations are needed. Not present in the dtset array (no internal). """, - ), - Variable( - abivarname="objbat", - varset="geo", - vartype="integer", - topics=["AtomManipulator_useful"], - dimensions=["[[objbn]]"], - mnemonics="OBJect B: list of AToms", - characteristics=["[[INPUT_ONLY]]"], - requires="[[nobj]] == 2", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="objbat", + varset="geo", + vartype="integer", + topics=["AtomManipulator_useful"], + dimensions=["[[objbn]]"], + mnemonics="OBJect B: list of AToms", + characteristics=["[[INPUT_ONLY]]"], + requires="[[nobj]] == 2", + added_in_version="before_v9", + text=r""" Gives the list of atoms in object b. This list is specified by giving, for each atom, its index in the list of coordinates ([[xred]] or [[xcart]]), that also corresponds to a type of atom (given by the array type). @@ -14479,19 +15504,20 @@ atoms. Look at [[objbrf]] for further explanations. """, - ), - Variable( - abivarname="objbax", - varset="geo", - vartype="real", - topics=["AtomManipulator_useful"], - dimensions=[6], - mnemonics="OBJect B: AXis", - characteristics=["[[INPUT_ONLY]]", "[[LENGTH]]"], - commentdefault="""[[objbax]] must be provided if ([[nobj]] == 1 and one component of [[objaro]] != 0). Moreover, +), + +Variable( + abivarname="objbax", + varset="geo", + vartype="real", + topics=["AtomManipulator_useful"], + dimensions=[6], + mnemonics="OBJect B: AXis", + characteristics=["[[INPUT_ONLY]]", "[[LENGTH]]"], + commentdefault="""[[objbax]] must be provided if ([[nobj]] == 1 and one component of [[objaro]] != 0). Moreover, [[objaax]] AND [[objbax]] must be provided if ( [[nobj]] == 2 and one component of [[objbro]] != 0 ).""", - added_in_version="before_v9", - text=r""" + added_in_version="before_v9", + text=r""" Gives, for each object, the cartesian coordinates of two points (first point: [[objbax]](1:3) second point: [[objbax]](4:6). By default, given in Bohr atomic units (1 Bohr=0.5291772108 Angstroms), although Angstrom can be @@ -14502,33 +15528,35 @@ clockwise when looking to it along the axis, from point 1 (coordinates 1:3) toward point 2 (coordinates 4:6). """, - ), - Variable( - abivarname="objbn", - varset="geo", - vartype="integer", - topics=["AtomManipulator_useful"], - dimensions="scalar", - mnemonics="OBJect B: Number of atoms", - characteristics=["[[INPUT_ONLY]]"], - commentdefault=" [[objan]] and [[objbn]] MUST be provided if [[nobj]] == 2.", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="objbn", + varset="geo", + vartype="integer", + topics=["AtomManipulator_useful"], + dimensions="scalar", + mnemonics="OBJect B: Number of atoms", + characteristics=["[[INPUT_ONLY]]"], + commentdefault=" [[objan]] and [[objbn]] MUST be provided if [[nobj]] == 2.", + added_in_version="before_v9", + text=r""" Gives the number of atoms in either object b. The list of atoms is given by the variables [[objbat]]. """, - ), - Variable( - abivarname="objbrf", - varset="geo", - vartype="integer", - topics=["AtomManipulator_useful"], - dimensions=[3], - defaultval=[1, 1, 1], - mnemonics="OBJect B: Repetition Factors", - characteristics=["[[INPUT_ONLY]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="objbrf", + varset="geo", + vartype="integer", + topics=["AtomManipulator_useful"], + dimensions=[3], + defaultval=[1, 1, 1], + mnemonics="OBJect B: Repetition Factors", + characteristics=["[[INPUT_ONLY]]"], + added_in_version="before_v9", + text=r""" Gives three repetition factors of the objects a or b. This gives the opportunity to generate a three-dimensional set of repeated objects, although a simple one-dimensional repetition will be easily obtained @@ -14549,19 +15577,20 @@ If the atom manipulator is only used to rotate or translate an object, without repeating it, simply use `1 1 1`, which is also the Default value. """, - ), - Variable( - abivarname="objbro", - varset="geo", - vartype="real", - topics=["AtomManipulator_useful"], - dimensions=[4], - defaultval=MultipleValue(number=4, value=0.0), - mnemonics="OBJect B: ROtations", - characteristics=["[[INPUT_ONLY]]"], - commentdefault="(no rotation)", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="objbro", + varset="geo", + vartype="real", + topics=["AtomManipulator_useful"], + dimensions=[4], + defaultval=MultipleValue(number=4, value=0.0), + mnemonics="OBJect B: ROtations", + characteristics=["[[INPUT_ONLY]]"], + commentdefault="(no rotation)", + added_in_version="before_v9", + text=r""" Give, for each object, the angles of rotation in degrees to be applied to the corresponding object. The rotation is applied before the translation, and the axis is defined by the @@ -14574,19 +15603,20 @@ repetition factor (resp.). This allows one to generate 3D arrays of molecules with different rotation angles. """, - ), - Variable( - abivarname="objbtr", - varset="geo", - vartype="real", - topics=["AtomManipulator_useful"], - dimensions=[12], - defaultval=MultipleValue(number=12, value=0.0), - mnemonics="OBJect B: TRanslations", - characteristics=["[[INPUT_ONLY]]", "[[LENGTH]]"], - commentdefault="(no translation)", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="objbtr", + varset="geo", + vartype="real", + topics=["AtomManipulator_useful"], + dimensions=[12], + defaultval=MultipleValue(number=12, value=0.0), + mnemonics="OBJect B: TRanslations", + characteristics=["[[INPUT_ONLY]]", "[[LENGTH]]"], + commentdefault="(no translation)", + added_in_version="before_v9", + text=r""" Give, for each object, the vectors of translations, in cartesian coordinates, to be applied to the corresponding object. By default, given in Bohr atomic units (1 Bohr=0.5291772108 Angstroms), although Angstrom can be specified, if @@ -14602,19 +15632,20 @@ exception, one can have a set of molecules regularly spaced on a circle, in which case, only rotations are needed. """, - ), - Variable( - abivarname="occ", - varset="gstate", - vartype="real", - topics=["BandOcc_basic"], - dimensions=["[[nband]]", "[[nsppol]]"], - commentdims="in case [[occopt]]=2, dimensions are ([[mband]],[[nkpt]],[[nsppol]])", - defaultval=MultipleValue(number=None, value=0), - mnemonics="OCCupation numbers", - characteristics=["[[EVOLVING]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="occ", + varset="gstate", + vartype="real", + topics=["BandOcc_basic"], + dimensions=["[[nband]]", "[[nsppol]]"], + commentdims="in case [[occopt]]=2, dimensions are ([[mband]],[[nkpt]],[[nsppol]])", + defaultval=MultipleValue(number=None, value=0), + mnemonics="OCCupation numbers", + characteristics=["[[EVOLVING]]"], + added_in_version="before_v9", + text=r""" Gives occupation numbers for all bands in the problem. Needed if [[occopt]] == 0 or [[occopt]] == 2. Ignored otherwise (automatically computed). Also ignored when [[iscf]] = -2. Typical band occupancy is either 2.0 or 0.0, but will usually be 1.0 or 0.0 for [[nsppol]]=2, or [[nspinor]]=2, @@ -14638,17 +15669,18 @@ When there are several images, [[occ]] might depend on the image number, see the description in [[nimage]]. """, - ), - Variable( - abivarname="occopt", - varset="basic", - vartype="integer", - topics=["BandOcc_basic", "STM_compulsory"], - dimensions="scalar", - defaultval=1, - mnemonics="OCCupation OPTion", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="occopt", + varset="basic", + vartype="integer", + topics=["BandOcc_basic", "STM_compulsory"], + dimensions="scalar", + defaultval=1, + mnemonics="OCCupation OPTion", + added_in_version="before_v9", + text=r""" Controls how input parameters [[nband]], [[occ]], and [[wtk]] are handled. Possible values are from 0 to 9. For gapped materials (semiconductors, molecules, ...), [[occopt]]=1 is the favourite for most usages. @@ -14750,51 +15782,54 @@ Fermi energy, and the bisection algorithm finds one or the other. See a more detailed explanation in [[cite:Santos2023]]. """, - ), - Variable( - abivarname="omegasimax", - varset="gw", - vartype="real", - topics=["SelfEnergy_basic"], - dimensions="scalar", - defaultval=ValueWithUnit(units="eV", value=50), - mnemonics="OMEGA to evaluate Sigma along the Imaginary axis D: MAXimal value", - characteristics=["[[ENERGY]]"], - requires="[[optdriver]] == 4 and [[gwcalctyp]] == 1", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="omegasimax", + varset="gw", + vartype="real", + topics=["SelfEnergy_basic"], + dimensions="scalar", + defaultval=ValueWithUnit(units="eV", value=50), + mnemonics="OMEGA to evaluate Sigma along the Imaginary axis D: MAXimal value", + characteristics=["[[ENERGY]]"], + requires="[[optdriver]] == 4 and [[gwcalctyp]] == 1", + added_in_version="before_v9", + text=r""" [[omegasimax]] defines the maximum frequency along the imaginary the axis. In conjunction with [[nomegasi]], [[omegasimax]] uniquely defines the linear mesh employed to sample the self-energy along the imaginary axis. """, - ), - Variable( - abivarname="omegasrdmax", - varset="gw", - vartype="real", - topics=["SelfEnergy_basic"], - dimensions="scalar", - defaultval=ValueWithUnit(units="eV", value=1.0), - mnemonics="OMEGA to evaluate the Sigma Real axis Derivative: MAXimal value", - characteristics=["[[ENERGY]]"], - requires="[[optdriver]] == 4", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="omegasrdmax", + varset="gw", + vartype="real", + topics=["SelfEnergy_basic"], + dimensions="scalar", + defaultval=ValueWithUnit(units="eV", value=1.0), + mnemonics="OMEGA to evaluate the Sigma Real axis Derivative: MAXimal value", + characteristics=["[[ENERGY]]"], + requires="[[optdriver]] == 4", + added_in_version="before_v9", + text=r""" The maximum distance from the KS energy where to evaluate Sigma. Sigma is evaluated at [ KS_energy - [[omegasrdmax]], KS_energy + [[omegasrdmax]] ] sampled [[nomegasrd]] times. """, - ), - Variable( - abivarname="optcell", - varset="rlx", - vartype="integer", - topics=["PIMD_basic", "GeoOpt_compulsory"], - dimensions="scalar", - defaultval=0, - mnemonics="OPTimize the CELL shape and dimensions", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="optcell", + varset="rlx", + vartype="integer", + topics=["PIMD_basic", "GeoOpt_compulsory"], + dimensions="scalar", + defaultval=0, + mnemonics="OPTimize the CELL shape and dimensions", + added_in_version="before_v9", + text=r""" Allows one to optimize the unit cell shape and dimensions (for [[ionmov]] >=2). The configuration for which the stress almost vanishes is iteratively determined, by using the same algorithms as for the nuclei positions. @@ -14824,27 +15859,26 @@ **optcell** value from the (x,f) history of another run with a different non- zero **optcell** value. There are still a few problems at that level. """, - ), - Variable( - abivarname="optdriver", - varset="gstate", - vartype="integer", - topics=[ - "nonlinear_compulsory", - "GWls_compulsory", - "ElPhonInt_compulsory", - "GW_compulsory", - "BSE_compulsory", - "DFPT_compulsory", - "Susceptibility_compulsory", - "SelfEnergy_compulsory", - "RTTDDFT_compulsory", - ], - dimensions="scalar", - defaultval=0, - mnemonics="OPTions for the DRIVER", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="optdriver", + varset="gstate", + vartype="integer", + topics=["nonlinear_compulsory", + "GWls_compulsory", + "ElPhonInt_compulsory", + "GW_compulsory", + "BSE_compulsory", + "DFPT_compulsory", + "Susceptibility_compulsory", + "SelfEnergy_compulsory", + "RTTDDFT_compulsory"], + dimensions="scalar", + defaultval=0, + mnemonics="OPTions for the DRIVER", + added_in_version="before_v9", + text=r""" For each dataset, choose the task to be done, at the level of the "driver" routine. The choice is among: @@ -14859,7 +15893,7 @@ * 7 --> electron-phonon coupling (EPH), see also [[eph_task]] input variable. * 8 --> Post-processing of WFK file, routine *wfk_analyze*. See also [[wfk_task]] input variable. * 9 --> Real-time TDDDFT calculation (RTTDDFT), routine *rttddft_driver* - * 10 --> longwave response functions (LONGWAVE), routine *longwave*. See also [[lw_flexo]], [[lw_qdrpl]] or [[lw_natopt]] input variables. + * 10 --> Spatial (LONGWAVE) and time (TIMDISP) dispersion, routine *longwave*. See also [[lw_flexo]], [[lw_qdrpl]] , [[lw_natopt]] or [[timdisp]] input variables. * 66 --> GW using Lanczos-Sternheimer, see input variables whose name start with `gwls_*`. * 99 --> Bethe-Salpeter calculation (BSE), routine *bethe_salpeter* @@ -14868,36 +15902,38 @@ to 1 automatically. These input variables ([[rfphon]], [[rfddk]], [[rfelfd]], and [[rfstrs]]) must be zero if **optdriver** is not set to 1. """, - ), - Variable( - abivarname="optforces", - varset="dev", - vartype="integer", - topics=["ForcesStresses_basic"], - dimensions="scalar", - defaultval=ValueWithConditions({"[[toldff]] or [[tolrff]] != 0": 1, "defaultval": 2}), - mnemonics="OPTions for the calculation of FORCES", - characteristics=["[[DEVELOP]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="optforces", + varset="dev", + vartype="integer", + topics=["ForcesStresses_basic"], + dimensions="scalar", + defaultval=ValueWithConditions({"[[toldff]] or [[tolrff]] != 0": 1, "defaultval": 2}), + mnemonics="OPTions for the calculation of FORCES", + characteristics=["[[DEVELOP]]"], + added_in_version="before_v9", + text=r""" Allows to choose options for the calculation of forces. * **optforces** = 0: the forces are set to zero, and many steps of the computation of forces are skipped * **optforces** = 1: calculation of forces at each SCF iteration, allowing to use forces as criterion to stop the SCF cycles * **optforces** = 2: calculation of forces at the end of the SCF iterations (like the stresses) """, - ), - Variable( - abivarname="optnlxccc", - varset="dev", - vartype="integer", - topics=["xc_expert"], - dimensions="scalar", - defaultval=1, - mnemonics="OPTion for the calculation of Non-Linear eXchange-Correlation Core Correction", - characteristics=["[[DEVELOP]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="optnlxccc", + varset="dev", + vartype="integer", + topics=["xc_expert"], + dimensions="scalar", + defaultval=1, + mnemonics="OPTion for the calculation of Non-Linear eXchange-Correlation Core Correction", + characteristics=["[[DEVELOP]]"], + added_in_version="before_v9", + text=r""" Allows to choose options for the calculation of non-linear XC correction. At present, only relevant for the FHI type of pseudopotentials, with pspcod=6. @@ -14905,17 +15941,18 @@ function (computed in this routine, while splined in the other parts of the code) * **optnlxccc** = 2: consistent calculation derivatives, in the `psp6cc_dhr.f` routine from DHamann. """, - ), - Variable( - abivarname="optstress", - varset="gstate", - vartype="integer", - topics=["ForcesStresses_basic"], - dimensions="scalar", - defaultval=1, - mnemonics="OPTion for the computation of STRESS", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="optstress", + varset="gstate", + vartype="integer", + topics=["ForcesStresses_basic"], + dimensions="scalar", + defaultval=1, + mnemonics="OPTion for the computation of STRESS", + added_in_version="before_v9", + text=r""" If set to 1, the computation of stresses is done, in the SCF case (under the conditions [[iscf]] > 0, [[prtstm]] == 0, [[positron]] == 0, and either [[nstep]] >0 or [[irdwfk]] == 1). @@ -14923,23 +15960,24 @@ can skip the computation of stresses. The CPU time saving might be interesting for some PAW calculations. """, - ), - Variable( - abivarname="orbmag", - varset="dfpt", - vartype="integer", - topics=["NMR_basic", "MagField_expert"], - dimensions="scalar", - defaultval=0, - mnemonics="ORBital MAGnetization", - characteristics=["[[DEVELOP]]"], - requires="""[[usepaw]] == 1; +), + +Variable( + abivarname="orbmag", + varset="dfpt", + vartype="integer", + topics=["NMR_basic","MagField_expert"], + dimensions="scalar", + defaultval=0, + mnemonics="ORBital MAGnetization", + characteristics=["[[DEVELOP]]"], + requires="""[[usepaw]] == 1; [[usexcnhat]] == 0; [[paral_atom]] == 0; [[paral_kgb]] == 0; ([[kptopt]] == 3 or [[kptopt]] == 0) """, - added_in_version="before_v9", - text=r""" + added_in_version="before_v9", + text=r""" Compute quantities related to orbital magnetic moment. Typically used in the presence of a nonzero nuclear magnetic dipole moment, see [[nucdipmom]], to compute the nuclear magnetic shielding as measured in NMR. [[orbmag]] @@ -14958,20 +15996,21 @@ * [[orbmag]] = 1: Compute orbital magnetization and Chern vector * [[orbmag]] = 2: Same as [[orbmag]] 1 but also print out values of each term making up total -orbital magnetic moment and a band-by-band decomposition. -""", - ), - Variable( - abivarname="ortalg", - varset="dev", - vartype="integer", - topics=["TuningSpeedMem_expert"], - dimensions="scalar", - defaultval=ValueWithConditions({"[[wfoptalg]] >= 10 ": -2, "defaultval": 2}), - mnemonics="ORThogonalisation ALGorithm", - characteristics=["[[DEVELOP]]"], - added_in_version="before_v9", - text=r""" +orbital magnetic moment. +""", +), + +Variable( + abivarname="ortalg", + varset="dev", + vartype="integer", + topics=["TuningSpeedMem_expert"], + dimensions="scalar", + defaultval=ValueWithConditions({"[[wfoptalg]] >= 10 ": -2, "defaultval": 2}), + mnemonics="ORThogonalisation ALGorithm", + characteristics=["[[DEVELOP]]"], + added_in_version="before_v9", + text=r""" Allows to choose the algorithm for orthogonalisation. Positive or zero values make two projections per line minimisation, one before the preconditioning, one after. This is the clean application of the band-by- @@ -14986,17 +16025,18 @@ The maximal value is presently 4 and -4. Tests have shown that **ortalg** = 2 or -2 is suitable for use on the available platforms. """, - ), - Variable( - abivarname="papiopt", - varset="dev", - vartype="integer", - topics=["Control_expert"], - dimensions="scalar", - defaultval=0, - mnemonics="PAPI OPTion", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="papiopt", + varset="dev", + vartype="integer", + topics=["Control_expert"], + dimensions="scalar", + defaultval=0, + mnemonics="PAPI OPTion", + added_in_version="before_v9", + text=r""" [PAPI](http://icl.cs.utk.edu/papi/index.html) aims to provide the tool designer and application engineer with a consistent interface and methodology for use of the performance counter hardware found in most major @@ -15008,17 +16048,18 @@ routine. All the timing output of ABINIT is then done with PAPI values. The measurements are more accurate and give also access to the flops of the calculation. """, - ), - Variable( - abivarname="paral_atom", - varset="paral", - vartype="integer", - topics=["parallelism_basic"], - dimensions="scalar", - defaultval=1, - mnemonics="activate PARALlelization over (paw) ATOMic sites", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="paral_atom", + varset="paral", + vartype="integer", + topics=["parallelism_basic"], + dimensions="scalar", + defaultval=1, + mnemonics="activate PARALlelization over (paw) ATOMic sites", + added_in_version="before_v9", + text=r""" Relevant only for PAW calculations. This keyword controls the parallel distribution of memory over atomic sites. Calculations are also distributed using the "kpt-band" communicator. @@ -15026,18 +16067,19 @@ This parallelization concerns only a small part of the whole calculation in the sequential case. When using parallelism, it might be that this small part becomes predominant if [[paral_atom]] is not activated. -""", - ), - Variable( - abivarname="paral_kgb", - varset="paral", - vartype="integer", - topics=["parallelism_basic"], - dimensions="scalar", - defaultval=0, - mnemonics="activate PARALlelization over K-point, G-vectors and Bands", - added_in_version="before_v9", - text=r""" +""" +), + +Variable( + abivarname="paral_kgb", + varset="paral", + vartype="integer", + topics=["parallelism_basic"], + dimensions="scalar", + defaultval=0, + mnemonics="activate PARALlelization over K-point, G-vectors and Bands", + added_in_version="before_v9", + text=r""" !!! note @@ -15094,17 +16136,18 @@ corresponding values for [[np_spkpt]], [[npfft]], [[npband]],[[bandpp]] and possibly [[npspinor]] in the input file. """, - ), - Variable( - abivarname="paral_rf", - varset="paral", - vartype="integer", - topics=["parallelism_basic"], - dimensions="scalar", - defaultval=0, - mnemonics="Activate PARALlelization over Response Function perturbations", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="paral_rf", + varset="paral", + vartype="integer", + topics=["parallelism_basic"], + dimensions="scalar", + defaultval=0, + mnemonics="Activate PARALlelization over Response Function perturbations", + added_in_version="before_v9", + text=r""" This parameter activates the parallelization over perturbations which can be used during RF-Calculation. It is possible to use this type of parallelization in combination to the parallelization over k-points. @@ -15117,39 +16160,37 @@ **paral_rf** can be specified separately for each dataset. """, - ), - Variable( - abivarname="paw_add_core", - varset="paw", - vartype="integer", - topics=["PAW_useful"], - dimensions="scalar", - defaultval=0, - mnemonics="PAW - ADD CORE contribution to total energy", - requires="[[usepaw]] == 1", - added_in_version="v10", - text=r""" +), + +Variable( + abivarname="paw_add_core", + varset="paw", + vartype="integer", + topics=["PAW_useful"], + dimensions="scalar", + defaultval=0, + mnemonics="PAW - ADD CORE contribution to total energy", + requires="[[usepaw]] == 1", + added_in_version="v10", + text=r""" If [[paw_add_core]] is activated (set to 1), then the core-electron contributions are added to the total energy displayed during the iterations and at the end of the calculation. These include the kinetic, electrostatic, and exchange-correlation contributions. By default, this variable is not activated, and the core contributions are only listed at the end of the calculation, without being added to the total energy. This feature is available only when the PAW atomic data are in [PAW-XML](https://esl.cecam.org/en/data/paw-xml/) format. """, - ), - Variable( - abivarname="pawcpxocc", - varset="paw", - vartype="integer", - topics=["PAW_expert"], - dimensions="scalar", - defaultval=ValueWithConditions( - { - '[[optdriver]] == 0 and [[moldyn]] /= "none" and [[pawspnorb]] == 1 and [[iscf]] >= 10 and ([[kptopt]] !=1 or [[kptopt]]!=2) and [[usepaw]] == 1': 2, - "defaultval": 1, - } - ), - mnemonics="PAW - use ComPleX rhoij OCCupancies", - requires="[[usepaw]] == 1", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="pawcpxocc", + varset="paw", + vartype="integer", + topics=["PAW_expert"], + dimensions="scalar", + defaultval=ValueWithConditions({'[[optdriver]] == 0 and [[moldyn]] /= "none" and [[pawspnorb]] == 1 and [[iscf]] >= 10 and ([[kptopt]] !=1 or [[kptopt]]!=2) and [[usepaw]] == 1': 2, + "defaultval": 1}), + mnemonics="PAW - use ComPleX rhoij OCCupancies", + requires="[[usepaw]] == 1", + added_in_version="before_v9", + text=r""" The only possible values for [[pawcpxocc]] are 1 or 2. When [[pawcpxocc]] == 1, "direct" decomposition of total energy cannot be printed out. @@ -15168,36 +16209,38 @@ In order to save CPU time, when molecular dynamics is selected ([[moldyn]] is not "none"). and SCF mixing done on density ([[iscf]] >= 10), [[pawcpxocc]] = 2 is (by default) set to **1**. """, - ), - Variable( - abivarname="pawcross", - varset="paw", - vartype="integer", - topics=["DFPT_expert"], - dimensions="scalar", - defaultval=0, - mnemonics="PAW - add CROSS term in oscillator strengths", - requires="([[optdriver]] == 3 or [[optdriver]] == 4) and [[usepaw]] == 1", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="pawcross", + varset="paw", + vartype="integer", + topics=["DFPT_expert"], + dimensions="scalar", + defaultval=0, + mnemonics="PAW - add CROSS term in oscillator strengths", + requires="([[optdriver]] == 3 or [[optdriver]] == 4) and [[usepaw]] == 1", + added_in_version="before_v9", + text=r""" When **pawcross=1**, the overlap between the plane-wave part of one band and the on-site part of an other is taken into account in the computation of the oscillator strengths. Hence, the completeness of the on-site basis is no longer assumed. """, - ), - Variable( - abivarname="pawecutdg", - varset="paw", - vartype="real", - topics=["Planewaves_compulsory", "PAW_compulsory"], - dimensions="scalar", - defaultval=-1, - mnemonics="PAW - Energy CUToff for the Double Grid", - characteristics=["[[ENERGY]]"], - commentdefault="pawecutdg MUST be specified for PAW calculations.", - requires="[[usepaw]] == 1", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="pawecutdg", + varset="paw", + vartype="real", + topics=["Planewaves_compulsory", "PAW_compulsory"], + dimensions="scalar", + defaultval=-1, + mnemonics="PAW - Energy CUToff for the Double Grid", + characteristics=["[[ENERGY]]"], + commentdefault="pawecutdg MUST be specified for PAW calculations.", + requires="[[usepaw]] == 1", + added_in_version="before_v9", + text=r""" Define the energy cut-off for the fine FFT grid (the "double grid", that allows one to transfer data from the normal, coarse, FFT grid to the spherical grid around each atom). @@ -15217,18 +16260,19 @@ the two values of the "Compensation charge inside spheres", a quantity written in the log file. """, - ), - Variable( - abivarname="pawfatbnd", - varset="paw", - vartype="integer", - topics=["PAW_useful", "ElecBandStructure_useful", "AtomCentered_useful"], - dimensions="scalar", - defaultval=0, - mnemonics="PAW: print band structure in the FAT-BaND representation", - requires="[[usepaw]] == 1", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="pawfatbnd", + varset="paw", + vartype="integer", + topics=["PAW_useful", "ElecBandStructure_useful", "AtomCentered_useful"], + dimensions="scalar", + defaultval=0, + mnemonics="PAW: print band structure in the FAT-BaND representation", + requires="[[usepaw]] == 1", + added_in_version="before_v9", + text=r""" For Ground-State calculations using PAW and non self-consistent calculations only. This option can be used to plot band structure. For each atom (specified by [[natsph]] and [[iatsph]]), each angular momentum, and each spin polarisation, @@ -15244,18 +16288,19 @@ * 1: The fatbands are only resolved in L. * 2: The fatbands are resolved in L and M. """, - ), - Variable( - abivarname="pawlcutd", - varset="paw", - vartype="integer", - topics=["PAW_expert"], - dimensions="scalar", - defaultval=10, - mnemonics="PAW - L angular momentum used to CUT the development in moments of the Densities", - requires="[[usepaw]] == 1", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="pawlcutd", + varset="paw", + vartype="integer", + topics=["PAW_expert"], + dimensions="scalar", + defaultval=10, + mnemonics="PAW - L angular momentum used to CUT the development in moments of the Densities", + requires="[[usepaw]] == 1", + added_in_version="before_v9", + text=r""" The expansion of the densities in angular momenta is performed up to l=[[pawlcutd]]. Note that, for a given system, the maximum value of [[pawlcutd]] is @@ -15267,18 +16312,19 @@ quantities, like forces, but also on the two values of the "Compensation charge inside spheres", a quantity written in the log file. """, - ), - Variable( - abivarname="pawlmix", - varset="paw", - vartype="integer", - topics=["PAW_expert"], - dimensions="scalar", - defaultval=10, - mnemonics="PAW - maximum L used in the spherical part MIXing", - requires="[[usepaw]] == 1", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="pawlmix", + varset="paw", + vartype="integer", + topics=["PAW_expert"], + dimensions="scalar", + defaultval=10, + mnemonics="PAW - maximum L used in the spherical part MIXing", + requires="[[usepaw]] == 1", + added_in_version="before_v9", + text=r""" The choice made for this variable determine how the spherical part of the density is mixed during electronic iterations. @@ -15288,18 +16334,19 @@ This option is useful to save CPU time but DOES have a bearing on the numerical accuracy of the results. """, - ), - Variable( - abivarname="pawmixdg", - varset="paw", - vartype="integer", - topics=["PAW_expert"], - dimensions="scalar", - defaultval=ValueWithConditions({"[[npfft]] == 1": 0, "defaultval": 1}), - mnemonics="PAW - MIXing is done (or not) on the (fine) Double Grid", - requires="[[usepaw]] == 1", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="pawmixdg", + varset="paw", + vartype="integer", + topics=["PAW_expert"], + dimensions="scalar", + defaultval=ValueWithConditions({"[[npfft]] == 1": 0, "defaultval": 1}), + mnemonics="PAW - MIXing is done (or not) on the (fine) Double Grid", + requires="[[usepaw]] == 1", + added_in_version="before_v9", + text=r""" The choice made for this variable determines the grid on which the density (or potential) is mixed during the SCF cycle. @@ -15323,18 +16370,19 @@ - A value of 0 is not allowed. - Density/potential is mixed in REAL space (Here only one grid is used). """, - ), - Variable( - abivarname="pawnhatxc", - varset="paw", - vartype="integer", - topics=["PAW_expert"], - dimensions="scalar", - defaultval=1, - mnemonics="PAW - Flag for exact computation of gradients of NHAT density in eXchange-Correlation.", - requires="[[usepaw]] == 1", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="pawnhatxc", + varset="paw", + vartype="integer", + topics=["PAW_expert"], + dimensions="scalar", + defaultval=1, + mnemonics="PAW - Flag for exact computation of gradients of NHAT density in eXchange-Correlation.", + requires="[[usepaw]] == 1", + added_in_version="before_v9", + text=r""" Relevant only when a GGA exchange-correlation functional is used. When this flag is activated, the gradients of compensation charge density (n_hat) are exactly computed (i.e. analytically); when it is deactivated, they @@ -15345,48 +16393,51 @@ accuracy can be affected by this choice. It is recommended to test the validity of this approximation before use. """, - ), - Variable( - abivarname="pawnphi", - varset="paw", - vartype="integer", - topics=["PAW_expert"], - dimensions="scalar", - defaultval=13, - mnemonics="PAW - Number of PHI angles used to discretize the sphere around each atom.", - requires="[[usepaw]] == 1", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="pawnphi", + varset="paw", + vartype="integer", + topics=["PAW_expert"], + dimensions="scalar", + defaultval=13, + mnemonics="PAW - Number of PHI angles used to discretize the sphere around each atom.", + requires="[[usepaw]] == 1", + added_in_version="before_v9", + text=r""" Number of phi angles (longitude) used to discretize the data on the atomic spheres. This discretization is completely defined by [[pawnphi]] and [[pawntheta]]. """, - ), - Variable( - abivarname="pawntheta", - varset="paw", - vartype="integer", - topics=["PAW_expert"], - dimensions="scalar", - defaultval=12, - mnemonics="PAW - Number of THETA angles used to discretize the sphere around each atom.", - requires="[[usepaw]] == 1", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="pawntheta", + varset="paw", + vartype="integer", + topics=["PAW_expert"], + dimensions="scalar", + defaultval=12, + mnemonics="PAW - Number of THETA angles used to discretize the sphere around each atom.", + requires="[[usepaw]] == 1", + added_in_version="before_v9", + text=r""" Number of theta angles (latitude) used to discretize the data on the atomic spheres. This discretization is completely defined by [[pawntheta]] and [[pawnphi]]. """, - ), - Variable( - abivarname="pawnzlm", - varset="paw", - vartype="integer", - topics=["PAW_expert"], - dimensions="scalar", - defaultval=1, - mnemonics="PAW - only compute Non-Zero LM-moments of the contributions to the density from the spheres", - requires="[[usepaw]] == 1", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="pawnzlm", + varset="paw", + vartype="integer", + topics=["PAW_expert"], + dimensions="scalar", + defaultval=1, + mnemonics="PAW - only compute Non-Zero LM-moments of the contributions to the density from the spheres", + requires="[[usepaw]] == 1", + added_in_version="before_v9", + text=r""" Concerns the computation of the contributions to the density from the spheres (named rho_1 - rho_tild_1). If set to 0, all lm-moments of the sphere contributions to the density are @@ -15396,18 +16447,19 @@ the first iteration then only those found to be non-zero will be computed; thus the first iteration is more cpu intensive) """, - ), - Variable( - abivarname="pawoptmix", - varset="paw", - vartype="integer", - topics=["PAW_expert"], - dimensions="scalar", - defaultval=0, - mnemonics="PAW - OPTion for the MIXing of the spherical part", - requires="[[usepaw]] == 1", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="pawoptmix", + varset="paw", + vartype="integer", + topics=["PAW_expert"], + dimensions="scalar", + defaultval=0, + mnemonics="PAW - OPTion for the MIXing of the spherical part", + requires="[[usepaw]] == 1", + added_in_version="before_v9", + text=r""" In the case of PAW computations, during the self-consistent cycle, ABINIT mixes the density $\rho(r)= \tilde{\rho}(r) +\hat{\rho}(r)$ and the occupancy matrix $\rho_{ij}$. ($\tilde{\rho}(r)$ is the pseudo density, $\hat{\rho}(r)$ is the compensation charge density). It can be @@ -15426,17 +16478,18 @@ history (see [[npulayit]]). Then it is also possible to play with the parameters of the Kerker mixing: [[diemix]], [[diemac]], etc... """, - ), - Variable( - abivarname="pawoptosc", - varset="paw", - vartype="integer", - topics=["Susceptibility_expert", "BSE_expert", "SelfEnergy_expert"], - dimensions="scalar", - defaultval=0, - mnemonics="PAW - OPTion for the computation of the OSCillator matrix elements", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="pawoptosc", + varset="paw", + vartype="integer", + topics=["Susceptibility_expert", "BSE_expert", "SelfEnergy_expert"], + dimensions="scalar", + defaultval=0, + mnemonics="PAW - OPTion for the computation of the OSCillator matrix elements", + added_in_version="before_v9", + text=r""" Only relevant for GW or Bethe-Salpeter calculations with PAW. This variable defines the approach used for the evaluation of the oscillator matrix elements within the PAW formalism. Possible values are 0,1,2. @@ -15448,18 +16501,19 @@ If [[pawoptosc]] = 2 the matrix elements are computed with the approximated expression proposed by [[cite:Shishkin2006]]. """, - ), - Variable( - abivarname="pawovlp", - varset="paw", - vartype="real", - topics=["PAW_useful"], - dimensions="scalar", - defaultval=5.0, - mnemonics="PAW - spheres OVerLaP allowed (in percentage)", - requires="[[usepaw]] == 1", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="pawovlp", + varset="paw", + vartype="real", + topics=["PAW_useful"], + dimensions="scalar", + defaultval=5.0, + mnemonics="PAW - spheres OVerLaP allowed (in percentage)", + requires="[[usepaw]] == 1", + added_in_version="before_v9", + text=r""" When PAW is activated, a localized atomic basis is added to describe wave functions. Spheres around atoms are defined and they are IN PRINCIPLE not allowed to overlap. However, a small overlap can be allowed without @@ -15479,65 +16533,69 @@ or [[imgmov]]/=0, but only at the second time in the same dataset. Indeed, such trespassing might only be transient. However, a second trespassing in the same dataset, or if both [[geoopt]] or [[moldyn]] are set to "none" and [[imgmov]]=0, will induce stop. """, - ), - Variable( - abivarname="pawprt_b", - varset="dev", - vartype="integer", - topics=["PAW_expert"], - dimensions="scalar", - defaultval=0, - mnemonics="PAW PRinT band", - characteristics=["[[DEVELOP]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="pawprt_b", + varset="dev", + vartype="integer", + topics=["PAW_expert"], + dimensions="scalar", + defaultval=0, + mnemonics="PAW PRinT band", + characteristics=["[[DEVELOP]]"], + added_in_version="before_v9", + text=r""" Forces the output of the all-electron wavefunction for only a single band. To be used in conjunction with: [[pawprtwf]] = 1 and [[pawprt_k]]. The indexing of the bands start with one for the lowest occupied band and goes up from there. """, - ), - Variable( - abivarname="pawprt_k", - varset="dev", - vartype="integer", - topics=["PAW_expert"], - dimensions="scalar", - defaultval=0, - mnemonics="PAW PRinT K-point", - characteristics=["[[DEVELOP]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="pawprt_k", + varset="dev", + vartype="integer", + topics=["PAW_expert"], + dimensions="scalar", + defaultval=0, + mnemonics="PAW PRinT K-point", + characteristics=["[[DEVELOP]]"], + added_in_version="before_v9", + text=r""" Forces the output of the all-electron wavefunction for only a single k-point. To be used in conjunction with: [[pawprtwf]] = 1 and [[pawprt_b]]. The indexing follows the order in output of the internal variable **kpt** in the beginning of the run. """, - ), - Variable( - abivarname="pawprtden", - varset="paw", - vartype="integer", - topics=["PAW_useful"], - dimensions="scalar", - defaultval=0, - mnemonics="PAW: PRinT total physical electron DENsity", - requires="[[usepaw]] == 1", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="pawprtden", + varset="paw", + vartype="integer", + topics=["PAW_useful"], + dimensions="scalar", + defaultval=0, + mnemonics="PAW: PRinT total physical electron DENsity", + requires="[[usepaw]] == 1", + added_in_version="before_v9", + text=r""" **Deprecated:** See the [[prtden]]. """, - ), - Variable( - abivarname="pawprtdos", - varset="paw", - vartype="integer", - topics=["PAW_useful", "ElecDOS_useful", "AtomCentered_useful"], - dimensions="scalar", - defaultval=0, - mnemonics="PAW: PRinT partial DOS contributions", - requires="[[usepaw]] == 1 and [[prtdos]] == 3", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="pawprtdos", + varset="paw", + vartype="integer", + topics=["PAW_useful", "ElecDOS_useful", "AtomCentered_useful"], + dimensions="scalar", + defaultval=0, + mnemonics="PAW: PRinT partial DOS contributions", + requires="[[usepaw]] == 1 and [[prtdos]] == 3", + added_in_version="before_v9", + text=r""" This input variable controls the computation and/or printing of contributions to the PAW partial DOS in _DOS file(s): @@ -15563,18 +16621,19 @@ local basis is complete, (2) the electronic charge is mostly contained in PAW spheres. - In that case, the [[ratsph]] variable is automatically set to the PAW radius. """, - ), - Variable( - abivarname="pawprtvol", - varset="paw", - vartype="integer", - topics=["PAW_expert"], - dimensions="scalar", - defaultval=0, - mnemonics="PAW: PRinT VOLume", - requires="[[usepaw]] == 1", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="pawprtvol", + varset="paw", + vartype="integer", + topics=["PAW_expert"], + dimensions="scalar", + defaultval=0, + mnemonics="PAW: PRinT VOLume", + requires="[[usepaw]] == 1", + added_in_version="before_v9", + text=r""" Control print volume and debugging output for PAW in log file or standard output. If set to 0, the print volume is at its minimum. **pawprtvol** can have values from -3 to 3: @@ -15590,18 +16649,19 @@ 1st and last atom are printed. When **pawprtvol** < 0, all components of $\rho_{ij}$ and $D_{ij}$ matrices for all atoms are printed. """, - ), - Variable( - abivarname="pawprtwf", - varset="paw", - vartype="integer", - topics=["PAW_useful"], - dimensions="scalar", - defaultval=0, - mnemonics="PAW: PRinT WaveFunctions", - requires="[[usepaw]] == 1", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="pawprtwf", + varset="paw", + vartype="integer", + topics=["PAW_useful"], + dimensions="scalar", + defaultval=0, + mnemonics="PAW: PRinT WaveFunctions", + requires="[[usepaw]] == 1", + added_in_version="before_v9", + text=r""" This input variable controls the output of the **full** PAW wave functions including the on-site contributions inside each PAW sphere needed to reconstruct the correct nodal shape in the augmentation region. @@ -15619,18 +16679,19 @@ output, but a single band and k-point index can be requested by using the variables [[pawprt_b]] and [[pawprt_k]]. """, - ), - Variable( - abivarname="pawspnorb", - varset="paw", - vartype="integer", - topics=["PAW_useful", "spinpolarisation_useful"], - dimensions="scalar", - defaultval=ValueWithConditions({"[[nspinor]] == 2": 1, "defaultval": 0}), - mnemonics="PAW - option for SPiN-ORBit coupling", - requires="[[usepaw]] == 1", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="pawspnorb", + varset="paw", + vartype="integer", + topics=["PAW_useful", "spinpolarisation_useful"], + dimensions="scalar", + defaultval=ValueWithConditions({"[[nspinor]] == 2": 1, "defaultval": 0}), + mnemonics="PAW - option for SPiN-ORBit coupling", + requires="[[usepaw]] == 1", + added_in_version="before_v9", + text=r""" When PAW is activated, the **spin-orbit coupling** as derived from the zero-order regular approximation to relativistic effects (ZORA) can be added without the @@ -15661,18 +16722,19 @@ reversal symmetry has to be avoided. An artificial scaling of the spin-orbit can be introduced thanks to the [[spnorbscl]] input variable. """, - ), - Variable( - abivarname="pawstgylm", - varset="paw", - vartype="integer", - topics=["PAW_expert"], - dimensions="scalar", - defaultval=1, - mnemonics="PAW - option for the STorage of G_l(r).YLM(r)", - requires="[[usepaw]] = 1", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="pawstgylm", + varset="paw", + vartype="integer", + topics=["PAW_expert"], + dimensions="scalar", + defaultval=1, + mnemonics="PAW - option for the STorage of G_l(r).YLM(r)", + requires="[[usepaw]] = 1", + added_in_version="before_v9", + text=r""" When PAW is activated, the computation of compensation charge density (so called "hat" density) requires the computation of $g_{l}(r).Y_{lm}(r)$ factors (and cartesian derivatives) at each point of real space contained in PAW spheres. @@ -15691,18 +16753,19 @@ $Y_{lm}(r)$ are real spherical harmonics """, - ), - Variable( - abivarname="pawsushat", - varset="paw", - vartype="integer", - topics=["PAW_expert"], - dimensions="scalar", - defaultval=0, - mnemonics="PAW - SUSceptibility, inclusion of HAT (compensation charge) contribution", - requires="[[usepaw]] == 1 and [[optdriver]] == 0", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="pawsushat", + varset="paw", + vartype="integer", + topics=["PAW_expert"], + dimensions="scalar", + defaultval=0, + mnemonics="PAW - SUSceptibility, inclusion of HAT (compensation charge) contribution", + requires="[[usepaw]] == 1 and [[optdriver]] == 0", + added_in_version="before_v9", + text=r""" Ground-State calculation only. When a sophisticated preconditioning scheme is selected for the SCF cycle of a Ground-State calculation ([[iprcel]] > 0), the computation of the susceptibility @@ -15719,64 +16782,68 @@ - [[pawsushat]] = 0: only plane-wave contribution to suscep. matrix is computed. - [[pawsushat]] = 1: the whole suscep. matrix (PW + PAW on-site) is computed. """, - ), - Variable( - abivarname="pawujat", - varset="dev", - vartype="integer", - topics=["DFT+U_expert"], - dimensions="scalar", - defaultval=1, - mnemonics="PAW+macro_UJ, ATom number", - characteristics=["[[DEVELOP]]"], - commentdefault=" i.e. the first atom treated with PAW+U.", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="pawujat", + varset="dev", + vartype="integer", + topics=["DFT+U_expert"], + dimensions="scalar", + defaultval=1, + mnemonics="PAW+macro_UJ, ATom number", + characteristics=["[[DEVELOP]]"], + commentdefault=" i.e. the first atom treated with PAW+U.", + added_in_version="before_v9", + text=r""" Determines the atom for which U (or J) should be determined. See also [[macro_uj]]. """, - ), - Variable( - abivarname="pawujrad", - varset="dev", - vartype="real", - topics=["DFT+U_expert"], - dimensions="scalar", - defaultval=ValueWithUnit(units="a.u.", value=20), - mnemonics="PAW+macro_UJ, sphere RADius", - characteristics=["[[DEVELOP]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="pawujrad", + varset="dev", + vartype="real", + topics=["DFT+U_expert"], + dimensions="scalar", + defaultval=ValueWithUnit(units="a.u.", value=20), + mnemonics="PAW+macro_UJ, sphere RADius", + characteristics=["[[DEVELOP]]"], + added_in_version="before_v9", + text=r""" The sphere radius serves to extrapolate the U value calculated at r_paw to a larger sphere radius. See also [[macro_uj]]. As most projector functions are localized within r_paw to ≈80%, 20 a.u. contains ≈100% of the wavefunction and corresponds to r_paw -> ∞. """, - ), - Variable( - abivarname="pawujv", - varset="dev", - vartype="real", - topics=["DFT+U_expert"], - dimensions="scalar", - defaultval=ValueWithUnit(units="eV", value=0.1), - mnemonics="PAW+macro_UJ, potential shift (V)", - characteristics=["[[DEVELOP]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="pawujv", + varset="dev", + vartype="real", + topics=["DFT+U_expert"], + dimensions="scalar", + defaultval=ValueWithUnit(units="eV", value=0.1), + mnemonics="PAW+macro_UJ, potential shift (V)", + characteristics=["[[DEVELOP]]"], + added_in_version="before_v9", + text=r""" Amplitude of the potential shift for the determination of U (or J). See also [[macro_uj]]. """, - ), - Variable( - abivarname="pawusecp", - varset="paw", - vartype="integer", - topics=["PAW_expert"], - dimensions="scalar", - defaultval=1, - mnemonics="PAW - option for the USE of CPrj in memory (cprj=WF projected with NL projector)", - requires="[[usepaw]] == 1", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="pawusecp", + varset="paw", + vartype="integer", + topics=["PAW_expert"], + dimensions="scalar", + defaultval=1, + mnemonics="PAW - option for the USE of CPrj in memory (cprj=WF projected with NL projector)", + requires="[[usepaw]] == 1", + added_in_version="before_v9", + text=r""" When PAW is activated, the computation of cprj arrays is memory and time consuming. When [[pawusecp]] = 0, then the cprj are never kept in memory, they are recomputed when needed (this is CPU-time consuming). When [[pawusecp]] = 1, then @@ -15790,18 +16857,19 @@ For the time being, only activated for RF calculations. """, - ), - Variable( - abivarname="pawxcdev", - varset="paw", - vartype="integer", - topics=["PAW_useful"], - dimensions="scalar", - defaultval=1, - mnemonics="PAW - choice for eXchange-Correlation DEVelopment (spherical part)", - requires="[[usepaw]] == 1", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="pawxcdev", + varset="paw", + vartype="integer", + topics=["PAW_useful"], + dimensions="scalar", + defaultval=1, + mnemonics="PAW - choice for eXchange-Correlation DEVelopment (spherical part)", + requires="[[usepaw]] == 1", + added_in_version="before_v9", + text=r""" * If set to 0, the exchange-correlation term in the spherical part of energy is totally computed on the angular mesh (time consuming but exact!) * If set to 1, the exchange-correlation term in the spherical part of energy is developed onto lm-moments at order 1 * If set to 2, the exchange-correlation term in the spherical part of energy is developed onto lm-moments at order 2 @@ -15809,34 +16877,36 @@ Be careful: Response function (DFPT) + PAW + GGA requires [[pawxcdev]] = 0. But if you plan to do DFPT calculations, it is better to use this option also in the preliminary ground state calculation. However, if [[nspden]] = 4 (non-collinear calculations) with GGA and [[usepawu]]/=0, one needs to use [[pawxcdev]] = 1. """, - ), - Variable( - abivarname="ph_intmeth", - varset="eph", - vartype="integer", - topics=["q-points_useful"], - dimensions="scalar", - defaultval=2, - mnemonics="PHonons: INTegration METHod", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="ph_intmeth", + varset="eph", + vartype="integer", + topics=["q-points_useful"], + dimensions="scalar", + defaultval=2, + mnemonics="PHonons: INTegration METHod", + added_in_version="before_v9", + text=r""" Select the integration technique for computing the phonon DOS and the Eliashberg function $\alpha^2F(\omega)$. * 1 --> Gaussian scheme (see also [[ph_smear]] for the broadening). * 2 --> Tetrahedron method (no other input is needed but at least 4 q-points in the BZ are required). """, - ), - Variable( - abivarname="ph_ndivsm", - varset="eph", - vartype="integer", - topics=["q-points_useful"], - dimensions="scalar", - defaultval=20, - mnemonics="PHonons: Number of DIVisions for sampling the SMallest segment", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="ph_ndivsm", + varset="eph", + vartype="integer", + topics=["q-points_useful"], + dimensions="scalar", + defaultval=20, + mnemonics="PHonons: Number of DIVisions for sampling the SMallest segment", + added_in_version="before_v9", + text=r""" This variable is used in conjunction with [[ph_nqpath]] and [[ph_qpath]] to define the q-path used for phonon band structures and phonon linewidths. It gives the number of points used to sample the smallest segment in the q-path specified by [[ph_qpath]]. @@ -15844,124 +16914,132 @@ A negative value activates a specialized mode in which [[ph_nqpath]] and [[ph_qpath]] provide the full list of $\qq$-points to be used. """, - ), - Variable( - abivarname="ph_ngqpt", - varset="eph", - vartype="integer", - topics=["q-points_useful"], - dimensions=[3], - defaultval=[20, 20, 20], - mnemonics="PHonons: Number of Grid points for Q-PoinT mesh.", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="ph_ngqpt", + varset="eph", + vartype="integer", + topics=["q-points_useful"], + dimensions=[3], + defaultval=[20, 20, 20], + mnemonics="PHonons: Number of Grid points for Q-PoinT mesh.", + added_in_version="before_v9", + text=r""" This variable defines the q-mesh used to compute the phonon DOS and the Eliashberg function via Fourier interpolation. Related input variables: [[ph_qshift]] and [[ph_nqshift]]. """, - ), - Variable( - abivarname="ph_nqpath", - varset="eph", - vartype="integer", - topics=["q-points_useful"], - dimensions="scalar", - defaultval=0, - mnemonics="PHonons: Number of Q-points defining the PATH", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="ph_nqpath", + varset="eph", + vartype="integer", + topics=["q-points_useful"], + dimensions="scalar", + defaultval=0, + mnemonics="PHonons: Number of Q-points defining the PATH", + added_in_version="before_v9", + text=r""" This integer defines the number of points in the [[ph_qpath]] array. """, - ), - Variable( - abivarname="ph_nqshift", - varset="eph", - vartype="integer", - topics=["q-points_useful"], - dimensions="scalar", - defaultval=1, - mnemonics="PHonons: Number of Q-SHIFTs", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="ph_nqshift", + varset="eph", + vartype="integer", + topics=["q-points_useful"], + dimensions="scalar", + defaultval=1, + mnemonics="PHonons: Number of Q-SHIFTs", + added_in_version="before_v9", + text=r""" This variable defines the number of shifts in the q-mesh used for the phonon DOS and for the Eliashberg functions (see [[ph_ngqpt]]). If not given, the code assumes a Gamma-centered mesh. The shifts are specified by [[ph_qshift]]. """, - ), - Variable( - abivarname="ph_qpath", - varset="eph", - vartype="real", - topics=["q-points_useful"], - dimensions=[3, "ph_nqpath"], - defaultval="None", - mnemonics="Phonons: Q-PATH", - requires="specified([[ph_nqpath]])", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="ph_qpath", + varset="eph", + vartype="real", + topics=["q-points_useful"], + dimensions=[3, "ph_nqpath"], + defaultval="None", + mnemonics="Phonons: Q-PATH", + requires="specified([[ph_nqpath]])", + added_in_version="before_v9", + text=r""" This array contains the list of special q-points used to construct the q-path used to (Fourier) interpolate phonon band structures and phonon linewidths. See also [[ph_nqpath]] and [[ph_ndivsm]]. """, - ), - Variable( - abivarname="ph_qshift", - varset="eph", - vartype="real", - topics=["q-points_useful"], - dimensions=[3, "ph_nqshift"], - defaultval=[0, 0, 0], - mnemonics="PHonons: Q-SHIFTs for mesh.", - requires="[[ph_nqshift]]", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="ph_qshift", + varset="eph", + vartype="real", + topics=["q-points_useful"], + dimensions=[3, "ph_nqshift"], + defaultval=[0, 0, 0], + mnemonics="PHonons: Q-SHIFTs for mesh.", + requires="[[ph_nqshift]]", + added_in_version="before_v9", + text=r""" This array gives the shifts to be used to construct the q-mesh for computing the phonon DOS and the Eliashberg functions (see also [[ph_nqshift]]). If not given, a Gamma-centered mesh is used. """, - ), - Variable( - abivarname="ph_smear", - varset="eph", - vartype="real", - topics=["q-points_useful"], - dimensions="scalar", - defaultval="0.00002 Hartree", - mnemonics="PHonons: SMEARing factor", - characteristics=["[[ENERGY]]"], - requires="[[ph_intmeth]] == 1", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="ph_smear", + varset="eph", + vartype="real", + topics=["q-points_useful"], + dimensions="scalar", + defaultval="0.00002 Hartree", + mnemonics="PHonons: SMEARing factor", + characteristics=["[[ENERGY]]"], + requires="[[ph_intmeth]] == 1", + added_in_version="before_v9", + text=r""" The Gaussian broadening used for the integration of the phonon DOS and the Eliashberg function. See also [[ph_intmeth]] and [[ph_ngqpt]]. """, - ), - Variable( - abivarname="ph_wstep", - varset="eph", - vartype="real", - topics=["q-points_useful"], - dimensions="scalar", - defaultval="0.1 meV", - mnemonics="PHonons: frequency(W) STEP.", - characteristics=["[[ENERGY]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="ph_wstep", + varset="eph", + vartype="real", + topics=["q-points_useful"], + dimensions="scalar", + defaultval="0.1 meV", + mnemonics="PHonons: frequency(W) STEP.", + characteristics=["[[ENERGY]]"], + added_in_version="before_v9", + text=r""" The step used to generate the (linear) frequency mesh for the phonon DOS and the Eliashberg function. The extrema of the mesh are automatically computed by the code. """, - ), - Variable( - abivarname="pimass", - varset="rlx", - vartype="real", - topics=["PIMD_useful"], - dimensions=["[[ntypat]]"], - defaultval="[[ntypat]]", - mnemonics="Path Integral fictitious MASSes", - requires="[[imgmov]] = 9 or 13", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="pimass", + varset="rlx", + vartype="real", + topics=["PIMD_useful"], + dimensions=["[[ntypat]]"], + defaultval="[[ntypat]]", + mnemonics="Path Integral fictitious MASSes", + requires="[[imgmov]] = 9 or 13", + added_in_version="before_v9", + text=r""" Only relevant if [[imgmov]] = 9 or 13 (Path-Integral Molecular Dynamics). Gives the fictitious masses ( [[cite:Marx1996]]) in atomic mass units for each kind of atom in cell. These masses are the inertial masses used in performing Path Integral Molecular Dynamics (PIMD), they are different from the true masses ([[amu]]) used to @@ -15972,18 +17050,19 @@ If [[pitransform]] = 1 (normal mode transformation), or [[pitransform]] = 2 (staging transformation), [[pimass]] is automatically set to its optimal value. """, - ), - Variable( - abivarname="pimd_constraint", - varset="rlx", - vartype="integer", - topics=["PIMD_useful"], - dimensions="scalar", - defaultval=0, - mnemonics="Path-Integral Molecular Dynamics: CONSTRAINT to be applied on a reaction coordinate", - requires="[[imgmov]] = 9 or 13", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="pimd_constraint", + varset="rlx", + vartype="integer", + topics=["PIMD_useful"], + dimensions="scalar", + defaultval=0, + mnemonics="Path-Integral Molecular Dynamics: CONSTRAINT to be applied on a reaction coordinate", + requires="[[imgmov]] = 9 or 13", + added_in_version="before_v9", + text=r""" Only relevant for Path-Integral Molecular Dynamics. Selects a constraint to be applied during the PIMD trajectory. The constraint is holonomic (it is a relation between the position variables). In practice, @@ -16002,17 +17081,18 @@ [[iatcon]]([[natcon]]) and [[natcon]] input parameters (where [[nconeq]] is fixed to 1). More details on the implementation in [[cite:Komeiji2007]]. """, - ), - Variable( - abivarname="pitransform", - varset="rlx", - vartype="integer", - topics=["PIMD_useful"], - dimensions="scalar", - defaultval=0, - mnemonics="Path Integral coordinate TRANSFORMation", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="pitransform", + varset="rlx", + vartype="integer", + topics=["PIMD_useful"], + dimensions="scalar", + defaultval=0, + mnemonics="Path Integral coordinate TRANSFORMation", + added_in_version="before_v9", + text=r""" Only relevant if [[imgmov]] = 9 or 13 (Path-Integral Molecular Dynamics). Coordinate transformation used in the integration of the Path Integral Molecular Dynamics equations of motion. The transformation, with an @@ -16026,47 +17106,50 @@ If equal to 1, normal mode transformation (in that case, [[nimage]] must be absolutely EVEN). If equal to 2, staging transformation. """, - ), - Variable( - abivarname="plowan_bandf", - varset="dev", - vartype="integer", - topics=["Wannier_compulsory"], - dimensions="scalar", - defaultval=0, - mnemonics="Projected Local Orbital WANnier functions BAND Final", - characteristics=["[[DEVELOP]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="plowan_bandf", + varset="dev", + vartype="integer", + topics=["Wannier_compulsory"], + dimensions="scalar", + defaultval=0, + mnemonics="Projected Local Orbital WANnier functions BAND Final", + characteristics=["[[DEVELOP]]"], + added_in_version="before_v9", + text=r""" Gives the upper band to include in the calculation of Wannier functions """, - ), - Variable( - abivarname="plowan_bandi", - varset="dev", - vartype="integer", - topics=["Wannier_compulsory"], - dimensions="scalar", - defaultval=0, - mnemonics="Projected Local Orbital WANnier functions BAND Initial", - characteristics=["[[DEVELOP]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="plowan_bandi", + varset="dev", + vartype="integer", + topics=["Wannier_compulsory"], + dimensions="scalar", + defaultval=0, + mnemonics="Projected Local Orbital WANnier functions BAND Initial", + characteristics=["[[DEVELOP]]"], + added_in_version="before_v9", + text=r""" Gives the lower band to include in the calculation of Wannier functions """, - ), - Variable( - abivarname="plowan_compute", - varset="dev", - vartype="integer", - topics=["Wannier_compulsory"], - dimensions="scalar", - defaultval=0, - mnemonics="Projected Local Orbital WANnier functions COMPUTATION", - characteristics=["[[DEVELOP]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="plowan_compute", + varset="dev", + vartype="integer", + topics=["Wannier_compulsory"], + dimensions="scalar", + defaultval=0, + mnemonics="Projected Local Orbital WANnier functions COMPUTATION", + characteristics=["[[DEVELOP]]"], + added_in_version="before_v9", + text=r""" Activate computation of Projected Local Orbital Wannier functions (PLO Wannier) and corresponding band structure. Variables [[plowan_bandi]], @@ -16084,127 +17167,135 @@ [[plowan_it]]. The implementation is not symmetrized over k-point and not parallelized. (The calculation of projections is detailed in [[cite:Amadon2008]] ) """, - ), - Variable( - abivarname="plowan_iatom", - varset="dev", - vartype="integer", - topics=["Wannier_compulsory"], - dimensions="scalar", - defaultval=0, - mnemonics="Projected Local Orbital WANnier functions, Index of ATOM", - characteristics=["[[DEVELOP]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="plowan_iatom", + varset="dev", + vartype="integer", + topics=["Wannier_compulsory"], + dimensions="scalar", + defaultval=0, + mnemonics="Projected Local Orbital WANnier functions, Index of ATOM", + characteristics=["[[DEVELOP]]"], + added_in_version="before_v9", + text=r""" Gives the indices of the [[plowan_natom]] atoms on which the projections will be done. """, - ), - Variable( - abivarname="plowan_it", - varset="dev", - vartype="integer", - topics=["Wannier_useful"], - dimensions=[3, "[[plowan_nt]]"], - defaultval=0, - mnemonics="Projected Local Orbital WANnier functions, Index of Translation.", - characteristics=["[[DEVELOP]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="plowan_it", + varset="dev", + vartype="integer", + topics=["Wannier_useful"], + dimensions=[3, "[[plowan_nt]]"], + defaultval=0, + mnemonics="Projected Local Orbital WANnier functions, Index of Translation.", + characteristics=["[[DEVELOP]]"], + added_in_version="before_v9", + text=r""" Requires [[plowan_realspace]] to be greater than 0 and [[plowan_nt]] to be greater than 0. Precise a given set of selected real space translation by using the real space vectors basis. These atoms are used to define Wannier functions in real space. These real space Wannier functions are used as a basis to compute the Hamiltonian. """, - ), - Variable( - abivarname="plowan_lcalc", - varset="dev", - vartype="integer", - topics=["Wannier_compulsory"], - dimensions=["sum([[plowan_nbl]])"], - defaultval=-1, - mnemonics="Projected Local Orbital WANnier functions, L values to use for CALCulation", - characteristics=["[[DEVELOP]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="plowan_lcalc", + varset="dev", + vartype="integer", + topics=["Wannier_compulsory"], + dimensions=["sum([[plowan_nbl]])"], + defaultval=-1, + mnemonics="Projected Local Orbital WANnier functions, L values to use for CALCulation", + characteristics=["[[DEVELOP]]"], + added_in_version="before_v9", + text=r""" Gives the [[plowan_nbl]] values of angular momenta for each atom, in the order of the atoms as given in [[plowan_iatom]]. """, - ), - Variable( - abivarname="plowan_natom", - varset="dev", - vartype="integer", - topics=["Wannier_compulsory"], - dimensions="scalar", - defaultval=0, - mnemonics="Projected Local Orbital WANnier functions, Number of ATOMs", - characteristics=["[[DEVELOP]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="plowan_natom", + varset="dev", + vartype="integer", + topics=["Wannier_compulsory"], + dimensions="scalar", + defaultval=0, + mnemonics="Projected Local Orbital WANnier functions, Number of ATOMs", + characteristics=["[[DEVELOP]]"], + added_in_version="before_v9", + text=r""" Gives the number of atoms on which the projection will be done """, - ), - Variable( - abivarname="plowan_nbl", - varset="dev", - vartype="integer", - topics=["Wannier_compulsory"], - dimensions=["[[plowan_natom]]"], - defaultval=0, - mnemonics="Projected Local Orbital WANnier functions, NumBer of L values", - characteristics=["[[DEVELOP]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="plowan_nbl", + varset="dev", + vartype="integer", + topics=["Wannier_compulsory"], + dimensions=["[[plowan_natom]]"], + defaultval=0, + mnemonics="Projected Local Orbital WANnier functions, NumBer of L values", + characteristics=["[[DEVELOP]]"], + added_in_version="before_v9", + text=r""" Gives the total number of angular momenta (over all atoms) to compute the projections. """, - ), - Variable( - abivarname="plowan_nt", - varset="dev", - vartype="integer", - topics=["Wannier_useful"], - dimensions="scalar", - defaultval=0, - mnemonics="""Projected Local Orbital WANnier functions, Number of Translation on which the real space values of +), + +Variable( + abivarname="plowan_nt", + varset="dev", + vartype="integer", + topics=["Wannier_useful"], + dimensions="scalar", + defaultval=0, + mnemonics="""Projected Local Orbital WANnier functions, Number of Translation on which the real space values of energy are computed""", - characteristics=["[[DEVELOP]]"], - added_in_version="before_v9", - text=r""" + characteristics=["[[DEVELOP]]"], + added_in_version="before_v9", + text=r""" Requires [[plowan_realspace]] to be greater than 0. Gives a number of selected atoms. These atoms are used to define Wannier functions in real space. These real space Wannier functions are used as a basis to compute the Hamiltonian. """, - ), - Variable( - abivarname="plowan_projcalc", - varset="dev", - vartype="integer", - topics=["Wannier_compulsory"], - dimensions=["sum([[plowan_nbl]])"], - defaultval=-1, - mnemonics="Projected Local Orbital WANnier functions, PROJectors values to use for CALCulation", - characteristics=["[[DEVELOP]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="plowan_projcalc", + varset="dev", + vartype="integer", + topics=["Wannier_compulsory"], + dimensions=["sum([[plowan_nbl]])"], + defaultval=-1, + mnemonics="Projected Local Orbital WANnier functions, PROJectors values to use for CALCulation", + characteristics=["[[DEVELOP]]"], + added_in_version="before_v9", + text=r""" Gives the [[plowan_nbl]] values of projectors for each atom, in the order of the atoms as given in [[plowan_iatom]]. The index i for the projectors refers to the i-th number on line orbitals of the PAW atomic data file. """, - ), - Variable( - abivarname="plowan_realspace", - varset="dev", - vartype="integer", - topics=["Wannier_useful"], - dimensions="scalar", - defaultval=0, - mnemonics="Projected Local Orbital WANnier functions, activate REAL SPACE calculation.", - characteristics=["[[DEVELOP]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="plowan_realspace", + varset="dev", + vartype="integer", + topics=["Wannier_useful"], + dimensions="scalar", + defaultval=0, + mnemonics="Projected Local Orbital WANnier functions, activate REAL SPACE calculation.", + characteristics=["[[DEVELOP]]"], + added_in_version="before_v9", + text=r""" Can take the following values: * 0 --> Default value: do not activate calculation of real space Wannier functions. @@ -16213,33 +17304,35 @@ * 2 --> Do simple Wannier Interpolation for a given k points starting from real space Wannier function Hamiltonian computed in a preceding dataset. """, - ), - Variable( - abivarname="polcen", - varset="ffield", - vartype="real", - topics=["Berry_useful"], - dimensions=[3], - defaultval=MultipleValue(number=3, value=0), - mnemonics="POLarization for CENtrosymmetric geometry", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="polcen", + varset="ffield", + vartype="real", + topics=["Berry_useful"], + dimensions=[3], + defaultval=MultipleValue(number=3, value=0), + mnemonics="POLarization for CENtrosymmetric geometry", + added_in_version="before_v9", + text=r""" When doing a finite electric displacement field calculation, if the structure is centrosymmetric but the polarization is non-zero (such as for AlAs), this non-zero polarization should be specified as [[polcen]] (in REDUCED coordinates, in atomic units) in the input file. See Eq.(24) in the Suppl. of [[cite:Stengel2009]] """, - ), - Variable( - abivarname="posdoppler", - varset="gstate", - vartype="integer", - topics=["positron_basic"], - dimensions="scalar", - defaultval=0, - mnemonics="POSitron computation of DOPPLER broadening", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="posdoppler", + varset="gstate", + vartype="integer", + topics=["positron_basic"], + dimensions="scalar", + defaultval=0, + mnemonics="POSitron computation of DOPPLER broadening", + added_in_version="before_v9", + text=r""" Relevant only when [[positron]]/=0. This input parameter activates the calculation of the Doppler broadening of the electron-positron annihilation radiation. @@ -16250,17 +17343,18 @@ 'corewf.abinit**ityp**' (where **ityp** is the index of the atom type). Core WF files can be obtained with the atompaw tool by the use of **prtcorewf** keyword. """, - ), - Variable( - abivarname="positron", - varset="gstate", - vartype="integer", - topics=["positron_compulsory"], - dimensions="scalar", - defaultval=0, - mnemonics="POSITRON calculation", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="positron", + varset="gstate", + vartype="integer", + topics=["positron_compulsory"], + dimensions="scalar", + defaultval=0, + mnemonics="POSITRON calculation", + added_in_version="before_v9", + text=r""" This input parameter can be positive or negative. Negative values for [[positron]] are only relevant for PAW calculations. Electron-positron correlation functional is defined by [[ixcpositron]]. @@ -16385,17 +17479,18 @@ References: [[cite:Arponen1979a]], [[cite:Boronski1986]], [[cite:Sterne1991]], [[cite:Puska1995]], [[cite:Barbiellini1995]] """, - ), - Variable( - abivarname="posnstep", - varset="gstate", - vartype="integer", - topics=["positron_basic"], - dimensions="scalar", - defaultval=50, - mnemonics="POSitron calculation: max. Number of STEPs for the two-component DFT", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="posnstep", + varset="gstate", + vartype="integer", + topics=["positron_basic"], + dimensions="scalar", + defaultval=50, + mnemonics="POSitron calculation: max. Number of STEPs for the two-component DFT", + added_in_version="before_v9", + text=r""" Relevant only when [[positron]]<0. Sets the maximum number of electronic/positronic iterations that, when reached, will cause the two-component DFT SCF cycle to stop. @@ -16404,17 +17499,18 @@ the positronic density until $\Delta$Etotal<[[postoldfe]] or $\Delta$Forces<[[postoldff]] or the number of electronic/positronic steps is [[posnstep]]. """, - ), - Variable( - abivarname="posocc", - varset="gstate", - vartype="real", - topics=["positron_basic"], - dimensions="scalar", - defaultval=1, - mnemonics="POSitron calculation: OCCupation number for the positron", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="posocc", + varset="gstate", + vartype="real", + topics=["positron_basic"], + dimensions="scalar", + defaultval=1, + mnemonics="POSitron calculation: OCCupation number for the positron", + added_in_version="before_v9", + text=r""" Relevant only when [[positron]]/=0. Sets the occupation number for the positron. Has to be <=1. Changing [[posocc]] is only useful for bulk calculation when one wants to @@ -16422,18 +17518,19 @@ of a supercell). It simulates the dispersion of the positron in the whole crystal. """, - ), - Variable( - abivarname="postoldfe", - varset="gstate", - vartype="real", - topics=["positron_basic"], - dimensions="scalar", - defaultval=ValueWithConditions({"[[postoldff]] = 0": 1e-06, "defaultval": 0.0}), - mnemonics="POSitron calculation: TOLerance on the DiFference of total Energy", - characteristics=["[[ENERGY]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="postoldfe", + varset="gstate", + vartype="real", + topics=["positron_basic"], + dimensions="scalar", + defaultval=ValueWithConditions({"[[postoldff]] = 0": 1e-06, "defaultval": 0.0}), + mnemonics="POSitron calculation: TOLerance on the DiFference of total Energy", + characteristics=["[[ENERGY]]"], + added_in_version="before_v9", + text=r""" Relevant only when [[positron]]<0. Sets a tolerance for absolute difference of total energy (of _ions+electrons+positron_ system) that, when reached, will cause the SCF cycle @@ -16443,17 +17540,18 @@ Can be specified in Ha (the default), Ry, eV or Kelvin, since [[postoldfe]] has the [[ENERGY]] characteristics. One and only one of [[postoldfe]] or [[postoldff]] can be set. """, - ), - Variable( - abivarname="postoldff", - varset="gstate", - vartype="real", - topics=["positron_basic"], - dimensions="scalar", - defaultval=0, - mnemonics="POSitron calculation: TOLerance on the DiFference of Forces", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="postoldff", + varset="gstate", + vartype="real", + topics=["positron_basic"], + dimensions="scalar", + defaultval=0, + mnemonics="POSitron calculation: TOLerance on the DiFference of Forces", + added_in_version="before_v9", + text=r""" Relevant only when [[positron]] < 0. Sets a tolerance for absolute difference of maximum force (in hartree/Bohr) acting on ions (due to _ions+electrons+positron_ system) that, when reached, will cause the SCF @@ -16461,19 +17559,20 @@ electronic/positronic steps is [[posnstep]]. One and only one of [[postoldfe]] or [[postoldff]] can be set. """, - ), - Variable( - abivarname="ppmfrq", - varset="gw", - vartype="real", - topics=["SelfEnergy_basic"], - dimensions="scalar", - defaultval=ValueWithUnit(units="Ha", value=0.0), - mnemonics="Plasmon Pole Model FReQuency", - characteristics=["[[ENERGY]]"], - requires="[[optdriver]] in [3,4]", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="ppmfrq", + varset="gw", + vartype="real", + topics=["SelfEnergy_basic"], + dimensions="scalar", + defaultval=ValueWithUnit(units="Ha", value=0.0), + mnemonics="Plasmon Pole Model FReQuency", + characteristics=["[[ENERGY]]"], + requires="[[optdriver]] in [3,4]", + added_in_version="before_v9", + text=r""" **In plasmon-pole calculations** Relevant only if GW corrections are evaluated using the plasmon-pole @@ -16514,18 +17613,19 @@ [[cd_frqim_method]], [[gw_frqim_inzgrid]] and [[gw_frqre_inzgrid]] for more details. """, - ), - Variable( - abivarname="ppmodel", - varset="gw", - vartype="integer", - topics=["SelfEnergy_basic"], - dimensions="scalar", - defaultval=1, - mnemonics="Plasmon Pole MODEL", - requires="[[optdriver]] in [4, 7]", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="ppmodel", + varset="gw", + vartype="integer", + topics=["SelfEnergy_basic"], + dimensions="scalar", + defaultval=1, + mnemonics="Plasmon Pole MODEL", + requires="[[optdriver]] in [4, 7]", + added_in_version="before_v9", + text=r""" This variable defines the plasmon-pole model used to compute the convolution between G and W either in the SIGMA code ([[optdriver]] 4) or in the EPH code ([[optdriver]] 7) when GWPT is used (see [[eph_task]]). @@ -16548,18 +17648,106 @@ least the lowest ones). Thus the calculated plasmon band structure (plasmon energy vs q vector) is reported in the output file for the lowest 10 bands. """, - ), - Variable( - abivarname="prepalw", - varset="dfpt", - vartype="integer", - topics=["longwave_compulsory"], - dimensions="scalar", - defaultval=0, - mnemonics="PREPAre LongWave calculation", - characteristics=["[[DEVELOP]]"], - added_in_version="v9", - text=r""" +), + +Variable( + abivarname="precon_in_memory", + varset="gstate", + vartype="integer", + topics=["SCFAlgorithms_expert"], + dimensions="scalar", + defaultval=1, + mnemonics="", + requires="[[iprcel]] == 202", + added_in_version="v10", + text=r""" +This variable determines whether the FFTs are stored throughout the preconditioner's GMRES +iterations (**precon_in_memory**=1) or recomputed at each GMRES step (**precon_in_memory**=0). + +This setting is only useful for $\chi_0$-based hybrid SCF preconditioning ([[iprcel]] = 202). +""", +), + +Variable( + abivarname="precon_ls_maxite", + varset="gstate", + vartype="integer", + topics=["SCFAlgorithms_expert"], + dimensions="scalar", + defaultval=20, + mnemonics="", + requires="[[iprcel]] in [200, 202]", + added_in_version="v10", + text=r""" +This variable defines the maximum number of GMRES iterations in the application of the $\chi0$-based SCF preconditioner ([[iprcel]] = 2**). +""", +), + +Variable( + abivarname="precon_ls_rtol", + varset="gstate", + vartype="real", + topics=["SCFAlgorithms_expert"], + dimensions="scalar", + defaultval=1.0e-6, + mnemonics="PRECONnditioner Linear Solver MAXimumm number of ITErations", + requires="[[iprcel]] in [200, 202]", + added_in_version="v10", + text=r""" +This variable defines the maximum number of GMRES iterations in the application of the $\chi0$-based SCF preconditioner ([[iprcel]] = 2**). +""", +), + +Variable( + abivarname="precon_tsmear", + varset="gstate", + vartype="real", + topics=["SCFAlgorithms_expert"], + dimensions="scalar", + defaultval=0.01, + mnemonics="PRECONnditioner Temperature of SMEARing", + requires="[[iprcel]] == 202", + added_in_version="v10", + text=r""" +This variable defines the smearing temperature used in the $\chi_0^\mathrm{diag}$ of the Hybrid preconditioner. + +Increasing the smearing temperature in the preconditioner helps smooth out the preconditioner, +which can be more challenging to converge in k_points that other quantities. +Adjusting this parameter can significantly improve convergence. + +This setting is only useful for $\chi_0$-based hybrid SCF preconditioning ([[iprcel]] = 202). +""", +), + +Variable( + abivarname="precon_verbose", + varset="gstate", + vartype="integer", + topics=["SCFAlgorithms_expert"], + dimensions="scalar", + defaultval=0, + mnemonics="", + requires="[[iprcel]] in [200, 202]", + added_in_version="v10", + text=r""" +This variable controls the verbosity level for logging during the application of the $\chi0$-based SCF preconditioner ([[iprcel]] = 2**). + + * **precon_verbose** = 0 --> No log output. + * **precon_verbose** = 1 --> Logs the GMRES convergence. +""", +), + +Variable( + abivarname="prepalw", + varset="dfpt", + vartype="integer", + topics=["longwave_compulsory"], + dimensions="scalar", + defaultval=0, + mnemonics="PREPAre LongWave calculation", + characteristics=["[[DEVELOP]]"], + added_in_version="v9", + text=r""" The computation of spatial-dispersion quantities from the longwave DFPT approach requires the first-order wavefunctions and densities obtained from a linear response calculation. The standard approach in a linear response calculation is: @@ -16596,17 +17784,19 @@ It is therefore the option to choose if one intends to run subsequent longwave calculations with [[lw_natopt]] = 1. """, - ), - Variable( - abivarname="prepanl", - varset="dfpt", - vartype="integer", - topics=["nonlinear_compulsory"], - dimensions="scalar", - defaultval=0, - mnemonics="PREPAre Non-Linear response calculation", - added_in_version="before_v9", - text=r""" +), + + +Variable( + abivarname="prepanl", + varset="dfpt", + vartype="integer", + topics=["nonlinear_compulsory"], + dimensions="scalar", + defaultval=0, + mnemonics="PREPAre Non-Linear response calculation", + added_in_version="before_v9", + text=r""" The computation of third-order derivatives from the 2n+1 theorem requires the first-order wavefunctions and densities obtained from a linear response calculation. The standard approach in a linear response calculation is: @@ -16629,68 +17819,72 @@ [[prepanl]] == 1 can be used in order to skip directions of perturbations that will not be used by the non-linear routine (see [[rf2_dkdk]] for more details). """, - ), - Variable( - abivarname="prepgkk", - varset="dfpt", - vartype="integer", - topics=["ElPhonInt_compulsory"], - dimensions="scalar", - defaultval=0, - mnemonics="PREPAre GKK calculation", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="prepgkk", + varset="dfpt", + vartype="integer", + topics=["ElPhonInt_compulsory"], + dimensions="scalar", + defaultval=0, + mnemonics="PREPAre GKK calculation", + added_in_version="before_v9", + text=r""" The calculation of electron-phonon coupling quantities requires the presence of all the perturbations (all atoms in all directions) for the chosen set of (irreducible) q-points. To impose this and prevent ABINIT from using symmetry to reduce the number of perturbations, set [[prepgkk]] to 1. Use in conjunction with [[prtgkk]]. """, - ), - Variable( - abivarname="prepscphon", - varset="dev", - vartype="integer", - topics=["printing_prngs"], - dimensions="scalar", - defaultval=0, - mnemonics="PREPare Self-Consistent PHONon calculation", - characteristics=["[[DEVELOP]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="prepscphon", + varset="dev", + vartype="integer", + topics=["printing_prngs"], + dimensions="scalar", + defaultval=0, + mnemonics="PREPare Self-Consistent PHONon calculation", + characteristics=["[[DEVELOP]]"], + added_in_version="before_v9", + text=r""" Print PCINFO, PHFREQ, and PHVEC files, for use with self-consistent phonon runs, after a perturbation calculation. Only prints out files for the present q-point, and there is presently no tool to symmetrize or merge these files, so use anaddb instead (with prtscphon input variable). The abinit input variable is destined to someday bypass the use of anaddb for scphon calculations. """, - ), - Variable( - abivarname="prt1dm", - varset="files", - vartype="integer", - topics=["printing_prgs"], - dimensions="scalar", - defaultval=0, - mnemonics="PRinT 1-DiMensional potential and density", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="prt1dm", + varset="files", + vartype="integer", + topics=["printing_prgs"], + dimensions="scalar", + defaultval=0, + mnemonics="PRinT 1-DiMensional potential and density", + added_in_version="before_v9", + text=r""" If set >= 1, provide one-dimensional projection of potential and density, for each of the three axis. This corresponds to averaging the potential or the density on bi-dimensional slices of the FFT grid. """, - ), - Variable( - abivarname="prtatlist", - varset="rlx", - vartype="integer", - topics=["printing_prgeo", "Output_useful"], - dimensions=["[[natom]]"], - defaultval=0, - mnemonics="PRinT by ATom LIST of ATom", - characteristics=["[[NO_MULTI]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="prtatlist", + varset="rlx", + vartype="integer", + topics=["printing_prgeo", "Output_useful"], + dimensions=["[[natom]]"], + defaultval=0, + mnemonics="PRinT by ATom LIST of ATom", + characteristics=["[[NO_MULTI]]"], + added_in_version="before_v9", + text=r""" This is an array of the numbers associated to the index atoms that the user want to print in the output or log files, this is useful when you have a large number of atoms and you are only interested to follow specific atoms, the @@ -16698,104 +17892,112 @@ [[xred]]. This input variable does not affect the contents of the "OUT.nc" or "HIST.nc", those are NetCDF files containing the information about all the atoms. """, - ), - Variable( - abivarname="prtbbb", - varset="dfpt", - vartype="integer", - topics=["printing_prngs", "Output_useful"], - dimensions="scalar", - defaultval=0, - mnemonics="PRinT Band-By-Band decomposition", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="prtbbb", + varset="dfpt", + vartype="integer", + topics=["printing_prngs", "Output_useful"], + dimensions="scalar", + defaultval=0, + mnemonics="PRinT Band-By-Band decomposition", + added_in_version="before_v9", + text=r""" If [[prtbbb]] is 1, print the band-by-band decomposition of Born effective charges and localization tensor, in case they are computed. See [[cite:Ghosez2000]]. """, - ), - Variable( - abivarname="prtbltztrp", - varset="dev", - vartype="integer", - topics=["printing_prgs"], - dimensions="scalar", - defaultval=0, - mnemonics="PRinT output for BoLTZTRaP code", - characteristics=["[[DEVELOP]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="prtbltztrp", + varset="dev", + vartype="integer", + topics=["printing_prgs"], + dimensions="scalar", + defaultval=0, + mnemonics="PRinT output for BoLTZTRaP code", + characteristics=["[[DEVELOP]]"], + added_in_version="before_v9", + text=r""" Print out geometry _BLZTRP_GEOM and eigenenergy _BLZTRP_EIGEN files for the [BoltzTraP code](https://www.imc.tuwien.ac.at/forschungsbereich_theoretische_chemie/forschungsgruppen/prof_dr_gkh_madsen_theoretical_materials_chemistry/boltztrap/) by Georg Madsen. """, - ), - Variable( - abivarname="prtchkprdm", - varset="files", - vartype="integer", - topics=["GW_expert", "SelfEnergy_expert"], - dimensions="scalar", - defaultval=0, - mnemonics="Integer that governs PrinTing of CHecK-Point files for the GW 1-RDM", - requires="[[optdriver]] == 4", - added_in_version="9.4.0", - text=r""" +), + +Variable( + abivarname="prtchkprdm", + varset="files", + vartype="integer", + topics=["GW_expert", "SelfEnergy_expert"], + dimensions="scalar", + defaultval=0, + mnemonics="Integer that governs PrinTing of CHecK-Point files for the GW 1-RDM", + requires="[[optdriver]] == 4", + added_in_version="9.4.0", + text=r""" [[prtchkprdm]]==1 triggers the printing of binary checkpoint files when updating the density matrix for the the linearized GW approximation. It is only meaningful when [[gw1rdm]]>0. The files that are printed use the usual ABINIT output files naming convention with extension _CHKP_RDM_1. """, - ), - Variable( - abivarname="prtcif", - varset="dev", - vartype="integer", - topics=["printing_prgeo"], - dimensions="scalar", - defaultval=0, - mnemonics="PRinT Crystallographic Information File", - characteristics=["[[DEVELOP]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="prtcif", + varset="dev", + vartype="integer", + topics=["printing_prgeo"], + dimensions="scalar", + defaultval=0, + mnemonics="PRinT Crystallographic Information File", + characteristics=["[[DEVELOP]]"], + added_in_version="before_v9", + text=r""" If set to 1, a CIF file is output with the crystallographic data for the present run (cell size shape and atomic positions). """, - ), - Variable( - abivarname="prtcurrent", - varset="rttddft", - vartype="integer", - topics=["RTTDDFT_useful"], - dimensions="scalar", - defaultval=0, - mnemonics="PRinT macroscopic CURRENT density", - added_in_version="10", - text=r""" +), + +Variable( + abivarname="prtcurrent", + varset="rttddft", + vartype="integer", + topics=["RTTDDFT_useful"], + dimensions="scalar", + defaultval=0, + mnemonics="PRinT macroscopic CURRENT density", + added_in_version="10", + text=r""" If set to 1, prints the time-dependent macroscopic current density computed in real-time TDDFT calculations ([[optdriver]] 9). """, - ), - Variable( - abivarname="prtddb", - varset="files", - vartype="integer", - topics=["printing_prgs"], - dimensions="scalar", - defaultval=1, - mnemonics="PRinT the Derivative Data Base file", - added_in_version="9.11.0", - text=r""" +), + +Variable( + abivarname="prtddb", + varset="files", + vartype="integer", + topics=["printing_prgs"], + dimensions="scalar", + defaultval=1, + mnemonics="PRinT the Derivative Data Base file", + added_in_version="9.11.0", + text=r""" If set to 1, ABINIT will produce a DDB file. """, - ), - Variable( - abivarname="prtden", - varset="files", - vartype="integer", - topics=["printing_prden"], - dimensions="scalar", - defaultval=ValueWithConditions({"[[nimage]] > 1": 0, "defaultval": 1}), - mnemonics="PRinT the DENsity", - added_in_version="before_v9", - text=r""" -If set to 1 or a larger value, provide output of electron density in real +), + + +Variable( + abivarname="prtden", + varset="files", + vartype="integer", + topics=["printing_prden"], + dimensions="scalar", + defaultval=ValueWithConditions({"[[nimage]] > 1": 0, "defaultval": 1}), + mnemonics="PRinT the DENsity", + added_in_version="before_v9", + text=r""" +If set to 1 or a larger value, provide output of the GS or of the DFPT electron density in real space rho(r), in units of electrons/Bohr^3. If [[geoopt]] or [[moldyn]] are set to "none", the name of the density file will be the root output name, followed by _DEN. @@ -16863,17 +18065,18 @@ prtden > 1 to chain the density output from one calculation as the input to another, use the _DEN file for that. """, - ), - Variable( - abivarname="prtdensph", - varset="gstate", - vartype="integer", - topics=["printing_prden"], - dimensions="scalar", - defaultval=ValueWithConditions({"defaultval": 1}), - mnemonics="PRinT integral of DENsity inside atomic SPHeres", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="prtdensph", + varset="gstate", + vartype="integer", + topics=["printing_prden"], + dimensions="scalar", + defaultval=ValueWithConditions({"defaultval": 1}), + mnemonics="PRinT integral of DENsity inside atomic SPHeres", + added_in_version="before_v9", + text=r""" When this flag is activated, values of integral(s) of total density inside sphere(s) around each atom are printed in output file (for each spin component). Spheres around atoms are defined by a radius given by [[ratsph]] keyword. @@ -16890,32 +18093,34 @@ real problem. If you are interested in a more accurate estimation of the density within a sphere, you should use the cut3d postprocessor ([[help:cut3d]]). """, - ), - Variable( - abivarname="prtdipole", - varset="dev", - vartype="integer", - topics=["printing_prgs"], - dimensions="scalar", - defaultval=0, - mnemonics="PRinT DIPOLE", - characteristics=["[[DEVELOP]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="prtdipole", + varset="dev", + vartype="integer", + topics=["printing_prgs"], + dimensions="scalar", + defaultval=0, + mnemonics="PRinT DIPOLE", + characteristics=["[[DEVELOP]]"], + added_in_version="before_v9", + text=r""" Print out dipole of unit cell, calculated in real space for the primitive cell only. Under development. """, - ), - Variable( - abivarname="prtdos", - varset="files", - vartype="integer", - topics=["printing_prdos", "ElecDOS_basic", "AtomCentered_useful"], - dimensions="scalar", - defaultval=0, - mnemonics="PRinT the Density Of States", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="prtdos", + varset="files", + vartype="integer", + topics=["printing_prdos", "ElecDOS_basic", "AtomCentered_useful"], + dimensions="scalar", + defaultval=0, + mnemonics="PRinT the Density Of States", + added_in_version="before_v9", + text=r""" Provide output of Density of States if set to 1...5. Can either use a smearing technique ([[prtdos]] = 1 or 4), or the tetrahedron method ([[prtdos]] = 2, 3 or 5). If [[prtdos]] = 3 or 4, provide output of angular-momentum projected Local Density of States inside a sphere @@ -16981,26 +18186,26 @@ particular, [[pawprtdos]] = 2 can be used to compute quickly a very good approximation of the DOS). -If [[prtdos]] = 4, delivers the sphere-projected DOS (like [[prtdos]] = 3), on the -basis of a smearing approach (like [[prtdos]] = 1). See (like [[prtdos]] = 1 -for the additional input variables to be specified. +If [[prtdos]] = 4, delivers the total DOS like [[prtdos]]=1, but also the angular-momentum projections +in the FATBANDS.nc file for post-processing. If [[prtdos]] = 5, delivers the spin-spin DOS in the [[nspinor]] == 2 case, using the tetrahedron method (as [[prtdos]] = 2). Note that in the case [[nsppol]]=1 and [[nspden]]=2, only the spin up DOS is delivered, for all values of [[prtdos]]. """, - ), - Variable( - abivarname="prtdosm", - varset="files", - vartype="integer", - topics=["printing_prdos", "ElecDOS_basic", "AtomCentered_useful"], - dimensions="scalar", - defaultval=0, - mnemonics="PRinT the Density Of States with M decomposition", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="prtdosm", + varset="files", + vartype="integer", + topics=["printing_prdos", "ElecDOS_basic", "AtomCentered_useful"], + dimensions="scalar", + defaultval=0, + mnemonics="PRinT the Density Of States with M decomposition", + added_in_version="before_v9", + text=r""" Relevant only when [[prtdos]] = 3. If set to 1, the m-decomposed LDOS is delivered in DOS file. Note that [[prtdosm]] computes the M-resolved partial dos for complex @@ -17013,17 +18218,18 @@ Note that in the case [[nsppol]]=1 and [[nspden]]=2, only the spin up DOS is delivered, for all values of [[prtdos]]. """, - ), - Variable( - abivarname="prtebands", - varset="gstate", - vartype="integer", - topics=["printing_prden"], - dimensions="scalar", - defaultval=ValueWithConditions({"[[nimage]] > 1": 0, "defaultval": 1}), - mnemonics="PRinT Electron BANDS", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="prtebands", + varset="gstate", + vartype="integer", + topics=["printing_prden"], + dimensions="scalar", + defaultval=ValueWithConditions({"[[nimage]] > 1": 0, "defaultval": 1}), + mnemonics="PRinT Electron BANDS", + added_in_version="before_v9", + text=r""" This option activates the output of the electron eigenvalues. Possible values: * 0- Disable the output of the band energies. @@ -17032,33 +18238,35 @@ * 2- Write eigenvalues in gnuplot format. The code produces a `EBANDS.dat` file with the eigenvalues and a `file_EBANDS.gnuplot` script. Use `gnuplot file_EBANDS.gnuplot` to visualize the band energies. """, - ), - Variable( - abivarname="prtefmas", - varset="dfpt", - vartype="integer", - topics=["printing_prngs", "EffectiveMass_useful"], - dimensions="scalar", - defaultval=1, - mnemonics="PRint EFfective MASs data", - requires="[[efmas]] == 1", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="prtefmas", + varset="dfpt", + vartype="integer", + topics=["printing_prngs", "EffectiveMass_useful"], + dimensions="scalar", + defaultval=1, + mnemonics="PRint EFfective MASs data", + requires="[[efmas]] == 1", + added_in_version="before_v9", + text=r""" If 1, at the end of an effective mass calculation ([[efmas]] = 1), create a file *_EFMAS, that contains the generalized second-order k-derivatives, see Eq.(66) in [[cite:Laflamme2016]], in view of further processing. """, - ), - Variable( - abivarname="prteig", - varset="files", - vartype="integer", - topics=["printing_prden"], - dimensions="scalar", - defaultval=ValueWithConditions({"[[nimage]] > 1": 0, "defaultval": 1}), - mnemonics="PRinT EIGenenergies", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="prteig", + varset="files", + vartype="integer", + topics=["printing_prden"], + dimensions="scalar", + defaultval=ValueWithConditions({"[[nimage]] > 1": 0, "defaultval": 1}), + mnemonics="PRinT EIGenenergies", + added_in_version="before_v9", + text=r""" If set to 1, a file *_EIG, containing the k-points and one-electron eigenvalues is printed. If set to 2, with [[geoopt]] or [[moldyn]] /= "none" ([[ionmov]] /= 0), eigenenergies file will be output at each time step, with @@ -17071,17 +18279,18 @@ The file structure of this unformatted output file is described in [[help:abinit#localpotfile|this section]]. No output is provided by a negative value of this variable. """, - ), - Variable( - abivarname="prtelf", - varset="files", - vartype="integer", - topics=["printing_prgs"], - dimensions="scalar", - defaultval=0, - mnemonics="PRinT Electron Localization Function (ELF)", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="prtelf", + varset="files", + vartype="integer", + topics=["printing_prgs"], + dimensions="scalar", + defaultval=0, + mnemonics="PRinT Electron Localization Function (ELF)", + added_in_version="before_v9", + text=r""" If set to 1 or a larger value, provide output of ELF in real space elf(r). This is a dimensionless quantity bounded between 0 and 1. The name of the ELF file will be the root output name, followed by _ELF. @@ -17103,46 +18312,50 @@ Please note that ELF is **not** yet implemented in the case of PAW ([[usepaw]] = 1) calculations. """, - ), - Variable( - abivarname="prtevk", - varset="files", - vartype="integer", - topics=["printing_prgs"], - dimensions="scalar", - defaultval=0, - mnemonics="PRinT EVK - Elements of the Velocity matrix at wavevector K", - added_in_version="9.11.0", - text=r""" +), + +Variable( + abivarname="prtevk", + varset="files", + vartype="integer", + topics=["printing_prgs"], + dimensions="scalar", + defaultval=0, + mnemonics="PRinT EVK - Elements of the Velocity matrix at wavevector K", + added_in_version="9.11.0", + text=r""" If set to 1, ABINIT will produce a netCDF EVK file, containing the elements of the velocity operator (ddk) between two wavefunctions at wavevector k. Not compatible with parallelization over perturbations ([[paral_rf]]=1) when netCDF library does not support MPI-IO. """, - ), - Variable( - abivarname="prtfull1wf", - varset="dfpt", - vartype="integer", - topics=["DFPT_expert"], - dimensions="scalar", - defaultval=0, - mnemonics="PRinT FULL 1st-order WaveFunction", - added_in_version="before_v9", - text=r""" +), + + +Variable( + abivarname="prtfull1wf", + varset="dfpt", + vartype="integer", + topics=["DFPT_expert"], + dimensions="scalar", + defaultval=0, + mnemonics="PRinT FULL 1st-order WaveFunction", + added_in_version="before_v9", + text=r""" If set to 1, the output _1WF files will contain the full 1st-order wavefunctions, for both valence and conduction bands. Otherwise, the _1WF files are not really 1st-order perturbed wavefunctions, but merely a set of perturbed wavefunctions that yield the correct perturbed density. This is used when one expect to perform post-processing of the 1st-order wavefunctions. """, - ), - Variable( - abivarname="prtfsurf", - varset="files", - vartype="integer", - topics=["printing_prfermi"], - dimensions="scalar", - defaultval=0, - mnemonics="PRinT Fermi SURFace file", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="prtfsurf", + varset="files", + vartype="integer", + topics=["printing_prfermi"], + dimensions="scalar", + defaultval=0, + mnemonics="PRinT Fermi SURFace file", + added_in_version="before_v9", + text=r""" If set to 1, provide Fermi surface file in the BXSF format (Xcrysden) If [[prtfsurf]] = 1, a _BXSF file readable by [XCrySDen](http://www.xcrysden.org) will be produced at the end of the calculation. The file contains information @@ -17156,17 +18369,18 @@ and [[nshiftk]]. Note, however, that the mesh must be homogeneous and centered on gamma (multiple shifts are not supported by Xcrysden) """, - ), - Variable( - abivarname="prtgden", - varset="files", - vartype="integer", - topics=["printing_prden"], - dimensions="scalar", - defaultval=0, - mnemonics="PRinT the Gradient of electron DENsity", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="prtgden", + varset="files", + vartype="integer", + topics=["printing_prden"], + dimensions="scalar", + defaultval=0, + mnemonics="PRinT the Gradient of electron DENsity", + added_in_version="before_v9", + text=r""" If set to 1 or a larger value, provide output of gradient of electron density in real space grho(r), in units of Bohr^-(5/2). The names of the gradient of electron density files will be the root output @@ -17174,17 +18388,18 @@ Like a _DEN file, it can be analyzed by cut3d. The file structure of this unformatted output file is described in [[help:abinit#denfile|this section]]. """, - ), - Variable( - abivarname="prtgeo", - varset="files", - vartype="integer", - topics=["printing_prgeo"], - dimensions="scalar", - defaultval=0, - mnemonics="PRinT the GEOmetry analysis", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="prtgeo", + varset="files", + vartype="integer", + topics=["printing_prgeo"], + dimensions="scalar", + defaultval=0, + mnemonics="PRinT the GEOmetry analysis", + added_in_version="before_v9", + text=r""" If set to 1 or a larger value, provide output of geometry analysis (bond lengths and bond angles). The value of [[prtgeo]] is taken by the code to be the maximum coordination number of atoms in the system. @@ -17203,17 +18418,18 @@ No output is provided by [[prtgeo]] is lower than or equal to 0. If [[prtgeo]] > 0, the maximum number of atoms ([[natom]]) is 9999. """, - ), - Variable( - abivarname="prtgkk", - varset="files", - vartype="integer", - topics=["printing_prngs", "ElPhonInt_compulsory"], - dimensions="scalar", - defaultval=0, - mnemonics="PRinT the GKK matrix elements file", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="prtgkk", + varset="files", + vartype="integer", + topics=["printing_prngs", "ElPhonInt_compulsory"], + dimensions="scalar", + defaultval=0, + mnemonics="PRinT the GKK matrix elements file", + added_in_version="before_v9", + text=r""" If set to 1, provide output of electron-phonon "gkk" matrix elements, for further treatment by mrggkk utility or anaddb utility. Note that symmetry will be disabled for the calculation of the perturbation, forcing the inclusion of @@ -17221,47 +18437,51 @@ electron-phonon treatment in ABINIT is given in the tutorial [[tutorial:eph_intro]] and subsequent ones, [[tutorial:eph4mob]] and [[tutorial:eph4zpr]]. """, - ), - Variable( - abivarname="prtgsr", - varset="files", - vartype="integer", - topics=["printing_prgs"], - dimensions="scalar", - defaultval=ValueWithConditions({"[[nimage]] > 1": 0, "defaultval": 1}), - mnemonics="PRinT the GSR file", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="prtgsr", + varset="files", + vartype="integer", + topics=["printing_prgs"], + dimensions="scalar", + defaultval=ValueWithConditions({"[[nimage]] > 1": 0, "defaultval": 1}), + mnemonics="PRinT the GSR file", + added_in_version="before_v9", + text=r""" If set to 1, ABINIT will produce a GSR file at the end of the GS calculation. The GSR file contains the most important GS results (band structure, forces, stresses, electronic density). The GSR file can be read by AbiPy and used for further post-processing. """, - ), - Variable( - abivarname="prthist", - varset="files", - vartype="integer", - topics=["printing_prgs"], - dimensions="scalar", - defaultval=1, - mnemonics="PRinT the HISTory file", - added_in_version="9.11.0", - text=r""" +), + +Variable( + abivarname="prthist", + varset="files", + vartype="integer", + topics=["printing_prgs"], + dimensions="scalar", + defaultval=1, + mnemonics="PRinT the HISTory file", + added_in_version="9.11.0", + text=r""" If set to 1, ABINIT will produce a HIST file. The HIST file contains the history of structural relaxations or molecular dynamics calculations. This file can be used to restart the calculation or to analyze the results at the end of calculation. """, - ), - Variable( - abivarname="prtkden", - varset="files", - vartype="integer", - topics=["printing_prden"], - dimensions="scalar", - defaultval="1 if [[usekden]] == 1 and [[nimage]] == 1 else 0", - mnemonics="PRinT the Kinetic energy DENsity", - added_in_version="before_v9", - text=r""" +), + + +Variable( + abivarname="prtkden", + varset="files", + vartype="integer", + topics=["printing_prden"], + dimensions="scalar", + defaultval="1 if [[usekden]] == 1 and [[nimage]] == 1 else 0", + mnemonics="PRinT the Kinetic energy DENsity", + added_in_version="before_v9", + text=r""" If set to 1 or a larger value, provide output of kinetic energy density in real space tau(r), in units of Bohr^-5. The name of the kinetic energy density file will be the root output name, followed by _KDEN. @@ -17270,17 +18490,18 @@ Note that the computation of the kinetic energy density must be activated, thanks to the input variable [[usekden]]. """, - ), - Variable( - abivarname="prtkpt", - varset="files", - vartype="integer", - topics=["printing_prden", "Output_useful", "k-points_useful"], - dimensions="scalar", - defaultval=0, - mnemonics="PRinT the K-PoinTs sets", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="prtkpt", + varset="files", + vartype="integer", + topics=["printing_prden", "Output_useful", "k-points_useful"], + dimensions="scalar", + defaultval=0, + mnemonics="PRinT the K-PoinTs sets", + added_in_version="before_v9", + text=r""" If set /= 0, proceeds to a detailed analysis of different k point grids. Works only if [[kptopt]] is positive, and neither [[kptrlatt]] nor [[ngkpt]] are defined. ABINIT will stop after this analysis. @@ -17307,49 +18528,76 @@ irreducible set and a file named kpts.nc with the list of the k-points and the corresponding weights is produced """, - ), - Variable( - abivarname="prtlden", - varset="files", - vartype="integer", - topics=["printing_prden"], - dimensions="scalar", - defaultval=0, - mnemonics="PRinT the Laplacian of electron DENsity", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="prtlden", + varset="files", + vartype="integer", + topics=["printing_prden"], + dimensions="scalar", + defaultval=0, + mnemonics="PRinT the Laplacian of electron DENsity", + added_in_version="before_v9", + text=r""" If set to 1 or a larger value, provide output of Laplacian of electron density in real space grho(r), in units of Bohr^-(7/2). The name of the Laplacian of electron density file will be the root output name, followed by _LDEN. Like a _DEN file, it can be analyzed by cut3d. The file structure of this unformatted output file is described in [[help:abinit#denfile|this section]]. """, - ), - Variable( - abivarname="prtnabla", - varset="paw", - vartype="integer", - topics=["printing_prgs"], - dimensions="scalar", - defaultval=0, - mnemonics="PRint NABLA", - requires="[[usepaw]] == 1", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="prt1mag", + varset="files", + vartype="integer", + topics=["DFPT_expert", "ConstrainedDFPT_expert"], + dimensions="scalar", + defaultval=0, + mnemonics="PRinT the 1st-order MAGnetic moments", + added_in_version="10.4", + text=r""" + +When this flag is activated, integrals of the first-order particle and magnetization densities inside the atomic spheres are printed in the output file: + + * **prt1mag** = 1 --> print the integrals of the densities for the last + iteration only. + * **prt1mag** = 2 --> print the integrals of the densities at each + iteration. + +In both cases, the total and local (i.e. integrated inside the atomic spheres) magnetic moments are also written to the DDB file, as second-order derivatives of the total energy with respect to a macroscopic or local +Zeeman field and to another arbitrary perturbation. + +""", +), + +Variable( + abivarname="prtnabla", + varset="paw", + vartype="integer", + topics=["printing_prgs"], + dimensions="scalar", + defaultval=0, + mnemonics="PRint NABLA", + requires="[[usepaw]] == 1", + added_in_version="before_v9", + text=r""" * If set to 1, calculate the matrix elements and write it in file _OPT to be read by the code conducti (see [[cite:Mazevet2010]]). """, - ), - Variable( - abivarname="prtnest", - varset="eph", - vartype="integer", - topics=["printing_prfermi"], - dimensions="scalar", - defaultval=0, - mnemonics="PRinT NESTing function", - characteristics=["[[DEVELOP]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="prtnest", + varset="eph", + vartype="integer", + topics=["printing_prfermi"], + dimensions="scalar", + defaultval=0, + mnemonics="PRinT NESTing function", + characteristics=["[[DEVELOP]]"], + added_in_version="before_v9", + text=r""" Same meaning as [[prtnest@anaddb]]. The only difference with respect to the anaddb version is that the path in q-space must be specified in terms of [[ph_qpath]] and [[ph_nqpath]]. @@ -17361,17 +18609,18 @@ [[prtnest]] can be used either in the GS part or in the EPH code [[optdriver]] == 7 (possibly with [[eph_task]] = 0). """, - ), - Variable( - abivarname="prtphbands", - varset="eph", - vartype="integer", - topics=["printing_prngs"], - dimensions="scalar", - defaultval=1, - mnemonics="PRinT PHonon BANDS", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="prtphbands", + varset="eph", + vartype="integer", + topics=["printing_prngs"], + dimensions="scalar", + defaultval=1, + mnemonics="PRinT PHonon BANDS", + added_in_version="before_v9", + text=r""" This option activates the output of the phonon frequencies in the EPH code. Possible values: @@ -17382,52 +18631,55 @@ with the eigenvalues and a `PHBANDS.gnuplot` script. Use `gnuplot file_PHBANDS.gnuplot` to visualize the phonon band structure. """, - ), - Variable( - abivarname="prtphdos", - varset="eph", - vartype="integer", - topics=["printing_prngs", "ElPhonInt_expert"], - dimensions="scalar", - defaultval=1, - mnemonics="PRinT the PHonon Density Of States", - characteristics=["[[DEVELOP]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="prtphdos", + varset="eph", + vartype="integer", + topics=["printing_prngs", "ElPhonInt_expert"], + dimensions="scalar", + defaultval=1, + mnemonics="PRinT the PHonon Density Of States", + characteristics=["[[DEVELOP]]"], + added_in_version="before_v9", + text=r""" Print the phonon density of states. It is activated by default when [[optdriver]] == 7. Note also that this variable activates the computation of the generalized Eliashberg function associated to the electron-phonon self-energy when [[eph_task]] in [-4, 4]. """, - ), - Variable( - abivarname="prtphsurf", - varset="eph", - vartype="integer", - topics=["printing_prngs", "ElPhonInt_expert"], - dimensions="scalar", - defaultval=0, - mnemonics="PRinT PHonon iso-SURFace", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="prtphsurf", + varset="eph", + vartype="integer", + topics=["printing_prngs", "ElPhonInt_expert"], + dimensions="scalar", + defaultval=0, + mnemonics="PRinT PHonon iso-SURFace", + added_in_version="before_v9", + text=r""" Print a bxsf file (Xcrysden format) with the (interpolated) phonon frequencies computed of the q-mesh determined by [[ph_ngqpt]]. The file can be use to visualize iso-surfaces with Xcrysden or other similar tools supporting the bxsf format. Note that the (dense) q-mesh must be Gamma-centered, shifted meshes are not supported by Xcrysden. This variable requires [[optdriver]] == 7. """, - ), - Variable( - abivarname="prtposcar", - varset="dev", - vartype="integer", - topics=["printing_prgeo"], - dimensions="scalar", - defaultval=0, - mnemonics="PRinT POSCAR file", - characteristics=["[[DEVELOP]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="prtposcar", + varset="dev", + vartype="integer", + topics=["printing_prgeo"], + dimensions="scalar", + defaultval=0, + mnemonics="PRinT POSCAR file", + characteristics=["[[DEVELOP]]"], + added_in_version="before_v9", + text=r""" Print out VASP-style POSCAR and FORCES files, for use with PHON or frophon codes for frozen phonon calculations. See the associated script in @@ -17435,17 +18687,18 @@ for further details on interfacing with PHON, PHONOPY, etc... """, - ), - Variable( - abivarname="prtpot", - varset="files", - vartype="integer", - topics=["printing_prpot"], - dimensions="scalar", - defaultval=0, - mnemonics="PRinT total POTential", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="prtpot", + varset="files", + vartype="integer", + topics=["printing_prpot"], + dimensions="scalar", + defaultval=0, + mnemonics="PRinT total POTential", + added_in_version="before_v9", + text=r""" If set >=1, provide output of the total (Kohn-Sham) potential (sum of local pseudo-potential, Hartree potential, and xc potential). @@ -17464,18 +18717,19 @@ NB: In DFPT calculations, prtpot is automatically set to 1 as the POT files might be used to perform EPH calculations unless the user explicitly sets prtpot to 0 in the input file. """, - ), - Variable( - abivarname="prtprocar", - varset="dev", - vartype="integer", - topics=["printing_prgs"], - dimensions="scalar", - defaultval=0, - mnemonics="PRinT PROCAR file", - characteristics=["[[DEVELOP]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="prtprocar", + varset="dev", + vartype="integer", + topics=["printing_prgs"], + dimensions="scalar", + defaultval=0, + mnemonics="PRinT PROCAR file", + characteristics=["[[DEVELOP]]"], + added_in_version="before_v9", + text=r""" Print out VASP-style PROCAR files, to generate "fat band" structures, where the thickness is proportional to the atomic and angular momentum character. Used in particular with the [pyprocar](https://github.com/romerogroup/pyprocar) @@ -17483,48 +18737,51 @@ VASP format. Attempts have been made to support spin polarized and spinor calculations, but there may be subtle inconsistencies. """, - ), - Variable( - abivarname="prtpsps", - varset="files", - vartype="integer", - topics=["printing_prgs"], - dimensions="scalar", - defaultval=0, - mnemonics="PRint the PSPS file", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="prtpsps", + varset="files", + vartype="integer", + topics=["printing_prgs"], + dimensions="scalar", + defaultval=0, + mnemonics="PRint the PSPS file", + added_in_version="before_v9", + text=r""" If set to 1, the code produces a netcdf file (PSPS.nc) with the internal tables used by Abinit to apply the pseudopotential part of the KS Hamiltonian. The data can be visualized with AbiPy. If prtpsps is set to -1, the code will exit after the output of the PSPS.nc file. """, - ), - Variable( - abivarname="prtspcur", - varset="files", - vartype="integer", - topics=["printing_prgs"], - dimensions="scalar", - defaultval=0, - mnemonics="PRinT the SPin CURrent density", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="prtspcur", + varset="files", + vartype="integer", + topics=["printing_prgs"], + dimensions="scalar", + defaultval=0, + mnemonics="PRinT the SPin CURrent density", + added_in_version="before_v9", + text=r""" If set to 1 or a larger value, provide output of the current density of different direction spins (x,y,z) in the whole unit cell. Should require spinorial wave functions [[nspinor]] = 2. Experimental: this does not work yet. """, - ), - Variable( - abivarname="prtstm", - varset="files", - vartype="integer", - topics=["printing_prgs", "STM_compulsory"], - dimensions="scalar", - defaultval=0, - mnemonics="PRinT the STM density", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="prtstm", + varset="files", + vartype="integer", + topics=["printing_prgs", "STM_compulsory"], + dimensions="scalar", + defaultval=0, + mnemonics="PRinT the STM density", + added_in_version="before_v9", + text=r""" If set to 1, provide output of the electron density in real space rho(r), made only from the electrons close to the Fermi energy, in a range of energy (positive or negative), determined by the (positive or @@ -17571,31 +18828,33 @@ No other printing variables for density or potentials should be activated (e.g. [[prtden]] has to be set to zero). """, - ), - Variable( - abivarname="prtsuscep", - varset="files", - vartype="integer", - topics=["printing_prngs"], - dimensions="scalar", - defaultval=0, - mnemonics="PRinT the SUSCEPtibility file (the irreducible polarizability)", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="prtsuscep", + varset="files", + vartype="integer", + topics=["printing_prngs"], + dimensions="scalar", + defaultval=0, + mnemonics="PRinT the SUSCEPtibility file (the irreducible polarizability)", + added_in_version="before_v9", + text=r""" If set to 0, no _SUSC file will be produced after the screening calculation, only the _SCR file will be output. """, - ), - Variable( - abivarname="prtvclmb", - varset="files", - vartype="integer", - topics=["printing_prpot"], - dimensions="scalar", - defaultval=0, - mnemonics="PRinT V CouLoMB", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="prtvclmb", + varset="files", + vartype="integer", + topics=["printing_prpot"], + dimensions="scalar", + defaultval=0, + mnemonics="PRinT V CouLoMB", + added_in_version="before_v9", + text=r""" If set >= 0 outputs a file with the Coulomb potential, defined as Hartree + local Pseudopotential. @@ -17604,31 +18863,33 @@ If **prtvclmb=2**, only the smooth part of the Coulomb potential is output. """, - ), - Variable( - abivarname="prtvdw", - varset="vdw", - vartype="integer", - topics=["printing_prgs"], - dimensions="scalar", - defaultval=0, - mnemonics="PRinT Van Der Waals file", - characteristics=["[[DEVELOP]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="prtvdw", + varset="vdw", + vartype="integer", + topics=["printing_prgs"], + dimensions="scalar", + defaultval=0, + mnemonics="PRinT Van Der Waals file", + characteristics=["[[DEVELOP]]"], + added_in_version="before_v9", + text=r""" Print out a NetCDF file containing a vdW-DF kernel. """, - ), - Variable( - abivarname="prtvha", - varset="files", - vartype="integer", - topics=["printing_prpot"], - dimensions="scalar", - defaultval=0, - mnemonics="PRinT V_HArtree", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="prtvha", + varset="files", + vartype="integer", + topics=["printing_prpot"], + dimensions="scalar", + defaultval=0, + mnemonics="PRinT V_HArtree", + added_in_version="before_v9", + text=r""" If set >=1, provide output of the Hartree potential. If [[geoopt]] or [[moldyn]] are set to "none", the name of the potential file will be the root output name, @@ -17643,17 +18904,18 @@ The file structure of this unformatted output file is described in [[help:abinit#localpotfile|this section]]. No output is provided by a negative value of this variable. """, - ), - Variable( - abivarname="prtvhxc", - varset="files", - vartype="integer", - topics=["printing_prpot"], - dimensions="scalar", - defaultval=0, - mnemonics="PRinT V_HXC", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="prtvhxc", + varset="files", + vartype="integer", + topics=["printing_prpot"], + dimensions="scalar", + defaultval=0, + mnemonics="PRinT V_HXC", + added_in_version="before_v9", + text=r""" If set >=1, provide output of the sum of the Hartree potential and xc potential. If [[geoopt]] or [[moldyn]] are set to "none", the name of the potential file will be the root output name, @@ -17668,17 +18930,18 @@ The file structure of this unformatted output file is described in [[help:abinit#localpotfile|this section]]. No output is provided by a negative value of this variable. """, - ), - Variable( - abivarname="prtvol", - varset="files", - vartype="integer", - topics=["printing_prgs", "Output_basic"], - dimensions="scalar", - defaultval=0, - mnemonics="PRinT VOLume", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="prtvol", + varset="files", + vartype="integer", + topics=["printing_prgs", "Output_basic"], + dimensions="scalar", + defaultval=0, + mnemonics="PRinT VOLume", + added_in_version="before_v9", + text=r""" Control the volume of printed output. In particular, this concerns the explicit echo of eigenenergies and residuals for all bands and k points in the main output file. Also, the analysis of the value and location of the maximal @@ -17711,17 +18974,18 @@ This debugging feature is not yet activated in the RF routines. Note that [[fftalg]] offers another option for debugging. """, - ), - Variable( - abivarname="prtvolimg", - varset="files", - vartype="integer", - topics=["printing_prgs", "Output_useful"], - dimensions="scalar", - defaultval=0, - mnemonics="PRinT VOLume for IMaGes", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="prtvolimg", + varset="files", + vartype="integer", + topics=["printing_prgs", "Output_useful"], + dimensions="scalar", + defaultval=0, + mnemonics="PRinT VOLume for IMaGes", + added_in_version="before_v9", + text=r""" Control the volume of printed output when an algorithm using images of the cell is used ([[nimage]] > 1). When such an algorithm is activated, the printing volume (in output file) can @@ -17732,17 +18996,18 @@ Using **prtvolimg=2**, the printing volume, for each image, is reduced to total energy and convergence residuals only. """, - ), - Variable( - abivarname="prtvpsp", - varset="files", - vartype="integer", - topics=["printing_prpot"], - dimensions="scalar", - defaultval=0, - mnemonics="PRinT V_PSeudoPotential", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="prtvpsp", + varset="files", + vartype="integer", + topics=["printing_prpot"], + dimensions="scalar", + defaultval=0, + mnemonics="PRinT V_PSeudoPotential", + added_in_version="before_v9", + text=r""" If set >=1, provide output of the local pseudo potential. If [[geoopt]] or [[moldyn]] are set to "none", the name of the potential file will be the root output name, followed by _VPSP. @@ -17755,17 +19020,18 @@ The file structure of this unformatted output file is described in [[help:abinit#localpotfile|this section]]. No output is provided by a negative value of this variable. """, - ), - Variable( - abivarname="prtvxc", - varset="files", - vartype="integer", - topics=["printing_prpot"], - dimensions="scalar", - defaultval=0, - mnemonics="PRinT V_XC", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="prtvxc", + varset="files", + vartype="integer", + topics=["printing_prpot"], + dimensions="scalar", + defaultval=0, + mnemonics="PRinT V_XC", + added_in_version="before_v9", + text=r""" If set >=1, provide output of the exchange-correlation potential. If [[geoopt]] or [[moldyn]] are set to "none", the name of the potential file will be the root output name, @@ -17780,17 +19046,18 @@ The file structure of this unformatted output file is described in [[help:abinit#localpotfile|this section]]. No output is provided by a negative value of this variable. """, - ), - Variable( - abivarname="prtwant", - varset="files", - vartype="integer", - topics=["printing_prgs", "Wannier_compulsory"], - dimensions="scalar", - defaultval=0, - mnemonics="PRinT WANT file", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="prtwant", + varset="files", + vartype="integer", + topics=["printing_prgs", "Wannier_compulsory"], + dimensions="scalar", + defaultval=0, + mnemonics="PRinT WANT file", + added_in_version="before_v9", + text=r""" Flag used to indicate that either the Wannier90 or the WanT interfaces will be used. * [[prtwant]] = 1 --> Use the **ABINIT- WanT** interface. @@ -17857,17 +19124,18 @@ * The final _QPS file created by the self-consistent GW run is required as input. * Any value of [[gwcalctyp]] between between 20 and 29 should be suitable, so, for example, Hartree-Fock maximally-localized Wannier functions could be generated setting [[gwcalctyp]] = 25. """, - ), - Variable( - abivarname="prtwf", - varset="files", - vartype="integer", - topics=["printing_prden", "vdw_useful"], - dimensions="scalar", - defaultval=ValueWithConditions({"[[nimage]] > 1": 0, "defaultval": 1}), - mnemonics="PRinT the WaveFunction", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="prtwf", + varset="files", + vartype="integer", + topics=["printing_prden", "vdw_useful"], + dimensions="scalar", + defaultval=ValueWithConditions({"[[nimage]] > 1": 0, "defaultval": 1}), + mnemonics="PRinT the WaveFunction", + added_in_version="before_v9", + text=r""" If [[prtwf]] = 1, provide output of wavefunction and eigenvalue file The file structure of this unformatted output file is described in [[help:abinit#wfkfile|this section]]. For a standard ground-state calculation, the name of the wavefunction file @@ -17951,18 +19219,19 @@ incorrectly normalized orbitals or non-integer occupation numbers there is probably something set wrong in the input file. """, - ), - Variable( - abivarname="prtwf_full", - varset="files", - vartype="integer", - topics=["printing_prden"], - dimensions="scalar", - defaultval=0, - mnemonics="PRinT Wavefunction file on the FULL mesh", - requires="[[prtwf]] == 1", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="prtwf_full", + varset="files", + vartype="integer", + topics=["printing_prden"], + dimensions="scalar", + defaultval=0, + mnemonics="PRinT Wavefunction file on the FULL mesh", + requires="[[prtwf]] == 1", + added_in_version="before_v9", + text=r""" If set to 1 in a ground-state calculation, the code will output another WFK file (with extension FULL_WFK) containing the wavefunctions in the full BZ as well as a text file with the tables used for the tetrahedron method. Note that @@ -17971,50 +19240,53 @@ produced only if the number of k-points in the irreducible zone ([[nkpt]]) is greater than 3. """, - ), - Variable( - abivarname="prt_lorbmag", - varset="gstate", - vartype="integer", - topics=["printing_prden", "AtomCentered_useful"], - dimensions="scalar", - defaultval=0, - mnemonics="PRinT L ORBital MAGnetic moment inside PAW spheres", - requires="[[nspden]] == 4 and [[usepaw]] == 1 and [[usepawu]] != 0", - added_in_version="v9", - text=r""" +), + +Variable( + abivarname="prt_lorbmag", + varset="gstate", + vartype="integer", + topics=["printing_prden", "AtomCentered_useful"], + dimensions="scalar", + defaultval=0, + mnemonics="PRinT L ORBital MAGnetic moment inside PAW spheres", + requires="[[nspden]] == 4 and [[usepaw]] == 1 and [[usepawu]] != 0", + added_in_version="v9", + text=r""" If set to 1, prints in the output the orbital magnetic moment integrated inside the PAW spheres (Bohr magneton). The orbital magnetic moment is resolved orbital by orbital (p, d and f, the s orbital moment being always zero) on each atom. Works only if PAW and DFT+U is used and if the spin-orbit coupling is on (with [[nspden]] == 4). """, - ), - Variable( - abivarname="prtxml", - varset="files", - vartype="integer", - topics=["printing_prgs"], - dimensions="scalar", - defaultval=0, - mnemonics="PRinT an XML output", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="prtxml", + varset="files", + vartype="integer", + topics=["printing_prgs"], + dimensions="scalar", + defaultval=0, + mnemonics="PRinT an XML output", + added_in_version="before_v9", + text=r""" Create an XML output with common values. The corresponding DTD is distributed in sources as extras/post_processing/abinitRun.dtd. All the DTD is not yet implemented and this one is currently restricted to ground-state computations (and derivative such as geometry optimisation). """, - ), - Variable( - abivarname="ptcharge", - varset="paw", - vartype="real", - topics=["EFG_basic"], - dimensions=["[[ntypat]]"], - defaultval=MultipleValue(number=None, value=0), - mnemonics="PoinT CHARGEs", - requires="[[usepaw]] == 1 and [[nucefg]]>=3", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="ptcharge", + varset="paw", + vartype="real", + topics=["EFG_basic"], + dimensions=["[[ntypat]]"], + defaultval=MultipleValue(number=None, value=0), + mnemonics="PoinT CHARGEs", + requires="[[usepaw]] == 1 and [[nucefg]]>=3", + added_in_version="before_v9", + text=r""" Array of point charges, in atomic units, of the nuclei. In the normal computation of electric field gradients (see [[nucefg]]) the ionic contribution is calculated from the core charges of the atomic sites. Thus @@ -18027,18 +19299,19 @@ the electric field gradient and also a simple point charge computation. The user inputs whatever point charges he/she wishes for each atom type. """, - ), - Variable( - abivarname="ptgroupma", - varset="geo", - vartype="integer", - topics=["spinpolarisation_internal", "SmartSymm_internal"], - dimensions="scalar", - defaultval=0, - mnemonics="PoinT GROUP number for the MAgnetic space group", - characteristics=["[[INTERNAL_ONLY]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="ptgroupma", + varset="geo", + vartype="integer", + topics=["spinpolarisation_internal", "SmartSymm_internal"], + dimensions="scalar", + defaultval=0, + mnemonics="PoinT GROUP number for the MAgnetic space group", + characteristics=["[[INTERNAL_ONLY]]"], + added_in_version="before_v9", + text=r""" This internal variable characterizes a Shubnikov type III magnetic space group (anti-ferromagnetic space group). The user is advised to consult [[cite:Bradley1972]]. In a Shubnikov type III magnetic space group, the primitive cell is the same if one takes @@ -18059,52 +19332,81 @@ Related input variables: [[spgroup]], [[spgroupma]], [[genafm]], [[symafm]]. """, - ), - Variable( - abivarname="pvelmax", - varset="gw", - vartype="real", - topics=["RandStopPow_basic"], - dimensions=[3], - defaultval=MultipleValue(number=3, value=1.0), - mnemonics="Particle VELocity MAXimum", - requires="[[optdriver]] == 3", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="pulayhiststore", + varset="dev", + vartype="integer", + topics=["SCFAlgorithms_expert"], + dimensions="scalar", + defaultval=0, + mnemonics="PULAY HISTory STORAGE mode", + characteristics=["[[DEVELOP]]"], + requires="[[iscf]] in [7,17]", + added_in_version="v10.5", + text=r""" +Selects the storage mode used for the FFT-grid part of the Pulay mixing history. +Mode `1` can reduce the memory footprint of Pulay mixing history, but convergence +should be validated for the target system, especially for very tight tolerances. +Use the default full-precision storage for calculations that must converge close +to the double-precision limit, e.g. residual tolerances around `1.0d-16` or +tighter. + +Possible values are: + + * 0: use the historical full double-precision Pulay history storage. This is the default and stable mode. + * 1: use experimental compact storage. Historical preconditioned residuals are stored in single precision, the most recent trial vector is stored in single precision, and older trial vectors are reconstructed from it using quantized 16-bit adjacent differences with per-slot scale factors. +""", +), + +Variable( + abivarname="pvelmax", + varset="gw", + vartype="real", + topics=["RandStopPow_basic"], + dimensions=[3], + defaultval=MultipleValue(number=3, value=1.0), + mnemonics="Particle VELocity MAXimum", + requires="[[optdriver]] == 3", + added_in_version="before_v9", + text=r""" When [[npvel]] is larger than 0, it performs electronic stopping power calculations on a velocity grid along the direction determined by [[pvelmax]]. The vector [[pvelmax]] defines both the direction and the maximum velocity. [[pvelmax]] is input in Cartesian coordinates. """, - ), - Variable( - abivarname="pw_unbal_thresh", - varset="paral", - vartype="real", - topics=["parallelism_expert"], - dimensions="scalar", - defaultval="40%", - mnemonics="Plane Wave UNBALancing: THRESHold for balancing procedure", - requires="[[paral_kgb]] == 1", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="pw_unbal_thresh", + varset="paral", + vartype="real", + topics=["parallelism_expert"], + dimensions="scalar", + defaultval="40%", + mnemonics="Plane Wave UNBALancing: THRESHold for balancing procedure", + requires="[[paral_kgb]] == 1", + added_in_version="before_v9", + text=r""" This parameter (in %) activates a load balancing procedure when the distribution of plane wave components over MPI processes is not optimal. The balancing procedure is activated when the ratio between the number of plane waves treated by a processor and the ideal one is higher than _pw_unbal_thresh_ %. """, - ), - Variable( - abivarname="qmass", - varset="rlx", - vartype="real", - topics=["PIMD_basic", "MolecularDynamics_basic"], - dimensions=["[[nnos]]"], - defaultval=MultipleValue(number=None, value=10.0), - mnemonics="Q thermostat MASS", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="qmass", + varset="rlx", + vartype="real", + topics=["PIMD_basic", "MolecularDynamics_basic"], + dimensions=["[[nnos]]"], + defaultval=MultipleValue(number=None, value=10.0), + mnemonics="Q thermostat MASS", + added_in_version="before_v9", + text=r""" This are the masses of the chains of [[nnos]] thermostats to be used when [[moldyn]] = "nvt_nose" or "npt_martyna" or "nst_martyna" (Molecular Dynamics) or [[imgmov]] = 13 (Path Integral Molecular Dynamics). @@ -18115,34 +19417,36 @@ can be used with [[optcell]] =0 (NVT ensemble) or 2 (fully flexible NPT ensemble). In that case, [[optcell]] = 2 is NOT USABLE yet. """, - ), - Variable( - abivarname="qprtrb", - varset="ffield", - vartype="integer", - topics=["Artificial_useful"], - dimensions=[3], - defaultval=[0, 0, 0], - mnemonics="Q-wavevector of the PERTurbation", - characteristics=["[[DEVELOP]]"], - requires="[[vprtrb]]", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="qprtrb", + varset="ffield", + vartype="integer", + topics=["Artificial_useful"], + dimensions=[3], + defaultval=[0, 0, 0], + mnemonics="Q-wavevector of the PERTurbation", + characteristics=["[[DEVELOP]]"], + requires="[[vprtrb]]", + added_in_version="before_v9", + text=r""" Gives the wavevector, in units of reciprocal lattice primitive translations, of a perturbing potential of strength [[vprtrb]]. See [[vprtrb]] for more info. """, - ), - Variable( - abivarname="qpt", - varset="gstate", - vartype="real", - topics=["q-points_useful"], - dimensions=[3], - defaultval=[0, 0, 0], - mnemonics="Q PoinT", - characteristics=["[[INPUT_ONLY]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="qpt", + varset="gstate", + vartype="real", + topics=["q-points_useful"], + dimensions=[3], + defaultval=[0, 0, 0], + mnemonics="Q PoinT", + characteristics=["[[INPUT_ONLY]]"], + added_in_version="before_v9", + text=r""" WARNING: Only used if [[nqpt]] = 1. If [[nqpt]]=0 (which is the default value of [[nqpt]]), no reading of [[qpt]] is done, and the default value of [[qpt]], namely the null vector, is kept. @@ -18152,36 +19456,38 @@ This input variable is not internal ([[qptn]](1:3) is used instead), but is used to echo the value of [[qptn]](1:3), with renormalisation factor one. """, - ), - Variable( - abivarname="qptdm", - varset="gw", - vartype="real", - topics=["Susceptibility_useful"], - dimensions=[3, "[[nqptdm]]"], - defaultval=MultipleValue(number=None, value=0.0), - mnemonics="Q-PoinTs for the Dielectric Matrix", - requires="[[optdriver]] == 3 and [[nqptdm]]!=0", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="qptdm", + varset="gw", + vartype="real", + topics=["Susceptibility_useful"], + dimensions=[3, "[[nqptdm]]"], + defaultval=MultipleValue(number=None, value=0.0), + mnemonics="Q-PoinTs for the Dielectric Matrix", + requires="[[optdriver]] == 3 and [[nqptdm]]!=0", + added_in_version="before_v9", + text=r""" [[qptdm]] contains the set of q points used in the screening part of ABINIT, instead of the automatic generation of the q points when [[nqptdm]] = 0. These q points are given in terms of reciprocal space primitive translations (**not** in cartesian coordinates!). For further explanation, see the input variable [[nqptdm]]. """, - ), - Variable( - abivarname="qptn", - varset="internal", - vartype="real", - topics=[" DFPT_internal"], - dimensions=[3], - defaultval=MultipleValue(number=3, value=0), - mnemonics="Q-PoinT re-Normalized", - characteristics=["[[INTERNAL_ONLY]]"], - requires="[[nqpt]] == 1", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="qptn", + varset="internal", + vartype="real", + topics=[" DFPT_internal"], + dimensions=[3], + defaultval=MultipleValue(number=3, value=0), + mnemonics="Q-PoinT re-Normalized", + characteristics=["[[INTERNAL_ONLY]]"], + requires="[[nqpt]] == 1", + added_in_version="before_v9", + text=r""" Only used if [[nqpt]] = 1. In ground-state calculation, the vector **qptn**(1:3) is added to each @@ -18201,35 +19507,37 @@ in reciprocal space is taken into account). Tests remain to be done to see whether other q points might be allowed (perhaps with some modification of the code). """, - ), - Variable( - abivarname="qptnrm", - varset="gstate", - vartype="real", - topics=["q-points_useful"], - dimensions="scalar", - defaultval=1.0, - mnemonics="Q PoinTs NoRMalization", - characteristics=["[[INPUT_ONLY]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="qptnrm", + varset="gstate", + vartype="real", + topics=["q-points_useful"], + dimensions="scalar", + defaultval=1.0, + mnemonics="Q PoinTs NoRMalization", + characteristics=["[[INPUT_ONLY]]"], + added_in_version="before_v9", + text=r""" Only used if [[nqpt]] = 1 and [[qptopt]] = 0 Provides re-normalization of [[qpt]]. Must be positive, non-zero. The actual q vector (renormalized) is [[qptn]](1:3)= [[qpt]](1:3)/[[qptnrm]]. """, - ), - Variable( - abivarname="qptopt", - varset="gstate", - vartype="integer", - topics=["q-points_basic"], - dimensions="scalar", - defaultval=0, - mnemonics="QPoinTs OPTion", - characteristics=["[[INPUT_ONLY]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="qptopt", + varset="gstate", + vartype="integer", + topics=["q-points_basic"], + dimensions="scalar", + defaultval=0, + mnemonics="QPoinTs OPTion", + characteristics=["[[INPUT_ONLY]]"], + added_in_version="before_v9", + text=r""" WARNING: Only used if [[nqpt]] = 1. If [[nqpt]]=0 (which is the default value of [[nqpt]]), no reading of [[qptopt]] is done, and the default value of [[qptopt]] is kept. @@ -18268,19 +19576,20 @@ [[ngkpt]] and [[prtkpt]] might help you to select the optimal grid, similarly to the case of the K point grid. """, - ), - Variable( - abivarname="qptrlatt", - varset="gstate", - vartype="integer", - topics=["q-points_useful"], - dimensions=[3, 3], - defaultval=MultipleValue(number=None, value=0), - mnemonics="Q - PoinTs grid: Real space LATTice", - characteristics=["[[INPUT_ONLY]]"], - excludes="[[ngqpt]]", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="qptrlatt", + varset="gstate", + vartype="integer", + topics=["q-points_useful"], + dimensions=[3, 3], + defaultval=MultipleValue(number=None, value=0), + mnemonics="Q - PoinTs grid: Real space LATTice", + characteristics=["[[INPUT_ONLY]]"], + excludes="[[ngqpt]]", + added_in_version="before_v9", + text=r""" WARNING: Only used if [[nqpt]] = 1. If [[nqpt]]=0 (which is the default value of [[nqpt]]), no reading of [[qptrlatt]] is done, and the default value of [[qptrlatt]] is kept. @@ -18299,35 +19608,37 @@ [[qptrlatt]] and [[shiftq]] that allows one to reach a sufficient value of [[kptrlen]]. See this latter variable for a complete description of this procedure. """, - ), - Variable( - abivarname="quadmom", - varset="paw", - vartype="real", - topics=["EFG_basic"], - dimensions=["[[ntypat]]"], - defaultval=MultipleValue(number=None, value=0), - mnemonics="QUADrupole MOMents", - requires="[[usepaw]] == 1 and [[nucefg]]>1", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="quadmom", + varset="paw", + vartype="real", + topics=["EFG_basic"], + dimensions=["[[ntypat]]"], + defaultval=MultipleValue(number=None, value=0), + mnemonics="QUADrupole MOMents", + requires="[[usepaw]] == 1 and [[nucefg]]>1", + added_in_version="before_v9", + text=r""" * Array of quadrupole moments, in barns, of the nuclei. These values are used in conjunction with the electric field gradients computed with [[nucefg]] to calculate the quadrupole couplings in MHz, as well as the asymmetries. Note that the electric field gradient at a nuclear site is independent of the nuclear quadrupole moment, thus the quadrupole moment of a nucleus can be input as 0. """, - ), - Variable( - abivarname="random_atpos", - varset="rlx", - vartype="integer", - topics=["crystal_expert", "GeoOpt_expert"], - dimensions="scalar", - defaultval=0, - mnemonics="RANDOM ATomic POSitions", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="random_atpos", + varset="rlx", + vartype="integer", + topics=["crystal_expert", "GeoOpt_expert"], + dimensions="scalar", + defaultval=0, + mnemonics="RANDOM ATomic POSitions", + added_in_version="before_v9", + text=r""" Control the inner coordinates, which can be generated randomly by using 4 different methods depending ont its value (0) if zero, no random generation and xred are taken as they have been introduced by the user @@ -18337,40 +19648,36 @@ atoms (note: this is incompatible with the definition of alchemical mixing, in which [[ntypat]] differs from [[npsp]]) """, - ), - Variable( - abivarname="ratsm", - varset="gstate", - vartype="real", - topics=["printing_prdos", "MagMom_useful", "ConstrainedDFT_useful"], - dimensions="scalar", - defaultval=ValueWithConditions({"any([[constraint_kind]] > 1)": 0.05, "defaultval": 0.00}), - mnemonics="Radii of the ATomic spheres SMearing", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="ratsm", + varset="gstate", + vartype="real", + topics=["printing_prdos", "MagMom_useful", "ConstrainedDFT_useful"], + dimensions="scalar", + defaultval=ValueWithConditions({"any([[constraint_kind]] > 1)": 0.05, "defaultval": 0.00}), + mnemonics="Radii of the ATomic spheres SMearing", + added_in_version="before_v9", + text=r""" Smearing width for the atomic spheres whose radius is determined by [[ratsph]]. For each spherical zone around each atom, the integrating function goes from 1.0 to 0.0 in an interval from [[ratsph]]-[[ratsm]] to [[ratsph]]. The function is the same as the one used to smear the kinetic energy, see [[ecutsm]]. """, - ), - Variable( - abivarname="ratsph", - varset="gstate", - vartype="real", - topics=[ - "printing_prdos", - "MagMom_useful", - "ElecBandStructure_useful", - "ElecDOS_useful", - "ConstrainedDFT_basic", - "AtomCentered_basic", - ], - dimensions=["[[ntypat]]"], - defaultval=ValueWithConditions({"[[usepaw]] == 1": "[[AUTO_FROM_PSP]]", "defaultval": 2.00}), - mnemonics="Radii of the ATomic SPHere(s)", - added_in_version="before_v9", - text=r""" +), + + +Variable( + abivarname="ratsph", + varset="gstate", + vartype="real", + topics=["printing_prdos", "MagMom_useful", "ElecBandStructure_useful", "ElecDOS_useful", "ConstrainedDFT_basic", "AtomCentered_basic"], + dimensions=["[[ntypat]]"], + defaultval=ValueWithConditions({"[[usepaw]] == 1": "[[AUTO_FROM_PSP]]", "defaultval": 2.00}), + mnemonics="Radii of the ATomic SPHere(s)", + added_in_version="before_v9", + text=r""" Relevant only when [[prtdensph]] = 1, or [[magconon]]/=0, or any([[constraint_kind]](:)/=0) (that is, constrained DFT), or [[prtdos]] = 3. In most cases (see later for [[prtdos]] = 3), provides the radius of the spheres around each atom in which the total charge density or magnetization will be integrated. @@ -18406,49 +19713,52 @@ channels s, p, d. At the limit of very small radii, the s component dominates the charge contained in the sphere. """, - ), - Variable( - abivarname="ratsph_extra", - varset="gstate", - vartype="real", - topics=["printing_prdos", "AtomCentered_useful"], - dimensions="scalar", - defaultval=ValueWithUnit(units="Bohr", value=2.0), - mnemonics="Radii of the ATomic SPHere(s) in the EXTRA set", - characteristics=["[[LENGTH]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="ratsph_extra", + varset="gstate", + vartype="real", + topics=["printing_prdos","AtomCentered_useful"], + dimensions="scalar", + defaultval=ValueWithUnit(units="Bohr", value=2.0), + mnemonics="Radii of the ATomic SPHere(s) in the EXTRA set", + characteristics=["[[LENGTH]]"], + added_in_version="before_v9", + text=r""" Radius for extra spheres the DOS is projected into. See [[natsph_extra]] and [[xredsph_extra]] for the number and positions of the spheres. """, - ), - Variable( - abivarname="rcut", - varset="gstate", - vartype="real", - topics=["Coulomb_useful"], - dimensions="scalar", - defaultval=0.0, - mnemonics="Radius of the CUT-off for coulomb interaction for Hartree, ion-electron, and ion-ion interactions", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="rcut", + varset="gstate", + vartype="real", + topics=["Coulomb_useful"], + dimensions="scalar", + defaultval=0.0, + mnemonics="Radius of the CUT-off for coulomb interaction for Hartree, ion-electron, and ion-ion interactions", + added_in_version="before_v9", + text=r""" Truncation of the Coulomb interaction in real space. The meaning of [[rcut]] is governed by the cutoff shape options [[icutcoul]]. If [[rcut]] is zero or negative, the cutoff is automatically calculated so to enclose the same volume inside the cutoff as the volume of the solid, i.e primitive cell times the number of k-points. """, - ), - Variable( - abivarname="gw_rcut", - varset="gstate", - vartype="real", - topics=["Coulomb_useful", "GWls_compulsory", "Susceptibility_basic", "SelfEnergy_basic"], - dimensions="scalar", - defaultval=0.0, - mnemonics="Radius of the CUT-off for coulomb interaction", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="gw_rcut", + varset="gstate", + vartype="real", + topics=["Coulomb_useful","GWls_compulsory", "Susceptibility_basic", "SelfEnergy_basic"], + dimensions="scalar", + defaultval=0.0, + mnemonics="Radius of the CUT-off for coulomb interaction", + added_in_version="before_v9", + text=r""" Truncation of the Coulomb interaction in real space. The meaning of [[gw_rcut]] is governed by the cutoff shape options [[gw_icutcoul]]. See complementary information in [[vcutgeo]]. @@ -18469,50 +19779,53 @@ If [[gw_rcut]] is negative, the cutoff is automatically calculated so to enclose the same volume inside the cutoff as the volume of the solid, i.e primitive cell times the number of k-points. """, - ), - Variable( - abivarname="fock_rcut", - varset="gstate", - vartype="real", - topics=["Coulomb_useful"], - dimensions="scalar", - defaultval=0.0, - mnemonics="Radius of the CUT-off for coulomb interaction for FOCK operator", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="fock_rcut", + varset="gstate", + vartype="real", + topics=["Coulomb_useful"], + dimensions="scalar", + defaultval=0.0, + mnemonics="Radius of the CUT-off for coulomb interaction for FOCK operator", + added_in_version="before_v9", + text=r""" Truncation of the Coulomb interaction in real space. The meaning of [[fock_rcut]] is governed by the cutoff shape options [[fock_icutcoul]]. If [[fock_rcut]] is zero or negative, the cutoff is automatically calculated so to enclose the same volume inside the cutoff as the volume of the solid, i.e primitive cell times the number of k-points. """, - ), - Variable( - abivarname="recefermi", - varset="dev", - vartype="real", - topics=["Recursion_useful"], - dimensions="scalar", - defaultval=0, - mnemonics="RECursion - initial guess of the FERMI Energy", - characteristics=["[[DEVELOP]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="recefermi", + varset="dev", + vartype="real", + topics=["Recursion_useful"], + dimensions="scalar", + defaultval=0, + mnemonics="RECursion - initial guess of the FERMI Energy", + characteristics=["[[DEVELOP]]"], + added_in_version="before_v9", + text=r""" Used in Recursion method ([[tfkinfunc]] = 2). In the first SCF calculation it fixes the initial guess for the Fermi energy. """, - ), - Variable( - abivarname="recgratio", - varset="dev", - vartype="integer", - topics=["Recursion_useful"], - dimensions="scalar", - defaultval=1, - mnemonics="RECursion - Grid RATIO", - characteristics=["[[DEVELOP]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="recgratio", + varset="dev", + vartype="integer", + topics=["Recursion_useful"], + dimensions="scalar", + defaultval=1, + mnemonics="RECursion - Grid RATIO", + characteristics=["[[DEVELOP]]"], + added_in_version="before_v9", + text=r""" Used in Recursion method ([[tfkinfunc]] = 2). It represents the ratio of the two grid step: [[recgratio]] = fine_step/coarse_step and it is bigger or equal than 1. It introduces a double-grid system which permits to compute the electronic @@ -18522,52 +19835,55 @@ FFT interpolation. Note that ngfft/recgratio=number of points of the coarse grid has to be compatible with the parallelization parameters. """, - ), - Variable( - abivarname="recnpath", - varset="dev", - vartype="integer", - topics=["Recursion_expert"], - dimensions="scalar", - defaultval=500, - mnemonics="RECursion - Number of point for PATH integral calculations", - characteristics=["[[DEVELOP]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="recnpath", + varset="dev", + vartype="integer", + topics=["Recursion_expert"], + dimensions="scalar", + defaultval=500, + mnemonics="RECursion - Number of point for PATH integral calculations", + characteristics=["[[DEVELOP]]"], + added_in_version="before_v9", + text=r""" Used in Recursion method ([[tfkinfunc]] = 2). Determine the number of discretisation points to compute some path integral in the recursion method; those path integrals are used to compute the entropy and the eigenvalues energy. during the latest SFC cycles. """, - ), - Variable( - abivarname="recnrec", - varset="dev", - vartype="integer", - topics=["Recursion_expert"], - dimensions="scalar", - defaultval=10, - mnemonics="RECursion - Number of RECursions", - characteristics=["[[DEVELOP]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="recnrec", + varset="dev", + vartype="integer", + topics=["Recursion_expert"], + dimensions="scalar", + defaultval=10, + mnemonics="RECursion - Number of RECursions", + characteristics=["[[DEVELOP]]"], + added_in_version="before_v9", + text=r""" Used in Recursion method ([[tfkinfunc]] = 2). Determine the maximum order of recursion, that is the dimension of the krylov space we use to compute density. If the precision set by [[rectolden]] is reached before that order, the recursion method automatically stops. """, - ), - Variable( - abivarname="recptrott", - varset="dev", - vartype="integer", - topics=["Recursion_expert"], - dimensions="scalar", - defaultval=0, - mnemonics="RECursion - TROTTer parameter", - characteristics=["[[DEVELOP]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="recptrott", + varset="dev", + vartype="integer", + topics=["Recursion_expert"], + dimensions="scalar", + defaultval=0, + mnemonics="RECursion - TROTTer parameter", + characteristics=["[[DEVELOP]]"], + added_in_version="before_v9", + text=r""" Used in Recursion method ([[tfkinfunc]] = 2). Determine the trotter parameter used to compute the exponential of the hamiltonian in the recursion method: @@ -18586,120 +19902,127 @@ the discretisation error of the green kernel $e^{\frac{c}{\beta|r|^2}}$ on the ngfft grid. """, - ), - Variable( - abivarname="recrcut", - varset="dev", - vartype="integer", - topics=["Recursion_useful"], - dimensions="scalar", - defaultval=0, - mnemonics="RECursion - CUTing Radius", - characteristics=["[[DEVELOP]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="recrcut", + varset="dev", + vartype="integer", + topics=["Recursion_useful"], + dimensions="scalar", + defaultval=0, + mnemonics="RECursion - CUTing Radius", + characteristics=["[[DEVELOP]]"], + added_in_version="before_v9", + text=r""" Used in Recursion method ([[tfkinfunc]] = 2). Used to improve the computational time in the case of the recursion method in a large cell: the density at a point will be computed with taking account only of a sphere of radius [[recrcut]]. """, - ), - Variable( - abivarname="rectesteg", - varset="dev", - vartype="integer", - topics=["Recursion_expert"], - dimensions="scalar", - defaultval=0, - mnemonics="RECursion - TEST on Electron Gas", - characteristics=["[[DEVELOP]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="rectesteg", + varset="dev", + vartype="integer", + topics=["Recursion_expert"], + dimensions="scalar", + defaultval=0, + mnemonics="RECursion - TEST on Electron Gas", + characteristics=["[[DEVELOP]]"], + added_in_version="before_v9", + text=r""" Used in Recursion method ([[tfkinfunc]] = 2). It is used to test an electron gas by putting the ion potential equal to zero. """, - ), - Variable( - abivarname="rectolden", - varset="dev", - vartype="real", - topics=["Recursion_basic"], - dimensions="scalar", - defaultval=0.0, - mnemonics="RECursion - TOLerance on the difference of electronic DENsity", - characteristics=["[[DEVELOP]]"], - commentdefault="Default value to be changed.", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="rectolden", + varset="dev", + vartype="real", + topics=["Recursion_basic"], + dimensions="scalar", + defaultval=0.0, + mnemonics="RECursion - TOLerance on the difference of electronic DENsity", + characteristics=["[[DEVELOP]]"], + commentdefault="Default value to be changed.", + added_in_version="before_v9", + text=r""" Used in Recursion method ([[tfkinfunc]] = 2). Sets a tolerance for differences of electronic density that, reached TWICE successively, will cause one SCF cycle to stop. That electronic density difference is computed in the infinity norm (that is, it is computed point-by-point, and then the maximum difference is computed). """, - ), - Variable( - abivarname="red_dfield", - varset="ffield", - vartype="real", - topics=["Berry_useful"], - dimensions=[3], - defaultval=MultipleValue(number=3, value=0.0), - mnemonics="REDuced Displacement FIELD", - requires="[[berryopt]] = 16, [[red_efield]]", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="red_dfield", + varset="ffield", + vartype="real", + topics=["Berry_useful"], + dimensions=[3], + defaultval=MultipleValue(number=3, value=0.0), + mnemonics="REDuced Displacement FIELD", + requires="[[berryopt]] = 16, [[red_efield]]", + added_in_version="before_v9", + text=r""" In case [[berryopt]] = 16, a reduced finite electric displacement field calculation is performed. The value of this displacement field, and its direction is determined by [[red_dfield]]. It must be given in atomic units. [[red_dfield]] is defined via Eq.(26) in the Supplement of [[cite:Stengel2009]]. """, - ), - Variable( - abivarname="red_efield", - varset="ffield", - vartype="real", - topics=["Berry_useful"], - dimensions=[3], - defaultval=MultipleValue(number=3, value=0.0), - mnemonics="REDuced Electric FIELD", - requires="[[berryopt]] = 16", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="red_efield", + varset="ffield", + vartype="real", + topics=["Berry_useful"], + dimensions=[3], + defaultval=MultipleValue(number=3, value=0.0), + mnemonics="REDuced Electric FIELD", + requires="[[berryopt]] = 16", + added_in_version="before_v9", + text=r""" In case [[berryopt]] = 16, a reduced finite electric displacement field calculation is performed. In this case, the parameter [[red_efield]] specifies the initial electric field used on the first iteration, in atomic units. [[red_efield]] is defined via Eq.(25) in the Supplement [[cite:Stengel2009]]. """, - ), - Variable( - abivarname="red_efieldbar", - varset="ffield", - vartype="real", - topics=["Berry_useful"], - dimensions=[3], - defaultval=MultipleValue(number=3, value=0.0), - mnemonics="REDuced Electric FIELD BAR", - requires="[[berryopt]] = 14", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="red_efieldbar", + varset="ffield", + vartype="real", + topics=["Berry_useful"], + dimensions=[3], + defaultval=MultipleValue(number=3, value=0.0), + mnemonics="REDuced Electric FIELD BAR", + requires="[[berryopt]] = 14", + added_in_version="before_v9", + text=r""" In case [[berryopt]] = 14, a reduced finite electric field calculation is performed. The magnitude and direction of this electric field are determined by [[red_efieldbar]]. It must be given in atomic units. [[red_efieldbar]] is defined via Eq.(28) in the Supplement of [[cite:Stengel2009]]. """, - ), - Variable( - abivarname="restartxf", - varset="rlx", - vartype="integer", - topics=["PIMD_useful", "MolecularDynamics_useful", "GeoOpt_useful"], - dimensions="scalar", - defaultval=0, - mnemonics="RESTART from (X,F) history", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="restartxf", + varset="rlx", + vartype="integer", + topics=["PIMD_useful", "MolecularDynamics_useful", "GeoOpt_useful"], + dimensions="scalar", + defaultval=0, + mnemonics="RESTART from (X,F) history", + added_in_version="before_v9", + text=r""" Control the restart of a molecular dynamics or structural optimization job. **restartxf = 0 (Default)**: No restart procedure is enabled and the code will start a @@ -18730,17 +20053,18 @@ Previously, positive values of restartxf were allowed, but these are deprecated since ABINITv8. """, - ), - Variable( - abivarname="rf2_dkdk", - varset="dfpt", - vartype="integer", - topics=["DFPT_expert"], - dimensions="scalar", - defaultval=0, - mnemonics="Response Function: 2nd Derivative of wavefunctions with respect to K", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="rf2_dkdk", + varset="dfpt", + vartype="integer", + topics=["DFPT_expert"], + dimensions="scalar", + defaultval=0, + mnemonics="Response Function: 2nd Derivative of wavefunctions with respect to K", + added_in_version="before_v9", + text=r""" If is equal to 1, activates computation of second derivatives of wavefunctions with respect to wavevectors (ipert = natom+10 is activated). This is not strictly a response function but is a needed auxiliary quantity in the calculations of 3rd-order derivatives of the energy @@ -18766,34 +20090,36 @@ electric field: the clamped-ion flexoelectric tensor, the first moment of the polarization response to an atomic displacement and the natural optical activity tensor. """, - ), - Variable( - abivarname="rf2_dkde", - varset="dfpt", - vartype="integer", - topics=["DFPT_expert"], - dimensions="scalar", - defaultval=0, - mnemonics="Response Function: mixed 2nd Derivative of wavefunctions with respect to K and electric field", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="rf2_dkde", + varset="dfpt", + vartype="integer", + topics=["DFPT_expert"], + dimensions="scalar", + defaultval=0, + mnemonics="Response Function: mixed 2nd Derivative of wavefunctions with respect to K and electric field", + added_in_version="before_v9", + text=r""" If is equal to 1, activates computation of mixed second derivatives of wavefunctions with respect to wavevector and electric field (ipert = natom+11 is activated). This is not strictly a response function but is a needed auxiliary quantity in the calculations of 3rd-order derivatives of the energy (non-linear response) if [[usepead]] == 0. The directions for the derivatives are determined by [[rf2_pert1_dir]], [[rf2_pert2_dir]] and [[prepanl]] in the same way than [[rf2_dkdk]]. """, - ), - Variable( - abivarname="rf2_pert1_dir", - varset="dfpt", - vartype="integer", - topics=["DFPT_useful"], - dimensions=[3], - defaultval=[1, 1, 1], - mnemonics="Response Function (2nd order Sternheimer equation): 1st PERTurbation DIRection", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="rf2_pert1_dir", + varset="dfpt", + vartype="integer", + topics=["DFPT_useful"], + dimensions=[3], + defaultval=[1, 1, 1], + mnemonics="Response Function (2nd order Sternheimer equation): 1st PERTurbation DIRection", + added_in_version="before_v9", + text=r""" Gives the directions of the 1st perturbation to be considered when solving the 2nd order Sternheimer equation. The three elements corresponds to the three primitive vectors, either in real space (phonon calculations), or in reciprocal space ($\,d/ \,d k$, homogeneous @@ -18802,17 +20128,18 @@ corresponding direction. If 0, this direction is not considered. See [[rf2_dkdk]] for more details. """, - ), - Variable( - abivarname="rf2_pert2_dir", - varset="dfpt", - vartype="integer", - topics=["DFPT_useful"], - dimensions=[3], - defaultval=[1, 1, 1], - mnemonics="Response Function (2nd order Sternheimer equation): 2nd PERTurbation DIRection", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="rf2_pert2_dir", + varset="dfpt", + vartype="integer", + topics=["DFPT_useful"], + dimensions=[3], + defaultval=[1, 1, 1], + mnemonics="Response Function (2nd order Sternheimer equation): 2nd PERTurbation DIRection", + added_in_version="before_v9", + text=r""" Gives the directions of the 2nd perturbation to be considered when solving the 2nd order Sternheimer equation. The three elements corresponds to the three primitive vectors, either in real space (phonon calculations), or in reciprocal space ($\,d/ \,d k$, homogeneous @@ -18821,17 +20148,18 @@ corresponding direction. If 0, this direction is not considered. See [[rf2_dkdk]] for more details. """, - ), - Variable( - abivarname="rfatpol", - varset="dfpt", - vartype="integer", - topics=["DFPT_basic", "Elastic_compulsory", "Phonons_compulsory"], - dimensions=[2], - defaultval=[1, "[[natom]]"], - mnemonics="Response Function: ATomic POLarisation", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="rfatpol", + varset="dfpt", + vartype="integer", + topics=["DFPT_basic", "Elastic_compulsory", "Phonons_compulsory"], + dimensions=[2], + defaultval=[1, "[[natom]]" ], + mnemonics="Response Function: ATomic POLarisation", + added_in_version="before_v9", + text=r""" Control the range of atoms for which displacements will be considered in phonon calculations (atomic polarizations). These values are only relevant to phonon response function calculations. @@ -18847,23 +20175,27 @@ [[rfdir]]. The name 'iatpol' is used for the part of the internal variable ipert when it runs from 1 to [[natom]]. The internal variable ipert can also assume values larger than [[natom]], denoting perturbations of electric field -or stress type (see [the DFPT help file](/guide/respfn)). +or stress type (see [the DFPT help file](../guide/respfn.md)). As a side technical information, the value [[rfatpol]](1)=-1 is admitted, and transformed immediately to [[rfatpol]](1)=1, while [[rfatpol]](2)=-1 is transformed to [[rfatpol]](2)=[[natom]], while the default input values are actually [[rfatpol]]=-1 . -""", - ), - Variable( - abivarname="rfddk", - varset="dfpt", - vartype="integer", - topics=["DFPT_basic"], - dimensions="scalar", - defaultval=0, - mnemonics="Response Function with respect to Derivative with respect to K", - added_in_version="before_v9", - text=r""" + +Starting from version 10.4, [[rfatpol]] also defines the range of atoms for which the local +Zeeman-field response function is computed when [[rfmagn]] = 2. +""", +), + +Variable( + abivarname="rfddk", + varset="dfpt", + vartype="integer", + topics=["DFPT_basic"], + dimensions="scalar", + defaultval=0, + mnemonics="Response Function with respect to Derivative with respect to K", + added_in_version="before_v9", + text=r""" Activates computation of derivatives of ground state wavefunctions with respect to wavevectors. This is not strictly a response function but is a needed auxiliary quantity in the electric field calculations (see [[rfelfd]]) and orbital magnetism calculations @@ -18874,17 +20206,18 @@ * 1 --> calculation of first derivatives of wavefunctions with respect to k points ($\,d/ \,d k$ calculation). The exact same functionality is provided by [[rfelfd]] = 2. """, - ), - Variable( - abivarname="rfdir", - varset="dfpt", - vartype="integer", - topics=["DFPT_compulsory", "Elastic_compulsory", "Phonons_compulsory"], - dimensions=[3], - defaultval=[1, 1, 1], - mnemonics="Response Function: DIRections", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="rfdir", + varset="dfpt", + vartype="integer", + topics=["DFPT_compulsory", "Elastic_compulsory", "Phonons_compulsory"], + dimensions=[3], + defaultval=[1, 1, 1], + mnemonics="Response Function: DIRections", + added_in_version="before_v9", + text=r""" Gives the directions to be considered for response function calculations (also for the Berry phase computation of the polarization, see the [[berryopt]] input variable). @@ -18898,17 +20231,18 @@ input variables, but also [[berryopt]] are to be computed for the corresponding direction. If 0, this direction should not be considered. """, - ), - Variable( - abivarname="rfelfd", - varset="dfpt", - vartype="integer", - topics=["EffectiveMass_compulsory", "DFPT_basic"], - dimensions="scalar", - defaultval=0, - mnemonics="Response Function with respect to the ELectric FielD", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="rfelfd", + varset="dfpt", + vartype="integer", + topics=["EffectiveMass_compulsory", "DFPT_basic"], + dimensions="scalar", + defaultval=0, + mnemonics="Response Function with respect to the ELectric FielD", + added_in_version="before_v9", + text=r""" Turns on electric field response function calculations. Actually, such calculations requires first the non-self-consistent calculation of derivatives with respect to k, independently of the electric field perturbation itself. @@ -18925,32 +20259,47 @@ The options 2 and 3 proves useful in that context; also, in case a scissor shift is to be used, it is usually not applied for the $\,d / \,d k$ response [[cite:Levine1989]]). """, - ), - Variable( - abivarname="rfmagn", - varset="dfpt", - vartype="integer", - topics=["DFPT_basic"], - dimensions="scalar", - defaultval=0, - mnemonics="Response Function with respect to MAGNetic B-field perturbation", - added_in_version="before_v9", - text=r""" -[[rfmagn]] allows one to run response function calculations with respect to -external magnetic field if set to 1. Currently, orbital magnetism is not taken into -account and the perturbing potential has Zeeman form. For more details, see [[cite:Ricci2019]]. -""", - ), - Variable( - abivarname="rfmeth", - varset="dfpt", - vartype="integer", - topics=["DFPT_expert"], - dimensions="scalar", - defaultval=1, - mnemonics="Response Function METHod", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="rfmagn", + varset="dfpt", + vartype="integer", + topics=["DFPT_basic", "ConstrainedDFPT_basic"], + dimensions="scalar", + defaultval=0, + mnemonics="Response Function with respect to MAGNetic B-field perturbation", + added_in_version="before_v9", + text=r""" +This variable enables response-function calculations with respect to external Zeeman magnetic fields. At present, orbital magnetism is not included, and the perturbing potential has purely Zeeman form. For further details, see Refs. [[cite:Ricci2019]] and [[cite:Royo2026]]. + + * 0 --> no magnetic-field perturbation + * 1 --> uniform magnetic-field perturbation (possibly at finite q) applied along the Cartesian directions specified by [[rfdir]] + * 2 --> local magnetic-field perturbations (possibly at finite q) applied to the atoms specified by [[rfatpol]] and along the + Cartesian directions specified by [[rfdir]]. The size and boundary shape of the atomic spheres wherein the field is applied + are specified by [[ratsph]] and [[ratsm]]. + * 3 --> Uniform non-magnetic scalar potential $e^{i {\bf q \cdot r}}$ perturbation applied along the direction of the wave-vector **q**. + +Note for constrained DFPT calculations: +A set of local magnetic-field response calculations, combined with a geometrically equivalent magnetic penalty +(defined by the variables [[magpen]], [[mpatpol]], and [[mpdir]]), enables the computation of the so-called +local spin susceptibility within the constrained-B functional introduced in Ref. [[cite:Royo2026]]. This quantity +is stored in the DDB file and subsequently used by anaddb to transform the second- and third-order energy derivatives +computed with the magnetic penalty--i.e., within the constrained-B functional--into the corresponding physically +relevant magnetic functionals. +""", +), + +Variable( + abivarname="rfmeth", + varset="dfpt", + vartype="integer", + topics=["DFPT_expert"], + dimensions="scalar", + defaultval=1, + mnemonics="Response Function METHod", + added_in_version="before_v9", + text=r""" Selects method used in response function calculations. Presently, only abs([[rfmeth]]) = 1 is allowed. This corresponds to storing matrix elements of the 2DTE computed using non-stationary expressions, instead of stationary ones. @@ -18962,30 +20311,48 @@ is available. Thus, the results obtained for positive and negative values of [[rfmeth]] might slightly differ for non-zero elements of the 2DTE, if they are computed in both cases. """, - ), - Variable( - abivarname="rfphon", - varset="dfpt", - vartype="integer", - topics=["DFPT_basic"], - dimensions="scalar", - defaultval=0, - mnemonics="Response Function with respect to PHONons", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="rfomega", + varset="gw", + vartype="real", + topics=["DFPT_expert"], + dimensions="scalar", + defaultval=0.0, + mnemonics="Response Function OMEGA", + characteristics=["[[DEVELOP]]"], + added_in_version="before_v9", + text=r""" +This variable sets the frequency (in Hartree energy units) of the perturbation in dynamic linear-response calculations. +If [[rfomega]]/=0, [[tim1rev]] must be set to 0, since a time-dependent perturbation automatically breaks time-reversal symmetry. +""", +), + +Variable( + abivarname="rfphon", + varset="dfpt", + vartype="integer", + topics=["DFPT_basic"], + dimensions="scalar", + defaultval=0, + mnemonics="Response Function with respect to PHONons", + added_in_version="before_v9", + text=r""" It must be equal to 1 to run phonon response function calculations. """, - ), - Variable( - abivarname="rfstrs", - varset="dfpt", - vartype="integer", - topics=["DFPT_basic", "Elastic_compulsory"], - dimensions="scalar", - defaultval=0, - mnemonics="Response Function with respect to STRainS", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="rfstrs", + varset="dfpt", + vartype="integer", + topics=["DFPT_basic", "Elastic_compulsory"], + dimensions="scalar", + defaultval=0, + mnemonics="Response Function with respect to STRainS", + added_in_version="before_v9", + text=r""" Used to run strain response-function calculations (e.g. needed to get elastic constants). Define, with [[rfdir]], the set of perturbations. @@ -18996,17 +20363,18 @@ See the possible restrictions on the use of strain perturbations, in the [[help:respfn]]. """, - ), - Variable( - abivarname="rfstrs_ref", - varset="dfpt", - vartype="integer", - topics=["longwave_useful"], - dimensions="scalar", - defaultval=0, - mnemonics="Response Function with respect to STRainS with the energy REFerence at the average electrostatic potential", - added_in_version="v9", - text=r""" +), + +Variable( + abivarname="rfstrs_ref", + varset="dfpt", + vartype="integer", + topics=["longwave_useful"], + dimensions="scalar", + defaultval=0, + mnemonics="Response Function with respect to STRainS with the energy REFerence at the average electrostatic potential", + added_in_version="v9", + text=r""" If equal to 1 and [[rfstrs]] /= 0 the strain response-function calculations are performed with the reference energy placed at the average electrostatic potential. The later is the reference adopted in the longwave driver. Since v9.x, [[rfstrs_ref]] = 1 is warned if [[prepalw]]/=0 because first-order @@ -19015,36 +20383,38 @@ Strain first-order energies calculated with [[rfstrs_ref]] = 1 are useful, for instance, in the calculation of absolute deformation potentials [[cite:Stengel2015]]. """, - ), - Variable( - abivarname="rhoqpmix", - varset="gw", - vartype="real", - topics=["GW_useful"], - dimensions="scalar", - defaultval=1.0, - mnemonics="RHO QuasiParticle MIXing", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="rhoqpmix", + varset="gw", + vartype="real", + topics=["GW_useful"], + dimensions="scalar", + defaultval=1.0, + mnemonics="RHO QuasiParticle MIXing", + added_in_version="before_v9", + text=r""" For self-consistent GW runs, [[rhoqpmix]] sets the mixing coefficient between the new and the previous electronic densities. This mixing damps the spurious oscillations in the Hartree potential when achieving self-consistency. [[rhoqpmix]] is meaningful only when doing self-consistency on the wavefunctions with [[gwcalctyp]] >= 20. """, - ), - Variable( - abivarname="rprim", - varset="basic", - vartype="real", - topics=["UnitCell_basic"], - dimensions=[3, 3], - defaultval=[[1, 0, 0], [0, 1, 0], [0, 0, 1]], - mnemonics="Real space PRIMitive translations", - characteristics=["[[EVOLVING]]"], - commentdims="Internally, it is represented as rprim(3,3,[[nimage]])", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="rprim", + varset="basic", + vartype="real", + topics=["UnitCell_basic"], + dimensions=[3, 3], + defaultval=[[1, 0, 0], [0, 1, 0], [0, 0, 1]], + mnemonics="Real space PRIMitive translations", + characteristics=["[[EVOLVING]]"], + commentdims="Internally, it is represented as rprim(3,3,[[nimage]])", + added_in_version="before_v9", + text=r""" Give the three dimensionless primitive translations in real space, to be rescaled by [[acell]] and [[scalecart]]. The three first numbers are the coordinates of the first vector, the next three numbers are the coordinates @@ -19156,18 +20526,19 @@ (3*1). So, in case [[scalecart]] is used, the echo of [[rprim]] in the output file is not the value contained in the input file, but the value rescaled by [[scalecart]]. """, - ), - Variable( - abivarname="rprimd", - varset="basic", - vartype="real", - topics=["UnitCell_internal"], - dimensions=[3, 3], - mnemonics="Real space PRIMitive translations, Dimensional", - characteristics=["[[INTERNAL_ONLY]]", "[[EVOLVING]]"], - commentdims="Internally, it is represented as rprimd(3,3,[[nimage]]).", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="rprimd", + varset="basic", + vartype="real", + topics=["UnitCell_internal"], + dimensions=[3, 3], + mnemonics="Real space PRIMitive translations, Dimensional", + characteristics=["[[INTERNAL_ONLY]]", "[[EVOLVING]]"], + commentdims="Internally, it is represented as rprimd(3,3,[[nimage]]).", + added_in_version="before_v9", + text=r""" This internal variable gives the dimensional real space primitive vectors, computed from [[acell]], [[scalecart]], and [[rprim]]. @@ -19177,18 +20548,19 @@ It is [[EVOLVING]] only if [[geoopt]] == "bfgs" or "lbfgs" and [[optcell]]/=0, otherwise it is fixed. """, - ), - Variable( - abivarname="scalecart", - varset="basic", - vartype="real", - topics=["UnitCell_useful"], - dimensions=[3], - defaultval=MultipleValue(number=3, value=1), - mnemonics="SCALE CARTesian coordinates", - characteristics=["[[INPUT_ONLY]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="scalecart", + varset="basic", + vartype="real", + topics=["UnitCell_useful"], + dimensions=[3], + defaultval=MultipleValue(number=3, value=1), + mnemonics="SCALE CARTesian coordinates", + characteristics=["[[INPUT_ONLY]]"], + added_in_version="before_v9", + text=r""" Gives the scaling factors of cartesian coordinates by which dimensionless primitive translations (in "[[rprim]]") are to be multiplied. See the [[rprim]] input @@ -19200,50 +20572,53 @@ immediately applied to rprim, at parsing time, and then scalecart will be set to the default values. So, it will not be echoed. """, - ), - Variable( - abivarname="scphon_supercell", - varset="gstate", - vartype="integer", - topics=["DFPT_expert"], - dimensions=[3], - defaultval=[1, 1, 1], - mnemonics="Self Consistent PHONon SUPERCELL", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="scphon_supercell", + varset="gstate", + vartype="integer", + topics=["DFPT_expert"], + dimensions=[3], + defaultval=[1, 1, 1], + mnemonics="Self Consistent PHONon SUPERCELL", + added_in_version="before_v9", + text=r""" Give extent, in number of primitive unit cells, of the supercell being used for a self-consistent phonon calculation. Presumes the phonon frequencies and eigenvectors have been calculated in the original primitive unit cell, on a grid of q-points which corresponds to the supercell in the present calculation. Experimental. """, - ), - Variable( - abivarname="scphon_temp", - varset="gstate", - vartype="real", - topics=["DFPT_expert"], - dimensions="scalar", - defaultval=0.0, - mnemonics="Self Consistent PHONon TEMPerature", - characteristics=["[[ENERGY]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="scphon_temp", + varset="gstate", + vartype="real", + topics=["DFPT_expert"], + dimensions="scalar", + defaultval=0.0, + mnemonics="Self Consistent PHONon TEMPerature", + characteristics=["[[ENERGY]]"], + added_in_version="before_v9", + text=r""" Temperature which is imposed on phonon distribution, in the self-consistent scheme of [[cite:Souvatzis2008]]. Determines the extent of the finite displacements used, and consequent anharmonic effects. Experimental. """, - ), - Variable( - abivarname="shiftk", - varset="basic", - vartype="real", - topics=["k-points_useful"], - dimensions=[3, "[[nshiftk]]"], - defaultval=ValueWithConditions({"[[nshiftk]]>1": None, "defaultval": [0.5, 0.5, 0.5]}), - mnemonics="SHIFT for K points", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="shiftk", + varset="basic", + vartype="real", + topics=["k-points_useful"], + dimensions=[3, "[[nshiftk]]"], + defaultval=ValueWithConditions({"[[nshiftk]]>1": None, "defaultval": [0.5, 0.5, 0.5]}), + mnemonics="SHIFT for K points", + added_in_version="before_v9", + text=r""" It is used only when [[kptopt]] >= 0, and must be defined if [[nshiftk]] is larger than 1. [[shiftk]](1:3,1:[[nshiftk]]) defines [[nshiftk]] shifts of the homogeneous @@ -19310,18 +20685,19 @@ one can use [[nshiftk]] = 1 and [[shiftk]] 0.0 0.0 0.5 """, - ), - Variable( - abivarname="shiftq", - varset="gstate", - vartype="real", - topics=["q-points_useful"], - dimensions=[3, "[[nshiftq]]"], - defaultval=ValueWithConditions({"[[nshiftq]]>1": None, "defaultval": [0.5, 0.5, 0.5]}), - mnemonics="SHIFT for Q points", - characteristics=["[[INPUT_ONLY]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="shiftq", + varset="gstate", + vartype="real", + topics=["q-points_useful"], + dimensions=[3, "[[nshiftq]]"], + defaultval=ValueWithConditions({"[[nshiftq]]>1": None, "defaultval": [0.5, 0.5, 0.5]}), + mnemonics="SHIFT for Q points", + characteristics=["[[INPUT_ONLY]]"], + added_in_version="before_v9", + text=r""" WARNING: Only used if [[nqpt]] = 1. If [[nqpt]]=0 (which is the default value of [[nqpt]]), no reading of [[shiftq]] is done, and the default value of [[shiftq]] is kept. @@ -19332,31 +20708,33 @@ See [[shiftk]] for more information on the definition, use, and suitable values for these shifts. """, - ), - Variable( - abivarname="signperm", - varset="rlx", - vartype="integer", - topics=["MolecularDynamics_expert"], - dimensions="scalar", - defaultval=1, - mnemonics="SIGN of PERMutation potential", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="signperm", + varset="rlx", + vartype="integer", + topics=["MolecularDynamics_expert"], + dimensions="scalar", + defaultval=1, + mnemonics="SIGN of PERMutation potential", + added_in_version="before_v9", + text=r""" +1 favors alternation of species -1 favors segregation """, - ), - Variable( - abivarname="slabwsrad", - varset="gstate", - vartype="real", - topics=["Artificial_expert"], - dimensions="scalar", - defaultval=0.0, - mnemonics="jellium SLAB Wigner-Seitz RADius", - characteristics=["[[LENGTH]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="slabwsrad", + varset="gstate", + vartype="real", + topics=["Artificial_expert"], + dimensions="scalar", + defaultval=0.0, + mnemonics="jellium SLAB Wigner-Seitz RADius", + characteristics=["[[LENGTH]]"], + added_in_version="before_v9", + text=r""" Fix the bulk-mean positive charge density $n_{bulk}$ of a jellium slab (if the latter is employed, e.g. [[jellslab]]/=0). Often called $r_s$ (see for example [[cite:Lang1970]]), [[slabwsrad]] is the radius of a @@ -19374,17 +20752,18 @@ $r_s$=2.07 Bohr, while for example magnesium has $r_s$=2.65 Bohr, sodium 3.99 Bohr. By default, given in Bohr atomic units (1 Bohr=0.5291772108 Angstroms). """, - ), - Variable( - abivarname="slabzbeg", - varset="gstate", - vartype="real", - topics=["Artificial_expert"], - dimensions="scalar", - defaultval=0.0, - mnemonics="jellium SLAB BEGinning edge along the z-direction", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="slabzbeg", + varset="gstate", + vartype="real", + topics=["Artificial_expert"], + dimensions="scalar", + defaultval=0.0, + mnemonics="jellium SLAB BEGinning edge along the z-direction", + added_in_version="before_v9", + text=r""" Define the edges of the jellium slab (if used, so if [[jellslab]]/=0) along z, namely the slab starts at a point along z which is expressed in Bohr by [[slabzbeg]] and it ends at a point expressed in Bohr by [[slabzend]]. @@ -19392,30 +20771,33 @@ to be orthogonal to the other ones, so the length of the cell along z is [[rprimd]](3,3). In addition [[slabzbeg]] and [[slabzend]] have to be such that: - 0 ≤ [[slabzbeg]] < [[slabzend]] ≤ [[rprimd]](3,3) +\begin{equation} + 0 \leq slabzbeg \lt slabzend \leq rprimd(3,3) +\end{equation} Together with [[slabwsrad]] they define the jellium positive charge density distribution $n_{+}(x,y,z)$ in this way: \begin{eqnarray} - n_{+}(x,y,z) &=& n_{bulk} \quad \text{if} \quad [[slabzbeg]] \leq z \leq [[slabzend]] \nonumber\\ + n_{+}(x,y,z) &=& n_{bulk} \quad \text{if} \quad slabzbeg \leq z \leq slabzend \nonumber\\ &=& 0 \quad \text{otherwise} \nonumber \end{eqnarray} so the positive charge density is invariant along the xy plane as well as the electrostatic potential generated by it. """, - ), - Variable( - abivarname="slabzend", - varset="gstate", - vartype="real", - topics=["Artificial_expert"], - dimensions="scalar", - defaultval=0.0, - mnemonics="jellium SLAB ENDing edge along the z-direction", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="slabzend", + varset="gstate", + vartype="real", + topics=["Artificial_expert"], + dimensions="scalar", + defaultval=0.0, + mnemonics="jellium SLAB ENDing edge along the z-direction", + added_in_version="before_v9", + text=r""" Define the edges of the jellium slab (if used, so if [[jellslab]]/=0) along z, namely the slab starts at a point along z which is expressed in Bohr by [[slabzbeg]] and it ends at a point expressed in Bohr by [[slabzend]]. @@ -19423,30 +20805,33 @@ to be orthogonal to the other ones, so the length of the cell along z is [[rprimd]](3,3). In addition [[slabzbeg]] and [[slabzend]] have to be such that: - 0 ≤ [[slabzbeg]] < [[slabzend]] ≤ [[rprimd]](3,3) +\begin{equation} + 0 \leq slabzbeg \lt slabzend \leq rprimd(3,3) +\end{equation} Together with [[slabwsrad]] they define the jellium positive charge density distribution $n_{+}(x,y,z)$ in this way: \begin{eqnarray} - n_{+}(x,y,z) &=& n_{bulk} \quad \text{if} \quad [[slabzbeg]] \leq z \leq [[slabzend]] \nonumber \\ + n_{+}(x,y,z) &=& n_{bulk} \quad \text{if} \quad slabzbeg \leq z \leq slabzend \nonumber \\ &=& 0 \quad \text{otherwise} \nonumber \end{eqnarray} so the positive charge density is invariant along the xy plane as well as the electrostatic potential generated by it. """, - ), - Variable( - abivarname="slk_rankpp", - varset="gstate", - vartype="integer", - topics=["parallelism_expert"], - dimensions="scalar", - defaultval=[1000], - mnemonics="ScaLapacK matrix RANK Per Process", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="slk_rankpp", + varset="gstate", + vartype="integer", + topics=["parallelism_expert"], + dimensions="scalar", + defaultval=[1000], + mnemonics="ScaLapacK matrix RANK Per Process", + added_in_version="before_v9", + text=r""" This variable controls how the number of processes to be used in Scalapack diagonalization algorithm: [[np_slk]] will be calculated according to this value. This value is the matrix rank that each process will hold for the diagonalization. For a 1000x1000 matrix with default value, scalapack won't be used (Lapack will be used). @@ -19459,17 +20844,18 @@ Usually it is better to define this variable and let the code do the rest. """, - ), - Variable( - abivarname="smdelta", - varset="dfpt", - vartype="integer", - topics=["TDepES_compulsory"], - dimensions="scalar", - defaultval=0, - mnemonics="SMeared DELTA function", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="smdelta", + varset="dfpt", + vartype="integer", + topics=["TDepES_compulsory"], + dimensions="scalar", + defaultval=0, + mnemonics="SMeared DELTA function", + added_in_version="before_v9", + text=r""" When [[smdelta]] in non-zero, it will trigger the calculation of the imaginary part of the second-order electronic eigenvalues, which can be related to the electronic lifetimes. The delta function is evaluated using: @@ -19480,18 +20866,19 @@ * when [[smdelta]] == 4, Smearing of Methfessel and Paxton ([[cite:Methfessel1989]]) with Hermite polynomial of degree 2, corresponding to "Cold smearing" of N. Marzari with $a=0$ (so, same smeared delta function as smdelta=2, with different $a$). * when [[smdelta]] == 5, Gaussian smearing: $\frac{e^{-x^2}}{\sqrt{\pi}}$ """, - ), - Variable( - abivarname="so_psp", - varset="gstate", - vartype="integer", - topics=["spinpolarisation_useful"], - dimensions=["[[npsp]]"], - defaultval=MultipleValue(number="[[npsp]]", value=1), - mnemonics="Spin-Orbit treatment for each PSeudoPotential", - requires="[[nspinor]] == 2 and [[usepaw]] == 0", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="so_psp", + varset="gstate", + vartype="integer", + topics=["spinpolarisation_useful"], + dimensions=["[[npsp]]"], + defaultval=MultipleValue(number="[[npsp]]", value=1), + mnemonics="Spin-Orbit treatment for each PSeudoPotential", + requires="[[nspinor]] == 2 and [[usepaw]] == 0", + added_in_version="before_v9", + text=r""" For each type of atom (each pseudopotential), specify the treatment of spin-orbit interaction (if [[nspinor]] == 2 and Norm-conserving pseudopotentials i.e. [[usepaw]] == 0) For PAW calculations with SOC, please refer to [[pawspnorb]]. @@ -19516,35 +20903,37 @@ [[so_psp]]. Because the values 0 and 1 have been switched between [[so_psp]] and **so_typat**, it was dangerous to continue to allow the use of **so_typat**. """, - ), - Variable( - abivarname="spbroad", - varset="gw", - vartype="real", - topics=["Susceptibility_useful"], - dimensions="scalar", - defaultval=0.0, - mnemonics="SPectral BROADening", - characteristics=["[[ENERGY]]"], - requires="[[optdriver]] == 3 and [[spmeth]] == 2", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="spbroad", + varset="gw", + vartype="real", + topics=["Susceptibility_useful"], + dimensions="scalar", + defaultval=0.0, + mnemonics="SPectral BROADening", + characteristics=["[[ENERGY]]"], + requires="[[optdriver]] == 3 and [[spmeth]] == 2", + added_in_version="before_v9", + text=r""" When a screening calculation ([[optdriver]] == 3) uses a spectral representation of the irreducible polarizability in which the delta function is replaced by the gaussian approximant ([[spmeth]] == 2), the standard deviation of the gaussian is given by [[spbroad]]. """, - ), - Variable( - abivarname="spgaxor", - varset="geo", - vartype="integer", - topics=["SmartSymm_useful"], - dimensions="scalar", - defaultval=1, - mnemonics="SPace Group: AXes ORientation", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="spgaxor", + varset="geo", + vartype="integer", + topics=["SmartSymm_useful"], + dimensions="scalar", + defaultval=1, + mnemonics="SPace Group: AXes ORientation", + added_in_version="before_v9", + text=r""" It is taken into account only when [[spgroup]]/=0; it allows one to define the axes orientation for the specific space groups for which this is needed. Trigonal groups (number 146,148,155,160,161,166,167): @@ -19585,18 +20974,19 @@ Bilbao axis (b) is in the first position. In this case you have 2 possibilities, [[spgaxor]] 3 or 5. If you have more than one highly symmetric coordinate you may have only a single possibility. """, - ), - Variable( - abivarname="spgorig", - varset="geo", - vartype="integer", - topics=["SmartSymm_useful"], - dimensions="scalar", - defaultval=1, - mnemonics="SPace Group: ORIGin", - requires="[[spgroup]]!=0", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="spgorig", + varset="geo", + vartype="integer", + topics=["SmartSymm_useful"], + dimensions="scalar", + defaultval=1, + mnemonics="SPace Group: ORIGin", + requires="[[spgroup]]!=0", + added_in_version="before_v9", + text=r""" Gives the choice of origin for the axes system. It is defined according to the origin choice in the International Tables of Crystallography. @@ -19604,17 +20994,18 @@ 130, 133, 134, 137, 141, 142, 201, 203, 222, 224, 227, 228. For more details see the [[help:spacegroup]]. """, - ), - Variable( - abivarname="spgroup", - varset="geo", - vartype="integer", - topics=["crystal_useful", "UnitCell_useful", "SmartSymm_basic"], - dimensions="scalar", - defaultval=0, - mnemonics="SPace GROUP number", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="spgroup", + varset="geo", + vartype="integer", + topics=["crystal_useful", "UnitCell_useful", "SmartSymm_basic"], + dimensions="scalar", + defaultval=0, + mnemonics="SPace GROUP number", + added_in_version="before_v9", + text=r""" Gives the Fedorov space group number of the system. It should be between 1 and 230, see [[help:spacegroup]]. Alternatively, if [[spgroup]] is 0, the code assumes that all the symmetries are input @@ -19631,18 +21022,19 @@ Related input variables: [[symrel]], [[tnons]], [[symafm]], [[spgroupma]], """, - ), - Variable( - abivarname="spgroupma", - varset="geo", - vartype="integer", - topics=["spinpolarisation_useful", "SmartSymm_useful"], - dimensions="scalar", - defaultval=0, - mnemonics="SPace GROUP number defining a MAgnetic space group", - characteristics=["[[INPUT_ONLY]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="spgroupma", + varset="geo", + vartype="integer", + topics=["spinpolarisation_useful", "SmartSymm_useful"], + dimensions="scalar", + defaultval=0, + mnemonics="SPace GROUP number defining a MAgnetic space group", + characteristics=["[[INPUT_ONLY]]"], + added_in_version="before_v9", + text=r""" This input variable might be used to define a Shubnikov magnetic space group (anti-ferromagnetic space group). The user is advised to consult [[cite:Bradley1972]]. @@ -19680,21 +21072,29 @@ positions and [[spinat]] vectors might yield different [[symafm]] values depending on [[nspden]], and thus different Shubnikov magnetic space groups. """, - ), - Variable( - abivarname="spinat", - varset="gstate", - vartype="real", - topics=["spinpolarisation_basic", "crystal_useful", "MagMom_useful", "ConstrainedDFT_useful"], - dimensions=ValueWithConditions({"[[natrd]]<[[natom]]": "[3, [[natrd]] ]", "defaultval": "[3, [[natom]] ]"}), - defaultval=0.0, - mnemonics="SPIN for AToms", - added_in_version="before_v9", - text=r""" -Gives the **initial** electronic spin-magnetization for each atom in Cartesian coordinates, in unit of $\hbar/2$, +), + +Variable( + abivarname="spinat", + varset="gstate", + vartype="real", + topics=["spinpolarisation_basic", "crystal_useful", "MagMom_useful", "ConstrainedDFT_useful"], + dimensions=ValueWithConditions({"[[natrd]]<[[natom]]": "[3, [[natrd]] ]", "defaultval": "[3, [[natom]] ]"}), + defaultval=0.0, + mnemonics="SPIN for AToms", + added_in_version="before_v9", + text=r""" +Gives the **initial** electronic spin-magnetization for each atom, in unit of $\hbar/2$, as well as, in case of fixed magnetization calculations (see [[constraint_kind]] and [[magconon]]), the **target value** of the magnetization. +The three components are expressed in the spin-axis basis defined by [[spinaxis]]. +For the default value [[spinaxis]] = (0 0 1), this basis coincides with the Cartesian reference frame, +so that [[spinat]] is equivalent to [[spinat_cart]]. + +When [[spinaxis]] is not aligned with the Cartesian z axis, it is recommended to use [[spinat_cart]] +instead of [[spinat]], in order to specify the magnetic vectors directly in Cartesian coordinates. + Note that if [[nspden]] = 2, the z-component must be given for each atom, in triplets (0 0 z-component). For example, the electron of an hydrogen atom can be spin up (0 0 1.0) or spin down (0 0 -1.0). @@ -19721,17 +21121,42 @@ * In the case of PAW+U calculations using the [[dmatpawu]] initial occupation matrix, and if [[nspden]] = 4, [[spinat]] is also used to determine the direction of the integrated magnetization matrix. """, - ), - Variable( - abivarname="spinmagntarget", - varset="ffield", - vartype="real", - topics=["spinpolarisation_useful"], - dimensions="scalar", - defaultval=-99.99, - mnemonics="SPIN-MAGNetization TARGET", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="spinat_cart", + varset="gstate", + vartype="real", + topics=["spinpolarisation_basic", "crystal_useful", "MagMom_useful", "ConstrainedDFT_useful"], + dimensions=ValueWithConditions({"[[natrd]]<[[natom]]": "[3, [[natrd]] ]", "defaultval": "[3, [[natom]] ]"}), + defaultval=0.0, + mnemonics="SPIN for AToms in CARTesian coordinates", + added_in_version="10.7.0", + text=r""" +Gives the **initial** electronic spin-magnetization for each atom in **Cartesian** coordinates, in unit of $\hbar/2$,. +as well as, in case of fixed magnetization calculations (see [[constraint_kind]] and [[magconon]]), +the **target value** of the magnetization. + +This variable is the Cartesian-coordinate counterpart of [[spinat]]. +Unlike [[spinat]], this variable is always interpreted in the Cartesian reference frame, regardless of the value of [[spinaxis]]. +It is recommended when [[spinaxis]] is not aligned with the Cartesian z axis, in order to specify +the magnetic moments directly in Cartesian coordinates. + +Note that if [[nspden]] = 2, only the component along [[spinaxis]] is used: the Cartesian magnetic +moments specified by [[spinat_cart]] are therefore projected onto this axis. +""", +), + +Variable( + abivarname="spinmagntarget", + varset="ffield", + vartype="real", + topics=["spinpolarisation_useful"], + dimensions="scalar", + defaultval=-99.99, + mnemonics="SPIN-MAGNetization TARGET", + added_in_version="before_v9", + text=r""" This input variable is active only in the [[nsppol]] = 2 case. It is an auxiliary input variable, that is used to define how the occupation numbers are generated (see [[occ]] input variable). @@ -19769,18 +21194,19 @@ the main output file. In the fixed magnetic moment case, it differs from the spin up Fermi energy. """, - ), - Variable( - abivarname="spmeth", - varset="gw", - vartype="integer", - topics=["Susceptibility_useful"], - dimensions="scalar", - defaultval=0, - mnemonics="SPectral METHod", - requires="[[optdriver]] == 4", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="spmeth", + varset="gw", + vartype="integer", + topics=["Susceptibility_useful"], + dimensions="scalar", + defaultval=0, + mnemonics="SPectral METHod", + requires="[[optdriver]] == 4", + added_in_version="before_v9", + text=r""" The [[spmeth]] input variable defines the method used to calculate the irreducible polarizability $\chi^{(0)}_{KS}$. @@ -19812,18 +21238,19 @@ * 1 --> use the spectral method approximating the delta function with a triangular approximant as proposed in **REF TO BE ADDED** * 2 --> use spectral method but approximating the delta function with a Taylor expansion of the exponential as proposed in **REF TO BE ADDED** """, - ), - Variable( - abivarname="spnorbscl", - varset="paw", - vartype="real", - topics=["PAW_expert", "spinpolarisation_useful"], - dimensions="scalar", - defaultval=1.0, - mnemonics="SPin-ORBit SCaLing", - requires="( [[usepaw]] == 1 and [[pawspnorb]] >= 1) .or NC pseudos with SOC terms.", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="spnorbscl", + varset="paw", + vartype="real", + topics=["PAW_expert", "spinpolarisation_useful"], + dimensions="scalar", + defaultval=1.0, + mnemonics="SPin-ORBit SCaLing", + requires="( [[usepaw]] == 1 and [[pawspnorb]] >= 1) .or NC pseudos with SOC terms.", + added_in_version="before_v9", + text=r""" Scaling of the spin-orbit interaction. The default values (one) gives the first-principles value, while other values are used for the analysis of the effect of the spin-orbit interaction, but are not expected to correspond to any @@ -19832,18 +21259,19 @@ Note that, starting with version 9.5.2, this option is also compatible with NC pseudos provided the pseudopotential files include the SOC term. """, - ), - Variable( - abivarname="stmbias", - varset="gstate", - vartype="real", - topics=["STM_compulsory"], - dimensions="scalar", - defaultval=0.0, - mnemonics="Scanning Tunneling Microscopy BIAS voltage", - characteristics=["[[ENERGY]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="stmbias", + varset="gstate", + vartype="real", + topics=["STM_compulsory"], + dimensions="scalar", + defaultval=0.0, + mnemonics="Scanning Tunneling Microscopy BIAS voltage", + characteristics=["[[ENERGY]]"], + added_in_version="before_v9", + text=r""" Gives, in Hartree, the bias of the STM tip, with respect to the sample, in order to generate the STM density map. Used with positive [[iscf]], [[occopt]] = 7 (metallic, gaussian), [[nstep]] = 1, @@ -19856,33 +21284,35 @@ the [[ENERGY]] characteristics (0.001 Ha = 27.2113845 meV = 315.773 Kelvin). With [[occopt]] = 7, one has also to specify an independent broadening [[tsmear]]. """, - ), - Variable( - abivarname="strfact", - varset="rlx", - vartype="real", - topics=["GeoOpt_basic"], - dimensions="scalar", - defaultval=100, - mnemonics="STRess FACTor", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="strfact", + varset="rlx", + vartype="real", + topics=["GeoOpt_basic"], + dimensions="scalar", + defaultval=100, + mnemonics="STRess FACTor", + added_in_version="before_v9", + text=r""" The stresses (in atomic units) multiplied by [[strfact]] will be treated like forces (in atomic units) in the algorithms for optimization ([[geoopt]] == "bfgs" or "lbfgs", non-zero [[optcell]]). For example, the stopping criterion defined by [[tolmxf]] relates to these scaled stresses. """, - ), - Variable( - abivarname="string_algo", - varset="rlx", - vartype="integer", - topics=["TransPath_useful"], - dimensions="scalar", - defaultval=1, - mnemonics="STRING method ALGOrithm", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="string_algo", + varset="rlx", + vartype="integer", + topics=["TransPath_useful"], + dimensions="scalar", + defaultval=1, + mnemonics="STRING method ALGOrithm", + added_in_version="before_v9", + text=r""" Relevant only when [[imgmov]] = 2 (String Method). Gives the variant of the String Method method used. Possible values can be: @@ -19902,32 +21332,34 @@ done by using energy-weight arc-lengths, giving a finer distribution near the saddle point. See [[cite:Weinan2007]] and [[cite:Goodrow2009]] """, - ), - Variable( - abivarname="strprecon", - varset="rlx", - vartype="real", - topics=["ForcesStresses_useful", "GeoOpt_useful"], - dimensions="scalar", - defaultval=1.0, - mnemonics="STRess PRECONditioner", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="strprecon", + varset="rlx", + vartype="real", + topics=["ForcesStresses_useful", "GeoOpt_useful"], + dimensions="scalar", + defaultval=1.0, + mnemonics="STRess PRECONditioner", + added_in_version="before_v9", + text=r""" This is a scaling factor to initialize the part of the Hessian related to the treatment of the stresses (optimisation of the unit cell). In case there is an instability, decrease the default value, e.g. set it to 0.1. """, - ), - Variable( - abivarname="strtarget", - varset="rlx", - vartype="real", - topics=["ForcesStresses_useful", "GeoOpt_useful"], - dimensions=[6], - defaultval=[0.0, 0.0, 0.0, 0.0, 0.0, 0.0], - mnemonics="STRess TARGET", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="strtarget", + varset="rlx", + vartype="real", + topics=["ForcesStresses_useful", "GeoOpt_useful"], + dimensions=[6], + defaultval=[0.0, 0.0, 0.0, 0.0, 0.0, 0.0], + mnemonics="STRess TARGET", + added_in_version="before_v9", + text=r""" Define the target stress to be obtained by optimization of the cell. The components of the stress tensor must be stored according to: (1,1) -->1; (2,2) --> 2; (3,3) --> 3; (2,3) --> 4; (3,1) --> 5; (1,2) -->6. The conversion factor @@ -19936,17 +21368,18 @@ -P -P -P 0 0 0 . Not used if [[optcell]] == 0. """, - ), - Variable( - abivarname="symafm", - varset="gstate", - vartype="integer", - topics=["spinpolarisation_useful"], - dimensions=["[[nsym]]"], - defaultval=MultipleValue(number="[[nsym]]", value=1), - mnemonics="SYMmetries, Anti-FerroMagnetic characteristics", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="symafm", + varset="gstate", + vartype="integer", + topics=["spinpolarisation_useful"], + dimensions=["[[nsym]]"], + defaultval=MultipleValue(number="[[nsym]]", value=1), + mnemonics="SYMmetries, Anti-FerroMagnetic characteristics", + added_in_version="before_v9", + text=r""" In case the material is magnetic, [[nspden]]=2 or 4, additional symmetry operations might appear, that change the sign of the magnetization (spin-flip). They have been introduced by Shubnikov in 1951 [[cite:Bradley1972]]. They can be used by ABINIT to decrease the CPU time, either @@ -19999,19 +21432,20 @@ Related variables: [[symrel]], [[tnons]], [[ptgroupma]], [[spgroupma]]. """, - ), - Variable( - abivarname="symchi", - varset="gw", - vartype="integer", - topics=["Susceptibility_expert"], - dimensions="scalar", - defaultval=1, - mnemonics=r"SYMmetryze $\chi_0$", - characteristics=["[[DEVELOP]]"], - requires="[[optdriver]] == 3", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="symchi", + varset="gw", + vartype="integer", + topics=["Susceptibility_expert"], + dimensions="scalar", + defaultval=1, + mnemonics=r"SYMmetryze $\chi_0$", + characteristics=["[[DEVELOP]]"], + requires="[[optdriver]] == 3", + added_in_version="before_v9", + text=r""" The evaluation of the irreducible polarizability for a given q point requires an integration over the Brillouin zone (BZ) which is approximated by a discrete sum over k points. In principle the integrand function should be @@ -20023,34 +21457,36 @@ * 0 --> the summation over k points is performed considering **all** the points in the BZ (useful for testing and debugging). * 1 --> the summation is restricted to the k points belonging to the irreducible wedge defined by the little group associated to the external vector q. """, - ), - Variable( - abivarname="symdynmat", - varset="eph", - vartype="integer", - topics=["Phonons_useful"], - dimensions="scalar", - defaultval=1, - mnemonics="SYMmetrize the DYNamical MATrix", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="symdynmat", + varset="eph", + vartype="integer", + topics=["Phonons_useful"], + dimensions="scalar", + defaultval=1, + mnemonics="SYMmetrize the DYNamical MATrix", + added_in_version="before_v9", + text=r""" If symdynmat is equal to 1, the dynamical matrix is symmetrized before the diagonalization (same meaning as the corresponding anaddb variable). Note that [[symdynmat]] == 1 will automatically enable the symmetrization of the electron- phonon linewidths. """, - ), - Variable( - abivarname="symmorphi", - varset="dev", - vartype="integer", - topics=["crystal_expert", "GW_useful"], - dimensions="scalar", - defaultval=1, - mnemonics="SYMMORPHIc symmetry operation selection", - characteristics=["[[DEVELOP]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="symmorphi", + varset="dev", + vartype="integer", + topics=["crystal_expert", "GW_useful"], + dimensions="scalar", + defaultval=1, + mnemonics="SYMMORPHIc symmetry operation selection", + characteristics=["[[DEVELOP]]"], + added_in_version="before_v9", + text=r""" With [[symmorphi]] = 1, symmetry operations with a non-symmorphic vector are allowed. With [[symmorphi]] = 0, they are not allowed. In the latter case, if the symmetry operations are specified in the input file, the code will stop @@ -20064,17 +21500,18 @@ were restricted to the IBZ. In order to prepare GW calculations, and to perform GW calculations, [[symmorphi]] = 0 was to be used, together with [[nsym]] = 0. """, - ), - Variable( - abivarname="symrel", - varset="basic", - vartype="integer", - topics=["crystal_useful"], - dimensions=[3, 3, "[[nsym]]"], - defaultval=ValueWithConditions({"[[nsym]] == 1": [[1, 0, 0], [0, 1, 0], [0, 0, 1]], "defaultval": None}), - mnemonics="SYMmetry in REaL space", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="symrel", + varset="basic", + vartype="integer", + topics=["crystal_useful"], + dimensions=[3, 3, "[[nsym]]"], + defaultval=ValueWithConditions({"[[nsym]] == 1": [[1, 0, 0], [0, 1, 0], [0, 0, 1]], "defaultval": None}), + mnemonics="SYMmetry in REaL space", + added_in_version="before_v9", + text=r""" Gives "[[nsym]]" 3x3 matrices expressing space group symmetries in terms of their action on the direct (or real) space primitive translations. It turns out that these can always be expressed as integers. @@ -20098,18 +21535,20 @@ Also see the accompanying input variables [[tnons]] and [[symafm]], for the full definition of the symmetry operations. Such variables are used to infer [[spgroup]], [[spgroupma]] and [[genafm]] if they are not user-defined. """, - ), - Variable( - abivarname="symsigma", - varset="gw", - vartype="integer", - topics=["SelfEnergy_expert"], - dimensions="scalar", - defaultval=1, - mnemonics="SYMmetrization of SIGMA matrix elements", - commentdefault="The default value changed in Abinitv9 from 0 to 1", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="symsigma", + varset="gw", + vartype="integer", + topics=["SelfEnergy_expert"], + dimensions="scalar", + defaultval=1, + mnemonics="SYMmetrization of SIGMA matrix elements", + requires="[[optdriver]] in [4, 7]", + commentdefault="The default value changed in Abinitv9 from 0 to 1", + added_in_version="before_v9", + text=r""" This option activates the symmetrization of the self-energy matrix elements ([[symsigma]] = 1). In this case the BZ integration defining the self-energy matrix elements is reduced to an appropriate irreducible wedge defined @@ -20127,35 +21566,37 @@ accidental degeneracy. States are considered degenerate if their energies differ by less than [[symsigma_de]]. """, - ), - Variable( - abivarname="symsigma_de", - varset="gw", - vartype="real", - topics=["SelfEnergy_expert"], - dimensions="scalar", - defaultval="1 meV", - mnemonics="SYMmetrization of SIGMA matrix elements, Delta Energy", - characteristics=["[[ENERGY]]"], - added_in_version="10.7.0", - text=r""" +), + +Variable( + abivarname="symsigma_de", + varset="gw", + vartype="real", + topics=["SelfEnergy_expert"], + dimensions="scalar", + defaultval="1 meV", + mnemonics="SYMmetrization of SIGMA matrix elements, Delta Energy", + characteristics=["[[ENERGY]]"], + added_in_version="10.7.0", + text=r""" This variable is used in conjunction with [[symsigma]] 1. States are considered degenerate if their energies differ by less than [[symsigma_de]]. The cutoff can be specified in Ha units (the default), Ry, eV, meV or Kelvin, since **symsigma_de** has the [[ENERGY]] characteristics. """, - ), - Variable( - abivarname="td_maxene", - varset="dfpt", - vartype="real", - topics=["TDDFT_useful"], - dimensions="scalar", - defaultval=0.0, - mnemonics="Time-Dependent dft: MAXimal kohn-sham ENErgy difference", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="td_maxene", + varset="dfpt", + vartype="real", + topics=["TDDFT_useful"], + dimensions="scalar", + defaultval=0.0, + mnemonics="Time-Dependent dft: MAXimal kohn-sham ENErgy difference", + added_in_version="before_v9", + text=r""" The Matrix to be diagonalized in the Casida framework (see [[cite:Casida1995]]) is a NxN matrix, where, by default, N is the product of the number of occupied states by the number of unoccupied states. The input variable [[td_maxene]] @@ -20164,30 +21605,32 @@ The default value 0.0 means that all pairs are taken into account. See [[td_mexcit]] for an alternative way to decrease N. """, - ), - Variable( - abivarname="tolcum", - varset="eph", - vartype="real", - topics=["ElPhonInt_expert"], - dimensions="scalar", - defaultval=0.0, - mnemonics="TOLerance on CUMulant", - added_in_version="9.8.0", - text=r""" +), + +Variable( + abivarname="tolcum", + varset="eph", + vartype="real", + topics=["ElPhonInt_expert"], + dimensions="scalar", + defaultval=0.0, + mnemonics="TOLerance on CUMulant", + added_in_version="9.8.0", + text=r""" This variable is active when computing the cumulant with [[eph_task]] = 9. """, - ), - Variable( - abivarname="td_mexcit", - varset="dfpt", - vartype="real", - topics=["TDDFT_useful"], - dimensions="scalar", - defaultval=0, - mnemonics="Time-Dependent dft: Maximal number of EXCITations", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="td_mexcit", + varset="dfpt", + vartype="real", + topics=["TDDFT_useful"], + dimensions="scalar", + defaultval=0, + mnemonics="Time-Dependent dft: Maximal number of EXCITations", + added_in_version="before_v9", + text=r""" The Matrix to be diagonalized in the Casida framework (see [[cite:Casida1995]]) is a NxN matrix, where, by default, N is the product of the number of occupied states by the number of unoccupied states. The input variable [[td_mexcit]] @@ -20196,18 +21639,19 @@ However, when [[td_mexcit]] is zero, all pairs are allowed. See [[td_maxene]] for an alternative way to decrease N. """, - ), - Variable( - abivarname="tfkinfunc", - varset="dev", - vartype="integer", - topics=["Recursion_compulsory"], - dimensions="scalar", - defaultval=0, - mnemonics="Thomas-Fermi KINetic energy FUNCtional", - characteristics=["[[DEVELOP]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="tfkinfunc", + varset="dev", + vartype="integer", + topics=["Recursion_compulsory"], + dimensions="scalar", + defaultval=0, + mnemonics="Thomas-Fermi KINetic energy FUNCtional", + characteristics=["[[DEVELOP]]"], + added_in_version="before_v9", + text=r""" * [[tfkinfunc]] = 1: Thomas-Fermi kinetic functional (explicit functional of the density) is used instead of Kohn-Sham kinetic energy functional (implicit functional of the density through Kohn-Sham wavefunctions). See [[cite:Perrot1979]]. @@ -20246,19 +21690,20 @@ In the recursion method the following variables are set to: [[useylm]] = 1, [[userec]] = 1. """, - ), - Variable( - abivarname="tfw_toldfe", - varset="dev", - vartype="real", - topics=["Recursion_useful"], - dimensions="scalar", - defaultval="1.0E-6 or [[toldfe]] is present", - mnemonics="Thomas-Fermi-Weizsacker: TOLerance on the DiFference of total Energy, for initialization steps", - characteristics=["[[ENERGY]]"], - requires="[[tfkinfunc]] = 11", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="tfw_toldfe", + varset="dev", + vartype="real", + topics=["Recursion_useful"], + dimensions="scalar", + defaultval="1.0E-6 or [[toldfe]] is present", + mnemonics="Thomas-Fermi-Weizsacker: TOLerance on the DiFference of total Energy, for initialization steps", + characteristics=["[[ENERGY]]"], + requires="[[tfkinfunc]] = 11", + added_in_version="before_v9", + text=r""" This input variable has the same definition as [[toldfe]] and is only relevant when [[tfkinfunc]] = 11. It sets a tolerance for absolute differences of total energy that, reached @@ -20266,38 +21711,41 @@ correction) to stop and the gradient correction to be added. Can be specified in Ha (the default), Ry, eV or Kelvin, since it has the [[ENERGY]] characteristics. """, - ), - Variable( - abivarname="tim1rev", - varset="dfpt", - vartype="integer", - topics=["DFPT_expert", "DFPT_internal"], - dimensions="scalar", - defaultval=0, - mnemonics="TIMe 1st order REVersal", - characteristics=["[[DEVELOP]]"], - added_in_version="before_v9", - text=r""" -Allowed values are 0 or 1. - -If tim1rev is equal to 1, the Sternheimer equation is solved simultaneously at -+q and -q perturbation wavevectors. The first order potential at -q is taken -to be equal to the Hermitian conjugate of the first order potential at +q. -The wavefunctions from both +q and -q are then combined to generate the first order density. -Relevant in the case of magnetic field perturbation (but will be relevant also in case of non-zero frequency DFPT, when implemented). -""", - ), - Variable( - abivarname="timopt", - varset="gstate", - vartype="integer", - topics=["Control_expert"], - dimensions="scalar", - defaultval=ValueWithConditions({"[[SEQUENTIAL]]": 1, "defaultval": 0}), - mnemonics="TIMing OPTion", - characteristics=["[[NO_MULTI]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="timdisp", + varset="dfpt", + vartype="integer", + topics=["longwave_expert"], + dimensions="scalar", + defaultval=0, + mnemonics="TIMe DISPersion", + requires="[[optdriver]] == 10", + characteristics=["[[DEVELOP]]"], + added_in_version="10.4", + text=r""" + +If [[optdriver]] is equal to 10, which activates a longwave run, setting [[timdisp]]=1 enables the +calculation of frequency-derivatives (Berry curvatures) of second-order energy derivatives +specified by the variables: [[d3e_pert1_phon]], [[d3e_pert1_elfd]], +[[d3e_pert1_magn]], [[d3e_pert2_phon]], etc.... + +This **requires** the precalculation of the corresponding first-order wavefunction files, +""", +), + +Variable( + abivarname="timopt", + varset="gstate", + vartype="integer", + topics=["Control_expert"], + dimensions="scalar", + defaultval=ValueWithConditions({"[[SEQUENTIAL]]": 1, "defaultval": 0}), + mnemonics="TIMing OPTion", + characteristics=["[[NO_MULTI]]"], + added_in_version="before_v9", + text=r""" This input variable allows one to modulate the use of the timing routines. * If 0 --> as soon as possible, suppresses all calls to timing routines @@ -20327,32 +21775,60 @@ for too small runs - the timing would take more time than the run !). The timer is timed. The sum of the independent parts is closer to 100% than for [[timopt]] = -3. """, - ), - Variable( - abivarname="tl_nprccg", - varset="gstate", - vartype="integer", - topics=["Wavelets_expert"], - dimensions="scalar", - defaultval=30, - mnemonics="TaiL maximum Number of PReConditioner Conjugate Gradient iterations", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="tim1rev", + varset="dfpt", + vartype="integer", + topics=["DFPT_expert", "DFPT_internal"], + dimensions="scalar", + defaultval=1, + mnemonics="TIMe 1st order REVersal", + characteristics=["[[DEVELOP]]"], + added_in_version="before_v9", + text=r""" +Allowed values are 0 or 1. + +If tim1rev is equal to 0, the Sternheimer equation is solved simultaneously at ++q and -q perturbation wavevectors. The first order potential at -q is taken +to be equal to the Hermitian conjugate of the first order potential at +q. +The wavefunctions from both +q and -q are then combined to generate the first order density. +Relevant in the following cases: + + * Finite-q phonon response function calculation in a magnetic material. + * Magnetic field perturbation [[rfmagn]]=1 or 2. + * Finite-frequency response function calculation (even in the q=0 limit). + * Berry curvature calculation at finte q or finite frequency. +""", +), + +Variable( + abivarname="tl_nprccg", + varset="gstate", + vartype="integer", + topics=["Wavelets_expert"], + dimensions="scalar", + defaultval=30, + mnemonics="TaiL maximum Number of PReConditioner Conjugate Gradient iterations", + added_in_version="before_v9", + text=r""" This variable is similar to [[wvl_nprccg]] but for the preconditioner iterations during the tail corrections (see [[tl_radius]]). """, - ), - Variable( - abivarname="tl_radius", - varset="gstate", - vartype="real", - topics=["Wavelets_useful"], - dimensions="scalar", - defaultval=0.0, - mnemonics="TaiL expansion RADIUS", - characteristics=["[[LENGTH]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="tl_radius", + varset="gstate", + vartype="real", + topics=["Wavelets_useful"], + dimensions="scalar", + defaultval=0.0, + mnemonics="TaiL expansion RADIUS", + characteristics=["[[LENGTH]]"], + added_in_version="before_v9", + text=r""" In the wavelet computation case, the linkage between the grid and the free boundary conditions can be smoothed using an exponential decay. This means a correction on the energy at the end on each wavefunction optimisation run. If @@ -20361,16 +21837,17 @@ correspond to a length in atomic units being the spatial expansion with the exponential decay around the grid. """, - ), - Variable( - abivarname="tnons", - varset="basic", - vartype="real", - topics=["crystal_useful"], - dimensions=[3, "[[nsym]]"], - mnemonics="Translation NON-Symmorphic vectors", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="tnons", + varset="basic", + vartype="real", + topics=["crystal_useful"], + dimensions=[3, "[[nsym]]"], + mnemonics="Translation NON-Symmorphic vectors", + added_in_version="before_v9", + text=r""" Gives the (nonsymmorphic) translation vectors associated with the symmetries expressed in "[[symrel]]". These may all be 0, or may be fractional (nonprimitive) translations expressed @@ -20389,20 +21866,21 @@ See also [[symafm]] for the complete description of the symmetry operation. """, - ), - Variable( - abivarname="toldfe", - varset="basic", - vartype="real", - topics=["SCFControl_basic"], - dimensions="scalar", - defaultval=0.0, - mnemonics="TOLerance on the DiFference of total Energy", - characteristics=["[[ENERGY]]"], - commentdefault="The default value implies that this stopping condition is ignored. For the SCF case, one and only one of the input tolerance criteria [[toldff]], [[tolrff]], [[toldfe]], [[toldmag]] or [[tolvrs]] can differ from zero.", - excludes="[[toldff]] or [[tolrff]] or [[tolvrs]] or [[toldmag]]", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="toldfe", + varset="basic", + vartype="real", + topics=["SCFControl_basic"], + dimensions="scalar", + defaultval=0.0, + mnemonics="TOLerance on the DiFference of total Energy", + characteristics=["[[ENERGY]]"], + commentdefault="The default value implies that this stopping condition is ignored. For the SCF case, one and only one of the input tolerance criteria [[toldff]], [[tolrff]], [[toldfe]], [[toldmag]] or [[tolvrs]] can differ from zero.", + excludes="[[toldff]] or [[tolrff]] or [[tolvrs]] or [[toldmag]]", + added_in_version="before_v9", + text=r""" Sets a tolerance for absolute differences of total energy that, reached TWICE successively, will cause one SCF cycle to stop (and ions to be moved). Can be specified in Ha (the default), Ry, eV, meV or Kelvin, since [[toldfe]] has @@ -20438,19 +21916,20 @@ Note that a tolerance defined generically does not couple with a criterion defined for one particular dataset. See [[tolwfr]] for more details about coupling two criteria. """, - ), - Variable( - abivarname="toldff", - varset="basic", - vartype="real", - topics=["SCFControl_basic", "ForcesStresses_basic"], - dimensions="scalar", - defaultval=0.0, - mnemonics="TOLerance on the DiFference of Forces", - commentdefault="The default value implies that this stopping condition is ignored. For the SCF case, one and only one of the input tolerance criteria [[toldff]], [[tolrff]], [[toldfe]] or [[tolvrs]] can differ from zero.", - excludes="[[toldfe]] or [[tolrff]] or [[tolvrs]]", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="toldff", + varset="basic", + vartype="real", + topics=["SCFControl_basic", "ForcesStresses_basic"], + dimensions="scalar", + defaultval=0.0, + mnemonics="TOLerance on the DiFference of Forces", + commentdefault="The default value implies that this stopping condition is ignored. For the SCF case, one and only one of the input tolerance criteria [[toldff]], [[tolrff]], [[toldfe]] or [[tolvrs]] can differ from zero.", + excludes="[[toldfe]] or [[tolrff]] or [[tolvrs]]", + added_in_version="before_v9", + text=r""" Sets a tolerance for differences of forces (in hartree/Bohr) that, reached TWICE successively, will cause one SCF cycle to stop (and ions to be moved). If set to zero, this stopping condition is ignored. @@ -20473,19 +21952,20 @@ Note that a tolerance defined generically does not couple with a criterion defined for one particular dataset. See [[tolwfr]] for more details about coupling two criteria. """, - ), - Variable( - abivarname="toldmag", - varset="basic", - vartype="real", - topics=["SCFControl_basic", "ForcesStresses_basic"], - dimensions="scalar", - defaultval=0.0, - mnemonics="TOLerance on the DiFference of MAGnetizations", - commentdefault="The default value implies that this stopping condition is ignored. For the SCF case, one and only one of the input tolerance criteria [[toldff]], [[tolrff]], [[toldfe]], [[toldmag]] or [[tolvrs]] can differ from zero.", - excludes="[[toldfe]] or [[tolrff]] or [[tolvrs]]", - added_in_version="v10.5", - text=r""" +), + +Variable( + abivarname="toldmag", + varset="basic", + vartype="real", + topics=["SCFControl_basic", "ForcesStresses_basic"], + dimensions="scalar", + defaultval=0.0, + mnemonics="TOLerance on the DiFference of MAGnetizations", + commentdefault="The default value implies that this stopping condition is ignored. For the SCF case, one and only one of the input tolerance criteria [[toldff]], [[tolrff]], [[toldfe]], [[toldmag]] or [[tolvrs]] can differ from zero.", + excludes="[[toldfe]] or [[tolrff]] or [[tolvrs]]", + added_in_version="v10.5", + text=r""" Sets a tolerance for differences of magnetization (in atomic unit ) that, reached TWICE successively, will cause one SCF cycle to stop (and ions to be moved). If set to zero, this stopping condition is ignored. @@ -20508,18 +21988,18 @@ When the maximum magnetization among all atoms and directions is smaller than 10e^-8, both the maximum of magnetization and its difference are reset to zero. In this case, the **toldmag** convergence criterion cannot be used. """, - ), - Variable( - abivarname="tolimg", - varset="rlx", - vartype="real", - topics=["TransPath_basic"], - dimensions="scalar", - defaultval=5e-05, - mnemonics="TOLerance on the mean total energy for IMaGes", - characteristics=["[[ENERGY]]"], - added_in_version="before_v9", - text=r""" +), +Variable( + abivarname="tolimg", + varset="rlx", + vartype="real", + topics=["TransPath_basic"], + dimensions="scalar", + defaultval=5e-05, + mnemonics="TOLerance on the mean total energy for IMaGes", + characteristics=["[[ENERGY]]"], + added_in_version="before_v9", + text=r""" Sets a maximal absolute energy tolerance (in hartree, averaged over dynamic images) below which iterations on images (the one governed by the [[ntimimage]] input variable) will stop. @@ -20529,35 +22009,37 @@ A value of about 5.0d-5 hartree or smaller is suggested (this corresponds to about 3.7d-7 eV). No meaning for RF calculations. """, - ), - Variable( - abivarname="tolmxde", - varset="rlx", - vartype="real", - topics=["GeoOpt_basic"], - dimensions="scalar", - defaultval=0.0, - mnemonics="TOLerance on the MaXimal Difference in Energy", - characteristics=["[[ENERGY]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="tolmxde", + varset="rlx", + vartype="real", + topics=["GeoOpt_basic"], + dimensions="scalar", + defaultval=0.0, + mnemonics="TOLerance on the MaXimal Difference in Energy", + characteristics=["[[ENERGY]]"], + added_in_version="before_v9", + text=r""" Sets a maximal difference in energy with respect to the two previous steps below which BFGS structural relaxation iterations will stop. A value of about 0.0005 eV/atom or smaller is suggested. In order to use tolmxde, you should explicitly set tolmxf to 0.0. No meaning for RF calculations. """, - ), - Variable( - abivarname="tolmxf", - varset="rlx", - vartype="real", - topics=["GeoOpt_basic"], - dimensions="scalar", - defaultval=5e-05, - mnemonics="TOLerance on the MaXimal Force", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="tolmxf", + varset="rlx", + vartype="real", + topics=["GeoOpt_basic"], + dimensions="scalar", + defaultval=5e-05, + mnemonics="TOLerance on the MaXimal Force", + added_in_version="before_v9", + text=r""" Sets a maximal absolute force tolerance (in hartree/Bohr) below which BFGS structural relaxation iterations will stop. Can also control tolerance on stresses, when [[optcell]] /=0, using the @@ -20570,17 +22052,18 @@ to about 2.5d-3 eV/Angstrom). No meaning for RF calculations. """, - ), - Variable( - abivarname="tolrde", - varset="dev", - vartype="real", - topics=["SCFControl_expert"], - dimensions="scalar", - defaultval=0.005, - mnemonics="TOLerance on the Relative Difference of Eigenenergies", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="tolrde", + varset="dev", + vartype="real", + topics=["SCFControl_expert"], + dimensions="scalar", + defaultval=0.005, + mnemonics="TOLerance on the Relative Difference of Eigenenergies", + added_in_version="before_v9", + text=r""" Sets a tolerance for the ratio of differences of eigenenergies in the line minimisation conjugate-gradient algorithm. It compares the decrease of the eigenenergy due to the last line minimisation, with the one observed for the @@ -20590,19 +22073,20 @@ This stopping criterion is present only for band-by-band conjugate gradient ([[wfoptalg]] different than 1,4,14 and 114) and [[rmm_diis]], but both GS and RF calculations. In RF calculations, [[tolrde]] is actually doubled before comparing with the above-mentioned ratio, for historical reasons. """, - ), - Variable( - abivarname="tolrff", - varset="basic", - vartype="real", - topics=["SCFControl_basic", "ForcesStresses_basic"], - dimensions="scalar", - defaultval=0.0, - mnemonics="TOLerance on the Relative diFference of Forces", - commentdefault="The default value implies that this stopping condition is ignored. For the SCF case, one and only one of the input tolerance criteria [[toldff]], [[tolrff]], [[toldfe]] or [[tolvrs]] can differ from zero.", - excludes="[[toldfe]] or [[toldff]] or [[tolvrs]]'", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="tolrff", + varset="basic", + vartype="real", + topics=["SCFControl_basic", "ForcesStresses_basic"], + dimensions="scalar", + defaultval=0.0, + mnemonics="TOLerance on the Relative diFference of Forces", + commentdefault="The default value implies that this stopping condition is ignored. For the SCF case, one and only one of the input tolerance criteria [[toldff]], [[tolrff]], [[toldfe]] or [[tolvrs]] can differ from zero.", + excludes="[[toldfe]] or [[toldff]] or [[tolvrs]]'", + added_in_version="before_v9", + text=r""" Sets a tolerance for the ratio of differences of forces (in hartree/Bohr) to maximum force, that, reached TWICE successively, will cause one SCF cycle to stop (and ions to be moved): diffor < tolrff * maxfor. @@ -20626,17 +22110,18 @@ Note that a tolerance defined generically does not couple with a criterion defined for one particular dataset. See [[tolwfr]] for more details about coupling two criteria. """, - ), - Variable( - abivarname="tolsym", - varset="geo", - vartype="real", - topics=["crystal_useful"], - dimensions="scalar", - defaultval=1e-05, - mnemonics="TOLERANCE for SYMmetries", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="tolsym", + varset="geo", + vartype="real", + topics=["crystal_useful"], + dimensions="scalar", + defaultval=1e-05, + mnemonics="TOLERANCE for SYMmetries", + added_in_version="before_v9", + text=r""" Gives the tolerance on the atomic positions (reduced coordinates), primitive vectors, or magnetization, to be considered equivalent, thanks to symmetry operations. This is used in the recognition of the set of symmetries of the @@ -20650,20 +22135,21 @@ If [[tolsym]] is set to a larger value than 1.e-8 (and the default is larger than 1.e-8), then the input atomic coordinates and lattice parameters are automatically re-symmetrized by the symmetry operations that have been found. -""", - ), - Variable( - abivarname="tolvrs", - varset="basic", - vartype="real", - topics=["SCFControl_basic"], - dimensions="scalar", - defaultval=0.0, - mnemonics="TOLerance on the potential V(r) ReSidual", - commentdefault="The default value implies that this stopping condition is ignored. For the SCF case, one and only one of the input tolerance criteria [[toldff]], [[tolrff]], [[toldfe]] or [[tolvrs]] or [[toldmag]] can differ from zero.", - excludes="[[toldfe]] or [[toldff]] or [[tolrff]] or [[toldmag]]'", - added_in_version="before_v9", - text=r""" +""" +), + +Variable( + abivarname="tolvrs", + varset="basic", + vartype="real", + topics=["SCFControl_basic"], + dimensions="scalar", + defaultval=0.0, + mnemonics="TOLerance on the potential V(r) ReSidual", + commentdefault="The default value implies that this stopping condition is ignored. For the SCF case, one and only one of the input tolerance criteria [[toldff]], [[tolrff]], [[toldfe]] or [[tolvrs]] or [[toldmag]] can differ from zero.", + excludes="[[toldfe]] or [[toldff]] or [[tolrff]] or [[toldmag]]'", + added_in_version="before_v9", + text=r""" Sets a tolerance for potential residual that, when reached, will cause one SCF cycle to stop (and ions to be moved). If set to zero, this stopping condition is ignored. @@ -20695,17 +22181,18 @@ Note that a tolerance defined generically does not couple with a criterion defined for one particular dataset. See [[tolwfr]] for more details about coupling two criteria. """, - ), - Variable( - abivarname="tolwfr", - varset="basic", - vartype="real", - topics=["SCFControl_basic"], - dimensions="scalar", - mnemonics="TOLerance on the Wavefunction Residuals", - defaultval=0.0, - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="tolwfr", + varset="basic", + vartype="real", + topics=["SCFControl_basic"], + dimensions="scalar", + mnemonics="TOLerance on the Wavefunction Residuals", + defaultval=0.0, + added_in_version="before_v9", + text=r""" The signification of this tolerance depends on the basis set. In plane waves, it gives a convergence tolerance for the largest squared "residual" (defined below) for any given band. The squared residual is: @@ -20745,17 +22232,18 @@ It is based on the norm 2 of the gradient of the wavefunctions. Typical values range from 5*10^-4 to 5*10^-5. """, - ), - Variable( - abivarname="tolwfr_diago", - varset="basic", - vartype="real", - topics=["SCFControl_expert"], - dimensions="scalar", - defaultval="[[tolwfr]]", - mnemonics="TOLerance on WaveFunction squared Residual at the DIAGOnalization level", - added_in_version="9.11.3", - text=r""" +), + +Variable( + abivarname="tolwfr_diago", + varset="basic", + vartype="real", + topics=["SCFControl_expert"], + dimensions="scalar", + defaultval="[[tolwfr]]", + mnemonics="TOLerance on WaveFunction squared Residual at the DIAGOnalization level", + added_in_version="9.11.3", + text=r""" This criterion is the same than [[tolwfr]], but used to control the diagonalization algorithm instead of the SCF cycles. In practice it is used to reduce the number of "lines" done at the diagonalization step (see [[nline]]), saving computational time. If the squared residual becomes lower than **tolwfr_diago**, the remaining "lines" to be done are skipped. @@ -20769,18 +22257,19 @@ For [[wfoptalg]]=114 (LOBPCG) and [[wfoptalg]]=111 (Chebyshev filtering), if **tolwfr_diago**=0 (default value if [[tolwfr]] is not specified in the input) then it is set to 1e-20 internally. As a consequence, to ensure that no lines are skipped one has to set **tolwfr_diago**=1e-30 in the input (instead of 0) in this particular case. """, - ), - Variable( - abivarname="tphysel", - varset="gstate", - vartype="real", - topics=["BandOcc_useful"], - dimensions="scalar", - defaultval=0.0, - mnemonics="Temperature (PHYSical) of the ELectrons", - characteristics=["[[ENERGY]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="tphysel", + varset="gstate", + vartype="real", + topics=["BandOcc_useful"], + dimensions="scalar", + defaultval=0.0, + mnemonics="Temperature (PHYSical) of the ELectrons", + characteristics=["[[ENERGY]]"], + added_in_version="before_v9", + text=r""" Gives, in Hartree, the physical temperature of the system, in case [[occopt]] = 4, 5, 6, or 7. Can be specified in Ha (the default), Ry, eV or Kelvin, since [[tphysel]] has the @@ -20792,18 +22281,19 @@ define the entropy contribution to the free energy. Note that [[tphysel]] might be used as parameter for Free Energy exchange-correlation functionals (see [[ixc]]). """, - ), - Variable( - abivarname="tsmear", - varset="gstate", - vartype="real", - topics=["BandOcc_basic", "STM_basic"], - dimensions="scalar", - defaultval=0.01, - mnemonics="Temperature of SMEARing", - characteristics=["[[ENERGY]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="tsmear", + varset="gstate", + vartype="real", + topics=["BandOcc_basic", "STM_basic"], + dimensions="scalar", + defaultval=0.01, + mnemonics="Temperature of SMEARing", + characteristics=["[[ENERGY]]"], + added_in_version="before_v9", + text=r""" Gives the broadening of occupation numbers [[occ]], in the metallic cases ([[occopt]] = 3, 4, 5, 6 and 7). Can be specified in Ha (the default), eV, Ry, or Kelvin, since [[tsmear]] has the [[ENERGY]] characteristics (0.001 Ha = @@ -20820,17 +22310,18 @@ convergence parameter. It is still possible to define a physical temperature, thanks to the input variable [[tphysel]] (See also [[cite:Verstraete2002]]). """, - ), - Variable( - abivarname="typat", - varset="basic", - vartype="integer", - topics=["crystal_basic", "AtomTypes_basic"], - dimensions=ValueWithConditions({"[[natrd]]<[[natom]]": [3, "[[natrd]]"], "defaultval": [3, "[[natom]]"]}), - defaultval=ValueWithConditions({"[[natom]] == 1": 1, "defaultval": None}), - mnemonics="TYPe of AToms", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="typat", + varset="basic", + vartype="integer", + topics=["crystal_basic", "AtomTypes_basic"], + dimensions=ValueWithConditions({"[[natrd]]<[[natom]]": [3, "[[natrd]]"], "defaultval": [3, "[[natom]]"]}), + defaultval=ValueWithConditions({"[[natom]] == 1": 1, "defaultval": None}), + mnemonics="TYPe of AToms", + added_in_version="before_v9", + text=r""" Array giving an integer label to every atom in the unit cell to denote its type. The different types of atoms are constructed from the pseudopotential files. @@ -20855,18 +22346,19 @@ the atoms of same type together. This should be transparent to the user, while keeping efficiency. """, - ), - Variable( - abivarname="ucrpa", - varset="gw", - vartype="integer", - topics=["CalcUJ_compulsory"], - dimensions="scalar", - defaultval=0, - mnemonics="calculation of the screened interaction U with the Constrained RPA method", - requires="[[nspinor]] == 1", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="ucrpa", + varset="gw", + vartype="integer", + topics=["CalcUJ_compulsory"], + dimensions="scalar", + defaultval=0, + mnemonics="calculation of the screened interaction U with the Constrained RPA method", + requires="[[nspinor]] == 1", + added_in_version="before_v9", + text=r""" When equal to one or two, this variable allows one to calculate U with the cRPA method. The present implementation is parallelized (as for usual GW @@ -20891,32 +22383,34 @@ A short presentation of the method and some aspect of the implementation can be found in Sec. II and Appendix A of [[cite:Amadon2014]]. """, - ), - Variable( - abivarname="ucrpa_bands", - varset="gw", - vartype="integer", - topics=["CalcUJ_basic"], - dimensions=[2], - defaultval=[-1, -1], - mnemonics="For the calculation of U with the Constrained RPA method, gives correlated BANDS", - commentdefault="That is, the default includes no band.", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="ucrpa_bands", + varset="gw", + vartype="integer", + topics=["CalcUJ_basic"], + dimensions=[2], + defaultval=[-1, -1], + mnemonics="For the calculation of U with the Constrained RPA method, gives correlated BANDS", + commentdefault="That is, the default includes no band.", + added_in_version="before_v9", + text=r""" Gives the first and last correlated bands for the cRPA calculation of the polarisability. """, - ), - Variable( - abivarname="ucrpa_window", - varset="gw", - vartype="real", - topics=["CalcUJ_basic"], - dimensions=[2], - defaultval=[-1, -1], - mnemonics="For the calculation of U with the Constrained RPA method, gives energy WINDOW", - commentdefault="That is, the energy window is empty by default.", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="ucrpa_window", + varset="gw", + vartype="real", + topics=["CalcUJ_basic"], + dimensions=[2], + defaultval=[-1, -1], + mnemonics="For the calculation of U with the Constrained RPA method, gives energy WINDOW", + commentdefault="That is, the energy window is empty by default.", + added_in_version="before_v9", + text=r""" Specify a window of energy for the cRPA calculation of the polarisability. The transition inside this window will not be taken into account in the constrained polarisabilty calculations. @@ -20924,17 +22418,18 @@ The lower bound and the upper bound energies must be specified (two real numbers) with respect to the position of the Fermi level. """, - ), - Variable( - abivarname="udtset", - varset="basic", - vartype="integer", - topics=["multidtset_basic"], - dimensions=[2], - mnemonics="Upper limit on DaTa SETs", - commentdefault="It is not used when it is not defined", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="udtset", + varset="basic", + vartype="integer", + topics=["multidtset_basic"], + dimensions=[2], + mnemonics="Upper limit on DaTa SETs", + commentdefault="It is not used when it is not defined", + added_in_version="before_v9", + text=r""" Used to define the set of indices in the multi-data set mode, when a double loop is needed (see later). The values of [[udtset]](1) must be between 1 and 999, the values of @@ -20956,19 +22451,20 @@ between 1 and [[udtset]](2). If [[udtset]] is used, the input variable [[jdtset]] cannot be used. """, - ), - Variable( - abivarname="upawu", - varset="paw", - vartype="real", - topics=["DFT+U_compulsory", "DMFT_compulsory", "DmftTriqsCthyb_compulsory"], - dimensions=["[[ntypat]]"], - defaultval=MultipleValue(number=None, value=0), - mnemonics="value of U for PAW+U", - characteristics=["[[ENERGY]]"], - requires="[[usepaw]] == 1 and [[usepawu]] > 0", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="upawu", + varset="paw", + vartype="real", + topics=["DFT+U_compulsory", "DMFT_compulsory", "DmftTriqsCthyb_compulsory"], + dimensions=["[[ntypat]]"], + defaultval=MultipleValue(number=None, value=0), + mnemonics="value of U for PAW+U", + characteristics=["[[ENERGY]]"], + requires="[[usepaw]] == 1 and [[usepawu]] > 0", + added_in_version="before_v9", + text=r""" Gives the value of the screened coulomb interaction between correlated electrons corresponding to [[lpawu]] for each species. In the case where [[lpawu]] =-1, the value is not used. @@ -21000,19 +22496,20 @@ optdriver4 4 upawu4 5.5 eV ! This is for the screening calculation """, - ), - Variable( - abivarname="use_gemm_nonlop", - varset="dev", - vartype="integer", - topics=["parallelism_expert"], - dimensions="scalar", - defaultval=0, - mnemonics="USE the GEMM routine for the application of the NON-Local OPerator", - characteristics=["[[DEVELOP]]"], - commentdefault="because it is not usually worth using it unless bandpp is large and it requires additional memory", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="use_gemm_nonlop", + varset="dev", + vartype="integer", + topics=["parallelism_expert"], + dimensions="scalar", + defaultval=0, + mnemonics="USE the GEMM routine for the application of the NON-Local OPerator", + characteristics=["[[DEVELOP]]"], + commentdefault="because it is not usually worth using it unless bandpp is large and it requires additional memory", + added_in_version="before_v9", + text=r""" This keyword tells abinit to use a BLAS3 routine to speed up the computation of the non-local operator. This requires the pre-computation of a large matrix, and has a significant memory overhead. In exchange, it provides improved @@ -21030,19 +22527,20 @@ if [[use_gemm_nonlop]] is set to 1 in the input file (actually, this is only needed when NC pseudos are used as PAW already uses 1 for [[useylm]]). """, - ), - Variable( - abivarname="use_nonscf_gkk", - varset="dev", - vartype="integer", - topics=["ElPhonInt_useful"], - dimensions="scalar", - defaultval=0, - mnemonics="USE NON-SCF calculation of GKK matrix elements (electron phonon)", - characteristics=["[[DEVELOP]]"], - commentdefault="Default is 0 for the moment. Do not use non-scf method.", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="use_nonscf_gkk", + varset="dev", + vartype="integer", + topics=["ElPhonInt_useful"], + dimensions="scalar", + defaultval=0, + mnemonics="USE NON-SCF calculation of GKK matrix elements (electron phonon)", + characteristics=["[[DEVELOP]]"], + commentdefault="Default is 0 for the moment. Do not use non-scf method.", + added_in_version="before_v9", + text=r""" When this flag is activated during a phonon calculation with abinit, all of the perturbations are cycled through, but only the symmetry-irreducible ones are calculated self-consistently. For the others the perturbed density is @@ -21062,32 +22560,34 @@ 1 with non-symmorphic symmetries - please check (at least) that lifetimes for phonons go to 0 for acoustic modes at Gamma. """, - ), - Variable( - abivarname="use_slk", - varset="paral", - vartype="integer", - topics=["parallelism_expert"], - dimensions="scalar", - defaultval=0, - mnemonics="USE ScaLapacK", - characteristics=["[[DEVELOP]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="use_slk", + varset="paral", + vartype="integer", + topics=["parallelism_expert"], + dimensions="scalar", + defaultval=0, + mnemonics="USE ScaLapacK", + characteristics=["[[DEVELOP]]"], + added_in_version="before_v9", + text=r""" If set to 1, enable the use of ScaLapack within LOBPCG. """, - ), - Variable( - abivarname="usedmatpu", - varset="paw", - vartype="integer", - topics=["DFT+U_useful"], - dimensions="scalar", - defaultval=0, - mnemonics="USE of an initial Density MATrix in Paw+U", - requires="[[usepaw]] == 1 and [[usepawu]] == 1", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="usedmatpu", + varset="paw", + vartype="integer", + topics=["DFT+U_useful"], + dimensions="scalar", + defaultval=0, + mnemonics="USE of an initial Density MATrix in Paw+U", + requires="[[usepaw]] == 1 and [[usepawu]] == 1", + added_in_version="before_v9", + text=r""" When [[usedmatpu]]/=0, an initial density matrix (given by [[dmatpawu]] keyword) is used and kept fixed during the first ABS([[usedmatpu]]) SCF steps. This starting value of the density matrix can be useful to find the correct @@ -21103,17 +22603,18 @@ - When [[usedmatpu]]>0, the density matrix is kept constant only at first ionic step - When [[usedmatpu]]<0, the density matrix is kept constant at each ionic step """, - ), - Variable( - abivarname="usedmft", - varset="dmft", - vartype="integer", - topics=["DMFT_compulsory", "DmftTriqsCthyb_compulsory"], - dimensions="scalar", - defaultval=0, - mnemonics="USE Dynamical Mean Field Theory", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="usedmft", + varset="dmft", + vartype="integer", + topics=["DMFT_compulsory", "DmftTriqsCthyb_compulsory"], + dimensions="scalar", + defaultval=0, + mnemonics="USE Dynamical Mean Field Theory", + added_in_version="before_v9", + text=r""" If set to 1, enable the use of DFT+DMFT, see in particular the important variables [[dmft_solv]], [[dmftbandi]], [[dmftbandf]], [[dmft_nwli]], [[dmft_nwlo]], [[dmft_tollc]], [[dmft_tolfreq]], and [[dmft_iter]]. @@ -21172,94 +22673,92 @@ calculation. They can be used by an external code or used to compute the screened interaction (see variable [[ucrpa]]). """, - ), - Variable( - abivarname="useexexch", - varset="paw", - vartype="integer", - topics=["xc_useful"], - dimensions="scalar", - defaultval=0, - mnemonics="USE of EXact EXCHange", - requires="[[usepaw]] == 1", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="useexexch", + varset="paw", + vartype="integer", + topics=["xc_useful"], + dimensions="scalar", + defaultval=0, + mnemonics="USE of EXact EXCHange", + requires="[[usepaw]] == 1", + added_in_version="before_v9", + text=r""" When [[useexexch]] = 1, the hybrid functional PBE0 is used in PAW, inside PAW spheres only, and only for correlated orbitals given by [[lexexch]]. To change the ratio of exact exchange, see also [[exchmix]]. """, - ), - Variable( - abivarname="usefock", - varset="internal", - vartype="integer", - topics=["Hybrids_internal"], - dimensions="scalar", - defaultval=0, - mnemonics="USE FOCK exact exchange", - characteristics=["[[INTERNAL_ONLY]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="usefock", + varset="internal", + vartype="integer", + topics=["Hybrids_internal"], + dimensions="scalar", + defaultval=0, + mnemonics="USE FOCK exact exchange", + characteristics=["[[INTERNAL_ONLY]]"], + added_in_version="before_v9", + text=r""" This internal variable is automatically set to 1 when the value of [[ixc]] refers to an Hartree-Fock calculation or hybrid functionals. * 0 --> No use of exact exchange. * 1 --> exact exchange is required for the calculation. """, - ), - Variable( - abivarname="usekden", - varset="gstate", - vartype="integer", - topics=["xc_expert"], - dimensions="scalar", - defaultval=0, - mnemonics="USE Kinetic energy DENsity", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="usekden", + varset="gstate", + vartype="integer", + topics=["xc_expert"], + dimensions="scalar", + defaultval=0, + mnemonics="USE Kinetic energy DENsity", + added_in_version="before_v9", + text=r""" If [[usekden]] = 1 the kinetic energy density will be computed during the self-consistent loop, in a way similar to the computation of the density. This is needed if a meta-GGA is to be used as XC functional. By default ([[usekden]] = 0), the kinetic energy density is not computed during the self- consistent loop. [[usekden]] = 1 is not yet allowed with [[nspden]]=4 (non-collinear magnetism). """, - ), - Variable( - abivarname="usepaw", - varset="internal", - vartype="integer", - topics=["PAW_internal"], - dimensions="scalar", - defaultval="[[AUTO_FROM_PSP]]", - mnemonics="USE Projector Augmented Waves method", - characteristics=["[[INTERNAL_ONLY]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="usepaw", + varset="internal", + vartype="integer", + topics=["PAW_internal"], + dimensions="scalar", + defaultval="[[AUTO_FROM_PSP]]", + mnemonics="USE Projector Augmented Waves method", + characteristics=["[[INTERNAL_ONLY]]"], + added_in_version="before_v9", + text=r""" This variable is determined by the pseudopotentials files. PAW calculations (see [[tutorial:paw1]]) can only be performed with PAW atomic data input files, while pseudopotential calculations are performed in ABINIT with norm-conserving pseudopotential input files. Most functionalities in ABINIT are available with either type of calculation. """, - ), - Variable( - abivarname="usepawu", - varset="paw", - vartype="integer", - topics=[ - "DFT+U_compulsory", - "PAW_useful", - "GW_useful", - "SelfEnergy_useful", - "DMFT_compulsory", - "DmftTriqsCthyb_compulsory", - ], - dimensions="scalar", - defaultval=0, - mnemonics="USE PAW+U (spherical part)", - requires="[[usepaw]] == 1", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="usepawu", + varset="paw", + vartype="integer", + topics=["DFT+U_compulsory", "PAW_useful", "GW_useful", "SelfEnergy_useful", "DMFT_compulsory", "DmftTriqsCthyb_compulsory"], + dimensions="scalar", + defaultval=0, + mnemonics="USE PAW+U (spherical part)", + requires="[[usepaw]] == 1", + added_in_version="before_v9", + text=r""" Must be non-zero if a DFT+U calculation is done, or if a GW calculation following a DFT+U calculation is done (important!), or if a DFT+DMFT calculation is done. @@ -21311,18 +22810,19 @@ Suggested acknowledgment [[cite:Amadon2008a]]. """, - ), - Variable( - abivarname="usepead", - varset="dfpt", - vartype="integer", - topics=["nonlinear_basic"], - dimensions="scalar", - defaultval=1, - mnemonics="USE of PEAD formalism", - requires="[[optdriver]] == 5 (non-linear response computations)", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="usepead", + varset="dfpt", + vartype="integer", + topics=["nonlinear_basic"], + dimensions="scalar", + defaultval=1, + mnemonics="USE of PEAD formalism", + requires="[[optdriver]] == 5 (non-linear response computations)", + added_in_version="before_v9", + text=r""" Determine which non-linear implementation is used. If [[usepead]]=1, the Perturbation Expansion After Discretization formalism is used, as in [[cite:Veithen2005]]. In that method, the electric field is treated numerically, i.e the k-space @@ -21336,17 +22836,18 @@ This is not the most time-consumming part though. Look at the inputs of related tests in the testsuite to see examples of the workflow. """, - ), - Variable( - abivarname="usepotzero", - varset="dev", - vartype="integer", - topics=["Coulomb_useful", "Verification_useful"], - dimensions="scalar", - defaultval=0, - mnemonics="USE POTential ZERO", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="usepotzero", + varset="dev", + vartype="integer", + topics=["Coulomb_useful","Verification_useful"], + dimensions="scalar", + defaultval=0, + mnemonics="USE POTential ZERO", + added_in_version="before_v9", + text=r""" Fix the convention for the choice of the average value of the Hartree potential, as described in [[cite:Bruneval2014]]. * [[usepotzero]] = 0, the usual convention: the smooth potential is set to zero average value. @@ -21356,182 +22857,194 @@ * [[usepotzero]] = 2, the QE/PWscf convention: the potential of equivalent point charges is set to zero average value (convention also valid for NC pseudopotentials). """, - ), - Variable( - abivarname="userec", - varset="internal", - vartype="integer", - topics=["Recursion_internal"], - dimensions="scalar", - defaultval=0, - mnemonics="USE RECursion", - characteristics=["[[INTERNAL_ONLY]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="userec", + varset="internal", + vartype="integer", + topics=["Recursion_internal"], + dimensions="scalar", + defaultval=0, + mnemonics="USE RECursion", + characteristics=["[[INTERNAL_ONLY]]"], + added_in_version="before_v9", + text=r""" This internal variable is set to 1 when the recursion method is activated (see [[tfkinfunc]]). """, - ), - Variable( - abivarname="useria", - varset="dev", - vartype="integer", - topics=["Dev_expert"], - dimensions="scalar", - defaultval=0, - mnemonics="USER Integer variable A", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="useria", + varset="dev", + vartype="integer", + topics=["Dev_expert"], + dimensions="scalar", + defaultval=0, + mnemonics="USER Integer variable A", + added_in_version="before_v9", + text=r""" These are user-definable integers which the user may input and then utilize in subroutines of his/her own design. They are not used in the official versions of the ABINIT code, and should ease independent developments (hopefully integrated in the official version afterwards). Internally, they are available in the dtset structured datatype, e.g. `dtset%useria`. """, - ), - Variable( - abivarname="userib", - varset="dev", - vartype="integer", - topics=["Dev_expert"], - dimensions="scalar", - defaultval=0, - mnemonics="USER Integer variable B", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="userib", + varset="dev", + vartype="integer", + topics=["Dev_expert"], + dimensions="scalar", + defaultval=0, + mnemonics="USER Integer variable B", + added_in_version="before_v9", + text=r""" These are user-definable integers which the user may input and then utilize in subroutines of his/her own design. They are not used in the official versions of the ABINIT code, and should ease independent developments (hopefully integrated in the official version afterwards). Internally, they are available in the dtset structured datatype, e.g. `dtset%useria`. """, - ), - Variable( - abivarname="useric", - varset="dev", - vartype="integer", - topics=["Dev_expert"], - dimensions="scalar", - defaultval=0, - mnemonics="USER Integer variable C", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="useric", + varset="dev", + vartype="integer", + topics=["Dev_expert"], + dimensions="scalar", + defaultval=0, + mnemonics="USER Integer variable C", + added_in_version="before_v9", + text=r""" These are user-definable integers which the user may input and then utilize in subroutines of his/her own design. They are not used in the official versions of the ABINIT code, and should ease independent developments (hopefully integrated in the official version afterwards). Internally, they are available in the dtset structured datatype, e.g. `dtset%useria`. """, - ), - Variable( - abivarname="userid", - varset="dev", - vartype="integer", - topics=["Dev_expert"], - dimensions="scalar", - defaultval=0, - mnemonics="USER Integer variable D", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="userid", + varset="dev", + vartype="integer", + topics=["Dev_expert"], + dimensions="scalar", + defaultval=0, + mnemonics="USER Integer variable D", + added_in_version="before_v9", + text=r""" These are user-definable integers which the user may input and then utilize in subroutines of his/her own design. They are not used in the official versions of the ABINIT code, and should ease independent developments (hopefully integrated in the official version afterwards). Internally, they are available in the dtset structured datatype, e.g. `dtset%useria`. """, - ), - Variable( - abivarname="userie", - varset="dev", - vartype="integer", - topics=["Dev_expert"], - dimensions="scalar", - defaultval=0, - mnemonics="USER Integer variable E", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="userie", + varset="dev", + vartype="integer", + topics=["Dev_expert"], + dimensions="scalar", + defaultval=0, + mnemonics="USER Integer variable E", + added_in_version="before_v9", + text=r""" These are user-definable integers which the user may input and then utilize in subroutines of his/her own design. They are not used in the official versions of the ABINIT code, and should ease independent developments (hopefully integrated in the official version afterwards). Internally, they are available in the dtset structured datatype, e.g. `dtset%useria`. """, - ), - Variable( - abivarname="userra", - varset="dev", - vartype="real", - topics=["Dev_expert"], - dimensions="scalar", - defaultval=0.0, - mnemonics="USER Real variable A", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="userra", + varset="dev", + vartype="real", + topics=["Dev_expert"], + dimensions="scalar", + defaultval=0.0, + mnemonics="USER Real variable A", + added_in_version="before_v9", + text=r""" These are user-definable with the same purpose as [[useria]] and cie. """, - ), - Variable( - abivarname="userrb", - varset="dev", - vartype="real", - topics=["Dev_expert"], - dimensions="scalar", - defaultval=0.0, - mnemonics="USER Real variable B", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="userrb", + varset="dev", + vartype="real", + topics=["Dev_expert"], + dimensions="scalar", + defaultval=0.0, + mnemonics="USER Real variable B", + added_in_version="before_v9", + text=r""" These are user-definable with the same purpose as [[useria]] and cie. """, - ), - Variable( - abivarname="userrc", - varset="dev", - vartype="real", - topics=["Dev_expert"], - dimensions="scalar", - defaultval=0.0, - mnemonics="USER Real variable C", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="userrc", + varset="dev", + vartype="real", + topics=["Dev_expert"], + dimensions="scalar", + defaultval=0.0, + mnemonics="USER Real variable C", + added_in_version="before_v9", + text=r""" These are user-definable with the same purpose as [[useria]] and cie. """, - ), - Variable( - abivarname="userrd", - varset="dev", - vartype="real", - topics=["Dev_expert"], - dimensions="scalar", - defaultval=0.0, - mnemonics="USER Real variable D", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="userrd", + varset="dev", + vartype="real", + topics=["Dev_expert"], + dimensions="scalar", + defaultval=0.0, + mnemonics="USER Real variable D", + added_in_version="before_v9", + text=r""" These are user-definable with the same purpose as [[useria]] and cie. """, - ), - Variable( - abivarname="userre", - varset="dev", - vartype="real", - topics=["Dev_expert"], - dimensions="scalar", - defaultval=0.0, - mnemonics="USER Real variable E", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="userre", + varset="dev", + vartype="real", + topics=["Dev_expert"], + dimensions="scalar", + defaultval=0.0, + mnemonics="USER Real variable E", + added_in_version="before_v9", + text=r""" These are user-definable with the same purpose as [[useria]] and cie. """, - ), - Variable( - abivarname="usewvl", - varset="basic", - vartype="integer", - topics=["Wavelets_compulsory"], - dimensions="scalar", - defaultval=0, - mnemonics="Use WaVeLet basis set", - commentdefault="use plane-wave basis set", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="usewvl", + varset="basic", + vartype="integer", + topics=["Wavelets_compulsory"], + dimensions="scalar", + defaultval=0, + mnemonics="Use WaVeLet basis set", + commentdefault="use plane-wave basis set", + added_in_version="before_v9", + text=r""" Used to define if the calculation is done on a wavelet basis set or not. The values of [[usewvl]] must be 0 or 1. Putting [[usewvl]] to 1, makes [[icoulomb]] mandatory to 1. The number of band ([[nband]]) must be set @@ -21543,18 +23056,19 @@ The spin computation is not currently possible with wavelets and metallic systems may be slow to converge. """, - ), - Variable( - abivarname="usexcnhat", - varset="paw", - vartype="integer", - topics=["PAW_useful"], - dimensions="scalar", - defaultval=-1, - mnemonics="USE eXchange-Correlation with NHAT (compensation charge density)", - requires="[[usepaw]] == 1", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="usexcnhat", + varset="paw", + vartype="integer", + topics=["PAW_useful"], + dimensions="scalar", + defaultval=-1, + mnemonics="USE eXchange-Correlation with NHAT (compensation charge density)", + requires="[[usepaw]] == 1", + added_in_version="before_v9", + text=r""" This flag determines how the exchange-correlation terms are computed for the pseudo-density. @@ -21582,20 +23096,19 @@ Still, the ABINIT user has both options. """, - ), - Variable( - abivarname="useylm", - varset="dev", - vartype="integer", - topics=["TuningSpeedMem_expert"], - dimensions="scalar", - defaultval=ValueWithConditions( - {"[[usepaw]] == 1": 1, "[[gpu_option]] > 0": 1, "[[tfkinfunc]] == 1": 1, "defaultval": 0} - ), - mnemonics="USE YLM (the spherical harmonics)", - characteristics=["[[DEVELOP]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="useylm", + varset="dev", + vartype="integer", + topics=["TuningSpeedMem_expert"], + dimensions="scalar", + defaultval=ValueWithConditions({"[[usepaw]] == 1": 1, "[[gpu_option]] > 0": 1, "[[tfkinfunc]] == 1": 1, "defaultval": 0}), + mnemonics="USE YLM (the spherical harmonics)", + characteristics=["[[DEVELOP]]"], + added_in_version="before_v9", + text=r""" When this flag is activated, the non-local operator is applied using an algorithm based on spherical harmonics. Non-local projectors are used with their usual form: @@ -21604,47 +23117,50 @@ When [[useylm]] = 0, the sum over $Y_{lm}$ can be reduced to a Legendre polynomial form. """, - ), - Variable( - abivarname="vaclst", - varset="geo", - vartype="integer", - topics=["AtomManipulator_useful"], - dimensions=["[[vacnum]]"], - mnemonics="VACancies LiST", - characteristics=["[[INPUT_ONLY]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="vaclst", + varset="geo", + vartype="integer", + topics=["AtomManipulator_useful"], + dimensions=["[[vacnum]]"], + mnemonics="VACancies LiST", + characteristics=["[[INPUT_ONLY]]"], + added_in_version="before_v9", + text=r""" Gives the identification number(s) of atoms to be subtracted from the set of atoms that are obtained after having rotated, translated and repeated the objects. Useful to created vacancies. """, - ), - Variable( - abivarname="vacnum", - varset="geo", - vartype="integer", - topics=["AtomManipulator_useful"], - dimensions="scalar", - defaultval=0, - mnemonics="VACancies NUMber", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="vacnum", + varset="geo", + vartype="integer", + topics=["AtomManipulator_useful"], + dimensions="scalar", + defaultval=0, + mnemonics="VACancies NUMber", + added_in_version="before_v9", + text=r""" Gives the number of atoms to be subtracted from the list of atoms after the rotations, translations and repetitions have been done. The list of these atoms is contained in [[vaclst]]. """, - ), - Variable( - abivarname="vacuum", - varset="gstate", - vartype="integer", - topics=["k-points_expert"], - dimensions=[3], - mnemonics="VACUUM identification", - characteristics=["[[INPUT_ONLY]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="vacuum", + varset="gstate", + vartype="integer", + topics=["k-points_expert"], + dimensions=[3], + mnemonics="VACUUM identification", + characteristics=["[[INPUT_ONLY]]"], + added_in_version="before_v9", + text=r""" Establishes the presence (if [[vacuum]] = 1) or absence (if [[vacuum]] = 0) of a vacuum layer, along the three possible directions normal to the primitive axes. @@ -21659,18 +23175,19 @@ determine automatically whether the distance between atoms is sufficient to have the presence or absence of vacuum. """, - ), - Variable( - abivarname="vacwidth", - varset="gstate", - vartype="real", - topics=["k-points_expert"], - dimensions="scalar", - defaultval=10.0, - mnemonics="VACuum WIDTH", - characteristics=["[[INPUT_ONLY]]", "[[LENGTH]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="vacwidth", + varset="gstate", + vartype="real", + topics=["k-points_expert"], + dimensions="scalar", + defaultval=10.0, + mnemonics="VACuum WIDTH", + characteristics=["[[INPUT_ONLY]]", "[[LENGTH]]"], + added_in_version="before_v9", + text=r""" Give a minimum "projected" distance between atoms to be found in order to declare that there is some [[vacuum]] present for each of the three directions. By default, given in Bohr atomic units (1 Bohr=0.5291772108 @@ -21679,18 +23196,19 @@ The precise requirement is that a slab of width [[vacwidth]], delimited by two planes of constant reduced coordinates in the investigated direction, must be empty of atoms. """, - ), - Variable( - abivarname="vcutgeo", - varset="gstate", - vartype="real", - topics=["Coulomb_useful", "GWls_compulsory", "Susceptibility_basic", "SelfEnergy_basic"], - dimensions=[3], - defaultval=MultipleValue(number=3, value=0.0), - mnemonics="V (potential) CUT-off GEOmetry", - requires="[[icutcoul]] in [1,2]", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="vcutgeo", + varset="gstate", + vartype="real", + topics=["Coulomb_useful","GWls_compulsory", "Susceptibility_basic", "SelfEnergy_basic"], + dimensions=[3], + defaultval=MultipleValue(number=3, value=0.0), + mnemonics="V (potential) CUT-off GEOmetry", + requires="[[icutcoul]] in [1,2]", + added_in_version="before_v9", + text=r""" [[vcutgeo]] is used in conjunction with [[icutcoul]], [[fock_icutcoul]] and/or [[gw_icutcoul]] to specify the geometry used to truncate the Coulomb interaction, as well as the particular approach to be used. It has a meaning either for a periodic one-dimensional system, typically @@ -21764,324 +23282,345 @@ the k point vector component(s) along non-periodic direction(s) must vanish. So, if the 2D Ismail-Beigi technique is used, the z-component of the k points must vanish. """, - ), - Variable( - abivarname="vdw_df_acutmin", - varset="vdw", - vartype="real", - topics=["vdw_expert"], - dimensions="scalar", - defaultval=10, - mnemonics="vdW-DF MINimum Angular CUT-off", - characteristics=["[[DEVELOP]]"], - requires="[[vdw_xc]]>0", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="vdw_df_acutmin", + varset="vdw", + vartype="real", + topics=["vdw_expert"], + dimensions="scalar", + defaultval=10, + mnemonics="vdW-DF MINimum Angular CUT-off", + characteristics=["[[DEVELOP]]"], + requires="[[vdw_xc]]>0", + added_in_version="before_v9", + text=r""" Used when [[vdw_xc]]>0, to build angular meshes for the vdW-DF kernel. """, - ), - Variable( - abivarname="vdw_df_aratio", - varset="vdw", - vartype="real", - topics=["vdw_expert"], - dimensions="scalar", - defaultval=30, - mnemonics="""vdW-DF Angle RATIO between the highest and lowest angles.""", - characteristics=["[[DEVELOP]]"], - requires="[[vdw_xc]]>0", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="vdw_df_aratio", + varset="vdw", + vartype="real", + topics=["vdw_expert"], + dimensions="scalar", + defaultval=30, + mnemonics="""vdW-DF Angle RATIO between the highest and lowest angles.""", + characteristics=["[[DEVELOP]]"], + requires="[[vdw_xc]]>0", + added_in_version="before_v9", + text=r""" Used when [[vdw_xc]]>0, to build angular meshes for the vdW-DF kernel. """, - ), - Variable( - abivarname="vdw_df_damax", - varset="vdw", - vartype="real", - topics=["vdw_expert"], - dimensions="scalar", - defaultval=0.5, - mnemonics="vdW-DF Delta for Angles, MAXimum", - characteristics=["[[DEVELOP]]"], - requires="[[vdw_xc]]>0", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="vdw_df_damax", + varset="vdw", + vartype="real", + topics=["vdw_expert"], + dimensions="scalar", + defaultval=0.5, + mnemonics="vdW-DF Delta for Angles, MAXimum", + characteristics=["[[DEVELOP]]"], + requires="[[vdw_xc]]>0", + added_in_version="before_v9", + text=r""" Used when [[vdw_xc]]>0, to build angular meshes for the vdW-DF kernel. """, - ), - Variable( - abivarname="vdw_df_damin", - varset="vdw", - vartype="real", - topics=["vdw_expert"], - dimensions="scalar", - defaultval=0.01, - mnemonics="vdW-DF Delta for Angles, MINimum", - characteristics=["[[DEVELOP]]"], - requires="[[vdw_xc]]>0", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="vdw_df_damin", + varset="vdw", + vartype="real", + topics=["vdw_expert"], + dimensions="scalar", + defaultval=0.01, + mnemonics="vdW-DF Delta for Angles, MINimum", + characteristics=["[[DEVELOP]]"], + requires="[[vdw_xc]]>0", + added_in_version="before_v9", + text=r""" Used when [[vdw_xc]]>0, to build angular meshes for the vdW-DF kernel. """, - ), - Variable( - abivarname="vdw_df_dcut", - varset="vdw", - vartype="real", - topics=["vdw_expert"], - dimensions="scalar", - defaultval=30, - mnemonics="vdW-DF D-mesh CUT-off", - characteristics=["[[DEVELOP]]"], - requires="[[vdw_xc]]>0", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="vdw_df_dcut", + varset="vdw", + vartype="real", + topics=["vdw_expert"], + dimensions="scalar", + defaultval=30, + mnemonics="vdW-DF D-mesh CUT-off", + characteristics=["[[DEVELOP]]"], + requires="[[vdw_xc]]>0", + added_in_version="before_v9", + text=r""" Used when [[vdw_xc]]>0, to build the vdW-DF kernel. """, - ), - Variable( - abivarname="vdw_df_dratio", - varset="vdw", - vartype="real", - topics=["vdw_expert"], - dimensions="scalar", - defaultval=20, - mnemonics="""vdW-DF, between the highest and +), + +Variable( + abivarname="vdw_df_dratio", + varset="vdw", + vartype="real", + topics=["vdw_expert"], + dimensions="scalar", + defaultval=20, + mnemonics="""vdW-DF, between the highest and lowest D, RATIO.""", - characteristics=["[[DEVELOP]]"], - requires="[[vdw_xc]]>0", - added_in_version="before_v9", - text=r""" + characteristics=["[[DEVELOP]]"], + requires="[[vdw_xc]]>0", + added_in_version="before_v9", + text=r""" Used when [[vdw_xc]]>0, to build the vdW-DF kernel. """, - ), - Variable( - abivarname="vdw_df_dsoft", - varset="vdw", - vartype="real", - topics=["vdw_expert"], - dimensions="scalar", - defaultval=1.0, - mnemonics="vdW-DF Distance for SOFTening.", - characteristics=["[[DEVELOP]]"], - requires="[[vdw_xc]]>0", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="vdw_df_dsoft", + varset="vdw", + vartype="real", + topics=["vdw_expert"], + dimensions="scalar", + defaultval=1.0, + mnemonics="vdW-DF Distance for SOFTening.", + characteristics=["[[DEVELOP]]"], + requires="[[vdw_xc]]>0", + added_in_version="before_v9", + text=r""" Used when [[vdw_xc]]>0, to build the vdW-DF kernel. """, - ), - Variable( - abivarname="vdw_df_gcut", - varset="vdw", - vartype="real", - topics=["vdw_expert"], - dimensions="scalar", - defaultval=5, - mnemonics="vdW-DF G-space CUT-off", - characteristics=["[[DEVELOP]]"], - requires="[[vdw_xc]]>0", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="vdw_df_gcut", + varset="vdw", + vartype="real", + topics=["vdw_expert"], + dimensions="scalar", + defaultval=5, + mnemonics="vdW-DF G-space CUT-off", + characteristics=["[[DEVELOP]]"], + requires="[[vdw_xc]]>0", + added_in_version="before_v9", + text=r""" Used when [[vdw_xc]]>0, to filter the vdW-DF kernel in reciprocal space. """, - ), - Variable( - abivarname="vdw_df_ndpts", - varset="vdw", - vartype="integer", - topics=["vdw_expert"], - dimensions="scalar", - defaultval=20, - mnemonics="vdW-DF Number of D-mesh PoinTS", - characteristics=["[[DEVELOP]]"], - requires="[[vdw_xc]]>0", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="vdw_df_ndpts", + varset="vdw", + vartype="integer", + topics=["vdw_expert"], + dimensions="scalar", + defaultval=20, + mnemonics="vdW-DF Number of D-mesh PoinTS", + characteristics=["[[DEVELOP]]"], + requires="[[vdw_xc]]>0", + added_in_version="before_v9", + text=r""" Used when [[vdw_xc]]>0, to build the vdW-DF kernel. """, - ), - Variable( - abivarname="vdw_df_ngpts", - varset="vdw", - vartype="integer", - topics=["vdw_expert"], - dimensions="scalar", - defaultval=-1, - mnemonics="vdW-DF Number of G-mesh PoinTS", - characteristics=["[[DEVELOP]]"], - requires="[[vdw_xc]]>0", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="vdw_df_ngpts", + varset="vdw", + vartype="integer", + topics=["vdw_expert"], + dimensions="scalar", + defaultval=-1, + mnemonics="vdW-DF Number of G-mesh PoinTS", + characteristics=["[[DEVELOP]]"], + requires="[[vdw_xc]]>0", + added_in_version="before_v9", + text=r""" Used when [[vdw_xc]]>0, to build the vdW-DF kernel. """, - ), - Variable( - abivarname="vdw_df_nqpts", - varset="vdw", - vartype="integer", - topics=["vdw_expert"], - dimensions="scalar", - defaultval=30, - mnemonics="vdW-DF Number of Q-mesh PoinTS", - characteristics=["[[DEVELOP]]"], - requires="[[vdw_xc]]>0", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="vdw_df_nqpts", + varset="vdw", + vartype="integer", + topics=["vdw_expert"], + dimensions="scalar", + defaultval=30, + mnemonics="vdW-DF Number of Q-mesh PoinTS", + characteristics=["[[DEVELOP]]"], + requires="[[vdw_xc]]>0", + added_in_version="before_v9", + text=r""" Used when [[vdw_xc]]>0, to build the vdW-DF kernel. """, - ), - Variable( - abivarname="vdw_df_nrpts", - varset="vdw", - vartype="integer", - topics=["vdw_expert"], - dimensions="scalar", - defaultval=2048, - mnemonics="vdW-DF Number of R-PoinTS", - characteristics=["[[DEVELOP]]"], - requires="[[vdw_xc]]>0", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="vdw_df_nrpts", + varset="vdw", + vartype="integer", + topics=["vdw_expert"], + dimensions="scalar", + defaultval=2048, + mnemonics="vdW-DF Number of R-PoinTS", + characteristics=["[[DEVELOP]]"], + requires="[[vdw_xc]]>0", + added_in_version="before_v9", + text=r""" Used when [[vdw_xc]]>0, to define the sampling of the vdW-DF-kernel in real-space. """, - ), - Variable( - abivarname="vdw_df_nsmooth", - varset="vdw", - vartype="integer", - topics=["vdw_expert"], - dimensions="scalar", - defaultval=12, - mnemonics="vdW-DF Number of SMOOTHening iterations", - characteristics=["[[DEVELOP]]"], - requires="[[vdw_xc]]>0", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="vdw_df_nsmooth", + varset="vdw", + vartype="integer", + topics=["vdw_expert"], + dimensions="scalar", + defaultval=12, + mnemonics="vdW-DF Number of SMOOTHening iterations", + characteristics=["[[DEVELOP]]"], + requires="[[vdw_xc]]>0", + added_in_version="before_v9", + text=r""" Used when [[vdw_xc]]>0, to exponentially smoothen q near q0. """, - ), - Variable( - abivarname="vdw_df_phisoft", - varset="vdw", - vartype="real", - topics=["vdw_expert"], - dimensions="scalar", - defaultval=-1.0, - mnemonics="vdW-DF PHI value SOFTening.", - characteristics=["[[DEVELOP]]"], - requires="[[vdw_xc]]>0", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="vdw_df_phisoft", + varset="vdw", + vartype="real", + topics=["vdw_expert"], + dimensions="scalar", + defaultval=-1.0, + mnemonics="vdW-DF PHI value SOFTening.", + characteristics=["[[DEVELOP]]"], + requires="[[vdw_xc]]>0", + added_in_version="before_v9", + text=r""" Used when [[vdw_xc]]>0, to build the vdW-DF kernel. """, - ), - Variable( - abivarname="vdw_df_qcut", - varset="vdw", - vartype="real", - topics=["vdw_expert"], - dimensions="scalar", - defaultval=5, - mnemonics="vdW-DF Q-mesh CUT-off", - characteristics=["[[DEVELOP]]"], - requires="[[vdw_xc]]>0", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="vdw_df_qcut", + varset="vdw", + vartype="real", + topics=["vdw_expert"], + dimensions="scalar", + defaultval=5, + mnemonics="vdW-DF Q-mesh CUT-off", + characteristics=["[[DEVELOP]]"], + requires="[[vdw_xc]]>0", + added_in_version="before_v9", + text=r""" Used when [[vdw_xc]]>0, to build the vdW-DF kernel. """, - ), - Variable( - abivarname="vdw_df_qratio", - varset="vdw", - vartype="real", - topics=["vdw_expert"], - dimensions="scalar", - defaultval=20, - mnemonics="vdW-DF, between highest and lowest Q, RATIO.", - characteristics=["[[DEVELOP]]"], - requires="[[vdw_xc]]>0", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="vdw_df_qratio", + varset="vdw", + vartype="real", + topics=["vdw_expert"], + dimensions="scalar", + defaultval=20, + mnemonics="vdW-DF, between highest and lowest Q, RATIO.", + characteristics=["[[DEVELOP]]"], + requires="[[vdw_xc]]>0", + added_in_version="before_v9", + text=r""" Used when [[vdw_xc]]>0,. """, - ), - Variable( - abivarname="vdw_df_rcut", - varset="vdw", - vartype="real", - topics=["vdw_expert"], - dimensions="scalar", - defaultval=100, - mnemonics="vdW-DF Real-space CUT-off", - characteristics=["[[DEVELOP]]"], - requires="[[vdw_xc]]>0", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="vdw_df_rcut", + varset="vdw", + vartype="real", + topics=["vdw_expert"], + dimensions="scalar", + defaultval=100, + mnemonics="vdW-DF Real-space CUT-off", + characteristics=["[[DEVELOP]]"], + requires="[[vdw_xc]]>0", + added_in_version="before_v9", + text=r""" Used when [[vdw_xc]]>0, to define the vdW-DF kernel cut-off radius. """, - ), - Variable( - abivarname="vdw_df_rsoft", - varset="vdw", - vartype="real", - topics=["vdw_expert"], - dimensions="scalar", - defaultval=0.0, - mnemonics="vdW-DF radius SOFTening.", - characteristics=["[[DEVELOP]]"], - requires="[[vdw_xc]]>0", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="vdw_df_rsoft", + varset="vdw", + vartype="real", + topics=["vdw_expert"], + dimensions="scalar", + defaultval=0.0, + mnemonics="vdW-DF radius SOFTening.", + characteristics=["[[DEVELOP]]"], + requires="[[vdw_xc]]>0", + added_in_version="before_v9", + text=r""" Used when [[vdw_xc]]>0, to build the vdW-DF kernel. """, - ), - Variable( - abivarname="vdw_df_threshold", - varset="vdw", - vartype="real", - topics=["vdw_expert"], - dimensions="scalar", - defaultval=0.01, - mnemonics="vdW-DF energy calculation THRESHOLD", - characteristics=["[[DEVELOP]]"], - requires="[[vdw_xc]]>0", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="vdw_df_threshold", + varset="vdw", + vartype="real", + topics=["vdw_expert"], + dimensions="scalar", + defaultval=0.01, + mnemonics="vdW-DF energy calculation THRESHOLD", + characteristics=["[[DEVELOP]]"], + requires="[[vdw_xc]]>0", + added_in_version="before_v9", + text=r""" Sets a threshold for the energy gradient that, when reached, will cause the vdW-DF interactions to be calculated. Adjust it to a big value (e.g. 1e12) to enable it all along the SCF calculation. Too small values, as well as negative values, will result in the vdW-DF energy contributions never being calculated. """, - ), - Variable( - abivarname="vdw_df_tolerance", - varset="vdw", - vartype="real", - topics=["vdw_expert"], - dimensions="scalar", - defaultval=1e-13, - mnemonics="vdW-DF global TOLERANCE.", - characteristics=["[[DEVELOP]]"], - requires="[[vdw_xc]]>0", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="vdw_df_tolerance", + varset="vdw", + vartype="real", + topics=["vdw_expert"], + dimensions="scalar", + defaultval=1e-13, + mnemonics="vdW-DF global TOLERANCE.", + characteristics=["[[DEVELOP]]"], + requires="[[vdw_xc]]>0", + added_in_version="before_v9", + text=r""" Used when [[vdw_xc]]>0, to build the vdW-DF kernel. """, - ), - Variable( - abivarname="vdw_df_tweaks", - varset="vdw", - vartype="integer", - topics=["vdw_expert"], - dimensions="scalar", - defaultval=0, - mnemonics="vdW-DF TWEAKS.", - characteristics=["[[DEVELOP]]"], - requires="[[vdw_xc]]>0", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="vdw_df_tweaks", + varset="vdw", + vartype="integer", + topics=["vdw_expert"], + dimensions="scalar", + defaultval=0, + mnemonics="vdW-DF TWEAKS.", + characteristics=["[[DEVELOP]]"], + requires="[[vdw_xc]]>0", + added_in_version="before_v9", + text=r""" Used when [[vdw_xc]]>0, to build the vdW-DF kernel. !!! important @@ -22090,34 +23629,36 @@ calculated energies and their gradients into garbage. You have been warned! """, - ), - Variable( - abivarname="vdw_df_zab", - varset="vdw", - vartype="real", - topics=["vdw_expert"], - dimensions="scalar", - defaultval=-0.8491, - mnemonics="vdW-DF ZAB parameter", - characteristics=["[[DEVELOP]]"], - requires="[[vdw_xc]]>0", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="vdw_df_zab", + varset="vdw", + vartype="real", + topics=["vdw_expert"], + dimensions="scalar", + defaultval=-0.8491, + mnemonics="vdW-DF ZAB parameter", + characteristics=["[[DEVELOP]]"], + requires="[[vdw_xc]]>0", + added_in_version="before_v9", + text=r""" Used when [[vdw_xc]]>0, as introduced in [[cite:Dion2004]]. """, - ), - Variable( - abivarname="vdw_nfrag", - varset="vdw", - vartype="integer", - topics=["vdw_basic"], - dimensions="scalar", - defaultval=1, - mnemonics="Van Der Waals Number of interacting FRAGments", - characteristics=["[[DEVELOP]]"], - requires="[[vdw_xc]] in [10,11]", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="vdw_nfrag", + varset="vdw", + vartype="integer", + topics=["vdw_basic"], + dimensions="scalar", + defaultval=1, + mnemonics="Van Der Waals Number of interacting FRAGments", + characteristics=["[[DEVELOP]]"], + requires="[[vdw_xc]] in [10,11]", + added_in_version="before_v9", + text=r""" The absolute value of vdw_nfrag is the number of vdW interacting fragments in the unit cell. As wannierization takes place in reciprocal space, the MLWF center positions could be translated by some lattice vector from the cell @@ -22126,19 +23667,20 @@ Wannier90. The later is usually correct if some atoms are located at the corners or at limiting faces of the unit cell. """, - ), - Variable( - abivarname="vdw_supercell", - varset="vdw", - vartype="integer", - topics=["vdw_basic"], - dimensions=[3], - defaultval=[0, 0, 0], - mnemonics="Van Der Waals correction from Wannier functions in SUPERCELL", - characteristics=["[[DEVELOP]]"], - requires="[[vdw_xc]] in [10,11]", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="vdw_supercell", + varset="vdw", + vartype="integer", + topics=["vdw_basic"], + dimensions=[3], + defaultval=[0, 0, 0], + mnemonics="Van Der Waals correction from Wannier functions in SUPERCELL", + characteristics=["[[DEVELOP]]"], + requires="[[vdw_xc]] in [10,11]", + added_in_version="before_v9", + text=r""" Set of dimensionless positive numbers which define the maximum multiples of the primitive translations ([[rprimd]]) in the supercell construction. Each component of vdw_supercell indicates the maximum number of cells along both @@ -22149,38 +23691,40 @@ avoided. Both a negative or null value for one component of [[vdw_supercell]] will indicate that the corresponding direction is normal to the layers. """, - ), - Variable( - abivarname="vdw_tol", - varset="vdw", - vartype="real", - topics=["vdw_compulsory"], - dimensions="scalar", - defaultval=1e-10, - mnemonics="Van Der Waals TOLerance", - characteristics=["[[DEVELOP]]"], - requires="[[vdw_xc]] == 5", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="vdw_tol", + varset="vdw", + vartype="real", + topics=["vdw_compulsory"], + dimensions="scalar", + defaultval=1e-10, + mnemonics="Van Der Waals TOLerance", + characteristics=["[[DEVELOP]]"], + requires="[[vdw_xc]] == 5", + added_in_version="before_v9", + text=r""" The DFT-D methods [[cite:Grimme2010]] dispersion potentials, [[vdw_xc]] == 5 or 6 or 7, include a pair potential. The number of pairs of atoms contributing to the potential is necessarily limited. To be included in the potential a pair of atom must have contribution to the energy larger than [[vdw_tol]]. """, - ), - Variable( - abivarname="vdw_tol_3bt", - varset="vdw", - vartype="real", - topics=["vdw_basic"], - dimensions="scalar", - defaultval=-1, - mnemonics="Van Der Waals TOLerance for 3-Body Term", - characteristics=["[[DEVELOP]]"], - commentdefault="Do include the 3-body term in the correction", - requires="[[vdw_xc]] == 6", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="vdw_tol_3bt", + varset="vdw", + vartype="real", + topics=["vdw_basic"], + dimensions="scalar", + defaultval=-1, + mnemonics="Van Der Waals TOLerance for 3-Body Term", + characteristics=["[[DEVELOP]]"], + commentdefault="Do include the 3-body term in the correction", + requires="[[vdw_xc]] == 6", + added_in_version="before_v9", + text=r""" Control the computation of the 3-body correction inside DFT-D3 dispersion correction (Grimme approach) to the total energy: @@ -22201,19 +23745,20 @@ contribution to energy, to forces and to stress is available (not planned for elastic constants, dynamical matrix and internal strains). """, - ), - Variable( - abivarname="vdw_typfrag", - varset="vdw", - vartype="integer", - topics=["vdw_basic"], - dimensions=["[[natom]]"], - defaultval=MultipleValue(number=1, value="[[natom]]"), - mnemonics="Van Der Waals TYPe of FRAGment", - characteristics=["[[DEVELOP]]"], - requires="[[vdw_xc]] in [10,11]", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="vdw_typfrag", + varset="vdw", + vartype="integer", + topics=["vdw_basic"], + dimensions=["[[natom]]"], + defaultval=MultipleValue(number=1, value="[[natom]]"), + mnemonics="Van Der Waals TYPe of FRAGment", + characteristics=["[[DEVELOP]]"], + requires="[[vdw_xc]] in [10,11]", + added_in_version="before_v9", + text=r""" This array defines the interacting fragments by assigning to each atom an integer index from 1 to **vdw_nfrag**. The ordering of [[vdw_typfrag]] is the same as [[typat]] or [[xcart]]. Internally each MLWF is assigned to a given @@ -22221,18 +23766,19 @@ fragment as their nearest atom. The resulting set of MLWFs in each interacting fragment can be found in the output file in xyz format for easy visualization. """, - ), - Variable( - abivarname="vdw_xc", - varset="vdw", - vartype="integer", - topics=["vdw_compulsory"], - dimensions="scalar", - defaultval=0, - mnemonics="Van Der Waals eXchange-Correlation functional", - characteristics=["[[DEVELOP]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="vdw_xc", + varset="vdw", + vartype="integer", + topics=["vdw_compulsory"], + dimensions="scalar", + defaultval=0, + mnemonics="Van Der Waals eXchange-Correlation functional", + characteristics=["[[DEVELOP]]"], + added_in_version="before_v9", + text=r""" Selects a van-der-Waals density functional to apply the corresponding correction to the exchange-correlation energy. If set to zero, no correction will be applied. For response functions, only [[vdw_xc]]=5, 6 and 7 have been implemented (obviously also 0).. @@ -22251,20 +23797,21 @@ For [[vdw_xc]] = 1 and [[vdw_xc]] = 2, the implementation follows the strategy devised in the article of Roman-Perez and Soler [[cite:Romanperez2009]]. """, - ), - Variable( - abivarname="vel", - varset="rlx", - vartype="real", - topics=["PIMD_useful", "MolecularDynamics_basic", "GeoOpt_basic"], - dimensions=[3, "[[natom]]"], - defaultval=MultipleValue(number=None, value=0), - mnemonics="VELocity", - characteristics=["[[EVOLVING]]"], - commentdims="It is represented internally as [[vel]](3,[[natom]],[[nimage]])", - requires="[[geoopt]] or [[moldyn]] /= none ([[ionmov]] > 0)", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="vel", + varset="rlx", + vartype="real", + topics=["PIMD_useful", "MolecularDynamics_basic", "GeoOpt_basic"], + dimensions=[3, "[[natom]]"], + defaultval=MultipleValue(number=None, value=0), + mnemonics="VELocity", + characteristics=["[[EVOLVING]]"], + commentdims="It is represented internally as [[vel]](3,[[natom]],[[nimage]])", + requires="[[geoopt]] or [[moldyn]] /= none ([[ionmov]] > 0)", + added_in_version="before_v9", + text=r""" Gives the starting velocities of atoms, in cartesian coordinates, in Bohr/atomic time units (atomic time units given where [[dtion]] is described). For [[ionmov]] = 8 (Nose thermostat), if [[vel]] is not initialized, a random @@ -22274,37 +23821,39 @@ the effect of this atom manipulator (see [[objarf]]). Velocities evolve is [[geoopt]] == "viscous" ([[ionmov]] == 1). """, - ), - Variable( - abivarname="vel_cell", - varset="rlx", - vartype="real", - topics=["PIMD_expert"], - dimensions=[3, 3], - defaultval=MultipleValue(number=None, value=3), - mnemonics="VELocity of the CELL parameters", - characteristics=["[[EVOLVING]]"], - commentdims="It is represented internally as [[vel_cell]](3,3,[[nimage]])", - requires="""[[imgmov]] in [9,13] and [[optcell]] > 0 +), + +Variable( + abivarname="vel_cell", + varset="rlx", + vartype="real", + topics=["PIMD_expert"], + dimensions=[3, 3], + defaultval=MultipleValue(number=None, value=3), + mnemonics="VELocity of the CELL parameters", + characteristics=["[[EVOLVING]]"], + commentdims="It is represented internally as [[vel_cell]](3,3,[[nimage]])", + requires="""[[imgmov]] in [9,13] and [[optcell]] > 0 (Path-Integral Molecular Dynamics with NPT algorithm)""", - added_in_version="before_v9", - text=r""" + added_in_version="before_v9", + text=r""" Irrelevant unless [[imgmov]] = 9 or 13 and [[optcell]]>0 (Path-Integral Molecular Dynamics with NPT algorithm). Gives the starting velocities of the dimensional cell parameters in Bohr/atomic time units (atomic time units given where [[dtion]] is described). """, - ), - Variable( - abivarname="vis", - varset="rlx", - vartype="real", - topics=["MolecularDynamics_basic"], - dimensions="scalar", - defaultval=100, - mnemonics="VIScosity", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="vis", + varset="rlx", + vartype="real", + topics=["MolecularDynamics_basic"], + dimensions="scalar", + defaultval=100, + mnemonics="VIScosity", + added_in_version="before_v9", + text=r""" The equations of motion are: M I d 2 R I /dt 2 = F I - [[vis]] dR I /dt @@ -22315,18 +23864,19 @@ [[amu]]. Critical damping is most desirable and is found only by optimizing [[vis]] for a given situation. """, - ), - Variable( - abivarname="vloc_rcut", - varset="dev", - vartype="real", - topics=["Planewaves_expert"], - dimensions="scalar", - defaultval=6.0, - mnemonics="VLOCal Radial CUToff", - characteristics=["[[LENGTH]]"], - added_in_version="9.8.0", - text=r""" +), + +Variable( + abivarname="vloc_rcut", + varset="dev", + vartype="real", + topics=["Planewaves_expert"], + dimensions="scalar", + defaultval=6.0, + mnemonics="VLOCal Radial CUToff", + characteristics=["[[LENGTH]]"], + added_in_version="9.8.0", + text=r""" This variable defines the cutoff for the radial mesh used to compute `epsatm` (the alpha term in the total energy due to the pseudos) and the Bessel transform for the local part in the case of NC pseudos given in UPF2 format. @@ -22336,19 +23886,21 @@ in the second order derivatives of the vloc form factors. For this reason, the default value in Abinit is set to 6.0. """, - ), - Variable( - abivarname="vprtrb", - varset="ffield", - vartype="real", - topics=["Artificial_useful"], - dimensions=[2], - defaultval=[0.0, 0.0], - mnemonics="potential -V- for the PeRTuRBation", - characteristics=["[[DEVELOP]]", "[[ENERGY]]"], - requires="[[qprtrb]]", - added_in_version="before_v9", - text=r""" +), + + +Variable( + abivarname="vprtrb", + varset="ffield", + vartype="real", + topics=["Artificial_useful"], + dimensions=[2], + defaultval=[0.0, 0.0], + mnemonics="potential -V- for the PeRTuRBation", + characteristics=["[[DEVELOP]]", "[[ENERGY]]"], + requires="[[qprtrb]]", + added_in_version="before_v9", + text=r""" Gives the real and imaginary parts of a scalar potential perturbation. Can be specified in Ha (the default), Ry, eV or Kelvin, since [[vprtrb]] has the [[ENERGY]] characteristics. @@ -22358,18 +23910,19 @@ * ([[vprtrb]](1)$+I$[[vprtrb]](2)$)/2$ at $G=$[[qprtrb]] and * ([[vprtrb]](1)$-I$[[vprtrb]](2)$)/2$ at $G=-$[[qprtrb]] (see [[qprtrb]] also). """, - ), - Variable( - abivarname="w90iniprj", - varset="w90", - vartype="integer", - topics=["Wannier_basic"], - dimensions="scalar", - defaultval=1, - mnemonics="Wannier90- INItial PROJections", - requires="[[prtwant]] == 2 or [[prtwant]] == 3", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="w90iniprj", + varset="w90", + vartype="integer", + topics=["Wannier_basic"], + dimensions="scalar", + defaultval=1, + mnemonics="Wannier90- INItial PROJections", + requires="[[prtwant]] == 2 or [[prtwant]] == 3", + added_in_version="before_v9", + text=r""" In order to find the Maximally Localized Wannier Functions, the user has to provide an initial guess. A set of localized trial orbitals is chosen corresponding to some rough initial guess at the Wannier Functions, and these @@ -22385,19 +23938,20 @@ Information about how to define them can be found in the manual of Wannier90. See [www.wannier.org](http://www.wannier.org) """, - ), - Variable( - abivarname="w90prtunk", - varset="w90", - vartype="integer", - topics=["Wannier_basic"], - dimensions="scalar", - defaultval=0, - mnemonics="Wannier90- PRINT UNKp.s file", - commentdefault="""The default is set to zero because UNKp.s files occupy a lot of memory.""", - requires="[[prtwant]] == 2 or [[prtwant]] == 3", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="w90prtunk", + varset="w90", + vartype="integer", + topics=["Wannier_basic"], + dimensions="scalar", + defaultval=0, + mnemonics="Wannier90- PRINT UNKp.s file", + commentdefault="""The default is set to zero because UNKp.s files occupy a lot of memory.""", + requires="[[prtwant]] == 2 or [[prtwant]] == 3", + added_in_version="before_v9", + text=r""" Defines whether or not the UNKp.s file will be printed. * [[w90prtunk]] = 0: Do not print the UNKp.s files @@ -22439,17 +23993,18 @@ produce an acceptable plot, [[w90prtunk]] can be set to 1 to output every grid point. (You should try spline interpolation in XCrysDen first.) """, - ), - Variable( - abivarname="wfinit", - varset="gstate", - vartype="integer", - topics=["TuningSpeedMem_useful", "SCFAlgorithms_useful", "PseudosPAW_useful"], - dimensions="scalar", - defaultval=0, - mnemonics="WaveFunctions INITialization", - added_in_version="9.9.0", - text=r""" +), + +Variable( + abivarname="wfinit", + varset="gstate", + vartype="integer", + topics=["TuningSpeedMem_useful","SCFAlgorithms_useful","PseudosPAW_useful"], + dimensions="scalar", + defaultval=0, + mnemonics="WaveFunctions INITialization", + added_in_version="9.9.0", + text=r""" This option specifies how to initialize the wavefunctions in the case of GS calculations. It requires pseudos with pseudized wavefunctions e.g. UPF2. Possible values are: @@ -22458,18 +24013,19 @@ * 1: Use atomic orbitals + random numbers. * 2: Use atomic orbitals without random numbers. """, - ), - Variable( - abivarname="wfmix", - varset="gstate", - vartype="real", - topics=["Hybrids_useful"], - dimensions="scalar", - defaultval=1.0, - mnemonics="WaveFunctions MIXing factor", - requires="[[usefock]] > 0 and [[nnsclohf]] >0 and [[fockoptmix]]/100 > 0", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="wfmix", + varset="gstate", + vartype="real", + topics=["Hybrids_useful"], + dimensions="scalar", + defaultval=1.0, + mnemonics="WaveFunctions MIXing factor", + requires="[[usefock]] > 0 and [[nnsclohf]] >0 and [[fockoptmix]]/100 > 0", + added_in_version="before_v9", + text=r""" When the wavefunctions are determined using a SCF double loop (hybrid functionals), [[wfmix]] provides the mixing factor to obtain the new input wavefunctions by the combination of the earlier input wavefunctions and @@ -22481,19 +24037,20 @@ better stability, but might be slower. If it is larger than 1.0, perhaps less iterations will be needed (if there is no instability). """, - ), - Variable( - abivarname="wfoptalg", - varset="dev", - vartype="integer", - topics=["SCFAlgorithms_basic"], - dimensions="scalar", - defaultval="[[AUTO_FROM_PSP]]", - mnemonics="WaveFunction OPTimisation ALGorithm", - characteristics=["[[DEVELOP]]"], - commentdefault="0 when [[usepaw]] = 0 (norm-conserving pseudopotentials), 10 when [[usepaw]] = 1 (PAW); 114 if [[paral_kgb]] = 1.", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="wfoptalg", + varset="dev", + vartype="integer", + topics=["SCFAlgorithms_basic"], + dimensions="scalar", + defaultval="[[AUTO_FROM_PSP]]", + mnemonics="WaveFunction OPTimisation ALGorithm", + characteristics=["[[DEVELOP]]"], + commentdefault="0 when [[usepaw]] = 0 (norm-conserving pseudopotentials), 10 when [[usepaw]] = 1 (PAW); 114 if [[paral_kgb]] = 1.", + added_in_version="before_v9", + text=r""" Allows one to choose the algorithm for the optimisation of the wavefunctions. The different possibilities are: @@ -22515,29 +24072,35 @@ * [[wfoptalg]] = 114: A modern and highly efficient version of [[wfoptalg]] = 14 (**Locally Optimal Block Preconditioned Conjugate Gradient**), particularly suited for parallel computations. It performs well with a small number of blocks and can utilize OpenMP if ABINIT is compiled with a multithreaded linear algebra library. > Note: When using more than one thread, [[npfft]] cannot be used. - * [[wfoptalg]] = 1: A spectrum filtering algorithm based on **Chebyshev filtering**, designed for use with a large number of processors. It is suitable when the LOBPCG algorithm no longer scales efficiently. The degree of the polynomial filter can be adjusted with [[mdeg_filter]] (formerly [[nline]]). For more information, see the [performance guide](/theory/howto_chebfi.pdf) and [[cite:Levitt2015]]. + * [[wfoptalg]] = 1: A spectrum filtering algorithm based on **Chebyshev filtering**, designed for use with a large number of processors. It is suitable when the LOBPCG algorithm no longer scales efficiently. The degree of the polynomial filter can be adjusted with [[mdeg_filter]] (formerly [[nline]]). For more information, see the [[pdf:howto_chebfi.pdf|performance guide]] and [[cite:Levitt2015]]. > Recommendation: use [[wfoptalg]] = 111, which is the modern and improved version of this algorithm. > See **notes** in the "[[wfoptalg]] = 111" section. -* [[wfoptalg]] = 111: A **modern and highly efficient version** of [[wfoptalg]] = 1, a spectrum filtering algorithm based on **Chebyshev filtering**, designed for use with a large number of processors. The degree of the polynomial filter can be adjusted with [[mdeg_filter]] (formerly [[nline]]). For more information, see the [performance guide](/theory/howto_chebfi.pdf) and [[cite:Levitt2015]]. +* [[wfoptalg]] = 111: A **modern and highly efficient version** of [[wfoptalg]] = 1, a spectrum filtering algorithm based on **Chebyshev filtering**, designed for use with a large number of processors. The degree of the polynomial filter can be adjusted with [[mdeg_filter]] (formerly [[nline]]). For more information, see the [[pdf:howto_chebfi.pdf|performance guide]] and [[cite:Levitt2015]]. + > **Notes**: > > * For more performance, try enabling [[use_gemm_nonlop]] (default on [[GPU]]). > > * This algorithm struggles to converge the last bands, so it is advisable to use slightly more bands than required. When using [[tolwfr_diago]], it is mandatory to set [[nbdbuf]]. > -> * By design, this algorithm cannot use preconditioning and, therefore, cannot handle [[ecutsm]]. Consequently, _Pulay stresses_ are not corrected. If stresses are important for the calculation (e.g., when pressure is required), it is necessary to slightly increase the plane-wave cutoff ([[ecut]]). """, - ), - Variable( - abivarname="write_files", - varset="files", - vartype="string", - topics=["printing_prgs"], - dimensions="scalar", - defaultval="default", - mnemonics="write files", - added_in_version="9.11.0", - text=r""" +> * By design, this algorithm cannot use preconditioning and, therefore, cannot handle [[ecutsm]]. Consequently, _Pulay stresses_ are not corrected. If stresses are important for the calculation (e.g., when pressure is required), it is necessary to slightly increase the plane-wave cutoff ([[ecut]]). + +* [[wfoptalg]] = 112: A **highly** experimental Spectrum Slicing algorithm. A spectral filtering +algorithm by spectral slices based on lowpass and bandpass Chebyshev polynomials. The polynomial degree is tuned using [[mdeg_filter]] (formerly [[nline]]). The number of slices is tuned with [[nslice]] variable. +""", +), + +Variable( + abivarname="write_files", + varset="files", + vartype="string", + topics=["printing_prgs"], + dimensions="scalar", + defaultval="default", + mnemonics="write files", + added_in_version="9.11.0", + text=r""" Supra-variable controlling the underlying printing options of the prt-type variables. It can be used as a simple string flagging the desired outputs as follows: @@ -22565,6 +24128,9 @@ * "fsurf" --> Activates the printing of the Fermi surface file. Refer to [[prtfsurf]] for further documentation. * "gden" --> Activates the printing of the gradient of the electronic density file. Refer to [[prtgden]] for further documentation. * "geo" --> Activates the printing of the geometry analysis. Refer to [[prtgeo]] for further documentation. + * "geo_1 --> Activates the printing of the geometry analysis under option 1 of the [[prtgeo]] variable. + * "geo_2 --> Activates the printing of the geometry analysis under option 2 of the [[prtgeo]] variable. + * "geo_3 --> Activates the printing of the geometry analysis under option 3 of the [[prtgeo]] variable. * "gkk" --> Activates the printing of the GKK matrix file. Refer to [[prtgkk]] for further documentation. * "gsr" --> Activates the printing of the GSR file. Refer to [[prtgsr]] for further documentation. * "hist" --> Activates the printing of the HIST file. Refer to [[prthist]] for further documentation. @@ -22593,18 +24159,20 @@ * "wf_-1" --> Activates the printing of the wavefunction file. Refer to [[prtwf]] for further documentation. * "xml" --> Activates the printing of the xml file. Refer to [[prtxml]] for further documentation. """, - ), - Variable( - abivarname="wtatcon", - varset="rlx", - vartype="real", - topics=["GeoConstraints_useful"], - dimensions=[3, "[[natcon]]", "[[nconeq]]"], - defaultval=0, - mnemonics="WeighTs for AToms in CONstraint equations", - characteristics=["[[NO_MULTI]]"], - added_in_version="before_v9", - text=r""" +), + + +Variable( + abivarname="wtatcon", + varset="rlx", + vartype="real", + topics=["GeoConstraints_useful"], + dimensions=[3, "[[natcon]]", "[[nconeq]]"], + defaultval=0, + mnemonics="WeighTs for AToms in CONstraint equations", + characteristics=["[[NO_MULTI]]"], + added_in_version="before_v9", + text=r""" Gives the weights determining how the motion of atoms is constrained during structural optimization or molecular dynamics (see [[nconeq]], [[natcon]], and [[iatcon]]). For each of the [[nconeq]] independent constraint equations, @@ -22623,18 +24191,19 @@ atoms on a surface (assuming their masses are equal), since F' z,1 - F' z,2 = 0 implies z 1 - z 2 = constant. """, - ), - Variable( - abivarname="wtk", - varset="basic", - vartype="real", - topics=["k-points_useful"], - dimensions=["[[nkpt]]"], - defaultval=MultipleValue(number="[[nkpt]]", value=1.0), - mnemonics="WeighTs for K points", - commentdefault="Except when [[kptopt]]/=0", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="wtk", + varset="basic", + vartype="real", + topics=["k-points_useful"], + dimensions=["[[nkpt]]"], + defaultval=MultipleValue(number="[[nkpt]]", value=1.0), + mnemonics="WeighTs for K points", + commentdefault="Except when [[kptopt]]/=0", + added_in_version="before_v9", + text=r""" Gives the k point weights. The k point weights will have their sum (re)normalized to 1 (unless [[occopt]] = 2 and [[kptopt]] = 0; see description of [[occopt]]) within the @@ -22642,64 +24211,68 @@ feature helps avoid the need for many digits in representing fractional weights such as 1/3. [[wtk]] is ignored if [[iscf]] is not positive, except if [[iscf]] = -3. """, - ), - Variable( - abivarname="wtq", - varset="gstate", - vartype="real", - topics=["q-points_useful"], - dimensions="scalar", - defaultval=1, - mnemonics="WeighTs for the current Q-points", - commentdefault="Except when [[qptopt]]/=0", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="wtq", + varset="gstate", + vartype="real", + topics=["q-points_useful"], + dimensions="scalar", + defaultval=1, + mnemonics="WeighTs for the current Q-points", + commentdefault="Except when [[qptopt]]/=0", + added_in_version="before_v9", + text=r""" Gives the current q-point weight. """, - ), - Variable( - abivarname="wvl_bigdft_comp", - varset="gstate", - vartype="integer", - topics=["Wavelets_expert"], - dimensions="scalar", - defaultval=0, - mnemonics="WaVeLet BIGDFT Comparison", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="wvl_bigdft_comp", + varset="gstate", + vartype="integer", + topics=["Wavelets_expert"], + dimensions="scalar", + defaultval=0, + mnemonics="WaVeLet BIGDFT Comparison", + added_in_version="before_v9", + text=r""" This variable is used for the wavelets capabilities of ABINIT (see [[usewvl]]). It is used to compare the results obtained with ABINIT with those obtained with BigDFT stand-alone. When it is set to 1, ABINIT will follow the workflow as in BigDFT stand-alone. Therefore, the results must be exactly the same with the two codes. """, - ), - Variable( - abivarname="wvl_crmult", - varset="gstate", - vartype="real", - topics=["Wavelets_basic"], - dimensions="scalar", - defaultval=6.0, - mnemonics="WaVeLet Coarse grid Radius MULTiplier", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="wvl_crmult", + varset="gstate", + vartype="real", + topics=["Wavelets_basic"], + dimensions="scalar", + defaultval=6.0, + mnemonics="WaVeLet Coarse grid Radius MULTiplier", + added_in_version="before_v9", + text=r""" This factor is used to define the expansion of the coarse resolution grid in the case of wavelets (see [[usewvl]]). The grid is made of points inside spheres centered on atoms. The radius of these spheres are the product between this factor and the covalent radius of element (read from the pseudo-potential file). This factor is responsible for the amount of used memory (see also [[wvl_hgrid]]). """, - ), - Variable( - abivarname="wvl_frmult", - varset="gstate", - vartype="real", - topics=["Wavelets_basic"], - dimensions="scalar", - defaultval=10.0, - mnemonics="WaVeLet Fine grid Radius MULTiplier", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="wvl_frmult", + varset="gstate", + vartype="real", + topics=["Wavelets_basic"], + dimensions="scalar", + defaultval=10.0, + mnemonics="WaVeLet Fine grid Radius MULTiplier", + added_in_version="before_v9", + text=r""" This factor is used to define the expansion of the fine resolution grid in the case of wavelets (see [[usewvl]]). This fine resolution grid has the same grid step than the coarse one (see [[wvl_crmult]] ), but on each point, 8 @@ -22709,80 +24282,85 @@ a value read from the pseudo-potential file. This factor is responsible for the amount of used memory (see also [[wvl_hgrid]]). """, - ), - Variable( - abivarname="wvl_hgrid", - varset="basic", - vartype="real", - topics=["Wavelets_basic"], - dimensions="scalar", - defaultval=0.5, - mnemonics="WaVeLet H step GRID", - characteristics=["[[LENGTH]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="wvl_hgrid", + varset="basic", + vartype="real", + topics=["Wavelets_basic"], + dimensions="scalar", + defaultval=0.5, + mnemonics="WaVeLet H step GRID", + characteristics=["[[LENGTH]]"], + added_in_version="before_v9", + text=r""" It gives the step size in real space for the grid resolution in the wavelet basis set. This value is highly responsible for the memory occupation in the wavelet computation. The value is a length in atomic units. """, - ), - Variable( - abivarname="wvl_ngauss", - varset="gstate", - vartype="integer", - topics=["Wavelets_expert"], - dimensions=[2], - defaultval=[1, 100], - mnemonics="WaVeLet Number of GAUSSians", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="wvl_ngauss", + varset="gstate", + vartype="integer", + topics=["Wavelets_expert"], + dimensions=[2], + defaultval=[1, 100], + mnemonics="WaVeLet Number of GAUSSians", + added_in_version="before_v9", + text=r""" In the wavelet-PAW computation case, projectors may be fitted to a sum of complex Gaussians. The fit is done for [[wvl_ngauss]](1), [[wvl_ngauss]](1)+1... up to [[wvl_ngauss]](2) Gaussians. """, - ), - Variable( - abivarname="wvl_nprccg", - varset="gstate", - vartype="integer", - topics=["Wavelets_expert"], - dimensions="scalar", - defaultval=5, - mnemonics="WaVeLet maximum Number of PReConditioner Conjugate Gradient iterations", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="wvl_nprccg", + varset="gstate", + vartype="integer", + topics=["Wavelets_expert"], + dimensions="scalar", + defaultval=5, + mnemonics="WaVeLet maximum Number of PReConditioner Conjugate Gradient iterations", + added_in_version="before_v9", + text=r""" In the wavelet computation case, the wavefunctions are directly minimised using a real-space preconditioner. This preconditioner has internally some conjugate gradient iterations. This value defines a boundary for the number of conjugate gradient iterations on each wavefunction convergence step. """, - ), - Variable( - abivarname="x1rdm", - varset="gw", - vartype="integer", - topics=["GW_expert", "SelfEnergy_expert"], - dimensions="scalar", - defaultval=0, - mnemonics="EXchange-only 1-Reduced Density Matrix", - requires="[[optdriver]] == 4", - added_in_version="9.4.0", - text=r""" +), + +Variable( + abivarname="x1rdm", + varset="gw", + vartype="integer", + topics=["GW_expert", "SelfEnergy_expert"], + dimensions="scalar", + defaultval=0, + mnemonics="EXchange-only 1-Reduced Density Matrix", + requires="[[optdriver]] == 4", + added_in_version="9.4.0", + text=r""" [[x1rdm]]==1 forces the update of the density-matrix using only the exchange operator (instead of exchange and GW correlation). It must be used with [[gwcalctyp]]==21 and [[gw1rdm]]>0. """, - ), - Variable( - abivarname="xc_denpos", - varset="dev", - vartype="real", - topics=["xc_expert"], - dimensions="scalar", - defaultval=1e-14, - mnemonics="eXchange-Correlation - DENsity POSitivity value", - characteristics=["[[DEVELOP]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="xc_denpos", + varset="dev", + vartype="real", + topics=["xc_expert"], + dimensions="scalar", + defaultval=1e-14, + mnemonics="eXchange-Correlation - DENsity POSitivity value", + characteristics=["[[DEVELOP]]"], + added_in_version="before_v9", + text=r""" For the evaluation of the exchange-correlation functionals, the density cannot be negative, or even too small (e.g. the LDA exchange kernel behaves like the density at power -(2/3), and the density is used at the denominator of @@ -22799,18 +24377,19 @@ has been seen to allow good convergence. Of course, this will affect the numerical results somehow, and one should play a bit with this value to avoid incorrect calculations. """, - ), - Variable( - abivarname="xc_taupos", - varset="dev", - vartype="real", - topics=["xc_expert"], - dimensions="scalar", - defaultval="[[xc_denpos]]", - mnemonics="eXchange-Correlation - TAU kinetic energy DENsity POSitivity value", - characteristics=["[[DEVELOP]]"], - added_in_version="9.10.4", - text=r""" +), + +Variable( + abivarname="xc_taupos", + varset="dev", + vartype="real", + topics=["xc_expert"], + dimensions="scalar", + defaultval="[[xc_denpos]]", + mnemonics="eXchange-Correlation - TAU kinetic energy DENsity POSitivity value", + characteristics=["[[DEVELOP]]"], + added_in_version="9.10.4", + text=r""" For the evaluation of the meta-GGA exchange-correlation functionals, the kinetic energy density (usually named tau) cannot be negative, or even too small. [[xc_taupos]] is the smallest value that the kinetic energy density can assume @@ -22824,17 +24403,18 @@ convergence. Of course, this will affect the numerical results somehow, and one should play a bit with this value to avoid incorrect calculations. """, - ), - Variable( - abivarname="xc_tb09_c", - varset="dev", - vartype="real", - topics=["xc_expert"], - dimensions="scalar", - defaultval=99.99, - mnemonics="Value of the c parameter in the eXchange-Correlation TB09 functional", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="xc_tb09_c", + varset="dev", + vartype="real", + topics=["xc_expert"], + dimensions="scalar", + defaultval=99.99, + mnemonics="Value of the c parameter in the eXchange-Correlation TB09 functional", + added_in_version="before_v9", + text=r""" The modified Becke-Johnson exchange-correlation functional by [[cite:Tran2009 | Tran and Blaha]] (acronym TB09, used when [[ixc]]=-12208, which needs [[usekden]]=1) reads: @@ -22859,17 +24439,18 @@ equal to the "magic" default value 99.99. The $c$ parameter can also be fixed to some (property-optimized or material-optimized) value by using this variable. """, - ), - Variable( - abivarname="xcart", - varset="basic", - vartype="real", - topics=["crystal_compulsory"], - dimensions=[3, "min([[natom]],[[natrd]])"], - mnemonics="vectors (X) of atom positions in CARTesian coordinates", - characteristics=["[[EVOLVING]]", "[[LENGTH]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="xcart", + varset="basic", + vartype="real", + topics=["crystal_compulsory"], + dimensions=[3, "min([[natom]],[[natrd]])"], + mnemonics="vectors (X) of atom positions in CARTesian coordinates", + characteristics=["[[EVOLVING]]", "[[LENGTH]]"], + added_in_version="before_v9", + text=r""" Gives the cartesian coordinates of atoms within unit cell. This information is redundant with that supplied by array [[xred]]. By default, [[xcart]] is given in Bohr atomic units (1 Bohr=0.5291772108 Angstroms), @@ -22881,18 +24462,19 @@ One and only one of [[xred]] or [[xcart]] must be provided. Atomic positions evolve if [[geoopt]] or [[moldyn]] /= "none". """, - ), - Variable( - abivarname="xclevel", - varset="internal", - vartype="integer", - topics=["xc_internal", "TDDFT_useful"], - dimensions="scalar", - defaultval=0, - mnemonics="eXchange Correlation functional LEVEL", - characteristics=["[[INTERNAL_ONLY]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="xclevel", + varset="internal", + vartype="integer", + topics=["xc_internal", "TDDFT_useful"], + dimensions="scalar", + defaultval=0, + mnemonics="eXchange Correlation functional LEVEL", + characteristics=["[[INTERNAL_ONLY]]"], + added_in_version="before_v9", + text=r""" Automatically determined from the value of [[ixc]]. * 0 --> No XC contribution. @@ -22900,19 +24482,20 @@ * 2 --> GGA functional or hybrid functional based on GGA. * 3 --> Functional for TDDFT. """, - ), - Variable( - abivarname="xred", - varset="basic", - vartype="real", - topics=["crystal_compulsory"], - dimensions=[3, "min([[natom]],[[natrd]])"], - defaultval=MultipleValue(number=None, value=0.0), - mnemonics="vectors (X) of atom positions in REDuced coordinates", - characteristics=["[[EVOLVING]]"], - commentdims="represented internally as xred(3,[[natom]],[[nimage]])", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="xred", + varset="basic", + vartype="real", + topics=["crystal_compulsory"], + dimensions=[3, "min([[natom]],[[natrd]])"], + defaultval=MultipleValue(number=None, value=0.0), + mnemonics="vectors (X) of atom positions in REDuced coordinates", + characteristics=["[[EVOLVING]]"], + commentdims="represented internally as xred(3,[[natom]],[[nimage]])", + added_in_version="before_v9", + text=r""" Gives the atomic locations within unit cell in coordinates relative to real space primitive translations (**NOT in cartesian coordinates**). Thus these are fractional numbers typically between 0 and 1 and are dimensionless. The @@ -22931,32 +24514,34 @@ The echo of [[xcart]] in the main output file is accompanied by its echo in Angstrom, named `xangst`. """, - ), - Variable( - abivarname="xredsph_extra", - varset="gstate", - vartype="real", - topics=["printing_prdos", "AtomCentered_useful"], - dimensions=[3, "[[natsph_extra]]"], - defaultval=MultipleValue(number=None, value=0.0), - mnemonics="X(position) in REDuced coordinates of the SPHeres for dos projection in the EXTRA set", - requires="[[natsph_extra]] > 0", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="xredsph_extra", + varset="gstate", + vartype="real", + topics=["printing_prdos","AtomCentered_useful"], + dimensions=[3, "[[natsph_extra]]"], + defaultval=MultipleValue(number=None, value=0.0), + mnemonics="X(position) in REDuced coordinates of the SPHeres for dos projection in the EXTRA set", + requires="[[natsph_extra]] > 0", + added_in_version="before_v9", + text=r""" The positions in reduced coordinates of extra spheres used in the DOS projection, simulating an STS signal. See [[natsph_extra]] for a more complete description. """, - ), - Variable( - abivarname="xyzfile", - varset="geo", - vartype="string", - topics=["crystal_useful"], - dimensions="scalar", - mnemonics="XYZ FILE input for geometry", - characteristics=["[[INPUT_ONLY]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="xyzfile", + varset="geo", + vartype="string", + topics=["crystal_useful"], + dimensions="scalar", + mnemonics="XYZ FILE input for geometry", + characteristics=["[[INPUT_ONLY]]"], + added_in_version="before_v9", + text=r""" Gives the name of a xyz format file, to take [[natom]], [[ntypat]], [[typat]], [[znucl]], and [[xcart]] (in Angstrom) from it. This input can not be mixed with normal atom specifications for other datasets. @@ -22966,20 +24551,21 @@ a comment line, then one line per atom, with the element as a 2 letter symbol ("As" "O" or "Pu") and the three cartesian coordinates in Angstrom. """, - ), - Variable( - abivarname="zcut", - varset="gw", - vartype="real", - topics=["Susceptibility_expert", "BSE_expert", "SelfEnergy_expert"], - dimensions="scalar", - defaultval=0.0036749326, - mnemonics="Z-CUT", - characteristics=["[[ENERGY]]"], - commentdefault="0.1 eV (0.0036749326 Ha)", - requires="[[optdriver]] in [3, 4, 7, 99]", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="zcut", + varset="gw", + vartype="real", + topics=["Susceptibility_expert", "BSE_expert", "SelfEnergy_expert"], + dimensions="scalar", + defaultval=0.0036749326, + mnemonics="Z-CUT", + characteristics=["[[ENERGY]]"], + commentdefault="0.1 eV (0.0036749326 Ha)", + requires="[[optdriver]] in [3, 4, 7, 99]", + added_in_version="before_v9", + text=r""" It is meant to avoid some divergences that might occur during the evaluation of the Adler-Wiser expression of the irreducible polarizability ([[optdriver]] = 3) or during the numerical treatment of the integrals defining @@ -23000,22 +24586,23 @@ When [[optdriver]] = 7, **zcut** defines the small complex shift used to avoid divergences in the expression for the Fan-Migdal e-ph self-energy. Note that the default value is too large for e-ph calculations, smaller values of the order -of 0.001 or 0.001 eV should be used (and carefully tested). -""", - ), - Variable( - abivarname="zeemanfield", - varset="ffield", - vartype="real", - topics=["MagField_basic"], - dimensions=[3], - defaultval=0, - mnemonics="ZEEMAN FIELD", - characteristics=["[[MAGNETIC_FIELD]]"], - added_in_version="before_v9", - text=r""" - -OBSOLETE, superceded by [[hspinfield]]. +of 0.01 or 0.001 eV should be used (and carefully tested). +""", +), + +Variable( + abivarname="zeemanfield", + varset="ffield", + vartype="real", + topics=["MagField_basic"], + dimensions=[3], + defaultval=0, + mnemonics="ZEEMAN FIELD", + characteristics=["[[MAGNETIC_FIELD]]"], + added_in_version="before_v9", + text=r""" + +OBSOLETE, superseded by [[hspinfield]]. Give the value of the magnetic field, $H$, acting on the spin/spinorial wavefunctions (so, not on the orbital part). As usual, the default is atomic units. @@ -23023,33 +24610,35 @@ Note that Tesla are admitted, despite the fact that this is not the proper unit for a $H$ field. Actually, if you specify "Tesla", ABINIT will set $\mu_0H$ in Tesla, so that H will be in Amperes/metre. """, - ), - Variable( - abivarname="ziontypat", - varset="internal", - vartype="real", - topics=["AtomTypes_internal", "PseudosPAW_internal"], - dimensions=["[[ntypat]]"], - defaultval="[[AUTO_FROM_PSP]]", - mnemonics="Z (charge) of the IONs for the different TYPes of AToms", - characteristics=["[[INTERNAL_ONLY]]"], - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="ziontypat", + varset="internal", + vartype="real", + topics=["AtomTypes_internal", "PseudosPAW_internal"], + dimensions=["[[ntypat]]"], + defaultval="[[AUTO_FROM_PSP]]", + mnemonics="Z (charge) of the IONs for the different TYPes of AToms", + characteristics=["[[INTERNAL_ONLY]]"], + added_in_version="before_v9", + text=r""" Charge of the pseudo-ion (defined as the number of valence electrons that are needed to screen exactly the pseudopotential). """, - ), - Variable( - abivarname="zora", - varset="paw", - vartype="integer", - topics=["PAW_useful", "spinpolarisation_useful"], - dimensions="scalar", - defaultval="0", - mnemonics="Zeroth Order Regularized Approximation", - requires="[[usepaw]] == 1", - added_in_version="v10.5", - text=r""" +), + +Variable( + abivarname="zora", + varset="paw", + vartype="integer", + topics=["PAW_useful", "spinpolarisation_useful"], + dimensions="scalar", + defaultval="0", + mnemonics="Zeroth Order Regularized Approximation", + requires="[[usepaw]] == 1", + added_in_version="v10.5", + text=r""" ZORA is an effective approximation to the full Dirac equation, which delivers reasonable values for relativistic effects at modest cost [[cite:Autschbach2013]]. @@ -23063,21 +24652,23 @@ [[zora]] 3 activates both kinetic energy and electron spin terms. Negative values of [[zora]] are present only for debugging purposes. [[zora]] -1 permits only -spin-orbit coupling, regardless of the presence of nuclear dipoles. [[zora]] -2 permits only -the electron spin-nuclear dipole through space interaction, and [[zora]] -3 permits only the -electron spin-nuclear dipole Fermi-contact-like interaction. -""", - ), - Variable( - abivarname="znucl", - varset="basic", - vartype="real", - topics=["AtomTypes_compulsory", "PseudosPAW_compulsory"], - dimensions=["[[npsp]]"], - mnemonics="charge -Z- of the NUCLeus", - characteristics=["[[NO_MULTI]]"], - added_in_version="before_v9", - text=r""" +spin-orbit coupling, regardless of the presence of nuclear dipoles. [[zora]] -2 permits spin-orbit +coupling and the electron spin-nuclear dipole through space interaction, while [[zora]] -3 permits +only spin-orbit coupling and the electron spin-nuclear dipole Fermi-contact-like interaction. +""", +), + + +Variable( + abivarname="znucl", + varset="basic", + vartype="real", + topics=["AtomTypes_compulsory", "PseudosPAW_compulsory"], + dimensions=["[[npsp]]"], + mnemonics="charge -Z- of the NUCLeus", + characteristics=["[[NO_MULTI]]"], + added_in_version="before_v9", + text=r""" Gives nuclear charge for each type of pseudopotential, in order. If [[znucl]] does not agree with nuclear charge, as given in pseudopotential files, the program writes an error message and stops. @@ -23089,35 +24680,37 @@ For a "dummy" atom, with [[znucl]] = 0, as used in the case of calculations with only a jellium surface, ABINIT sets arbitrarily the covalent radius to one. """, - ), - Variable( - abivarname="tmesh", - varset="eph", - topics=["ElPhonInt_basic"], - vartype="real", - defaultval=[5.0, 59.0, 6.0], - dimensions=[3], - mnemonics="Temperature MESH", - added_in_version="8.7.3", - text=r""" +), + +Variable( + abivarname="tmesh", + varset="eph", + topics=["ElPhonInt_basic"], + vartype="real", + defaultval=[5.0, 59.0, 6.0], + dimensions=[3], + mnemonics="Temperature MESH", + added_in_version="8.7.3", + text=r""" This variable defines the linear mesh of temperatures used in the EPH code ([[optdriver]] = 7). The first entry gives the **initial** temperature in Kelvin, the second entry the **linear step** in Kelvin, the third entry is the **number of points** in the mesh. The default value corresponds to 6 points between 5 K and 300 K. """, - ), - Variable( - abivarname="prtkbff", - varset="files", - topics=["printing_prden"], - vartype="integer", - defaultval=0, - dimensions="scalar", - requires="[[iomode]] == 3", - mnemonics="PRinT Kleynman-Bylander Form Factors", - added_in_version="8.7.3", - text=r""" +), + +Variable( + abivarname="prtkbff", + varset="files", + topics=["printing_prden"], + vartype="integer", + defaultval=0, + dimensions="scalar", + requires="[[iomode]] == 3", + mnemonics="PRinT Kleynman-Bylander Form Factors", + added_in_version="8.7.3", + text=r""" This input variable activates the output of the Kleynman-Bylander form factors in the **netcdf** WFK file produced at the end of the ground-state calculation. Remember to set [[iomode]] to 3. @@ -23133,18 +24726,19 @@ since external codes do not support wavefunctions given on the reduced G-sphere. Moreover [[useylm]] must be 0 (default if NC pseudos). """, - ), - Variable( - abivarname="sigma_ngkpt", - varset="gw", - topics=["SelfEnergy_useful"], - vartype="integer", - defaultval=0, - dimensions=[3], - requires="[[optdriver]] in [4, 7]", - mnemonics="SIGMA: Number of Grid points for K PoinTs generation", - added_in_version="9.0.0", - text=r""" +), + +Variable( + abivarname="sigma_ngkpt", + varset="gw", + topics=["SelfEnergy_useful"], + vartype="integer", + defaultval=0, + dimensions=[3], + requires="[[optdriver]] in [4, 7]", + mnemonics="SIGMA: Number of Grid points for K PoinTs generation", + added_in_version="9.0.0", + text=r""" This variable allows the user to specify the list of k-points in the self-energy $\Sigma_{n\kk}$ in terms of a homogeneous mesh in the IBZ instead of the traditional approach based on [[nkptgw]], [[kptgw]], [[bdgw]]. @@ -23158,33 +24752,35 @@ sigma_ngkpt and [[nkptgw]] are mutually exclusive. """, - ), - Variable( - abivarname="sigma_nshiftk", - varset="gw", - topics=["SelfEnergy_useful"], - vartype="integer", - defaultval=0, - dimensions="scalar", - requires="[[optdriver]] in [4, 7] and [[sigma_shiftk]]", - mnemonics="SIGMA: Number of SHIFTs for K point grids", - added_in_version="9.0.0", - text=r""" +), + +Variable( + abivarname="sigma_nshiftk", + varset="gw", + topics=["SelfEnergy_useful"], + vartype="integer", + defaultval=0, + dimensions="scalar", + requires="[[optdriver]] in [4, 7] and [[sigma_shiftk]]", + mnemonics="SIGMA: Number of SHIFTs for K point grids", + added_in_version="9.0.0", + text=r""" The number of shifts in [[sigma_shiftk]]. """, - ), - Variable( - abivarname="sigma_shiftk", - varset="gw", - topics=["SelfEnergy_useful"], - vartype="integer", - defaultval=[0, 0, 0], - dimensions=[3, "[[sigma_nshiftk]]"], - requires="[[optdriver]] in [4, 7] and [[sigma_nshiftk]]", - mnemonics="SHIFT for K points", - excludes="[[sigma_erange]] or [[nkptgw]]", - added_in_version="9.0.0", - text=r""" +), + +Variable( + abivarname="sigma_shiftk", + varset="gw", + topics=["SelfEnergy_useful"], + vartype="integer", + defaultval=[0, 0, 0], + dimensions=[3, "[[sigma_nshiftk]]"], + requires="[[optdriver]] in [4, 7] and [[sigma_nshiftk]]", + mnemonics="SHIFT for K points", + excludes="[[sigma_erange]] or [[nkptgw]]", + added_in_version="9.0.0", + text=r""" The shifts of the k-mesh used to define the list of k-points for the computation of the electron self-energy $\Sigma_{n\kk}$. See also [[sigma_nshiftk]]. @@ -23193,18 +24789,19 @@ This variable is not compatible with [[nkptgw]] and [[sigma_erange]]. """, - ), - Variable( - abivarname="td_ef_type", - varset="rttddft", - topics=["RTTDDFT_useful"], - vartype="integer", - defaultval=0, - dimensions="scalar", - requires="[[optdriver]] is 9", - mnemonics="Time-Dependent Electric Field TYPE", - added_in_version="10", - text=r""" +), + +Variable( + abivarname="td_ef_type", + varset="rttddft", + topics=["RTTDDFT_useful"], + vartype="integer", + defaultval=0, + dimensions="scalar", + requires="[[optdriver]] is 9", + mnemonics="Time-Dependent Electric Field TYPE", + added_in_version="10", + text=r""" This variable controls the type of external electric field to apply in RT-TDDFT. As of now, only impulse electric field are implemented, [[td_ef_type]] is 1. Moreover, the response to such impulse electric field can only be performed @@ -23213,96 +24810,102 @@ applied are controlled by the parameters [[td_ef_ezero]] and [[td_ef_tzero]]. If [[td_ef_type]] is 0, no electric field is applied. """, - ), - Variable( - abivarname="td_ef_tzero", - varset="rttddft", - topics=["RTTDDFT_useful"], - vartype="integer", - defaultval=0.0, - dimensions="scalar", - requires="[[optdriver]] is 9 and [[td_ef_type]] is not 0", - mnemonics="Time-Dependent Electric Field TZERO", - added_in_version="10", - text=r""" +), + +Variable( + abivarname="td_ef_tzero", + varset="rttddft", + topics=["RTTDDFT_useful"], + vartype="integer", + defaultval=0.0, + dimensions="scalar", + requires="[[optdriver]] is 9 and [[td_ef_type]] is not 0", + mnemonics="Time-Dependent Electric Field TZERO", + added_in_version="10", + text=r""" This variable controls the time (in atomic units) at which the external electric field is applied (see [[td_ef_type]]). """, - ), - Variable( - abivarname="td_ef_ezero", - varset="rttddft", - topics=["RTTDDFT_useful"], - vartype="integer", - defaultval=0.1, - dimensions="scalar", - requires="[[optdriver]] is 9 and [[td_ef_type]] is not 0", - mnemonics="Time-Dependent Electric Field EZERO", - added_in_version="10", - text=r""" +), + +Variable( + abivarname="td_ef_ezero", + varset="rttddft", + topics=["RTTDDFT_useful"], + vartype="integer", + defaultval=0.1, + dimensions="scalar", + requires="[[optdriver]] is 9 and [[td_ef_type]] is not 0", + mnemonics="Time-Dependent Electric Field EZERO", + added_in_version="10", + text=r""" This variable is the intensity (in atomic units) of the external electric field applied (see [[td_ef_type]]). """, - ), - Variable( - abivarname="td_ef_pol", - varset="rttddft", - topics=["RTTDDFT_useful"], - vartype="integer", - defaultval=[1.0, 0.0, 0.0], - dimensions=[3], - requires="[[optdriver]] is 9 and [[td_ef_type]] is not 0", - mnemonics="Time-Dependent Electric Field POLarization", - added_in_version="10", - text=r""" +), + +Variable( + abivarname="td_ef_pol", + varset="rttddft", + topics=["RTTDDFT_useful"], + vartype="integer", + defaultval=[1.0, 0.0, 0.0], + dimensions=[3], + requires="[[optdriver]] is 9 and [[td_ef_type]] is not 0", + mnemonics="Time-Dependent Electric Field POLarization", + added_in_version="10", + text=r""" This variable is the polarization vector (direction) of the external electric field applied (see [[td_ef_type]]). """, - ), - Variable( - abivarname="td_ef_induced_vecpot", - varset="rttddft", - topics=["RTTDDFT_expert"], - vartype="integer", - defaultval=0, - dimensions="scalar", - requires="[[optdriver]] is 9 and [[td_ef_type]] is not 0", - mnemonics="Time-Dependent Electric Field INDUCED VECtor POTential", - added_in_version="10", - text=r""" +), + +Variable( + abivarname="td_ef_induced_vecpot", + varset="rttddft", + topics=["RTTDDFT_expert"], + vartype="integer", + defaultval=0, + dimensions="scalar", + requires="[[optdriver]] is 9 and [[td_ef_type]] is not 0", + mnemonics="Time-Dependent Electric Field INDUCED VECtor POTential", + added_in_version="10", + text=r""" This variable controls whether we include the induced vector potential in the Hamiltonian so that the total vector potential applied is the sum of the vector potential associated with the external electric field and the vector potential induced by the current density. """, - ), - Variable( - abivarname="td_exp_order", - varset="rttddft", - topics=["RTTDDFT_expert"], - vartype="integer", - defaultval=4, - dimensions="scalar", - requires="[[optdriver]] is 9", - mnemonics="Time-Dependent EXPonential ORDER", - added_in_version="10", - text=r""" +), + +Variable( + abivarname="td_exp_order", + varset="rttddft", + topics=["RTTDDFT_expert"], + vartype="integer", + defaultval=4, + dimensions="scalar", + requires="[[optdriver]] is 9", + mnemonics="Time-Dependent EXPonential ORDER", + added_in_version="10", + text=r""" This variable controls the order of the Taylor expansion used to approximate the exponential of an operator in the propagator for RT-TDDFT. The default value of 4 is usually a good choice that ensures good stability and acceptable computation time. """, - ), - Variable( - abivarname="td_propagator", - varset="rttddft", - topics=["RTTDDFT_useful"], - vartype="integer", - defaultval=0, - dimensions="scalar", - requires="[[optdriver]] is 9", - mnemonics="Time-Dependent PROPAGATOR", - added_in_version="10", - text=r""" +), + +Variable( + abivarname="td_propagator", + varset="rttddft", + topics=["RTTDDFT_useful"], + vartype="integer", + defaultval=0, + dimensions="scalar", + requires="[[optdriver]] is 9", + mnemonics="Time-Dependent PROPAGATOR", + added_in_version="10", + text=r""" This variable controls the propagation algorithm used to integrate the time-dependent Kohn-Sham equations in real-time TDDFT. At present only the exponential rule, [[td_propagator]] is 0, and the exponential mid-point rule, [[td_propagator]] is 1, @@ -23312,181 +24915,189 @@ the code uses a predictor-corrector scheme associated with two parameters [[td_scnmax]] and [[td_scthr]]. """, - ), - Variable( - abivarname="td_prtstr", - varset="rttddft", - topics=["RTTDDFT_useful"], - vartype="integer", - defaultval=1, - dimensions="scalar", - requires="[[optdriver]] is 9", - mnemonics="Time-Dependent PRinT STRide", - added_in_version="10", - text=r""" +), + +Variable( + abivarname="td_prtstr", + varset="rttddft", + topics=["RTTDDFT_useful"], + vartype="integer", + defaultval=1, + dimensions="scalar", + requires="[[optdriver]] is 9", + mnemonics="Time-Dependent PRinT STRide", + added_in_version="10", + text=r""" This variable controls how often the code outputs various physical properties (DOS, occupations, current density etc.). The code will write these properties in files every [[td_prtstr]] time step. """, - ), - Variable( - abivarname="td_restart", - varset="rttddft", - topics=["RTTDDFT_useful"], - vartype="integer", - defaultval=0, - dimensions="scalar", - requires="[[optdriver]] is 9", - mnemonics="Time-Dependent calculation RESTART", - added_in_version="10", - text=r""" +), + +Variable( + abivarname="td_restart", + varset="rttddft", + topics=["RTTDDFT_useful"], + vartype="integer", + defaultval=0, + dimensions="scalar", + requires="[[optdriver]] is 9", + mnemonics="Time-Dependent calculation RESTART", + added_in_version="10", + text=r""" This variable controls whether we are restarting a RTTDDFT run. If [[td_restart]] is 0 the calculation starts from scratch, if it is set to 1 than ABINIT will read the file called TD_RESTART that contains some information in order to continue the previous RTTDDFT calculation. """, - ), - Variable( - abivarname="td_scnmax", - varset="rttddft", - topics=["RTTDDFT_expert"], - vartype="integer", - defaultval=6, - dimensions="scalar", - requires="[[optdriver]] is 9 and [[td_propagator]] is 1", - mnemonics="Time-Dependent Self-Consistent NMAX", - added_in_version="10", - text=r""" +), + +Variable( + abivarname="td_scnmax", + varset="rttddft", + topics=["RTTDDFT_expert"], + vartype="integer", + defaultval=6, + dimensions="scalar", + requires="[[optdriver]] is 9 and [[td_propagator]] is 1", + mnemonics="Time-Dependent Self-Consistent NMAX", + added_in_version="10", + text=r""" This variable controls the maximum number of self-consistent corrector step in the predictor-corrector scheme ([[td_propagator]] equal to 1). """, - ), - Variable( - abivarname="td_scthr", - varset="rttddft", - topics=["RTTDDFT_expert"], - vartype="integer", - defaultval=1e-7, - dimensions="scalar", - requires="[[optdriver]] is 9 and [[td_propagator]] is 1", - mnemonics="Time-Dependent propagation Self-Consistent THReshold", - added_in_version="10", - text=r""" +), + +Variable( + abivarname="td_scthr", + varset="rttddft", + topics=["RTTDDFT_expert"], + vartype="integer", + defaultval=1e-7, + dimensions="scalar", + requires="[[optdriver]] is 9 and [[td_propagator]] is 1", + mnemonics="Time-Dependent propagation Self-Consistent THReshold", + added_in_version="10", + text=r""" This variable controls the threshold used to define the convergence of the self-consistent predictor-corrector scheme ([[td_propagator]] equal to 1). """, - ), - Variable( - abivarname="wfk_task", - varset="gstate", - topics=["ElecBandStructure_useful"], - vartype="string", - defaultval=0, - dimensions="scalar", - requires="[[optdriver]] == 8", - mnemonics="WaveFunction at K TASK", - added_in_version="9.0.0", - text=r""" +), + +Variable( + abivarname="wfk_task", + varset="gstate", + topics=["ElecBandStructure_useful"], + vartype="string", + defaultval=0, + dimensions="scalar", + requires="[[optdriver]] == 8", + mnemonics="WaveFunction at K TASK", + added_in_version="9.0.0", + text=r""" This variable defines the quantity that should be computed starting from a previously generated WFK file. Possible values are: - * "wfk_fullbz" --> Read input WFK file and produce new WFK file with $\kk$-points in the full BZ. - Wavefunctions with [[istwfk]] > 2 are automatically converted into the full G-sphere representation. - This option can be used to interface Abinit with external tools (e.g. lobster) requiring $\kk$-points in the full BZ. - Use [[iomode]] = 3 and [[prtkbff]] = 1 to produce a WFK file in netcdf format with Kleynmann-Bylander form factors. - - * "wfk_einterp" --> Read energies from WFK file and interpolate the band structure with the modified SKW method [[cite:Pickett1988]], - using the parameters specified by [[einterp]]. - - * "wfk_ddk" --> Compute velocity matrix elements for all bands and $\kk$-points found the input WFK file. - The code generates three `_EVK.nc` netcdf files with the matrix element of the $\frac{d}{d{\kk_i}}$ - operator using the same list of $\kk$-points found in the input WFK file i.e. the same value of [[kptopt]]. - These files can then be passed to optics via the `ddkfile_1, ddkfile_2, ddkfile_3` variables - without having to call the DFPT part that is much more expensive at the level of memory. - - Please note that, at present, the computation of non-linear optical properties in optic requires - [[kptopt]] = 3 i.e. $\kk$-points in the full BZ whereas the computation of linear optical properties - can take advantage of spatial and time-reversal symmetries. - If you use **wfk_ddk** to generate input files for optics, please make sure that your input WFK file - has the correct value of [[kptopt]] according to the physical properties you want to compute. - - In other words, don't use a WFK with [[kptopt]] != 3 if you plan to compute non-linear optical properties. - To work around the limitation of the non-linear part of optics, one can use "wfk_optics_fullbz" - to generate WKF and EVK files in the full BZ starting from a WFK defined in the IBZ. - - * "wfk_optics_fullbz" --> Similar to "wfk_ddk" but accepts a WFK with wavefunctions in the IBZ - and generates a new WFK and three `_EVK.nc` files with $\kk$-points in the full BZ. - This procedure is equivalent to performing a NSCF + DDK calculation with [[kptopt]] = 3 as documented - in the tutorial [[tutorial:optic]] for non-linear optical properties but it is much faster and, most importantly, - less memory demanding. - - * "wfk_kpts_erange" --> Read WFK file, use star-function and [[einterp]] parameters to interpolate - electron energies onto fine k-mesh defined by [[sigma_ngkpt]] and [[sigma_shiftk]]. - Find k-points inside (electron/hole) pockets according to the values specified by [[sigma_erange]]. - Write KERANGE.nc file with all the tables required by the code to automate NSCF band structure calculations - inside the pocket(s) and electron lifetime computation in the EPH code when [[eph_task]] = -4. - - * "wannier" --> Read WFK file and run Wannierization. It has the similar effect of - [[prtwant]] = 2, which uses the **ABINIT- Wannier90** interface. The difference is that with wfk_task "wannier", - the $\kk$-points in the full BZ is not necessary. Instead, the wavefunctions with the $\kk$-points not in - the IBZ will be reconstructed by symmetry. This functionality does not yet work with PAW when the wavefunction - is not already in full BZ. - - ABINIT will produce the input files required by Wannier90 and it will run - Wannier90 to produce the Maximally-locallized Wannier functions (see [ - http://www.wannier.org ](http://www.wannier.org) ). - !!! Notes - - * The files that are created can also be used by Wannier90 in stand-alone mode. - * In order to use Wannier90 as a post-processing program for ABINIT you might have to - compile it with the appropriate flags (see ABINIT makefile). You might use ./configure --enable-wannier90 - * There are some other variables related to the interface of Wannier90 and ABINIT. See [[varset:w90]]. -""", - ), - Variable( - abivarname="sigma_bsum_range", - varset="gw", - topics=["SelfEnergy_expert"], - vartype="integer", - defaultval=[0, 0], - dimensions=[2], - requires="[[optdriver]] in [7]", - mnemonics="SIGMA: Band SUM RANGE", - added_in_version="9.0.0", - text=r""" +* "wfk_fullbz" --> Read input WFK file and produce new WFK file with $\kk$-points in the full BZ. + Wavefunctions with [[istwfk]] > 2 are automatically converted into the full G-sphere representation. + This option can be used to interface Abinit with external tools (e.g. lobster) requiring $\kk$-points in the full BZ. + Use [[iomode]] = 3 and [[prtkbff]] = 1 to produce a WFK file in netcdf format with Kleynmann-Bylander form factors. + +* "wfk_einterp" --> Read energies from WFK file and interpolate the band structure with the modified SKW method [[cite:Pickett1988]], + using the parameters specified by [[einterp]]. + +* "wfk_ddk" --> Compute velocity matrix elements for all bands and $\kk$-points found the input WFK file. + The code generates three `_EVK.nc` netcdf files with the matrix element of the $\frac{d}{d{\kk_i}}$ + operator using the same list of $\kk$-points found in the input WFK file i.e. the same value of [[kptopt]]. + These files can then be passed to optics via the `ddkfile_1, ddkfile_2, ddkfile_3` variables + without having to call the DFPT part that is much more expensive at the level of memory. + + Please note that, at present, the computation of non-linear optical properties in optic requires + [[kptopt]] = 3 i.e. $\kk$-points in the full BZ whereas the computation of linear optical properties + can take advantage of spatial and time-reversal symmetries. + If you use **wfk_ddk** to generate input files for optics, please make sure that your input WFK file + has the correct value of [[kptopt]] according to the physical properties you want to compute. + + In other words, do not use a WFK with [[kptopt]] != 3 if you plan to compute non-linear optical properties. + To work around the limitation of the non-linear part of optics, one can use "wfk_optics_fullbz" + to generate WKF and EVK files in the full BZ starting from a WFK defined in the IBZ. + +* "wfk_optics_fullbz" --> Similar to "wfk_ddk" but accepts a WFK with wavefunctions in the IBZ + and generates a new WFK and three `_EVK.nc` files with $\kk$-points in the full BZ. + This procedure is equivalent to performing a NSCF + DDK calculation with [[kptopt]] = 3 as documented + in the tutorial [[tutorial:optic]] for non-linear optical properties but it is much faster and, most importantly, + less memory demanding. + +* "wfk_kpts_erange" --> Read WFK file, use star-function and [[einterp]] parameters to interpolate + electron energies onto fine k-mesh defined by [[sigma_ngkpt]] and [[sigma_shiftk]]. + Find k-points inside (electron/hole) pockets according to the values specified by [[sigma_erange]]. + Write KERANGE.nc file with all the tables required by the code to automate NSCF band structure calculations + inside the pocket(s) and electron lifetime computation in the EPH code when [[eph_task]] = -4. + +* "wannier" --> Read WFK file and run Wannierization. It has the similar effect of + [[prtwant]] = 2, which uses the **ABINIT- Wannier90** interface. The difference is that with wfk_task "wannier", + the $\kk$-points in the full BZ is not necessary. Instead, the wavefunctions with the $\kk$-points not in + the IBZ will be reconstructed by symmetry. This functionality does not yet work with PAW when the wavefunction + is not already in full BZ. + + ABINIT will produce the input files required by Wannier90 and it will run + Wannier90 to produce Maximally-locallized Wannier functions (see [http://www.wannier.org](http://www.wannier.org)). + + !!! Notes + + * The files that are created can also be used by Wannier90 in stand-alone mode. + * In order to use Wannier90 as a post-processing program for ABINIT you might have to + compile it with the appropriate flags (see ABINIT makefile). You might use ./configure --enable-wannier90 + * There are some other variables related to the interface of Wannier90 and ABINIT. See [[varset:w90]]. +""", +), + +Variable( + abivarname="sigma_bsum_range", + varset="gw", + topics=["SelfEnergy_expert"], + vartype="integer", + defaultval=[0, 0], + dimensions=[2], + requires="[[optdriver]] in [7]", + mnemonics="SIGMA: Band SUM RANGE", + added_in_version="9.0.0", + text=r""" This variable allows the user to specify the range of bands in the sum over states for the e-ph self-energy $\Sigma_{n\kk}$. If not specified, the code includes all the states from 1 up to [[nband]]. Note that this option can be used only when computing both the real and imaginary part of the self-energy. In the calculation of electron linewidths, indeed, the states are automatically selected using an energy window that takes into account the maximum phonon frequency. """, - ), - Variable( - abivarname="prteliash", - varset="eph", - topics=["SelfEnergy_expert"], - vartype="integer", - defaultval=0, - dimensions="scalar", - requires="[[optdriver]] in [7]", - mnemonics="PRINT ELIASHberg function.", - added_in_version="9.0.0", - text=r""" +), + +Variable( + abivarname="prteliash", + varset="eph", + topics=["SelfEnergy_expert"], + vartype="integer", + defaultval=0, + dimensions="scalar", + requires="[[optdriver]] in [7]", + mnemonics="PRINT ELIASHberg function.", + added_in_version="9.0.0", + text=r""" This variable controls the output of the generalized Eliashberg function when [[eph_task]] is +4 or -4. If set 1, the EPH code will compute the generalized Eliashberg function and will save the results in the SIGEPH.nc file. """, - ), - Variable( - abivarname="sigma_erange", - varset="eph", - topics=["SelfEnergy_expert"], - vartype="real", - defaultval=[0.0, 0.0], - dimensions=[2], - mnemonics="SIGMA Energy-range.", - characteristics=["[[ENERGY]]"], - added_in_version="9.0.0", - text=r""" +), + +Variable( + abivarname="sigma_erange", + varset="eph", + topics=["SelfEnergy_expert"], + vartype="real", + defaultval=[0.0, 0.0], + dimensions=[2], + mnemonics="SIGMA Energy-range.", + characteristics=["[[ENERGY]]"], + added_in_version="9.0.0", + text=r""" This variable consists of two entries that allow one to select the k-points and the bands in the e-ph self-energy $\Sigma_\nk$ on the basis of their KS energy $\ee_\nk$. This variable is used in [[eph_task]] = -4 to compute phonon-limited mobilities in the energy region relevant for transport. @@ -23510,33 +25121,35 @@ to specify the energy intervals in eV units. meV is supported as well. """, - ), - Variable( - abivarname="eph_tols_idelta", - varset="eph", - topics=["SelfEnergy_expert"], - vartype="real", - defaultval=[1e-12, 1e-12], - dimensions=[2], - mnemonics="EPH TOLeranceS on Integral of DELTA.", - added_in_version="9.0.0", - text=r""" +), + +Variable( + abivarname="eph_tols_idelta", + varset="eph", + topics=["SelfEnergy_expert"], + vartype="real", + defaultval=[1e-12, 1e-12], + dimensions=[2], + mnemonics="EPH TOLeranceS on Integral of DELTA.", + added_in_version="9.0.0", + text=r""" This variable can be used to introduce a cutoff on the q-points when computing the imaginary part of the electron-phonon self-energy ([[eph_task]] = -4) with the tetrahedron method ([[eph_intmeth]] = 2). The first entry refers to phonon absorption while the second one is associated to phonon emission. A q-point is included in the sum of the tetrahedron weights for phonon absorption/emission are larger that these values. """, - ), - Variable( - abivarname="eph_phrange", - varset="eph", - topics=["SelfEnergy_expert"], - vartype="integer", - defaultval=[0, 0], - dimensions=[2], - mnemonics="EPH PHonon mode RANGE.", - added_in_version="9.0.0", - text=r""" +), + +Variable( + abivarname="eph_phrange", + varset="eph", + topics=["SelfEnergy_expert"], + vartype="integer", + defaultval=[0, 0], + dimensions=[2], + mnemonics="EPH PHonon mode RANGE.", + added_in_version="9.0.0", + text=r""" This variable is used to select the range of phonon indices included in the computation of the electron-phonon self-energy. By default all phonon indices are included ([0, 0]), otherwise only the phonon indices between the first @@ -23554,18 +25167,19 @@ At each q-point, indeed, phonons are ordered according to their energy. and this order does not necessarily reflect the connection of the energy branch in q-space. """, - ), - Variable( - abivarname="eph_phrange_w", - varset="eph", - topics=["SelfEnergy_expert"], - vartype="real", - defaultval=[0, 0], - dimensions=[2], - mnemonics="EPH PHonon mode RANGE (Frequency)", - characteristics=["[[ENERGY]]"], - added_in_version="9.6.2", - text=r""" +), + +Variable( + abivarname="eph_phrange_w", + varset="eph", + topics=["SelfEnergy_expert"], + vartype="real", + defaultval=[0, 0], + dimensions=[2], + mnemonics="EPH PHonon mode RANGE (Frequency)", + characteristics=["[[ENERGY]]"], + added_in_version="9.6.2", + text=r""" This variable is used to include/exclude phonon modes in the computation of the electron-phonon self-energy on the basis of the vibrational energy instead of the index as done in [[eph_phrange]]. The usage of [[eph_phrange_w]] is recommended especially if there are crossings in the phonon band structure. @@ -23582,18 +25196,19 @@ This variable has the [[ENERGY]] characteristics so the code assume Hartree units by default. """, - ), - Variable( - abivarname="transport_ngkpt", - varset="eph", - topics=["SelfEnergy_expert"], - vartype="integer", - defaultval=[0, 0, 0], - dimensions=[3], - requires="[[optdriver]] == 7 and [[eph_task]] in [-4,7]", - mnemonics="TRANSPORT: Number of Grid points for K PoinTs integration in transport computations", - added_in_version="9.0.0", - text=r""" +), + +Variable( + abivarname="transport_ngkpt", + varset="eph", + topics=["SelfEnergy_expert"], + vartype="integer", + defaultval=[0, 0, 0], + dimensions=[3], + requires="[[optdriver]] == 7 and [[eph_task]] in [-4,7]", + mnemonics="TRANSPORT: Number of Grid points for K PoinTs integration in transport computations", + added_in_version="9.0.0", + text=r""" This in an advanced option that is mainly used to downsample the k-points used to compute the carrier mobility obtained with ([[eph_task]] = -4 or [[eph_task]] = 7). @@ -23603,17 +25218,18 @@ For instance one may have performed a calculation with a 100x100x100 k-mesh and may be interested in the values obtained with a 50x50x50 without having to perform a full lifetime calculation on a 50x50x50 from scratch. """, - ), - Variable( - abivarname="ibte_abs_tol", - varset="eph", - topics=["ElPhonInt_expert"], - vartype="real", - defaultval=-1.0, - dimensions="scalar", - mnemonics="Iterative Boltzmann Equation: ABSolute TOLerance for convergence", - added_in_version="9.3.0", - text=r""" +), + +Variable( + abivarname="ibte_abs_tol", + varset="eph", + topics=["ElPhonInt_expert"], + vartype="real", + defaultval=-1.0, + dimensions="scalar", + mnemonics="Iterative Boltzmann Equation: ABSolute TOLerance for convergence", + added_in_version="9.3.0", + text=r""" This variable defines the absolute tolerance used to stop the iterative solution of the Boltzmann equation. The code stops the iterations when $$ \max_\kk |{\bm F}_\kk^i - {\bm F}_\kk^{i-1}| $$ is less than [[ibte_abs_tol]] where $${\bm F}_\kk^i$$ is the solution at iteration step i. @@ -23630,44 +25246,47 @@ According to numerical tests, a reasonable value of [[ibte_abs_tol]] can be estimated using 1e-20 * carrier_density in cm^-3. """, - ), - Variable( - abivarname="ibte_alpha_mix", - varset="eph", - topics=["ElPhonInt_expert"], - vartype="real", - defaultval=0.7, - dimensions="scalar", - mnemonics="Iterative Boltzmann Equation: ALPHA Mixing factor", - added_in_version="9.3.0", - text=r""" +), + +Variable( + abivarname="ibte_alpha_mix", + varset="eph", + topics=["ElPhonInt_expert"], + vartype="real", + defaultval=0.7, + dimensions="scalar", + mnemonics="Iterative Boltzmann Equation: ALPHA Mixing factor", + added_in_version="9.3.0", + text=r""" This variable defines the coefficient for the linear mixing used in the IBTE solver. If the algorithm has problems to converge try to decrease [[ibte_alpha_mix]] and increase [[ibte_niter]]. """, - ), - Variable( - abivarname="ibte_niter", - varset="eph", - topics=["ElPhonInt_useful"], - vartype="integer", - defaultval=100, - dimensions="scalar", - mnemonics="Iterative Boltzmann Equation: max Number of ITERations", - added_in_version="9.3.0", - text=r""" +), + +Variable( + abivarname="ibte_niter", + varset="eph", + topics=["ElPhonInt_useful"], + vartype="integer", + defaultval=100, + dimensions="scalar", + mnemonics="Iterative Boltzmann Equation: max Number of ITERations", + added_in_version="9.3.0", + text=r""" This variable defines the maximum number of iterations of the IBTE solver. """, - ), - Variable( - abivarname="ibte_prep", - varset="eph", - topics=["ElPhonInt_useful"], - vartype="integer", - defaultval=0, - dimensions="scalar", - mnemonics="Iterative Boltzmann Equation PREPare", - added_in_version="9.3.0", - text=r""" +), + +Variable( + abivarname="ibte_prep", + varset="eph", + topics=["ElPhonInt_useful"], + vartype="integer", + defaultval=0, + dimensions="scalar", + mnemonics="Iterative Boltzmann Equation PREPare", + added_in_version="9.3.0", + text=r""" This variable is used when computing the imaginary part of the e-ph self-energy ([[eph_task]] = - 4) to save the collision term to the SIGEPH file. This step is required for solving the iterative BTE. @@ -23680,17 +25299,18 @@ IBTE calculations cannot use [[sigma_ngkpt]] to donwsample the k-mesh. The k-mesh ([[ngkpt]] and the q-mesh [[eph_ngqpt_fine]] must be equal. """, - ), - Variable( - abivarname="eph_prtscratew", - varset="eph", - topics=["ElPhonInt_expert"], - vartype="integer", - defaultval=0, - dimensions="scalar", - mnemonics="EPH PRINT spectral decomposition of SCATTERING RATES as a function of omega phonon.", - added_in_version="9.6.7", - text=r""" +), + +Variable( + abivarname="eph_prtscratew", + varset="eph", + topics=["ElPhonInt_expert"], + vartype="integer", + defaultval=0, + dimensions="scalar", + mnemonics="EPH PRINT spectral decomposition of SCATTERING RATES as a function of omega phonon.", + added_in_version="9.6.7", + text=r""" This variable can be used to compute the spectral decomposition of the SERTA/MRTA scattering rates in terms of an integral over phonon frequencies: @@ -23704,20 +25324,22 @@ The delta function $\delta(\omega - \omega_{\qnu})$ is approximated with a gaussian of standard deviation [[ph_smear]] and the spectral decomposition is evaluated on a linear mesh of step [[ph_wstep]] covering the entire vibrational spectrum. """, - ), - Variable( - abivarname="eph_restart", - varset="eph", - topics=["ElPhonInt_basic"], - vartype="integer", - defaultval=0, - dimensions="scalar", - mnemonics="EPH RESTART.", - added_in_version="9.0.0", - text=r""" +), + +Variable( + abivarname="eph_restart", + varset="eph", + topics=["ElPhonInt_basic"], + vartype="integer", + defaultval=1, + dimensions="scalar", + mnemonics="EPH RESTART.", + added_in_version="9.0.0", + text=r""" This variable can be used to restart an EPH calculation. At present, this feature is supported only when computing the electron-phonon self-energy ([[eph_task]] = 4, -4) -and solving the variational polaron equations ([[eph_task]] = 13). +or when solving the variational polaron equations ([[eph_task]] = 13). +or when computing the GSTORE.nc file ([[eph_task]] 11, 17), In the first case, the code will look for a **pre-existing** SIGEPH.nc file and will compute the remaining k-points. Note that the restart in done **in-place** that is the output SIGEPH.nc is used as input of the calculation so there is no @@ -23725,23 +25347,29 @@ In the second case, the code will look for a **pre-existing** VPQ.nc file and continue the optimization process from the last iteration available in the netcdf file. +In this case the default value of [[eph_restart]] is 0, so restart must be activated explicitly in the input file + +In the third case, the code will look for a **pre-existing** GSTORE.nc file and continue the computation of the missing elements. +This feature is activated by default. + !!! note The code aborts if the metadata reported in the file netcdf is not compatible with the input file. """, - ), - Variable( - abivarname="eph_stern", - varset="eph", - vartype="integer", - topics=["ElPhonInt_expert"], - dimensions="scalar", - defaultval=0, - mnemonics="Electron-PHonon: use STERNheimer approach to replace sum over empty states.", - requires="[[tolwfr]] > 0", - added_in_version="9.0.0", - text=r""" +), + +Variable( + abivarname="eph_stern", + varset="eph", + vartype="integer", + topics=["ElPhonInt_expert"], + dimensions="scalar", + defaultval=0, + mnemonics="Electron-PHonon: use STERNheimer approach to replace sum over empty states.", + requires="[[tolwfr]] > 0", + added_in_version="9.0.0", + text=r""" This variable activates the Sternheimer method in the calculation of the e-ph self-energy ([[eph_task]] == 4) This technique replaces the explicit sum over empty states **above** [[nband]] with the NSCF computation of the first order derivative of the KS wavefunctions (actually @@ -23763,17 +25391,18 @@ Note however that the memory requirements and the computational cost of the Sternheimer solver increases with **nband** as this part is not yet parallelized. """, - ), - Variable( - abivarname="getkerange_filepath", - varset="eph", - vartype="string", - topics=["ElPhonInt_expert"], - dimensions="scalar", - defaultval=None, - mnemonics="KERANGE PATH", - added_in_version="9.0.0", - text=r""" +), + +Variable( + abivarname="getkerange_filepath", + varset="eph", + vartype="string", + topics=["ElPhonInt_expert"], + dimensions="scalar", + defaultval=None, + mnemonics="KERANGE PATH", + added_in_version="9.0.0", + text=r""" This variable defines the path of the external KERANGE.nc file with the list of k-points in the electron/hole pockets for semiconductors or the k-points within an energy window around the Fermi level as specified by [[sigma_erange]]. @@ -23783,34 +25412,36 @@ This file is generated by running a preliminary step with [[wfk_task]] = "wfk_kpts_erange". For an example, see [[test:v9_57]] """, - ), - Variable( - abivarname="symv1scf", - varset="eph", - vartype="integer", - topics=["ElPhonInt_expert"], - dimensions="scalar", - defaultval=0, - mnemonics="SYMmetrize V1 DFPT SCF potentials", - added_in_version="9.0.0", - text=r""" +), + +Variable( + abivarname="symv1scf", + varset="eph", + vartype="integer", + topics=["ElPhonInt_expert"], + dimensions="scalar", + defaultval=0, + mnemonics="SYMmetrize V1 DFPT SCF potentials", + added_in_version="9.0.0", + text=r""" If *symv1scf* is equal to 1, the spatial-symmetry on the first-order DFPT potentials is enforced every time a set of potentials in the BZ is reconstructed by symmetry starting from the initial values in the IBZ. This option is similar to [[symdynmat]] but it acts on the DFPT potentials instead of the dynamical matrix. """, - ), - Variable( - abivarname="dvdb_add_lr", - varset="eph", - vartype="integer", - topics=["ElPhonInt_expert"], - dimensions="scalar", - defaultval=1, - mnemonics="DVDB ADD Long-Range part when interpolating DFPT potentials.", - added_in_version="9.0.0", - text=r""" +), + +Variable( + abivarname="dvdb_add_lr", + varset="eph", + vartype="integer", + topics=["ElPhonInt_expert"], + dimensions="scalar", + defaultval=1, + mnemonics="DVDB ADD Long-Range part when interpolating DFPT potentials.", + added_in_version="9.0.0", + text=r""" This flag is used in the Fourier interpolation in q-space of the DFPT potentials. This option is similar to [[dipdip]] but it acts on the DFPT potentials instead of the dynamical matrix. @@ -23846,17 +25477,18 @@ 6: --> Use quadrupole part only. """, - ), - Variable( - abivarname="eph_np_pqbks", - varset="eph", - vartype="integer", - topics=["ElPhonInt_expert"], - dimensions=[5], - defaultval=0, - mnemonics="EPH Number of Processors for Perturbations, Q-points, Bands, K-points, Spin.", - added_in_version="9.1.0", - text=r""" +), + +Variable( + abivarname="eph_np_pqbks", + varset="eph", + vartype="integer", + topics=["ElPhonInt_expert"], + dimensions=[5], + defaultval=0, + mnemonics="EPH Number of Processors for Perturbations, Q-points, Bands, K-points, Spin.", + added_in_version="9.1.0", + text=r""" This variable defines the Cartesian grid of MPI processors used for EPH calculations. If not specified in the input, the code will generate this grid automatically using the total number of processors and the basic dimensions of the job computed at runtime. @@ -23924,17 +25556,18 @@ Other variables such as [[nppert]], [[npband]], [[npfft]], [[np_spkpt]] and [[paral_kgb]] are **not used** in the EPH subdriver. """, - ), - Variable( - abivarname="eph_use_ftinterp", - varset="eph", - vartype="integer", - topics=["ElPhonInt_expert"], - dimensions="scalar", - defaultval=0, - mnemonics="EPH FORCE Fourier Transform Interpolation of DFPT potentials.", - added_in_version="9.0.0", - text=r""" +), + +Variable( + abivarname="eph_use_ftinterp", + varset="eph", + vartype="integer", + topics=["ElPhonInt_expert"], + dimensions="scalar", + defaultval=0, + mnemonics="EPH FORCE Fourier Transform Interpolation of DFPT potentials.", + added_in_version="9.0.0", + text=r""" This is an *advanced option* used for testing/debugging the interpolation of the DFPT potentials when [[eph_task]] in (2, -2). By default, the code seeks for the q-point in the input DVDB file when *eph_use_ftinterp* is set to zero (default) and stops is the q-point in not found in the file. @@ -23942,147 +25575,175 @@ will be used to generate the real-space representation of the DFPT potentials and interpolate the potential at the input [[qpt]]. """, - ), - Variable( - abivarname="getpot_filepath", - varset="files", - vartype="string", - topics=["multidtset_useful"], - dimensions="scalar", - defaultval=None, - mnemonics="GET the KS POTential from FILEPATH", - added_in_version="9.0.0", - text=r""" +), + +Variable( + abivarname="getpot_filepath", + varset="files", + vartype="string", + topics=["multidtset_useful"], + dimensions="scalar", + defaultval=None, + mnemonics="GET the KS POTential from FILEPATH", + added_in_version="9.0.0", + text=r""" This variable defines the path of the POT file containing the KS ground-state potential that should be used in input. At present, it is mainly used in the EPH code when performing calculation with the Sternheimer equation. Note that the path must be inserted between quotation marks. Note also that relative paths are interpreted according to the working directory in which Abinit is executed! """, - ), - Variable( - abivarname="getwfk_filepath", - varset="files", - vartype="string", - topics=["multidtset_useful"], - dimensions="scalar", - defaultval=None, - mnemonics="GET the wavefunctions from WFK PATH", - added_in_version="9.0.0", - text=r""" +), + +Variable( + abivarname="getwfk_filepath", + varset="files", + vartype="string", + topics=["multidtset_useful"], + dimensions="scalar", + defaultval=None, + mnemonics="GET the wavefunctions from WFK PATH", + added_in_version="9.0.0", + text=r""" Specify the path of the WFK file using a string instead of the dataset index. Alternative to [[getwfk]] and [[irdwfk]]. The string must be enclosed between quotation marks: getwfk_filepath "../outdata/out_WFK" -""", - ), - Variable( - abivarname="getwfkfine_filepath", - varset="files", - vartype="string", - topics=["multidtset_useful"], - dimensions="scalar", - defaultval=None, - mnemonics="GET the fine wavefunctions from FILEPATH", - added_in_version="9.0.0", - text=r""" +""" +), + + +Variable( + abivarname="getwfkfine_filepath", + varset="files", + vartype="string", + topics=["multidtset_useful"], + dimensions="scalar", + defaultval=None, + mnemonics="GET the fine wavefunctions from FILEPATH", + added_in_version="9.0.0", + text=r""" Specify the path of the fine WFK file using a string instead of the dataset index. Alternative to [[getwfkfine]] and [[irdwfkfine]]. The string must be enclosed between quotation marks: getwfkfine_filepath "../outdata/out_WFK" -""", - ), - Variable( - abivarname="getwfq_filepath", - varset="files", - vartype="string", - topics=["multidtset_useful"], - dimensions="scalar", - defaultval=None, - mnemonics="GET the k+q wavefunctions from WFQ PATH", - added_in_version="9.0.0", - text=r""" +""" +), + + +Variable( + abivarname="getwfmq_filepath", + varset="files", + vartype="string", + topics=["multidtset_useful"], + dimensions="scalar", + defaultval=None, + mnemonics="GET the k-q wavefunctions from WFQ PATH", + added_in_version="10.4", + text=r""" +Eventually used when [[tim1rev]]=0 to specify the path of the k-q WFQ file using a string instead of the dataset index. +Alternative to [[getwfmq]] and [[irdwfmq]]. The string must be enclosed between quotation marks: + + getwfmq_filepath "../outdata/out_WFQ" +""" +), + +Variable( + abivarname="getwfq_filepath", + varset="files", + vartype="string", + topics=["multidtset_useful"], + dimensions="scalar", + defaultval=None, + mnemonics="GET the k+q wavefunctions from WFQ PATH", + added_in_version="9.0.0", + text=r""" Specify the path of the WFQ file using a string instead of the dataset index. Alternative to [[getwfq]] and [[irdwfq]]. The string must be enclosed between quotation marks: getwfq_filepath "../outdata/out_WFQ" -""", - ), - Variable( - abivarname="getddb_filepath", - varset="files", - vartype="string", - topics=["multidtset_useful"], - dimensions="scalar", - defaultval="None", - mnemonics="GET the DDB from FILEPATH", - added_in_version="9.0.0", - text=r""" +""" +), + +Variable( + abivarname="getddb_filepath", + varset="files", + vartype="string", + topics=["multidtset_useful"], + dimensions="scalar", + defaultval="None", + mnemonics="GET the DDB from FILEPATH", + added_in_version="9.0.0", + text=r""" Specify the path of the DDB file using a string instead of the dataset index. Alternative to [[getddb]] and [[irdddb]]. The string must be enclosed between quotation marks: getddb_filepath "../outdata/out_DDB" -""", - ), - Variable( - abivarname="getdvdb_filepath", - varset="files", - vartype="string", - topics=["multidtset_useful"], - dimensions="scalar", - defaultval=None, - mnemonics="GET the DVDB file from FILEPATH", - added_in_version="9.0.0", - text=r""" +""" +), + +Variable( + abivarname="getdvdb_filepath", + varset="files", + vartype="string", + topics=["multidtset_useful"], + dimensions="scalar", + defaultval=None, + mnemonics="GET the DVDB file from FILEPATH", + added_in_version="9.0.0", + text=r""" Specify the path of the DVDB file using a string instead of the dataset index. Alternative to [[getdvdb]] and [[irddvdb]]. The string must be enclosed between quotation marks: getdvdb_filepath "../outdata/out_DVDB" -""", - ), - Variable( - abivarname="getden_filepath", - varset="files", - vartype="string", - topics=["multidtset_useful"], - dimensions="scalar", - defaultval=None, - mnemonics="GET the DEN file from FILEPATH", - added_in_version="9.0.0", - text=r""" +""" +), + +Variable( + abivarname="getden_filepath", + varset="files", + vartype="string", + topics=["multidtset_useful"], + dimensions="scalar", + defaultval=None, + mnemonics="GET the DEN file from FILEPATH", + added_in_version="9.0.0", + text=r""" Specify the path of the DEN file using a string instead of the dataset index. Alternative to [[getden]] and [[irdden]]. The string must be enclosed between quotation marks: getden_filepath "../outdata/out_DEN" -""", - ), - Variable( - abivarname="getscr_filepath", - varset="files", - vartype="string", - topics=["multidtset_useful"], - dimensions="scalar", - defaultval=None, - mnemonics="GET the SCR file from FILEPATH", - added_in_version="9.0.0", - text=r""" +""" +), + +Variable( + abivarname="getscr_filepath", + varset="files", + vartype="string", + topics=["multidtset_useful"], + dimensions="scalar", + defaultval=None, + mnemonics="GET the SCR file from FILEPATH", + added_in_version="9.0.0", + text=r""" Specify the path of the SCR file using a string instead of the dataset index. Alternative to [[getscr]] and [[irdscr]]. The string must be enclosed between quotation marks: getscr_filepath "../outdata/out_SCR" -""", - ), - Variable( - abivarname="eph_ecutosc", - varset="eph", - vartype="real", - topics=["ElPhonInt_expert"], - dimensions="scalar", - defaultval="0.0 Hartree", - mnemonics="Electron-Phonon: Energy CUToff for OSCillator matrix elements", - characteristics=["[[ENERGY]]"], - added_in_version="9.0.0", - text=r""" +""" +), + +Variable( + abivarname="eph_ecutosc", + varset="eph", + vartype="real", + topics=["ElPhonInt_expert"], + dimensions="scalar", + defaultval="0.0 Hartree", + mnemonics="Electron-Phonon: Energy CUToff for OSCillator matrix elements", + characteristics=["[[ENERGY]]"], + added_in_version="9.0.0", + text=r""" This variable defines the energy cutoff defining the number of G-vectors in the oscillator matrix elements: $$ \langle \mathbf{k+q},b_1 | e^{+i (\mathbf{q+G)} \mathbf{r}} | \mathbf{k}, b_2 \rangle $$ @@ -24102,17 +25763,18 @@ This variable is still under development! """, - ), - Variable( - abivarname="output_file", - varset="files", - vartype="string", - topics=["Control_useful"], - dimensions="scalar", - defaultval=None, - mnemonics="OUTPUT FILE", - added_in_version="9.0.0", - text=r""" +), + +Variable( + abivarname="output_file", + varset="files", + vartype="string", + topics=["Control_useful"], + dimensions="scalar", + defaultval=None, + mnemonics="OUTPUT FILE", + added_in_version="9.0.0", + text=r""" String specifying the name of the main output file when Abinit is executed with the new syntax: @@ -24125,18 +25787,19 @@ output_file "t01.out" with the string enclosed between double quotation marks. -""", - ), - Variable( - abivarname="indata_prefix", - varset="files", - vartype="string", - topics=["Control_useful"], - dimensions="scalar", - defaultval=None, - mnemonics="INput DATA PREFIX", - added_in_version="9.0.0", - text=r""" +""" +), + +Variable( + abivarname="indata_prefix", + varset="files", + vartype="string", + topics=["Control_useful"], + dimensions="scalar", + defaultval=None, + mnemonics="INput DATA PREFIX", + added_in_version="9.0.0", + text=r""" Prefix for input files. Replaces the analogous entry in the obsolete *files_file* . This variable is used when Abinit is executed with the new syntax: @@ -24145,18 +25808,19 @@ If this option is not specified, a prefix is automatically constructed from the input file name provided the filename ends with an extension, e.g. `.ext`. (`.abi` is recommended) If the input filename does not have a file extension, a default is provided. -""", - ), - Variable( - abivarname="outdata_prefix", - varset="files", - vartype="string", - topics=["Control_useful"], - dimensions="scalar", - defaultval=None, - mnemonics="OUTput DATA PREFIX", - added_in_version="9.0.0", - text=r""" +""" +), + +Variable( + abivarname="outdata_prefix", + varset="files", + vartype="string", + topics=["Control_useful"], + dimensions="scalar", + defaultval=None, + mnemonics="OUTput DATA PREFIX", + added_in_version="9.0.0", + text=r""" Prefix for output files. Replaces the analogous entry in the obsolete *files_file* . This variable is used when Abinit is executed with the new syntax: @@ -24165,18 +25829,19 @@ If this option is not specified, a prefix is automatically constructed from the input file name provided the filename ends with an extension, e.g. `.ext`. (`.abi` is recommended) If the input filename does not have a file extension, a default is provided. -""", - ), - Variable( - abivarname="tmpdata_prefix", - varset="files", - vartype="string", - topics=["Control_useful"], - dimensions="scalar", - defaultval=None, - mnemonics="TeMPorary DATA PREFIX", - added_in_version="9.0.0", - text=r""" +""" +), + +Variable( + abivarname="tmpdata_prefix", + varset="files", + vartype="string", + topics=["Control_useful"], + dimensions="scalar", + defaultval=None, + mnemonics="TeMPorary DATA PREFIX", + added_in_version="9.0.0", + text=r""" Prefix for temporary files. Replaces the analogous entry in the obsolete *files_file* . This variable is used when Abinit is executed with the new syntax: @@ -24186,18 +25851,19 @@ provided the filename ends with an extension, e.g. `.ext`. If the input filename does not have a file extension, a default is provided. -""", - ), - Variable( - abivarname="pp_dirpath", - varset="files", - vartype="string", - topics=["Control_useful"], - dimensions="scalar", - defaultval="", - mnemonics="PseudoPotential DIRectory PATH", - added_in_version="9.0.0", - text=r""" +""" +), + +Variable( + abivarname="pp_dirpath", + varset="files", + vartype="string", + topics=["Control_useful"], + dimensions="scalar", + defaultval="", + mnemonics="PseudoPotential DIRectory PATH", + added_in_version="9.0.0", + text=r""" This variable specifies the directory that will be prepended to the names of the pseudopotentials specified in [[pseudos]]. This option is useful when all your pseudos are gathered in a single directory in your file system @@ -24213,18 +25879,19 @@ pseudos "al.psp8, as.psp8" If [[pp_dirpath]] is not present, the filenames specified in [[pseudos]] are used directly. -""", - ), - Variable( - abivarname="supercell_latt", - varset="gstate", - vartype="integer", - topics=["UnitCell_useful"], - dimensions=[3], - defaultval=[1, 1, 1], - mnemonics="SUPERCELL LATTice", - added_in_version="before v9", - text=r""" +""" +), + +Variable( + abivarname="supercell_latt", + varset="gstate", + vartype="integer", + topics=["UnitCell_useful"], + dimensions=[3], + defaultval=[1, 1, 1], + mnemonics="SUPERCELL LATTice", + added_in_version="before v9", + text=r""" Factor that multiplies the three primitive vectors to generate a supercell. The starting nuclei types [[typat]] and coordinates [[xred]] and [[xcart]] are simply replicated in the different images of the original primitive cell. @@ -24236,18 +25903,20 @@ Also, [[nsym]] is set to 1. Also note that [[vel]], if defined, must have the dimensions of the number of atoms in the supercell, not the initial [[natom]], because it is not replicated. [[supercell_latt]] is typically used to initialize molecular dynamics runs. -""", - ), - Variable( - abivarname="pseudos", - varset="files", - vartype="string", - topics=["Control_basic"], - dimensions="scalar", - defaultval="", - mnemonics="PSEUDOpotentialS", - added_in_version="9.0.0", - text=r""" +""" +), + + +Variable( + abivarname="pseudos", + varset="files", + vartype="string", + topics=["Control_basic"], + dimensions="scalar", + defaultval="", + mnemonics="PSEUDOpotentialS", + added_in_version="9.0.0", + text=r""" String defining the list of pseudopotential files when Abinit is executed with the new syntax: abinit abi_in >& log & @@ -24287,18 +25956,19 @@ ```sh export ABI_PSPDIR="/home/user/pseudos" ``` -""", - ), - Variable( - abivarname="structure", - varset="basic", - vartype="string", - topics=["crystal_useful"], - dimensions="scalar", - defaultval="", - mnemonics="initialize the crystalline STRUCTURE from ...", - added_in_version="9.0.0", - text=r""" +""" +), + +Variable( + abivarname="structure", + varset="basic", + vartype="string", + topics=["crystal_useful"], + dimensions="scalar", + defaultval="", + mnemonics="initialize the crystalline STRUCTURE from ...", + added_in_version="9.0.0", + text=r""" This variable provides a simplified interface to build the crystalline structure from an external file. The idea is to keep the **geometry information** separated from the input file so that one can perform multiple calculations in different input files sharing the same structure @@ -24450,18 +26120,19 @@ In all these cases in which the [[structure]] variable is not supported, one has to resort to the **standard approach** to define the list of atoms and their type. -""", - ), - Variable( - abivarname="dvdb_rspace_cell", - varset="eph", - vartype="integer", - topics=["ElPhonInt_expert"], - dimensions="scalar", - defaultval=0, - mnemonics="DVDB R-SPACE CELL", - added_in_version="9.1.0", - text=r""" +""" +), + +Variable( + abivarname="dvdb_rspace_cell", + varset="eph", + vartype="integer", + topics=["ElPhonInt_expert"], + dimensions="scalar", + defaultval=0, + mnemonics="DVDB R-SPACE CELL", + added_in_version="9.1.0", + text=r""" This **advanced** variable sets the list of supercell $\RR$-points used to construct the scattering potential in the real-space representation with the associated weights for the Fourier transform to go from $W(\rr,\RR)$ to $v1scf(\rr,\qq)$. @@ -24477,17 +26148,18 @@ Reducing the value of [[boxcutmin]] to e.g. 1.1 allows one to reduce the number, [[nfft]], of $\rr$-points with a considerable memory saving for $W(\rr,\RR)$. """, - ), - Variable( - abivarname="dvdb_qdamp", - varset="eph", - vartype="real", - topics=["ElPhonInt_expert"], - dimensions="scalar", - defaultval=0.1, - mnemonics="DVDB Q-DAMPing", - added_in_version="9.1.0", - text=r""" +), + +Variable( + abivarname="dvdb_qdamp", + varset="eph", + vartype="real", + topics=["ElPhonInt_expert"], + dimensions="scalar", + defaultval=0.1, + mnemonics="DVDB Q-DAMPing", + added_in_version="9.1.0", + text=r""" This **advanced** variable defines the $\alpha$ parameter in the Gaussian filter $e^{-\frac{|\qG|^2}{4\alpha}}$ that multiplies the Fourier components of the model potential in the long wavelength limit (Eq 24 of [[cite:Brunin2020b]] see also [[cite:Sjakste2015]] and [[cite:Giustino2017]]). @@ -24497,62 +26169,66 @@ in terms of a sum in $\GG$-space (long-range part) and a sum in real space that, being short ranged, is not relevant for the definition of the LR model. """, - ), - Variable( - abivarname="getsigeph_filepath", - varset="files", - vartype="string", - topics=["multidtset_useful"], - dimensions="scalar", - defaultval="Output filename of the present dataset", - mnemonics="GET the SIGEPH from FILEPATH", - added_in_version="9.1.0", - text=r""" +), + +Variable( + abivarname="getsigeph_filepath", + varset="files", + vartype="string", + topics=["multidtset_useful"], + dimensions="scalar", + defaultval="Output filename of the present dataset", + mnemonics="GET the SIGEPH from FILEPATH", + added_in_version="9.1.0", + text=r""" This variable defines the path of the SIGEPH file with the e-ph self-energy results that should be used as input for further analysis. At present, it is used by the transport driver ([[eph_task]] = 7) to read the lifetimes needed to compute carrier mobilities within the RTA. """, - ), - Variable( - abivarname="brav", - varset="eph", - vartype="integer", - topics=["ElPhonInt_expert"], - dimensions="scalar", - defaultval=1, - mnemonics="BRAVais", - added_in_version="9.1.4", - text=r""" +), + +Variable( + abivarname="brav", + varset="eph", + vartype="integer", + topics=["ElPhonInt_expert"], + dimensions="scalar", + defaultval=1, + mnemonics="BRAVais", + added_in_version="9.1.4", + text=r""" See [[brav@anaddb]] """, - ), - Variable( - abivarname="eph_doping", - varset="eph", - vartype="real", - topics=["ElPhonInt_expert"], - dimensions="scalar", - defaultval=0.0, - mnemonics="EPH doping", - added_in_version="9.2.0", - text=r""" +), + +Variable( + abivarname="eph_doping", + varset="eph", + vartype="real", + topics=["ElPhonInt_expert"], + dimensions="scalar", + defaultval=0.0, + mnemonics="EPH doping", + added_in_version="9.2.0", + text=r""" Gives the doping charge in units of |e_charge| / cm^3. Negative for n-doping, positive for p-doping. Alternative to [[eph_extrael]] for simulating doping within the rigid band approximation. Require metallic occupation scheme [[occopt]] e.g. Fermi-Dirac. """, - ), - Variable( - abivarname="eph_phwinfact", - varset="eph", - vartype="real", - topics=["ElPhonInt_expert"], - dimensions="scalar", - defaultval=1.1, - mnemonics="EPH PHonon FACTor for energy WINdow", - added_in_version="9.2.0", - text=r""" +), + +Variable( + abivarname="eph_phwinfact", + varset="eph", + vartype="real", + topics=["ElPhonInt_expert"], + dimensions="scalar", + defaultval=1.1, + mnemonics="EPH PHonon FACTor for energy WINdow", + added_in_version="9.2.0", + text=r""" This variable defines the effective energy window for the $\kq$ KS states in the computation of electron lifetimes ([[eph_task]] -4) and is used to predict the list of $\qq$-points in the BZ that will be needed during the calculation. @@ -24568,30 +26244,32 @@ $\kq$ KS states that must be read from file with a subsequent decrease in the memory requirements for the wavefunctions. We recommended to perform initial tests to decide whether a value smaller than four can be used. """, - ), - Variable( - abivarname="rifcsph", - varset="eph", - vartype="real", - topics=["Phonons_expert"], - dimensions="scalar", - defaultval=0, - mnemonics="Radius of the Interatomic Force Constant SPHere", - added_in_version="9.2.0", - text=r""" +), + +Variable( + abivarname="rifcsph", + varset="eph", + vartype="real", + topics=["Phonons_expert"], + dimensions="scalar", + defaultval=0, + mnemonics="Radius of the Interatomic Force Constant SPHere", + added_in_version="9.2.0", + text=r""" Same meaning as [[rifcsph@anaddb]]. """, - ), - Variable( - abivarname="rmm_diis", - varset="gstate", - vartype="integer", - topics=["TuningSpeedMem_useful", "SCFAlgorithms_useful"], - dimensions="scalar", - defaultval=0, - mnemonics="Activate the RMM-DIIS eigensolver for GS calculations.", - added_in_version="9.3.0", - text=r""" +), + +Variable( + abivarname="rmm_diis", + varset="gstate", + vartype="integer", + topics=["TuningSpeedMem_useful","SCFAlgorithms_useful"], + dimensions="scalar", + defaultval=0, + mnemonics="Activate the RMM-DIIS eigensolver for GS calculations.", + added_in_version="9.3.0", + text=r""" This variable activates the Residual Minimization Method, Direct Inversion in the Iterative Subspace (RMM-DIIS) eigensolver to **accelerate** GS computations, structural relaxations and molecular-dynamics simulations. @@ -24678,17 +26356,18 @@ Last but not least, note that the default implementation is quite aggressive at the level of memory allocations. A less memory-intensive version of the algorithm can be activated via [[rmm_diis_savemem]] = 1. """, - ), - Variable( - abivarname="rmm_diis_savemem", - varset="gstate", - vartype="integer", - topics=["TuningSpeedMem_useful"], - dimensions="scalar", - defaultval=0, - mnemonics="Save memory in the RMM-DIIS eigensolver.", - added_in_version="9.3.0", - text=r""" +), + +Variable( + abivarname="rmm_diis_savemem", + varset="gstate", + vartype="integer", + topics=["TuningSpeedMem_useful"], + dimensions="scalar", + defaultval=0, + mnemonics="Save memory in the RMM-DIIS eigensolver.", + added_in_version="9.3.0", + text=r""" This variable allows one to save memory in the RMM-DIIS eigensolver when [[rmm_diis]] /= 0. By default, the RMM-DIIS routine allocates two extra arrays to reduce the number of applications of the Hamiltonian. The size of these arrays depends on the number of plane-waves treated by each processor and [[nband]]. @@ -24696,17 +26375,18 @@ may go out of memory for large systems. In this case, one can use [[rmm_diis_savemem]] = 1 to activate a version of RMM-DIIS that avoids these extra allocations. """, - ), - Variable( - abivarname="useextfpmd", - varset="gstate", - vartype="integer", - topics=["ExtFPMD_basic"], - dimensions="scalar", - defaultval=0, - mnemonics="USE EXTended FPMD model", - added_in_version="9.5.2", - text=r""" +), + +Variable( + abivarname="useextfpmd", + varset="gstate", + vartype="integer", + topics=["ExtFPMD_basic"], + dimensions="scalar", + defaultval=0, + mnemonics="USE EXTended FPMD model", + added_in_version="9.5.2", + text=r""" Enables the calculation of contributions to the energy, entropy, stresses, number of electrons and chemical potential using the extended First Principle Molecular Dynamics model for high temperature simulations. @@ -24742,50 +26422,53 @@ [[extfpmd_nband]] sets the last band index, which acts like [[nband]] for a conventional calculation. """, - ), - Variable( - abivarname="extfpmd_nband", - varset="gstate", - vartype="integer", - topics=["ExtFPMD_basic"], - dimensions="scalar", - defaultval=0, - mnemonics="EXTended FPMD: Number of Bands", - added_in_version="10.1.0", - text=r""" +), + +Variable( + abivarname="extfpmd_nband", + varset="gstate", + vartype="integer", + topics=["ExtFPMD_basic"], + dimensions="scalar", + defaultval=0, + mnemonics="EXTended FPMD: Number of Bands", + added_in_version="10.1.0", + text=r""" Specifies the number of bands to use for extended First-Principles Molecular Dynamics contributions when using [[useextfpmd]] = 5. This acts like [[nband]] for a conventional calculation. **extfpmd_nband** must be sufficiently high so that its occupancy is close to zero. Extended FPMD contributions will be computed from [[nband]] to [[extfpmd_nband]]. **extfpmd_nband** must be greater than [[nband]]. """, - ), - Variable( - abivarname="extfpmd_nbcut", - varset="gstate", - vartype="integer", - topics=["ExtFPMD_basic"], - dimensions="scalar", - defaultval=25, - mnemonics="EXTended FPMD: Number of Bands at CUT", - added_in_version="9.5.2", - text=r""" +), + +Variable( + abivarname="extfpmd_nbcut", + varset="gstate", + vartype="integer", + topics=["ExtFPMD_basic"], + dimensions="scalar", + defaultval=25, + mnemonics="EXTended FPMD: Number of Bands at CUT", + added_in_version="9.5.2", + text=r""" Specifies the number of bands to use when averaging over last bands to get the energy shift when [[useextfpmd]] = 2 or 3. **extfpmd_nbcut** must be less than or equal to [[nband]]. """, - ), - Variable( - abivarname="extfpmd_nbdbuf", - varset="gstate", - vartype="integer", - topics=["ExtFPMD_basic"], - dimensions="scalar", - defaultval=0, - mnemonics="EXTended FPMD: Number of BanDs for the BUFfer", - added_in_version="9.9.0", - text=r""" +), + +Variable( + abivarname="extfpmd_nbdbuf", + varset="gstate", + vartype="integer", + topics=["ExtFPMD_basic"], + dimensions="scalar", + defaultval=0, + mnemonics="EXTended FPMD: Number of BanDs for the BUFfer", + added_in_version="9.9.0", + text=r""" Specifies the number of bands to use for the buffer when [[useextfpmd]] /= 0. Among the total number of bands [[nband]], last [[extfpmd_nbdbuf]] bands occupation will be set to 0, and ExtFPMD model will take charge of computing @@ -24797,49 +26480,52 @@ **extfpmd_nbdbuf** must be less than or equal to [[nband]]. """, - ), - Variable( - abivarname="dipquad", - varset="eph", - vartype="integer", - topics=["longwave_basic"], - dimensions="scalar", - defaultval=0, - mnemonics="DIPole-QUADdrupole interaction", - characteristics=["[[DEVELOP]]"], - added_in_version="v9.5.2", - text=r""" +), + +Variable( + abivarname="dipquad", + varset="eph", + vartype="integer", + topics=["longwave_basic"], + dimensions="scalar", + defaultval=0, + mnemonics="DIPole-QUADdrupole interaction", + characteristics=["[[DEVELOP]]"], + added_in_version="v9.5.2", + text=r""" Same meaning as [[dipquad@anaddb]] """, - ), - Variable( - abivarname="quadquad", - varset="eph", - vartype="integer", - topics=["longwave_basic"], - dimensions="scalar", - defaultval=0, - mnemonics="QUADdrupole-QUADdrupole interaction", - characteristics=["[[DEVELOP]]"], - added_in_version="v9.5.2", - text=r""" +), + +Variable( + abivarname="quadquad", + varset="eph", + vartype="integer", + topics=["longwave_basic"], + dimensions="scalar", + defaultval=0, + mnemonics="QUADdrupole-QUADdrupole interaction", + characteristics=["[[DEVELOP]]"], + added_in_version="v9.5.2", + text=r""" Same meaning as [[quadquad@anaddb]] """, - ), - Variable( - abivarname="use_oldchi", - varset="gw", - vartype="integer", - topics=["Susceptibility_expert"], - dimensions="scalar", - defaultval=1, - mnemonics=r"USE OLD CHI implementation for evaluating $\chi^{0}$ with eigenvalues taken from a QPS file", - characteristics=["[[DEVELOP]]"], - requires="[[optdriver]] == 3", - added_in_version="9.5.2", - text=r""" +), + +Variable( + abivarname="use_oldchi", + varset="gw", + vartype="integer", + topics=["Susceptibility_expert"], + dimensions="scalar", + defaultval=1, + mnemonics=r"USE OLD CHI implementation for evaluating $\chi^{0}$ with eigenvalues taken from a QPS file", + characteristics=["[[DEVELOP]]"], + requires="[[optdriver]] == 3", + added_in_version="9.5.2", + text=r""" This input variable defines whether to keep the old implementation in which the polarizability $\chi^{0}$ is evaluated when the eigenvalues are read from an existing QPS file (e.g. in quasiparticle self-consistent QS$GW$ or $G_0W_0$ starting from a hybrid-functional starting point.) @@ -24850,18 +26536,19 @@ See line 743 in src/95_drive/screening.F90 . """, - ), - Variable( - abivarname="gstore_with_vk", - varset="eph", - vartype="integer", - topics=["ElPhonInt_basic"], - dimensions="scalar", - defaultval=1, - mnemonics=r"GSTORE WITH Velocity_k", - requires="[[optdriver]] == 7", - added_in_version="9.6.2", - text=r""" +), + +Variable( + abivarname="gstore_with_vk", + varset="eph", + vartype="integer", + topics=["ElPhonInt_basic"], + dimensions="scalar", + defaultval=1, + mnemonics=r"GSTORE WITH Velocity_k", + requires="[[optdriver]] == 7", + added_in_version="9.6.2", + text=r""" This input variable specifies whether the EPH code should compute and store the matrix elements of the velocity operator when computing the e-ph matrix elements ([[eph_task]] == 11) Possible values are: @@ -24870,40 +26557,42 @@ 1 --> compute and store the diagonal matrix elements (default) 2 --> compute and store diagonal + off-diagonal terms. """, - ), - Variable( - abivarname="gstore_iv1p_comm", - varset="eph", - vartype="integer", - topics=["ElPhonInt_basic"], - dimensions="scalar", - defaultval=0, - mnemonics=r"GSTORE write matrix elements of i[V1_ka, p] commutator", - requires="[[optdriver]] == 7", - added_in_version="10.7.0", - text=r""" +), + +Variable( + abivarname="gstore_iv1p_comm", + varset="eph", + vartype="integer", + topics=["ElPhonInt_basic"], + dimensions="scalar", + defaultval=0, + mnemonics=r"GSTORE write matrix elements of i[V1_ka, p] commutator", + requires="[[optdriver]] == 7", + added_in_version="10.9.0", + text=r""" If set to 1, the EPH code computes and stores on file the matrix elements -i in the full BZ in reduced coordinates. +$$ i \left\langle \psi_{mk}\big| \middle[ V^{(1)}_{q0,ka}, p \middle] \big| \psi_{nk} \right\rangle $$ +in the full BZ in reduced coordinates, when computing the GSTORE.nc. See [[cite:Lihm2020]]. """, - ), - Variable( - abivarname="gstore_use_lgk", - varset="eph", - vartype="integer", - topics=["ElPhonInt_basic"], - dimensions="scalar", - defaultval=0, - mnemonics=r"GSTORE USE Little Group of K", - requires="[[optdriver]] == 7", - added_in_version="10.5.6", - text=r""" +), + +Variable( + abivarname="gstore_use_lgk", + varset="eph", + vartype="integer", + topics=["ElPhonInt_basic"], + dimensions="scalar", + defaultval=0, + mnemonics=r"GSTORE USE Little Group of K", + requires="[[optdriver]] == 7", + added_in_version="10.5.6", + text=r""" When generating a GSTORE file, setting [[gstore_use_lgk]] to 1, instructs Abinit to restrict the computation of the g(k,q) to the -$\qq$-points in the IBZ_k where IBZ_k is the irreducible zone -defined by the little group of the $\kk$-point. +$\qq$-points in the IBZ_k where IBZ_k is the irreducible zone defined by the little group of the $\kk$-point. This allows one to reduce the number of e-ph matrix elements, but keep in mind that the generated GSTORE can only be used to compute electronic properties such as the electron self-energy $\Sigma_\kk$. @@ -24913,22 +26602,23 @@ [[gstore_use_lgk]] = 1 is only compatible with [[gstore_qzone]] == "bz". """, - ), - Variable( - abivarname="gstore_use_lgq", - varset="eph", - vartype="integer", - topics=["ElPhonInt_basic"], - dimensions="scalar", - defaultval=1, - mnemonics=r"GSTORE USE Little Group of Q", - requires="[[optdriver]] == 7", - added_in_version="10.5.6", - text=r""" +), + +Variable( + abivarname="gstore_use_lgq", + varset="eph", + vartype="integer", + topics=["ElPhonInt_basic"], + dimensions="scalar", + defaultval=1, + mnemonics=r"GSTORE USE Little Group of Q", + requires="[[optdriver]] == 7", + added_in_version="10.5.6", + text=r""" When generating a GSTORE file, setting [[gstore_use_lgq]] to 1, instructs Abinit to restrict the computation of the g(k,q) to the -$\kk$-points in the IBZ_q where IBZ_q is the irreducible zone -defined by the little group of the $\qq$-point. +$\kk$-points in the IBZ_q where IBZ_q is the irreducible zone defined by the little group of the $\qq$-point. + This allows one to reduce the number of e-ph matrix elements, but keep in mind that the generated GSTORE can only be used to compute phonon properties such as the phonon self-energy $\Pi_\kk$. @@ -24938,20 +26628,57 @@ [[gstore_use_lgq]] = 1 is only compatible with [[gstore_kzone]] == "bz". """, - ), - Variable( - abivarname="gstore_kzone", - varset="eph", - vartype="string", - topics=["ElPhonInt_basic"], - dimensions="scalar", - defaultval="ibz", - mnemonics=r"GSTORE K-point ZONE", - requires="[[optdriver]] == 7", - added_in_version="9.6.2", - text=r""" + + +), + +Variable( + abivarname="gstore_sym", + varset="eph", + vartype="integer", + topics=["ElPhonInt_basic"], + dimensions="scalar", + defaultval=0, + mnemonics=r"GSTORE use SYMmetries to reconstruct g(k,q)", + requires="[[optdriver]] == 7 and [[gstore_kzone]] == 'bz' and [[gstore_qzone]] == 'bz'", + added_in_version="10.9.1", + text=r""" +Activates the reconstruction of the electron-phonon matrix elements g(k,q) by symmetry when +[[gstore_kzone]] == "bz" and [[gstore_qzone]] == "bz". Only meaningful in that combination; +setting it to a nonzero value otherwise is a fatal error. + +* 0 --> No reconstruction. g(k,q) is computed directly for every $\kk$ and $\qq$ in the full BZ. + This is the most expensive but always-safe option and the default. + +* 1 --> g(k,q) is computed directly only for $\kk$ in the IBZ (with $\qq$ still spanning the full + BZ) and then reconstructed by symmetry for $\kk$ outside the IBZ. Requires [[gstore_use_lgk]] == 0. + +* 2 --> Like 1, but $\qq$ is also restricted to IBZ_k (the irreducible zone defined by the little + group of $\kk$) at the direct-computation stage, and reconstructed by symmetry for both + $\kk$ outside the IBZ and $\qq$ outside IBZ_k. Requires [[gstore_use_lgk]] == 1. + +!!! important + + [[gstore_sym]] != 0 is not yet supported for [[nspinor]] == 2 (spin-orbit coupling): the + reconstruction formula has a known, still-open bug for spinor wavefunctions. Use + [[gstore_sym]] 0 for spin-orbit calculations. +""", +), + +Variable( + abivarname="gstore_kzone", + varset="eph", + vartype="string", + topics=["ElPhonInt_basic"], + dimensions="scalar", + defaultval="ibz", + mnemonics=r"GSTORE K-point ZONE", + requires="[[optdriver]] == 7", + added_in_version="9.6.2", + text=r""" This input variable specifies whether the EPH code should compute the $g(\kk, \qq)$ matrix elements with $\kk$ in the IBZ or in the BZ. +Possible values are "ibz" or "bz". !!! important @@ -24960,20 +26687,22 @@ Using the BZ for both $\kk$ and $\qq$ is usually used for testing purposes, and it is not recommended for production runs (much slower). """, - ), - Variable( - abivarname="gstore_qzone", - varset="eph", - vartype="string", - topics=["ElPhonInt_basic"], - dimensions="scalar", - defaultval="bz", - mnemonics=r"GSTORE Q-point ZONE", - requires="[[optdriver]] == 7", - added_in_version="9.6.2", - text=r""" +), + +Variable( + abivarname="gstore_qzone", + varset="eph", + vartype="string", + topics=["ElPhonInt_basic"], + dimensions="scalar", + defaultval="bz", + mnemonics=r"GSTORE Q-point ZONE", + requires="[[optdriver]] == 7", + added_in_version="9.6.2", + text=r""" This input variable specifies whether the EPH code should compute the $g(\kk, \qq)$ e-ph matrix elements for $\qq$ in the IBZ or in the BZ. +Possible values are "ibz" or "bz". !!! important @@ -24982,20 +26711,21 @@ Using the BZ for both $\kk$ and $\qq$ is usually used for testing purposes, and it is not recommended for production runs (much slower). """, - ), - Variable( - abivarname="gstore_kfilter", - varset="eph", - vartype="string", - topics=["ElPhonInt_basic"], - dimensions="scalar", - defaultval="none", - mnemonics=r"GSTORE K-FILTER", - requires="[[optdriver]] == 7", - added_in_version="9.6.2", - text=r""" +), + +Variable( + abivarname="gstore_kfilter", + varset="eph", + vartype="string", + topics=["ElPhonInt_basic"], + dimensions="scalar", + defaultval="none", + mnemonics=r"GSTORE K-FILTER", + requires="[[optdriver]] == 7", + added_in_version="9.6.2", + text=r""" This input variable can be used to introduce a filter in the electronic wavevectors (k and k+q) -when computing the e-ph matrix elements with [[eph_task]] == 11. +when computing the e-ph matrix elements with [[eph_task]] in [11, 17]. Possible values are: - "none" --> No filter is applied (default) @@ -25007,56 +26737,71 @@ Note that it is possible to use another filter based on the position of the energy states wrt to either the CBM/VBM or the position wrt to the Fermi level via [[gstore_erange]]. """, - ), - Variable( - abivarname="gstore_gname", - varset="eph", - vartype="string", - topics=["ElPhonInt_expert"], - dimensions="scalar", - defaultval="gvals", - mnemonics=r"GSTORE G-value NAME", - requires="[[optdriver]] == 7", - added_in_version="10.5.6", - text=r""" +), + +Variable( + abivarname="gstore_gname", + varset="eph", + vartype="string", + topics=["ElPhonInt_expert"], + dimensions="scalar", + defaultval="gvals", + mnemonics=r"GSTORE G-value NAME", + requires="[[optdriver]] == 7", + added_in_version="10.5.6", + text=r""" This input variable specifies the name of the netcdf variable from which the e-ph matrix elements will be **read** from the GSTORE.nc file. Possible values are: "gvals" (default) or "gvals_ks" + This variable has an effect only where reading a GSTORE file produced by the GWPT subdriver ([[eph_task]] 17) for post-processing purposes. In this case, indeed, the "gvals" netcdf variables stores the GWPT electron-matrix elements while "gvals_ks" contains the KS e-ph matrix elements. -Use "gvals_ks" if you want to compute physical properties using KS matrix elements instead of the GWPT ones +Use "gvals_ks" if you wish to compute physical properties using KS matrix elements instead of the GWPT ones for comparison purposes. +""", +), + +Variable( + abivarname="gstore_convert", + varset="eph", + vartype="string", + topics=["ElPhonInt_expert"], + dimensions="scalar", + defaultval="''", + mnemonics=r"GSTORE CONVERT", + requires="[[optdriver]] == 7", + added_in_version="10.8.2", + text=r""" +This variable activates the conversion of a GSTORE file to an external format that +can be used to interface ABINIT with other codes. + +If gstore_convert is not an empty string, ABINIT automatically invokes the conversion routine +after the GSTORE.nc file has been generated with [[eph_task]] 11 or 17. + +A dedicated eph_task can also be used to convert an existing GSTORE.nc file by using +[[eph_task]] 20 and [[getgstore_filepath]]. + +Currently, the following formats are supported: + +- "epiq" to interface gstore with [EPIq](https://the-epiq-team.gitlab.io/epiq-site/) -This input variable specifies the name of the NetCDF variable from which -the electron–phonon matrix elements will be read in the GSTORE.nc file. - -Valid options are: - -- "gvals" (default) -- "gvals_ks" - -This variable is only relevant when reading a GSTORE.nc file produced by -the GWPT subdriver ([[eph_task]] = 17) for post-processing. -In such cases: "gvals" stores the GWPT-renormalized electron–phonon matrix elements while -"gvals_ks" contains the Kohn–Sham (KS) electron–phonon matrix elements. - -Select "gvals_ks" if you wish to compute physical properties using the KS matrix elements -instead of the GWPT ones, for comparison purposes. -""", - ), - Variable( - abivarname="gstore_brange", - varset="eph", - vartype="int", - topics=["ElPhonInt_basic"], - dimensions=[2, "[[nsppol]]"], - defaultval=0, - mnemonics=r"GSTORE Band RANGE", - requires="[[optdriver]] == 7", - added_in_version="9.6.2", - text=r""" +""", +), + + +Variable( + abivarname="gstore_brange", + varset="eph", + vartype="integer", + topics=["ElPhonInt_basic"], + dimensions=[2, "[[nsppol]]"], + defaultval=0, + mnemonics=r"GSTORE Band RANGE", + requires="[[optdriver]] == 7", + added_in_version="9.6.2", + text=r""" This input variable can be used to specify the band range when computing the GSTORE.nc file with [[eph_task]] == 11. The first entry gives the first band to be included while the second index specifies the last band. @@ -25064,97 +26809,127 @@ two different spin channels when [[nsppol]] == 2. If not specified in input, ABINIT will use all the bands from 1 up to [[nband]] -unless additional filters are activated, see [[gstore_kfilter]] and [[gstore_erange]]. -""", - ), - Variable( - abivarname="getgstore_filepath", - varset="eph", - vartype="string", - topics=["ElPhonInt_basic"], - dimensions="scalar", - defaultval="None", - mnemonics="GET the GSTORE.nc from FILEPATH", - requires="[[optdriver]] == 7", - added_in_version="9.6.2", - text=r""" +unless additional filters are activated, see also [[gstore_kfilter]] and [[gstore_erange]]. + +When reading an existing GSTORE.nc file with [[getgstore_filepath]], this variable can be used +to reduce the number of intermediate states at k+q kept in memory. In this case the requested +range must be contained in the k+q band range stored in the file and `gstore_brange(2)` must be +equal to [[nband]]. When [[eph_stern]] is enabled, `gstore_brange(1)` must be 1. The band range +for the external states at k is not modified. +""", +), + +Variable( + abivarname="getgstore_filepath", + varset="eph", + vartype="string", + topics=["ElPhonInt_basic"], + dimensions="scalar", + defaultval="None", + mnemonics="GET the GSTORE.nc from FILEPATH", + requires="[[optdriver]] == 7", + added_in_version="9.6.2", + text=r""" This variable defines the path of the GSTORE.nc file with the e-ph matrix elements that should be used as input for further analysis. +""", -This variable can also be used when [[eph_task]] == 11 i.e. when we compute the GSTORE file. -In this case, the code assumes we want to restart a GSTORE calculation and only the (k, q) entries -that are missing in the nc file are computed. -This option is very useful if the previous job has been killed due to timeout limit. -""", - ), - Variable( - abivarname="getabiwan_filepath", - varset="eph", - vartype="string", - topics=["ElPhonInt_basic"], - dimensions="scalar", - defaultval="None", - mnemonics="GET the ABIWAN.nc from FILEPATH", - added_in_version="10.1.1", - text=r""" +# This variable can also be used when [[eph_task]] == 11 i.e. when we compute the GSTORE file. +# In this case, the code assumes we want to restart a GSTORE calculation and only the (k, q) entries +# that are missing in the nc file are computed. +# This option is very useful if the previous job has been killed due to timeout limit. + +), + +Variable( + abivarname="getqpdata_filepath", + varset="eph", + vartype="string", + topics=["ElPhonInt_basic"], + dimensions="scalar", + defaultval="None", + mnemonics="GET the QPDATA.nc from FILEPATH", + added_in_version="10.9.0", + text=r""" +This variable defines the path of the QPDATA file with the quasi-particle energies. +to be used to update the initial KS band structure. +To generate a QPDATA file, one can use AbiPy to extract the results from a SIGRES.nc file. +""", +), + + +Variable( + abivarname="getabiwan_filepath", + varset="eph", + vartype="string", + topics=["ElPhonInt_basic"], + dimensions="scalar", + defaultval="None", + mnemonics="GET the ABIWAN.nc from FILEPATH", + added_in_version="10.1.1", + text=r""" This variable defines the path of the ABIWAN.nc file with the Wannier rotation matrices produced by ABINIT when wannier90 in invoked in library mode. See also [[getabiwan]]. """, - ), - Variable( - abivarname="getabiwan", - varset="eph", - vartype="int", - topics=["ElPhonInt_basic"], - dimensions="scalar", - defaultval="None", - mnemonics="GET the ABIWAN.nc from dataset", - added_in_version="10.1.1", - text=r""" +), + +Variable( + abivarname="getabiwan", + varset="eph", + vartype="integer", + topics=["ElPhonInt_basic"], + dimensions="scalar", + defaultval="None", + mnemonics="GET the ABIWAN.nc from dataset", + added_in_version="10.1.1", + text=r""" This variable is similar in spirit to [[getabiwan_filepath]] but uses the dataset index instead of the filepath. """, - ), - Variable( - abivarname="getgwan_filepath", - varset="eph", - vartype="string", - topics=["ElPhonInt_basic"], - dimensions="scalar", - defaultval="None", - mnemonics="GET the GWAN.nc from FILEPATH", - added_in_version="10.1.1", - text=r""" +), + +Variable( + abivarname="getgwan_filepath", + varset="eph", + vartype="string", + topics=["ElPhonInt_basic"], + dimensions="scalar", + defaultval="None", + mnemonics="GET the GWAN.nc from FILEPATH", + added_in_version="10.1.1", + text=r""" This variable defines the path of the GWAN.nc file with the e-ph matrix elements in the Wannier representation See also [[getgwan]]. """, - ), - Variable( - abivarname="getgwan", - varset="eph", - vartype="int", - topics=["ElPhonInt_basic"], - dimensions="scalar", - defaultval="None", - mnemonics="GET the GWAN.nc from dataset", - added_in_version="10.1.1", - text=r""" +), + +Variable( + abivarname="getgwan", + varset="eph", + vartype="integer", + topics=["ElPhonInt_basic"], + dimensions="scalar", + defaultval="None", + mnemonics="GET the GWAN.nc from dataset", + added_in_version="10.1.1", + text=r""" This variable is similar in spirit to [[getgwan_filepath]] but uses the dataset index instead of the filepath. """, - ), - Variable( - abivarname="gstore_erange", - varset="eph", - vartype="real", - topics=["ElPhonInt_basic"], - dimensions=[2, "[[nsppol]]"], - characteristics=["[[ENERGY]]"], - requires="[[optdriver]] == 7", - mnemonics="GSTORE Energy RANGE", - added_in_version="9.6.2", - text=r""" +), + +Variable( + abivarname="gstore_erange", + varset="eph", + vartype="real", + topics=["ElPhonInt_basic"], + dimensions=[2, "[[nsppol]]"], + characteristics=["[[ENERGY]]"], + requires="[[optdriver]] == 7", + mnemonics="GSTORE Energy RANGE", + added_in_version="9.6.2", + text=r""" This variable is used when [[eph_task]] = 11 to define the k/q points that should be considered when producing the GSTORE.nc file This variable consists of two x [[nsppol]] entries that allow one to select the k-points and the bands @@ -25163,8 +26938,8 @@ If both entries in [[gstore_erange]] are negative, the code assumes a metal and only states within the energy window [efermi - abs(gstore_erange(1)), efermi + abs(gstore_erange(2)] are included in the calculation. Positive (or zero) values are used in semiconductors to define an energy range with respect to the band edges. -In this case, the first entry given the position of the holes with respect to the CBM while the second entry -gives the position of electrons with respect to the VBM (energy differences are **always positive**, even for holes). +In this case, the first entry given the position of the holes with respect to the VBM while the second entry +gives the position of electrons with respect to the CBM (energy differences are **always positive**, even for holes). A zero entry can be used to exclude either holes or electrons from the calculation. If both entries are zero, the variable is ignored. @@ -25178,18 +26953,19 @@ to specify the energy intervals in eV units. meV is supported as well. """, - ), - Variable( - abivarname="gwr_np_kgts", - varset="gwr", - vartype="integer", - topics=["GWR_expert"], - dimensions=[4], - defaultval=0, - mnemonics="GWR Number of Processors for K-vectors, G-vectors, Tau-points, Spin.", - requires="[[optdriver]] == 6", - added_in_version="9.6.2", - text=r""" +), + +Variable( + abivarname="gwr_np_kgts", + varset="gwr", + vartype="integer", + topics=["GWR_expert"], + dimensions=[4], + defaultval=0, + mnemonics="GWR Number of Processors for K-vectors, G-vectors, Tau-points, Spin.", + requires="[[optdriver]] == 6", + added_in_version="9.6.2", + text=r""" This variable defines the 4D Cartesian grid of MPI processors used for GWR calculations. If not specified in the input, the code will generate this grid automatically using the total number of MPI processors and the basic dimensions of the job computed at runtime. @@ -25206,34 +26982,36 @@ Other variables such as [[npband]], [[npfft]], [[np_spkpt]] and [[paral_kgb]] are **not used** in the GWR subdriver. """, - ), - Variable( - abivarname="gwr_ucsc_batch", - varset="gwr", - vartype="integer", - topics=["GWR_expert"], - dimensions=[2], - defaultval=-1, - mnemonics="GWR Unit Cell, Supercell BATCH SIZE.", - requires="[[optdriver]] == 6", - added_in_version="9.6.2", - text=r""" +), + +Variable( + abivarname="gwr_ucsc_batch", + varset="gwr", + vartype="integer", + topics=["GWR_expert"], + dimensions=[2], + defaultval=-1, + mnemonics="GWR Unit Cell, Supercell BATCH SIZE.", + requires="[[optdriver]] == 6", + added_in_version="9.6.2", + text=r""" This variable defines the maximum number of FFTs performed in the unit cell/supercell. If not specified in the input, the code will automatically define these values in order to find a good compromise between memory and performance. """, - ), - Variable( - abivarname="gwr_task", - varset="gwr", - vartype="string", - topics=["GWR_basic"], - dimensions=[1], - defaultval="None", - mnemonics="GWR TASK", - requires="[[optdriver]] == 6", - added_in_version="9.6.2", - text=r""" +), + +Variable( + abivarname="gwr_task", + varset="gwr", + vartype="string", + topics=["GWR_basic"], + dimensions=[1], + defaultval="None", + mnemonics="GWR TASK", + requires="[[optdriver]] == 6", + added_in_version="9.6.2", + text=r""" Select the task to be performed when [[optdriver]] == 6 i.e. GWR code. The choice is among: @@ -25260,18 +27038,19 @@ * Temperature effects at the electronic level are not taken into account as we work with the T = 0 formalism. * Only $\Gamma$-centered $\kk$-meshes are supported in GWR. """, - ), - Variable( - abivarname="gwr_ntau", - varset="gwr", - vartype="integer", - topics=["GWR_basic"], - dimensions=[1], - defaultval=12, - mnemonics="GWR Number of TAU points.", - requires="[[optdriver]] == 6", - added_in_version="9.6.2", - text=r""" +), + +Variable( + abivarname="gwr_ntau", + varset="gwr", + vartype="integer", + topics=["GWR_basic"], + dimensions=[1], + defaultval=12, + mnemonics="GWR Number of TAU points.", + requires="[[optdriver]] == 6", + added_in_version="9.6.2", + text=r""" This variable defines the number of points in the minimax mesh. Possible values are: [6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34]. @@ -25280,18 +27059,19 @@ the differerence between the highest KS eigenvalue for the empty states that, in turns, depends on the value of [[nband]] used and the energy of the lowest occupied state. """, - ), - Variable( - abivarname="gwr_chi_algo", - varset="gwr", - vartype="integer", - topics=["GWR_basic"], - dimensions=[1], - defaultval=1, - mnemonics="GWR CHI ALGOrithm.", - requires="[[optdriver]] == 6", - added_in_version="9.6.2", - text=r""" +), + +Variable( + abivarname="gwr_chi_algo", + varset="gwr", + vartype="integer", + topics=["GWR_basic"], + dimensions=[1], + defaultval=1, + mnemonics="GWR CHI ALGOrithm.", + requires="[[optdriver]] == 6", + added_in_version="9.6.2", + text=r""" This variable is similar in spirit to [[gwr_sigma_algo]]. It selects the algorithm used to compute the polarizability in the GWR code. Possible values are: @@ -25308,32 +27088,34 @@ The two algorithms are equivalent in the case of $\Gamma$-only sampling. """, - ), - Variable( - abivarname="gwr_rpa_ncut", - varset="gwr", - vartype="integer", - topics=["GWR_basic"], - dimensions=[1], - defaultval=5, - mnemonics="GWR RPA Number of CUToff", - requires="[[optdriver]] == 6", - added_in_version="9.6.2", - text=r""" +), + +Variable( + abivarname="gwr_rpa_ncut", + varset="gwr", + vartype="integer", + topics=["GWR_basic"], + dimensions=[1], + defaultval=5, + mnemonics="GWR RPA Number of CUToff", + requires="[[optdriver]] == 6", + added_in_version="9.6.2", + text=r""" Number of cutoff energies for extrapolating RPA correlation energy. """, - ), - Variable( - abivarname="gwr_sigma_algo", - varset="gwr", - vartype="integer", - topics=["GWR_basic"], - dimensions=[1], - defaultval=1, - mnemonics="GWR SIGMA ALGOrithm.", - requires="[[optdriver]] == 6", - added_in_version="9.6.2", - text=r""" +), + +Variable( + abivarname="gwr_sigma_algo", + varset="gwr", + vartype="integer", + topics=["GWR_basic"], + dimensions=[1], + defaultval=1, + mnemonics="GWR SIGMA ALGOrithm.", + requires="[[optdriver]] == 6", + added_in_version="9.6.2", + text=r""" This input variable selects the algorithm used to compute the self-energy in the GWR code. Possible values are @@ -25354,18 +27136,19 @@ The two algorithms are equivalent in the case of $\Gamma$-only sampling. See also [[gwr_chi_algo]]. """, - ), - Variable( - abivarname="gwr_boxcutmin", - varset="gwr", - vartype="real", - topics=["GWR_useful"], - dimensions=[1], - defaultval=1.0, - mnemonics="GWR BOX CUT-off MINimum", - requires="[[optdriver]] == 6", - added_in_version="9.6.2", - text=r""" +), + +Variable( + abivarname="gwr_boxcutmin", + varset="gwr", + vartype="real", + topics=["GWR_useful"], + dimensions=[1], + defaultval=1.0, + mnemonics="GWR BOX CUT-off MINimum", + requires="[[optdriver]] == 6", + added_in_version="9.6.2", + text=r""" This variable defines the FFT mesh used to represent the polarizability, the screened interaction $W$ and the self-energy $\Sigma$ in the GWR code. The role is very similar to that of [[boxcutmin]], which is has a meaning only in the case of GS/DFPT calculations. @@ -25375,18 +27158,19 @@ In practice, it is recommended to start with a smaller value, such as 1.1, and then gradually increase it (1.2, 1.3, etc.) in order to monitor the stability of the results. """, - ), - Variable( - abivarname="gwr_max_hwtene", - varset="gwr", - vartype="real", - topics=["GWR_useful"], - dimensions=[1], - defaultval=-1.0, - mnemonics="GWR MAX Head Wings Transition ENErgy", - requires="[[optdriver]] == 6", - added_in_version="9.8.0", - text=r""" +), + +Variable( + abivarname="gwr_max_hwtene", + varset="gwr", + vartype="real", + topics=["GWR_useful"], + dimensions=[1], + defaultval=-1.0, + mnemonics="GWR MAX Head Wings Transition ENErgy", + requires="[[optdriver]] == 6", + added_in_version="9.8.0", + text=r""" This variable defines the transition energy window (in Hartree) for the empty states used in computing the head and wings of the polarizability. As discussed in [[cite:baroni1986]], the head and wings converge rapidly with respect to the number of bands, unlike the body of the matrix. @@ -25396,35 +27180,39 @@ See also [[inclvkb]] for the inclusion of the contribution given by the non-local part of pseudopotential. """, - ), - Variable( - abivarname="optdcmagpawu", - varset="paw", - vartype="integer", - topics=["DFT+U_expert"], - dimensions="scalar", - defaultval=3, - mnemonics="OPTion for Double-Counting MAGnetic term in PAW+U formalism", - requires="[[usepaw]] == 1, [[usepawu]] == 1 or 4, and [[nspden]] == 4", - added_in_version="9.8.2", - text=r""" +), + + +Variable( + abivarname="optdcmagpawu", + varset="paw", + vartype="integer", + topics=["DFT+U_expert"], + dimensions="scalar", + defaultval=3, + mnemonics="OPTion for Double-Counting MAGnetic term in PAW+U formalism", + requires="[[usepaw]] == 1, [[usepawu]] == 1 or 4, and [[nspden]] == 4", + added_in_version="9.8.2", + text=r""" This option is useful only for tests and code comparisons. For magnetic computations ([[nspden]]==4), it defines how the magnetism is treated in the double counting term in the PAW+U formalism. Abinit versions before 9.8 correspond to [[optdcmagpawu]]=1, without magnetism in the DC term, while [[optdcmagpawu]]=3 takes into account magnetism in the DC term, that is currently the default. """, - ), - Variable( - abivarname="gwpt_np_wpqbks", - varset="eph", - vartype="integer", - topics=["ElPhonInt_expert"], - dimensions=[6], - defaultval=0, - mnemonics="GWPT Number of Processors for Wavevector sum, Perturbations, Q-points, Bands, K-points, Spin.", - added_in_version="10.1.4", - text=r""" -This variable defines the Cartesian grid of MPI processors used for GWPT calculations. +), + + +Variable( + abivarname="gwpt_np_wpqbks", + varset="eph", + vartype="integer", + topics=["ElPhonInt_expert"], + dimensions=[6], + defaultval=0, + mnemonics="GWPT Number of Processors for Wavevector sum, Perturbations, Q-points, Bands, K-points, Spin.", + added_in_version="10.1.4", + text=r""" +This variable defines the Cartesian grid of MPI processors used for GWPT calculations ([[eph_task]] = 17) If not specified in the input, the code will generate this grid automatically using the total number of processors and the basic dimensions of the job computed at runtime. @@ -25439,32 +27227,34 @@ Other variables such as [[nppert]], [[npband]], [[npfft]], [[np_spkpt]] and [[paral_kgb]] are **not used** in the EPH subdriver. """, - ), - Variable( - abivarname="xg_nonlop_option", - varset="dev", - vartype="integer", - topics=["TuningSpeedMem_expert"], - dimensions="scalar", - defaultval=0, - mnemonics="OPTION for XG_NONLOP routines", - added_in_version="10.2.2", - text=r""" +), + +Variable( + abivarname="xg_nonlop_option", + varset="dev", + vartype="integer", + topics=["TuningSpeedMem_expert"], + dimensions="scalar", + defaultval=0, + mnemonics="OPTION for XG_NONLOP routines", + added_in_version="10.2.2", + text=r""" When using [[cprj_in_memory]]=1 with [[wfoptalg]]==111, the non-local terms of the Hamiltonian (see [[cprj_in_memory]]) can be computed in two different ways, corresponding to [[xg_nonlop_option]]=0 or 1. [[xg_nonlop_option]]=0 requires more memory than [[xg_nonlop_option]]=1, but much less MPI communications, so it is more efficient. """, - ), - Variable( - abivarname="getdrhodb", - varset="files", - vartype="integer", - topics=["ElPhonInt_useful"], - dimensions="scalar", - defaultval=0, - mnemonics="GET the DRHODB from...", - added_in_version="10.3.0", - text=r""" +), + +Variable( + abivarname="getdrhodb", + varset="files", + vartype="integer", + topics=["ElPhonInt_useful"], + dimensions="scalar", + defaultval=0, + mnemonics="GET the DRHODB from...", + added_in_version="10.3.0", + text=r""" This variable can be used when performing GWPT calculations with [[optdriver]] = 17 to read a DVDB file with the derivative of densities produced in a previous dataset. For example, one can concatenate a dataset in which an initial set of DFPT densities @@ -25484,47 +27274,100 @@ Note also that one can also use [[getdrhodb_filepath]] to specify the path of the file directly. """, - ), - Variable( - abivarname="getdrhodb_filepath", - varset="files", - vartype="string", - topics=["multidtset_useful"], - dimensions="scalar", - defaultval=None, - mnemonics="GET the DRHODB file from FILEPATH", - added_in_version="10.3.0", - text=r""" +), + +Variable( + abivarname="getdrhodb_filepath", + varset="files", + vartype="string", + topics=["multidtset_useful"], + dimensions="scalar", + defaultval=None, + mnemonics="GET the DRHODB file from FILEPATH", + added_in_version="10.3.0", + text=r""" Specify the path of the DVDB file with the first-order densities using a string instead of the dataset index. Alternative to [[getdrhodb]] and [[irddrhodb]]. The string must be enclosed between quotation marks: getdrhodb_filepath "../outdata/out_DRHODB" """, - ), - Variable( - abivarname="irddrhodb", - varset="files", - vartype="integer", - topics=["ElPhonInt_useful"], - dimensions="scalar", - mnemonics="Integer that governs the ReaDing of DRHODB file", - added_in_version="10.3.0", - text=r""" +), + + +Variable( + abivarname="irddrhodb", + varset="files", + vartype="integer", + topics=["ElPhonInt_useful"], + dimensions="scalar", + mnemonics="Integer that governs the ReaDing of DRHODB file", + added_in_version="10.3.0", + text=r""" This variable can be used when performing GWPT calculations with [[optdriver]] = 17. Set to 1, an *input* DRHODB file will be read. See also [[getdrhodb]] """, - ), - Variable( - abivarname="getvpq_filepath", - varset="eph", - vartype="string", - topics=["Polaron_basic"], - dimensions="scalar", - defaultval=None, - mnemonics="GET the VPQ.nc from FILEPATH", - requires="[[eph_task]] in [13, -13]", - added_in_version="10.1.4", - text=r""" +), + + +Variable( + abivarname="vpq_hop_from_filepath", + varset="eph", + vartype="string", + topics=["Polaron_basic"], + dimensions="scalar", + defaultval=None, + mnemonics="VPQ.nc, HOPping FROM: FILEPATH", + requires="[[eph_task]] == 13 and [[vpq_mode]] == 'hopping'", + added_in_version="10.8.1", + text=r""" +Specifies the path to the VPQ.nc file containing the initial polaron solution +for the minimum-energy path optimisation. + +When [[vpq_hop_to_filepath]] is also provided, the centre of the initial +polaron must be specified using [[vpq_hop_from_site]]. + +""", +), + +Variable( + abivarname="vpq_hop_to_filepath", + varset="eph", + vartype="string", + topics=["Polaron_expert"], + dimensions="scalar", + defaultval=None, + mnemonics="VPQ.nc, HOPping TO: FILEPATH", + requires="[[eph_task]] == 13 and [[vpq_mode]] == 'hopping'", + added_in_version="10.8.1", + text=r""" +Specifies the path to the VPQ.nc file containing the final polaron solution +for the minimum-energy path optimisation. + +When this variable is not provided, the final solution is generated by +translating the initial solution according to [[vpq_hop_vec]]. + +When both [[vpq_hop_from_filepath]] and [[vpq_hop_to_filepath]] are +provided, the centres of the initial and final polarons must be specified +using [[vpq_hop_from_site]] and [[vpq_hop_to_site]], respectively. + +In this case, [[vpq_hop_vec]] specifies the translation of the final +polaron relative to the initial one. + +""", +), + + +Variable( + abivarname="getvpq_filepath", + varset="eph", + vartype="string", + topics=["Polaron_basic"], + dimensions="scalar", + defaultval=None, + mnemonics="GET the VPQ.nc from FILEPATH", + requires="[[eph_task]] in [13, -13]", + added_in_version="10.1.4", + text=r""" This variable defines the path of the VPQ.nc file with the variational polaron equations optimization results. @@ -25538,33 +27381,35 @@ polaronic wavefunction and induced displacements that can be visualized with a crystal visualisation software like VESTA or Xcrysden. """, - ), - Variable( - abivarname="getvpq", - varset="eph", - vartype="int", - topics=["Polaron_basic"], - dimensions="scalar", - defaultval=None, - mnemonics="GET the VPQ.nc from dataset", - requires="[[eph_task]] in [13, -13]", - added_in_version="10.1.4", - text=r""" +), + +Variable( + abivarname="getvpq", + varset="eph", + vartype="integer", + topics=["Polaron_basic"], + dimensions="scalar", + defaultval=None, + mnemonics="GET the VPQ.nc from dataset", + requires="[[eph_task]] in [13, -13]", + added_in_version="10.1.4", + text=r""" This variable is similar in spirit to [[getvpq_filepath]] but uses the dataset index instead of the filepath. """, - ), - Variable( - abivarname="vpq_aseed", - varset="eph", - vartype="string", - topics=["Polaron_basic"], - dimensions="scalar", - defaultval="gau_energy", - mnemonics="Variational Polaron eQuations: A_nk-coefficients SEED", - requires="[[eph_task]] == 13", - added_in_version="10.1.4", - text=r""" +), + +Variable( + abivarname="vpq_aseed", + varset="eph", + vartype="string", + topics=["Polaron_basic"], + dimensions="scalar", + defaultval="gau_energy", + mnemonics="Variational Polaron eQuations: A_nk-coefficients SEED", + requires="[[eph_task]] == 13", + added_in_version="10.1.4", + text=r""" This variable specifies the type of initial seed for the electronic coefficients $A_{n\mathbf{k}}$, defining the charge localization in the variational polaron equations. @@ -25590,19 +27435,23 @@ - "even" --> Even contribution from each electronic state $\psi_n{\mathbf{k}}$. +- "localize" --> Localize polaron on a specific atom. See [[vpq_atloc]] for details. + """, - ), - Variable( - abivarname="vpq_pkind", - varset="eph", - vartype="string", - topics=["Polaron_compulsory"], - dimensions="scalar", - defaultval="None", - mnemonics="Variational Polaron eQuations: Polaron KIND", - requires="[[eph_task]] == 13", - added_in_version="10.1.4", - text=r""" +), + + +Variable( + abivarname="vpq_pkind", + varset="eph", + vartype="string", + topics=["Polaron_compulsory"], + dimensions="scalar", + defaultval="None", + mnemonics="Variational Polaron eQuations: Polaron KIND", + requires="[[eph_task]] == 13", + added_in_version="10.1.4", + text=r""" This variable specifies the kind of polaron to be obtained within the variational polaron equations framework. @@ -25623,19 +27472,139 @@ If the "hole" option is chosen, valence states are flipped, so one always deals with a minimization problem, regardless of the polaron kind. + """, - ), - Variable( - abivarname="vpq_avg_g", - varset="eph", - vartype="integer", - topics=["Polaron_basic"], - dimensions="scalar", - defaultval=0, - mnemonics="Variational Polaron eQuations: AVeraGe matrix-elements at Gamma", - requires="[[eph_task]] == 13", - added_in_version="10.1.4", - text=r""" +), + + +Variable( + abivarname="vpq_atloc", + varset="eph", + vartype="integer", + topics=["Polaron_basic"], + dimensions="scalar", + defaultval=0, + mnemonics="Variational Polaron eQuations: ATom LOCalization site", + requires="[[eph_task]] == 13", + added_in_version="10.8.1", + text=r""" +If non-zero and [[vpq_aseed]] = "localize", selects an atomic site at which to +localize the polaron. The value must be between 1 and specifies the index of the +atom in the [[typat]] array on which the polaron is to be localized. + +The [[chrgat]] variable must also be provided. Together with [[vpq_atloc]], it is +used to assign "artificial" charges to all atoms in the unit cell. For an ionic +solid, the oxidation states of the atoms generally provide a good guess. + +The algorithm then places an additional "artificial" charge ($\pm 1$) on the atom +selected by [[vpq_atloc]], for [[vpq_pkind]] = "hole"/"electron", respectively, +and introduces a local distortion based on Coulomb-like interactions with the +surrounding atoms. The resulting geometry is used as the starting guess for the +polaron geometry. + +!!! note + + For instance, consider an electron polaron in rutile TiO$_2$. If [[typat]] is + given by `1 1 2 2 2 2`, where 1 corresponds to titanium atoms and 2 to oxygen + atoms, then [[vpq_atloc]] = 1 makes the code localize the polaron on the first + Ti atom. The corresponding [[chrgat]] could be chosen as + `4 4 -2 -2 -2 -2`. + +""", +), + +Variable( + abivarname="vpq_mode", + varset="eph", + vartype="string", + topics=["Polaron_basic"], + dimensions="scalar", + defaultval="polaron", + mnemonics="Variational Polaron eQuations: MODE", + requires="[[eph_task]] == 13", + added_in_version="10.8.1", + text=r""" +Specifies the calculation mode for the variational polaron equations. + +Possible values: + +- "polaron" --> Optimises the polaron binding energy to obtain a polaron solution. + +- "hopping" --> Optimises the minimum-energy path between initial and final polaron solutions. + +!!! important + + In the "hopping" mode, the initial solution must be read from the file + specified by [[vpq_hop_from_filepath]]. + + The final solution can either be generated by translating the initial + solution according to [[vpq_hop_vec]] or read from the file specified by + [[vpq_hop_to_filepath]]. + + When both initial and final solutions are read from files, their centres + must be specified using [[vpq_hop_from_site]] and [[vpq_hop_to_site]], + respectively. In this case, [[vpq_hop_vec]] specifies the translation of + the final polaron relative to the initial one. + +""", +), + + +Variable( + abivarname="vpq_hop_from_ip", + varset="eph", + vartype="integer", + topics=["Polaron_expert"], + dimensions="scalar", + defaultval=1, + mnemonics="Variational Polaron eQuations: HOPping FROM Ith Polaron state", + requires="[[eph_task]] == 13", + added_in_version="10.8.1", + text=r""" +Selects the index of the initial polaron state in +[[vpq_hop_from_filepath]]. + +This variable is only relevant when [[vpq_hop_from_filepath]] contains +multiple polaron states, obtained from a calculation with +[[vpq_nstates]] > 1. + +""", +), + +Variable( + abivarname="vpq_hop_to_ip", + varset="eph", + vartype="integer", + topics=["Polaron_expert"], + dimensions="scalar", + defaultval=1, + mnemonics="Variational Polaron eQuations: HOPping TO Ith Polaron state", + requires="[[eph_task]] == 13", + added_in_version="10.8.1", + text=r""" +Selects the index of the final polaron state in +[[vpq_hop_to_filepath]]. + +This variable is only relevant when [[vpq_hop_to_filepath]] contains +multiple polaron states, obtained from a calculation with +[[vpq_nstates]] > 1. + +""", +), + + + +Variable( + abivarname="vpq_avg_g", + varset="eph", + vartype="integer", + topics=["Polaron_basic"], + dimensions="scalar", + defaultval=0, + mnemonics="Variational Polaron eQuations: AVeraGe matrix-elements at Gamma", + requires="[[eph_task]] == 13", + added_in_version="10.1.4", + text=r""" If non-zero, this variable activates the correction to the electron-phonon matrix elements' Fröhlich divergence. In this sense, correction terms $g^\mathrm{avg}_\nu(0)$ are added to the matrix @@ -25668,18 +27637,20 @@ This option is expected to accelerate the convergence of the optimization process. """, - ), - Variable( - abivarname="vpq_interp", - varset="eph", - vartype="integer", - topics=["Polaron_basic"], - dimensions="scalar", - defaultval=0, - mnemonics="Variational Polaron eQuations: INTERPolation", - requires="[[eph_task]] == 13", - added_in_version="10.1.4", - text=r""" +), + + +Variable( + abivarname="vpq_interp", + varset="eph", + vartype="integer", + topics=["Polaron_basic"], + dimensions="scalar", + defaultval=0, + mnemonics="Variational Polaron eQuations: INTERPolation", + requires="[[eph_task]] == 13", + added_in_version="10.1.4", + text=r""" If non-zero, this variable activates the interpolation of the initial guess for the electronic vector in the variational polaron equations. In this case, the code reads a pre-existing VPQ.nc file and performs a linear @@ -25693,23 +27664,29 @@ This option is expected to lead the optimization process to the same polaronic configuration and accelerate the convergence. """, - ), - Variable( - abivarname="vpq_nstates", - varset="eph", - vartype="integer", - topics=["Polaron_basic"], - dimensions="scalar", - defaultval=1, - mnemonics="Variational Polaron eQuations: Number of polaronic STATES", - requires="[[optdriver]] == 7 and [[eph_task]] == 13", - added_in_version="10.1.4", - text=r""" +), + + +Variable( + abivarname="vpq_nstates", + varset="eph", + vartype="integer", + topics=["Polaron_basic"], + dimensions="scalar", + defaultval=1, + mnemonics="Variational Polaron eQuations: Number of polaronic STATES", + requires="[[optdriver]] == 7 and [[eph_task]] == 13", + added_in_version="10.1.4", + text=r""" This variable specifies the number of polaronic states to be found by solving the variational polaron equations. -Each new state is found by imposing the orthogonalization constraint to all + +If [[vpq_mode]] = "polaron", each new state is found by imposing the orthogonalization constraint to all previously found states during the optimization process. +If [[vpq_mode]] = "hopping", it specifies the number of images, representing the energy +path, connecting polaronic solutions. + !!! important Since polaronic solutions are not necessarily orthogonal to each other, only the @@ -25724,51 +27701,74 @@ In order to eliminate such trivial solutions, the [[vpq_translate]] variable can be used. """, - ), - Variable( - abivarname="vpq_nstep", - varset="eph", - vartype="integer", - topics=["Polaron_basic"], - dimensions="scalar", - defaultval=50, - mnemonics="Variational Polaron eQuations: Number of iteration STEPs", - requires="[[optdriver]] == 7 and [[eph_task]] == 13", - added_in_version="10.1.4", - text=r""" +), + +Variable( + abivarname="vpq_nstep", + varset="eph", + vartype="integer", + topics=["Polaron_basic"], + dimensions="scalar", + defaultval=50, + mnemonics="Variational Polaron eQuations: Number of iteration STEPs", + requires="[[optdriver]] == 7 and [[eph_task]] == 13", + added_in_version="10.1.4", + text=r""" This variables sets the maximum number of iterations in the optimization of variational polaron equations. """, - ), - Variable( - abivarname="vpq_select", - varset="eph", - vartype="integer", - topics=["Polaron_basic"], - dimensions="scalar", - defaultval=-1, - mnemonics="Variational Polaron eQuations: SELECT polaronic state", - requires="[[eph_task]] == 13", - added_in_version="10.1.4", - text=r""" +), + + +Variable( + abivarname="vpq_hop_nstep", + varset="eph", + vartype="integer", + topics=["Polaron_basic"], + dimensions="scalar", + defaultval=1, + mnemonics="Variational Polaron eQuations, HOPping: Number of iteration STEPs", + requires="[[optdriver]] == 7 and [[eph_task]] == 13", + added_in_version="10.8.1", + text=r""" +Sets the maximum number of iterations used to optimise the polaron hopping +path with the string method. + +""", +), + + + +Variable( + abivarname="vpq_select", + varset="eph", + vartype="integer", + topics=["Polaron_basic"], + dimensions="scalar", + defaultval=-1, + mnemonics="Variational Polaron eQuations: SELECT polaronic state", + requires="[[eph_task]] == 13", + added_in_version="10.1.4", + text=r""" If non-zero, this variable selects a single polaronic state to be optimized from a **pre-existing** VPQ.nc file. It requires [[eph_restart]] == 1 or [[vpq_interp]] == 1. Additionally, since a single polaronic state is selected, [[vpq_nstates]] must be 1 in the input file. """, - ), - Variable( - abivarname="vpq_mesh_fact", - varset="eph", - vartype="integer", - topics=["Polaron_basic"], - dimensions="scalar", - defaultval=1, - mnemonics="Variational Polaron eQuations: SCALE MESH for polaron wavefunction", - requires="[[eph_task]] == -13", - added_in_version="10.1.4", - text=r""" +), + +Variable( + abivarname="vpq_mesh_fact", + varset="eph", + vartype="integer", + topics=["Polaron_basic"], + dimensions="scalar", + defaultval=1, + mnemonics="Variational Polaron eQuations: SCALE MESH for polaron wavefunction", + requires="[[eph_task]] == -13", + added_in_version="10.1.4", + text=r""" This variable can used to reduce the density of the real-space mesh used to represent the polaron wavefunction and generate the XSF file when [[eph_task]] == -13. This is especially useful when computing the variational polaron equations on extra-dense $\kk$-meshes in conjunction with the @@ -25779,120 +27779,276 @@ If [[vpq_mesh_fact]] is greater than one, the mesh in real space will be downsampled by this value along the three reduced direction with a significant decrease in memory requirements. """, - ), - Variable( - abivarname="vpq_tolgrs", - varset="eph", - vartype="real", - topics=["Polaron_basic"], - dimensions="scalar", - defaultval=1e-6, - mnemonics="Variational Polaron eQuations: TOLerance on the Gradient ReSidual", - requires="[[eph_task]] == 13", - added_in_version="10.1.4", - text=r""" +), + +Variable( + abivarname="vpq_tolgrs", + varset="eph", + vartype="real", + topics=["Polaron_basic"], + dimensions="scalar", + defaultval=1e-6, + mnemonics="Variational Polaron eQuations: TOLerance on the Gradient ReSidual", + requires="[[eph_task]] == 13", + added_in_version="10.1.4", + text=r""" This variable sets a tolerance for the electronic gradient residual in the optimization of the variational polaron equations. When reached, the iterative process will terminate for the current polaronic state and move to the next one, up to [[vpq_nstates]] """, - ), - Variable( - abivarname="vpq_gpr_energy", - varset="eph", - vartype="real", - topics=["Polaron_basic"], - dimensions="(2)", - defaultval=[0, 1], - mnemonics="Variational Polaron eQuations: Gaussian PaRameters -- electronic ENERGY", - requires='[[eph_task]] == 13 and [[vpq_aseed]] == "gau_energy"', - added_in_version="10.1.4", - text=r""" +), + +Variable( + abivarname="vpq_hop_tolgrs", + varset="eph", + vartype="real", + topics=["Polaron_basic"], + dimensions="scalar", + defaultval=1e-6, + mnemonics="Variational Polaron eQuations, HOPping: TOLerance on the Gradient ReSidual", + requires="[[eph_task]] == 13", + added_in_version="10.8.1", + text=r""" +Sets the convergence tolerance for the maximum displacement of the string +representing the minimum-energy path. + +The string-method optimisation terminates when this displacement falls below +the specified tolerance. + +""", +), + + +Variable( + abivarname="vpq_hop_ts", + varset="eph", + vartype="real", + topics=["Polaron_basic"], + dimensions="scalar", + defaultval=0, + mnemonics="Variational Polaron eQuations, HOPping: Time Step", + requires="[[eph_task]] == 13", + added_in_version="10.8.1", + text=r""" +Sets the time step used to evolve the string representing the minimum-energy +path. + +If set to zero, the time step is estimated automatically. At present, however, +this estimate may be too large and cause the optimisation to diverge. + +It is therefore advisable to test several values of [[vpq_hop_ts]] and select +an appropriate value manually. Values in the range 1e4--5e4 may provide a +useful starting point. + +""", +), + + +Variable( + abivarname="vpq_efilter", + varset="eph", + vartype="real", + topics=["Polaron_expert"], + dimensions="scalar", + characteristics=["[[ENERGY]]"], + defaultval=0, + mnemonics="Variational Polaron eQuations: Energy FILTER", + requires="[[eph_task]] == 13", + added_in_version="10.8.1", + text=r""" +If non-zero, activates energy-based post-filtering of the electronic states +participating in polaron formation. + +This variable should not be confused with [[gstore_erange]], which applies +pre-filtering in $\mathbf{k}$ space. + +During the variational optimisation, coefficients $A_{n\mathbf{k}}$ are set +to zero for states lying outside an energy window of width [[vpq_efilter]] +around the relevant band edge: the CBM for an electron polaron and the VBM +for a hole polaron. + +""", +), + + +Variable( + abivarname="vpq_hop_from_site", + varset="eph", + vartype="integer", + topics=["Polaron_expert"], + dimensions="(3)", + defaultval=[0, 0, 0], + mnemonics="Variational Polaron eQuations: HOPping FROM SITE", + requires="[[eph_task]] == 13", + added_in_version="10.8.1", + text=r""" +Specifies the site associated with the initial polaron within the +Born-von Karman supercell. + +The three integers define the origin of the corresponding unit cell in the +basis of the primitive lattice vectors. + +The latter can be obtained by visualizing the polaron in real space using + [[eph_task]] = -13. + +""", +), + +Variable( + abivarname="vpq_hop_to_site", + varset="eph", + vartype="integer", + topics=["Polaron_expert"], + dimensions="(3)", + defaultval=[0, 0, 0], + mnemonics="Variational Polaron eQuations: HOPping TO SITE", + requires="[[eph_task]] == 13", + added_in_version="10.8.1", + text=r""" +Specifies the site associated with the final polaron within the +Born-von Karman supercell. + +The three integers define the origin of the corresponding unit cell in the +basis of the primitive lattice vectors. + +The latter can be obtained by visualizing the polaron in real space using + [[eph_task]] = -13. + +""", +), + + +Variable( + abivarname="vpq_hop_vec", + varset="eph", + vartype="real", + topics=["Polaron_basic"], + dimensions="(3)", + defaultval=[0, 0, 0], + mnemonics="Variational Polaron eQuations: HOPping VECtor", + requires="[[eph_task]] == 13 and [[vpq_mode]] == 'hopping'", + added_in_version="10.8.1", + text=r""" +Specifies, in the unit-cell basis, the translation of the final polaron +relative to the initial one. + +When [[vpq_hop_to_filepath]] is not provided, the final polaron solution is +generated by applying this translation to the initial solution read from +[[vpq_hop_from_filepath]]. + +When [[vpq_hop_to_filepath]] is provided, this variable specifies the +translation of the final polaron read from that file relative to the initial +polaron. The centres of the two polarons must then be specified using +[[vpq_hop_from_site]] and [[vpq_hop_to_site]]. + +""", +), + + + +Variable( + abivarname="vpq_gpr_energy", + varset="eph", + vartype="real", + topics=["Polaron_basic"], + dimensions=[2], + defaultval=[0, 1], + mnemonics="Variational Polaron eQuations: Gaussian PaRameters -- electronic ENERGY", + requires='[[eph_task]] == 13 and [[vpq_aseed]] == "gau_energy"', + added_in_version="10.1.4", + text=r""" If [[vpq_aseed]] == "gau_energy", this variable defines the mean value and the standard deviation as [[vpq_gpr_energy]](:) = $\mu$, $\sigma$ for the Gaussian function to be used as the initial seed for the electronic vector coefficients. See [[vpq_aseed]] for details. """, - ), - Variable( - abivarname="vpq_trvec", - varset="eph", - vartype="real", - topics=["Polaron_basic"], - dimensions="(3)", - defaultval=[0, 0, 0], - mnemonics="Variational Polaron eQuations: TRanslation VECtor", - requires="[[eph_task]] == -13", - added_in_version="10.1.4", - text=r""" +), + +Variable( + abivarname="vpq_trvec", + varset="eph", + vartype="real", + topics=["Polaron_basic"], + dimensions=[3], + defaultval=[0, 0, 0], + mnemonics="Variational Polaron eQuations: TRanslation VECtor", + requires="[[eph_task]] == -13", + added_in_version="10.1.4", + text=r""" This variable specifies the translation vector (in unit cell basis) to be applied to the polaronic solution before visualisation with [[eph_task]] == -13. """, - ), - Variable( - abivarname="vpq_gpr_length", - varset="eph", - vartype="real", - topics=["Polaron_basic"], - dimensions="(3)", - defaultval=[1, 1, 1], - mnemonics="Variational Polaron eQuations: Gaussian PaRameters -- localization LENGTH", - requires='[[eph_task]] == 13 and [[vpq_aseed]] == "gau_length"', - added_in_version="10.1.4", - text=r""" +), + + +Variable( + abivarname="vpq_gpr_length", + varset="eph", + vartype="real", + topics=["Polaron_basic"], + dimensions=[3], + defaultval=[1, 1, 1], + mnemonics="Variational Polaron eQuations: Gaussian PaRameters -- localization LENGTH", + requires='[[eph_task]] == 13 and [[vpq_aseed]] == "gau_length"', + added_in_version="10.1.4", + text=r""" If [[vpq_aseed]] == "gau_length", this variable defines the estimated polaron localization lengths $a_x$, $a_y$, $a_z$ for the spread of the Gaussian function to be used as the initial seed for the electronic vector coefficients. See [[vpq_aseed]] for details. """, - ), - Variable( - abivarname="vpq_translate", - varset="eph", - vartype="integer", - topics=["Polaron_basic"], - dimensions="scalar", - defaultval=0, - mnemonics="Variational Polaron eQuations: TRANSLATE solutions", - requires="[[eph_task]] == 13 and [[vpq_nstates]] > 1", - added_in_version="10.1.4", - text=r""" +), + +Variable( + abivarname="vpq_translate", + varset="eph", + vartype="integer", + topics=["Polaron_basic"], + dimensions="scalar", + defaultval=0, + mnemonics="Variational Polaron eQuations: TRANSLATE solutions", + requires="[[eph_task]] == 13 and [[vpq_nstates]] > 1", + added_in_version="10.1.4", + text=r""" If non-zero and [[vpq_nstates]] > 1, this variable activates the translation of previously obtained polaronic solutions prior to solving the variational polaron equations for a new one. This helps to eliminate trivial states that are invariant under primitive translations. See also [[vpq_nstates]]. """, - ), - Variable( - abivarname="vpq_nstep_ort", - varset="eph", - vartype="integer", - topics=["Polaron_basic"], - dimensions="scalar", - defaultval=50, - mnemonics="Variational Polaron eQuations: Number of STEPs with ORThogonalisation", - requires="[[eph_task]] == 13 and [[vpq_nstates]] > 1", - added_in_version="10.1.4", - text=r""" +), + +Variable( + abivarname="vpq_nstep_ort", + varset="eph", + vartype="integer", + topics=["Polaron_basic"], + dimensions="scalar", + defaultval=50, + mnemonics="Variational Polaron eQuations: Number of STEPs with ORThogonalisation", + requires="[[eph_task]] == 13 and [[vpq_nstates]] > 1", + added_in_version="10.1.4", + text=r""" This variable defines the number of optimization steps up to which the orthogonalization to previous polaronic solutions is enforced. After [[vpq_nstep_ort]], the orthogonalization constraint is lifted, allowing the polaron to fully relax while maintaining a distance from the previously obtained states. See also [[vpq_nstates]]. """, - ), - Variable( - abivarname="vpq_mix_fact", - varset="eph", - vartype="real", - topics=["Polaron_expert"], - dimensions="scalar", - defaultval=0.0, - mnemonics="Variational Polaron eQuations: MIXing FACTor", - requires="[[eph_task]] == 13", - added_in_version="10.1.4", - text=r""" +), + +Variable( + abivarname="vpq_mix_fact", + varset="eph", + vartype="real", + topics=["Polaron_expert"], + dimensions="scalar", + defaultval=0., + mnemonics="Variational Polaron eQuations: MIXing FACTor", + requires="[[eph_task]] == 13", + added_in_version="10.1.4", + text=r""" This variable defines the mixing factor $\alpha$ for vibrational coefficients $B_{\mathbf{q}\nu}$ during the optimization process, i.e., for the $n$-th step: @@ -25900,36 +28056,38 @@ In certain cases, mixing may be useful to facilitate the convergence of optimization. """, - ), - Variable( - abivarname="eph_fix_korq", - varset="eph", - vartype="string", - topics=["ElPhonInt_basic"], - dimensions="scalar", - defaultval="k", - mnemonics="Electron-PHonon: FIX K-point OR Q-point", - requires="[[eph_task]] == 18", - added_in_version="10.1.4", - text=r""" +), + +Variable( + abivarname="eph_fix_korq", + varset="eph", + vartype="string", + topics=["ElPhonInt_basic"], + dimensions="scalar", + defaultval="k", + mnemonics="Electron-PHonon: FIX K-point OR Q-point", + requires="[[eph_task]] == 18", + added_in_version="10.1.4", + text=r""" This variable defines whether one should fix the $\kk$-point or the $\qq$-point when computing the e-ph matrix elements g(k,q) along either a $\qq$-path or a $\kk$-path ([[eph_task]] == 18]. Use "k" to fix the k-point or "q" to fix the q-point. The other piece of information is given by [[eph_fix_wavevec]] that specifies the reduced coordinates of the wavevector. """, - ), - Variable( - abivarname="eph_fix_wavevec", - varset="eph", - vartype="real", - topics=["ElPhonInt_basic"], - dimensions=[3], - defaultval=[0, 0, 0], - mnemonics="Electron-PHonon: FIX WAVE-VECtor", - requires="[[eph_task]] == 18", - added_in_version="10.1.4", - text=r""" +), + +Variable( + abivarname="eph_fix_wavevec", + varset="eph", + vartype="real", + topics=["ElPhonInt_basic"], + dimensions=[3], + defaultval=[0, 0, 0], + mnemonics="Electron-PHonon: FIX WAVE-VECtor", + requires="[[eph_task]] == 18", + added_in_version="10.1.4", + text=r""" This variable defines the wavevector in reduced coordinates of the reciprocal lattice that should be fixed when computing the e-ph matrix elements g(k,q) along either a $\qq$-path or $\kk$-path ([[eph_task]] == 18]. The other piece of information is given by [[eph_fix_korq]] that specifies whether one should fix the $\kk$-point or the $\qq$-point. @@ -25981,66 +28139,71 @@ 0.5 0.25 0.75 ``` """, - ), - Variable( - abivarname="eph_path_brange", - varset="eph", - vartype="int", - topics=["ElPhonInt_useful"], - dimensions=[2], - defaultval=[0, 0], - mnemonics="Electron-PHonon: Band RANGE", - requires="[[eph_task]] == 18", - added_in_version="10.1.4", - text=r""" +), + + +Variable( + abivarname="eph_path_brange", + varset="eph", + vartype="integer", + topics=["ElPhonInt_useful"], + dimensions=[2], + defaultval=[0, 0], + mnemonics="Electron-PHonon: Band RANGE", + requires="[[eph_task]] == 18", + added_in_version="10.1.4", + text=r""" This variable defines the first and the last band that should be included when computing the e-ph matrix elements g(k,q) along either a $\qq$-path or $\kk$-path when [[eph_task]] == 18. One can use these two variables to select the band range of interest and skip, for instance, low-energy states. If not specified, all bands from 1 up to [[nband]] are included. If specified in input, eph_path_brange(2) must be <= [[nband]]. """, - ), - Variable( - abivarname="oracle_factor", - varset="gstate", - vartype="real", - topics=["TuningSpeedMem_expert"], - dimensions="scalar", - defaultval="0.1", - mnemonics="ORACLE in chebyshev filtering algorithm: FACTOR", - characteristics=["[[DEVELOP]]"], - added_in_version="10.3.4", - requires="[[wfoptalg]] == 111 and [[chebfi_oracle]] == 2", - text=r""" +), + +Variable( + abivarname="oracle_factor", + varset="gstate", + vartype="real", + topics=["TuningSpeedMem_expert"], + dimensions="scalar", + defaultval="0.1", + mnemonics="ORACLE in chebyshev filtering algorithm: FACTOR", + characteristics=["[[DEVELOP]]"], + added_in_version="10.3.4", + requires="[[wfoptalg]] == 111 and [[chebfi_oracle]] == 2", + text=r""" This parameter controls the convergence rate of the wave-functions when using the oracle in the Chebyshev algorithm. See [[chebfi_oracle]] for more information. """, - ), - Variable( - abivarname="oracle_min_occ", - varset="gstate", - vartype="real", - topics=["TuningSpeedMem_expert"], - dimensions="scalar", - defaultval="0.0001", - mnemonics="ORACLE in chebyshev filtering algorithm: MINimal OCCupancy", - characteristics=["[[DEVELOP]]"], - added_in_version="10.3.4", - requires="[[wfoptalg]] == 111 and [[chebfi_oracle]] > 0 and [[nbdbuf]] = -101", - text=r""" +), + +Variable( + abivarname="oracle_min_occ", + varset="gstate", + vartype="real", + topics=["TuningSpeedMem_expert"], + dimensions="scalar", + defaultval="0.0001", + mnemonics="ORACLE in chebyshev filtering algorithm: MINimal OCCupancy", + characteristics=["[[DEVELOP]]"], + added_in_version="10.3.4", + requires="[[wfoptalg]] == 111 and [[chebfi_oracle]] > 0 and [[nbdbuf]] = -101", + text=r""" This parameter controls the minimal occupancy when using the oracle in the Chebyshev algorithm. See [[chebfi_oracle]] for more information. """, - ), - Variable( - abivarname="scr_wrange", - varset="gw", - vartype="integer", - topics=["Susceptibility_useful"], - dimensions=[2], - defaultval=[0, 0], - mnemonics="SCReening frequency RANGE", - added_in_version="10.4.0", - requires="[[optdriver]] == 6", - text=r""" +), + +Variable( + abivarname="scr_wrange", + varset="gw", + vartype="integer", + topics=["Susceptibility_useful"], + dimensions=[2], + defaultval=[0, 0], + mnemonics="SCReening frequency RANGE", + added_in_version="10.4.0", + requires="[[optdriver]] == 6", + text=r""" This variable can be used to select a subset of frequencies in the Screening to be computed. Abinit will produce partial SCR files that can be merged with the mrgscr tool before starting the SIGMA calculation. @@ -26052,23 +28215,27 @@ with the first point being the static limit. As a consequence, the full set of frequencies spans the [1, 1 + nfreqim] range. """, - ), - Variable( - abivarname="use_gbt", - varset="gstate", - vartype="integer", - topics=["spinpolarisation_basic", "MagMom_useful"], - dimensions="scalar", - defaultval=0, - mnemonics="USE Generalized Bloch Theorem", - added_in_version="10.5.1", - text=r""" +), + +Variable( + abivarname="use_gbt", + varset="gstate", + vartype="integer", + topics=["spinpolarisation_basic", "MagMom_useful"], + dimensions="scalar", + defaultval=0, + mnemonics="USE Generalized Bloch Theorem", + added_in_version="10.5.1", + text=r""" If set to 1, the Generalized Bloch Theorem (GBT) is used to compute a spin-spiral with wavevector [[qgbt]]. The GBT requires [[nspinor]] = 2 and [[nspden]]=4, but is not compatible with spin-orbit coupling hence [[so_psp]] must be set to zero. Also, one has to disable spatial symmetries completely by setting [[nsym]] to 1, and time-reversal symmetry as well with [[kptopt]] = 4. +If set to 2, the GBT is used together with a projected spin-orbit coupling (SOC), +in which only the σ_z (S_z) component of the SOC operator is retained. + Note that, for the time being, [[use_gbt]] /= 0 requires: - NC pseudos (no PAW) @@ -26103,39 +28270,108 @@ either all-electron or PAW methods, and, when necessary, generating customized pseudopotentials for the magnetic species, starting from the input files available on the PseudoDojo website. """, - ), - Variable( - abivarname="qgbt", - varset="gstate", - vartype="real", - topics=["spinpolarisation_basic", "MagMom_useful"], - dimensions=[3], - defaultval=[0, 0, 0], - mnemonics="Q-point for Generalized Bloch Theorem in REDuced coordinates.", - added_in_version="10.5.1", - text=r""" +), + +Variable( + abivarname="qgbt", + varset="gstate", + vartype="real", + topics=["spinpolarisation_basic", "MagMom_useful"], + dimensions=[3], + defaultval=[0, 0, 0], + mnemonics="Q-point for Generalized Bloch Theorem in REDuced coordinates.", + added_in_version="10.5.1", + text=r""" Reduced coordinates of the wave-vector $\qq$ of the spin spiral when [[use_gbt]] /= 0. If you prefer to work only with cartesian coordinates, you may work entirely with "[[qgbt_cart]]" and ignore [[qgbt]], in which case [[qgbt]] must be absent from the input file. One and only one of [[qgbt]] or [[qgbt_cart]] must be provided. """, - ), - Variable( - abivarname="qgbt_cart", - varset="gstate", - vartype="real", - topics=["spinpolarisation_basic", "MagMom_useful"], - dimensions=[3], - defaultval=[0, 0, 0], - mnemonics="Q-point for Generalized Bloch Theorem in CARTesian coordinates.", - added_in_version="10.5.1", - text=r""" +), + +Variable( + abivarname="qgbt_cart", + varset="gstate", + vartype="real", + topics=["spinpolarisation_basic", "MagMom_useful"], + dimensions=[3], + defaultval=[0, 0, 0], + mnemonics="Q-point for Generalized Bloch Theorem in CARTesian coordinates.", + added_in_version="10.5.1", + text=r""" Cartesian coordinates of the wave-vector $\qq$ of the spin spiral when [[use_gbt]] /= 0. If [[qgbt]] is ABSENT from the input file and [[qgbt_cart]] is provided, then the values of [[qgbt]] will be computed from the provided [[qgbt_cart]] One and only one of [[qgbt]] or [[qgbt_cart]] must be provided. """, - ), +), + +Variable( + abivarname="spinaxis", + varset="gstate", + vartype="real", + topics=["spinpolarisation_basic", "MagMom_useful"], + dimensions=[3], + defaultval=[0, 0, 1], + mnemonics="Spin-quantization AXIS in CARTesian coordinates.", + added_in_version="10.7.0", + text=r""" +Cartesian coordinates of the global spin-quantization axis. +By default, the spin-quantization axis is aligned with the Cartesian z axis. +The variable [[spinaxis]] defines the orientation of spinor space spanned by the Pauli matrices \{\sigma_1,\sigma_2,\sigma_3\} +with respect to the Cartesian reference frame; in particular, it sets the \sigma_3 axis along the direction specified by [[spinaxis]]. +When [[spinaxis]] differs from its default value, it is recommended to specify magnetic vectors in Cartesian coordinates +using [[spinat_cart]] and [[hspinfield_cart]] rather than [[spinat]] and [[hspinfield]] who give the same quantities in the spinaxis coordinates.. +""", +), + +Variable( + abivarname="nslice", + varset="dev", + vartype="integer", + topics=["SCFAlgorithms_expert"], + dimensions="scalar", + defaultval=2, + mnemonics="Number of spectral SLICEs", + requires="[[wfoptalg]] = 112", + added_in_version="10.7.2", + text=r""" +Number of spectral slices to be used in Spectrum Slicing diagonalization algorithm. +Highly experimental, current implementation supports 2 slices. +""", +), + +Variable( + abivarname="nstep_mixed", + varset="dev", + vartype="integer", + topics=["SCFAlgorithms_expert"], + dimensions="scalar", + defaultval=0, + mnemonics="Number of STEPs for MIXED chebyshev filtering and spectrum slicing", + requires="[[wfoptalg]] = 112", + added_in_version="10.7.2", + text=r""" +Number of initial Chebyshev filtering SCF iterations before launching Spectrum Slicing. +This option is useful if Spectrum Slicing does not converge or converge very slowly during first iterations. +Highly experimental. +""", +), + +Variable( + abivarname="paral_slice", + varset="dev", + vartype="integer", + topics=["SCFAlgorithms_expert"], + dimensions="scalar", + defaultval=0, + mnemonics="PARALell option for spectral SLICE execution", + requires="[[wfoptalg]] = 112", + added_in_version="10.7.2", + text=r""" +Option for slice execution sequential [[paral_slice]] = 0 or parallel [[paral_slice]] = 1. Highly experimental. +""", +), ] diff --git a/abipy/abio/abivar_database/variables_aim.py b/abipy/abio/abivar_database/variables_aim.py index 5fa053918..8fd093308 100644 --- a/abipy/abio/abivar_database/variables_aim.py +++ b/abipy/abio/abivar_database/variables_aim.py @@ -1,3 +1,4 @@ + executable = "aim" try: @@ -7,72 +8,76 @@ pass ValueWithConditions = dict -Variable = dict +Variable=dict variables = [ - Variable( - abivarname="atom@aim", - varset="aim", - vartype="integer", - topics=["Bader_basic"], - dimensions="scalar", - defaultval=1, - mnemonics="index of ATOM", - added_in_version="before_v9", - text=r""" +Variable( + abivarname="atom@aim", + varset="aim", + vartype="integer", + topics=["Bader_basic"], + dimensions="scalar", + defaultval=1, + mnemonics="index of ATOM", + added_in_version="before_v9", + text=r""" Index of the investigated atom. """, - ), - Variable( - abivarname="atrad@aim", - varset="aim", - vartype="real", - topics=["Bader_expert"], - dimensions="scalar", - defaultval=1.0, - mnemonics="bader ATomic RADius", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="atrad@aim", + varset="aim", + vartype="real", + topics=["Bader_expert"], + dimensions="scalar", + defaultval=1.0, + mnemonics="bader ATomic RADius", + added_in_version="before_v9", + text=r""" A first estimation of the Bader radius (not too important - it is used only two times) """, - ), - Variable( - abivarname="coff1@aim", - varset="aim", - vartype="real", - topics=["Bader_expert"], - dimensions="scalar", - defaultval=0.98, - mnemonics="COeFFicient 1", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="coff1@aim", + varset="aim", + vartype="real", + topics=["Bader_expert"], + dimensions="scalar", + defaultval=0.98, + mnemonics="COeFFicient 1", + added_in_version="before_v9", + text=r""" See the input variable [[ratmin@aim]]. """, - ), - Variable( - abivarname="coff2@aim", - varset="aim", - vartype="real", - topics=["Bader_expert"], - dimensions="scalar", - defaultval=0.95, - mnemonics="COeFFicient 2", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="coff2@aim", + varset="aim", + vartype="real", + topics=["Bader_expert"], + dimensions="scalar", + defaultval=0.95, + mnemonics="COeFFicient 2", + added_in_version="before_v9", + text=r""" See the input variable [[ratmin@aim]]. """, - ), - Variable( - abivarname="crit@aim", - varset="aim", - vartype="integer", - topics=["Bader_compulsory"], - dimensions="scalar", - defaultval=0, - mnemonics="computation of CRITical points", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="crit@aim", + varset="aim", + vartype="integer", + topics=["Bader_compulsory"], + dimensions="scalar", + defaultval=0, + mnemonics="computation of CRITical points", + added_in_version="before_v9", + text=r""" Drives the computation of critical points. * [0] not @@ -96,17 +101,18 @@ surface determination), 2 is recommended. In all cases the number of neighbors considered is limited by distance cutoff (variable [[maxatd@aim]]) """, - ), - Variable( - abivarname="denout@aim", - varset="aim", - vartype="integer", - topics=["Bader_compulsory"], - dimensions="scalar", - defaultval=0, - mnemonics="electronic DENsity OUTput", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="denout@aim", + varset="aim", + vartype="integer", + topics=["Bader_compulsory"], + dimensions="scalar", + defaultval=0, + mnemonics="electronic DENsity OUTput", + added_in_version="before_v9", + text=r""" Output of the electronic density. The specification of the line (plane) in the real space must be given in the input variable [[vpts@aim]] and grid in [[ngrid@aim]]. It is also possible to get only the valence density or the core @@ -116,17 +122,18 @@ * 1, 1D distribution * 2, 2D distribution """, - ), - Variable( - abivarname="dltyp@aim", - varset="aim", - vartype="integer", - topics=["Bader_compulsory"], - dimensions="scalar", - defaultval=0, - mnemonics="Density or Laplacian TYP output", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="dltyp@aim", + varset="aim", + vartype="integer", + topics=["Bader_compulsory"], + dimensions="scalar", + defaultval=0, + mnemonics="Density or Laplacian TYP output", + added_in_version="before_v9", + text=r""" Specification of the contribution of the electronic density corresponding to the density and/or laplacian output (see [[denout@aim]] and [[lapout@aim]]) @@ -134,17 +141,18 @@ * 1, only the valence density * 2, only the core density """, - ), - Variable( - abivarname="dpclim@aim", - varset="aim", - vartype="real", - topics=["Bader_useful"], - dimensions="scalar", - defaultval="1.d-2", - mnemonics="DPCLIM", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="dpclim@aim", + varset="aim", + vartype="real", + topics=["Bader_useful"], + dimensions="scalar", + defaultval="1.d-2", + mnemonics="DPCLIM", + added_in_version="before_v9", + text=r""" If two "numerically different" critical points are separated by less than **dpclim**, they are considered to be the same critical point. This often happens because of numerical inaccuracies: one CP might be "seen" by two @@ -152,120 +160,128 @@ large, on the order of 60 Hartree. For less accurate calculations of the density, increase the default value to 5.d-2, let's say. """, - ), - Variable( - abivarname="foldep@aim", - varset="aim", - vartype="real", - topics=["Bader_expert"], - dimensions=[3], - defaultval="3*0.0", - mnemonics="FOLlow DEParture", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="foldep@aim", + varset="aim", + vartype="real", + topics=["Bader_expert"], + dimensions=[3], + defaultval="3*0.0", + mnemonics="FOLlow DEParture", + added_in_version="before_v9", + text=r""" Needed in the case [[aim:follow]]=1 only. Defines the starting point. """, - ), - Variable( - abivarname="follow@aim", - varset="aim", - vartype="integer", - topics=["Bader_compulsory"], - dimensions="scalar", - defaultval=0, - mnemonics="FOLLOW the gradient path", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="follow@aim", + varset="aim", + vartype="integer", + topics=["Bader_compulsory"], + dimensions="scalar", + defaultval=0, + mnemonics="FOLLOW the gradient path", + added_in_version="before_v9", + text=r""" Follow the gradient path to the corresponding atom starting from the position specified in the input variable [[aim:foldep]]. """, - ), - Variable( - abivarname="folstp@aim", - varset="aim", - vartype="real", - topics=["Bader_expert"], - dimensions="scalar", - defaultval=0.5, - mnemonics="FOLlow STeP", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="folstp@aim", + varset="aim", + vartype="real", + topics=["Bader_expert"], + dimensions="scalar", + defaultval=0.5, + mnemonics="FOLlow STeP", + added_in_version="before_v9", + text=r""" The first step for following the gradient path. """, - ), - Variable( - abivarname="gpsurf@aim", - varset="aim", - vartype="integer", - topics=["Bader_compulsory"], - dimensions="scalar", - defaultval=0, - mnemonics="GraPhic output for the bader SURFace", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="gpsurf@aim", + varset="aim", + vartype="integer", + topics=["Bader_compulsory"], + dimensions="scalar", + defaultval=0, + mnemonics="GraPhic output for the bader SURFace", + added_in_version="before_v9", + text=r""" Drives the graphic output (gnuplot script) of the irreducible part of the calculated Bader surface. * 0, not output * 1, output """, - ), - Variable( - abivarname="inpt@aim", - varset="aim", - vartype="integer", - topics=["Bader_expert"], - dimensions="scalar", - defaultval=100, - mnemonics="number of INtegration PoinTs", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="inpt@aim", + varset="aim", + vartype="integer", + topics=["Bader_expert"], + dimensions="scalar", + defaultval=100, + mnemonics="number of INtegration PoinTs", + added_in_version="before_v9", + text=r""" Number of radial points used for integration of the Bader charge (not too sensitive). """, - ), - Variable( - abivarname="irho@aim", - varset="aim", - vartype="integer", - topics=["Bader_compulsory"], - dimensions="scalar", - defaultval=0, - mnemonics="Integration of the charge density RHO", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="irho@aim", + varset="aim", + vartype="integer", + topics=["Bader_compulsory"], + dimensions="scalar", + defaultval=0, + mnemonics="Integration of the charge density RHO", + added_in_version="before_v9", + text=r""" Drives the integration of the charge of the Bader atom. * 0, not calculated * 1, calculated (usual mode) """, - ), - Variable( - abivarname="ivol@aim", - varset="aim", - vartype="integer", - topics=["Bader_compulsory"], - dimensions="scalar", - defaultval=0, - mnemonics="Integration of the VOLume", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="ivol@aim", + varset="aim", + vartype="integer", + topics=["Bader_compulsory"], + dimensions="scalar", + defaultval=0, + mnemonics="Integration of the VOLume", + added_in_version="before_v9", + text=r""" Drives the integration of the volume of the Bader atom. * 0, not calculated * 1, calculated """, - ), - Variable( - abivarname="lapout@aim", - varset="aim", - vartype="integer", - topics=["Bader_compulsory"], - dimensions="scalar", - defaultval=0, - mnemonics="electronic density LAPlacian OUTput", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="lapout@aim", + varset="aim", + vartype="integer", + topics=["Bader_compulsory"], + dimensions="scalar", + defaultval=0, + mnemonics="electronic density LAPlacian OUTput", + added_in_version="before_v9", + text=r""" Output of the laplacian of electronic density. The specification of the line (plane) in the real space must be given in the input variable [[aim:vpts]] and grid in [[aim:ngrid]]. It is also possible to get only the valence density or @@ -275,17 +291,18 @@ * 1, 1D distribution * 2, 2D distribution """, - ), - Variable( - abivarname="lgrad@aim", - varset="aim", - vartype="real", - topics=["Bader_useful"], - dimensions="scalar", - defaultval="1.d-12", - mnemonics="Low GRADient criterion", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="lgrad@aim", + varset="aim", + vartype="real", + topics=["Bader_useful"], + dimensions="scalar", + defaultval="1.d-12", + mnemonics="Low GRADient criterion", + added_in_version="before_v9", + text=r""" The search for one particular CP is decided to be successful when either the norm of the gradient of the electron density is smaller than **lgrad** or when the length of the planned search step is smaller than [[aim:lstep]]. If the @@ -295,59 +312,63 @@ criteria on [[aim:lgrad2]] and [[aim:lstep2]] are not satisfied, then the searching procedure continues with the next seed. """, - ), - Variable( - abivarname="lgrad2@aim", - varset="aim", - vartype="real", - topics=["Bader_useful"], - dimensions="scalar", - defaultval="1.d-5", - mnemonics="Low GRADient criterion 2", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="lgrad2@aim", + varset="aim", + vartype="real", + topics=["Bader_useful"], + dimensions="scalar", + defaultval="1.d-5", + mnemonics="Low GRADient criterion 2", + added_in_version="before_v9", + text=r""" Determines the criterion for deciding that a CP has been found. See [[aim:lgrad]] for more details. """, - ), - Variable( - abivarname="lstep@aim", - varset="aim", - vartype="real", - topics=["Bader_useful"], - dimensions="scalar", - defaultval="1.d-10", - mnemonics="Length of the planned search STEP", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="lstep@aim", + varset="aim", + vartype="real", + topics=["Bader_useful"], + dimensions="scalar", + defaultval="1.d-10", + mnemonics="Length of the planned search STEP", + added_in_version="before_v9", + text=r""" Determines the criterion for deciding a CP has been found. See [[aim:lgrad]] for more details. """, - ), - Variable( - abivarname="lstep2@aim", - varset="aim", - vartype="real", - topics=["Bader_useful"], - dimensions="scalar", - defaultval="1.d-5", - mnemonics="Length of the planned search STEP 2", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="lstep2@aim", + varset="aim", + vartype="real", + topics=["Bader_useful"], + dimensions="scalar", + defaultval="1.d-5", + mnemonics="Length of the planned search STEP 2", + added_in_version="before_v9", + text=r""" Determines the criterion for deciding that a CP has been found. See [[aim:lgrad]] for more details. """, - ), - Variable( - abivarname="maxatd@aim", - varset="aim", - vartype="real", - topics=["Bader_useful"], - dimensions="scalar", - defaultval=10.0, - mnemonics="MAXimal ATomic Distance", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="maxatd@aim", + varset="aim", + vartype="real", + topics=["Bader_useful"], + dimensions="scalar", + defaultval=10.0, + mnemonics="MAXimal ATomic Distance", + added_in_version="before_v9", + text=r""" Atoms within this maximal distance are considered in order to start the search of a CP. @@ -355,48 +376,51 @@ [[aim:nsc]] might be too small to actually lead to the consideration of all the desired atoms. """, - ), - Variable( - abivarname="maxcpd@aim", - varset="aim", - vartype="real", - topics=["Bader_useful"], - dimensions="scalar", - defaultval=5.0, - mnemonics="MAXimal CP Distance", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="maxcpd@aim", + varset="aim", + vartype="real", + topics=["Bader_useful"], + dimensions="scalar", + defaultval=5.0, + mnemonics="MAXimal CP Distance", + added_in_version="before_v9", + text=r""" The CPs are searched for within this maximal distance. Note that the supercell, determined by [[aim:nsa]], [[aim:nsb]], and [[aim:nsc]] might be too small to actually lead to the consideration of all the critical points. """, - ), - Variable( - abivarname="ngrid@aim", - varset="aim", - vartype="integer", - topics=["Bader_expert"], - dimensions=[2], - defaultval="2*30", - mnemonics="Number of GRID points", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="ngrid@aim", + varset="aim", + vartype="integer", + topics=["Bader_expert"], + dimensions=[2], + defaultval="2*30", + mnemonics="Number of GRID points", + added_in_version="before_v9", + text=r""" Defines the grid in real space, for the density and laplacian outputs, governed by [[aim:denout]] and [[aim:lapout]]. """, - ), - Variable( - abivarname="nphi@aim", - varset="aim", - vartype="integer", - topics=["Bader_basic"], - dimensions="scalar", - defaultval=48, - mnemonics="Number of PHI angle", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="nphi@aim", + varset="aim", + vartype="integer", + topics=["Bader_basic"], + dimensions="scalar", + defaultval=48, + mnemonics="Number of PHI angle", + added_in_version="before_v9", + text=r""" With [[aim:ntheta]], this variable defines the angular grid for the integration within the Bader volume, in particular, the number of phi angles, to be used between [[aim:phimin]] and [[aim:phimax]]. When the difference @@ -404,17 +428,18 @@ When it is $\pi$ (for symmetry reasons), the recommended value is 32. When it is $\pi$/2 (for symmetry reasons), the recommended value is 20. """, - ), - Variable( - abivarname="nsa@aim", - varset="aim", - vartype="integer", - topics=["Bader_expert"], - dimensions="scalar", - defaultval=3, - mnemonics="Number of Supercell points in direction A", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="nsa@aim", + varset="aim", + vartype="integer", + topics=["Bader_expert"], + dimensions="scalar", + defaultval=3, + mnemonics="Number of Supercell points in direction A", + added_in_version="before_v9", + text=r""" These variables define a "supercell", from the primitive cell repeated along each primitive direction. This supercell is build as follows: @@ -430,17 +455,18 @@ enddo enddo """, - ), - Variable( - abivarname="nsb@aim", - varset="aim", - vartype="integer", - topics=["Bader_expert"], - dimensions="scalar", - defaultval=3, - mnemonics="Number of Supercell points in direction B", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="nsb@aim", + varset="aim", + vartype="integer", + topics=["Bader_expert"], + dimensions="scalar", + defaultval=3, + mnemonics="Number of Supercell points in direction B", + added_in_version="before_v9", + text=r""" These variables define a "supercell", from the primitive cell repeated along each primitive direction. This supercell is build as follows: @@ -456,17 +482,18 @@ enddo enddo """, - ), - Variable( - abivarname="nsc@aim", - varset="aim", - vartype="integer", - topics=["Bader_expert"], - dimensions="scalar", - defaultval=3, - mnemonics="Number of Supercell points in direction C", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="nsc@aim", + varset="aim", + vartype="integer", + topics=["Bader_expert"], + dimensions="scalar", + defaultval=3, + mnemonics="Number of Supercell points in direction C", + added_in_version="before_v9", + text=r""" These variables define a "supercell", from the primitive cell repeated along each primitive direction. This supercell is build as follows: @@ -482,77 +509,82 @@ enddo enddo """, - ), - Variable( - abivarname="ntheta@aim", - varset="aim", - vartype="integer", - topics=["Bader_basic"], - dimensions="scalar", - defaultval=32, - mnemonics="Number of THETA angles", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="ntheta@aim", + varset="aim", + vartype="integer", + topics=["Bader_basic"], + dimensions="scalar", + defaultval=32, + mnemonics="Number of THETA angles", + added_in_version="before_v9", + text=r""" With [[aim:nphi]], this variable defines the angular grid for the integration within the Bader volume, in particular, the number of theta angles, to be used between [[aim:thetamin]] and [[aim:thetamax]]. When the difference between these two variables is $\pi$, the recommended value of **ntheta** is 32. When it is $\pi$/2 (for symmetry reasons), the recommended value is 20. """, - ), - Variable( - abivarname="phimax@aim", - varset="aim", - vartype="real", - topics=["Bader_basic"], - dimensions="scalar", - defaultval=2.0, - mnemonics="PHI MAXimal angle", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="phimax@aim", + varset="aim", + vartype="real", + topics=["Bader_basic"], + dimensions="scalar", + defaultval=2.0, + mnemonics="PHI MAXimal angle", + added_in_version="before_v9", + text=r""" Angular limits of integration of the Bader volume for the phi variables. The number of integration points is given by [[aim:nphi]]. The range of integration can be decreased if there are symmetry reasons for doing this. """, - ), - Variable( - abivarname="phimin@aim", - varset="aim", - vartype="real", - topics=["Bader_expert"], - dimensions="scalar", - defaultval=0.0, - mnemonics="PHI MINimal angle", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="phimin@aim", + varset="aim", + vartype="real", + topics=["Bader_expert"], + dimensions="scalar", + defaultval=0.0, + mnemonics="PHI MINimal angle", + added_in_version="before_v9", + text=r""" Angular limits of integration of the Bader volume for the phi variables. The number of integration points is given by [[aim:nphi]]. The range of integration can be decreased if there are symmetry reasons for doing this. """, - ), - Variable( - abivarname="radstp@aim", - varset="aim", - vartype="real", - topics=["Bader_expert"], - dimensions="scalar", - defaultval=0.05, - mnemonics="RADial STeP", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="radstp@aim", + varset="aim", + vartype="real", + topics=["Bader_expert"], + dimensions="scalar", + defaultval=0.05, + mnemonics="RADial STeP", + added_in_version="before_v9", + text=r""" The length of the first step in the search of the exact Bader radius. """, - ), - Variable( - abivarname="ratmin@aim", - varset="aim", - vartype="real", - topics=["Bader_expert"], - dimensions="scalar", - defaultval=1.0, - mnemonics="Radius Atomic MINimal", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="ratmin@aim", + varset="aim", + vartype="real", + topics=["Bader_expert"], + dimensions="scalar", + defaultval=1.0, + mnemonics="Radius Atomic MINimal", + added_in_version="before_v9", + text=r""" The first estimation of the smallest radius of the basin of the atom (the distance at which the procedure that follows the gradient path announces that the gradient path finishes in the corresponding atom) This parameter is very @@ -563,111 +595,119 @@ nearest bonding CP. If there is a problem later, [[aim:coff2]] (default 0.95) is used instead. """, - ), - Variable( - abivarname="rsurdir@aim", - varset="aim", - vartype="real", - topics=["Bader_expert"], - dimensions=[2], - defaultval="2*0.0", - mnemonics="Radius SURface DIRection", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="rsurdir@aim", + varset="aim", + vartype="real", + topics=["Bader_expert"], + dimensions=[2], + defaultval="2*0.0", + mnemonics="Radius SURface DIRection", + added_in_version="before_v9", + text=r""" In the case [[aim:rsurf]]=1, gives the direction (angular coordinates theta,phi) along which the radius of the Bader surface is to be determined. """, - ), - Variable( - abivarname="rsurf@aim", - varset="aim", - vartype="integer", - topics=["Bader_compulsory"], - dimensions="scalar", - defaultval=0, - mnemonics="computation of the Radius bader SURFace", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="rsurf@aim", + varset="aim", + vartype="integer", + topics=["Bader_compulsory"], + dimensions="scalar", + defaultval=0, + mnemonics="computation of the Radius bader SURFace", + added_in_version="before_v9", + text=r""" Drive the computation of the radius of the Bader surface for the angles specified in the input variable [[aim:rsurdir]] * 0, not calculated * 1, calculated """, - ), - Variable( - abivarname="scal@aim", - varset="aim", - vartype="real", - topics=["Bader_expert"], - dimensions=[3], - defaultval="1.0 1.0 1.0", - mnemonics="SCALing of the cartesian coordinates", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="scal@aim", + varset="aim", + vartype="real", + topics=["Bader_expert"], + dimensions=[3], + defaultval="1.0 1.0 1.0", + mnemonics="SCALing of the cartesian coordinates", + added_in_version="before_v9", + text=r""" SCALing of the cartesian coordinates. """, - ), - Variable( - abivarname="surf@aim", - varset="aim", - vartype="integer", - topics=["Bader_compulsory"], - dimensions="scalar", - defaultval=0, - mnemonics="computation of the bader SURFace", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="surf@aim", + varset="aim", + vartype="integer", + topics=["Bader_compulsory"], + dimensions="scalar", + defaultval=0, + mnemonics="computation of the bader SURFace", + added_in_version="before_v9", + text=r""" Drive the computation of the full Bader surface. * 0, not calculated * 1, calculated """, - ), - Variable( - abivarname="thetamax@aim", - varset="aim", - vartype="real", - topics=["Bader_basic"], - dimensions="scalar", - defaultval=r"$\pi$", - mnemonics="THETA MAXimal angle", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="thetamax@aim", + varset="aim", + vartype="real", + topics=["Bader_basic"], + dimensions="scalar", + defaultval=r"$\pi$", + mnemonics="THETA MAXimal angle", + added_in_version="before_v9", + text=r""" Angular limits of integration of the Bader volume for the theta variables. The number of integration points is given by [[aim:ntheta]]. The range of integration can be decreased if there are symmetry reasons for doing this. """, - ), - Variable( - abivarname="thetamin@aim", - varset="aim", - vartype="real", - topics=["Bader_expert"], - dimensions="scalar", - defaultval=0.0, - mnemonics="THETA MINimal angle", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="thetamin@aim", + varset="aim", + vartype="real", + topics=["Bader_expert"], + dimensions="scalar", + defaultval=0.0, + mnemonics="THETA MINimal angle", + added_in_version="before_v9", + text=r""" Angular limits of integration of the Bader volume for the theta variables. The number of integration points is given by [[aim:ntheta]]. The range of integration can be decreased if there are symmetry reasons for doing this. """, - ), - Variable( - abivarname="vpts@aim", - varset="aim", - vartype="real", - topics=["Bader_useful"], - dimensions=[6], - defaultval="6*0.0", - mnemonics="Vectors defining the PoinTS of the surface", - commentdims="6 for 1D, 9 for 2D", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="vpts@aim", + varset="aim", + vartype="real", + topics=["Bader_useful"], + dimensions=[6], + defaultval="6*0.0", + mnemonics="Vectors defining the PoinTS of the surface", + commentdims="6 for 1D, 9 for 2D", + added_in_version="before_v9", + text=r""" Basic vectors of the line or rectangle in real space, defining the points for which the density or laplacian will be computed, thanks to [[aim:denout]] or [[aim:lapout]] """, - ), +), + ] diff --git a/abipy/abio/abivar_database/variables_anaddb.py b/abipy/abio/abivar_database/variables_anaddb.py index ef6ae1ea4..a890a20f4 100644 --- a/abipy/abio/abivar_database/variables_anaddb.py +++ b/abipy/abio/abivar_database/variables_anaddb.py @@ -1,3 +1,4 @@ + try: from abimkdocs.variables import MultipleValue, Range, ValueWithUnit except ImportError: @@ -27,6 +28,7 @@ are replaced by Gaussians of width **a2fsmear** (by default in Hartree). """, ), + Variable( abivarname="alphon@anaddb", varset="anaddb", @@ -45,6 +47,7 @@ of uniaxial crystals, the z-axis should be chosen along the optical axis. """, ), + Variable( abivarname="asr@anaddb", varset="anaddb", @@ -63,6 +66,12 @@ * 1 or 2 --> the ASR for interatomic force constants is imposed by modifying the on-site interatomic force constants, in a symmetric way ( **asr** =2), or in the more general case, unconstrained way ( **asr** =1). + * 6 --> impose ASR and rotational invariance on the interatomic force constants. + This requires the knowledge of the IFCS derivatives, estimated based on real-space + IFCs moments (requires [[anaddb:ifcflag]]=1) or reading them from flexoddb + (requires [[anaddb:flexoflag]]=1). Right now, scaling is not optimum with + the number of atoms, but it could be in principle improved using sparse matrix + algorithms. Additional information are provided at the end of this description. More detailed explanations: the total energy should be invariant under translation of the crystal as a whole. This would guarantee that the three @@ -70,7 +79,10 @@ Unfortunately, the way the DDB is generated (presence of a discrete grid of points for the evaluation of the exchange-correlation potential and energy) slightly breaks the translational invariance. Well, in some pathological -cases, the breaking can be rather important. +cases, the breaking can be rather important. Meanwhile, rotational invariance, +i.e. the total energy should be invariant under rotation and leaves no torque +on the atoms. Its imposition has different impacts depending on the dimensionality +of the problem, see [[anaddb:sys_dim]]. Two quantities are affected: the interatomic forces (or dynamical matrices), and the effective charges. The ASR for the effective charges is called the @@ -111,8 +123,20 @@ the breaking of the ASR is rather severe. In order to clear the situation, one should use a diagonalisation routine for non-hermitian matrices. ). + +For rotational infariance [[anaddb:asr]]==6, invariance is imposed on the zone-center +IFCs and/or their derivatives thanks to a Moore-Penrose pseudo-inverse, +correcting on-site and first-neigbhors interactions. In principle, rotational +invariance also propagates to the second derivatives of the IFCs, but this requires a +rotational-invariant long-range electrostatics treatments of the IFCs, which is now +missing both in 3D or in low-dimmensional materials. It is therefore deactivated. +As an extension, be very prudent when IFCs moments are used in combination to the +long-range electrostatic treatments of IFCs ([[anaddb:dipdip]]): they have been +tested on a limited amount of systems. + """, ), + Variable( abivarname="atifc@anaddb", varset="anaddb", @@ -127,6 +151,7 @@ to be written and eventually analysed. """, ), + # FIXME NOTE XG20170811: apparently no effective test for this input variable. Also, # the description is strange ...! Variable( @@ -143,6 +168,7 @@ Allow setting the target band gap, in eV. ([[anaddb:elphflag]]=1). """, ), + Variable( abivarname="brav@anaddb", varset="anaddb", @@ -180,6 +206,7 @@ based on Wigner-Seitz cells (new as v8.7). The default algorithm has a correct treatment of symmetries. """, ), + Variable( abivarname="chneut@anaddb", varset="anaddb", @@ -208,6 +235,7 @@ See also [[asr@anaddb]] and [[asr]]. """, ), + Variable( abivarname="dieflag@anaddb", varset="anaddb", @@ -253,6 +281,54 @@ So please set: [[anaddb:elaflag]]=2,3,4 or 5 and [[anaddb:instrflag]]=1 """, ), + + Variable( + abivarname="dielt_env@anaddb", + varset="anaddb", + vartype="real", + topics=["PhononBands_basic"], + dimensions="scalar", + defaultval=1, + mnemonics="DIELecTric constant ENVironment", + added_in_version="v10", + text=r""" + Dielectric constant of embedding dielectric materials when considering a bi-dimensional material. + Dipoles and dynamical quadrupoles generate an electrostatic potential that is reflected at the + dielectric interfaces with the environment (in ab initio calculations, typically vacuum). The sign + and amplitude of the reflection entirely depends on the dielectric mismatch. This variable fixes + such dielectric environment constant, allowing to compute the phonon band structure of a material + in different dielectric environment. The dielectric constant can be positive or negative (corresponding + to a metal where the plasmon frequency has been tuned by doping). + +""", + ), + Variable( + abivarname="dielt_thick@anaddb", + varset="anaddb", + vartype="real", + topics=["PhononBands_basic"], + dimensions="scalar", + defaultval=2, + mnemonics="dielectric thickness of 2D materials", + added_in_version="v10", + text=r""" + In low-dimensional materials, the electronic density doesn't extend infinitively in space, and it is + necessary to define a dielectric thickness when considering electrostatics in such a system (simple) + or several ones (more advanced electrostatic model) to add the potential variation along the z direction. + The embedding dielectric constant is controlled by [[anaddb:dielt_env]]. Right now two cases are possible: + + * If only the first value of [[anaddb:dielt_thick]] is non-zero, consider one dielectric constant for + the whole 2D (dielectric slab). Both in-plane and out-of-plane dipole responses are estimated using this + thickness. The dielectric constants of the 2D are then computed based on DFPT dielectric tensors with + vacuum considering capacitors in parallel or in series, respectively. + + * If two values are input, the first one corresponds to the total (outer) dielectric thickness + (beyond that value, the dielectric constant is fixed by [[anaddb:dielt_env]]), while the second gives + the inner dielectric thickness with the dielectric constant fixed to 1. The outer dielectric constant + is then computed based on DFPT dielectric tensors. +""", + ), + Variable( abivarname="dipdip@anaddb", varset="anaddb", @@ -284,8 +360,13 @@ [[anaddb:dipquad]] or [[anaddb:quadquad]] are set to 1. It is recommended to check that calculations with dipdip = 1 and -1 (both with dipquad = 0 and quadquad = 0) lead to identical results. Otherwise increase the resolution of the q-point grid and repeat this test. + + Note that when [[anaddb:sys_dim]] =2-4 (2D materials), a specific correction is applied to account to + the reduction of dimensionality and the appearance of potential reflections at the dielectric interfaces. + See [[anaddb:dielt_thick]] and [[anaddb:dielt_env]] for more information. """, ), + Variable( abivarname="dipquad@anaddb", varset="anaddb", @@ -311,6 +392,7 @@ If the DDB file does not contain the dynamical quadrupoles, this variable is automatically set to zero at runtime. """, ), + Variable( abivarname="quadquad@anaddb", varset="anaddb", @@ -336,6 +418,7 @@ If the DDB file does not contain the dynamical quadrupoles, this variable is automatically set to zero at runtime. """, ), + Variable( abivarname="dosdeltae@anaddb", varset="anaddb", @@ -352,6 +435,7 @@ Prior to v9.10, the default was 1 cm$^{-1}$. """, ), + Variable( abivarname="dossmear@anaddb", varset="anaddb", @@ -369,6 +453,7 @@ Prior to v9.10, the default was 5 cm$^{-1}$. """, ), + Variable( abivarname="dossum@anaddb", varset="anaddb", @@ -384,6 +469,7 @@ sum and difference are reported in the output file. """, ), + Variable( abivarname="dostol@anaddb", varset="anaddb", @@ -400,6 +486,7 @@ bigger is smaller than **dostol**. """, ), + Variable( abivarname="eivec@anaddb", varset="anaddb", @@ -415,6 +502,7 @@ * 4 --> generate output files for band2eps (drawing tool for the phonon band structure); """, ), + Variable( abivarname="elaflag@anaddb", varset="anaddb", @@ -453,6 +541,7 @@ into a new DDB file, which can contain both information. And the program will also check for the users. """, ), + Variable( abivarname="elph_fermie@anaddb", varset="anaddb", @@ -469,6 +558,7 @@ ([[anaddb:elphflag]]=1). """, ), + Variable( abivarname="elphflag@anaddb", varset="anaddb", @@ -482,6 +572,7 @@ If **elphflag** is 1, anaddb performs an analysis of the electron-phonon coupling. """, ), + Variable( abivarname="elphsmear@anaddb", varset="anaddb", @@ -496,6 +587,7 @@ Smearing width for the Fermi surface integration (in Hartree by default). """, ), + Variable( abivarname="enunit@anaddb", varset="anaddb", @@ -514,6 +606,7 @@ * 2 --> Hartree, cm$^{-1}$, meV, Thz, and Kelvin. """, ), + Variable( abivarname="ep_b_max@anaddb", varset="anaddb", @@ -531,6 +624,7 @@ [[anaddb:ep_b_min]] and **ep_b_max**. """, ), + Variable( abivarname="ep_b_min@anaddb", varset="anaddb", @@ -545,6 +639,7 @@ integration, instead of the upper bound. See also [[anaddb:telphint]]. """, ), + Variable( abivarname="ep_extrael@anaddb", varset="anaddb", @@ -563,6 +658,7 @@ used at the same time. ([[anaddb:elphflag]]=1). """, ), + Variable( abivarname="ep_int_gkk@anaddb", varset="anaddb", @@ -579,6 +675,7 @@ weights are treated symmetrically. """, ), + Variable( abivarname="ep_keepbands@anaddb", varset="anaddb", @@ -595,6 +692,7 @@ transport calculations **ep_keepbands** must be set to 1. """, ), + Variable( abivarname="ep_nqpt@anaddb", varset="anaddb", @@ -610,6 +708,7 @@ number of q-points to be found in the GKK file, independently of the normal anaddb input (ngqpt) """, ), + Variable( abivarname="ep_nspline@anaddb", varset="anaddb", @@ -624,6 +723,7 @@ time approximation ([[anaddb:ifltransport]]=3). """, ), + Variable( abivarname="ep_prt_yambo@anaddb", varset="anaddb", @@ -637,6 +737,7 @@ For electron-phonon calculations, print out matrix elements for use by the yambo code. """, ), + Variable( abivarname="ep_qptlist@anaddb", varset="anaddb", @@ -653,6 +754,7 @@ (ngqpt), in reduced coordinates of the reciprocal space lattice. """, ), + Variable( abivarname="ep_scalprod@anaddb", varset="anaddb", @@ -673,6 +775,23 @@ or high symmetry points. I do not know why... """, ), + + + Variable( + abivarname="eta@anaddb", + varset="anaddb", + vartype="real", + topics=["DFPT_expert", "ConstrainedDFPT_expert"], + dimensions="scalar", + defaultval=0.0, + mnemonics="causality ETA parameter", + characteristics=["[[DEVELOP]]"], + added_in_version="10.4", + text=r""" +This variable specifies the amplitude of the infinitesimal imaginary part used in the frequency interpolation of second-order quantities computed in a constrained DFPT ABINIT run, in order to account for causality and dissipation effects. +""", + ), + Variable( abivarname="flexoflag@anaddb", varset="anaddb", @@ -699,6 +818,28 @@ Requires a preceding generation of 2nd and 3rd order DDB with a [[lw_flexo]] = 1 or 4 run. """, ), + + + Variable( + abivarname="freqflag@anaddb", + varset="anaddb", + vartype="integer", + topics=["DFPT_expert","ConstrainedDFPT_expert"], + dimensions="scalar", + defaultval=3, + mnemonics="FREQuency interpolation FLAG", + characteristics=["[[DEVELOP]]"], + added_in_version="10.4", + text=r""" + +This variable selects the type of frequency interpolation applied to the second-order quantities computed in a constrained DFPT ABINIT run. + + * 1 --> Adiabatic (beyond-Born-Oppenheimer) dynamics. Equivalent to a linear-in-frequency interpolation. The zeroth-order terms are taken from the static ([[rfomega]] = 0.0) second-order DDB entries, while the first-order frequency terms are given by the Berry curvatures stored in the DDB file. This option requires [[timdisp@anaddb]] = 1 and allows to include dissipation via [[eta@anaddb]] /= 0.0. + * 2 --> Nonadiabatic polynomial interpolation. Uses DDB blocks computed at different [[rfomega]] values to perform a polynomial interpolation (using the polint routine). This option does not allow [[eta@anaddb]] /= 0.0. + * 3 --> Nonadiabatic polynomial interpolation with dissipation. Extracts the polynomial coefficients from the DDB blocks at different [[rfomega]] values using the polcoe routine, and then performs an analytical continuation to complex frequencies, where [[eta@anaddb]] enters as an infinitesimal imaginary part. +""", + ), + Variable( abivarname="freeze_displ@anaddb", varset="anaddb", @@ -730,32 +871,41 @@ be used with a small number [[anaddb:nph1l]] of q-points for interpolation. """, ), + Variable( abivarname="frmax@anaddb", varset="anaddb", vartype="real", - topics=["Phonons_useful"], + topics=["Phonons_useful", "ConstrainedDFPT_useful"], dimensions="scalar", defaultval=10.0, mnemonics="FRequency MAXimum", added_in_version="before_v9", text=r""" Value of the largest frequency for the frequency-dependent dielectric tensor, in Hartree. + +Starting from version 10.4, this variable specifies the largest frequency used for the +frequency interpolation of second-order quantities computed in a constrained DFPT ABINIT run. """, ), + Variable( abivarname="frmin@anaddb", varset="anaddb", vartype="real", - topics=["Phonons_useful"], + topics=["Phonons_useful", "ConstrainedDFPT_useful"], dimensions="scalar", defaultval=0.0, mnemonics="FRequency MINimum", added_in_version="before_v9", text=r""" Value of the lowest frequency for the frequency-dependent dielectric tensor, in Hartree. + +Starting from version 10.4, this variable specifies the lowest frequency used for the +frequency interpolation of second-order quantities computed in a constrained DFPT ABINIT run. """, ), + Variable( abivarname="gkqwrite@anaddb", varset="anaddb", @@ -770,6 +920,7 @@ gkqfile. This reduces strongly the memory needed for an electron-phonon run. """, ), + Variable( abivarname="gruns_ddbs@anaddb", varset="anaddb", @@ -791,6 +942,7 @@ computes the derivative of the dynamical matrix wrt the volume using central finite difference. """, ), + Variable( abivarname="gruns_nddbs@anaddb", varset="anaddb", @@ -808,6 +960,7 @@ possible responses. """, ), + Variable( abivarname="iatfix@anaddb", varset="anaddb", @@ -822,6 +975,7 @@ constrained polarization. See [[anaddb:polflag]]. """, ), + Variable( abivarname="iatprj_bs@anaddb", varset="anaddb", @@ -836,6 +990,7 @@ eigenvectors, giving a weighted phonon band structure file. """, ), + Variable( abivarname="ifcana@anaddb", varset="anaddb", @@ -862,6 +1017,7 @@ the matrix in local coordinates). """, ), + Variable( abivarname="ifcflag@anaddb", varset="anaddb", @@ -893,6 +1049,7 @@ for checking purpose, and if there is not enough information in the DDB. """, ), + Variable( abivarname="ifcout@anaddb", varset="anaddb", @@ -909,6 +1066,7 @@ distance with respect to the generic atom. """, ), + Variable( abivarname="ifltransport@anaddb", varset="anaddb", @@ -925,6 +1083,7 @@ calculates the k-dependent relaxation time. (needs [[anaddb:elphflag]] = 1) """, ), + Variable( abivarname="instrflag@anaddb", varset="anaddb", @@ -943,6 +1102,7 @@ Set [[rfstrs]] = 1, 2, or 3 (preferably 3). Set [[rfatpol]] and [[rfdir]] to do a full calculation of phonons at Q=0. """, ), + Variable( abivarname="istrfix@anaddb", varset="anaddb", @@ -982,6 +1142,7 @@ See [[anaddb:polflag]]. """, ), + Variable( abivarname="kptrlatt@anaddb", varset="anaddb", @@ -997,6 +1158,7 @@ calculations using nesting functions or tetrahedron integration. """, ), + Variable( abivarname="kptrlatt_fine@anaddb", varset="anaddb", @@ -1011,6 +1173,7 @@ Does not work yet, as of |today|. """, ), + Variable( abivarname="lwf_anchor_ibands@anaddb", varset="anaddb", @@ -1024,6 +1187,9 @@ The indices of bands of the anchor points. Together with the [[anaddb:lwf_anchor_qpt]], it gives the phonon modes used as anchor points. For example, lwf_anchor_qpt = 0.0 0.0 0.0 and lwf_anchor_ibands= 0 1 2 means the lowest three modes are used as anchor points. The number of anchor ibands should be equal to the number of Wannier functions. """, ), + + + Variable( abivarname="lwf_anchor_proj@anaddb", varset="anaddb", @@ -1042,6 +1208,9 @@ """, ), + + + Variable( abivarname="lwf_anchor_qpt@anaddb", varset="anaddb", @@ -1055,6 +1224,8 @@ The q-point of the anchor points. Together with the [[anaddb:lwf_anchor_ibands]], it gives the phonon modes used as anchor points. For example, lwf_anchor_qpt = 0.0 0.0 0.0 and lwf_anchor_ibands= 0 1 2 means the lowest three modes are used as anchor points. """, ), + + Variable( abivarname="lwf_disentangle@anaddb", varset="anaddb", @@ -1078,6 +1249,7 @@ """, ), + Variable( abivarname="lwf_mu@anaddb", varset="anaddb", @@ -1092,6 +1264,7 @@ See [[anaddb:lwf_disentangle]] for more details. """, ), + Variable( abivarname="lwf_sigma@anaddb", varset="anaddb", @@ -1106,6 +1279,9 @@ See [[anaddb:lwf_disentangle]] for more details. """, ), + + + Variable( abivarname="lwf_ngqpt@anaddb", varset="anaddb", @@ -1119,6 +1295,10 @@ The Monkhorst-Pack grid used for construction Lattice Wannier functions. """, ), + + + + Variable( abivarname="lwf_nwann@anaddb", varset="anaddb", @@ -1132,6 +1312,8 @@ The number of Lattice Wannier functions to be constructed. """, ), + + Variable( abivarname="lwf_projector@anaddb", varset="anaddb", @@ -1146,6 +1328,11 @@ For each atom, there are three displacements along x, y, and z in the cartesian coordinate. The list of the displacements are thus (atom 1, x), (atoms 1, y), (atom 1, z), (atom 2, x), etc. The lwf_projector option specifies the indices of the se displacement to be used as projectors. The number of the projectors should equal the number of wannier functions. """, ), + + + + + Variable( abivarname="lwfflag@anaddb", varset="anaddb", @@ -1164,6 +1351,77 @@ """, ), + + + Variable( + abivarname="magpen@anaddb", + varset="anaddb", + vartype="real", + topics=["DFPT_expert", "ConstrainedDFPT_expert"], + dimensions="scalar", + defaultval=0.0, + mnemonics="MAGnetic PENalty DFPT parameter", + characteristics=["[[DEVELOP]]"], + added_in_version="10.4", + text=r""" +This variable specifies the amplitude of the penalty function applied to the first-order local magnetic moments in a constrained DFPT calculation (see [[magpen]]). A nonzero value in an anaddb input activates the transformation of the second-order total-energy derivatives to the magnetic functional specified by [[mpopt@anaddb]]. + +The Legendre transformations between magnetic functionals require that the DDB file contain second-order data obtained from a set of local Zeeman-field linear-response calculations (see the [[rfmagn]] = 2 option), combined with a geometrically equivalent magnetic penalty. + +The penalized ions and directions are specified by [[mpatpol@anaddb]] and [[mpdir@anaddb]], respectively. +""", + ), + + + Variable( + abivarname="mpatpol@anaddb", + varset="anaddb", + vartype="integer", + topics=["DFPT_expert", "ConstrainedDFPT_expert"], + dimensions=[2], + defaultval=[1, "[[natom]]" ], + mnemonics="Magnetic Penalty: ATomic POLarisation", + characteristics=["[[DEVELOP]]"], + added_in_version="10.4", + text=r""" +This variable specifies the range of atoms to which a magnetic penalty has been applied in a constrained DFPT calculation on the first-order local magnetic moments. It may take values between 1 to [[natom]], with [[mpatpol]](1)<=[[mpatpol]](2). +In practice, the penalty is typically applied only to the magnetic ions. +""", + ), + + Variable( + abivarname="mpdir@anaddb", + varset="anaddb", + vartype="integer", + topics=["DFPT_expert", "ConstrainedDFPT_expert"], + dimensions=[3], + defaultval=[1, 1, 1], + mnemonics="Magnetic Penalty: DIRections", + characteristics=["[[DEVELOP]]"], + added_in_version="10.4", + text=r""" +Gives the Cartesian directions along which the first-order magnetic moments +have been constrained during a linear-response calculatiuon when [[magpen]]/= 0.0. +""", + ), + + Variable( + abivarname="mpopt@anaddb", + varset="anaddb", + vartype="integer", + topics=["DFPT_expert", "ConstrainedDFPT_expert"], + dimensions="scalar", + defaultval=2, + mnemonics="Magnetic Penalty: OPTion", + characteristics=["[[DEVELOP]]"], + added_in_version="10.4", + text=r""" +This variable sets the type of magnetic functional (see Ref. [[cite:Royo2019]]) to which the second-order total-energy derivatives computed with a magnetic penalty are transformed. + * 1 --> Fully constrained magnetic moments (spins fixed to the ground-state configuration) + * 2 --> Constrained Zeeman fields (spins allowed to relax) +""", + ), + Variable( abivarname="mustar@anaddb", varset="anaddb", @@ -1178,6 +1436,7 @@ superconducting Tc using Mc-Millan's formula. """, ), + Variable( abivarname="natfix@anaddb", varset="anaddb", @@ -1192,6 +1451,7 @@ polarization. See [[anaddb:polflag]]. """, ), + Variable( abivarname="natifc@anaddb", varset="anaddb", @@ -1206,6 +1466,7 @@ The list of these atoms is provided by [[anaddb:atifc]]. """, ), + Variable( abivarname="natprj_bs@anaddb", varset="anaddb", @@ -1220,6 +1481,7 @@ will be output. The list of these atoms is provided by [[anaddb:iatprj_bs]]. """, ), + Variable( abivarname="nchan@anaddb", varset="anaddb", @@ -1235,6 +1497,7 @@ frequency sampled. The first channel begins at 0. """, ), + Variable( abivarname="ndivsm@anaddb", varset="anaddb", @@ -1251,11 +1514,12 @@ along the path using the coordinates given in the array [[anaddb:qpath]]. """, ), + Variable( abivarname="nfreq@anaddb", varset="anaddb", vartype="integer", - topics=["Phonons_useful"], + topics=["Phonons_useful", "ConstrainedDFPT_useful"], dimensions="scalar", defaultval=1, mnemonics="Number of FREQuencies", @@ -1264,8 +1528,11 @@ Number of frequencies wanted for the frequency-dependent dielectric tensor. Should be positive. See [[anaddb:dieflag]]. The code will take **nfreq** equidistant values from [[anaddb:frmin]] to [[anaddb:frmax]]. + +Starting from version 10.4, this variable specifies the number of frequencies used for the frequency interpolation of second-order quantities computed in a constrained DFPT ABINIT run. """, ), + Variable( abivarname="ng2qpt@anaddb", varset="anaddb", @@ -1280,6 +1547,7 @@ Used for the integration of thermodynamical functions (Bose-Einstein distribution) or for the DOS. """, ), + Variable( abivarname="ngqpt@anaddb", varset="anaddb", @@ -1294,6 +1562,7 @@ Should correspond to the grid of points available in the DDB or to a sub-grid. """, ), + Variable( abivarname="ngrids@anaddb", varset="anaddb", @@ -1311,6 +1580,7 @@ ngqpt_igrid(ii)=(igrid ng2qpt(ii))/[[anaddb:ngrids]]s """, ), + Variable( abivarname="nlflag@anaddb", varset="anaddb", @@ -1330,6 +1600,7 @@ * 3 --> only the non-linear optical susceptibility is calculated. """, ), + Variable( abivarname="nph1l@anaddb", varset="anaddb", @@ -1348,6 +1619,7 @@ the corresponding eigenfrequencies will be printed. """, ), + Variable( abivarname="nph2l@anaddb", varset="anaddb", @@ -1374,6 +1646,7 @@ three first numbers are zero, then the code will do a calculation at Gamma without non-analyticities. """, ), + Variable( abivarname="nqpath@anaddb", varset="anaddb", @@ -1388,6 +1661,7 @@ the phonon band structure and phonon linewidths are interpolated. """, ), + Variable( abivarname="nqshft@anaddb", varset="anaddb", @@ -1405,6 +1679,7 @@ (Warning: not FCC lattice, FCC *sampling*). """, ), + Variable( abivarname="nsphere@anaddb", varset="anaddb", @@ -1432,6 +1707,7 @@ will be violated if some atoms are no more included in the inverse Fourier Transform. """, ), + Variable( abivarname="nstrfix@anaddb", varset="anaddb", @@ -1446,6 +1722,7 @@ constrained polarization. See [[anaddb:polflag]]. """, ), + Variable( abivarname="ntemper@anaddb", varset="anaddb", @@ -1466,6 +1743,7 @@ solids), such anharmonic effects might be important already at room temperature. """, ), + Variable( abivarname="nwchan@anaddb", varset="anaddb", @@ -1483,6 +1761,7 @@ [[anaddb:thmtol]] have been fulfilled. """, ), + Variable( abivarname="outboltztrap@anaddb", varset="anaddb", @@ -1498,6 +1777,7 @@ velocities. The output file will be appended _BTRAP """, ), + Variable( abivarname="outscphon@anaddb", varset="anaddb", @@ -1514,6 +1794,7 @@ for Primitive Cell INFOrmation. """, ), + Variable( abivarname="piezoflag@anaddb", varset="anaddb", @@ -1562,6 +1843,7 @@ The flags should be set to satisfy the above rules from 1 to 6. """, ), + Variable( abivarname="polflag@anaddb", varset="anaddb", @@ -1599,6 +1881,7 @@ calculation of the effective charges and the piezoelectric tensor. """, ), + Variable( abivarname="prt_ifc@anaddb", varset="anaddb", @@ -1616,6 +1899,7 @@ * 1 --> write out the IFC in file ifcinfo.out (the name is fixed) to be used by AI2PS from John Rehr's group """, ), + Variable( abivarname="prtbltztrp@anaddb", varset="anaddb", @@ -1630,6 +1914,7 @@ * 1 --> write out the input files for BoLTZTRaP code. """, ), + Variable( abivarname="prtddb@anaddb", varset="anaddb", @@ -1648,6 +1933,7 @@ * 1 --> Interpolate the DDB and write out the DDB and DDB.nc files. """, ), + Variable( abivarname="prtdos@anaddb", varset="anaddb", @@ -1673,6 +1959,7 @@ through the input variable [[anaddb:dosdeltae]]. """, ), + Variable( abivarname="prtfsurf@anaddb", varset="anaddb", @@ -1701,6 +1988,7 @@ this array must be zero. """, ), + Variable( abivarname="prtmbm@anaddb", varset="anaddb", @@ -1715,6 +2003,7 @@ * 1 --> write out the contribution of the individual zone-center phonon modes to the electrooptic tensor. """, ), + Variable( abivarname="prtnest@anaddb", varset="anaddb", @@ -1750,6 +2039,7 @@ * 2 --> write out the nesting function both in the X-Y and in the XSF format. """, ), + Variable( abivarname="prtphbands@anaddb", varset="anaddb", @@ -1769,6 +2059,7 @@ and a `PHBANDS.gnuplot` script. Use `gnuplot file_PHBANDS.gnuplot` to visualize the phonon band structure. """, ), + Variable( abivarname="prtsrlr@anaddb", varset="anaddb", @@ -1788,17 +2079,13 @@ See also [[anaddb:ifcflag]] and [[anaddb:dipdip]]. """, ), + Variable( abivarname="prtvol@anaddb", varset="anaddb", vartype="integer", - topics=[ - "Phonons_useful", - "PhononBands_useful", - "Temperature_useful", - "PhononWidth_useful", - "ElPhonTransport_useful", - ], + topics=["Phonons_useful", "PhononBands_useful", "Temperature_useful", + "PhononWidth_useful", "ElPhonTransport_useful"], dimensions="scalar", defaultval=0, mnemonics="PRinT VOLume", @@ -1807,6 +2094,7 @@ Control the volume of printed output. """, ), + Variable( abivarname="q1shft@anaddb", varset="anaddb", @@ -1861,6 +2149,7 @@ 1x1x1 BCC sampling ([[anaddb:nqshft]]=2). """, ), + Variable( abivarname="q2shft@anaddb", varset="anaddb", @@ -1876,6 +2165,7 @@ Note that [[anaddb:nqshft]] for this series of grids corresponds to 1. """, ), + Variable( abivarname="qgrid_type@anaddb", varset="anaddb", @@ -1892,6 +2182,7 @@ to a regular grid as in the rest of anaddb (using [[anaddb:ngqpt]]). """, ), + Variable( abivarname="qpath@anaddb", varset="anaddb", @@ -1910,6 +2201,7 @@ for the output of the nesting function if [[anaddb:prtnest]]=1. """, ), + Variable( abivarname="qph1l@anaddb", varset="anaddb", @@ -1932,6 +2224,7 @@ fourth is stored in the array qnrml1(nph1l). """, ), + Variable( abivarname="qph2l@anaddb", varset="anaddb", @@ -1962,6 +2255,7 @@ fourth is stored in the array qnrml2(nph2l). """, ), + Variable( abivarname="qrefine@anaddb", varset="anaddb", @@ -1981,6 +2275,7 @@ Should implement Gaal-Nagy's algorithm in [[cite:GaalNagy2006]]. """, ), + Variable( abivarname="ramansr@anaddb", varset="anaddb", @@ -2006,6 +2301,7 @@ For the time being, **ramansr** =1 is the preferred choice. """, ), + Variable( abivarname="relaxat@anaddb", varset="anaddb", @@ -2020,6 +2316,7 @@ constrained polarization. See [[anaddb:polflag]]. """, ), + Variable( abivarname="relaxstr@anaddb", varset="anaddb", @@ -2034,6 +2331,7 @@ structural relaxation at constrained polarization. See [[anaddb:polflag]]. """, ), + Variable( abivarname="rfmeth@anaddb", varset="anaddb", @@ -2053,6 +2351,7 @@ DDB is available, always use the option 2. If not, you can try option 1, which is less accurate. """, ), + Variable( abivarname="rifcsph@anaddb", varset="anaddb", @@ -2071,6 +2370,7 @@ not be put to zero. """, ), + Variable( abivarname="selectz@anaddb", varset="anaddb", @@ -2095,6 +2395,7 @@ The result with non-zero **selectz** are unphysical. """, ), + Variable( abivarname="symdynmat@anaddb", varset="anaddb", @@ -2115,6 +2416,45 @@ some slight symmetry breaking effects. The latter can be bypassed by this additional symmetrization. """, ), + + Variable( + abivarname="sys_dim@anaddb", + varset="anaddb", + vartype="integer", + topics=["PhononBands_basic"], + dimensions="scalar", + defaultval=1, + mnemonics="SYStem DIMensionality", + added_in_version="v10", + text=r""" + Control the dimensionality of the problem when rotational invariance is imposed on the interatomic force constants + [[anaddb:asr]]==6 AND/OR when long-range electrostatics IFCs of 2D materials are considered (in this case, + only available with [[anaddb:sys_dim]]<5, but both for [[anaddb:dipdip]] and [[anaddb:quadquad]]). Currently, only + possible to consider [[anaddb:dipquad]] and [[anaddb:quadquad]] interactions at the same time. + + For rotational invariance: along periodic lattices, rotational invariance imposes conditions on the IFCs derivative, + while along non-periodic ones, only the zone-center IFCs are impacted. The code doesn't automatically detect it based + on the input structure and this variable allows to identify the periodic directions. Similar principles for long-range + electrotatics. + + * 1 --> consider a 3D problem (IFCs derivatives used everywhere). + + * 2 --> consider a 2D problem with non-periodic lattice along x + + * 3 --> consider a 2D problem with non-periodic lattice along y + + * 4 --> consider a 2D problem with non-periodic lattice along z + + * 5 --> consider a 1D problem with periodic lattice along x + + * 6 --> consider a 2D problem with periodic lattice along y + + * 7 --> consider a 2D problem with periodic lattice along z + + * 8 --> consider a 0D problem (molecule) +""", + ), + Variable( abivarname="symgkq@anaddb", varset="anaddb", @@ -2130,6 +2470,7 @@ should always be used, except for debugging or test purposes. """, ), + Variable( abivarname="targetpol@anaddb", varset="anaddb", @@ -2143,6 +2484,7 @@ Target value of the polarization in cartesian coordinates and in C/m$^2$. See [[anaddb:polflag]]. """, ), + Variable( abivarname="telphint@anaddb", varset="anaddb", @@ -2160,6 +2502,7 @@ * 2 = uniformly weighted band window between [[anaddb:ep_b_min]] and [[anaddb:ep_b_max]], for all k-points """, ), + Variable( abivarname="temperinc@anaddb", varset="anaddb", @@ -2179,6 +2522,7 @@ solids), such anharmonic effects might be important already at room temperature. """, ), + Variable( abivarname="tempermin@anaddb", varset="anaddb", @@ -2200,6 +2544,7 @@ anharmonic effects might be important already at room temperature. """, ), + Variable( abivarname="thermal_supercell@anaddb", varset="anaddb", @@ -2230,6 +2575,7 @@ relative phases of the displacements are not fixed properly yet... (Aug 2017) """, ), + Variable( abivarname="thmflag@anaddb", varset="anaddb", @@ -2263,6 +2609,7 @@ [[anaddb:ng2qpt]], [[anaddb:ngrids]], [[anaddb:q2shft]]. """, ), + Variable( abivarname="thmtol@anaddb", varset="anaddb", @@ -2279,6 +2626,25 @@ the next bigger is smaller than **thmtol**. """, ), + + + Variable( + abivarname="timdisp@anaddb", + varset="anaddb", + vartype="integer", + topics=["longwave_expert", "ConstrainedDFPT_expert"], + dimensions="scalar", + defaultval=0, + mnemonics="TIMe DISpersion", + characteristics=["[[DEVELOP]]"], + added_in_version="10.4", + text=r""" + If [[timdisp@anaddb]] = 1 and [[magpen@anaddb]] /= 0.0, the Berry curvatures calculated with the magnetic penalty are transformed to the fully fixed-spin functional and can be used in adiabatic (beyond–Born–Oppenheimer) dynamics calculations. + + This requires that the DDB file contain a third-order block with the frequency derivatives of the required second-order quantities. +""", + ), + Variable( abivarname="use_k_fine@anaddb", varset="anaddb", @@ -2295,6 +2661,7 @@ needed. Note that the coarse k-grid must be a subset of the fine k-grid. """, ), + Variable( abivarname="vs_qrad_tolkms@anaddb", varset="anaddb", @@ -2317,6 +2684,7 @@ The default values will not work. """, ), + # ABINIT 9 Variable( abivarname="ddb_filepath@anaddb", @@ -2341,6 +2709,7 @@ Shell variables e.g. $HOME or tilde syntax `~` for user home are not supported. """, ), + Variable( abivarname="output_file@anaddb", varset="anaddb", @@ -2360,6 +2729,7 @@ output = "t01.out" """, ), + # Variable( # abivarname="md_output@anaddb", # varset="anaddb", @@ -2377,6 +2747,7 @@ # Note This variable is optional and used ... # """, # ), + Variable( abivarname="gkk_filepath@anaddb", varset="anaddb", @@ -2395,6 +2766,7 @@ This variable is optional and used for performing EPH calculation with [[elphflag@anaddb]]. """, ), + Variable( abivarname="eph_prefix@anaddb", varset="anaddb", @@ -2413,6 +2785,7 @@ This variable is optional and used for performing EPH calculation with [[elphflag@anaddb]]. """, ), + Variable( abivarname="ddk_filepath@anaddb", varset="anaddb", @@ -2444,6 +2817,7 @@ t90o_DS10_GKK6 """, ), + Variable( abivarname="outdata_prefix@anaddb", varset="anaddb", @@ -2465,6 +2839,7 @@ See also [[outdata_prefix@abinit]] """, ), + Variable( abivarname="dos_maxmode@anaddb", varset="anaddb", @@ -2481,4 +2856,5 @@ If set to 0, which is the default value, all modes are included in the DOS. """, ), + ] diff --git a/abipy/abio/abivar_database/variables_atdep.py b/abipy/abio/abivar_database/variables_atdep.py index ed4803d67..5ea9f414b 100644 --- a/abipy/abio/abivar_database/variables_atdep.py +++ b/abipy/abio/abivar_database/variables_atdep.py @@ -1,3 +1,4 @@ + executable = "atdep" try: @@ -8,70 +9,75 @@ ValueWithConditions = dict -Variable = dict +Variable=dict variables = [ - Variable( - abivarname="alloy@atdep", - varset="atdep", - vartype="integer", - topics=["aTDEP_expert"], - dimensions="3", - defaultval="0", - mnemonics="ALLOY treatment", - added_in_version="9.5.1", - text=r""" + +Variable( + abivarname="alloy@atdep", + varset="atdep", + vartype="integer", + topics=["aTDEP_expert"], + dimensions=[3], + defaultval="0", + mnemonics="ALLOY treatment", + added_in_version="9.5.1", + text=r""" OPTIONAL: Defines the treatment of the alloy. The first value defines the approximation used (0=nothing and 1=Virtual Crystal Approximation). The second and the third values define the [[typat_unitcell] of the atoms which have to be alloyed. """, - ), - Variable( - abivarname="amu@atdep", - varset="atdep", - vartype="real", - topics=["aTDEP_basic"], - dimensions=["[[atdep:ntypat]]"], - defaultval="[[atdep:ntypat]]*0.d0", - mnemonics="Atomic masses in Mass Units", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="amu@atdep", + varset="atdep", + vartype="real", + topics=["aTDEP_basic"], + dimensions=["[[atdep:ntypat]]"], + defaultval="[[atdep:ntypat]]*0.d0", + mnemonics="Atomic masses in Mass Units", + added_in_version="before_v9", + text=r""" Defines the masses in atomic mass units for each kind of atom. See the ABINIT variable [[amu]] for more details. (Only required when the NetCDF file is absent). """, - ), - Variable( - abivarname="angle@atdep", - varset="atdep", - vartype="real", - topics=["aTDEP_basic"], - dimensions="scalar", - defaultval="90.d0", - mnemonics="ANGLE alpha", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="angle@atdep", + varset="atdep", + vartype="real", + topics=["aTDEP_basic"], + dimensions="scalar", + defaultval="90.d0", + mnemonics="ANGLE alpha", + added_in_version="before_v9", + text=r""" This angle has to be defined if the bravais lattice is monoclinic. That is to say if [[atdep:brav]](1)=2. """, - ), - Variable( - abivarname="born_charge@atdep", - varset="atdep", - vartype="real", - topics=["aTDEP_expert"], - dimensions=["[[atdep:ntypat]]"], - defaultval="[[atdep:ntypat]]*0.d0", - mnemonics="BORN effective CHARGE", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="born_charge@atdep", + varset="atdep", + vartype="real", + topics=["aTDEP_expert"], + dimensions=["[[atdep:ntypat]]"], + defaultval="[[atdep:ntypat]]*0.d0", + mnemonics="BORN effective CHARGE", + added_in_version="before_v9", + text=r""" OPTIONAL : Defines the Born effective charge (for each kind of atom) used to compute the dipole-dipole interaction. """, - ), - Variable( - abivarname="brav@atdep", - varset="atdep", - vartype="integer", - topics=["aTDEP_basic"], - dimensions=[2], - defaultval="2*0", - mnemonics="BRAVais", - added_in_version="before_v9", - text=""" +), + +Variable( + abivarname="brav@atdep", + varset="atdep", + vartype="integer", + topics=["aTDEP_basic"], + dimensions=[2], + defaultval="2*0", + mnemonics="BRAVais", + added_in_version="before_v9", + text=""" These two parameters define the Bravais lattice (as defined in the ABINIT code) and the primitive vectors [[rprim]] in the aTDEP code. - For bravais(1): The holohedral groups are numbered as follows (see international tables for crystallography (1983), p. 13): @@ -92,98 +98,105 @@ center=3 C-face centered """, - ), - Variable( - abivarname="bzlength@atdep", - varset="atdep", - vartype="integer+real", - topics=["aTDEP_expert"], - dimensions="'[[atdep:bzlength]](1)'+1", - defaultval="0", - mnemonics="Brillouin Zone LENGTH", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="bzlength@atdep", + varset="atdep", + vartype="real", + topics=["aTDEP_expert"], + dimensions="'[[atdep:bzlength]](1)'+1", + defaultval="0", + mnemonics="Brillouin Zone LENGTH", + added_in_version="before_v9", + text=r""" OPTIONAL: Defines the length of the Brillouin Zone for the phonon spectrum calculation. The first value defines the number of segments used in the path. The other values define the size of each segment. """, - ), - Variable( - abivarname="bzpath@atdep", - varset="atdep", - vartype="integer", - topics=["aTDEP_expert"], - dimensions="1", - defaultval="0", - mnemonics="Brillouin Zone PATH", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="bzpath@atdep", + varset="atdep", + vartype="integer", + topics=["aTDEP_expert"], + dimensions=[1], + defaultval="0", + mnemonics="Brillouin Zone PATH", + added_in_version="before_v9", + text=r""" OPTIONAL: Defines the number of special points used in the path in the Brillouin Zone for the phonon spectrum calculation. """, - ), - Variable( - abivarname="special_qpt@atdep", - varset="atdep", - vartype="letter", - topics=["aTDEP_expert"], - dimensions="'[[atdep:bzpath]](1)'", - defaultval="0", - mnemonics="SPECIAL Q-PoinTs", - added_in_version="10.4", - text=r""" +), + +Variable( + abivarname="special_qpt@atdep", + varset="atdep", + vartype="string", + topics=["aTDEP_expert"], + dimensions="'[[atdep:bzpath]](1)'", + defaultval="0", + mnemonics="SPECIAL Q-PoinTs", + added_in_version="10.4", + text=r""" OPTIONAL: Defines the path in the Brillouin Zone for the phonon spectrum calculation. The values define the special points of the BZ (only the letters fixed by convention for the present lattice are allowed: L, X, M... and G for $\Gamma$). """, - ), - Variable( - abivarname="dielec_constant@atdep", - varset="atdep", - vartype="real", - topics=["aTDEP_expert"], - dimensions="scalar", - defaultval="0", - mnemonics="DIELECtric CONSTANT", - added_in_version="before_v9", - text=""" +), + +Variable( + abivarname="dielec_constant@atdep", + varset="atdep", + vartype="real", + topics=["aTDEP_expert"], + dimensions="scalar", + defaultval="0", + mnemonics="DIELECtric CONSTANT", + added_in_version="before_v9", + text=""" OPTIONAL: Defines the dielectric constant used to compute the dipole-dipole interaction. """, - ), - Variable( - abivarname="dosdeltae@atdep", - varset="atdep", - vartype="integer", - topics=["aTDEP_expert"], - dimensions="scalar", - defaultval="0.2 cm$^{-1}$", - mnemonics="DOS delta Energy", - added_in_version="before_v9", - text=""" +), + +Variable( + abivarname="dosdeltae@atdep", + varset="atdep", + vartype="integer", + topics=["aTDEP_expert"], + dimensions="scalar", + defaultval="0.2 cm$^{-1}$", + mnemonics="DOS delta Energy", + added_in_version="before_v9", + text=""" OPTIONAL: Defines the smearing used for the phonon Density Of State calculation. Prior to v9.10, the default was 4.5d-6. """, - ), - Variable( - abivarname="enunit@atdep", - varset="atdep", - vartype="integer", - topics=["aTDEP_expert"], - dimensions="scalar", - defaultval="0", - mnemonics="ENergy UNIT", - added_in_version="before_v9", - text=""" +), + +Variable( + abivarname="enunit@atdep", + varset="atdep", + vartype="integer", + topics=["aTDEP_expert"], + dimensions="scalar", + defaultval="0", + mnemonics="ENergy UNIT", + added_in_version="before_v9", + text=""" OPTIONAL: Defines the energy unit used for the phonon spectrum (0 for meV, 1 for cm-1, 2 for Ha and 3 for THz). """, - ), - Variable( - abivarname="multiplicity@atdep", - varset="atdep", - vartype="real", - topics=["aTDEP_basic"], - dimensions=[3, 3], - defaultval="9*0.d0", - mnemonics="MULTIPLICITY", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="multiplicity@atdep", + varset="atdep", + vartype="real", + topics=["aTDEP_basic"], + dimensions=[3,3], + defaultval="9*0.d0", + mnemonics="MULTIPLICITY", + added_in_version="before_v9", + text=r""" Defines the multiplicity of the SUPERCELL with respect to the primitive UNICELL. See the ABINIT variables [[rprimd]], [[acell]] and [[rprim]] for more details. The multiplicity [[atdep:multiplicity]] and the SUPERCELL lattice parameters [[atdep:rprimd]] are used to find the UNITCELL lattice parameters acell_unitcell such as: $$ \text{rprimd}_{i,j}=\sum_{k=1}^3 \text{acell_unitcell}_i * \text{multiplicity}_{i,k}*\text{rprim_tmp}_{k,j} $$ @@ -193,340 +206,368 @@ - for a fcc lattice: rprim = ( 0 1/2 1/2 ; 1/2 0 1/2 ; 1/2 1/2 0) and acell = (a a a). If the SUPERCELL is rprimd = (3a 0 0 ; 0 3a 0 ; 0 0 3a), the multiplicity = ( -3 3 3 ; 3 -3 3 ; 3 3 -3) - for a bcc lattice: rprim = ( -1/2 1/2 1/2 ; 1/2 -1/2 1/2 ; 1/2 1/2 -1/2) and acell = (a a a). If the SUPERCELL is rprimd = (3a 0 0 ; 0 3a 0 ; 0 0 3a), the multiplicity = ( 0 3 3 ; 3 0 3 ; 3 3 0) """, - ), - Variable( - abivarname="natom@atdep", - varset="atdep", - vartype="integer", - topics=["aTDEP_basic"], - dimensions="scalar", - defaultval="0", - mnemonics="NATOM", - added_in_version="before_v9", - text=""" +), + +Variable( + abivarname="natom@atdep", + varset="atdep", + vartype="integer", + topics=["aTDEP_basic"], + dimensions="scalar", + defaultval="0", + mnemonics="NATOM", + added_in_version="before_v9", + text=""" Defines the number of atoms in the SUPERCELL. See the ABINIT variable [[natom]] for more details. (Only required when the NetCDF file is absent). """, - ), - Variable( - abivarname="natom_unitcell@atdep", - varset="atdep", - vartype="integer", - topics=["aTDEP_basic"], - dimensions="scalar", - defaultval="0", - mnemonics="NATOM in the UNITCELL", - added_in_version="before_v9", - text=""" +), + +Variable( + abivarname="natom_unitcell@atdep", + varset="atdep", + vartype="integer", + topics=["aTDEP_basic"], + dimensions="scalar", + defaultval="0", + mnemonics="NATOM in the UNITCELL", + added_in_version="before_v9", + text=""" Defines the number of atoms in the UNITCELL. """, - ), - Variable( - abivarname="ngqpt1@atdep", - varset="atdep", - vartype="integer", - topics=["aTDEP_expert"], - dimensions=[3], - defaultval=[8, 8, 8], - mnemonics="Number of Grid points for Q PoinTs generation (coarse)", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="ngqpt1@atdep", + varset="atdep", + vartype="integer", + topics=["aTDEP_expert"], + dimensions=[3], + defaultval=[8, 8, 8], + mnemonics="Number of Grid points for Q PoinTs generation (coarse)", + added_in_version="before_v9", + text=r""" OPTIONAL: Defines the COARSE grid of q-points for the dynamical matrix output (in DDB). """, - ), - Variable( - abivarname="ngqpt2@atdep", - varset="atdep", - vartype="integer", - topics=["aTDEP_expert"], - dimensions=[3], - defaultval=[32, 32, 32], - mnemonics="Number of Grid points for Q PoinTs generation (fine)", - added_in_version="before_v9", - text=""" +), + +Variable( + abivarname="ngqpt2@atdep", + varset="atdep", + vartype="integer", + topics=["aTDEP_expert"], + dimensions=[3], + defaultval=[32, 32, 32], + mnemonics="Number of Grid points for Q PoinTs generation (fine)", + added_in_version="before_v9", + text=""" OPTIONAL: Defines the FINE grid of q-points for the DOS and thermodynamic quantity calculations. """, - ), - Variable( - abivarname="nstep_max@atdep", - varset="atdep", - vartype="integer", - topics=["aTDEP_basic"], - dimensions="scalar", - defaultval="0", - mnemonics="NSTEP at MAX", - added_in_version="before_v9", - text=""" +), + +Variable( + abivarname="nstep_max@atdep", + varset="atdep", + vartype="integer", + topics=["aTDEP_basic"], + dimensions="scalar", + defaultval="0", + mnemonics="NSTEP at MAX", + added_in_version="before_v9", + text=""" Defines the upper limit in the range of configurations that one wants to use. This number has to be lower than the maximum number of configurations present in the NetCDF or ASCII file. """, - ), - Variable( - abivarname="nstep_min@atdep", - varset="atdep", - vartype="integer", - topics=["aTDEP_basic"], - dimensions="scalar", - defaultval="0", - mnemonics="NSTEP at MIN", - added_in_version="before_v9", - text=""" +), + +Variable( + abivarname="nstep_min@atdep", + varset="atdep", + vartype="integer", + topics=["aTDEP_basic"], + dimensions="scalar", + defaultval="0", + mnemonics="NSTEP at MIN", + added_in_version="before_v9", + text=""" Defines the lower limit in the range of configurations that one wants to use. This number has to be larger than the minimum number of configurations present in the NetCDF or ASCII file. """, - ), - Variable( - abivarname="ntypat@atdep", - varset="atdep", - vartype="integer", - topics=["aTDEP_basic"], - dimensions="scalar", - defaultval="0", - mnemonics="NTYPAT", - added_in_version="before_v9", - text=""" +), + +Variable( + abivarname="ntypat@atdep", + varset="atdep", + vartype="integer", + topics=["aTDEP_basic"], + dimensions="scalar", + defaultval="0", + mnemonics="NTYPAT", + added_in_version="before_v9", + text=""" Defines the number of atom types. See the ABINIT variable [[ntypat]] for more details. (Only required when the NetCDF file is absent). """, - ), - Variable( - abivarname="order@atdep", - varset="atdep", - vartype="integer+real", - topics=["aTDEP_expert"], - dimensions="2", - defaultval="2", - mnemonics="ORDER for the IFC", - added_in_version="before_v9", - text=""" +), + +Variable( + abivarname="order@atdep", + varset="atdep", + vartype="real", + topics=["aTDEP_expert"], + dimensions=[2], + defaultval="2", + mnemonics="ORDER for the IFC", + added_in_version="before_v9", + text=""" OPTIONAL: Defines at which order the calculation of the IFCs is performed. If the first value [[atdep:order]](1)=3, that turns on a third order calculation and the second value [[atdep:order]](2) defines the cutoff radius. """, - ), - Variable( - abivarname="rcut@atdep", - varset="atdep", - vartype="real", - topics=["aTDEP_basic"], - dimensions="scalar", - defaultval="0.d0", - mnemonics="Radius CUToff", - added_in_version="before_v9", - text=""" +), + +Variable( + abivarname="rcut@atdep", + varset="atdep", + vartype="real", + topics=["aTDEP_basic"], + dimensions="scalar", + defaultval="0.d0", + mnemonics="Radius CUToff", + added_in_version="before_v9", + text=""" Defines the cutoff radius used when the second order IFCs are computed. This ones has to be lower than half the smallest SUPERCELL lattice parameter. """, - ), - Variable( - abivarname="readifc@atdep", - varset="atdep", - vartype="integer", - topics=["aTDEP_expert"], - dimensions="scalar", - defaultval="0", - mnemonics="READ the Interatomic Force Constants", - added_in_version="before_v9", - text=""" +), + +Variable( + abivarname="readifc@atdep", + varset="atdep", + vartype="integer", + topics=["aTDEP_expert"], + dimensions="scalar", + defaultval="0", + mnemonics="READ the Interatomic Force Constants", + added_in_version="before_v9", + text=""" OPTIONAL: Defines the IO strategy used for the IFC. If : - [[atdep:readifc]] = 1 : Read the IFC coming from an input file. - [[atdep:readifc]] = 2 : Write and read the IFC coming from the calculation (for tests). """, - ), - Variable( - abivarname="rprimd@atdep", - varset="atdep", - vartype="real", - topics=["aTDEP_basic"], - dimensions=[3, 3], - defaultval="9*0.d0", - mnemonics="RPRIMD", - added_in_version="before_v9", - text=""" +), + +Variable( + abivarname="rprimd@atdep", + varset="atdep", + vartype="real", + topics=["aTDEP_basic"], + dimensions=[3,3], + defaultval="9*0.d0", + mnemonics="RPRIMD", + added_in_version="before_v9", + text=""" Defines the dimensional real space primitive vectors of the SUPERCELL. See [[rprimd]] for more details. (Only required when the NetCDF file is absent). """, - ), - Variable( - abivarname="slice@atdep", - varset="atdep", - vartype="integer", - topics=["aTDEP_expert"], - dimensions="1", - defaultval="1", - mnemonics="SLICE", - added_in_version="before_v9", - text=""" +), + +Variable( + abivarname="slice@atdep", + varset="atdep", + vartype="integer", + topics=["aTDEP_expert"], + dimensions="1", + defaultval="1", + mnemonics="SLICE", + added_in_version="before_v9", + text=""" OPTIONAL: Defines the slice used to include some configurations in the calculations. Only the ([[atdep:nstep_max]]-[[atdep:nstep_min]])/[[atdep:slice]] configurations will be considered in the calculations of the IFCs. """, - ), - Variable( - abivarname="temperature@atdep", - varset="atdep", - vartype="real", - topics=["aTDEP_basic"], - dimensions="scalar", - defaultval="0", - mnemonics="TEMPERATURE", - added_in_version="before_v9", - text=""" +), + + +Variable( + abivarname="temperature@atdep", + varset="atdep", + vartype="real", + topics=["aTDEP_basic"], + dimensions="scalar", + defaultval="0", + mnemonics="TEMPERATURE", + added_in_version="before_v9", + text=""" Defines the temperature of the system. """, - ), - Variable( - abivarname="together@atdep", - varset="atdep", - vartype="integer", - topics=["aTDEP_expert"], - dimensions="scalar", - defaultval="1", - mnemonics="Are the different orders solved TOGETHER?", - added_in_version="9.5.1", - text=""" +), + +Variable( + abivarname="together@atdep", + varset="atdep", + vartype="integer", + topics=["aTDEP_expert"], + dimensions="scalar", + defaultval="1", + mnemonics="Are the different orders solved TOGETHER?", + added_in_version="9.5.1", + text=""" OPTIONAL: Defines if the different [[atdep:order]] are solved together or not : - simultaneously : [[atdep:together]] = 1. - successively : [[atdep:together]] = 0. """, - ), - Variable( - abivarname="tolinbox@atdep", - varset="atdep", - vartype="real", - topics=["aTDEP_expert"], - dimensions="scalar", - defaultval="5.d-2", - mnemonics="TOLerance for shifting atoms in the BOX.", - added_in_version="10.5", - text=""" +), + +Variable( + abivarname="tolinbox@atdep", + varset="atdep", + vartype="real", + topics=["aTDEP_expert"], + dimensions="scalar", + defaultval="5.d-2", + mnemonics="TOLerance for shifting atoms in the BOX.", + added_in_version="10.5", + text=""" Defines the tolerance criterion when shifting xred so that each component falls in the box [-0.5,0.5[. """, - ), - Variable( - abivarname="tolmatch@atdep", - varset="atdep", - vartype="real", - topics=["aTDEP_expert"], - dimensions="scalar", - defaultval="5.d-2", - mnemonics="TOLerance for MATCHing atom positions.", - added_in_version="10.5", - text=""" +), + +Variable( + abivarname="tolmatch@atdep", + varset="atdep", + vartype="real", + topics=["aTDEP_expert"], + dimensions="scalar", + defaultval="5.d-2", + mnemonics="TOLerance for MATCHing atom positions.", + added_in_version="10.5", + text=""" Defines the tolerance criterion for matching the average values of xred to the ideal ones. """, - ), - Variable( - abivarname="tolmotif@atdep", - varset="atdep", - vartype="real", - topics=["aTDEP_expert"], - dimensions="scalar", - defaultval="5.d-2", - mnemonics="TOLerance on atoms MOTIF", - added_in_version="10.5", - text=""" +), + + +Variable( + abivarname="tolmotif@atdep", + varset="atdep", + vartype="real", + topics=["aTDEP_expert"], + dimensions="scalar", + defaultval="5.d-2", + mnemonics="TOLerance on atoms MOTIF", + added_in_version="10.5", + text=""" Defines the tolerance criterion for mathing the motif, that is, the relative atom positions in reduced coordinates. This is used for finding the unit cell within the average values of xred in the supercell. """, - ), - Variable( - abivarname="typat@atdep", - varset="atdep", - vartype="integer", - topics=["aTDEP_basic"], - dimensions=["[[atdep:natom]]"], - defaultval="[[atdep:natom]]*0", - mnemonics="TYPAT", - added_in_version="before_v9", - text=""" +), + +Variable( + abivarname="typat@atdep", + varset="atdep", + vartype="integer", + topics=["aTDEP_basic"], + dimensions=["[[atdep:natom]]"], + defaultval="[[atdep:natom]]*0", + mnemonics="TYPAT", + added_in_version="before_v9", + text=""" Defines the type of atoms in the SUPERCELL. See [[typat]] for more details. (Only required when the NetCDF file is absent). """, - ), - Variable( - abivarname="typat_unitcell@atdep", - varset="atdep", - vartype="integer", - topics=["aTDEP_basic"], - dimensions=["[[atdep:natom_unitcell]]"], - defaultval="[[atdep:natom_unitcell]]*0", - mnemonics="TYPAT in the UNITCELL", - added_in_version="before_v9", - text=""" +), + +Variable( + abivarname="typat_unitcell@atdep", + varset="atdep", + vartype="integer", + topics=["aTDEP_basic"], + dimensions=["[[atdep:natom_unitcell]]"], + defaultval="[[atdep:natom_unitcell]]*0", + mnemonics="TYPAT in the UNITCELL", + added_in_version="before_v9", + text=""" Defines the type of atoms in the UNITCELL. """, - ), - Variable( - abivarname="use_ideal_positions@atdep", - varset="atdep", - vartype="integer", - topics=["aTDEP_expert"], - dimensions="scalar", - defaultval="0", - mnemonics="USE IDEAL POSITIONS", - added_in_version="before_v9", - text=""" +), + +Variable( + abivarname="use_ideal_positions@atdep", + varset="atdep", + vartype="integer", + topics=["aTDEP_expert"], + dimensions="scalar", + defaultval="0", + mnemonics="USE IDEAL POSITIONS", + added_in_version="before_v9", + text=""" OPTIONAL: Defines if the ideal ([[atdep:use_ideal_positions]]=1) or averaged ([[atdep:use_ideal_positions]]=0) positions are used during the calculations. It can affect strongly the phonon spectrum (and other quantities) if the system is close to an instability (soft mode,...). """, - ), - Variable( - abivarname="use_weights@atdep", - varset="atdep", - vartype="integer", - topics=["aTDEP_expert"], - dimensions="scalar", - defaultval="0", - mnemonics="USE the WEIGHTS", - added_in_version="9.5.1", - text=""" +), + +Variable( + abivarname="use_weights@atdep", + varset="atdep", + vartype="integer", + topics=["aTDEP_expert"], + dimensions="scalar", + defaultval="0", + mnemonics="USE the WEIGHTS", + added_in_version="9.5.1", + text=""" OPTIONAL: Defines if a specific weight has to be used for each configuration ([[atdep:use_weights]]=1). """, - ), - Variable( - abivarname="xred_unitcell@atdep", - varset="atdep", - vartype="real", - topics=["aTDEP_basic"], - dimensions=[3, "[[atdep:natom_unitcell]]"], - defaultval="(3*[[atdep:natom_unitcell]])*0.d0", - mnemonics="XRED in the UNITCELL", - added_in_version="before_v9", - text=""" +), + +Variable( + abivarname="xred_unitcell@atdep", + varset="atdep", + vartype="real", + topics=["aTDEP_basic"], + dimensions=[3, "[[atdep:natom_unitcell]]"], + defaultval="(3*[[atdep:natom_unitcell]])*0.d0", + mnemonics="XRED in the UNITCELL", + added_in_version="before_v9", + text=""" Defines the reduced coordinates of atoms in the UNITCELL. """, - ), - Variable( - abivarname="znucl@atdep", - varset="atdep", - vartype="float", - topics=["aTDEP_basic"], - dimensions=["[[atdep:natom]]"], - defaultval="[[atdep:natom]]*0", - mnemonics="charge -Z- of the NUCLeus", - added_in_version="10.4", - text=""" +), + +Variable( + abivarname="znucl@atdep", + varset="atdep", + vartype="real", + topics=["aTDEP_basic"], + dimensions=["[[atdep:natom]]"], + defaultval="[[atdep:natom]]*0", + mnemonics="charge -Z- of the NUCLeus", + added_in_version="10.4", + text=""" OPTIONAL: Gives nuclear charge for each type of atom, in order. Within atep, this variable is only used when writing the DDB file. """, - ), - Variable( - abivarname="debug_mode@atdep", - varset="atdep", - vartype="integer", - topics=["aTDEP_expert"], - dimensions="scalar", - defaultval="0", - mnemonics="DEBUG MODE", - added_in_version="10.4", - text=""" +), + +Variable( + abivarname="debug_mode@atdep", + varset="atdep", + vartype="integer", + topics=["aTDEP_expert"], + dimensions="scalar", + defaultval="0", + mnemonics="DEBUG MODE", + added_in_version="10.4", + text=""" OPTIONAL: A non-zero value activates debug mode for atdep. """, - ), - Variable( - abivarname="output_file@atdep", - varset="atdep", - vartype="string", - topics=["Control_useful"], - dimensions="scalar", - defaultval="", - mnemonics="OUTPUT FILE", - added_in_version="10.4", - text=r""" +), + + +Variable( + abivarname="output_file@atdep", + varset="atdep", + vartype="string", + topics=["Control_useful"], + dimensions="scalar", + defaultval="", + mnemonics="OUTPUT FILE", + added_in_version="10.4", + text=r""" This variable specifies the name of the output file when atdep is invoked with the new syntax: atdep run.in > run.log 2> run.err @@ -535,17 +576,18 @@ output_file = "run.out" """, - ), - Variable( - abivarname="indata_prefix@atdep", - varset="atdep", - vartype="string", - topics=["Control_useful"], - dimensions="scalar", - defaultval="", - mnemonics="INput DATA PREFIX", - added_in_version="10.4", - text=r""" +), + +Variable( + abivarname="indata_prefix@atdep", + varset="atdep", + vartype="string", + topics=["Control_useful"], + dimensions="scalar", + defaultval="", + mnemonics="INput DATA PREFIX", + added_in_version="10.4", + text=r""" Prefix for input files, in particular for the HIST.nc file. This variable is used when atdep is executed with the new syntax: @@ -556,18 +598,19 @@ indata_prefix = "in" which tells atdep to look for a file called "in_HIST.nc". -""", - ), - Variable( - abivarname="outdata_prefix@atdep", - varset="atdep", - vartype="string", - topics=["Control_useful"], - dimensions="scalar", - defaultval="atdep", - mnemonics="OUTput DATA PREFIX", - added_in_version="10.4", - text=r""" +""" +), + +Variable( + abivarname="outdata_prefix@atdep", + varset="atdep", + vartype="string", + topics=["Control_useful"], + dimensions="scalar", + defaultval="atdep", + mnemonics="OUTput DATA PREFIX", + added_in_version="10.4", + text=r""" Prefix for output files. This variable is used when atdep is executed with the new syntax: @@ -578,6 +621,27 @@ outdata_prefix = "run" which tells atdep to construct output file names like "run_DDB". +""" +), + +Variable( + abivarname="symbec@atdep", + varset="atdep", + vartype="integer", + topics=["aTDEP_expert"], + dimensions="scalar", + defaultval="0", + mnemonics="SYMmetrize Born Effective Charges", + added_in_version="10.7", + text=""" +OPTIONAL: Symmetrize the Born Effective Charges after reading them. + +- No symmetrization : [[atdep:symbec]] = 0 +- Spatial average : [[atdep:symbec]] = 1 + Zero-out the non-diagonal part of the 3x3 BEC tensor of each atom, + and average the diagonal components, so that the BEC are spherically + symmetric. """, - ), +), + ] diff --git a/abipy/abio/abivar_database/variables_multibinit.py b/abipy/abio/abivar_database/variables_multibinit.py index 063dfceea..03b51cdbe 100644 --- a/abipy/abio/abivar_database/variables_multibinit.py +++ b/abipy/abio/abivar_database/variables_multibinit.py @@ -1,3 +1,4 @@ + executable = "multibinit" try: @@ -10,85 +11,90 @@ Variable = dict variables = [ - Variable( - abivarname="dipdip@multibinit", - varset="multibinit", - vartype="integer", - topics=["LatticeModel_basic"], - dimensions="scalar", - defaultval=1, - mnemonics="DIPole-DIPole interaction", - added_in_version="before_v9", - text=r""" +Variable( + abivarname="dipdip@multibinit", + varset="multibinit", + vartype="integer", + topics=["LatticeModel_basic"], + dimensions="scalar", + defaultval=1, + mnemonics="DIPole-DIPole interaction", + added_in_version="before_v9", + text=r""" * 0 --> Do not recompute the dipole-dipole interaction. * 1 --> Recompute the dipole-dipole interaction based on ewald summation . """, - ), - Variable( - abivarname="dipdip_prt@multibinit", - varset="multibinit", - vartype="integer", - topics=["LatticeModel_expert"], - dimensions="scalar", - defaultval=0, - mnemonics="DIPole-DIPole PRinT", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="dipdip_prt@multibinit", + varset="multibinit", + vartype="integer", + topics=["LatticeModel_expert"], + dimensions="scalar", + defaultval=0, + mnemonics="DIPole-DIPole PRinT", + added_in_version="before_v9", + text=r""" * 1 --> Print the dipole-dipole interaction into the XML. * 0 --> Do not print the dipole-dipole interaction into the XML. """, - ), - ## Deprecated. - # Variable( - # abivarname="dipdip_range@multibinit", - # varset="multibinit", - # vartype="integer", - # topics=['LatticeModel_expert'], - # dimensions=[3], - # defaultval=0, - # mnemonics="Dipole-Dipole range", - # added_in_version="before_v9", - # text=r""" - # Depending of the cases, the range of the dipole-dipole interaction will be parameted by: - # - # * dipdip_range if superior to ncell and superior to short-range interaction - # * ncell if dipdip_range inferior to ncell - # * short-range if dipdip_range inferior to short-range interaction - # - # For example: - # - # * if dipdip_range = 2 2 2 and the short range interaction if 3 3 3, the dipdip interaction will be set on 3 3 3 - # - # * if ncell = 15 15 15 and the dipdip_range is 6 6 6, the dipdip interaction will be set on 15 15 15 - # """, - # ), - Variable( - abivarname="energy_reference@multibinit", - varset="multibinit", - vartype="real", - topics=["LatticeModel_useful"], - dimensions="scalar", - defaultval=0.0, - mnemonics="Energy of the references structure", - characteristics=["[[ENERGY]]"], - added_in_version="before_v9", - text=r""" +), + +## Deprecated. +#Variable( +# abivarname="dipdip_range@multibinit", +# varset="multibinit", +# vartype="integer", +# topics=['LatticeModel_expert'], +# dimensions=[3], +# defaultval=0, +# mnemonics="Dipole-Dipole range", +# added_in_version="before_v9", +# text=r""" +#Depending of the cases, the range of the dipole-dipole interaction will be parameted by: +# +#* dipdip_range if superior to ncell and superior to short-range interaction +#* ncell if dipdip_range inferior to ncell +#* short-range if dipdip_range inferior to short-range interaction +# +#For example: +# +# * if dipdip_range = 2 2 2 and the short range interaction if 3 3 3, the dipdip interaction will be set on 3 3 3 +# +# * if ncell = 15 15 15 and the dipdip_range is 6 6 6, the dipdip interaction will be set on 15 15 15 +#""", +#), + + +Variable( + abivarname="energy_reference@multibinit", + varset="multibinit", + vartype="real", + topics=["LatticeModel_useful"], + dimensions="scalar", + defaultval=0.0, + mnemonics="Energy of the references structure", + characteristics=["[[ENERGY]]"], + added_in_version="before_v9", + text=r""" Set the energy of the reference structure (from the DFT calculation) if the energy of the reference is not specified in the DDB, (for example if the DDB file of the ground states is not merged), or not specified in the XML file), (by default in Hartree). """, - ), - Variable( - abivarname="lwf_dynamics@multibinit", - varset="multibinit", - vartype="integer", - topics=["LWFModel_basic"], - dimensions="scalar", - defaultval=0, - mnemonics="Lattice Wannier Function DYNAMICS", - added_in_version="9.8", - text=r""" +), + +Variable( + abivarname="lwf_dynamics@multibinit", + varset="multibinit", + vartype="integer", + topics=["LWFModel_basic"], + dimensions="scalar", + defaultval=0, + mnemonics="Lattice Wannier Function DYNAMICS", + added_in_version="9.8", + text=r""" Kind of LWF dynamics to run. Currently there is only the option 3. * 0: Do not run LWF dynamics. @@ -96,32 +102,36 @@ * 3: Run NVT LWF dynamics with the Berendsen thermalstat. """, - ), - Variable( - abivarname="lwf_init_hist_fname@multibinit", - varset="multibinit", - vartype="string", - topics=["LWFModel_basic"], - dimensions="scalar", - defaultval="", - mnemonics="LWF INITIAL state HISTory file name", - added_in_version="9.8", - text=r""" +), + + +Variable( + abivarname="lwf_init_hist_fname@multibinit", + varset="multibinit", + vartype="string", + topics=["LWFModel_basic"], + dimensions="scalar", + defaultval="", + mnemonics="LWF INITIAL state HISTory file name", + added_in_version="9.8", + text=r""" Specify the initial state of the multibinit LWF dynamics calculation, which can be a lwf_hist netcdf file, usually generated from previous LWF dynamics calculations. It is used when [[multibinit:lwf_init_state]]=4 The string must be enclosed between quotation marks, for example: lwf_init_hist_fname "last_step_lwf_hist.nc" """, - ), - Variable( - abivarname="lwf_init_state@multibinit", - varset="multibinit", - vartype="integer", - topics=["LWFModel_basic"], - dimensions="scalar", - defaultval=1, - mnemonics="Lattice Wannier Function INITial STATE", - added_in_version="before_v9", - text=r""" +), + + +Variable( + abivarname="lwf_init_state@multibinit", + varset="multibinit", + vartype="integer", + topics=["LWFModel_basic"], + dimensions="scalar", + defaultval=1, + mnemonics="Lattice Wannier Function INITial STATE", + added_in_version="before_v9", + text=r""" Flag to initialize spin state. * 1 --> The LWF amplitudes are homogeneous random numbers between -0.1 to 0.1 Bohr. @@ -130,235 +140,261 @@ * 4 --> Restart from an input spin hist file, as specified in [[multibinit:lwf_init_hist_fname]]. """, - ), - Variable( - abivarname="lwf_constraint@multibinit", - varset="multibinit", - vartype="integer", - topics=["LWFModel_expert"], - dimensions="scalar", - defaultval=0, - mnemonics="Lattice Wannier Function use CONSTRAINT", - added_in_version="9.8", - text=r""" +), + +Variable( + abivarname="lwf_constraint@multibinit", + varset="multibinit", + vartype="integer", + topics=["LWFModel_expert"], + dimensions="scalar", + defaultval=0, + mnemonics="Lattice Wannier Function use CONSTRAINT", + added_in_version="9.8", + text=r""" Whether to use constraint in Lattice Wannier function dynamics. The constraints are defined in a LWF initial state file by three parameters: n_fixed_lwf: number of fixed LWF. fixed_lwf_ids: indices of fixed LWFs. fixed_lwf_values: values of fixed LWFs. """, - ), - Variable( - abivarname="lwf_dt@multibinit", - varset="multibinit", - vartype="real", - topics=["LWFModel_basic"], - dimensions="scalar", - defaultval=100, - mnemonics="Lattice Wannier Function Delta Time", - added_in_version="9.8", - text=r""" +), + +Variable( + abivarname="lwf_dt@multibinit", + varset="multibinit", + vartype="real", + topics=["LWFModel_basic"], + dimensions="scalar", + defaultval=100, + mnemonics="Lattice Wannier Function Delta Time", + added_in_version="9.8", + text=r""" Time step for lwf dynamics. Default value is 100. Default unit is atomic unit (2.419e-17 s). S, Sec or Second can be appended as unit. (e.g. 1e-16 Sec). """, - ), - Variable( - abivarname="lwf_nctime@multibinit", - varset="multibinit", - vartype="integer", - topics=["LWFModel_basic"], - dimensions="scalar", - defaultval=0, - mnemonics="Lattice Wannier function dynamics NetCdf write per number of TIME steps", - added_in_version="before_v9", - text=r""" +), + + + +Variable( + abivarname="lwf_nctime@multibinit", + varset="multibinit", + vartype="integer", + topics=["LWFModel_basic"], + dimensions="scalar", + defaultval=0, + mnemonics="Lattice Wannier function dynamics NetCdf write per number of TIME steps", + added_in_version="before_v9", + text=r""" Write LWF amplitude into netcdf file in every lwf_nctime of spin dynamics time steps. """, - ), - Variable( - abivarname="lwf_ntime@multibinit", - varset="multibinit", - vartype="integer", - topics=["LWFModel_basic"], - dimensions="scalar", - defaultval=0, - mnemonics="Lattice Wannier function dynamics total Number of TIME steps", - added_in_version="9.8", - text=r""" +), + + + +Variable( + abivarname="lwf_ntime@multibinit", + varset="multibinit", + vartype="integer", + topics=["LWFModel_basic"], + dimensions="scalar", + defaultval=0, + mnemonics="Lattice Wannier function dynamics total Number of TIME steps", + added_in_version="9.8", + text=r""" Total number of lattice Wannier function dynamics time steps. """, - ), - Variable( - abivarname="lwf_pot_fname@multibinit", - varset="multibinit", - vartype="string", - topics=["LWFModel_basic"], - dimensions="scalar", - defaultval="", - mnemonics="Lattice Wannier function POTential File NAME", - added_in_version="9.8", - text=r""" +), + +Variable( + abivarname="lwf_pot_fname@multibinit", + varset="multibinit", + vartype="string", + topics=["LWFModel_basic"], + dimensions="scalar", + defaultval="", + mnemonics="Lattice Wannier function POTential File NAME", + added_in_version="9.8", + text=r""" Specify the LWF potential file name in the multibinit lwf dynamics calculation, which is a netcdf file. The string must be enclosed between quotation marks: lwf_pot_fname "BaTiO3_lwf_pot.nc" -""", - ), - Variable( - abivarname="lwf_taut@multibinit", - varset="multibinit", - vartype="integer", - topics=["LWFModel_basic"], - dimensions="scalar", - defaultval=1000, - mnemonics="Lattice Wannier function dynamics relaxation time TAUT", - added_in_version="9.8", - text=r""" +""" + +), + + +Variable( + abivarname="lwf_taut@multibinit", + varset="multibinit", + vartype="integer", + topics=["LWFModel_basic"], + dimensions="scalar", + defaultval=1000, + mnemonics="Lattice Wannier function dynamics relaxation time TAUT", + added_in_version="9.8", + text=r""" Parameter used in Berendsen lattice dynamics [[multibinit:lwf_dynamics]] = 3, in which the temperature is relaxed exponentially to the target temperature, with the characteristic time of lwf_taut. The default unit is atomic unit. But it is possible to use the second as the unit by adding Second or S at the end of the line, for example: lwf_taut 1d-15 S """, - ), - Variable( - abivarname="lwf_temperature_start@multibinit", - varset="multibinit", - vartype="real", - topics=["LWFModel_basic"], - dimensions="scalar", - defaultval=0.0, - mnemonics="Lattice Wannier function TEMPERATURE START", - added_in_version="9.8", - text=r""" +), + + + +Variable( + abivarname="lwf_temperature_start@multibinit", + varset="multibinit", + vartype="real", + topics=["LWFModel_basic"], + dimensions="scalar", + defaultval=0.0, + mnemonics="Lattice Wannier function TEMPERATURE START", + added_in_version="9.8", + text=r""" Start point of variable temperature LWF dynamcis calculation (see [[multibinit:lwf_var_temperature]]) in lwf dynamics calculation. """, - ), - Variable( - abivarname="lwf_temperature_end@multibinit", - varset="multibinit", - vartype="real", - topics=["LWFModel_basic"], - dimensions="scalar", - defaultval=0.0, - mnemonics="Lattice Wannier function TEMPERATURE END", - added_in_version="9.8", - text=r""" +), + +Variable( + abivarname="lwf_temperature_end@multibinit", + varset="multibinit", + vartype="real", + topics=["LWFModel_basic"], + dimensions="scalar", + defaultval=0.0, + mnemonics="Lattice Wannier function TEMPERATURE END", + added_in_version="9.8", + text=r""" End point of variable temperature LWF dynamics calculation (see [[multibinit:LWF_var_temperature]]) in LWF dynamics calculation. """, - ), - Variable( - abivarname="lwf_temperature_nstep@multibinit", - varset="multibinit", - vartype="integer", - topics=["LWFModel_basic"], - dimensions="scalar", - defaultval=0, - mnemonics="Lattice Wannier function TEMPERATURE Number of STEPs", - added_in_version="9.8", - text=r""" +), + +Variable( + abivarname="lwf_temperature_nstep@multibinit", + varset="multibinit", + vartype="integer", + topics=["LWFModel_basic"], + dimensions="scalar", + defaultval=0, + mnemonics="Lattice Wannier function TEMPERATURE Number of STEPs", + added_in_version="9.8", + text=r""" Number of steps in the variable temperature LWF dynamics calculation (see [[multibinit:lwf_var_temperature]]) in lwf dynamics calculation. """, - ), - Variable( - abivarname="lwf_var_temperature@multibinit", - varset="multibinit", - vartype="integer", - topics=["LWFModel_basic"], - dimensions="scalar", - defaultval=0, - mnemonics="Lattice Wannier function VARiable TEMPERATURE", - added_in_version="9.8", - text=r""" +), + +Variable( + abivarname="lwf_var_temperature@multibinit", + varset="multibinit", + vartype="integer", + topics=["LWFModel_basic"], + dimensions="scalar", + defaultval=0, + mnemonics="Lattice Wannier function VARiable TEMPERATURE", + added_in_version="9.8", + text=r""" Switch for variable temperature calculation in LWF dynamics. 0: off. 1: on. If switched on, a series of LWF dynamics calculation with temperatures from [[multibinit:lwf_temperature_start]] to [[multibinit:lwf_temperature_end]], with number of steps [[multibinit:lwf_temperature_nstep]] will be done. The corresponding _lwf_hist.nc file has the corresponding temperature in the filename. """, - ), - Variable( - abivarname="ncoeff@multibinit", - varset="multibinit", - vartype="integer", - topics=["LatticeModel_useful"], - dimensions="scalar", - defaultval=0, - mnemonics="Number of anharmonic COEFFicients", - added_in_version="before_v9", - text=r""" +), + + +Variable( + abivarname="ncoeff@multibinit", + varset="multibinit", + vartype="integer", + topics=["LatticeModel_useful"], + dimensions="scalar", + defaultval=0, + mnemonics="Number of anharmonic COEFFicients", + added_in_version="before_v9", + text=r""" Set the number of anharmonic coefficients in the model. This number have to be in agreement with the number of coefficients present in the XML file. If ncoeff /= 0, [[multibinit:coefficients]] have to be present in the input files """, - ), - Variable( - abivarname="coefficients@multibinit", - varset="multibinit", - vartype="real", - topics=["LatticeModel_useful"], - dimensions=["[[multibinit:ncoeff]]"], - defaultval=0.0, - mnemonics="values of the COEFFICIENTS", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="coefficients@multibinit", + varset="multibinit", + vartype="real", + topics=["LatticeModel_useful"], + dimensions=["[[multibinit:ncoeff]]"], + defaultval=0.0, + mnemonics="values of the COEFFICIENTS", + added_in_version="before_v9", + text=r""" Set the values of the coefficients present in the XML file """, - ), - Variable( - abivarname="ngqpt@multibinit", - varset="multibinit", - vartype="integer", - topics=["LatticeModel_useful"], - dimensions=[3], - defaultval="3*1", - mnemonics="Number of Grids points for Q PoinTs", - added_in_version="before_v9", - text=r""" +), + + +Variable( + abivarname="ngqpt@multibinit", + varset="multibinit", + vartype="integer", + topics=["LatticeModel_useful"], + dimensions=[3], + defaultval="3*1", + mnemonics="Number of Grids points for Q PoinTs", + added_in_version="before_v9", + text=r""" The Monkhorst-Pack grid linear dimensions, for the DDB (coarse grid). """, - ), - Variable( - abivarname="nqshft@multibinit", - varset="multibinit", - vartype="integer", - topics=["LatticeModel_useful"], - dimensions="scalar", - defaultval=1, - mnemonics="Number of Q SHiFTs", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="nqshft@multibinit", + varset="multibinit", + vartype="integer", + topics=["LatticeModel_useful"], + dimensions="scalar", + defaultval=1, + mnemonics="Number of Q SHiFTs", + added_in_version="before_v9", + text=r""" The number of vector shifts of the simple Monkhorst and Pack grid, needed to generate the coarse grid of q points (for the series of fine grids, the number of shifts it is always taken to be 1). Usually, put it to 1. Use 2 if BCC sampling (Warning: not BCC lattice, BCC *sampling*), and 4 for FCC sampling (Warning: not FCC lattice, FCC *sampling*). """, - ), - Variable( - abivarname="prt_GF_csv@multibinit", - varset="multibinit", - vartype="integer", - topics=["LatticeModel_expert"], - dimensions="scalar", - defaultval=0, - mnemonics="Print the Goal-Function values in a CSV file", - added_in_version="v9", - text=r""" +), + +Variable( + abivarname="prt_GF_csv@multibinit", + varset="multibinit", + vartype="integer", + topics=["LatticeModel_expert"], + dimensions="scalar", + defaultval=0, + mnemonics="Print the Goal-Function values in a CSV file", + added_in_version="v9", + text=r""" * 0 --> do nothing (Default) * 1 --> Print the Goal-Function Values (GF) for all coefficients on a given processor at a given fit iteration into a csv file. Each iteration each processor prints a csv file. The columns are the GF on Energy, Force+Stresses, Forces, Stresses. """, - ), - Variable( - abivarname="prt_model@multibinit", - varset="multibinit", - vartype="integer", - topics=["LatticeModel_basic"], - dimensions="scalar", - defaultval=0, - mnemonics="PRinT the MODEL", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="prt_model@multibinit", + varset="multibinit", + vartype="integer", + topics=["LatticeModel_basic"], + dimensions="scalar", + defaultval=0, + mnemonics="PRinT the MODEL", + added_in_version="before_v9", + text=r""" * 0 --> do nothing (Default). * 1 --> Generate the XML file with: @@ -377,295 +413,319 @@ * The model (Anharmonic) in _coeffs.xml """, - ), - Variable( - abivarname="test_prt_ph@multibinit", - varset="multibinit", - vartype="integer", - topics=["LatticeModel_expert"], - dimensions="scalar", - defaultval=0, - mnemonics="Prt test-set evaluation into file ph_test.nc", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="test_prt_ph@multibinit", + varset="multibinit", + vartype="integer", + topics=["LatticeModel_expert"], + dimensions="scalar", + defaultval=0, + mnemonics="Prt test-set evaluation into file ph_test.nc", + added_in_version="before_v9", + text=r""" Flag to activate the printing of the evaluation of the effective potential on to a test set into a separate netcdf file called ph_test.nc. Forces, Energies, Stresses and Atomic Positions are written in ph_test.nc. """, - ), - Variable( - abivarname="fit_coeff@multibinit", - varset="multibinit", - vartype="integer", - topics=["FitProcess_basic"], - dimensions="scalar", - defaultval=0, - mnemonics="FIT anharmonic COEFFficients", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="fit_coeff@multibinit", + varset="multibinit", + vartype="integer", + topics=["FitProcess_basic"], + dimensions="scalar", + defaultval=0, + mnemonics="FIT anharmonic COEFFficients", + added_in_version="before_v9", + text=r""" * 0 --> do not active the fit process * 1 --> Activate the fit process. This option will first generate a set of coefficients if [[multibinit:fit_generateCoeff]] is set to one. This generation is mainly parametrized by [[multibinit:fit_rangePower]] and [[multibinit:fit_cutoff]]. You can also provided a list of coefficients with the model_anharmonic.MXL (see [[help:multibinit]]). Then the fit process will select the coefficients one by one up to [[multibinit:fit_ncoeff]] (see this [[cite:Escorihuela-Sayalero2017|paper]] for the details of the procedure). * -1 --> **only for developers**, print the files for the scripts """, - ), - Variable( - abivarname="fit_EFS@multibinit", - varset="multibinit", - vartype="integer", - topics=["FitProcess_basic"], - dimensions=[3], - defaultval=[0, 1, 1], - mnemonics="FIT on Energy, Forces, and or, Stresses", - added_in_version="v9", - text=r""" +), + +Variable( + abivarname="fit_EFS@multibinit", + varset="multibinit", + vartype="integer", + topics=["FitProcess_basic"], + dimensions=[3], + defaultval=[0,1,1], + mnemonics="FIT on Energy, Forces, and or, Stresses", + added_in_version="v9", + text=r""" Specifies on which first-principles quantities the anharmonic coefficients will be fitted. The first number flags the fitting on the energies, the second the fitting on the forces, and the third on the stressses. Default value is 0 1 1, so anharmonic coefficients get fitted on Forces and Stresses but not on energies """, - ), - Variable( - abivarname="fit_factors@multibinit", - varset="multibinit", - vartype="real", - topics=["FitProcess_basic"], - dimensions=[3], - defaultval=[1, 1, 1], - mnemonics="FIT FACTORS for Goal Function of Energy, Forces, and Stresses", - added_in_version="v9", - text=r""" +), + +Variable( + abivarname="fit_factors@multibinit", + varset="multibinit", + vartype="real", + topics=["FitProcess_basic"], + dimensions=[3], + defaultval=[1,1,1], + mnemonics="FIT FACTORS for Goal Function of Energy, Forces, and Stresses", + added_in_version="v9", + text=r""" Specifies three factors for Energy, Forces and Stresses in the calcukation of the Goal Function which is to be minimized during the fit process allowing to change the relative weight of the three quantities. Default value is 1 1 1, equally balancing energy, forces and stresses. """, - ), - Variable( - abivarname="fit_ncoeff@multibinit", - varset="multibinit", - vartype="integer", - topics=["FitProcess_basic"], - dimensions="scalar", - defaultval=0, - mnemonics="FIT Number of COEFFicients", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="fit_ncoeff@multibinit", + varset="multibinit", + vartype="integer", + topics=["FitProcess_basic"], + dimensions="scalar", + defaultval=0, + mnemonics="FIT Number of COEFFicients", + added_in_version="before_v9", + text=r""" Give the number of anharmonic coefficients to add in the model during the fit process """, - ), - Variable( - abivarname="fit_ncoeff_per_iatom@multibinit", - varset="multibinit", - vartype="integer", - topics=["FitProcess_basic"], - dimensions="scalar", - defaultval=0, - mnemonics="FIT Number of COEFFicients per Irreducible ATOM", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="fit_ncoeff_per_iatom@multibinit", + varset="multibinit", + vartype="integer", + topics=["FitProcess_basic"], + dimensions="scalar", + defaultval=0, + mnemonics="FIT Number of COEFFicients per Irreducible ATOM", + added_in_version="before_v9", + text=r""" Give the number of anharmonic coefficients per symmetric irreducible atom to add during fit process. [[multibinit:fit_ncoeff]]/(nirred_atoms*fit_ncoeff_per_iatom) gives the number of fitting loops performed during the fit process, where in each loop fit_ncoeff_per_iatom coefficients for each irreducible atom will be added to the anharmonic potential. """, - ), - Variable( - abivarname="fit_generateCoeff@multibinit", - varset="multibinit", - vartype="integer", - topics=["FitProcess_basic"], - dimensions="scalar", - defaultval=1, - mnemonics="FIT GENERATE anharmonic COEFFicient ", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="fit_generateCoeff@multibinit", + varset="multibinit", + vartype="integer", + topics=["FitProcess_basic"], + dimensions="scalar", + defaultval=1, + mnemonics="FIT GENERATE anharmonic COEFFicient ", + added_in_version="before_v9", + text=r""" Flag to activate the generation of the anharmonic coefficient for the fit process **Related variables:** The power range of the coefficients ([[multibinit:fit_rangePower]]), the cut off of the interactions ([[multibinit:fit_cutoff]]), the flag to add anharmonic strain ([[multibinit:fit_anhaStrain]]), the flag to add phonon strain coupling ([[multibinit:fit_SPCoupling]]) """, - ), - Variable( - abivarname="fit_iatom@multibinit", - varset="multibinit", - vartype="integer", - topics=["FitProcess_basic"], - dimensions="scalar", - defaultval=0, - mnemonics="FIT anharmonic terms around ATOM I", - added_in_version="before_v9", - text=r"""Gives the index of the atom in the reference structure around which the anharmonic terms will be generated. +), + +Variable( + abivarname="fit_iatom@multibinit", + varset="multibinit", + vartype="integer", + topics=["FitProcess_basic"], + dimensions="scalar", + defaultval=0, + mnemonics="FIT anharmonic terms around ATOM I", + added_in_version="before_v9", + text=r"""Gives the index of the atom in the reference structure around which the anharmonic terms will be generated. If 0 (default) a loop over all atoms in the reference structure will be perforemed and fit_ncoeff coefficienst will be fitted and selected per atom. If -1 all possible cross terms will be generated (e.G. (A_x-B_x)^2*(C_y-D_y)^1. This options generates much more terms. """, - ), - Variable( - abivarname="fit_initializeData@multibinit", - varset="multibinit", - vartype="integer", - topics=["FitProcess_basic"], - dimensions="scalar", - defaultval=0, - mnemonics="FIT INITIALIZE DATA for the fit", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="fit_initializeData@multibinit", + varset="multibinit", + vartype="integer", + topics=["FitProcess_basic"], + dimensions="scalar", + defaultval=0, + mnemonics="FIT INITIALIZE DATA for the fit", + added_in_version="before_v9", + text=r""" Flag to de/activate the precomputing and storage of all the data for the fit, it will reduce the computation time but increase a lot the memory... """, - ), - Variable( - abivarname="fit_rangePower@multibinit", - varset="multibinit", - vartype="integer", - topics=["FitProcess_basic"], - dimensions=[2], - defaultval="3 4", - mnemonics="FIT RANGE POWER for the coefficients", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="fit_rangePower@multibinit", + varset="multibinit", + vartype="integer", + topics=["FitProcess_basic"], + dimensions=[2], + defaultval="3 4", + mnemonics="FIT RANGE POWER for the coefficients", + added_in_version="before_v9", + text=r""" Set the range of the powers for the anharmonic coefficients """, - ), - Variable( - abivarname="fit_max_nbody@multibinit", - varset="multibinit", - vartype="integer", - topics=["FitProcess_basic"], - dimensions=["max([[multibinit:fit_rangePower]])-min([[multibinit:fit_rangePower]])+1"], - defaultval=0, - mnemonics="FIT MAXimum Number of BODY for the coefficients", - added_in_version="before_v9", - text=r""" +), + + + +Variable( + abivarname="fit_max_nbody@multibinit", + varset="multibinit", + vartype="integer", + topics=["FitProcess_basic"], + dimensions=["max([[multibinit:fit_rangePower]])-min([[multibinit:fit_rangePower]])+1"], + defaultval=0, + mnemonics="FIT MAXimum Number of BODY for the coefficients", + added_in_version="before_v9", + text=r""" For terms of every order specified in [[multibinit:fit_rangePower]], set the maximum of the number of bodies involved. The number of values should be the same as the number of orders. This can reduce the number of terms generated, so that the high order terms can be generated within a reasonable time. Note that each atomic motion in one direction and each strain component count as one body. """, - ), - Variable( - abivarname="fit_cutoff@multibinit", - varset="multibinit", - vartype="real", - topics=["FitProcess_basic"], - dimensions="scalar", - defaultval="Unit cell", - mnemonics="FIT CUT-OFF of the anharmonic phonon interaction", - added_in_version="before_v9", - text=r""" +), + + +Variable( + abivarname="fit_cutoff@multibinit", + varset="multibinit", + vartype="real", + topics=["FitProcess_basic"], + dimensions="scalar", + defaultval="Unit cell", + mnemonics="FIT CUT-OFF of the anharmonic phonon interaction", + added_in_version="before_v9", + text=r""" Cut-off for the anharmonic phonon interaction (in Bohr) """, - ), - Variable( - abivarname="fit_anhaStrain@multibinit", - varset="multibinit", - vartype="integer", - topics=["FitProcess_basic"], - dimensions="scalar", - defaultval=0, - mnemonics="FIT ANHARmonic STRAIN coefficients", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="fit_anhaStrain@multibinit", + varset="multibinit", + vartype="integer", + topics=["FitProcess_basic"], + dimensions="scalar", + defaultval=0, + mnemonics="FIT ANHARmonic STRAIN coefficients", + added_in_version="before_v9", + text=r""" Flag to activate the anharmonic strain. This option will add coefficients like (eta^4) """, - ), - Variable( - abivarname="fit_SPCoupling@multibinit", - varset="multibinit", - vartype="integer", - topics=["FitProcess_basic"], - dimensions="scalar", - defaultval=1, - mnemonics="FIT anharmonic Strain-Phonon COUPLING coefficients", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="fit_SPCoupling@multibinit", + varset="multibinit", + vartype="integer", + topics=["FitProcess_basic"], + dimensions="scalar", + defaultval=1, + mnemonics="FIT anharmonic Strain-Phonon COUPLING coefficients", + added_in_version="before_v9", + text=r""" Flag to activate the strain phonon coupling. This option will add coefficients like (Sr-Ti)^1 (eta^4) """, - ), - Variable( - abivarname="fit_dispterms@multibinit", - varset="multibinit", - vartype="integer", - topics=["FitProcess_basic"], - dimensions="scalar", - defaultval=1, - mnemonics="FIT anharmonic Strain-Phonon COUPLING coefficients", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="fit_dispterms@multibinit", + varset="multibinit", + vartype="integer", + topics=["FitProcess_basic"], + dimensions="scalar", + defaultval=1, + mnemonics="FIT anharmonic Strain-Phonon COUPLING coefficients", + added_in_version="before_v9", + text=r""" Flag to activate the generation of pure displacement coefficients. This option will generate coefficients like (Sr-Ti)^2*(Sr-O), where only atomic displacements occur. Default value: 1 -> displacement terms are generated. """, - ), - Variable( - abivarname="fit_SPC_maxS@multibinit", - varset="multibinit", - vartype="integer", - topics=["FitProcess_basic"], - dimensions="scalar", - defaultval=1, - mnemonics="FIT Strain Phonon Coupling maximum Strain", - added_in_version="v9", - text=r""" +), + +Variable( + abivarname="fit_SPC_maxS@multibinit", + varset="multibinit", + vartype="integer", + topics=["FitProcess_basic"], + dimensions="scalar", + defaultval=1, + mnemonics="FIT Strain Phonon Coupling maximum Strain", + added_in_version="v9", + text=r""" Set maximum power of strain body in strain-phonon coupling terms. """, - ), - Variable( - abivarname="fit_tolMSDE@multibinit", - varset="multibinit", - vartype="real", - topics=["FitProcess_basic"], - dimensions="scalar", - defaultval=0, - mnemonics="FIT TOLerance on Mean Standard Deviation of the Energy", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="fit_tolMSDE@multibinit", + varset="multibinit", + vartype="real", + topics=["FitProcess_basic"], + dimensions="scalar", + defaultval=0, + mnemonics="FIT TOLerance on Mean Standard Deviation of the Energy", + added_in_version="before_v9", + text=r""" Tolerance of the fit based on the Mean Standard Deviation of the Energy in (meV/atm) """, - ), - Variable( - abivarname="fit_tolMSDS@multibinit", - varset="multibinit", - vartype="real", - topics=["FitProcess_basic"], - dimensions="scalar", - defaultval=0, - mnemonics="FIT TOLerance on Mean Standard Deviation of the Stresses", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="fit_tolMSDS@multibinit", + varset="multibinit", + vartype="real", + topics=["FitProcess_basic"], + dimensions="scalar", + defaultval=0, + mnemonics="FIT TOLerance on Mean Standard Deviation of the Stresses", + added_in_version="before_v9", + text=r""" Tolerance of the fit based on the Mean Standard Deviation of the Stresses in (eV^2/A^2) """, - ), - Variable( - abivarname="fit_tolMSDF@multibinit", - varset="multibinit", - vartype="real", - topics=["FitProcess_basic"], - dimensions="scalar", - defaultval=0, - mnemonics="FIT TOLerance on Mean Standard Deviation of the Forces", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="fit_tolMSDF@multibinit", + varset="multibinit", + vartype="real", + topics=["FitProcess_basic"], + dimensions="scalar", + defaultval=0, + mnemonics="FIT TOLerance on Mean Standard Deviation of the Forces", + added_in_version="before_v9", + text=r""" Tolerance of the fit based on the Mean Standard Deviation of the Forces (eV^2/A^2) """, - ), - Variable( - abivarname="fit_tolMSDFS@multibinit", - varset="multibinit", - vartype="real", - topics=["FitProcess_basic"], - dimensions="scalar", - defaultval=0, - mnemonics="FIT TOLerance on Mean Standard Deviation of the Forces and Stresses", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="fit_tolMSDFS@multibinit", + varset="multibinit", + vartype="real", + topics=["FitProcess_basic"], + dimensions="scalar", + defaultval=0, + mnemonics="FIT TOLerance on Mean Standard Deviation of the Forces and Stresses", + added_in_version="before_v9", + text=r""" Tolerance of the fit based on the Mean Standard Deviation of the Forces and Sressses (eV^2/A^2) """, - ), - Variable( - abivarname="fit_nfixcoeff@multibinit", - varset="multibinit", - vartype="integer", - topics=["FitProcess_expert"], - dimensions="scalar", - defaultval=0, - mnemonics="FIT Number of FIXed COEFFicients", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="fit_nfixcoeff@multibinit", + varset="multibinit", + vartype="integer", + topics=["FitProcess_expert"], + dimensions="scalar", + defaultval=0, + mnemonics="FIT Number of FIXed COEFFicients", + added_in_version="before_v9", + text=r""" Number of imposed coefficients during the fit process for the model: * -1 --> fix all the coefficients @@ -674,30 +734,33 @@ * n --> fix n coefficients (requires [[multibinit:fit_fixcoeff]] input variable) """, - ), - Variable( - abivarname="fit_fixcoeff@multibinit", - varset="multibinit", - vartype="integer", - topics=["FitProcess_expert"], - dimensions=["[[multibinit:fit_nfixcoeff]]"], - defaultval=0, - mnemonics="FIT FIXed COEFFicients", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="fit_fixcoeff@multibinit", + varset="multibinit", + vartype="integer", + topics=["FitProcess_expert"], + dimensions=["[[multibinit:fit_nfixcoeff]]"], + defaultval=0, + mnemonics="FIT FIXed COEFFicients", + added_in_version="before_v9", + text=r""" Indices of the imposed coefficients during the fit process for the model: """, - ), - Variable( - abivarname="fit_nimposecoeff@multibinit", - varset="multibinit", - vartype="integer", - topics=["FitProcess_expert"], - dimensions="scalar", - defaultval=0, - mnemonics="FIT Number of IMPOSEd COEFFicients", - added_in_version="before_v9", - text=r""" +), + + +Variable( + abivarname="fit_nimposecoeff@multibinit", + varset="multibinit", + vartype="integer", + topics=["FitProcess_expert"], + dimensions="scalar", + defaultval=0, + mnemonics="FIT Number of IMPOSEd COEFFicients", + added_in_version="before_v9", + text=r""" Number of coefficients imposed with fixed value as in the input xml during the fit process for the model: * -1 --> fix all the coefficients @@ -706,60 +769,64 @@ * n --> fix n coefficients (requires [[multibinit:fit_imposecoeff]] input variable) """, - ), - Variable( - abivarname="fit_imposecoeff@multibinit", - varset="multibinit", - vartype="integer", - topics=["FitProcess_expert"], - dimensions=["[[multibinit:fit_nimposecoeff]]"], - defaultval=0, - mnemonics="FIT Number of IMPOSEd COEFFicients", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="fit_imposecoeff@multibinit", + varset="multibinit", + vartype="integer", + topics=["FitProcess_expert"], + dimensions=["[[multibinit:fit_nimposecoeff]]"], + defaultval=0, + mnemonics="FIT Number of IMPOSEd COEFFicients", + added_in_version="before_v9", + text=r""" Indices of the imposed coefficients with fixed coefficient value during the fit process for the model. """, - ), - Variable( - abivarname="fit_nbancoeff@multibinit", - varset="multibinit", - vartype="integer", - topics=["FitProcess_expert"], - dimensions="scalar", - defaultval=0, - mnemonics="FIT Number of BANed COEFFicients", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="fit_nbancoeff@multibinit", + varset="multibinit", + vartype="integer", + topics=["FitProcess_expert"], + dimensions="scalar", + defaultval=0, + mnemonics="FIT Number of BANed COEFFicients", + added_in_version="before_v9", + text=r""" Number of imposed coefficients during the fit process of the model: * 0 --> do not ban coefficients * n --> ban n coefficients (requires [[multibinit:fit_bancoeff]] input variable) """, - ), - Variable( - abivarname="fit_bancoeff@multibinit", - varset="multibinit", - vartype="integer", - topics=["FitProcess_expert"], - dimensions=["[[multibinit:fit_nbancoeff]]"], - defaultval=0, - mnemonics="FIT BANed COEFFicients", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="fit_bancoeff@multibinit", + varset="multibinit", + vartype="integer", + topics=["FitProcess_expert"], + dimensions=["[[multibinit:fit_nbancoeff]]"], + defaultval=0, + mnemonics="FIT BANed COEFFicients", + added_in_version="before_v9", + text=r""" Indices of the banned coefficients during the fit process of the model """, - ), - Variable( - abivarname="fit_weight_T@multibinit", - varset="multibinit", - vartype="float", - topics=["FitProcess_expert"], - dimensions="scalar", - defaultval=-0.1, - mnemonics="FIT WEIGHT characteristic Temperature", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="fit_weight_T@multibinit", + varset="multibinit", + vartype="real", + topics=["FitProcess_expert"], + dimensions="scalar", + defaultval=-0.1, + mnemonics="FIT WEIGHT characteristic Temperature", + added_in_version="before_v9", + text=r""" A temperature-like parameter to tune the weights of the structures in the training set. If the value is negative or 0, this weight scheme is not used and all structures in the training set are seen as equally important. @@ -771,48 +838,54 @@ This can be useful when the structure near local minima and saddle points (in which the forces are close to 0) need to the emphasized. Note that if the fig_weight_T is too small, the algorithm becomes inefficient as a large part of the training set has very low weight and are wasted. """, - ), - Variable( - abivarname="ts_option@multibinit", - varset="multibinit", - vartype="integer", - topics=["FitProcess_useful"], - dimensions="scalar", - defaultval=0, - mnemonics="fit Training Set OPTION", - added_in_version="before_v9", - text=r""" +), + + + + +Variable( + abivarname="ts_option@multibinit", + varset="multibinit", + vartype="integer", + topics=["FitProcess_useful"], + dimensions="scalar", + defaultval=0, + mnemonics="fit Training Set OPTION", + added_in_version="before_v9", + text=r""" * 0 --> the Training is hist from ABINIT * 1 --> the Training contains -1 * stress (usually output from VASP) """, - ), - Variable( - abivarname="bound_factors@multibinit", - varset="multibinit", - vartype="real", - topics=["FitProcess_basic"], - dimensions=[3], - defaultval=[1, 1, 1], - mnemonics="FACTORS for Goal Function of Energy, Forces, and Stresses during bounding process", - added_in_version="v9", - text=r""" +), + +Variable( + abivarname="bound_factors@multibinit", + varset="multibinit", + vartype="real", + topics=["FitProcess_basic"], + dimensions=[3], + defaultval=[1,1,1], + mnemonics="FACTORS for Goal Function of Energy, Forces, and Stresses during bounding process", + added_in_version="v9", + text=r""" Specify three factors for Energy, Forces and Stresses in the calculation of the Goal Function which is to be minimized during the bounding process, allowing to change the relative weights of the three quantities. Default value is 1 1 1, equally balancing energy, forces and stresses. """, - ), - Variable( - abivarname="bound_model@multibinit", - varset="multibinit", - vartype="integer", - topics=["BoundingProcess_basic"], - dimensions="scalar", - defaultval=0, - mnemonics="BOUND MODEL", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="bound_model@multibinit", + varset="multibinit", + vartype="integer", + topics=["BoundingProcess_basic"], + dimensions="scalar", + defaultval=0, + mnemonics="BOUND MODEL", + added_in_version="before_v9", + text=r""" Flag to activate the bound process: * 0 --> Do not activate the bound process @@ -826,21 +899,23 @@ *3 --> Check each anharmonic term in the effective potential. If the term contains has a negative coefficient and is even in its displacement or contains odd powers in the displacement generate high order bounding terms of the same combination of displacement within the range of powers defined by the user ([[multibinit:bound_rangePower]]). The coefficients of the added high-order terms are optimized until the precision of the original effective potential is retained. """, - ), - Variable( - abivarname="bound_maxCoeff@multibinit", - varset="multibinit", - vartype="integer", - topics=["BoundingProcess_basic"], - dimensions="scalar", - defaultval=0, - mnemonics="BOUND MAX COEFFicient", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="bound_maxCoeff@multibinit", + varset="multibinit", + vartype="integer", + topics=["BoundingProcess_basic"], + dimensions="scalar", + defaultval=0, + mnemonics="BOUND MAX COEFFicient", + added_in_version="before_v9", + text=r""" Number of maximum additional coefficients for the bound process """, - ), - Variable( +), + +Variable( abivarname="bound_option@multibinit", varset="multibinit", vartype="integer", @@ -858,121 +933,132 @@ For example, for a polynomial term x^2y^1, the bounding terms of order 4 will include $x^4$ with option 2, but not with option 1. """, - ), - Variable( - abivarname="bound_penalty@multibinit", - varset="multibinit", - vartype="real", - topics=["FitProcess_basic"], - dimensions="scalar", - defaultval=1.001, - mnemonics="Goal Function penalty for determination of bounding coefficients", - added_in_version="v9", - text=r""" +), + + +Variable( + abivarname="bound_penalty@multibinit", + varset="multibinit", + vartype="real", + topics=["FitProcess_basic"], + dimensions="scalar", + defaultval=1.001, + mnemonics="Goal Function penalty for determination of bounding coefficients", + added_in_version="v9", + text=r""" Relative penalty for the determination of bounding coefficient values. The penalty defines the ration of the goal function before and after adding the coefficient. If the optimum value of the coefficient (-one that decreases the value of the goal function-) is negative a positive value that . """, - ), - Variable( - abivarname="bound_rangePower@multibinit", - varset="multibinit", - vartype="integer", - topics=["BoundingProcess_basic"], - dimensions=[2], - defaultval="6,6", - mnemonics="BOUND RANGE POWER", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="bound_rangePower@multibinit", + varset="multibinit", + vartype="integer", + topics=["BoundingProcess_basic"], + dimensions=[2], + defaultval="6,6", + mnemonics="BOUND RANGE POWER", + added_in_version="before_v9", + text=r""" Range of the power for the additional coefficients in the bound process """, - ), - Variable( - abivarname="bound_cutoff@multibinit", - varset="multibinit", - vartype="real", - topics=["BoundingProcess_basic"], - dimensions="scalar", - defaultval="1 unit cell", - mnemonics="BOUND CUT OFF", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="bound_cutoff@multibinit", + varset="multibinit", + vartype="real", + topics=["BoundingProcess_basic"], + dimensions="scalar", + defaultval="1 unit cell", + mnemonics="BOUND CUT OFF", + added_in_version="before_v9", + text=r""" Cut-off for the anharmonic phonon interaction during the bound process (in Bohr) """, - ), - Variable( - abivarname="bound_anhaStrain@multibinit", - varset="multibinit", - vartype="integer", - topics=["BoundingProcess_basic"], - dimensions="scalar", - defaultval=0, - mnemonics="BOUND ANHArmonic STRAIN coefficients", - added_in_version="before_v9", - text=r""" +), + + +Variable( + abivarname="bound_anhaStrain@multibinit", + varset="multibinit", + vartype="integer", + topics=["BoundingProcess_basic"], + dimensions="scalar", + defaultval=0, + mnemonics="BOUND ANHArmonic STRAIN coefficients", + added_in_version="before_v9", + text=r""" Flag to activate the anharmonic strain. When the bound process will generate the possible coefficients for the fit, if this input variable is set to 1, the generator will consider coefficients like eta^4 """, - ), - Variable( - abivarname="bound_SPCoupling@multibinit", - varset="multibinit", - vartype="integer", - topics=["BoundingProcess_basic"], - dimensions="scalar", - defaultval=1, - mnemonics="BOUND Strain Phonon COUPLING coefficients", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="bound_SPCoupling@multibinit", + varset="multibinit", + vartype="integer", + topics=["BoundingProcess_basic"], + dimensions="scalar", + defaultval=1, + mnemonics="BOUND Strain Phonon COUPLING coefficients", + added_in_version="before_v9", + text=r""" Flag to activate the strain phonon coupling. When the bound process will generate the possible coefficients for the fit, if this input variable is set to 1, the generator will consider coefficients like (Sr-Ti)^2 eta^2 """, - ), - Variable( - abivarname="bound_cell@multibinit", - varset="multibinit", - vartype="integer", - topics=["BoundingProcess_expert"], - dimensions=[3], - defaultval="6,6,6", - mnemonics="BOUND superCELL size for the molecular dynamics", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="bound_cell@multibinit", + varset="multibinit", + vartype="integer", + topics=["BoundingProcess_expert"], + dimensions=[3], + defaultval="6,6,6", + mnemonics="BOUND superCELL size for the molecular dynamics", + added_in_version="before_v9", + text=r""" When the process will try a given model, this input variable is used to set the size of the supercell for the molecular dynamics """, - ), - Variable( - abivarname="bound_temp@multibinit", - varset="multibinit", - vartype="integer", - topics=["BoundingProcess_expert"], - dimensions="scalar", - defaultval=500, - mnemonics="BOUND TEMPerature for the molecular dynamics (in Kelvin)", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="bound_temp@multibinit", + varset="multibinit", + vartype="integer", + topics=["BoundingProcess_expert"], + dimensions="scalar", + defaultval=500, + mnemonics="BOUND TEMPerature for the molecular dynamics (in Kelvin)", + added_in_version="before_v9", + text=r""" When the process will try a given model, this input variable is used to set the temperature for the molecular dynamics """, - ), - Variable( - abivarname="bound_step@multibinit", - varset="multibinit", - vartype="integer", - topics=["BoundingProcess_expert"], - dimensions="scalar", - defaultval=1000, - mnemonics="BOUND number of STEP for the molecular dynamics", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="bound_step@multibinit", + varset="multibinit", + vartype="integer", + topics=["BoundingProcess_expert"], + dimensions="scalar", + defaultval=1000, + mnemonics="BOUND number of STEP for the molecular dynamics", + added_in_version="before_v9", + text=r""" When the process will try a given model, this input variable is used to set the maximum number of molecular dynamics steps """, - ), - Variable( - abivarname="dynamics@multibinit", - varset="multibinit", - vartype="integer", - topics=["DynamicsMultibinit_basic"], - dimensions="scalar", - defaultval=0, - mnemonics="Dynamics option for Multibinit", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="dynamics@multibinit", + varset="multibinit", + vartype="integer", + topics=["DynamicsMultibinit_basic"], + dimensions="scalar", + defaultval=0, + mnemonics="Dynamics option for Multibinit", + added_in_version="before_v9", + text=r""" Set the Dynamics option for Multibinit. This option is equivalent to [[abinit:ionmov]] for numbers < 100. For numbers >100, it uses algorithms implemented inside Multibinit: * 0 --> do nothing @@ -1060,67 +1146,76 @@ * 120 --> Dummy mover. Atoms does not move. For testing only. """, - # Not yet fully implemented. Need to be properly documented and tested. Disactivated temporarily. - # * 104 --> NPT ensemble with method. Similar to option 103, except the pressure is also scaled. - # **Purpose:** Molecular dynamics - # **Cell optimization:** No (Use [[optcell]]=0 only) - # **Related variables:** The time step ([[dtion]]), the temperatures - # ([[multibinit:temperature]]), the ion relaxation time [[multibinit:latt_taut]], the pressure relaxation time [[multibinit:latt_taup]]. - ), - Variable( - abivarname="dyn_chksym@multibinit", - varset="multibinit", - vartype="integer", - topics=["DynamicsMultibinit_basic"], - dimensions="scalar", - defaultval=0, - mnemonics="DYNamics CHecK SYMmetry", - added_in_version="v9", - text=r""" + +# Not yet fully implemented. Need to be properly documented and tested. Disactivated temporarily. +#* 104 --> NPT ensemble with method. Similar to option 103, except the pressure is also scaled. +#**Purpose:** Molecular dynamics +#**Cell optimization:** No (Use [[optcell]]=0 only) +#**Related variables:** The time step ([[dtion]]), the temperatures +#([[multibinit:temperature]]), the ion relaxation time [[multibinit:latt_taut]], the pressure relaxation time [[multibinit:latt_taup]]. + + + + +), + +Variable( + abivarname="dyn_chksym@multibinit", + varset="multibinit", + vartype="integer", + topics=["DynamicsMultibinit_basic"], + dimensions="scalar", + defaultval=0, + mnemonics="DYNamics CHecK SYMmetry", + added_in_version="v9", + text=r""" Flag to activate symmetry finder and imposition of symmetry of the restart structure before dynamics run, when restartxf is negative. Useful to do symmetry constrained relaxation with structural realxations algorithms. Be cautious to use it with large number of atoms, symmetry detection might take a long time. **Related variables:** Restart flag for multibinit dynamcis ([[multibinit:restartxf]]), symmetry on symmetry finder ([[multibinit:dyn_tolsym]])) """, - ), - Variable( - abivarname="dyn_tolsym@multibinit", - varset="multibinit", - vartype="real", - topics=["DynamicsMultibinit_basic"], - dimensions="scalar", - defaultval=1e-10, - mnemonics="DYNamics TOLerance on SYMmetries", - added_in_version="v9", - text=r""" +), + +Variable( + abivarname="dyn_tolsym@multibinit", + varset="multibinit", + vartype="real", + topics=["DynamicsMultibinit_basic"], + dimensions="scalar", + defaultval=1e-10, + mnemonics="DYNamics TOLerance on SYMmetries", + added_in_version="v9", + text=r""" Tolerance on symmetry finder. **Related variables:** Activation flag for symmetry finder ([[multibinit:dyn_chksym]]) """, - ), - Variable( - abivarname="dtion@multibinit", - varset="multibinit", - vartype="integer", - topics=["DynamicsMultibinit_basic"], - dimensions="scalar", - defaultval=100, - mnemonics="Delta Time for IONs", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="dtion@multibinit", + varset="multibinit", + vartype="integer", + topics=["DynamicsMultibinit_basic"], + dimensions="scalar", + defaultval=100, + mnemonics="Delta Time for IONs", + added_in_version="before_v9", + text=r""" See [[abinit:dtion]] """, - ), - Variable( - abivarname="efield_type@multibinit", - varset="multibinit", - vartype="integer", - topics=["DynamicsMultibinit_basic"], - dimensions="scalar", - defaultval=0, - mnemonics="Electric FIELD TYPE for Multibinit", - added_in_version="v10", - text=r""" +), + +Variable( + abivarname="efield_type@multibinit", + varset="multibinit", + vartype="integer", + topics=["DynamicsMultibinit_basic"], + dimensions="scalar", + defaultval=0, + mnemonics="Electric FIELD TYPE for Multibinit", + added_in_version="v10", + text=r""" Set the electric field option for Multibinit. * 0 --> no electric field @@ -1135,233 +1230,255 @@ * 5 --> Allows the computation of Gaussian like distributed electric fields. -* 6 --> Allows the computation of 2 spatially modulated electric fields with the functional form of 3 at the same time.""", - ), - Variable( - abivarname="efield@multibinit", - varset="multibinit", - vartype="real", - topics=["DynamicsMultibinit_basic"], - dimensions=[3, "[[multibinit:nefield]]"], - defaultval=[0.0, 0.0, 0.0], - mnemonics="Electric FIELD magnitude for Multibinit", - added_in_version="before v9", - text=r""" +* 6 --> Allows the computation of 2 spatially modulated electric fields with the functional form of 3 at the same time.""" +), + +Variable( + abivarname="efield@multibinit", + varset="multibinit", + vartype="real", + topics=["DynamicsMultibinit_basic"], + dimensions=[3, "[[multibinit:nefield]]"], + defaultval=[0.0, 0.0, 0.0], + mnemonics="Electric FIELD magnitude for Multibinit", + added_in_version="before v9", + text=r""" Set the magnitude for the electric field. For efield_type 6, multiple ([[multibinit:nefield]]) efield values are allowed, the format is Ex1, Ey1, Ez1, Ex2, Ey2, Ez2 -""", - ), - Variable( - abivarname="efield_background@multibinit", - varset="multibinit", - vartype="real", - topics=["DynamicsMultibinit_basic"], - dimensions=[3], - defaultval=[0.0, 0.0, 0.0], - mnemonics="Electric FIELD magnitude for BACKGROUND field in Multibinit when efield_type is > 1", - added_in_version="v10", - text=r""" -Set the magnitude for the background homogeneous electric field when efield_type > 1 in MB""", - ), - Variable( - abivarname="efield_lambda@multibinit", - varset="multibinit", - vartype="real", - topics=["DynamicsMultibinit_basic"], - dimensions=[3, "[[multibinit:nefield]]"], - defaultval=[0.0, 0.0, 0.0], - mnemonics="Electric FIELD periodicity LAMBDA.", - added_in_version="v10", - text=r""" +""" +), + + +Variable( + abivarname="efield_background@multibinit", + varset="multibinit", + vartype="real", + topics=["DynamicsMultibinit_basic"], + dimensions=[3], + defaultval=[0.0, 0.0, 0.0], + mnemonics="Electric FIELD magnitude for BACKGROUND field in Multibinit when efield_type is > 1", + added_in_version="v10", + text=r""" +Set the magnitude for the background homogeneous electric field when efield_type > 1 in MB""" +), + +Variable( + abivarname="efield_lambda@multibinit", + varset="multibinit", + vartype="real", + topics=["DynamicsMultibinit_basic"], + dimensions=[3, "[[multibinit:nefield]]"], + defaultval=[0.0, 0.0, 0.0], + mnemonics="Electric FIELD periodicity LAMBDA.", + added_in_version="v10", + text=r""" Set the periodicity in real space for spatially inhomogeneous vector fields. 0.0 is interpreted as infinite. For efield_type 6, multiple ([[multibinit:nefield]]) efield_lambda values are allowed, the format is λx1, λy1, λz1, λx2, λy2, λz2 -""", - ), - Variable( - abivarname="efield_period@multibinit", - varset="multibinit", - vartype="real", - topics=["DynamicsMultibinit_basic"], - dimensions="scalar", - defaultval=1000000000000000.0, - mnemonics="Electric FIELD PERIOD.", - added_in_version="v10", - text=r""" -Set the periodicity in time for time modulated electric fields""", - ), - Variable( - abivarname="efield_phase@multibinit", - varset="multibinit", - vartype="real", - topics=["DynamicsMultibinit_basic"], - dimensions=["[[multibinit:nefield]]"], - defaultval=0.0, - mnemonics="Electric FIELD PHASE shift.", - added_in_version="v10", - text=r""" +""" +), + +Variable( + abivarname="efield_period@multibinit", + varset="multibinit", + vartype="real", + topics=["DynamicsMultibinit_basic"], + dimensions="scalar", + defaultval=1000000000000000.0, + mnemonics="Electric FIELD PERIOD.", + added_in_version="v10", + text=r""" +Set the periodicity in time for time modulated electric fields""" +), + +Variable( + abivarname="efield_phase@multibinit", + varset="multibinit", + vartype="real", + topics=["DynamicsMultibinit_basic"], + dimensions=["[[multibinit:nefield]]"], + defaultval=0.0, + mnemonics="Electric FIELD PHASE shift.", + added_in_version="v10", + text=r""" Set the phase shift for spatially or time modulated fields. For efield_type 6, multiple ([[multibinit:nefield]]) efield_phase values are allowed. -""", - ), - Variable( - abivarname="efield_gmean@multibinit", - varset="multibinit", - vartype="real", - topics=["DynamicsMultibinit_basic"], - dimensions=[3], - defaultval=[0.0, 0.0, 0.0], - mnemonics="Electric FIELD Gaussian MEAN.", - added_in_version="v10", - text=r""" -Set the mean value for the Gaussian distributed electric field.""", - ), - Variable( - abivarname="efield_gvel@multibinit", - varset="multibinit", - vartype="real", - topics=["DynamicsMultibinit_basic"], - dimensions=[3], - defaultval=[0.0, 0.0, 0.0], - mnemonics="Electric FIELD Gaussian VELocity.", - added_in_version="v10", - text=r""" -Set the velocity of the center of the Gaussian distributed field.""", - ), - Variable( - abivarname="efield_sigma@multibinit", - varset="multibinit", - vartype="real", - topics=["DynamicsMultibinit_basic"], - dimensions="scalar", - defaultval=0.01, - mnemonics="Electric FIELD gaussian SIGMA.", - added_in_version="v10", - text=r""" -Set the standard deviation of the Gaussian field.""", - ), - Variable( - abivarname="latt_friction@multibinit", - varset="multibinit", - vartype="integer", - topics=["DynamicsMultibinit_basic"], - dimensions="scalar", - defaultval=1e-4, - mnemonics="LATTice dynamics FRICTION parameter", - added_in_version="before_v9", - text=r""" +""" +), + + +Variable( + abivarname="efield_gmean@multibinit", + varset="multibinit", + vartype="real", + topics=["DynamicsMultibinit_basic"], + dimensions=[3], + defaultval= [0.0, 0.0, 0.0], + mnemonics="Electric FIELD Gaussian MEAN.", + added_in_version="v10", + text=r""" +Set the mean value for the Gaussian distributed electric field.""" +), + +Variable( + abivarname="efield_gvel@multibinit", + varset="multibinit", + vartype="real", + topics=["DynamicsMultibinit_basic"], + dimensions=[3], + defaultval= [0.0, 0.0, 0.0], + mnemonics="Electric FIELD Gaussian VELocity.", + added_in_version="v10", + text=r""" +Set the velocity of the center of the Gaussian distributed field.""" +), + +Variable( + abivarname="efield_sigma@multibinit", + varset="multibinit", + vartype="real", + topics=["DynamicsMultibinit_basic"], + dimensions="scalar", + defaultval=0.01, + mnemonics="Electric FIELD gaussian SIGMA.", + added_in_version="v10", + text=r""" +Set the standard deviation of the Gaussian field.""" +), + + +Variable( + abivarname="latt_friction@multibinit", + varset="multibinit", + vartype="integer", + topics=["DynamicsMultibinit_basic"], + dimensions="scalar", + defaultval=1e-4, + mnemonics="LATTice dynamics FRICTION parameter", + added_in_version="before_v9", + text=r""" Parameter of the friction coefficient used in Langevin dynamics [[multibinit:dynamics]] =102. Typical value is 1e-4 to 1e-2. """, - ), - Variable( - abivarname="latt_anharm_pot_fname@multibinit", - varset="multibinit", - vartype="string", - topics=["DynamicsMultibinit_basic"], - dimensions="scalar", - defaultval="", - mnemonics="LATTice HARMornic POTential File NAME", - added_in_version="9.8", - text=r""" +), + +Variable( + abivarname="latt_anharm_pot_fname@multibinit", + varset="multibinit", + vartype="string", + topics=["DynamicsMultibinit_basic"], + dimensions="scalar", + defaultval="", + mnemonics="LATTice HARMornic POTential File NAME", + added_in_version="9.8", + text=r""" Specify the input coefficients from fitted polynomial in multibinit lattice calculation, which can be a xml file. The string must be enclosed between quotation marks: lat_anharm_pot_fname "BaTiO3_coeff.xml" -""", - ), - Variable( - abivarname="latt_harm_pot_fname@multibinit", - varset="multibinit", - vartype="string", - topics=["DynamicsMultibinit_basic"], - dimensions="scalar", - defaultval="", - mnemonics="LATTice HARMonic POTential File NAME", - added_in_version="9.8", - text=r""" +""" +), + + +Variable( + abivarname="latt_harm_pot_fname@multibinit", + varset="multibinit", + vartype="string", + topics=["DynamicsMultibinit_basic"], + dimensions="scalar", + defaultval="", + mnemonics="LATTice HARMonic POTential File NAME", + added_in_version="9.8", + text=r""" Specify the input derivative database of reference structure in multibinit lattice calculation, which can be a DDB file or a xml file. The string must be enclosed between quotation marks: latt_harm_pot_fname "BaTiO3.ddb" -""", - ), - Variable( - abivarname="latt_training_set_fname@multibinit", - varset="multibinit", - vartype="string", - topics=["DynamicsMultibinit_basic"], - dimensions="scalar", - defaultval="", - mnemonics="LATTice potential TRAINING SET File NAME", - added_in_version="9.3.3", - text=r""" +""" +), + +Variable( + abivarname="latt_training_set_fname@multibinit", + varset="multibinit", + vartype="string", + topics=["DynamicsMultibinit_basic"], + dimensions="scalar", + defaultval="", + mnemonics="LATTice potential TRAINING SET File NAME", + added_in_version="9.3.3", + text=r""" Specify the training set file name for building multibinit lattice potential, which is usually a abinit molecular dynamics history netcdf file. The string must be enclosed between quotation marks: latt_training_set_fname "BaTiO3_md_hist.nc" -""", - ), - Variable( - abivarname="latt_test_set_fname@multibinit", - varset="multibinit", - vartype="string", - topics=["DynamicsMultibinit_basic"], - dimensions="scalar", - defaultval="", - mnemonics="LATTice potential TEST SET File NAME", - added_in_version="9.8", - text=r""" +""" +), + +Variable( + abivarname="latt_test_set_fname@multibinit", + varset="multibinit", + vartype="string", + topics=["DynamicsMultibinit_basic"], + dimensions="scalar", + defaultval="", + mnemonics="LATTice potential TEST SET File NAME", + added_in_version="9.8", + text=r""" Specify the test set file name for building multibinit lattice potential, which is usually a abinit molecular dynamics history netcdf file. The string must be enclosed between quotation marks: latt_test_set_fname "BaTiO3_md_hist.nc" -""", - ), - Variable( - abivarname="latt_pot_fname@multibinit", - varset="multibinit", - vartype="string", - topics=["DynamicsMultibinit_basic"], - dimensions="scalar", - defaultval="", - mnemonics="LATTice POTential FileNAME", - added_in_version="9.8", - text=r""" +""" +), + + +Variable( + abivarname="latt_pot_fname@multibinit", + varset="multibinit", + vartype="string", + topics=["DynamicsMultibinit_basic"], + dimensions="scalar", + defaultval="", + mnemonics="LATTice POTential FileNAME", + added_in_version="9.8", + text=r""" Specify the lattice potential file name in the multibinit lattice dynamics calculation, which can be a netcdf file. This variable is only used in the harmonic-only lattice potential for testing only. The string must be enclosed between quotation marks: latt_pot_fname "BaTiO3.nc" -""", - ), - Variable( - abivarname="latt_taut@multibinit", - varset="multibinit", - vartype="integer", - topics=["DynamicsMultibinit_basic"], - dimensions="scalar", - defaultval=1000, - mnemonics="LATTice dynamics relaxation time TAUT", - added_in_version="before_v9", - text=r""" +""" +), + + +Variable( + abivarname="latt_taut@multibinit", + varset="multibinit", + vartype="integer", + topics=["DynamicsMultibinit_basic"], + dimensions="scalar", + defaultval=1000, + mnemonics="LATTice dynamics relaxation time TAUT", + added_in_version="before_v9", + text=r""" Parameter used in Berendsen lattice dynamics [[multibinit:dynamics]] =102 and 103, in which the temperature is relaxed exponentially to the target temperature, with the characteristic time of latt_taut. The default unit is atomic unit. But it is possible to use the second as the unit by adding Second or S at the end of the line, for example: latt_taut 1d-15 S """, - ), - Variable( - abivarname="latt_taup@multibinit", - varset="multibinit", - vartype="integer", - topics=["DynamicsMultibinit_basic"], - dimensions="scalar", - defaultval=1000, - mnemonics="LATTice dynamics relaxation time TAUP", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="latt_taup@multibinit", + varset="multibinit", + vartype="integer", + topics=["DynamicsMultibinit_basic"], + dimensions="scalar", + defaultval=1000, + mnemonics="LATTice dynamics relaxation time TAUP", + added_in_version="before_v9", + text=r""" Parameter used in Berendsen lattice dynamics [[multibinit:dynamics]] =103, in which the pressure is relaxed exponentially to the target temperature, with the characteristic time of latt_taup. The default unit is atomic unit. But it is possible to use the second as the unit by adding Second or S at the end of the line, for example: @@ -1369,124 +1486,137 @@ """, - ), - Variable( - abivarname="nefield@multibinit", - varset="multibinit", - vartype="integer", - topics=["DynamicsMultibinit_basic"], - dimensions="scalar", - defaultval=1, - mnemonics="Number of Electric FEIELDs", - added_in_version="v10", - text=r""" +), + + +Variable( + abivarname="nefield@multibinit", + varset="multibinit", + vartype="integer", + topics=["DynamicsMultibinit_basic"], + dimensions="scalar", + defaultval=1, + mnemonics="Number of Electric FEIELDs", + added_in_version="v10", + text=r""" Number of Electric fields to be used in the dynamics when efield_type 6. Currently only 2 efields are allowed. """, - ), - Variable( - abivarname="ntime@multibinit", - varset="multibinit", - vartype="integer", - topics=["DynamicsMultibinit_basic"], - dimensions="scalar", - defaultval=200, - mnemonics="Number of TIME step", - added_in_version="before_v9", - text=r""" +), + + + + +Variable( + abivarname="ntime@multibinit", + varset="multibinit", + vartype="integer", + topics=["DynamicsMultibinit_basic"], + dimensions="scalar", + defaultval=200, + mnemonics="Number of TIME step", + added_in_version="before_v9", + text=r""" Number of step for the dynamics. """, - ), - Variable( - abivarname="nnos@multibinit", - varset="multibinit", - vartype="integer", - topics=["DynamicsMultibinit_basic"], - dimensions="scalar", - defaultval=0, - mnemonics="Number of NOSe masses", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="nnos@multibinit", + varset="multibinit", + vartype="integer", + topics=["DynamicsMultibinit_basic"], + dimensions="scalar", + defaultval=0, + mnemonics="Number of NOSe masses", + added_in_version="before_v9", + text=r""" See [[abinit:nnos]] """, - ), - Variable( - abivarname="qmass@multibinit", - varset="multibinit", - vartype="real", - topics=["DynamicsMultibinit_basic"], - dimensions=["[[abinit:nnos]]"], - defaultval=0, - mnemonics="Q thermostat MASS", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="qmass@multibinit", + varset="multibinit", + vartype="real", + topics=["DynamicsMultibinit_basic"], + dimensions=["[[abinit:nnos]]"], + defaultval=0, + mnemonics="Q thermostat MASS", + added_in_version="before_v9", + text=r""" See [[abinit:qmass]] """, - ), - Variable( - abivarname="nctime@multibinit", - varset="multibinit", - vartype="integer", - topics=["DynamicsMultibinit_basic"], - dimensions="scalar", - defaultval=1, - mnemonics="NetCdf TIME between output of molecular dynamics information", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="nctime@multibinit", + varset="multibinit", + vartype="integer", + topics=["DynamicsMultibinit_basic"], + dimensions="scalar", + defaultval=1, + mnemonics="NetCdf TIME between output of molecular dynamics information", + added_in_version="before_v9", + text=r""" Set the number of step between output the molecular dynamics information in the NetCDF file """, - ), - Variable( - abivarname="temperature@multibinit", - varset="multibinit", - vartype="real", - topics=["DynamicsMultibinit_basic"], - dimensions="scalar", - defaultval=325, - mnemonics="molecular dynamics TEMPERATURE (in Kelvin)", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="temperature@multibinit", + varset="multibinit", + vartype="real", + topics=["DynamicsMultibinit_basic"], + dimensions="scalar", + defaultval=325, + mnemonics="molecular dynamics TEMPERATURE (in Kelvin)", + added_in_version="before_v9", + text=r""" Give the temperature of the dynamics in Kelvin """, - ), - Variable( - abivarname="ncell@multibinit", - varset="multibinit", - vartype="integer", - topics=["DynamicsMultibinit_basic"], - dimensions=[3], - defaultval=[6, 6, 6], - mnemonics="Number of Cell", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="ncell@multibinit", + varset="multibinit", + vartype="integer", + topics=["DynamicsMultibinit_basic"], + dimensions=[3], + defaultval=[6,6,6], + mnemonics="Number of Cell", + added_in_version="before_v9", + text=r""" Give the size of the supercell for the dynamics """, - ), - Variable( - abivarname="ncellmat@multibinit", - varset="multibinit", - vartype="integer", - topics=["DynamicsMultibinit_basic"], - dimensions=[3, 3], - defaultval=[[1, 0, 0], [0, 1, 0], [0, 0, 1]], - mnemonics="Number of superCELL MATtrix", - added_in_version="9.5.0", - text=r""" +), + +Variable( + abivarname="ncellmat@multibinit", + varset="multibinit", + vartype="integer", + topics=["DynamicsMultibinit_basic"], + dimensions=[3, 3], + defaultval=[[1,0,0],[0,1,0], [0,0,1]], + mnemonics="Number of superCELL MATtrix", + added_in_version="9.5.0", + text=r""" Give the size of the supercell for the dynamics in the format of a matrix. Currently allowed in spin dynamics and spin and LWF dynamics. It will override the [[multibinit:ncell]] if specified. -""", - ), - Variable( - abivarname="outdata_prefix", - varset="multibinit", - vartype="string", - topics=["Control_useful"], - dimensions="scalar", - defaultval=None, - mnemonics="OUTput DATA PREFIX", - added_in_version="9.3.3", - text=r""" +""" +), + +Variable( + abivarname="outdata_prefix", + varset="multibinit", + vartype="string", + topics=["Control_useful"], + dimensions="scalar", + defaultval=None, + mnemonics="OUTput DATA PREFIX", + added_in_version="9.3.3", + text=r""" Prefix for output files. Replaces the analogous entry in the obsolete *files_file* . This variable is used when Abinit is executed with the new syntax: @@ -1495,136 +1625,145 @@ If this option is not specified, a prefix is automatically constructed from the input file name provided the filename ends with an extension, e.g. `.ext`. (`.abi` is recommended) If the input filename does not have a file extension, a default is provided. -""", - ), - Variable( - abivarname="strfact@multibinit", - varset="multibinit", - vartype="real", - topics=["DynamicsMultibinit_basic"], - dimensions="scalar", - defaultval=100.0, - mnemonics="STRess FACTor", - added_in_version="v9.1", - text=r""" +""" +), + + +Variable( + abivarname="strfact@multibinit", + varset="multibinit", + vartype="real", + topics=["DynamicsMultibinit_basic"], + dimensions="scalar", + defaultval=100.0, + mnemonics="STRess FACTor", + added_in_version="v9.1", + text=r""" See [[abinit:strfact]] """, - ), - Variable( - abivarname="strtarget@multibinit", - varset="multibinit", - vartype="real", - topics=["DynamicsMultibinit_basic"], - dimensions=[6], - defaultval=[0.0, 0.0, 0.0, 0.0, 0.0, 0.0], - mnemonics="STRess TARGET", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="strtarget@multibinit", + varset="multibinit", + vartype="real", + topics=["DynamicsMultibinit_basic"], + dimensions=[6], + defaultval=[0.0, 0.0, 0.0, 0.0, 0.0, 0.0], + mnemonics="STRess TARGET", + added_in_version="before_v9", + text=r""" See [[abinit:strtarget]] """, - ), - Variable( - abivarname="bmass@multibinit", - varset="multibinit", - vartype="real", - topics=["DynamicsMultibinit_basic"], - dimensions="scalar", - defaultval=10, - mnemonics="Barostat MASS", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="bmass@multibinit", + varset="multibinit", + vartype="real", + topics=["DynamicsMultibinit_basic"], + dimensions="scalar", + defaultval=10, + mnemonics="Barostat MASS", + added_in_version="before_v9", + text=r""" See [[abinit:bmass]] """, - ), - Variable( - abivarname="optcell@multibinit", - varset="multibinit", - vartype="integer", - topics=["DynamicsMultibinit_basic"], - dimensions="scalar", - defaultval=0, - mnemonics="OPTimize the CELL shape and dimensions", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="optcell@multibinit", + varset="multibinit", + vartype="integer", + topics=["DynamicsMultibinit_basic"], + dimensions="scalar", + defaultval=0, + mnemonics="OPTimize the CELL shape and dimensions", + added_in_version="before_v9", + text=r""" See [[abinit:optcell]] """, - ), - Variable( - abivarname="restartxf@multibinit", - varset="multibinit", - vartype="integer", - topics=["DynamicsMultibinit_basic"], - dimensions="scalar", - defaultval=0, - mnemonics="RESTART from (X,F) history", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="restartxf@multibinit", + varset="multibinit", + vartype="integer", + topics=["DynamicsMultibinit_basic"], + dimensions="scalar", + defaultval=0, + mnemonics="RESTART from (X,F) history", + added_in_version="before_v9", + text=r""" See [[abinit:restartxf]] """, - ), - Variable( - abivarname="sel_EFS@multibinit", - varset="multibinit", - vartype="integer", - topics=["FitProcess_basic"], - dimensions=[3], - defaultval=[0, 1, 1], - added_in_version="v9", - mnemonics="Select on Energy, Forces, and or, Stresses", - text=r""" +), + +Variable( + abivarname="sel_EFS@multibinit", + varset="multibinit", + vartype="integer", + topics=["FitProcess_basic"], + dimensions=[3], + defaultval=[0,1,1], + added_in_version="v9", + mnemonics="Select on Energy, Forces, and or, Stresses", + text=r""" Specifies on which goal function quantities the anharmonic coefficients will be selected. The first number flags the selecting on the energies, the second the fitting on the forces, and the third on the stressses. Default value is 0 1 1, so anharmonic coefficients get selected on Forces and Stresses but not on energies """, - ), - # The below are not yet functioning, comment out temporarily. - # Variable( - # abivarname="spin_calc_correlation_obs@multibinit", - # varset="multibinit", - # vartype="integer", - # topics=['SpinDynamicsMultibinit_basic'], - # dimensions="scalar", - # defaultval=0, - # mnemonics="SPIN CALCulate CORRELATION OBServables", - # added_in_version="before_v9", - # text=r""" - # Flag to calculate spin correlation function based observables. - # - # * 0 --> do not calculate. - # - # * 1 --> calculate. - # """, - # ), - # - # - # Variable( - # abivarname="spin_calc_traj_obs@multibinit", - # varset="multibinit", - # vartype="integer", - # topics=['SpinDynamicsMultibinit_basic'], - # dimensions="scalar", - # defaultval=0, - # mnemonics="SPIN CALCulate TRAJectory based OBServables", - # added_in_version="before_v9", - # text=r""" - # Flag to calculate spin trajectory based observables. (Nothing included yet.) - # - # * 0 --> do not calculate. - # - # * 1 --> calculate. - # """, - # ), - Variable( - abivarname="spin_calc_thermo_obs@multibinit", - varset="multibinit", - vartype="integer", - topics=["SpinDynamicsMultibinit_basic"], - dimensions="scalar", - defaultval=1, - mnemonics="SPIN CALCulate THERMO dynamics OBServables", - added_in_version="before_v9", - text=r""" +), + +# The below are not yet functioning, comment out temporarily. +#Variable( +# abivarname="spin_calc_correlation_obs@multibinit", +# varset="multibinit", +# vartype="integer", +# topics=['SpinDynamicsMultibinit_basic'], +# dimensions="scalar", +# defaultval=0, +# mnemonics="SPIN CALCulate CORRELATION OBServables", +# added_in_version="before_v9", +# text=r""" +#Flag to calculate spin correlation function based observables. +# +#* 0 --> do not calculate. +# +#* 1 --> calculate. +#""", +#), +# +# +#Variable( +# abivarname="spin_calc_traj_obs@multibinit", +# varset="multibinit", +# vartype="integer", +# topics=['SpinDynamicsMultibinit_basic'], +# dimensions="scalar", +# defaultval=0, +# mnemonics="SPIN CALCulate TRAJectory based OBServables", +# added_in_version="before_v9", +# text=r""" +#Flag to calculate spin trajectory based observables. (Nothing included yet.) +# +#* 0 --> do not calculate. +# +#* 1 --> calculate. +#""", +#), + +Variable( + abivarname="spin_calc_thermo_obs@multibinit", + varset="multibinit", + vartype="integer", + topics=["SpinDynamicsMultibinit_basic"], + dimensions="scalar", + defaultval=1, + mnemonics="SPIN CALCulate THERMO dynamics OBServables", + added_in_version="before_v9", + text=r""" Flag to calculate spin thermo dynamics observables, including the specific heat, magnetic susceptibility, Binder U4 value. It's recommend to always calculate these observables. @@ -1633,65 +1772,71 @@ * 1 --> calculate. """, - ), - Variable( - abivarname="spin_damping@multibinit", - varset="multibinit", - vartype="real", - topics=["SpinDynamicsMultibinit_basic"], - dimensions="scalar", - defaultval=-1.0, - mnemonics="SPIN gilbert DAMPING factor", - added_in_version="before_v9", - text=r""" +), + + +Variable( + abivarname="spin_damping@multibinit", + varset="multibinit", + vartype="real", + topics=["SpinDynamicsMultibinit_basic"], + dimensions="scalar", + defaultval=-1.0, + mnemonics="SPIN gilbert DAMPING factor", + added_in_version="before_v9", + text=r""" Gilbert damping factor in LLG equation for spin dynamics. * negative value --> use damping factor from spin xml file. * positive value --> use as damping factor. The value should be between 0.0 and 1.0 (both included). """, - ), - # Variable( - # abivarname="spin_dipdip@multibinit", - # varset="multibinit", - # vartype="integer", - # topics=['SpinDynamicsMultibinit_basic'], - # dimensions="scalar", - # defaultval=0, - # mnemonics="SPIN DIPole DIPole interaction", - # added_in_version="before_v9", - # text=r""" - # * 0 --> Switch off spin dipole-dipole interaction. - # - # * 1 --> Switch on spin dipole-dipole interaction. - # (Not yet implemented.) - # """, - # ), - Variable( - abivarname="spin_dt@multibinit", - varset="multibinit", - vartype="real", - topics=["SpinDynamicsMultibinit_basic"], - dimensions="scalar", - defaultval=100, - mnemonics="SPIN Delta Time", - added_in_version="before_v9", - text=r""" +), + +#Variable( +# abivarname="spin_dipdip@multibinit", +# varset="multibinit", +# vartype="integer", +# topics=['SpinDynamicsMultibinit_basic'], +# dimensions="scalar", +# defaultval=0, +# mnemonics="SPIN DIPole DIPole interaction", +# added_in_version="before_v9", +# text=r""" +#* 0 --> Switch off spin dipole-dipole interaction. +# +#* 1 --> Switch on spin dipole-dipole interaction. +# (Not yet implemented.) +#""", +#), + +Variable( + abivarname="spin_dt@multibinit", + varset="multibinit", + vartype="real", + topics=["SpinDynamicsMultibinit_basic"], + dimensions="scalar", + defaultval=100, + mnemonics="SPIN Delta Time", + added_in_version="before_v9", + text=r""" Time step for spin dynamics. Default value is 100. Default unit is atomic unit (2.419e-17 s). S, Sec or Second can be appended as unit. (e.g. 1e-16 Sec). """, - ), - Variable( - abivarname="spin_dynamics@multibinit", - varset="multibinit", - vartype="integer", - topics=["SpinDynamicsMultibinit_basic"], - dimensions="scalar", - defaultval=0, - mnemonics="SPIN DYNAMICS", - added_in_version="before_v9", - text=r""" +), + + +Variable( + abivarname="spin_dynamics@multibinit", + varset="multibinit", + vartype="integer", + topics=["SpinDynamicsMultibinit_basic"], + dimensions="scalar", + defaultval=0, + mnemonics="SPIN DYNAMICS", + added_in_version="before_v9", + text=r""" Flag to run spin dynamics. * 0 --> Do not run spin dynamics. @@ -1709,32 +1854,37 @@ For system with very simple interaction terms, HeunP could be faster. Otherwise, use Depondt-Mertens method can be more efficient. """, - ), - Variable( - abivarname="spin_init_hist_fname@multibinit", - varset="multibinit", - vartype="string", - topics=["SpinDynamicsMultibinit_basic"], - dimensions="scalar", - defaultval="", - mnemonics="SPIN INITIAL state HISTory file name", - added_in_version="9.3.3", - text=r""" +), + +Variable( + abivarname="spin_init_hist_fname@multibinit", + varset="multibinit", + vartype="string", + topics=["SpinDynamicsMultibinit_basic"], + dimensions="scalar", + defaultval="", + mnemonics="SPIN INITIAL state HISTory file name", + added_in_version="9.3.3", + text=r""" Specify the initial state of the multibinit spin dynamics calculation, which can be a spin_hist netcdf file, usually generated from previous spin dynamics calculations. It is used when [[multibinit:spin_init_state]]=4 The string must be enclosed between quotation marks, for example: spin_init_hist_fname "last_step_spin_hist.nc" -""", - ), - Variable( - abivarname="spin_init_state@multibinit", - varset="multibinit", - vartype="integer", - topics=["SpinDynamicsMultibinit_basic"], - dimensions="scalar", - defaultval=1, - mnemonics="SPIN INITial STATE", - added_in_version="before_v9", - text=r""" +""" + +), + + + +Variable( + abivarname="spin_init_state@multibinit", + varset="multibinit", + vartype="integer", + topics=["SpinDynamicsMultibinit_basic"], + dimensions="scalar", + defaultval=1, + mnemonics="SPIN INITial STATE", + added_in_version="before_v9", + text=r""" Flag to initialize spin state. * 1 --> Random spin state using uniform random numbers. @@ -1745,148 +1895,169 @@ * 4 --> Restart from last step of input spin hist file, as specified in [[multibinit:spin_init_hist_fname]]. """, - ), - Variable( - abivarname="spin_mag_field@multibinit", - varset="multibinit", - vartype="real", - topics=["SpinDynamicsMultibinit_basic"], - dimensions=[3], - defaultval=[0, 0, 0], - mnemonics="SPIN Magnetic Field", - added_in_version="before_v9", - text=r""" +), + + +Variable( + abivarname="spin_mag_field@multibinit", + varset="multibinit", + vartype="real", + topics=["SpinDynamicsMultibinit_basic"], + dimensions=[3], + defaultval=[0,0,0], + mnemonics="SPIN Magnetic Field", + added_in_version="before_v9", + text=r""" External magnetic field. Unit: Tesla. """, - ), - Variable( - abivarname="spin_nctime@multibinit", - varset="multibinit", - vartype="integer", - topics=["SpinDynamicsMultibinit_basic"], - dimensions="scalar", - defaultval=0, - mnemonics="SPIN NetCdf write per number of TIME steps", - added_in_version="before_v9", - text=r""" +), + + +Variable( + abivarname="spin_nctime@multibinit", + varset="multibinit", + vartype="integer", + topics=["SpinDynamicsMultibinit_basic"], + dimensions="scalar", + defaultval=0, + mnemonics="SPIN NetCdf write per number of TIME steps", + added_in_version="before_v9", + text=r""" Write spin into netcdf file in every spin_nctime of spin dynamics time steps. """, - ), - Variable( - abivarname="spin_ntime@multibinit", - varset="multibinit", - vartype="integer", - topics=["SpinDynamicsMultibinit_basic"], - dimensions="scalar", - defaultval=0, - mnemonics="SPIN dynamics total Number of TIME steps", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="spin_ntime@multibinit", + varset="multibinit", + vartype="integer", + topics=["SpinDynamicsMultibinit_basic"], + dimensions="scalar", + defaultval=0, + mnemonics="SPIN dynamics total Number of TIME steps", + added_in_version="before_v9", + text=r""" Total number of spin dynamics time steps. """, - ), - Variable( - abivarname="spin_ntime_pre@multibinit", - varset="multibinit", - vartype="integer", - topics=["SpinDynamicsMultibinit_basic"], - dimensions="scalar", - defaultval=0, - mnemonics="SPIN dynamics total Number of TIME steps for PREparing", - added_in_version="before_v9", - text=r""" +), + + +Variable( + abivarname="spin_ntime_pre@multibinit", + varset="multibinit", + vartype="integer", + topics=["SpinDynamicsMultibinit_basic"], + dimensions="scalar", + defaultval=0, + mnemonics="SPIN dynamics total Number of TIME steps for PREparing", + added_in_version="before_v9", + text=r""" Total number of spin dynamics time steps for preparing the system. The results of these time step are not written to trajectory spinhist.nc file, And they are not used for calculating the observables. """, - ), - Variable( - abivarname="spin_init_orientation@multibinit", - varset="multibinit", - vartype="real", - topics=["SpinDynamicsMultibinit_basic"], - dimensions=[3], - defaultval=[0, 0, 1], - mnemonics="SPIN INITial ORIENTATION", - added_in_version="before_v9", - text=r""" +), + + +Variable( + abivarname="spin_init_orientation@multibinit", + varset="multibinit", + vartype="real", + topics=["SpinDynamicsMultibinit_basic"], + dimensions=[3], + defaultval=[0,0,1], + mnemonics="SPIN INITial ORIENTATION", + added_in_version="before_v9", + text=r""" Spin initial orientation. It is used for setting the initial spin in a supercell. For a spin in a cell labeled with R, the rotation angle is $2\pi Q\cdot R$ from the initial orientation along the rotate axis. Default is along z(0,0,1) direction. """, - ), - Variable( - abivarname="spin_init_qpoint@multibinit", - varset="multibinit", - vartype="real", - topics=["SpinDynamicsMultibinit_basic"], - dimensions=[3], - defaultval=[0, 0, 0], - mnemonics="SPIN INITial QPOINT", - added_in_version="before_v9", - text=r""" +), + + + + +Variable( + abivarname="spin_init_qpoint@multibinit", + varset="multibinit", + vartype="real", + topics=["SpinDynamicsMultibinit_basic"], + dimensions=[3], + defaultval=[0,0,0], + mnemonics="SPIN INITial QPOINT", + added_in_version="before_v9", + text=r""" Spin wave vector. It is used for setting the initial spin in a supercell. For a spin in a cell labeled with R, the rotation angle is $2\pi Q\cdot R$ from the initial orientation along the rotate axis. Default is Gamma (0, 0, 0). """, - ), - Variable( - abivarname="spin_init_rotate_axis@multibinit", - varset="multibinit", - vartype="real", - topics=["SpinDynamicsMultibinit_basic"], - dimensions=[3], - defaultval=[1, 0, 0], - mnemonics="SPIN INITial ROTATE AXIS", - added_in_version="before_v9", - text=r""" +), + + + +Variable( + abivarname="spin_init_rotate_axis@multibinit", + varset="multibinit", + vartype="real", + topics=["SpinDynamicsMultibinit_basic"], + dimensions=[3], + defaultval=[1,0,0], + mnemonics="SPIN INITial ROTATE AXIS", + added_in_version="before_v9", + text=r""" Spin initial rotate axis. It is used for setting the initial spin in a supercell. For a spin in a cell labeled with R, the rotation angle is $2\pi Q\cdot R$ from the initial orientation along the rotate axis. Default is along x axis (1,0,0). """, - ), - Variable( - abivarname="spin_pot_fname@multibinit", - varset="multibinit", - vartype="string", - topics=["SpinDynamicsMultibinit_basic"], - dimensions="scalar", - defaultval="", - mnemonics="SPIN POTential File NAME", - added_in_version="9.3.3", - text=r""" +), + +Variable( + abivarname="spin_pot_fname@multibinit", + varset="multibinit", + vartype="string", + topics=["SpinDynamicsMultibinit_basic"], + dimensions="scalar", + defaultval="", + mnemonics="SPIN POTential File NAME", + added_in_version="9.3.3", + text=r""" Specify the spin potential file name in the multibinit spin dynamics calculation, which can be either a xml or a netcdf file. The string must be enclosed between quotation marks: spin_pot_fname "Fe.xml" -""", - ), - Variable( - abivarname="spin_projection_qpoint@multibinit", - varset="multibinit", - vartype="real", - topics=["SpinDynamicsMultibinit_basic"], - dimensions=[3], - defaultval=[0, 0, 0], - mnemonics="SPIN PROJECTION QPOINT", - added_in_version="before_v9", - text=r""" +""" + +), + +Variable( + abivarname="spin_projection_qpoint@multibinit", + varset="multibinit", + vartype="real", + topics=["SpinDynamicsMultibinit_basic"], + dimensions=[3], + defaultval=[0,0,0], + mnemonics="SPIN PROJECTION QPOINT", + added_in_version="before_v9", + text=r""" Spin wave vector. It is used for getting the total spin. $M_{tot}=\sum_i M_i exp(i q \cdot R_i)$. The unit is the reciprocal lattice vectors of the unitcell. Default is Gamma. (0, 0, 0) """, - ), - Variable( - abivarname="spin_sia_add@multibinit", - varset="multibinit", - vartype="integer", - topics=["SpinDynamicsMultibinit_basic"], - dimensions="scalar", - defaultval=0, - mnemonics="SPIN Single Ion Anisotropy ADD", - added_in_version="before_v9", - text=r""" +), + + +Variable( + abivarname="spin_sia_add@multibinit", + varset="multibinit", + vartype="integer", + topics=["SpinDynamicsMultibinit_basic"], + dimensions="scalar", + defaultval=0, + mnemonics="SPIN Single Ion Anisotropy ADD", + added_in_version="before_v9", + text=r""" Add single ion anisotropy term to the spin model hamiltonian. with user defined values (see [[multibinit:spin_sia_k1amp]] and [[multibinit:spin_sia_k1dir]]. @@ -1898,235 +2069,259 @@ Default value: 0. """, - ), - Variable( - abivarname="spin_sia_k1amp@multibinit", - varset="multibinit", - vartype="real", - topics=["SpinDynamicsMultibinit_basic"], - dimensions="scalar", - defaultval=0.0, - mnemonics="SPIN Single Ion Anisotropy K1 AMPtitude", - added_in_version="before_v9", - text=r""" +), + + +Variable( + abivarname="spin_sia_k1amp@multibinit", + varset="multibinit", + vartype="real", + topics=["SpinDynamicsMultibinit_basic"], + dimensions="scalar", + defaultval=0.0, + mnemonics="SPIN Single Ion Anisotropy K1 AMPtitude", + added_in_version="before_v9", + text=r""" User defined amplitude of single ion anisotropy. Only used when [[multibinit:spin_sia_add]] is not 0. The direction is defined with [[multibinit:spin_sia_k1dir]]. The unit is Ha. To use eV or Ry as unit, put eV or Ry at the end. """, - ), - Variable( - abivarname="spin_sia_k1dir@multibinit", - varset="multibinit", - vartype="real", - topics=["SpinDynamicsMultibinit_basic"], - dimensions=[3], - defaultval=[0.0, 0.0, 1.0], - mnemonics="SPIN Single Ion Anisotropy K1 DIRection", - added_in_version="before_v9", - text=r""" +), + + +Variable( + abivarname="spin_sia_k1dir@multibinit", + varset="multibinit", + vartype="real", + topics=["SpinDynamicsMultibinit_basic"], + dimensions=[3], + defaultval=[0.0,0.0,1.0], + mnemonics="SPIN Single Ion Anisotropy K1 DIRection", + added_in_version="before_v9", + text=r""" User defined direction of single ion anisotropy. Only used when [[multibinit:spin_sia_add]] is not 0. It will be automatically normalized to 1.0. The amplitude is defined with [[multibinit:spin_sia_k1amp]]. Default value: [0.0, 0.0,1.0]. """, - ), - Variable( - abivarname="spin_temperature@multibinit", - varset="multibinit", - vartype="real", - topics=["SpinDynamicsMultibinit_basic"], - dimensions="scalar", - defaultval=325, - mnemonics="SPIN TEMPERATURE", - added_in_version="before_v9", - text=r""" +), + + +Variable( + abivarname="spin_temperature@multibinit", + varset="multibinit", + vartype="real", + topics=["SpinDynamicsMultibinit_basic"], + dimensions="scalar", + defaultval=325, + mnemonics="SPIN TEMPERATURE", + added_in_version="before_v9", + text=r""" Temperature of spin for spin dynamics. Unit: Kelvin. Default value: 325. """, - ), - Variable( - abivarname="spin_var_temperature@multibinit", - varset="multibinit", - vartype="integer", - topics=["SpinDynamicsMultibinit_basic"], - dimensions="scalar", - defaultval=0, - mnemonics="SPIN VARiable TEMPERATURE", - added_in_version="before_v9", - text=r""" +), + + +Variable( + abivarname="spin_var_temperature@multibinit", + varset="multibinit", + vartype="integer", + topics=["SpinDynamicsMultibinit_basic"], + dimensions="scalar", + defaultval=0, + mnemonics="SPIN VARiable TEMPERATURE", + added_in_version="before_v9", + text=r""" Switch for variable temperature calculation. 0: off. 1: on. If switched on, a series of spin dynamics calculation with temperatures from [[multibinit:spin_temperature_start]] to [[multibinit:spin_temperature_end]], with number of steps [[multibinit:spin_temperature_nstep]] will be done. The corresponding _spinhist.nc file has the corresponding temperature in the filename. """, - ), - Variable( - abivarname="spin_write_traj@multibinit", - varset="multibinit", - vartype="integer", - topics=["SpinDynamicsMultibinit_basic"], - dimensions="scalar", - defaultval=1, - mnemonics="SPIN WRITE TRAJectory to spinhist.nc file", - added_in_version="before_v9", - text=""" +), + + +Variable( + abivarname="spin_write_traj@multibinit", + varset="multibinit", + vartype="integer", + topics=["SpinDynamicsMultibinit_basic"], + dimensions="scalar", + defaultval=1, + mnemonics="SPIN WRITE TRAJectory to spinhist.nc file", + added_in_version="before_v9", + text=""" Switch for writing of spin trajectory file. 0: off. 1 on. The trajectory is needed for postprocessing of correlation functions. """, - ), - Variable( - abivarname="spin_temperature_start@multibinit", - varset="multibinit", - vartype="real", - topics=["SpinDynamicsMultibinit_basic"], - dimensions="scalar", - defaultval=0.0, - mnemonics="SPIN TEMPERATURE START", - added_in_version="before_v9", - text=r""" +), + + +Variable( + abivarname="spin_temperature_start@multibinit", + varset="multibinit", + vartype="real", + topics=["SpinDynamicsMultibinit_basic"], + dimensions="scalar", + defaultval=0.0, + mnemonics="SPIN TEMPERATURE START", + added_in_version="before_v9", + text=r""" Start point of variable temperature spin dynamcis calculation (see [[multibinit:spin_var_temperature]]) in spin dynamics calculation. """, - ), - Variable( - abivarname="spin_temperature_end@multibinit", - varset="multibinit", - vartype="real", - topics=["SpinDynamicsMultibinit_basic"], - dimensions="scalar", - defaultval=0.0, - mnemonics="SPIN TEMPERATURE END", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="spin_temperature_end@multibinit", + varset="multibinit", + vartype="real", + topics=["SpinDynamicsMultibinit_basic"], + dimensions="scalar", + defaultval=0.0, + mnemonics="SPIN TEMPERATURE END", + added_in_version="before_v9", + text=r""" End point of variable temperature spin dynamics calculation (see [[multibinit:spin_var_temperature]]) in spin dynamics calculation. """, - ), - Variable( - abivarname="spin_temperature_nstep@multibinit", - varset="multibinit", - vartype="integer", - topics=["SpinDynamicsMultibinit_basic"], - dimensions="scalar", - defaultval=0, - mnemonics="SPIN TEMPERATURE Number of STEPs", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="spin_temperature_nstep@multibinit", + varset="multibinit", + vartype="integer", + topics=["SpinDynamicsMultibinit_basic"], + dimensions="scalar", + defaultval=0, + mnemonics="SPIN TEMPERATURE Number of STEPs", + added_in_version="before_v9", + text=r""" Number of steps in the variable temperature spin dynamics calculation (see [[multibinit:spin_var_temperature]]) in spin dynamics calculation. """, - ), - Variable( - abivarname="test_effpot@multibinit", - varset="multibinit", - vartype="integer", - topics=["LatticeModel_basic"], - dimensions="scalar", - defaultval=0, - mnemonics="TEST EFFective POTential", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="test_effpot@multibinit", + varset="multibinit", + vartype="integer", + topics=["LatticeModel_basic"], + dimensions="scalar", + defaultval=0, + mnemonics="TEST EFFective POTential", + added_in_version="before_v9", + text=r""" * 0 --> nothing. * 1 --> Evaluate the effective potential with respect to given test-set and calculate mean square differences between ab-initio energy/forces and model energy/forces """, - ), - Variable( - abivarname="tolmxf@multibinit", - varset="multibinit", - vartype="real", - topics=["DynamicsMultibinit_basic"], - dimensions="scalar", - defaultval=2e-5, - mnemonics="TOLerance on the MaXimal Force", - added_in_version="v9", - text=r""" +), + +Variable( + abivarname="tolmxf@multibinit", + varset="multibinit", + vartype="real", + topics=["DynamicsMultibinit_basic"], + dimensions="scalar", + defaultval=2e-5, + mnemonics="TOLerance on the MaXimal Force", + added_in_version="v9", + text=r""" Sets a maximal absolute force tolerance (in hartree/Bohr) below which BFGS structural relaxation iterations will stop. Corresponds to [[tolmxf]] of Abinit. """, - ), - Variable( - abivarname="analyze_anh_pot@multibinit", - varset="multibinit", - vartype="integer", - topics=["LatticeModel_expert"], - dimensions="scalar", - defaultval=0, - mnemonics="ANALYZE ANHarmonic POTential", - added_in_version="before_v9", - text=r""" +), + + +Variable( +abivarname="analyze_anh_pot@multibinit", + varset="multibinit", + vartype="integer", + topics=["LatticeModel_expert"], + dimensions="scalar", + defaultval=0, + mnemonics="ANALYZE ANHarmonic POTential", + added_in_version="before_v9", + text=r""" * 0 --> Nothing. * 1 --> Print energy contribution of each anharmonic term in the effective Potential. If it is a Molecular Dynamics (MD) run, the contribution of each term is printed for each MD-step into MD_anharmonic_terms_energy.dat . If the effective potential is tested against a test set the contribution of each term for each configuration in the test set is printed in TES_anharmonic_terms_energy.dat . If the effective potential is fitted, the contribution of each selected term for each configuration in the training set is printed in TRS_anharmonic_terms_energy.dat """, - ), - Variable( - abivarname="opt_effpot@multibinit", - varset="multibinit", - vartype="integer", - topics=["FitProcess_expert"], - dimensions="scalar", - defaultval=0, - mnemonics="OPTimize EFFective POTential", - added_in_version="before_v9", - text=r""" +), + + +Variable( + abivarname="opt_effpot@multibinit", + varset="multibinit", + vartype="integer", + topics=["FitProcess_expert"], + dimensions="scalar", + defaultval=0, + mnemonics="OPTimize EFFective POTential", + added_in_version="before_v9", + text=r""" * 0 --> Nothing. * 1 --> Turn on reading of optimization of effective potential keywords (opt_). The optimization process gives the user the ability to refit the coefficients of specified terms with respect to the training set while keeping the rest fixed. **Related variables:** The number of coefficients to refit ([[multibinit:opt_ncoeff]]), the indices of the coefficients to optimize ([[multibinit:opt_coeff]]). """, - ), - Variable( - abivarname="opt_factors@multibinit", - varset="multibinit", - vartype="real", - topics=["FitProcess_basic"], - dimensions=[3], - defaultval=[1, 1, 1], - mnemonics="FACTORS for Goal Function of Energy, Forces, and Stresses during optimization of coefficients", - added_in_version="v9", - text=r""" +), + +Variable( + abivarname="opt_factors@multibinit", + varset="multibinit", + vartype="real", + topics=["FitProcess_basic"], + dimensions=[3], + defaultval=[1,1,1], + mnemonics="FACTORS for Goal Function of Energy, Forces, and Stresses during optimization of coefficients", + added_in_version="v9", + text=r""" Specifies three factors for Energy, Forces and Stresses in the calculation of the Goal Function which is to be minimized during the optimization process allowing to change the relative weight of the three quantities. Default value is 1 1 1, equally balancing energy, forces and stresses. """, - ), - Variable( - abivarname="opt_ncoeff@multibinit", - varset="multibinit", - vartype="integer", - topics=["FitProcess_expert"], - dimensions="scalar", - defaultval=0, - mnemonics="OPTimize NUMBER of COEFFicients", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="opt_ncoeff@multibinit", + varset="multibinit", + vartype="integer", + topics=["FitProcess_expert"], + dimensions="scalar", + defaultval=0, + mnemonics="OPTimize NUMBER of COEFFicients", + added_in_version="before_v9", + text=r""" * Number of anharmonic terms to refit in the effective potential. **Related variables:** [[multibinit:opt_coeff]] """, - ), - Variable( - abivarname="opt_coeff@multibinit", - varset="multibinit", - vartype="integer", - topics=["FitProcess_expert"], - dimensions=["[[multibinit:opt_ncoeff]]"], - defaultval=0, - mnemonics="OPTimize Coefficients", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="opt_coeff@multibinit", + varset="multibinit", + vartype="integer", + topics=["FitProcess_expert"], + dimensions=["[[multibinit:opt_ncoeff]]"], + defaultval=0, + mnemonics="OPTimize Coefficients", + added_in_version="before_v9", + text=r""" Indices of the terms to refit in the effective potential. """, - ), - Variable( - abivarname="randomseed@multibinit", - varset="multibinit", - vartype="integer", - topics=["SpinDynamicsMultibinit_expert"], - dimensions="scalar", - defaultval=0, - mnemonics="RANDOM SEED", - added_in_version="9.8", - text=r""" +), + +Variable( + abivarname="randomseed@multibinit", + varset="multibinit", + vartype="integer", + topics=["SpinDynamicsMultibinit_expert"], + dimensions="scalar", + defaultval=0, + mnemonics="RANDOM SEED", + added_in_version="9.8", + text=r""" Random seed to be used in Multibinit spin/LWF dynamics. It should be 0, or a large positive integer. The default value 0 means it will use the current clock time. @@ -2137,17 +2332,20 @@ that the previous result can be recovered, as the generation of numbers is also affected by the number of processors, type of type of CPU, compiler, and version of MULTIBINIT. """, - ), - Variable( - abivarname="slc_coupling@multibinit", - varset="multibinit", - vartype="integer", - topics=["SpinDynamicsMultibinit_basic"], - dimensions="scalar", - defaultval=0, - mnemonics="SpinLatticeCoupling_Coupling", - added_in_version="9.0.0", - text=r""" +), + + + +Variable( + abivarname="slc_coupling@multibinit", + varset="multibinit", + vartype="integer", + topics=["SpinDynamicsMultibinit_basic"], + dimensions="scalar", + defaultval=0, + mnemonics="SpinLatticeCoupling_Coupling", + added_in_version="9.0.0", + text=r""" Which spin-lattice coupling terms are used in the calculation, different terms can be combined in a binary fashion, i.e. 1010 turns on all terms quadratic in spin. * 0 --> No coupling. @@ -2160,32 +2358,35 @@ * 1000 --> Coupling term quadratic in spin and lattice coordinate """, - ), - Variable( - abivarname="slc_pot_fname@multibinit", - varset="multibinit", - vartype="string", - topics=["SpinDynamicsMultibinit_basic"], - dimensions="scalar", - defaultval="", - mnemonics="SLC POTential FileNAME", - added_in_version="9.3.3", - text=r""" +), + +Variable( + abivarname="slc_pot_fname@multibinit", + varset="multibinit", + vartype="string", + topics=["SpinDynamicsMultibinit_basic"], + dimensions="scalar", + defaultval="", + mnemonics="SLC POTential FileNAME", + added_in_version="9.3.3", + text=r""" Specify the spin-lattice-coupling potential file name in the coupled spin-lattice multibinit dynamics calculation, which can be a netcdf file. The string must be enclosed between quotation marks: slc_pot_fname "BaTiO3_slc.nc" -""", - ), - Variable( - abivarname="outdata_prefix@multibinit", - varset="multibinit", - vartype="string", - topics=["Control_useful"], - dimensions="scalar", - defaultval=None, - mnemonics="OUTput DATA PREFIX", - added_in_version="9.8.0", - text=r""" +""" + +), + +Variable( + abivarname="outdata_prefix@multibinit", + varset="multibinit", + vartype="string", + topics=["Control_useful"], + dimensions="scalar", + defaultval=None, + mnemonics="OUTput DATA PREFIX", + added_in_version="9.8.0", + text=r""" Prefix for output files. Replaces the analogous entry in the obsolete *files_file* . This variable is used when MULTIBINIT is executed with the new syntax: @@ -2201,6 +2402,8 @@ See also [[outdata_prefix@abinit]] and [[outdata_prefix@anaddb]] -""", - ), +""" +), + + ] diff --git a/abipy/abio/abivar_database/variables_optic.py b/abipy/abio/abivar_database/variables_optic.py index bc9bf4eae..681dadeed 100644 --- a/abipy/abio/abivar_database/variables_optic.py +++ b/abipy/abio/abivar_database/variables_optic.py @@ -1,3 +1,4 @@ + executable = "optic" try: @@ -7,19 +8,19 @@ pass ValueWithConditions = dict -Variable = dict +Variable=dict variables = [ - Variable( - abivarname="broadening@optic", - varset="optic", - vartype="real", - topics=["Optic_basic"], - dimensions="scalar", - defaultval="1.d-3 Ha", - mnemonics="BROADENING", - added_in_version="before_v9", - text=r""" +Variable( + abivarname="broadening@optic", + varset="optic", + vartype="real", + topics=["Optic_basic"], + dimensions="scalar", + defaultval="1.d-3 Ha", + mnemonics="BROADENING", + added_in_version="before_v9", + text=r""" This parameter applies a broadening to the spectrum and is used to avoid divergences in the sum-over-states approach. The sum-over-states approach to the linear and nonlinear susceptibilities @@ -35,17 +36,18 @@ and acts as a broadening to the spectrum. The broadening should not be too large, as this would wash out the features in the spectrum. """, - ), - Variable( - abivarname="ddkfile@optic", - varset="optic", - vartype="string", - topics=["Optic_basic"], - dimensions="scalar", - mnemonics="DDK FILE", - commentdefault="no default", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="ddkfile@optic", + varset="optic", + vartype="string", + topics=["Optic_basic"], + dimensions="scalar", + mnemonics="DDK FILE", + commentdefault="no default", + added_in_version="before_v9", + text=r""" This parameter specifies the name of the file containing the matrix elements of the $d/dk$ operator in direction X, as the string ddkfile_X. This file should have been produced by a preparatory Abinit run. @@ -56,17 +58,18 @@ Make sure that the number of bands, spin channels, and k-points are the same in all the files. """, - ), - Variable( - abivarname="domega@optic", - varset="optic", - vartype="real", - topics=["Optic_basic"], - dimensions="scalar", - defaultval="1.d-3 Ha", - mnemonics="Delta OMEGA", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="domega@optic", + varset="optic", + vartype="real", + topics=["Optic_basic"], + dimensions="scalar", + defaultval="1.d-3 Ha", + mnemonics="Delta OMEGA", + added_in_version="before_v9", + text=r""" This parameter specifies the step size $\Delta\omega$ for the grid over which the optic utility computes the susceptibilities. The maximum energy is set by the companion parameter [[optic:maxomega]]. The susceptibilities are thus computed at @@ -74,17 +77,18 @@ to capture more features, decrease the step size to get a finer energy grid. In order to go to higher frequency, increase the maximum. """, - ), - Variable( - abivarname="lin_comp@optic", - varset="optic", - vartype="integer", - topics=["Optic_basic"], - dimensions=[["num_lin_comp"]], - defaultval=0, - mnemonics="LINear COMPonents", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="lin_comp@optic", + varset="optic", + vartype="integer", + topics=["Optic_basic"], + dimensions=[["num_lin_comp"]], + defaultval=0, + mnemonics="LINear COMPonents", + added_in_version="before_v9", + text=r""" This parameter specifies the directions of the [[optic:num_lin_comp]] requested components of the dielectric tensor. The components are specified in cartesian coordinates, where 1, 2, and 3 represent x, y, and z respectively. For @@ -92,17 +96,18 @@ [[optic:num_lin_comp]] entries. Note that these directions are denoted by $a$ and $b$ in [[cite:Sharma2004]]. """, - ), - Variable( - abivarname="maxomega@optic", - varset="optic", - vartype="real", - topics=["Optic_basic"], - dimensions="scalar", - defaultval="1 Ha", - mnemonics="MAXimum value of OMEGA", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="maxomega@optic", + varset="optic", + vartype="real", + topics=["Optic_basic"], + dimensions="scalar", + defaultval="1 Ha", + mnemonics="MAXimum value of OMEGA", + added_in_version="before_v9", + text=r""" This parameter specifies the maximum energy for the grid over which the optic utility computes the susceptibilities. The grid step size is set by the companion parameter [[optic:domega]]. The susceptibilities are thus computed at @@ -110,17 +115,18 @@ to capture more features, decrease the step size to get a finer energy grid. In order to go to higher frequency, increase the maximum. """, - ), - Variable( - abivarname="nonlin_comp@optic", - varset="optic", - vartype="integer", - topics=["Optic_basic"], - dimensions=[["num_nonlin_comp"]], - defaultval=0, - mnemonics="NON-LINear COMPonents", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="nonlin_comp@optic", + varset="optic", + vartype="integer", + topics=["Optic_basic"], + dimensions=[["num_nonlin_comp"]], + defaultval=0, + mnemonics="NON-LINear COMPonents", + added_in_version="before_v9", + text=r""" This parameter specifies the directions of the [[optic:num_nonlin_comp]] requested components of the second-order nonlinear dielectric tensor. The components are specified in cartesian coordinates, where 1, 2, and 3 represent x, y, and z respectively. For @@ -128,17 +134,18 @@ [[optic:num_nonlin_comp]] entries. Note that these directions are denoted by $a$ and $b$ in [[cite:Sharma2004]]. """, - ), - Variable( - abivarname="num_lin_comp@optic", - varset="optic", - vartype="integer", - topics=["Optic_basic"], - dimensions="scalar", - defaultval=0, - mnemonics="NUMber of LINear COMPonents", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="num_lin_comp@optic", + varset="optic", + vartype="integer", + topics=["Optic_basic"], + dimensions="scalar", + defaultval=0, + mnemonics="NUMber of LINear COMPonents", + added_in_version="before_v9", + text=r""" This parameter specifies how many components (out of 9 possible) of the linear optical dielectric tensor to calculate. Some of these may be either equal to each other, or zero, depending upon the @@ -146,84 +153,89 @@ The directions of the requested components are specified by the parameter [[optic:lin_comp]]. """, - ), - Variable( - abivarname="num_nonlin_comp@optic", - varset="optic", - vartype="integer", - topics=["Optic_basic"], - dimensions="scalar", - defaultval=0, - mnemonics="NUMber of NON-LINear COMPonents", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="num_nonlin_comp@optic", + varset="optic", + vartype="integer", + topics=["Optic_basic"], + dimensions="scalar", + defaultval=0, + mnemonics="NUMber of NON-LINear COMPonents", + added_in_version="before_v9", + text=r""" This parameter specifies how many components (out of 27 possible) of the second-order nonlinear optical tensor to calculate. Some of these may be either equal to each other, or zero, depending upon the symmetry of the material. The directions of the requested components are specified by the parameter [[optic:nonlin_comp]]. """, - ), - Variable( - abivarname="num_linel_comp@optic", - varset="optic", - vartype="integer", - topics=["Optic_basic"], - dimensions="scalar", - defaultval=0, - mnemonics="NUMber of LINear ELetro-optic COMPonents", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="num_linel_comp@optic", + varset="optic", + vartype="integer", + topics=["Optic_basic"], + dimensions="scalar", + defaultval=0, + mnemonics="NUMber of LINear ELetro-optic COMPonents", + added_in_version="before_v9", + text=r""" This parameter specifies how many components (out of 27 possible) of the linear electro-optical susceptibility to calculate. Some of these may be either equal to each other, or zero, depending upon the symmetry of the material. The directions of the requested components are specified by the parameter [[optic:linel_comp]]. """, - ), - Variable( - abivarname="prtlincompmatrixelements@optic", - varset="optic", - vartype="integer", - topics=["Optic_basic"], - dimensions="scalar", - defaultval=0, - mnemonics="PRinT the LINear COMPonent of the dielectric tensor's MATRIX ELEMENTS", - added_in_version="v9.5", - text=r""" +), + +Variable( + abivarname="prtlincompmatrixelements@optic", + varset="optic", + vartype="integer", + topics=["Optic_basic"], + dimensions="scalar", + defaultval=0, + mnemonics="PRinT the LINear COMPonent of the dielectric tensor's MATRIX ELEMENTS", + added_in_version="v9.5", + text=r""" If set to 1, the matrix elements, the renormalized (but unshifted) Kohn-Sham eigenvalues, the occupations and the kpts weights are all printed out in the ‘_OPTIC.nc’ file generated by the optic tool. The matrix elements are the ones used to build the linear components of the dielectric tensor. Useful for post processing of matrix elements or rebuild the linear components of the dielectric tensor in an external script. """, - ), - Variable( - abivarname="linel_comp@optic", - varset="optic", - vartype="integer", - topics=["Optic_basic"], - dimensions=[["num_linel_comp"]], - defaultval=0, - mnemonics="LINear ELectro-optic COMPonents", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="linel_comp@optic", + varset="optic", + vartype="integer", + topics=["Optic_basic"], + dimensions=[["num_linel_comp"]], + defaultval=0, + mnemonics="LINear ELectro-optic COMPonents", + added_in_version="before_v9", + text=r""" This parameter specifies the directions of the [[optic:num_linel_comp]] requested components of the linear electro-optical susceptibility. The components are specified in cartesian coordinates, where 1, 2, and 3 represent x, y, and z respectively. For example, 111 represents the xxx component, and 321 represents zyx. There should be [[optic:num_linel_comp]] entries. """, - ), - Variable( - abivarname="scissor@optic", - varset="optic", - vartype="real", - topics=["Optic_basic"], - dimensions="scalar", - defaultval=0.0, - mnemonics="SCISSOR operator", - commentdefault="in Ha", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="scissor@optic", + varset="optic", + vartype="real", + topics=["Optic_basic"], + dimensions="scalar", + defaultval=0.0, + mnemonics="SCISSOR operator", + commentdefault="in Ha", + added_in_version="before_v9", + text=r""" This parameter provides a fixed shift to all the conduction bands. As LDA/GGA are known to underestimate the band-gap by a significant amount in some cases, in order to obtain a reasonable optical spectrum and make a realistic @@ -233,48 +245,51 @@ determine the self energy using the [[tutorial:gw1|GW approach]], in which case the opening of the gap due to the GW correction can be used as the scissor shift. """, - ), - Variable( - abivarname="tolerance@optic", - varset="optic", - vartype="real", - topics=["Optic_basic"], - dimensions="scalar", - defaultval="1.d-3 Ha", - mnemonics="TOLERANCE", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="tolerance@optic", + varset="optic", + vartype="real", + topics=["Optic_basic"], + dimensions="scalar", + defaultval="1.d-3 Ha", + mnemonics="TOLERANCE", + added_in_version="before_v9", + text=r""" This parameter sets a scale for discarding small energy denominators. When energy denominators are smaller than **tolerance**, the term is discarded from the sum. See also [[optic:broadening]]. """, - ), - Variable( - abivarname="wfkfile@optic", - varset="optic", - vartype="string", - topics=["Optic_basic"], - dimensions="scalar", - mnemonics="WaveFunction K FILE", - commentdefault="no default", - added_in_version="before_v9", - text=r""" +), + +Variable( + abivarname="wfkfile@optic", + varset="optic", + vartype="string", + topics=["Optic_basic"], + dimensions="scalar", + mnemonics="WaveFunction K FILE", + commentdefault="no default", + added_in_version="before_v9", + text=r""" This parameter specifies the name of the ground state wavefunction file, which should have been produced in a preparatory Abinit run. It should include both the valence and conduction states to be used in the optic calculation (see [[help:optic]]). """, - ), - Variable( - abivarname="nband_sum@optic", - varset="optic", - vartype="integer", - topics=["Optic_basic"], - dimensions="scalar", - mnemonics="Number of BANDs in SUM", - commentdefault="-1 i.e. use all bands found in external files. ", - added_in_version="9.6.2", - text=r""" +), + +Variable( + abivarname="nband_sum@optic", + varset="optic", + vartype="integer", + topics=["Optic_basic"], + dimensions="scalar", + mnemonics="Number of BANDs in SUM", + commentdefault="-1 i.e. use all bands found in external files. ", + added_in_version="9.6.2", + text=r""" This variable specifies the number of bands included in the sum over states expressions. If not given in input, all the bands found in the external files are used. @@ -286,5 +301,6 @@ Obviously nband_sum cannot be greater than the number of bands stored on disk. """, - ), +), + ] From fc4db419c6e54dc610ab391d23ad184939393079 Mon Sep 17 00:00:00 2001 From: Matteo Giantomassi Date: Wed, 30 Sep 2026 18:36:55 +0200 Subject: [PATCH 19/23] Deactivate test_cod --- abipy/core/tests/test_restapi.py | 1 + 1 file changed, 1 insertion(+) diff --git a/abipy/core/tests/test_restapi.py b/abipy/core/tests/test_restapi.py index 836348b32..6ebf88074 100644 --- a/abipy/core/tests/test_restapi.py +++ b/abipy/core/tests/test_restapi.py @@ -43,6 +43,7 @@ def test_mprester(self): if self.has_nbformat(): mp.write_notebook(nbpath=self.get_tmpname(text=True)) + @pytest.mark.skip(reason="connection with COD is not very stable") def test_cod(self): """Testing COD interface.""" self.skip_if_not_executable("mysql") From 909c823c78eef3d1cac7b514f1df0cca1c6ecd6f Mon Sep 17 00:00:00 2001 From: Matteo Giantomassi Date: Wed, 30 Sep 2026 23:08:46 +0200 Subject: [PATCH 20/23] Fox warnings in doc --- abipy/core/structure.py | 5 +- abipy/examples/flows/run_ldaus.py | 1 + abipy/examples/plot/plot_phonons_msqd.py | 2 +- abipy/ml/ml_relax.py | 2 +- abipy/panels/oncvpsp_gui.py | 14 +- docs/README.rst | 129 ++--- docs/api/index.rst | 25 +- docs/api/modules.rst | 7 - docs/coding_guide.rst | 80 +-- docs/features.rst | 38 +- docs/flows_howto.rst | 72 +-- docs/graphical_interface.rst | 217 ++++----- docs/installation.rst | 188 ++++--- docs/postprocessing_howto.rst | 271 +++++------ docs/scripts/abicheck.rst | 10 +- docs/scripts/abicomp.rst | 20 +- docs/scripts/abidoc.rst | 6 +- docs/scripts/abinp.rst | 14 +- docs/scripts/abiopen.rst | 34 +- docs/scripts/abips.rst | 2 +- docs/scripts/abirun.rst | 8 +- docs/scripts/abistruct.rst | 48 +- docs/scripts/abiview.rst | 6 +- docs/scripts/index.rst | 24 +- docs/scripts/oncv.rst | 4 +- docs/workflows/taskmanager.rst | 594 ++++++++++++----------- pyproject.toml | 14 +- tasks.py | 18 +- 28 files changed, 909 insertions(+), 944 deletions(-) delete mode 100644 docs/api/modules.rst diff --git a/abipy/core/structure.py b/abipy/core/structure.py index a6d992a22..44ff98986 100644 --- a/abipy/core/structure.py +++ b/abipy/core/structure.py @@ -831,8 +831,9 @@ def to_abivars(self, enforce_znucl=None, enforce_typat=None, **kwargs) -> dict: Returns a dictionary with the ABINIT variables. Args: - enforce_znucl[ntypat] = Enforce this value for znucl. - enforce_typat[natom] = Fortran conventions. Start to count from 1. + enforce_znucl: Array of shape (ntypat,). Enforce this value for znucl. + enforce_typat: Array of shape (natom,). Enforce this value for typat. + Fortran conventions i.e. start to count from 1. """ from abipy.flowtk.abiobjects import structure_to_abivars diff --git a/abipy/examples/flows/run_ldaus.py b/abipy/examples/flows/run_ldaus.py index 60bf713a6..b4d1339ef 100755 --- a/abipy/examples/flows/run_ldaus.py +++ b/abipy/examples/flows/run_ldaus.py @@ -1,6 +1,7 @@ #!/usr/bin/env python r""" KS + U calculations +=================== This example shows how to compute the KS + U band structure of NiO with PAW for several values of U and J. diff --git a/abipy/examples/plot/plot_phonons_msqd.py b/abipy/examples/plot/plot_phonons_msqd.py index f68eebdf0..10ad6e80c 100755 --- a/abipy/examples/plot/plot_phonons_msqd.py +++ b/abipy/examples/plot/plot_phonons_msqd.py @@ -23,7 +23,7 @@ # Invoke anaddb to compute phonon bands and dos. # dos_method = "gaussian" dos_method = "tetra" -phbst_file, phdos_file = ddb.anaget_phbst_and_phdos_files(nqsmall=4, dos_method=dos_method, ndivsm=1, mpi_procs=2) +phbst_file, phdos_file = ddb.anaget_phbst_and_phdos_files(nqsmall=4, dos_method=dos_method, ndivsm=1) # Extract msqd_dos msqd_dos = phdos_file.msqd_dos diff --git a/abipy/ml/ml_relax.py b/abipy/ml/ml_relax.py index f84926dd8..c1f4de5b5 100644 --- a/abipy/ml/ml_relax.py +++ b/abipy/ml/ml_relax.py @@ -9,7 +9,7 @@ import numpy as np from ase.atoms import Atoms from ase.calculators.abinit import Abinit, AbinitProfile -from ase.constraints import ExpCellFilter +from ase.filters import ExpCellFilter from ase.stress import voigt_6_to_full_3x3_stress from monty.collections import dict2namedtuple diff --git a/abipy/panels/oncvpsp_gui.py b/abipy/panels/oncvpsp_gui.py index 1b586e067..582d553fa 100644 --- a/abipy/panels/oncvpsp_gui.py +++ b/abipy/panels/oncvpsp_gui.py @@ -512,31 +512,31 @@ class OncvGui(AbipyParameterized): qcut_num = param.Integer(2, bounds=(1, None)) qcut_step = param.Number(1, bounds=(0, None)) - qcut_dir = param.Selector(["centered", ">", "<"]) + qcut_dir = param.Selector(objects=["centered", ">", "<"]) rc_num = param.Integer(2, bounds=(1, None)) rc_step = param.Number(0.1, bounds=(0, None)) - rc_dir = param.Selector(["centered", ">", "<"]) + rc_dir = param.Selector(objects=["centered", ">", "<"]) debl_num = param.Integer(2, bounds=(1, None)) debl_step = param.Number(1.0, bounds=(0, None)) - debl_dir = param.Selector(["centered", ">", "<"]) + debl_dir = param.Selector(objects=["centered", ">", "<"]) rc5_num = param.Integer(2, bounds=(1, None)) rc5_step = param.Number(0.1, bounds=(0, None)) - rc5_dir = param.Selector(["<", "centered", ">"]) + rc5_dir = param.Selector(objects=["<", "centered", ">"]) dvloc0_num = param.Integer(2, bounds=(1, None)) dvloc0_step = param.Number(0.5, bounds=(0, None)) - dvloc0_dir = param.Selector(["centered", "<", ">"]) + dvloc0_dir = param.Selector(objects=["centered", "<", ">"]) fcfact_num = param.Integer(1, bounds=(1, None)) fcfact_step = param.Number(0.2, bounds=(0, None)) - fcfact_dir = param.Selector(["centered", ">", "<"]) + fcfact_dir = param.Selector(objects=["centered", ">", "<"]) rcfact_num = param.Integer(1, bounds=(1, None)) rcfact_step = param.Number(0.2, bounds=(0, None)) - rcfact_dir = param.Selector(["centered", ">", "<"]) + rcfact_dir = param.Selector(objects=["centered", ">", "<"]) ace_theme = param.ObjectSelector( default="chrome", objects=pnw.CodeEditor.param.theme.objects, doc="Theme of the editor" diff --git a/docs/README.rst b/docs/README.rst index b1e39c087..1e99df166 100644 --- a/docs/README.rst +++ b/docs/README.rst @@ -9,75 +9,75 @@ Documenting AbiPy Organization of documentation ----------------------------- -The AbiPy documentation is generated from ReStructured Text using the Sphinx_ documentation generation tool. -The documentation sources are in the :file:`~/docs/` directory in the repository. -Major items: - -* index.rst - the top level include document for AbiPy docs -* api - placeholders to automatically generate the api documentation -* scripts - documentation for scripts -* flow_gallery/gallery - automatically generated by sphinx-gallery -* workflows - Documentation about Abinit flows/works/tasks and TaskManager -* README.rst - the present file -* conf.py - the sphinx configuration file -* _static - used by the sphinx build system - -The main entry point is :file:`docs/index.rst`, which pulls in the files -for the users guide, developers guide, api reference. -The actual ReStructured Text files for the APIs of the subpackages, for the scripts and for the workflows (resp.) are kept -in :file:`docs/api`, :file:`docs/scripts` and :file:`docs/workflows` (resp.). - -Additional files can be added to the various guides by including their base -file name (the ``.rst`` extension is not necessary) in the table of contents. -It is also possible to include other documents through the use of an include -statement, such as:: +The AbiPy documentation is written in reStructuredText and built with the Sphinx_ documentation generator. +The sources are in the :file:`~/docs/` directory of the repository. +The main items are: + +* index.rst - the top-level document of the AbiPy docs +* api - placeholders used to generate the API documentation automatically +* scripts - documentation for the scripts +* flow_gallery/gallery - generated automatically by sphinx-gallery +* workflows - documentation on Abinit flows/works/tasks and the TaskManager +* README.rst - this file +* conf.py - the Sphinx configuration file +* _static - used by the Sphinx build system + +The main entry point is :file:`docs/index.rst`, which pulls in the files +for the user guide, the developer guide and the API reference. +The reStructuredText files for the API of the subpackages, the scripts and the workflows are kept +in :file:`docs/api`, :file:`docs/scripts` and :file:`docs/workflows`, respectively. + +To add a file to one of the guides, include its base +name (the ``.rst`` extension is not needed) in the table of contents. +You can also include other documents with an include +directive, such as:: .. include:: ../../TODO -The output produced by Sphinx can be configured by editing the :file:`conf.py` file located in the :file:`docs/`. -Before building the documentation, you need to install the sphinx extensions listed -in the ``docs`` optional-dependency group in :file:`abipy/pyproject.toml` with:: +The Sphinx output can be configured by editing the :file:`conf.py` file in :file:`docs/`. +Before building the documentation, install the Sphinx extensions listed +in the ``docs`` optional-dependency group of :file:`abipy/pyproject.toml` with:: cd abipy python -m pip install --editable ".[docs]" -To build the HTML documentation, install sphinx then type ``make`` that will execute:: +To build the HTML documentation, type ``make``, which executes:: sphinx-build -b html -d _build/doctrees . _build/html -Remember to issue:: +Remember to set:: export READTHEDOCS=1 -before running ``make`` to activate the generation of the thumbnails in :file:`abipy/examples/flows`. +before running ``make`` to generate the thumbnails for :file:`abipy/examples/flows`. -The documentation is produced in :file:`_build/html`. +The documentation is written to :file:`_build/html`. Use:: open _build/html/index.html to open the homepage in your browser. -You can run ``make help`` to see information on all possible make targets. +Run ``make help`` to list all the available make targets. .. _formatting-abipy-docs: Formatting ---------- -The Sphinx website contains plenty of documentation_ concerning ReST markup and -working with Sphinx in general. -Here are a few additional things to keep in mind: +The Sphinx website has plenty of documentation_ on reST markup and +on working with Sphinx in general. +Here are a few additional points to keep in mind: -* Please familiarize yourself with the Sphinx directives for `inline markup`_. - Abipy's documentation makes heavy use of cross-referencing and other semantic markup. +* Familiarize yourself with the Sphinx directives for `inline markup`_. + AbiPy's documentation makes heavy use of cross-referencing and other semantic markup. Several aliases are defined in :file:`abipy/docs/links.rst` and are automatically - included in each ``rst`` file via `rst_epilog `_ + included in every ``rst`` file via `rst_epilog `_. -* Mathematical expressions can be rendered with `mathjax `_ in html. +* Mathematical expressions are rendered in HTML with `mathjax `_. For example: - ``:math:`\sin(x_n^2)``` yields: :math:`\sin(x_n^2)`, and:: + ``:math:`\sin(x_n^2)``` yields :math:`\sin(x_n^2)`, and:: .. math:: @@ -89,29 +89,29 @@ Here are a few additional things to keep in mind: \int_{-\infty}^{\infty}\frac{e^{i\phi}}{1+x^2\frac{e^{i\phi}}{1+x^2}} -* Bibtex citations are supported via the - `sphinxcontrib-bibtex extension `_ - The bibtext entries are declared in the :file:`abipy/docs/refs.bib` file. +* BibTeX citations are supported via the + `sphinxcontrib-bibtex extension `_. + The BibTeX entries are declared in the :file:`abipy/docs/abiref.bib` file. For example:: See :cite:`Gonze2016` for a brief description of recent developments in ABINIT. - yelds: See :cite:`Gonze2016` for a brief description of recent developments in ABINIT. + yields: See :cite:`Gonze2016` for a brief description of recent developments in ABINIT. - To add a new bibtex entry to the database, please use the :program:`doi2bibtex` tool + To add a new BibTeX entry to the database, use the :program:`doi2bibtex` tool provided by the `betterbib package `_:: - doi2bibtex https://doi.org/10.1103/PhysRevB.33.7017 >> refs.bib + doi2bibtex https://doi.org/10.1103/PhysRevB.33.7017 >> abiref.bib - then change the bibtex identifier (use the name of the first author and the publication year). + then change the BibTeX identifier to the name of the first author followed by the publication year. -* Interactive ipython_ sessions can be illustrated in the documentation using the following directive:: +* Interactive ipython_ sessions can be shown in the documentation with the following directive:: .. sourcecode:: ipython In [69]: lines = plot([1, 2, 3]) - which would yield: + which yields: .. sourcecode:: ipython @@ -125,12 +125,12 @@ Here are a few additional things to keep in mind: yields: .. note:: - here is a note + Here is a note - also: + Similarly: .. warning:: - here is a warning + Here is a warning * Use the *deprecated* directive when appropriate:: @@ -142,17 +142,19 @@ Here are a few additional things to keep in mind: .. deprecated:: 0.98 This feature is obsolete, use something else. -* Use the *versionadded* and *versionchanged* directives, which have similar - syntax to the *deprecated* role:: +* The *versionadded* and *versionchanged* directives have a syntax similar + to *deprecated*:: .. versionadded:: 0.2 The transforms have been completely revamped. + yields: + .. versionadded:: 0.2 The transforms have been completely revamped. -* The autodoc extension will handle index entries for the API, but additional - entries in the index need to be explicitly added. +* The autodoc extension handles index entries for the API, but any additional + index entries must be added explicitly. .. _documentation: http://www.sphinx-doc.org/en/master/ .. _`inline markup`: http://www.sphinx-doc.org/en/master/usage/restructuredtext/basics.html?highlight=inline#inline-markup @@ -160,20 +162,19 @@ Here are a few additional things to keep in mind: Docstrings ---------- -In addition to the aforementioned formatting suggestions: +In addition to the formatting suggestions above: -* Docstrings are written following the +* Docstrings follow the `Google Python Style Guide `_. - We use the `napoleon `_ extension - to convert Google style docstrings to reStructuredText before Sphinx attempts to parse them. + The `napoleon `_ extension + converts Google-style docstrings to reStructuredText before Sphinx parses them. Dynamically generated figures ----------------------------- -Figures can be automatically generated from scripts and included in the docs. -It is not necessary to explicitly save the figure in the script, this will be done -automatically at build time to ensure that the code that is included runs and produces the advertised figure. - -Any plots specific to the documentation should be added to the :file:`examples/plot/` directory and committed to git. +Figures can be generated automatically from scripts and included in the docs +with `sphinx-gallery `_. +There is no need to save the figure explicitly in the script: this is done +automatically at build time, which also ensures that the included code runs and produces the advertised figure. -`sphinx-gallery `_ +Plots specific to the documentation should be added to the :file:`examples/plot/` directory and committed to git. diff --git a/docs/api/index.rst b/docs/api/index.rst index 67eb581ee..f75c72549 100644 --- a/docs/api/index.rst +++ b/docs/api/index.rst @@ -5,27 +5,6 @@ API documentation ================= .. toctree:: - :maxdepth: 1 + :maxdepth: 2 - abipy.abio.abivar_database.rst - abipy.abio.rst - abipy.core.rst - abipy.dfpt.rst - abipy.display.rst - abipy.dynamics.rst - abipy.electrons.rst - abipy.embedding.rst - abipy.eph.rst - abipy.flowtk.rst - abipy.iotools.rst - abipy.lumi.rst - abipy.ml.rst - abipy.panels.rst - abipy.ppcodes.rst - abipy.rst - abipy.scripts.rst - abipy.tools.elate.rst - abipy.tools.rst - abipy.wannier90.rst - abipy.waves.rst - index.rst \ No newline at end of file + abipy diff --git a/docs/api/modules.rst b/docs/api/modules.rst deleted file mode 100644 index fb448e9f3..000000000 --- a/docs/api/modules.rst +++ /dev/null @@ -1,7 +0,0 @@ -abipy -===== - -.. toctree:: - :maxdepth: 1 - - abipy diff --git a/docs/coding_guide.rst b/docs/coding_guide.rst index 5dca1bfcf..c8070753e 100644 --- a/docs/coding_guide.rst +++ b/docs/coding_guide.rst @@ -9,24 +9,24 @@ Coding guide Committing changes ------------------ -When committing changes to AbiPy, there are a few things to bear in mind. +When committing changes to AbiPy, keep the following points in mind: -* if your changes are non-trivial, please make an entry in the :file:`CHANGELOG.rst` - Note that the changelog is written following the format employed by the +* If your changes are non-trivial, add an entry to :file:`CHANGELOG.rst`. + The changelog follows the format used by the `releases `_ Sphinx extension. -* if you change the API, please document the modifications in the docstring with the ``versionadded`` role:: +* If you change the API, document the modifications in the docstring with the ``versionadded`` role:: .. versionadded:: 0.2 Add new argument ``foobar`` -* Can you pass the automatic tests? +* Do your changes pass the automatic tests? -* Can you add a test to test your changes? +* Can you add a test for your changes? * If you have added new files or directories, or reorganized existing - ones, are the new files included in the match patterns in :file:`MANIFEST.in`. - This file determines what goes into the source distribution of the build. + ones, are the new files matched by the patterns in :file:`MANIFEST.in`? + This file determines what goes into the source distribution. Importing and name spaces ------------------------- @@ -36,19 +36,19 @@ For numpy_, use:: import numpy as np a = np.array([1,2,3]) -For matplotlib_, **avoid** using the high-level interface such as in:: +For matplotlib_, **avoid** the high-level interface, as in:: import matplotlib.pyplot as plt plt.plot(x, y) -and use the object-oriented API provided by |matplotlib-Axes|:: +and use the object-oriented API provided by |matplotlib-Axes| instead:: from abipy.tools.plotting import get_ax_fig_plt ax, fig, plt = get_ax_fig_plt(ax=None) ax.plot(x, y) -It is recommended to pass the Axes ``ax`` to the plotting method and -use the decorator ``add_fig_kwargs``:: +Plotting methods should accept an Axes ``ax`` argument and +use the ``add_fig_kwargs`` decorator:: @add_fig_kwargs def plot(self, ax=None, **kwargs): @@ -67,64 +67,64 @@ use the decorator ``add_fig_kwargs``:: Naming, spacing, and formatting conventions ------------------------------------------- -In general, we want to stay as closely as possible to the standard -coding guidelines for python written by Guido van Rossum in `PEP0008 `_. +In general, we try to follow as closely as possible the standard +Python coding guidelines written by Guido van Rossum in `PEP0008 `_. * functions and class methods: ``lower`` or ``lower_underscore_separated`` -* attributes and variables: ``lower`` +* attributes and variables: ``lower`` * classes: ``Upper`` or ``MixedCase`` Prefer the shortest names that are still readable. -Configure your editor to use spaces, not hard tabs. -The standard indentation unit is always four spaces; -if there is a file with tabs or a different number of spaces it is a bug -- please fix it. +Configure your editor to use spaces, not hard tabs. +The standard indentation unit is always four spaces; +a file with tabs or a different number of spaces is a bug, so please fix it. -Keep docstrings uniformly indented as in the example below, with nothing to the left of the triple quotes. +Keep docstrings uniformly indented as in the example above, with nothing to the left of the triple quotes. -Limit line length to (around) 90 characters. -If you wonder why we are violating pep8 that specifies a maximum line length of 79 characters, +Limit line length to around 90 characters. +If you wonder why we deviate from PEP8, which specifies a maximum line length of 79 characters, check out this video by Raymond Hettinger: .. youtube:: wf-BqAjZb8M -If a logical line needs to be longer, use parentheses to break it; do not use an escaped newline. -It may be preferable to use a temporary variable to replace a single -long line with two shorter and more readable lines. +If a logical line needs to be longer, break it using parentheses rather than an escaped newline. +Sometimes it is better to introduce a temporary variable and replace a single +long line with two shorter, more readable ones. -Please do not commit lines with trailing white space, as it causes noise in diffs. +Please do not commit lines with trailing whitespace, as they add noise to diffs. Writing examples ---------------- -We have examples in subdirectories of :file:`abipy/examples`, and these are automatically -generated when the website is built to show up both in the :file:`examples` -and :file:`gallery` sections of the website. +The examples live in subdirectories of :file:`abipy/examples` and are automatically +run when the website is built, so that they appear in both the :file:`examples` +and :file:`gallery` sections of the website. -Many people find these examples from the website, and do not have ready access to the -:file:`examples` directory in which they reside. -Thus any example data that is required for the example should be added to the :file:`abipy/data` directory +Many people find these examples on the website and do not have easy access to the +:file:`examples` directory itself. +Any data required by an example should therefore be added to the :file:`abipy/data` directory. Testing ------- -Abipy has a testing infrastructure based on :mod:`unittest` and pytest_. +AbiPy has a testing infrastructure based on :mod:`unittest` and pytest_. -Common test support is provided by :mod:`abipy.core.testing`, -data files are stored in :file:`abipy/data`, in particular in :file:`abipy/data/refs` that -contains several output files that can be used for writing unit tests and examples. +Common test support is provided by :mod:`abipy.core.testing`. +Data files are stored in :file:`abipy/data`; in particular, :file:`abipy/data/refs` +contains several output files that can be used to write unit tests and examples. -To install pytest with useful plugins, use:: +To install pytest together with useful plugins, run:: python -m pip install --editable ".[tests]" in the top-level directory of the package. -To run the tests associated to the abio.inputs module, use:: +To run the tests of the abio.inputs module, use:: pytest -v abio/tests/test_inputs.py -or use:: +while:: - pytest -v + pytest -v -to run the entire test suite. +runs the entire test suite. diff --git a/docs/features.rst b/docs/features.rst index 828765463..7b189ac09 100644 --- a/docs/features.rst +++ b/docs/features.rst @@ -2,28 +2,28 @@ Overview ======== -AbiPy is a Python_ package to analyze the results produced by Abinit_ -an open-source program for the ab-initio calculations of the physical properties of materials -within Density Functional Theory and Many-Body perturbation theory. -AbiPy also provides tools to generate input files and workflows to automate +AbiPy is a Python_ package for analyzing the results produced by Abinit_, +an open-source program for the ab-initio calculation of the physical properties of materials +within Density Functional Theory and Many-Body Perturbation Theory. +AbiPy also provides tools to generate input files and to build workflows that automate ab-initio calculations and typical convergence studies. -AbiPy is interfaced with pymatgen_ thus allowing users to -benefit from the different tools and python objects available in the pymatgen ecosystem. +Since AbiPy is interfaced with pymatgen_, users can also take advantage of +the many tools and Python objects available in the pymatgen ecosystem. -AbiPy can be used in conjunction with matplotlib_, pandas_, seaborn_, -ipython_ and jupyter_ thus providing a powerful and user-friendly environment for data analysis and visualization. -Check out the list of plotting scripts available in our :ref:`plot-gallery`. -To learn more about the integration between jupyter_ and AbiPy, visit `our collection of notebooks +AbiPy works well together with matplotlib_, pandas_, seaborn_, +ipython_ and jupyter_, providing a powerful and user-friendly environment for data analysis and visualization. +Check out the plotting scripts available in our :ref:`plot-gallery`. +To learn more about how AbiPy integrates with jupyter_, browse `our collection of notebooks `_ -or click the **Launch Binder** badge to start a Docker image with Abinit, AbiPy and all the other python dependencies -required to run the code inside the jupyter notebooks. -The notebook will be opened in your browser after building. +or click the **Launch Binder** badge to start a Docker image with Abinit, AbiPy and all the Python dependencies +needed to run the notebooks. +Once the image is built, the notebook opens in your browser. -Note also that the majority of the post-processing tools available in AbiPy require Abinit output files in -netcdf_ format so we strongly suggest to compile Abinit with netcdf support -(use ``--with_trio_flavor="netcdf-fallback"`` at configure time to activate the internal netcdf library, -to link Abinit against an external netcdf library please consult the configuration examples +Note that most of the post-processing tools in AbiPy require Abinit output files in +netcdf_ format, so we strongly recommend compiling Abinit with netcdf support. +Use ``--with_trio_flavor="netcdf-fallback"`` at configure time to activate the internal netcdf library. +To link Abinit against an external netcdf library, consult the configuration examples provided by the abiconfig_ package. -AbiPy is free to use. However, we also welcome your help to improve this library by making your own contributions. -Please report any bugs and issues at AbiPy's `Github page `_. +AbiPy is free to use, and we welcome contributions that help improve the library. +Please report bugs and issues on AbiPy's `GitHub page `_. diff --git a/docs/flows_howto.rst b/docs/flows_howto.rst index 3756902c6..2c005b5fe 100644 --- a/docs/flows_howto.rst +++ b/docs/flows_howto.rst @@ -4,28 +4,28 @@ Flows How-To ************ -This is a list of FAQs about the AbiPy flows and the abirun.py_ script. +This page collects frequently asked questions about AbiPy flows and the abirun.py_ script. Feel free to suggest new entries! .. important:: - The execution of the flow requires the proper configuration of ``manager.yml`` and `scheduler.yml``. - Please consult the documentation available via the abidoc.py script. See also FAQ below. + Running a flow requires properly configured ``manager.yml`` and ``scheduler.yml`` files. + The available options are documented by the abidoc.py script (see the FAQ below). Suggestions: -* Please start from the examples available in `~abipy/examples/flows` before embarking on large scale calculations. -* Make sure the Abinit executable compiled on your machine can be executed both on the front end - and the compute node (ask your sysadmin) -* If you are running on clusters in which the architecture of the compute node is different - from the one available on the front end, use ``shell_runner`` -* Use the ``abirun.py FLOWDIR debug`` command +* Start from the examples in `~abipy/examples/flows` before embarking on large-scale calculations. +* Make sure the Abinit executable compiled on your machine runs both on the front end + and on the compute nodes (ask your sysadmin). +* If the compute nodes have a different architecture from + the front end, use ``shell_runner``. +* Use the ``abirun.py FLOWDIR debug`` command to investigate problems. Please DO NOT: -* Change manually the input files and the submission scripts while the scheduler is running -* Submit jobs manually when the scheduler is running -* Use a too small delay for the scheduler to avoid overloading the front end. +* Manually change input files or submission scripts while the scheduler is running. +* Manually submit jobs while the scheduler is running. +* Use a very short delay for the scheduler, as this may overload the front end. .. contents:: @@ -34,21 +34,21 @@ Please DO NOT: How to get all the TaskManager options -------------------------------------- -The abidoc.py_ script provides three commands to get the documentation -for the options supported in ``manager.yml`` and ``scheduler.yml``. +The abidoc.py_ script provides three commands to document +the options supported in ``manager.yml`` and ``scheduler.yml``. Use:: abidoc.py manager -to document all the options supported by |TaskManager| and:: +to list all the options supported by the |TaskManager|, and:: abidoc.py scheduler for the scheduler options. -If your environment is properly configured, you should be able to get -information about the Abinit version used by the AbiPy with:: +If your environment is properly configured, you can get +information about the Abinit version used by AbiPy with:: abidoc.py abibuild @@ -63,10 +63,10 @@ information about the Abinit version used by the AbiPy with:: .. important:: - Netcdf support must be activated in Abinit as AbiPy might use - these files to extract data and/or fix runtime errors. + Netcdf support must be activated in Abinit, since AbiPy uses + netcdf files to extract data and to fix runtime errors. -At this point, you can try to run a small flow for testing purpose with:: +You can then run a small test flow with:: abicheck.py --with-flow @@ -86,55 +86,55 @@ Add the following options to `~/.abinit/abipy/scheduler.yml`: How to reduce the number of files produced by the Flow ------------------------------------------------------ -When running many calculations, use ``prtwf -1`` to tell Abinit to produce the wavefunction file only -if SCF cycle didn't converged so that AbiPy can reuse the file to restart the calculation. +When running many calculations, use ``prtwf -1`` so that Abinit writes the wavefunction file only +if the SCF cycle did not converge. AbiPy can then use this file to restart the calculation. -Note that it is possible to use:: +You can also call:: flow.use_smartio() -to activate this mode for all tasks that are not supposed to produce WFK files for their children. +to activate this mode for all the tasks that are not expected to produce WFK files for their children. How to extend tasks/works with specialized code ----------------------------------------------- Remember that pickle_ does not support classes defined inside scripts (`__main__`). -This means that `abirun.py` will raise the following exception when trying to +As a consequence, `abirun.py` will raise the following exception when trying to reconstruct the object from the pickle file: .. code-block:: python AttributeError: Cannot get attribute 'MyWork' on `_ or inside jupyter notebooks. -This document explains how to install the required dependencies and how to -generate dashboards either from the command line interface (CLI) or inside jupyter notebooks. +AbiPy provides interactive dashboards that can be used either as standalone web applications +served by the `bokeh server `_ or inside jupyter notebooks. +This page explains how to install the required dependencies and how to +generate dashboards from the command line interface (CLI) or inside jupyter notebooks. .. important:: - Please note that one needs a **running python backend** - to execute the callbacks triggerered by the widgets in the HTML page. - This part, indeed, is implemented by HTML/CSS/JS code executed - by the frontend (i.e. **your browser**) that sends the signal - to the python server (the **backend**). - The python server is supposed to process the data - and send the results back to the frontend for visualization purposes + The callbacks triggered by the widgets in the HTML page require a **running Python backend**. + The widgets are implemented in HTML/CSS/JS code executed + by the frontend (i.e. **your browser**), which sends signals + to the Python server (the **backend**). + The server processes the data + and sends the results back to the frontend for visualization. - Don't be surprised if you start to click buttons and **nothing happens**! - The examples provided in this page are only meant to show how to build GUI - or dashboards with AbiPy. + This static page has no backend, so don't be surprised if **nothing happens** when you click the buttons! + The examples on this page are only meant to show how to build GUIs + and dashboards with AbiPy. Installation ------------ -Install the `panel `_ package either from pip with: +Install the `panel `_ package with pip: .. code-block:: bash pip install panel -or with conda (**recommended**) using: +or with conda (**recommended**): .. code-block:: bash conda install panel -c conda-forge -If you plan to use panel within JupyterLab, you will also need to install -the PyViz JupyterLab extension and activate it with: +If you plan to use panel within JupyterLab, you also need to install +and activate the PyViz JupyterLab extension: .. code-block:: bash @@ -54,10 +53,10 @@ the PyViz JupyterLab extension and activate it with: Basic Usage ----------- -Several AbiPy objects provide a ``get_panel`` method returning -an object that can be served by a web browser or displayed inside the jupyter notebook. -When running inside a jupyter notebook, remember to enable the integration -with the ``panel`` infrastructure by executing: +Several AbiPy objects provide a ``get_panel`` method that returns +an object that can be served to a web browser or displayed inside a jupyter notebook. +When working in a jupyter notebook, remember to enable the integration +with ``panel`` by executing: .. jupyter-execute:: @@ -68,9 +67,9 @@ with the ``panel`` infrastructure by executing: .. note:: - The ``abipanel`` function is needed to load extensions and javascript packages + The ``abipanel`` function loads the extensions and javascript packages required by AbiPy. - This function is just a small wrapper around the panel API: + It is just a small wrapper around the panel API: .. code-block:: bash @@ -78,9 +77,9 @@ with the ``panel`` infrastructure by executing: pn.extension() -At this point, we can start to construct AbiPy objects. -For our first example, we use the abiopen function to open a ``GSR`` file, -then we call ``get_panel`` to build a set of widgets that allows us to interact +We can now start building AbiPy objects. +In our first example, we use the abiopen function to open a ``GSR`` file +and then call ``get_panel`` to build a set of widgets for interacting with the |GsrFile|: .. jupyter-execute:: @@ -93,21 +92,21 @@ with the |GsrFile|: gsr.get_panel() -The **Summary** tab provides a string representation of the file -but there is no widget to interact with it. -If you select the **e-Bands** tab, you will see several widgets and a button -that activates the visualization of the KS band energies. -Again, in this HTML page there is no python server running in background so -if you click the **Plot e-bands** button nothing happens (this is not a bug!). +The **Summary** tab shows a string representation of the file +and has no interactive widgets. +The **e-Bands** tab, on the other hand, contains several widgets and a button +that plots the KS band energies. +Since no Python server is running behind this HTML page, +clicking the **Plot e-bands** button does nothing (this is not a bug!). -The advantage of this notebook-based approach is that it is possible to mix -the panel GUIs with python code that can be used to perform +The advantage of the notebook-based approach is that you can mix +the panel GUIs with Python code to perform more advanced tasks not supported by the GUI. -Obviously it is possible to have multiple panels running in the same notebook. -Calling ``get_panel`` with an AbiPy structure, for instance, creates a set of widgets -to facilitate common operations such as exporting the structure to a different format or -generating a basic Abinit input file for e.g. GS calculations: +You can also have multiple panels in the same notebook. +For instance, calling ``get_panel`` on an AbiPy structure creates a set of widgets +for common operations such as exporting the structure to a different format or +generating a basic Abinit input file, e.g. for GS calculations: .. jupyter-execute:: @@ -115,9 +114,9 @@ generating a basic Abinit input file for e.g. GS calculations: .. note:: - At present, not all the AbiPy objects support the ``get_panel`` protocol - but we plan to gradually support more objects, especially the most important - netcdf files produced by Abinit + Not all AbiPy objects support the ``get_panel`` protocol yet, + but we plan to gradually extend it to more objects, starting from the most important + netcdf files produced by Abinit. To generate a notebook from the command line, use the abiopen.py_ script: @@ -125,17 +124,17 @@ To generate a notebook from the command line, use the abiopen.py_ script: abiopen.py si_nscf_GSR.nc -nb # short for --notebook -that will automatically open the notebook inside jupyterlab. -If you prefer classic jupyter notebooks, use the ``-nb --classic-notebook`` options +which automatically opens the notebook in JupyterLab. +If you prefer the classic jupyter notebook, use the ``-nb --classic-notebook`` options. -If you do not need to execute python code, you may want to generate a panel dashboard with: +If you do not need to execute Python code, you can generate a panel dashboard instead with: .. code-block:: bash abiopen.py si_nscf_GSR.nc -pn # short for --panel -The same approach can be used with a ``DDB`` file. -In this case, we get more tabs and options because one can use the GUI +The same approach works with a ``DDB`` file. +In this case, there are more tabs and options, since the GUI can be used to set the input parameters, invoke ``anaddb`` and visualize the results: .. jupyter-execute:: @@ -144,16 +143,16 @@ to set the input parameters, invoke ``anaddb`` and visualize the results: ddb_path = abidata.ref_file("mp-1009129-9x9x10q_ebecs_DDB") abilab.abiopen(ddb_path).get_panel() -The same result can be obtained from the CLI with +The same result can be obtained from the CLI with: .. code-block:: bash abiopen.py mp-1009129-9x9x10q_ebecs_DDB -nb -There are, however, cases in which you don't need the interactive environment provided -by jupyter notebooks as you are mainly interested in the visualization of the results. -In this case, it is possible to use the command line interface to automatically generate -a dashboard with widgets without having to start a notebook. +Sometimes, however, you do not need the interactive environment provided +by jupyter notebooks because you are mainly interested in visualizing the results. +In this case, you can use the command line interface to generate +a dashboard with widgets without starting a notebook. To build a dashboard for a |Structure| object extracted from ``FILE``, use: @@ -161,29 +160,29 @@ To build a dashboard for a |Structure| object extracted from ``FILE``, use: abistruct.py panel FILE -where ``FILE`` is **any** file providing a ``Structure`` object -e.g. netcdf files, cif files, abi, abo files etc. +where ``FILE`` is **any** file that provides a ``Structure`` object, +e.g. netcdf files, CIF files, abi and abo files, etc. -To build a dashboard associated to one of the AbiPy file, use the syntax: +To build a dashboard for one of the files supported by AbiPy, use: .. code-block:: bash abiopen.py FILE --panel -where ``FILE`` is one of the Abinit files supported by ``abiopen.py``. -For instance, one can create a dashboard to interact with a ``DDB`` file with: +where ``FILE`` is any Abinit file supported by ``abiopen.py``. +For instance, to create a dashboard for a ``DDB`` file, use: .. code-block:: bash abiopen.py out_DDB --panel -To build a dashboard for an AbiPy Flow use: +To build a dashboard for an AbiPy Flow, use: .. code-block:: bash abirun.py FLOWDIR panel -or alternatively: +or, equivalently: .. code-block:: bash @@ -192,76 +191,78 @@ or alternatively: Serving dashboards from a remote server --------------------------------------- -inspired to https://ljvmiranda921.github.io/notebook/2018/01/31/running-a-jupyter-notebook/ +In all the examples so far, we assumed that AbiPy and the web browser +run on the same machine. +Calculations, however, are often performed on clusters where a web browser +is not available or where the connection is too slow to use one. +You could copy the files from the cluster to your local machine with scp +or mount the remote file system with sshfs, but neither approach is ideal. +Ideally, we would like to run AbiPy and Abinit on the remote cluster +and visualize the results directly on our local machine. -In all the examples presented so far we assumed that both AbiPy and the web browser -are running on the same machine. -In many cases, however, calculations are performed on clusters in which web browsers are -not always available or, even if the browser is installed, the connection may be too slow.. -Obviously, one can always copy files from the remote cluster to the local machine with scp -or mount the remote file system with sshfs but both approaches are far from optimal. -In principle, we would like to be able to execute AbiPy and Abinit on the remote cluster -and visualize the results directly in our local machine. +This section explains how to start a web server on the remote cluster and +connect to it from your local machine. +The procedure is inspired by `this blog post +`_. -In this section, we discuss how to start a web server on the remote cluster and how -to connect to it from our local machine. +In what follows, ``localuser`` and ``localhost`` denote the local user and host, +while ``remoteuser`` and ``remotehost`` denote the remote user and host. +Make sure that AbiPy and all its dependencies are installed on ``remotehost``, +including the ``manager.yml`` configuration file. -Before starting, let us introduce some notation. -Let us define the local user and host as ``localuser`` and ``localhost``, respectively. -Similarly, let us define the remote user and remote host as ``remoteuser`` and ``remotehost``. -Needless to say, make sure that Abipy and all its dependencies are installed on the remotehost, -including the `taskmanager.yml` configuration file. +**Step 1: Start the server on the remote machine** -Step 1: Start the server on the remote machine - -Log-in to the remote machine via ssh as usual with ``ssh remoteuser@remotehost``. -Now use: +Log in to the remote machine via ssh as usual with ``ssh remoteuser@remotehost``, then run: .. code-block:: bash abiopen.py FILE --panel --no-browser --port 49412 -to start the server without opening the browser (``--no-browser`` option). -The server will be listening on port 49412 of the remotehost -If the port is occupied, use another one but remember that ports below 1023 are +The ``--no-browser`` option starts the server without opening a browser. +The server listens on port 49412 of ``remotehost``. +If this port is already in use, choose another one, but remember that ports below 1024 are reserved. -Step 2: +**Step 2: Forward the remote port to your local machine** -Forward port XXXX to YYYY and listen to it -In your remote host, the notebook is now running at the port XXXX that you specified. -What you’ll do next is forward this to port YYYY of your machine so that you can listen -and run it from your browser. -To achieve this, we use the following command: +The server is now running on port ``REMOTE_PORT`` (49412 in our example) of the remote host. +Next, forward this port to a port ``LOCAL_PORT`` of your local machine so that you can +connect to the server from your browser. +On your local machine, run: .. code-block:: bash - localuser@localhost: ssh -N -f -L localhost:YYYY:localhost:XXXX remoteuser@remotehost + localuser@localhost: ssh -N -f -L localhost:LOCAL_PORT:localhost:REMOTE_PORT remoteuser@remotehost + +where the options have the following meaning: --N: Suppresses the execution of a remote command. Pretty much used in port forwarding. --f: Requests the ssh command to go to background before execution. --L: this argument requires an input in the form of local_socket:remote_socket. +- ``-N``: do not execute a remote command (typically used for port forwarding). +- ``-f``: send ssh to the background before executing the command. +- ``-L``: bind ``LOCAL_PORT`` on the local machine to ``REMOTE_PORT`` on the remote machine. + The argument has the form ``local_socket:remote_socket``. -Here, we’re specifying our port as YYYY which will be binded to the port XXXX -from your remote connection. +**Step 3: Open the dashboard in your local browser** -Step 3: Fire-up Jupyter Notebook -To open up the Jupyter notebook from your remote machine, -At this point, you can simply start your web browser on your local machine -and type the following in the address bar:: +Start the web browser on your local machine and type the following in the address bar:: - localhost:YYYY + localhost:LOCAL_PORT -If you’re successful, you should see the typical Jupyter Notebook home screen in the directory -where you ran the command in Step 1. At the same time, if you look in your remote terminal, -you should see some log actions happening as you perform some tasks. +If everything worked, you should see the dashboard. +At the same time, the terminal on the remote machine should show log messages +as you interact with the page. -Closing all connections -To close connections, I usually stop my notebook from remote via CTRL + C then Y, and kill the process on YYYY via: +**Closing the connections** -localuser@localhost: sudo netstat -lpn |grep :YYYY +To close the connections, stop the server on the remote machine with ``CTRL + C``, +then find the ssh process listening on ``LOCAL_PORT`` on your local machine: + +.. code-block:: bash -# This will show the process ID (PID), e.g. ABCDEF of the one running in YYYY, -# you can kill it by simply typing + localuser@localhost: sudo netstat -lpn | grep :LOCAL_PORT + +This command shows the process ID (PID) of the process bound to ``LOCAL_PORT``. +Kill it with: + +.. code-block:: bash -localuser@localhost: kill ABCDEF + localuser@localhost: kill PID diff --git a/docs/installation.rst b/docs/installation.rst index 2694f6350..671b48236 100644 --- a/docs/installation.rst +++ b/docs/installation.rst @@ -9,51 +9,49 @@ Getting AbiPy Stable version -------------- -The version at the `Python Package Index `_ (PyPI) is always -the latest **stable** release that can be installed in user mode with:: +The version on the `Python Package Index `_ (PyPI) is always +the latest **stable** release. You can install it in user mode with:: pip install abipy --user -Note that you may need to install some optional dependencies manually. -In this case, please consult the detailed installation instructions provided in the -`pymatgen howto `_ to install these optional packages. +You may need to install some optional dependencies manually. +If so, follow the detailed installation instructions in the +`pymatgen howto `_. -The installation process is greatly simplified if you install the required +Installation is much simpler if you get the required packages through the Anaconda_ distribution. -We routinely use conda_ to test new developments with multiple Python versions and multiple virtual environments. -The anaconda distribution already provides the most critical dependencies (numpy_, scipy_, matplotlib_, netcdf4-python_) -in the form of pre-compiled packages that can be easily installed with e.g.:: +We routinely use conda_ to test new developments with multiple Python versions and virtual environments. +Anaconda already provides the most critical dependencies (numpy_, scipy_, matplotlib_, netcdf4-python_) +as pre-compiled packages that can be installed with, for example:: conda install numpy scipy netcdf4 -Additional information on the steps required to install AbiPy with anaconda -are available in the :ref:`anaconda_howto` howto as well as in the -`conda-based-install `_ +For more details on installing AbiPy with Anaconda, see the :ref:`anaconda_howto` section +and the `conda-based-install `_ section of the pymatgen_ documentation. We are also working with the spack_ community -to provide packages for AbiPy and Abinit in order to facilitate the installation on large supercomputing centers. +to provide AbiPy and Abinit packages that make installation easier on large supercomputing centers. -Advanced users who need to compile a local version of the python interpreter and install the AbiPy dependencies -manually can consult the :ref:`howto_compile_python_and_bootstrap_pip` document. +Advanced users who need to compile their own Python interpreter and install the AbiPy dependencies +manually can consult the :ref:`howto_compile_python_and_bootstrap_pip` section. --------------------- Optional dependencies --------------------- -Optional libraries that are required if you need certain features: +The following libraries are needed only for certain features: ipython_ - Required to interact with the AbiPy/Pymatgen objects in the ipython shell + Required to interact with AbiPy/pymatgen objects in the ipython shell (strongly recommended, already provided by conda_). jupyter_ and nbformat_ - Required to generate jupyter notebooks. - Install these two packages with ``conda install jupyter nbformat`` or use pip_. - To use ``jupyter`` you will also need a web browser to open the notebook. - (recommended) + Required to generate jupyter notebooks (recommended). + Install both packages with ``conda install jupyter nbformat`` or with pip_. + You will also need a web browser to open the notebooks. .. _anaconda_howto: @@ -61,41 +59,39 @@ jupyter_ and nbformat_ Anaconda Howto -------------- -Download the anaconda installer from the `official web-site `_. -by choosing the version that matches your OS. -You may want to use the ``wget`` utility to download the anaconda script directly from the terminal -(useful if you are installing anaconda on a cluster). +Download the Anaconda installer for your OS from the `official website `_. +If you are installing Anaconda on a cluster, you may find it convenient to download the installer +directly from the terminal with ``wget``. Run the bash script in the terminal and follow the instructions on screen. -By default, the installer creates the ``anaconda`` directory in your home. -Anaconda will add one line to your ``.bashrc`` to enable access to the anaconda executables. -Once the installation is completed, execute:: +By default, the installer creates an ``anaconda`` directory in your home +and adds a line to your ``.bashrc`` to make the Anaconda executables available. +Once the installation is complete, activate the ``base`` environment with:: source ~/anaconda/bin/activate base -to activate the ``base`` environment. -The output of ``which python`` should show that you are using the python interpreter provided by anaconda. +The output of ``which python`` should now show that you are using the Python interpreter provided by Anaconda. -Use the conda_ command-line interface to install the packages not included in the official distribution. +Use the conda_ command-line interface to install packages that are not included in the official distribution. For example, you can install ``pyyaml`` and ``netcdf4`` with:: conda install pyyaml netcdf4 -Remember that if a package is not available in the official conda repository, you can always -download the package from one of the conda channels or use ``pip install`` if no conda package is available. +If a package is not available in the official conda repository, you can +download it from one of the conda channels, or fall back to ``pip install`` if no conda package exists. -Fortunately there are conda channels providing all dependencies needed by AbiPy. -Now add ``conda-forge`` to your conda channels with:: +Fortunately, some conda channels provide all the dependencies needed by AbiPy. +Add ``conda-forge`` to your channels with:: conda config --add channels conda-forge -This is the channel from which we will download pymatgen, abipy and abinit. +This is the channel from which pymatgen, AbiPy and Abinit will be downloaded. Finally, install AbiPy with:: conda install abipy -Once you have completed the installation of AbiPy and pymatgen, open the ipython_ shell and type:: +To check the installation, open the ipython_ shell and type:: # make sure spglib library works import spglib @@ -105,12 +101,10 @@ Once you have completed the installation of AbiPy and pymatgen, open the ipython from abipy import abilab -to check the installation. - -Note that one can use conda_ to create different environments with different -versions of the python interpreter or different libraries. -Further information are available on the `conda official website `_. -Using different environments is very useful to keep different versions and branches separate. +conda_ can also create separate environments with different +versions of the Python interpreter or of other libraries. +This is very useful for keeping different versions and branches apart. +More information is available on the `official conda website `_. .. _developmental_version: @@ -119,53 +113,51 @@ Developmental version --------------------- Getting the developmental version of AbiPy is easy. -You can clone it from our `github repository `_ using:: +Clone it from our `GitHub repository `_ with:: git clone https://github.com/abinit/abipy -After cloning the repository, type:: +then, inside the repository, type:: python -m pip install . -or alternately:: +or, to install the package in development (editable) mode:: python -m pip install --editable . -to install the package in developmental mode -(Develop mode is the recommended approach if you are planning to implement new features. -In this case you may also opt to first fork AbiPy on Git and then clone your own fork. -This will allow you to push any changes to you own fork and also get them merged in the main branch). +Development mode is the recommended approach if you plan to implement new features. +In this case, you may prefer to fork AbiPy on GitHub first and then clone your fork, +so that you can push changes to your fork and later get them merged into the main branch. -The documentation of the **developmental** version is hosted on `github pages `_. +The documentation of the **developmental** version is hosted on `GitHub Pages `_. -The Github version include test files for complete unit testing. -To run the suite of unit tests, make sure you have pytest_ installed and issue:: +The GitHub version includes the test files needed for complete unit testing. +To run the test suite, make sure pytest_ is installed and run:: pytest in the AbiPy root directory. -Note that several unit tests check the integration between AbiPy and Abinit. -In order to run the tests, you need a working set of Abinit executables and +Several unit tests check the integration between AbiPy and Abinit. +To run them, you need a working set of Abinit executables and a ``manager.yml`` configuration file. -For further information on the syntax of the configuration file, please consult the :ref:`taskmanager` section. +For the syntax of the configuration file, see the :ref:`taskmanager` section. -A pre-compiled sequential version of Abinit for Linux and OSx can be installed directly from the abinit-channel_ with:: +A pre-compiled sequential version of Abinit for Linux and macOS can be installed from the abinit-channel_ with:: conda install abinit -c conda-forge -Examples of configuration files to configure and compile Abinit on clusters can be found +Examples of configuration files for compiling Abinit on clusters are available in the abiconfig_ package. -Contributing to AbiPy is relatively easy. -Just send us a `pull request `_. -When you send your request, make ``develop`` the destination branch on the repository -AbiPy uses the `Git Flow `_ branching model. -The ``develop`` branch contains the latest contributions, and ``master`` is always tagged and points +Contributing to AbiPy is easy: just send us a `pull request `_. +When you open the request, choose ``develop`` as the destination branch. +AbiPy uses the `Git Flow `_ branching model: +the ``develop`` branch contains the latest contributions, while ``master`` is always tagged and points to the latest stable release. -If you choose to share your developments please take some time to develop some unit tests of at least the -basic functionalities of your code +If you share your developments, please take the time to write unit tests that cover at least +the basic functionality of your code. .. _installing_without_internet_access: @@ -173,51 +165,55 @@ basic functionalities of your code Installing without internet access ---------------------------------- -Here, it is described how to set up a virtual environment with AbiPy on a cluster that cannot reach out to the internet. -One first creates a virtual environment with AbiPy on a cluster/computer with access, then ports the required files -to the cluster without access, and performs an offline installation. -We use Conda for the Python installation and pip for the packages, as the former reduces the odds that incompatibilities arise, -while the latter provides convenient syntax for offline package installation. +This section explains how to set up a virtual environment with AbiPy on a cluster that cannot access the internet. +The idea is to create a virtual environment with AbiPy on a machine with internet access, copy the required files +to the offline cluster, and then perform an offline installation there. +We use Conda for the Python installation, since it reduces the risk of incompatibilities, +and pip for the packages, since it offers a convenient syntax for offline installation. -One first needs Conda on the cluster with access. -If not available by default, follow the :ref:`instructions for installing Conda `. -Next, set up a conda virtual environment with a designated Python version, for example 3.12:: +First, you need Conda on the machine with internet access. +If it is not available by default, follow the :ref:`instructions for installing Conda `. +Then create a conda virtual environment with a given Python version, for example 3.12:: conda create --name abienv python=3.12 conda activate abienv -We then install AbiPy in this virtual environment, followed by creating requirements.txt, and creating -a folder packages/ containing all the wheels (.whl format):: +Install AbiPy in this environment, write the list of installed packages to ``requirements.txt``, +and download all the wheels (``.whl`` files) into a ``packages/`` folder:: pip install abipy pip list --format=freeze > requirements.txt pip download -r requirements.txt -d packages/ -Next, the .txt file, the folder, and the miniconda installer must be forwarded to the cluster without internet access. -You may have to use a computer that has access to both locations with the scp command. -If the offline cluster does not have Conda preinstalled, the Miniconda executable must be ported so that -an offline Conda installation can be performed. -Thus, from a computer that can access both locations, execute:: +Next, copy ``requirements.txt``, the ``packages/`` folder and the Miniconda installer to the offline cluster. +You may need to use ``scp`` from a computer that can reach both machines. +The Miniconda installer is needed only if Conda is not already available on the offline cluster. +From a computer that can access both locations, run:: scp -r connected_cluster:/file/and/folder/location/* . wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh scp -r requirements.txt packages/ Miniconda3-latest-Linux-x86_64.sh disconnected_cluster:/desired/location/ -If conda is not available on the cluster that cannot access the internet, -follow the :ref:`Conda installation instructions ` once more. -Next, one can set up an **offline** virtual environment on the cluster without internet access:: +If Conda is not available on the offline cluster, +follow the :ref:`Conda installation instructions ` there as well. +Then create an **offline** virtual environment on the offline cluster:: conda create --name abienv --offline python=3.12 conda activate abienv -At this step, AbiPy might fail to install due to missing/incompatible packages. -Some of these issues may be solved by repeating the above steps (excluding the environment creation) -for packages that are listed as missing/incompatible during the installation procedure, by updating the requirements.txt and packages/ and trying to install again. -Upon reading:: +and install the packages from the local folder with:: + + pip install --no-index --find-links=packages/ -r requirements.txt + +At this step, the installation may fail because of missing or incompatible packages. +Some of these issues can be solved by repeating the steps above (except for the environment creation) +for the packages reported as missing or incompatible, updating ``requirements.txt`` and ``packages/``, +and trying again. +Once you see:: Successfully installed abipy-x.y.z -You can quickly test your installation by running ``python`` followed by ``import abipy``. +you can quickly test the installation by running ``python`` followed by ``import abipy``. .. _howto_compile_python_and_bootstrap_pip: @@ -230,28 +226,28 @@ Troubleshooting unknown locale: UTF-8 ^^^^^^^^^^^^^^^^^^^^^ -If python stops with the error message:: +If Python stops with the error message:: "ValueError: unknown locale: UTF-8" -add the following line to your ``.bashrc`` file inside your ``$HOME`` (``.profile`` if MacOSx):: +add the following line to the ``.bashrc`` file in your ``$HOME`` (``.profile`` on macOS):: export LC_ALL=C -reload the environment with ``source ~/.bashrc`` and rerun the code. +then reload the environment with ``source ~/.bashrc`` and run the code again. ^^^^^^^^^^^^^^^^^^^^ netcdf does not work ^^^^^^^^^^^^^^^^^^^^ -The version of hdf5 installed by conda may not be compatible with python netcdf. -Try the hdf5/netcdf4 libraries provided by conda forge:: +The version of hdf5 installed by conda may not be compatible with python-netcdf. +Try the hdf5/netcdf4 libraries provided by conda-forge:: conda uninstall hdf4 hdf5 conda config --add channels conda-forge conda install netcdf4 -These packages are known to work on MacOsX:: +These packages are known to work on macOS:: conda list hdf4 hdf4 4.2.12 0 conda-forge @@ -264,8 +260,8 @@ These packages are known to work on MacOsX:: UnicodeDecodeError ^^^^^^^^^^^^^^^^^^^ -Python2.7 raises an `UnicodeDecodeError: 'ascii' codec can't decode byte ...` -when trying to open files with abiopen. Add +If Python 2.7 raises `UnicodeDecodeError: 'ascii' codec can't decode byte ...` +when opening files with abiopen, add .. code-block:: python diff --git a/docs/postprocessing_howto.rst b/docs/postprocessing_howto.rst index 5a38a8cc8..a4dfa2d4f 100644 --- a/docs/postprocessing_howto.rst +++ b/docs/postprocessing_howto.rst @@ -4,7 +4,7 @@ Post-processing How-To *********************** -This is a list of FAQs about the usage of the AbiPy scripts. +This page collects frequently asked questions about the AbiPy scripts. Feel free to suggest new entries! .. contents:: @@ -14,9 +14,9 @@ Feel free to suggest new entries! Preliminary considerations --------------------------- -The AbiPy scripts detect the file type by looking at the file extension -so **don't change the file extension**. -Also, remember that it is possible to get the documentation by just adding +The AbiPy scripts detect the file type from the file extension, +so **do not change the file extension**. +Remember also that you can get the documentation of any script simply by adding the ``--help`` option to the command line. For example: @@ -24,13 +24,13 @@ For example: abistruct.py --help -gives the documentation and usage examples for the abistruct.py_ script while: +shows the documentation and usage examples for the abistruct.py_ script, while: .. code-block:: shell abistruct.py COMMAND --help -prints the documentation and the options supported by ``COMMAND`` +prints the documentation and the options supported by ``COMMAND``. Get information about a generic ``FILE`` @@ -40,14 +40,14 @@ Use:: abiopen.py FILE --print -to print information about a file inside the terminal or +to print information about a file in the terminal, or:: abiopen.py FILE --expose -to generate multiple matplotlib figures depending on FILE. +to generate a set of matplotlib figures that depend on the type of FILE. -Use ``--verbose`` or ``-v`` to increase verbosity level. -The option can be can be supplied multiple times e.g. ``-vv``. +Use ``--verbose`` or ``-v`` to increase the verbosity level. +The option can be given multiple times, e.g. ``-vv``. Get all file extensions supported by ``abiopen.py`` --------------------------------------------------- @@ -66,47 +66,47 @@ Use:: abistruct.py convert FILE -to read the structure from ``FILE`` and generate a CIF_ file (default behaviour). +to read the structure from ``FILE`` and generate a CIF_ file (the default behaviour). -The majority of the netcdf_ files produced by Abinit contain structural information -so this command can be used with netcdf output files as well as Abinit input/output -files and all the other formats supported by pymatgen e.g. POSCAR files. -Other formats can be specified with the ``-f`` option. +Most of the netcdf_ files produced by Abinit contain structural information, +so this command works with netcdf output files as well as with Abinit input/output +files and all the other formats supported by pymatgen, e.g. POSCAR files. +Other output formats can be selected with the ``-f`` option. For example:: abistruct.py convert FILE -f abivars -gives the Abinit input variables while:: +prints the Abinit input variables, while:: abistruct.py convert FILE -f xsf > out.xsf -exports the structure to the ``xsf`` format (xcrysden_) and save it to file. +exports the structure in the ``xsf`` format (xcrysden_) and saves it to a file. Use:: abistruct.py convert --help -to list the formats supported. +to list the supported formats. Check if my Abinit input file is OK ----------------------------------- -First of all, one can use:: +First of all, use:: abiopen.py ../abipy/data/refs/si_ebands/run.abi -p -to print the crystalline structure and find the space group with the spglib_ library. +to print the crystalline structure and determine the space group with the spglib_ library. -If the structure looks good, use the abinp.py_ script with the ``validate`` command as in:: +If the structure looks good, validate the input file with Abinit using the ``validate`` command of the abinp.py_ script:: abinp.py validate run.abi -to validate the input file with Abinit (requires ``manager.yml`` and, obviously, Abinit). +This requires a ``manager.yml`` file and, of course, Abinit. -The script provides other options to invoke Abinit -to get space group information, the list of k-points in the IBZ. +The script provides other commands that invoke Abinit +to get space group information, the list of k-points in the IBZ, the list of atomic perturbations for phonons or the list of autoparal configurations. -See ``abinp.py --help`` for further info. +See ``abinp.py --help`` for more information. Print the warnings in the log file ---------------------------------- @@ -135,73 +135,73 @@ to get:: num_errors: 0, num_warnings: 4, num_comments: 0, completed: True -A similar interface is also available via:: +A similar interface is also available with:: abiview.py log run.log -Get a quick look to a file +Get a quick look at a file -------------------------- -The abiview.py_ script is especially designed for this task. -The syntax is ``abiview.py COMMAND FILE`` where ``COMMAND`` is either -the Abinit file extension (without ``.nc``, if any) or the AbiPy object we want to visualize. +The abiview.py_ script is designed specifically for this task. +The syntax is ``abiview.py COMMAND FILE``, where ``COMMAND`` is either +the Abinit file extension (without ``.nc``, if any) or the AbiPy object to visualize. To get a quick look at the DDB file, use:: abiview.py ddb out_DDB -This command invokes anaddb to compute phonon bands and DOS from the DDB and produces matplotlib_ plots. +This command invokes anaddb to compute the phonon bands and DOS from the DDB and produces matplotlib_ plots. If ``FILE`` contains electronic band energies, use e.g.:: abiview.py ebands out_GSR.nc -to plot the KS eigenvalues (the same command works for other files such as ``WFK.nc``, ``DEN.nc`` etc. +to plot the KS eigenvalues (the same command works for other files such as ``WFK.nc``, ``DEN.nc``, etc.). -Note that abiview.py_ uses a predefined logic to visualize the data. -There are options to tune some parameters and/or export data in different formats -but exposing the AbiPy API from the command line is not easy. +Note that abiview.py_ visualizes the data according to a predefined logic. +Some options let you tune parameters or export the data in different formats, +but exposing the full AbiPy API from the command line is not practical. -For a more flexible interface, we suggest to use:: +For a more flexible interface, use:: abiopen.py FILE -to start an ipython_ shell that will allow you to interact with the python object directly. +to start an ipython_ shell in which you can interact with the Python object directly. -If you have installed jupyter_ on your machine/cluster and you have a web browser, use:: +If jupyter_ is installed on your machine/cluster and you have a web browser, use:: abiopen.py FILE -nb -to generate automatically a predefined jupyter notebook associated to the file type. +to automatically generate a predefined jupyter notebook for that file type. Visualize a structure --------------------- -The visualization of the structure is delegated to external graphical applications +Structure visualization is delegated to external graphical applications that must be installed on your machine. -AbiPy will extract the structure from ``FILE``, convert it to one of the formats -supported by the graphical application and finally invoke the executable. -If you have vesta_ installed in one of the standard -locations of your machine, you can simply execute:: +AbiPy extracts the structure from ``FILE``, converts it to one of the formats +supported by the graphical application and then invokes the executable. +If vesta_ is installed in one of the standard +locations on your machine, simply run:: abistruct.py visualize FILE -inside the terminal. -Other applications can be specified with the ``--application`` option. +in the terminal. +Other applications can be selected with the ``--application`` option. At present, AbiPy supports vesta_, ovito_, xcrysden_, avogadro_, and v_sim_. -To visualize the crystalline structure inside the jupyter_ notebook, you may want to +To visualize the crystalline structure inside a jupyter_ notebook, you may want to try the nbjsmol_ jupyter extension. Get a high-symmetry kpath for a given structure ----------------------------------------------- -Use the `kpath` command and pass a FILE providing structural info:: +Use the `kpath` command with a FILE that provides structural information:: abistruct.py kpath FILE -to generate a template with the input variables defining the k-path +to generate a template with the input variables that define the k-path: .. code-block:: shell @@ -238,28 +238,28 @@ to generate a template with the input variables defining the k-path +0.50000 +0.00000 +0.50000 # X -Re-symmetrize a structure when Abinit reports less symmetries than expected ---------------------------------------------------------------------------- +Re-symmetrize a structure when Abinit reports fewer symmetries than expected +---------------------------------------------------------------------------- Crystalline structures saved in text format (e.g. CIF files downloaded from -the Materials Project websites) may not have enough significant digits -and Abinit may not find the same spacegroup as the one reported by the source -as the default tolerance for symmetry detection in Abinit is tight (tolsym = 1e-8). +the Materials Project website) may not have enough significant digits. +Since the default tolerance for symmetry detection in Abinit is tight (tolsym = 1e-8), +Abinit may then find a different space group from the one reported by the source. -In this case, one can use the `abispg` option of abistruct.py to compute the spacegroup -with Abinit and a tolerance larger that the default value:: +In this case, use the `abispg` command of abistruct.py to compute the space group +with Abinit using a tolerance larger than the default value:: abistruct.py abispg problematic.cif --tolsym=1e-6 -Hopefully, the code will detect the correct spacegroup, will re-symmetrize -the initial lattice vectors and atomic positions and print the new symmetrized structure to terminal. +Hopefully, the code will detect the correct space group, re-symmetrize +the initial lattice vectors and atomic positions, and print the new symmetrized structure to the terminal. Get neighbors for each atom in the unit cell out to a distance radius --------------------------------------------------------------------- -If we are interested in the environment/nearest neighbours of the atoms in the unit cell, -we can analyze the different coordinations with:: +To analyze the environment (nearest neighbours) of the atoms in the unit cell +and their coordination, use:: abistruct.py neighbors sic_relax_HIST.nc @@ -287,11 +287,11 @@ Use:: abistruct.py mp_search LiF -to search on the `materials project`_ database for structures corresponding to a -chemical system or formula e.g. ``Fe2O3`` or ``Li-Fe-O`` or +to search the `materials project`_ database for structures matching a +chemical system or formula, e.g. ``Fe2O3``, ``Li-Fe-O``, or ``Ir-O-*`` for wildcard pattern matching. -The script prints the results to terminal in tabular form: +The script prints the results to the terminal in tabular form: .. code-block:: bash @@ -311,31 +311,31 @@ The script prints the results to terminal in tabular form: .. important:: - The script will try to connect to the materials project server. - You need a ``~/.pmgrc.yaml`` configuration file inside your home directory - with the authentication token **PMG_MAPI_KEY**. - For further info please refer to the + The script connects to the Materials Project server, + so you need a ``~/.pmgrc.yaml`` configuration file in your home directory + containing the authentication token **PMG_MAPI_KEY**. + For more information, see the `pymatgen documentation `_ The script provides other commands to get (experimental) structures from the COD_ database, -find matching structures on the `materials project`_ website and generate phase diagrams. +find matching structures on the `materials project`_ website, and generate phase diagrams. See ``abistruct.py --help`` for more examples. Compare my structure with the Materials Project database -------------------------------------------------------- -Let's assume we have performed a structural relaxation and we want -to compare our results with the Materials Project data. -One can use the abicomp.py_ structure to extract the structure from the HIST.nc_ -file and compare the data with the database:: +Suppose you have performed a structural relaxation and want +to compare your results with the Materials Project data. +Use the abicomp.py_ script to extract the structure from the HIST.nc_ +file and compare it with the database:: abicomp.py mp_structure ../abipy/data/refs/sic_relax_HIST.nc -It's also possible to select only the structures with the same space group number as the input structure with:: +To select only the structures with the same space group number as the input structure, use:: abicomp.py mp_structure ../abipy/data/refs/sic_relax_HIST.nc --same-spgnum -that produces +which produces: .. code-block:: ipython @@ -350,13 +350,13 @@ that produces Use --verbose to print atomic positions. -Note that one can replace the HIST.nc_ file with any other file providing a structure object. +The HIST.nc_ file can be replaced by any other file that provides a structure object. .. important:: - The structures of the materials project have been obtained with the GGA-PBE functional - and they might include the U term in the Hamiltonian. - One should take into account these different settings when comparing structural relaxations. + The Materials Project structures have been obtained with the GGA-PBE functional + and may include a U term in the Hamiltonian. + Take these settings into account when comparing structural relaxations. Visualize the iterations of the SCF cycle @@ -366,10 +366,10 @@ Use:: abiview.py abo run.abo -to plot the SCF iterations or the steps of the structural relaxations or the DFPT SCF cycles -(depending on the content of run.abo). +to plot the SCF iterations, the steps of a structural relaxation or the DFPT SCF cycles, +depending on the content of run.abo. -Note that one can also use:: +You can also use:: abiview.py log run.log @@ -386,7 +386,7 @@ For electrons, use:: and:: - abiview.py phbands out_PHBST.nc -xmgrace + abiview.py phbands out_PHBST.nc --xmgrace for phonons. @@ -397,13 +397,14 @@ Use:: abiview.py ebands out_GSR.nc --bxsf -to export a set of band energies in BXSF format -suitable for the visualization of the Fermi surface with xcrysden_. +to export the band energies in BXSF format, +which is suitable for visualizing the Fermi surface with xcrysden_. Then use:: xcrysden --bxsf BXSF_FILE -to visualize the Fermi surface with xcrysden_ +to visualize the Fermi surface. +The same file can be produced from Python with: .. code-block:: ipython @@ -411,55 +412,55 @@ to visualize the Fermi surface with xcrysden_ .. important:: - This option requires k-points in the irreducible wedge and a gamma-centered k-mesh. + This option requires k-points in the irreducible wedge and a Gamma-centered k-mesh. Visualize phonon displacements ------------------------------ -AbiPy is interfaced with the phononwebsite_ project -If you have already installed the python package from `github `_ -it's possbile to export the ``PHBST.nc`` to JSON and then load the file via the web-interface. -Alternatively, it's possible to automate the entire procedure with the abiview.py_ script. +AbiPy is interfaced with the phononwebsite_ project. +If you have installed the Python package from `GitHub `_, +you can export the ``PHBST.nc`` file to JSON and then load it in the web interface. +Alternatively, the entire procedure can be automated with the abiview.py_ script. Use:: abiview.py phbands out_PHBST.nc -web -to start a local web server and open the HTML page inside the default browser -(the browser can be changed with the ``--browser`` option). +to start a local web server and open the HTML page in the default browser +(use the ``--browser`` option to select a different browser). -It is also possible to visualize the phonon modes starting directly from a DDB_ file with:: +You can also visualize the phonon modes directly from a DDB_ file with:: - abiview.py ddb -web + abiview.py ddb out_DDB -web -In this case, AbiPy will invoke anaddb to produce the ``PHBST.nc`` file on an automatically -generated q-path and then start the web server. +In this case, AbiPy invokes anaddb to produce the ``PHBST.nc`` file along an automatically +generated q-path and then starts the web server. Visualize the results of a structural relaxation ------------------------------------------------ The quickest way is to use:: - abiview hist out_HIST.nc + abiview.py hist out_HIST.nc -to plot the results with matplotlib or:: +to plot the results with matplotlib, or:: abiopen.py out_HIST.nc -p -to print the most important results to terminal. +to print the most important results to the terminal. -Note that it's possible to generate a ``XDATCAR`` file with:: +You can also generate an ``XDATCAR`` file with:: - abiview hist out_HIST.nc --xdatcar + abiview.py hist out_HIST.nc --xdatcar -and visualize the crystalline structure with ovito_:: +and visualize the evolution of the crystalline structure with ovito_:: - abiview hist out_HIST.nc -appname=ovito + abiview.py hist out_HIST.nc --appname=ovito .. important:: - The XDATCAR format assumes a fixed unit cell so you won't be able - to visualize the modifications of the unit cell lattice vectors in ovito. + The XDATCAR format assumes a fixed unit cell, so changes in the + lattice vectors will not be visible in ovito. Plot results stored in a text file in tabular format @@ -469,63 +470,63 @@ Use:: abiview.py data FILE_WITH_COLUMNS -to plot with matplotlib_ all the columns given in the file. -By default, the first column is assumed to contain the values for the x-axis -but it is possible to change this behaviour and use the row index with the `--use-index` option. -Multiple datasets i.e. multiple sets of data separated by blank lines are supported. +to plot all the columns in the file with matplotlib_. +By default, the first column is used for the x-axis; +use the `--use-index` option to use the row index instead. +Multiple datasets, i.e. blocks of data separated by blank lines, are supported. -To compare multiple files use:: +To compare multiple files, use:: abicomp.py data FILE1 FILE2 -Obviously one can use standard tools such as gnuplot_ and xmgrace_ but -the AbiPy scripts are quite handy for a quick analysis of the results. +Standard tools such as gnuplot_ and xmgrace_ work as well, of course, but +the AbiPy scripts are handy for a quick analysis of the results. Compare multiple files ---------------------- -The abicomp.py_ script is explicitly designed for this kind of task. -It operates on multiple files (usually files with the same extension) and -either produces matplotlib_ plots or creates AbiPy robots providing methods +The abicomp.py_ script is designed specifically for this task. +It operates on multiple files (usually with the same extension) and +either produces matplotlib_ plots or creates AbiPy robots with methods to analyze the results, perform convergence studies and build pandas DataFrames_. -The ``COMMAND`` defines the quantity to be compared, followed by a list of filenames. +The ``COMMAND`` argument specifies the quantity to compare and is followed by a list of filenames. -To compare e.g. the structure given in one Abinit input file with the structure -coming from a GSR.nc_ file, use:: +For example, to compare the structure in an Abinit input file with the structure +stored in a GSR.nc_ file, use:: abicomp.py structure run.abi out_GSR.nc .. note:: - In this example, we can use files of different type because they - both have a Structure object. This philosophy can be applied to other commands as well: - everything works as long as AbiPy is able to extract the quantity of interest from the file. + In this example, we can mix files of different types because + both provide a Structure object. The same philosophy applies to other commands as well: + everything works as long as AbiPy can extract the quantity of interest from the file. To plot multiple electronic structures on a grid, use:: abicomp.py ebands *_GSR.nc out2_WFK.nc -p -Remember that it is possible to use the shell syntax ``*_GSR.nc`` to select all files with a given extension. -If you have nested directories, use unix ``find`` to scan the directory tree for files matching a given pattern +Remember that you can use the shell syntax ``*_GSR.nc`` to select all files with a given extension. +For nested directories, use the Unix ``find`` command to scan the directory tree for files matching a pattern. For example:: abicomp.py ebands `find . -name *_GSR.nc` -finds all ``GSR.nc`` files contained withing the current working directory. -The output of ``find`` is then passed to the abicomp.py_ script. +finds all the ``GSR.nc`` files in the current working directory and its subdirectories, +and passes them to the abicomp.py_ script. .. note:: - Note the `backticks syntax `_ + Note the `backtick syntax `_ used in the command. Profile the scripts ------------------- -All AbiPy script can be executed in profile mode by just prepending the ``prof`` keyword -to the command line arguments. -This option could be useful if the script seems to be slow and you need to understand what's happening. +All AbiPy scripts can be run in profile mode by prepending the ``prof`` keyword +to the command-line arguments. +This is useful if a script seems slow and you want to understand why. Use:: @@ -548,17 +549,17 @@ Use:: to print the official documentation for the ``ecut`` variable to the terminal. -To list all the variables depending on the ``natom`` dimension, use:: +To list all the variables that depend on the ``natom`` dimension, use:: abidoc.py withdim natom -More options are available. See ``abidoc.py --help``. +More options are available; see ``abidoc.py --help``. -Avoid transfering files from the cluster to localhost just to use matplotlib ----------------------------------------------------------------------------- +Avoid transferring files from the cluster to localhost just to use matplotlib +----------------------------------------------------------------------------- Use `SSHFS `_ to mount the remote file system over SSH. -Now one can execute the AbiPy scripts in a terminal running on the local machine. -to open/visualize the files stored on the cluster. +You can then run the AbiPy scripts in a terminal on your local machine +to open and visualize the files stored on the cluster. diff --git a/docs/scripts/abicheck.rst b/docs/scripts/abicheck.rst index 69771f6bb..687a88ad8 100644 --- a/docs/scripts/abicheck.rst +++ b/docs/scripts/abicheck.rst @@ -4,16 +4,16 @@ ``abicheck.py`` ^^^^^^^^^^^^^^^ -This script checks that the options specified in ``manager.yml``, ``scheduler.yml``, -and the environment on the local machine are properly configured. -Please consult the documentation on the :ref:`taskmanager` for a more detailed description of these YAML_ files. +This script checks that the options in ``manager.yml`` and ``scheduler.yml``, +as well as the environment on the local machine, are properly configured. +See the :ref:`taskmanager` documentation for a detailed description of these YAML_ files. .. command-output:: abicheck.py --no-colors -The command ``abicheck.py --with-flow`` can be used to run a small AbiPy flow in order to +Use ``abicheck.py --with-flow`` to run a small AbiPy flow and check the interface with the Abinit executables. -Complete command line reference +Complete command line reference: .. argparse:: :ref: abipy.scripts.abicheck.get_parser diff --git a/docs/scripts/abicomp.rst b/docs/scripts/abicomp.rst index 218a79158..b0fb670d9 100644 --- a/docs/scripts/abicomp.rst +++ b/docs/scripts/abicomp.rst @@ -4,28 +4,28 @@ ``abicomp.py`` ^^^^^^^^^^^^^^ -This script compares output results stored in multiple netcdf_ files. -For example, one can compare the crystalline structure used in different calculations -or compare the electronic bands stored in two or more netcdf_ files (e.g. GSR.nc_ or ``WFK.nc``). +This script compares the results stored in multiple netcdf_ files. +For example, you can compare the crystalline structures used in different calculations +or the electronic bands stored in two or more netcdf_ files (e.g. GSR.nc_ or ``WFK.nc``). -Depending on COMMAND, ``abicomp`` either starts an ``ipython`` session so that the user can interact -with the ``robot`` or print the results to screen. +Depending on COMMAND, ``abicomp`` either starts an ``ipython`` session in which you can interact +with the ``robot``, or prints the results to the screen. For instance, the command:: abicomp.py structure out1_GSR.nc out2_GSR.nc -compares the crystalline structures reported in two ``GSR.nc`` files and print the result to screen while:: +compares the crystalline structures stored in two ``GSR.nc`` files and prints the result to the screen, while:: abicomp.py gsr out*_GSR.nc starts an ipython session. -Use the ``-p`` option if you just want to get information on the file without opening it, e.g.:: +Use the ``-p`` option if you just want to print information about the files without opening an ipython session, e.g.:: abicomp.py gsr out1_GSR.nc out2_GSR.nc -p -It is possible to generate automatically a jupyter_ notebook with the ``-nb`` option e.g.:: +The ``-nb`` option automatically generates a jupyter_ notebook, e.g.:: abicomp.py gsr out1_GSR.nc out2_GSR.nc -nb @@ -33,11 +33,11 @@ Finally, use ``-e`` (``--expose``) to generate matplotlib plots automatically:: abicomp.py gsr out1_GSR.nc out2_GSR.nc -e -sns=poster -seaborn_ plot style and settings can be changed from the command line interface with the `-sns` option +The seaborn_ plot style and settings can be changed from the command line with the `-sns` option. .. command-output:: abicomp.py --help -Complete command line reference +Complete command line reference: .. argparse:: :ref: abipy.scripts.abicomp.get_parser diff --git a/docs/scripts/abidoc.rst b/docs/scripts/abidoc.rst index a193bf968..6b0f906a2 100644 --- a/docs/scripts/abidoc.rst +++ b/docs/scripts/abidoc.rst @@ -5,15 +5,15 @@ ^^^^^^^^^^^^^ This script provides a command line interface to the Abinit documentation. -For example, the documentation for the ``ecut`` input variable can be obtained with:: +For example, to get the documentation of the ``ecut`` input variable, use:: abidoc.py man ecut -For the full list of commands use: +For the full list of commands, use: .. command-output:: abidoc.py --help -Complete command line reference +Complete command line reference: .. argparse:: :ref: abipy.scripts.abidoc.get_parser diff --git a/docs/scripts/abinp.rst b/docs/scripts/abinp.rst index f22944884..05b9f778e 100644 --- a/docs/scripts/abinp.rst +++ b/docs/scripts/abinp.rst @@ -4,14 +4,14 @@ ``abinp.py`` ^^^^^^^^^^^^ -This script provides a simplified interface to the AbiPy API for constructing input files. -It is a useful tool especially for newcomers who are not familiar with the programmatic interface -for building workflows. -In this case, indeed, one can use ``abinp.py`` to generate automatically input files from -file providing the crystalline structure of the system and then customize the generated output. +This script provides a simplified interface to the AbiPy API for building input files. +It is especially useful for newcomers who are not yet familiar with the programmatic interface +for building workflows: +``abinp.py`` can automatically generate input files from any +file that provides the crystalline structure of the system, and the generated output can then be customized. -There are also commands operating on input files directly. -These options could be useful to get data directly from Abinit. +Other commands operate directly on existing input files +and can be used to get data directly from Abinit. .. argparse:: :ref: abipy.scripts.abinp.get_parser diff --git a/docs/scripts/abiopen.rst b/docs/scripts/abiopen.rst index 2340fcf02..444729911 100644 --- a/docs/scripts/abiopen.rst +++ b/docs/scripts/abiopen.rst @@ -4,50 +4,50 @@ ``abiopen.py`` ^^^^^^^^^^^^^^ -AbiPy provides python objects associated to several Abinit output files. +AbiPy provides Python objects associated with several Abinit output files. These objects implement methods to analyze and plot the results. The examples in our :ref:`plot-gallery` use this API to plot data with matplotlib_. -The ``abiopen.py`` script provides a handy interface to the AbiPy objects. -It can be used to open Abinit files directly in the ipython_ shell or inside a jupyter_ -notebook and interact with the associated object (called ``abifile`` in the ``ipython`` terminal). +The ``abiopen.py`` script provides a handy interface to these objects. +It opens Abinit files directly in the ipython_ shell or in a jupyter_ +notebook, where you can interact with the associated object (called ``abifile`` in the ``ipython`` terminal). The syntax of the script is:: abiopen.py FILE [options] -where ``FILE`` is one of the files supported by AbiPy (usually in netcdf_ format but other -files are supported as well e.g. Abinit input and output files in text format). -By default ``abiopen`` starts an ``ipython`` session and the user can interact with the ``abifile`` +where ``FILE`` is one of the files supported by AbiPy (usually in netcdf_ format, although other +files are supported as well, e.g. Abinit input and output files in text format). +By default, ``abiopen`` starts an ``ipython`` session in which you can interact with the ``abifile`` and invoke its methods. -Alternatively, it is possible to generate automatically a jupyter_ notebook with the ``-nb`` option e.g.:: +Alternatively, the ``-nb`` option automatically generates a jupyter_ notebook. For example:: abiopen.py out_FATBANDS.nc -nb -will produce a notebook to visualize the electronic fatbands inside your default web browser. +produces a notebook to visualize the electronic fatbands in your default web browser. -Use the ``-p`` option if you just want to get information on the file without opening it, e.g.:: +Use the ``-p`` option if you just want to print information about the file without opening an ipython session, e.g.:: abiopen.py out_GSR.nc -p -or the ``-e`` (``--expose``) to generate matplotlib plots automatically:: +or the ``-e`` (``--expose``) option to generate matplotlib plots automatically:: abiopen.py out_GSR.nc -e -sns=talk -seaborn_ plot style and settings can be changed from the command line interface with the `-sns` option +The seaborn_ plot style and settings can be changed from the command line with the `-sns` option. -The script uses the file extension to decide what to do with the file and the type -of python object that should be instantiated. -The list of supported file extensions is obtained with: +The script uses the file extension to decide what to do with the file and which +Python object to instantiate. +To get the list of supported file extensions, use: .. command-output:: abiopen.py --help .. WARNING:: AbiPy uses the ``.abi`` extension for Abinit input files, ``.abo`` for output files and ``.log`` for log files. - Please follow this convention to facilitate the integration with AbiPy. + Please follow this convention to ease the integration with AbiPy. -Complete command line reference +Complete command line reference: .. argparse:: :ref: abipy.scripts.abiopen.get_parser diff --git a/docs/scripts/abips.rst b/docs/scripts/abips.rst index 3c6b25e00..8db453619 100644 --- a/docs/scripts/abips.rst +++ b/docs/scripts/abips.rst @@ -4,7 +4,7 @@ ``abips.py`` ^^^^^^^^^^^^ -Script to download and install pseudopotential tables from the web. +This script downloads and installs pseudopotential tables from the web. .. argparse:: :ref: abipy.scripts.abips.get_parser diff --git a/docs/scripts/abirun.rst b/docs/scripts/abirun.rst index 75fafca92..cae3fb020 100644 --- a/docs/scripts/abirun.rst +++ b/docs/scripts/abirun.rst @@ -4,8 +4,8 @@ ``abirun.py`` ^^^^^^^^^^^^^ -This script allows the user to submit the calculations contained in the AbiPy Flow -(for further detail, consult the :ref:`taskmanager` documentation). +This script submits the calculations contained in an AbiPy Flow +(for more details, see the :ref:`taskmanager` documentation). .. command-output:: abirun.py --help @@ -23,11 +23,11 @@ At the time of writing (|today|), AbiPy supports the following resource managers * sge_ * torque_ -To obtain the list of options supported by a particular resource manager e.g. ``slurm``:: +To get the list of options supported by a particular resource manager, e.g. ``slurm``, use:: abirun.py . doc_manager slurm -Complete command line reference +Complete command line reference: .. argparse:: :ref: abipy.scripts.abirun.get_parser diff --git a/docs/scripts/abistruct.rst b/docs/scripts/abistruct.rst index cbce92c30..dccaba9c7 100644 --- a/docs/scripts/abistruct.rst +++ b/docs/scripts/abistruct.rst @@ -4,55 +4,55 @@ ``abistruct.py`` ^^^^^^^^^^^^^^^^ -This script reads a |Structure| object from file and performs predefined operations -depending on the ``COMMAND`` and the ``options`` specified on the command line. -The syntax of the command is:: +This script reads a |Structure| object from a file and performs predefined operations +depending on the ``COMMAND`` and ``options`` given on the command line. +The syntax is:: abistruct.py COMMAND FILE [options] -where ``FILE`` is any file from which AbiPy can extract a Structure object (this includes -the majority of the nectdf output files, Abinit input and output files in text format -as well as other formats supported by pymatgen_ e.g. CIF_ files, POSCAR_ etc. +where ``FILE`` is any file from which AbiPy can extract a Structure object. This includes +most of the netcdf output files, Abinit input and output files in text format, +and the other formats supported by pymatgen_, e.g. CIF_ files, POSCAR_, etc. -The documentation for a given ``COMMAND`` is accessible with:: +The documentation of a given ``COMMAND`` is available with:: - abistruct.py command --help + abistruct.py COMMAND --help -Use e.g.:: +For example:: $ abistruct.py spglib --help -to get the list of options supported by the spglib_ COMMAND. +lists the options supported by the spglib_ command. -The ``convert`` command is quite useful if you need to convert the crystalline structure -from one format to another one. -For example, one can read a CIF_ file and print the corresponding Abinit variables with:: +The ``convert`` command is useful for converting the crystalline structure +from one format to another. +For example, to read a CIF_ file and print the corresponding Abinit variables, use:: $ abistruct.py convert si.cif .. note:: - The script can fetch data from the materials project database and - the COD_ database http://www.crystallography.net/cod`_ - To access the materials project database, please register on - to get your personal access token. - Then create a `.pymrc.yaml` configuration file inside your $HOME and add your token with the line:: + The script can fetch data from the Materials Project database and + the COD_ database. + To access the Materials Project database, register on + https://www.materialsproject.org to get your personal access token. + Then create a `.pmgrc.yaml` configuration file in your $HOME and add your token with the line:: PMG_MAPI_KEY: your_token_goes_here -It is possible to analyze the structure object either a jupyter_ notebook with e.g.:: +You can analyze the structure object either in a jupyter_ notebook, e.g.:: - abistruct.py jupter si.cif + abistruct.py notebook si.cif -or directly inside the ipython_ shell with:: +or directly in the ipython_ shell with:: - abistruct.py notebook si.cif + abistruct.py ipython si.cif -Several other options are available. To get the full list, use +Several other commands are available. To get the full list, use: .. command-output:: abistruct.py --help -Complete command line reference +Complete command line reference: .. argparse:: :ref: abipy.scripts.abistruct.get_parser diff --git a/docs/scripts/abiview.rst b/docs/scripts/abiview.rst index 3a185e753..c286f1393 100644 --- a/docs/scripts/abiview.rst +++ b/docs/scripts/abiview.rst @@ -4,10 +4,10 @@ ``abiview.py`` ^^^^^^^^^^^^^^ -This script visualizes provides a simplified interface to the AbiPy post-processing tools -It can also visualize data (structures, densities) with external graphical applications. +This script provides a simplified interface to the AbiPy post-processing tools. +It can also visualize data (structures, densities) with external graphical applications. -Complete command line reference +Complete command line reference: .. argparse:: :ref: abipy.scripts.abiview.get_parser diff --git a/docs/scripts/index.rst b/docs/scripts/index.rst index 00650a455..e46b3848a 100644 --- a/docs/scripts/index.rst +++ b/docs/scripts/index.rst @@ -6,25 +6,25 @@ Scripts ======= -This page documents the usage of the AbiPy scripts, -the subcommands available and the options supported by each subcommand. +This page documents the AbiPy scripts, +their subcommands and the options supported by each subcommand. -To analyze the cystalline structure stored in FILE, use ``abistruct.py``. +To analyze the crystalline structure stored in FILE, use ``abistruct.py``. To operate on a **single** FILE, use ``abiopen.py``. -To compare **multiple** FILES of the same type, use the ``abicomp.py`` script. -If the analysis requires the execution of additional logic -(e.g. the computation of phonons with anaddb from the DDB file), use ``abiview.py``. -To generate a minimalist input file for Abinit, use ``abinp.py``. +To compare **multiple** FILES of the same type, use ``abicomp.py``. +If the analysis requires additional steps +(e.g. computing phonons with anaddb from a DDB file), use ``abiview.py``. +To generate a minimal Abinit input file, use ``abinp.py``. For a command line interface to the Abinit documentation, use ``abidoc.py``. -Finally, use ``abicheck.py`` to validate your AbiPy + Abinit installation **before running** AbiPy flows -and use ``abirun.py`` to launch Abinit calculations. +Finally, use ``abicheck.py`` to validate your AbiPy + Abinit installation **before running** AbiPy flows, +and ``abirun.py`` to launch Abinit calculations. .. important:: - Each script provides a ``--help`` option that documents all the commands available - and provides a list of typical examples. - To list of the options supported by **COMMAND** use e.g. `abicomp.py COMMAND --help`. + Each script provides a ``--help`` option that documents all the available commands + and gives a list of typical examples. + To list the options supported by a **COMMAND**, use e.g. `abicomp.py COMMAND --help`. .. toctree:: diff --git a/docs/scripts/oncv.rst b/docs/scripts/oncv.rst index 04b7eff85..50f7ee5da 100644 --- a/docs/scripts/oncv.rst +++ b/docs/scripts/oncv.rst @@ -4,8 +4,8 @@ ``oncv.py`` ^^^^^^^^^^^ -Script to generate/analyze/plot ONCVPSP pseudopotentials. +This script generates, analyzes and plots ONCVPSP pseudopotentials. .. argparse:: :ref: abipy.scripts.oncv.get_parser - :prog: abips.py + :prog: oncv.py diff --git a/docs/workflows/taskmanager.rst b/docs/workflows/taskmanager.rst index 23d2ef1a8..f32d66a06 100644 --- a/docs/workflows/taskmanager.rst +++ b/docs/workflows/taskmanager.rst @@ -8,24 +8,24 @@ TaskManager ^^^^^^^^^^^ Besides post-processing tools and a programmatic interface to generate input files, -AbiPy also provides a pythonic API to execute small Abinit tasks directly or submit calculations on supercomputing clusters. -This section discusses how to create the configuration files required to interface AbiPy with Abinit. +AbiPy provides a Pythonic API to run small Abinit tasks directly or to submit calculations on supercomputing clusters. +This section explains how to create the configuration files needed to interface AbiPy with Abinit. We assume that Abinit is already available on your machine and that you know how to configure -your environment so that the operating system can load and execute Abinit. -In other words, we assume that you know how to set the ``$PATH`` and ``$LD_LIBRARY_PATH`` (``$DYLD_LIBRARY_PATH`` on Mac) +your environment so that the operating system can find and execute Abinit. +In other words, we assume you know how to set the ``$PATH`` and ``$LD_LIBRARY_PATH`` (``$DYLD_LIBRARY_PATH`` on macOS) environment variables, load modules with ``module load``, run MPI applications with ``mpirun``, etc. .. IMPORTANT:: - Please make sure that you can execute Abinit interactively with simple input files and - that it works as expected before proceeding with the rest of the tutorial. - It's also a very good idea to run the Abinit test suite with the `runtests.py script `_ - before running production calculations. + Before proceeding with the rest of the tutorial, make sure that you can run Abinit interactively + with simple input files and that it works as expected. + It is also a very good idea to run the Abinit test suite with the `runtests.py script `_ + before starting production calculations. .. TIP:: - A pre-compiled sequential version of Abinit for Linux and OSx can be installed directly + A pre-compiled sequential version of Abinit for Linux and macOS can be installed directly from the conda-forge channel with:: conda install abinit -c conda-forge @@ -35,24 +35,24 @@ How to configure the TaskManager -------------------------------- The ``TaskManager`` takes care of task submission. -This includes the creation of the submission script, -the initialization of the environment as well as the optimization of the parallel algorithms -(number of MPI processes, number of OpenMP threads, automatic parallelization with Abinit ``autoparal`` feature). +This includes creating the submission script, +initializing the environment and optimizing the parallel execution +(number of MPI processes, number of OpenMP threads, automatic parallelization with the Abinit ``autoparal`` feature). -AbiPy obtains the information needed to create the correct ``TaskManager`` for a specific cluster (personal computer) +AbiPy reads the information needed to create the correct ``TaskManager`` for a specific cluster (or personal computer) from the ``manager.yml`` configuration file. -The file is written in YAML_ a human-readable data serialization language commonly used for configuration files -(a good introduction to the YAML syntax can be found `here `_. -See also this `reference card `_. -Experiment with YAML syntax using a `YAML validator `_) +This file is written in YAML_, a human-readable data serialization language commonly used for configuration files. +A good introduction to the YAML syntax is available `here `_; +see also this `reference card `_, +and experiment with the syntax using a `YAML validator `_. -By default, AbiPy looks for a ``manager.yml`` file in the current working directory i.e. -the directory in which you execute your script in first and then inside ``$HOME/.abinit/abipy``. +By default, AbiPy looks for a ``manager.yml`` file first in the current working directory, i.e. +the directory in which you run your script, and then in ``$HOME/.abinit/abipy``. If no file is found, the code aborts immediately. -An important piece of information for the ``TaskManager`` is the type of queueing system available on the cluster, +The ``TaskManager`` also needs to know the type of queueing system available on the cluster, the list of queues and their specifications. -In AbiPy queueing systems or resource managers are supported via ``quadapters``. +In AbiPy, queueing systems (resource managers) are supported via ``qadapters``. At the time of writing (|today|), AbiPy provides ``qadapters`` for the following resource managers: * ``shell`` @@ -65,17 +65,17 @@ At the time of writing (|today|), AbiPy provides ``qadapters`` for the following Manager configuration files for typical cases are available in ``~abipy/data/managers``. -We first discuss how to configure AbiPy on a personal computer and then we look at the more -complicated case in which the calculation must be submitted to a queue. +We first discuss how to configure AbiPy on a personal computer and then look at the more +complicated case in which calculations must be submitted to a queue. ----------------------------------- TaskManager for a personal computer ----------------------------------- -Let's start from the simplest case i.e. a personal computer in which we can execute +Let's start from the simplest case, i.e. a personal computer on which we can execute applications directly from the shell (``qtype: shell``). -In this case, the configuration file is relatively easy because we can run Abinit -directly without having to generate and submit a script to the resource manager. +Here the configuration file is relatively simple, because we can run Abinit +directly without generating a script and submitting it to a resource manager. In its simplest form, the ``manager.yml`` file consists of a list of ``qadapters``: .. code-block:: yaml @@ -84,31 +84,31 @@ In its simplest form, the ``manager.yml`` file consists of a list of ``qadapters - # qadapter_0 - # qadapter_1 -Each item in the ``qadapters`` list is essentially a YAML dictionary with the following sub-dictionaries: +Each item in the ``qadapters`` list is a YAML dictionary with the following sub-dictionaries: ``queue`` Dictionary with the name of the queue and optional parameters used to build and customize the header of the submission script. ``job`` - Dictionary with the options used to prepare the environment before submitting the job. + Dictionary with the options used to set up the environment before submitting the job. ``limits`` - Dictionary with the constraints that must be fulfilled in order to run with this ``qadapter``. + Dictionary with the constraints that must be satisfied to run with this ``qadapter``. ``hardware`` - Dictionary with information on the hardware available on this particular queue. - Used by Abinit ``autoparal`` to optimize parallel execution. + Dictionary with information on the hardware available on this queue. + It is used by the Abinit ``autoparal`` feature to optimize parallel execution. -The ``qadapter`` is therefore responsible for all interactions with a specific -queue management system (shell, Slurm, PBS, etc), including handling all details -of queue script format as well as queue submission and management. +The ``qadapter`` is therefore responsible for all the interactions with a specific +queue management system (shell, Slurm, PBS, etc.), including the format of the +submission script, job submission and job management. .. NOTE:: - Multiple ``qadapters`` are useful if you are running on a cluster with different queues - but we post-pone the discussion of this rather technical point. - For the time being, we use a ``manager.yml`` with a single adapter. + Multiple ``qadapters`` are useful on clusters with several queues, + but we postpone the discussion of this rather technical point. + For now, we use a ``manager.yml`` with a single adapter. A typical configuration file used on a laptop to run jobs via the shell is: @@ -136,50 +136,50 @@ A typical configuration file used on a laptop to run jobs via the shell is: cores_per_socket: 2 mem_per_node: 4 Gb -The ``job`` section is the most critical one, in particular the ``pre_run`` option -that will be executed by the shell script before invoking Abinit. -In this case Abinit is not installed by default (the executable is not already in the path). -The directory where the Abinit executables are located hence have to be prepended to the original ``$PATH`` variable. -Change ``pre_run`` according to your Abinit installation and make sure that ``mpirun`` is also in ``$PATH``. -If you don't use a parallel version of Abinit, just set ``mpi_runner: null`` -(``null`` is the YAML_ version of the Python ``None``). -Note this approach also allows you to safely use multiple versions. - -Copy this example and change the entries in the ``hardware`` and the ``limits`` section according to -your machine, in particular make sure that ``max_cores`` is not greater than the number of physical cores -available on your personal computer. +The ``job`` section is the most critical one, in particular the ``pre_run`` option, +which is executed by the shell script before invoking Abinit. +In this example, the Abinit executable is not in the default search path, +so the directory containing the Abinit executables must be prepended to ``$PATH``. +Adapt ``pre_run`` to your Abinit installation and make sure that ``mpirun`` is also in ``$PATH``. +If you do not use a parallel version of Abinit, simply set ``mpi_runner: null`` +(``null`` is the YAML_ equivalent of Python's ``None``). +This approach also lets you safely switch between multiple Abinit versions. + +Copy this example and adapt the ``hardware`` and ``limits`` sections to +your machine. In particular, make sure that ``max_cores`` does not exceed the number of physical cores +available on your computer. Save the file in the current working directory and run the abicheck.py_ script provided by AbiPy. -If everything is configured properly, you should see something like this in the terminal. +If everything is configured properly, you should see something like this in the terminal: .. command-output:: abicheck.py --no-colors This message tells us that everything is in place and we can finally run our first calculation. -.. note: +.. note:: - This laptop has 1 socket with 2 CPUs and 4 Gb of memory in total, hence we don't want to run - Abinit tasks with more than 2 CPUs. This is the reason why ``max_cores`` is set to 2. - The ``timelimit`` option is not used when you are using ``qname: shell``, but it becomes - important when you submit jobs on a cluster because this value is used to generate the submission script - and Abinit will use this value to exit from iterative algorithms e.g. the SCF cycle before the timeline - and produce files from which it can then restart. + This laptop has 1 socket with 2 CPUs and 4 Gb of memory in total, so we don't want to run + Abinit tasks with more than 2 CPUs. This is why ``max_cores`` is set to 2. + The ``timelimit`` option is ignored with ``qtype: shell``, but it becomes + important when submitting jobs on a cluster: the value is used to generate the submission script, + and Abinit uses it to exit from iterative algorithms (e.g. the SCF cycle) before the time limit is reached + and write files from which the calculation can be restarted. -The directory ``~abipy/data/runs`` contains python scripts to generate workflows for typical ab-initio calculations. -Here we focus on the configuration of the manager and the execution of the flow so we don't discuss how to -generate input files and create Flow objects in python. -This topic is covered in more detail in our collection of `jupyter notebooks -`_ +The directory ``~abipy/data/runs`` contains Python scripts that generate workflows for typical ab-initio calculations. +Here we focus on configuring the manager and executing the flow, so we don't discuss how to +generate input files and create Flow objects in Python. +This topic is covered in detail in our collection of `jupyter notebooks +`_. -Let's start from the simplest example i.e. the ``run_si_ebands.py`` script that generates +Let's start from the simplest example, the ``run_si_ebands.py`` script, which generates a flow to compute the band structure of silicon at the Kohn-Sham level: -GS calculation to get the density followed by a NSCF run along a k-path in the first Brillouin zone. +a GS calculation to get the density, followed by an NSCF run along a k-path in the first Brillouin zone. -Cd to ``~abipy/data/runs`` and execute ``run_si_ebands.py`` to generate the flow:: +Go to ``~abipy/data/runs`` and execute ``run_si_ebands.py`` to generate the flow:: cd ~abipy/data/runs ./run_si_ebands.py -At this point, you should have a directory ``flow_si_ebands`` with the following structure: +You should now have a ``flow_si_ebands`` directory with the following structure: .. code-block:: console @@ -211,10 +211,10 @@ At this point, you should have a directory ``flow_si_ebands`` with the following 15 directories, 7 files -``w0/`` is the directory containing the input files of the first workflow (well, we have only one workflow in our example). -``w0/t0/`` and ``w0/t1/`` contain the input files need to run the SCF and the NSC run, respectively. +``w0/`` contains the input files of the first workflow (the only one in this example). +``w0/t0/`` and ``w0/t1/`` contain the input files needed for the SCF and the NSCF run, respectively. -You might have noticed that each task directory (``w0/t0``, ``w0/t1``) presents the same structure: +Note that all the task directories (``w0/t0``, ``w0/t1``) have the same structure: * ``run.abi``: Abinit input file. * ``run.files``: Abinit files file. @@ -227,26 +227,26 @@ You might have noticed that each task directory (``w0/t0``, ``w0/t1``) presents ``__AbinitFlow__.pickle`` is the pickle file used to save the status of the `Flow`. Don't touch it! -The ``job.sh`` script has been generated by the ``TaskManager`` using the information provided by ``manager.yml``. -In this case it is a simple shell script that executes the code directly as we are using ``qtype: shell``. -The script will get more complicated when we start to submit jobs on a cluster with a resource manager. +The ``job.sh`` script has been generated by the ``TaskManager`` from the information in ``manager.yml``. +Since we are using ``qtype: shell``, it is a simple shell script that executes the code directly. +The script becomes more complex when jobs are submitted to a resource manager on a cluster. -We usually interact with the AbiPy flow via the :ref:`abirun.py` script whose syntax is:: +We usually interact with an AbiPy flow via the :ref:`abirun.py` script, whose syntax is:: abirun.py FLOWDIR command [options] -where ``FLOWDIR`` is the directory containing the flow and ``command`` defines the action to perform -(use ``abirun.py --help`` to get the list of possible commands and ``abirun.py COMMAND --help`` to document the +where ``FLOWDIR`` is the directory containing the flow and ``command`` is the action to perform. +Use ``abirun.py --help`` to get the list of available commands and ``abirun.py COMMAND --help`` to see the options supported by ``COMMAND``. -``abirun.py`` reconstructs the python Flow from the pickle file ``__AbinitFlow__.pickle`` located in ``FLOWDIR`` -and invokes the methods of the object depending on the options passed via the command line. +``abirun.py`` reconstructs the Python Flow from the ``__AbinitFlow__.pickle`` file in ``FLOWDIR`` +and calls the methods of the object according to the command-line options. Use:: abirun.py flow_si_ebands status -to get a summary with the status of the different tasks and:: +to get a summary of the status of the tasks, and:: abirun.py flow_si_ebands deps @@ -261,21 +261,21 @@ to print the dependencies of the tasks in textual format. .. TIP:: - Alternatively, one can use ``abirun.py flow_si_ebands networkx`` - to visualize the connections with the networkx_ package. + Alternatively, use ``abirun.py flow_si_ebands networkx`` + to visualize the dependencies with the networkx_ package. -In this case, we have a flow with one work (``w0``) that contains two tasks. -The second task (``w0/t1``) depends on first one that is a ``ScfTask``, -more specifically ``w0/t1`` depends on the density file produced by ``w0/t0``. -This means that ``w0/t1`` cannot be executed/submitted until we have completed the first task. -AbiPy is aware of this dependency and will use this information to manage the submission/execution -of our flow. +Here we have a flow with one work (``w0``) containing two tasks. +The second task (``w0/t1``) depends on the first one, a ``ScfTask``; +more specifically, ``w0/t1`` needs the density file produced by ``w0/t0``. +This means that ``w0/t1`` cannot be executed until the first task has completed. +AbiPy is aware of this dependency and uses it to manage the submission and execution +of the flow. -There are two commands that can be used to launch tasks: ``single`` and ``rapid``. -The ``single`` command executes the first task in the flow that is in the ``READY`` state that is a task +Tasks can be launched with two commands: ``single`` and ``rapid``. +The ``single`` command executes the first task of the flow in the ``READY`` state, i.e. the first task whose dependencies have been fulfilled. -``rapid``, on the other hand, submits **all tasks** of the flow that are in the ``READY`` state. -Let's try to run the flow with the ``rapid`` command... +``rapid``, on the other hand, submits **all the tasks** of the flow in the ``READY`` state. +Let's run the flow with the ``rapid`` command: .. code-block:: console @@ -294,26 +294,26 @@ Let's try to run the flow with the ``rapid`` command... +--------+-------------+-----------------+--------------+------------+----------+-----------------+----------+-----------+ -What's happening here? -The ``rapid`` command tried to execute all tasks that are ``READY`` but since the second task depends -on the first one only the first task gets submitted. +What happened here? +The ``rapid`` command tried to execute all the ``READY`` tasks but, since the second task depends +on the first one, only the first task was submitted. Note that the SCF task (``w0_t0``) has been submitted with 2 MPI processes. -Before submitting the task, indeed, AbiPy -invokes Abinit to get all the possible parallel configurations compatible within the limits -specified by the user (e.g. ``max_cores``), select an "optimal" configuration according -to some policy and then submit the task with the optimized parameters. -At this point, there's no other task that can be executed, the script exits -and we have to wait for the SCF task before running the second part of the flow. +Before submitting a task, AbiPy +invokes Abinit to get all the parallel configurations compatible with the limits +specified by the user (e.g. ``max_cores``), selects an "optimal" configuration according +to a given policy, and submits the task with the optimized parameters. +Since no other task can be executed at this point, the script exits, +and we have to wait for the SCF task to complete before running the second part of the flow. -At each iteration, :ref:`abirun.py` prints a table with the status of the different tasks. -The meaning of the columns is as follows: +At each iteration, :ref:`abirun.py` prints a table with the status of the tasks. +The columns have the following meaning: ``Queue`` - String in the form ``JobID @ QueueName`` where JobID is the process identifier if we are in the shell - or the job ID assigned by the resource manager (e.g. slurm) if we are submitting to a queue. + String of the form ``JobID @ QueueName``, where JobID is the process identifier when running in the shell, + or the job ID assigned by the resource manager (e.g. slurm) when submitting to a queue. ``MPI`` - Number of MPI processes used. This value is obtained automatically by calling Abinit in ``autoparal mode``, - cannot exceed ``max_ncpus``. + Number of MPI processes. This value is obtained automatically by calling Abinit in ``autoparal`` mode + and cannot exceed ``max_ncpus``. ``OMP`` Number of OpenMP threads. ``Gb`` @@ -323,30 +323,30 @@ The meaning of the columns is as follows: ``Com`` Number of comments found in the log file. ``Sub`` - Number of submissions. It can be > 1 if AbiPy encounters a problem and resubmit the task - with different parameters without performing any operation that can change the physics of the system). + Number of submissions. It can be > 1 if AbiPy encounters a problem and resubmits the task + with different parameters, without performing any operation that changes the physics of the system. ``Rest`` - Number of restarts. AbiPy can restart the job if convergence has not been reached. + Number of restarts. AbiPy restarts the job if convergence has not been reached. ``Corr`` Number of corrections performed by AbiPy to fix runtime errors. These operations can change the physics of the system. ``Time`` - Time spent in the queue (if string ends with Q) or running time (if string ends with R). + Time spent in the queue (if the string ends with Q) or running time (if the string ends with R). ``Node_ID`` - Node identifier used by AbiPy to identify each node of the flow. + Identifier used by AbiPy for each node of the flow. .. NOTE:: - When the submission is done through the shell there's almost no difference between - job submission and job execution. The scenario is completely different if you are submitting - jobs to a resource manager because the task will get a priority value and will enter the queue. + When jobs are submitted through the shell, there is almost no difference between + job submission and job execution. The situation is completely different with + a resource manager, where the task gets a priority value and enters the queue. -If you execute ``status`` again, you should see that the first task is completed. -We can thus run ``rapid`` again to launch the |NscfTask|. -The second task won't take long and if you issue ``status`` again, you should see that the entire flow -completed successfully. +If you run ``status`` again, you should see that the first task has completed. +We can now run ``rapid`` again to launch the |NscfTask|. +The second task won't take long; if you run ``status`` once more, you should see that the entire flow +has completed successfully. -To understand what happened in more detail, use the ``history`` command to get -the list of operations performed by AbiPy on each task. +To understand in more detail what happened, use the ``history`` command to get +the list of operations performed by AbiPy on each task: .. code-block:: console @@ -382,51 +382,53 @@ the list of operations performed by AbiPy on each task. [Mon Mar 6 21:49:48 2017] Finalized set to True -A closer inspection of the logs reveal that before submitting the first task, python has executed -Abinit in ``autoparal`` mode to get the list of possible parallel configuration and the calculation is then submitted. -At this point, AbiPy starts to look at the output files produced by the task to understand what's happening. +A closer look at the logs reveals that, before submitting the first task, AbiPy executed +Abinit in ``autoparal`` mode to get the list of possible parallel configurations, and only then submitted the calculation. +AbiPy then monitors the output files produced by the task to understand what is happening. When the first task completes, the status of the second task is automatically changed to ``READY``, -the ``irdden`` input variable is added to the input file of the second task and a symbolic link to +the ``irdden`` input variable is added to the input file of the second task, and a symbolic link to the ``DEN`` file produced by ``w0/t0`` is created in the ``indata`` directory of ``w0/t1``. -Another auto-parallel run is executed for the NSCF calculation and the second task is finally submitted. +Another autoparal run is executed for the NSCF calculation, and the second task is finally submitted. The command line interface is very flexible and sometimes it is the only tool available. -However, there are cases in which we would like to have a global view of what's happening. +In some cases, however, we would like a global view of what is happening. The command:: $ abirun.py flow_si_ebands notebook -generates a jupyter_ notebook with pre-defined python code that can be executed -to get a graphical representation of the status of our flow inside a web browser -(requires jupyter_, nbformat_ and, obviously, a web browser). +generates a jupyter_ notebook with predefined Python code that +displays a graphical representation of the status of the flow in a web browser +(requires jupyter_, nbformat_ and, of course, a web browser). -Expert users may want to use:: +Expert users may prefer:: $ abirun.py flow_si_ebands ipython -to open the flow in the ipython_ shell to have direct access to the API provided by the flow. +to open the flow in the ipython_ shell and access its API directly. -Once ``manager.yml`` is properly configured, it is possible -to use the AbiPy objects to invoke Abinit and perform useful operations. -For example, one can use the |AbinitInput| object to get the list of k-points in the IBZ, -the list of independent DFPT perturbations, the possible parallel configurations reported by ``autoparal`` etc. +Once ``manager.yml`` is properly configured, you can +use AbiPy objects to invoke Abinit and perform useful operations. +For example, the |AbinitInput| object can give you the list of k-points in the IBZ, +the list of independent DFPT perturbations, the parallel configurations reported by ``autoparal``, etc. -This programmatic interface can be used in scripts to facilitate the creation of input files and workflows. -For example, one can call Abinit to get the list of perturbations for each q-point in the IBZ and then -generate automatically all the input files for DFPT calculations (actually this is the approach used to -generated DFPT workflows in the AbiPy factory functions). +This programmatic interface can be used in scripts to simplify the creation of input files and workflows. +For example, you can call Abinit to get the list of perturbations for each q-point in the IBZ and then +automatically generate all the input files for the DFPT calculations (this is actually how +the AbiPy factory functions generate DFPT workflows). -Note that ``manager.yml`` is also used to invoke other executables (``anaddb``, ``optic``, ``mrgddb``, etcetera) -thus creating some sort of interface between the python language and the Fortran executables. -Thanks to this interface, one can perform relatively simple ab-initio calculations directly in AbiPy. -For instance one can open a ``DDB`` file in a jupyter notebook, call ``anaddb`` to compute -the phonon frequencies and plot the DOS and the phonon band structure with matplotlib_. +``manager.yml`` is also used to invoke other executables (``anaddb``, ``optic``, ``mrgddb``, etc.), +thus providing an interface between Python and the Fortran executables. +Thanks to this interface, relatively simple ab-initio calculations can be performed directly in AbiPy. +For instance, you can open a ``DDB`` file in a jupyter notebook, call ``anaddb`` to compute +the phonon frequencies, and plot the DOS and the phonon band structure with matplotlib_. .. TIP:: + The command:: + abirun.py . doc_manager - gives the full documentation for the different entries of ``manager.yml``. + gives the full documentation of the entries of ``manager.yml``. .. command-output:: abirun.py . doc_manager @@ -437,16 +439,16 @@ How to configure the scheduler ------------------------------ In the previous example, we ran a simple band structure calculation for silicon in a few seconds -on a laptop but one might have more complicated flows requiring hours or even days to complete. -For such cases, the ``single`` and ``rapid`` commands are not handy because we are supposed -to monitor the evolution of the flow and re-run ``abirun.py`` when a new task is ``READY``. -In these cases, it is much easier to delegate all the repetitive work to a ``python scheduler``, +on a laptop, but more complex flows may take hours or even days to complete. +In such cases, the ``single`` and ``rapid`` commands are not practical, because we would have +to monitor the flow and re-run ``abirun.py`` every time a new task becomes ``READY``. +It is much easier to delegate all this repetitive work to a ``python scheduler``: a process that runs in the background, submits tasks automatically and performs the actions -required to complete the flow. +needed to complete the flow. -The parameters for the scheduler are declared in the YAML_ file ``scheduler.yml``. -Also in this case, AbiPy will look first in the working directory and then inside ``$HOME/.abinit/abipy``. -Create a ``scheduler.yml`` in the working directory by copying the example below: +The scheduler parameters are declared in the YAML_ file ``scheduler.yml``. +As before, AbiPy looks first in the working directory and then in ``$HOME/.abinit/abipy``. +Create a ``scheduler.yml`` file in the working directory by copying the example below: .. code-block:: yaml @@ -455,26 +457,26 @@ Create a ``scheduler.yml`` in the working directory by copying the example below #hours: 0 # number of hours to wait. This file tells the scheduler to wake up every 5 seconds, inspect the status of the tasks -in the flow and perform the actions required for reach completion +in the flow, and perform the actions needed to reach completion. .. IMPORTANT:: Remember to set the time interval to a reasonable value. - A small value leads to an increase of the submission rate but it also increases the CPU load - and the pressure on the hardware and on the resource manager. - A too large time interval can have a detrimental effect on the throughput, especially - if you are submitting many small jobs. + A short interval increases the submission rate, but it also increases the CPU load + and the pressure on the hardware and the resource manager. + A very long interval, on the other hand, can reduce throughput, especially + when submitting many small jobs. -At this point, we are ready to run our first calculation with the scheduler. -To make things more interesting, we execute a slightly more complicated flow that computes +We are now ready to run our first calculation with the scheduler. +To make things more interesting, we execute a slightly more complex flow that computes the G0W0 corrections to the direct band gap of silicon at the Gamma point. The flow consists of the following six tasks: -- 0: Ground state calculation to get the density. +- 0: Ground-state calculation to get the density. - 1: NSCF calculation with several empty states. -- 2: Calculation of the screening using the WFK produced by task 2. -- 3-4-5: Evaluation of the Self-Energy matrix elements with different values of nband - using the WFK produced by task 2 and the SCR file produced by task 3 +- 2: Calculation of the screening using the WFK produced by task 1. +- 3-4-5: Evaluation of the self-energy matrix elements with different values of nband, + using the WFK produced by task 1 and the SCR file produced by task 2. Generate the flow with:: @@ -484,32 +486,32 @@ and let the scheduler manage the submission with:: abirun.py flow_si_g0w0 scheduler -You should see the following output on the terminal +You should see the following output in the terminal: .. code-block:: console - abirun.py flow_si_ebands scheduler + abirun.py flow_si_g0w0 scheduler Abipy Scheduler: PyFlowScheduler, Pid: 72038 Scheduler options: {'seconds': 10, 'hours': 0, 'weeks': 0, 'minutes': 0, 'days': 0} -``Pid`` is the process identifier associated the scheduler (also saved in in the ``_PyFlowScheduler.pid`` file). +``Pid`` is the process identifier of the scheduler (also saved in the ``_PyFlowScheduler.pid`` file). .. IMPORTANT:: - A ``_PyFlowScheduler.pid`` file in ``FLOWDIR`` means that there's a scheduler running the flow. - Note that there must be only one scheduler associated to a given flow. + A ``_PyFlowScheduler.pid`` file in ``FLOWDIR`` means that a scheduler is running the flow. + There must be only one scheduler associated with a given flow. -As you can easily understand the scheduler brings additional power to the AbiPy flow because -it is possible to automate complicated ab-initio workflows with little effort: write -a script that implements the flow in python and save it to disk, run it with -``abirun.py FLOWDIR scheduler`` and finally use the AbiPy/Pymatgen tools to analyze the final results. -Even complicated convergence studies for G0W0 calculations can be implemented along these lines -as shown by this `video `_. -The only problem is that at a certain point our flow will become too big or too computational expensive -that cannot be executed on a personal computer anymore and we have to move to a supercomputing center. -The next section discusses how to configure AbiPy to run on a cluster with a queue management system. +The scheduler makes AbiPy flows much more powerful, since +complex ab-initio workflows can be automated with little effort: write +a Python script that implements the flow, run it with +``abirun.py FLOWDIR scheduler``, and finally analyze the results with the AbiPy/pymatgen tools. +Even complex convergence studies for G0W0 calculations can be implemented along these lines, +as shown in this `video `_. +Sooner or later, however, flows become too large or too computationally expensive +to run on a personal computer, and we have to move to a supercomputing center. +The next section explains how to configure AbiPy to run on a cluster with a queue management system. .. TIP:: @@ -523,25 +525,25 @@ The next section discusses how to configure AbiPy to run on a cluster with a que Configuring AbiPy on a cluster ------------------------------ -In this section we discuss how to configure the manager to run flows on a cluster. -The configuration depends on specific queue management system (Slurm, PBS, etc) hence -we assume that you are already familiar with job submissions and you know the options -that mush be specified in the submission script in order to have your job accepted -and executed by the management system (username, name of the queue, memory ...) +In this section, we discuss how to configure the manager to run flows on a cluster. +The configuration depends on the specific queue management system (Slurm, PBS, etc.), so +we assume that you are already familiar with job submission and know which options +must be specified in the submission script for your job to be accepted +and executed by the resource manager (username, queue name, memory, ...). -Let's assume that our computing center uses slurm_ and our jobs must be submitted to the ``default_queue`` partition. -In the best case, the system administrator of our cluster already provides -an ``Abinit module`` that can be loaded directly with ``module load`` before invoking the code. -To make things a little bit more difficult, however, we assume the we had to compile our own version of Abinit -inside the build directory ``${HOME}/git_repos/abinit/build_impi`` using the following two modules -already installed by the system administrator:: +Let's assume that our computing center uses slurm_ and that jobs must be submitted to the ``default_queue`` partition. +In the best case, the system administrator already provides +an ``Abinit module`` that can be loaded with ``module load`` before invoking the code. +To make things a bit more challenging, however, we assume that we compiled our own version of Abinit +in the build directory ``${HOME}/git_repos/abinit/build_impi`` using the following two modules +provided by the system administrator:: compiler/intel/composerxe/2013_sp1.1.106 intelmpi -In this case, we have to be careful with the configuration of our environment because the Slurm submission -script should load the modules and modify our ``$PATH`` so that our version of Abinit can be found. -A ``manager.yml`` with a single ``qadapter`` looks like: +In this case, we have to configure the environment carefully, because the Slurm submission +script must load the modules and modify ``$PATH`` so that our version of Abinit can be found. +A ``manager.yml`` with a single ``qadapter`` looks like this: .. code-block:: yaml @@ -578,54 +580,56 @@ A ``manager.yml`` with a single ``qadapter`` looks like: .. TIP:: - abirun.py FLOWDIR doc_manager script + The command:: + + abirun.py FLOWDIR doc_manager script - prints to screen the submission script that will be generated by AbiPy at runtime. + prints the submission script that AbiPy will generate at runtime. -Let's discuss the different options in more detail. Let's start from the ``queue`` section: +Let's discuss the options in more detail, starting from the ``queue`` section: ``qtype`` - String specifying the resource manager. This option tells AbiPy which ``qadapter`` to use to generate the submission - script, submit them, kill jobs in the queue and how to interpret the other options passed by the user. + String specifying the resource manager. This option tells AbiPy which ``qadapter`` to use to generate + and submit the submission scripts and to kill jobs in the queue, as well as how to interpret the other options passed by the user. ``qname`` - Name of the submission queue (string, MANDATORY) + Name of the submission queue (string, MANDATORY). ``qparams`` Dictionary with the parameters passed to the resource manager. - We use the *normalized* version of the options i.e. dashes in the official name of the parameter - are replaced by underscores e.g. ``--mail-type`` becomes ``mail_type``. - For the list of supported options use the ``doc_manager`` command. + We use the *normalized* version of the options, i.e. dashes in the official parameter name + are replaced by underscores, e.g. ``--mail-type`` becomes ``mail_type``. + For the list of supported options, use the ``doc_manager`` command. Use ``qverbatim`` to pass additional options that are not included in the template. -Note that we are not specifying the number of cores in ``qparams`` because AbiPy will find -an appropriate value at run-time. +Note that we do not specify the number of cores in ``qparams``, since AbiPy finds +an appropriate value at runtime. -The ``job`` section is the most critical one because it defines how to configure the environment -before executing the application and how to run the code. -The ``modules`` entry specifies the list of modules to load, ``shell_env`` allows us to modify the -``$PATH`` environment variables so that the OS can find our Abinit executable. +The ``job`` section is the most critical one, because it defines how to set up the environment +and how to run the code. +The ``modules`` entry lists the modules to load, while ``shell_env`` modifies the +``$PATH`` environment variable so that the OS can find our Abinit executable. .. IMPORTANT:: - Various resource managers will first execute your ``.bashrc`` before starting to load the new modules. + Some resource managers execute your ``.bashrc`` before loading the new modules. -We also increase the size of the stack with ``ulimit`` before running the code and we run Abinit +We also increase the stack size with ``ulimit`` before running the code, and we run Abinit with the ``mpirun`` provided by the modules. -The ``limits`` section defines the constraints that must be fulfilled in order to run on this queue -while ``hardware`` is a dictionary with info on the hardware available on this queue. -Every job will have a ``timelimit`` of 20 minutes, cannot use more that ``max_cores`` cores, -and the first job submission will request 1 Gb of memory. -Note that the actual number of cores will be determined at runtime by calling Abinit in ``autoparal`` mode -to get all parallel configurations up to ``max_cores``. -If the job is killed due to insufficient memory, AbiPy will resubmit the task with increased resources -and it will stop when it reaches the maximum amount given by ``mem_per_node``. +The ``limits`` section defines the constraints that must be satisfied to run on this queue, +while ``hardware`` describes the hardware available on this queue. +Every job has a ``timelimit`` of 20 minutes, cannot use more than ``max_cores`` cores, +and the first submission requests 1 Gb of memory per process. +The actual number of cores is determined at runtime by calling Abinit in ``autoparal`` mode +to get all the parallel configurations up to ``max_cores``. +If a job is killed because of insufficient memory, AbiPy resubmits the task with more memory, +up to the maximum given by ``mem_per_node``. -Note that there are more advanced options supported by ``limits`` and other options -will be added as time goes by. +``limits`` supports more advanced options as well, and new options +will be added over time. -The get the complete list of options supported by the Slurm ``qadapter`` use: +To get the complete list of options supported by the Slurm ``qadapter``, use: .. command-output:: abirun.py . doc_manager slurm @@ -635,32 +639,32 @@ The get the complete list of options supported by the Slurm ``qadapter`` use: abirun.py FLOWDIR cancel - Note that the script will ask for confirmation before killing all the jobs belonging to the flow. + The script asks for confirmation before killing all the jobs belonging to the flow. -Once you have a ``manager.yml`` properly configured for your cluster, you can start -to use the scheduler to automate job submissions. -Very likely your flows will require hours or even days to complete and, in principle, -you should maintain an active connection to the machine in order to keep your scheduler alive -(if your session expires, all subprocesses launched within your terminal, -including the python scheduler, will be automatically killed). -Fortunately there is a standard Unix tool called ``nohup`` that comes to our rescue. +Once ``manager.yml`` is properly configured for your cluster, you can +use the scheduler to automate job submission. +Your flows will most likely take hours or even days to complete and, in principle, +you would need to keep an active connection to the machine to keep the scheduler alive +(if your session expires, all the subprocesses launched from your terminal, +including the Python scheduler, are killed). +Fortunately, the standard Unix tool ``nohup`` comes to the rescue. -For long-running jobs, we strongly suggest to start the scheduler with:: +For long-running jobs, we strongly recommend starting the scheduler with:: nohup abirun.py FLOWDIR scheduler > sched.stdout 2> sched.stderr & -This command executes the scheduler in background and redirects the ``stdout`` and ``stderr`` -to ``sched.log`` and ``sched.err``, respectively. -The process identifier of the scheduler is saved in the ``_PyFlowScheduler.pid`` file inside ``FLOWDIR``. -This file is removed automatically when the scheduler completes its execution. -Thanks to the ``nohup`` command, we can close our session, let the scheduler work overnight -and reconnect the day after to collect our data. +This command runs the scheduler in the background and redirects ``stdout`` and ``stderr`` +to ``sched.stdout`` and ``sched.stderr``, respectively. +The process identifier of the scheduler is saved in the ``_PyFlowScheduler.pid`` file in ``FLOWDIR``, +which is removed automatically when the scheduler completes. +Thanks to ``nohup``, we can close the session, let the scheduler work overnight, +and reconnect the next day to collect the results. .. IMPORTANT:: - Use ``abirun.py FLOWDIR cancel`` to cancel the jobs of a flow that is being executed by - a scheduler. AbiPy will detect that there is a scheduler already attached to the flow - and will cancel the jobs of the flow and kill the scheduler as well. + Use ``abirun.py FLOWDIR cancel`` to cancel the jobs of a flow managed by + a scheduler. AbiPy detects that a scheduler is attached to the flow, + cancels the jobs of the flow and kills the scheduler as well. .. _inspecting-the-flow: @@ -674,51 +678,51 @@ The simplest command is:: abirun.py FLOWDIR tail -that is the analogous of Unix tail but a little bit more smarter in the -sense that ``abirun.py`` will only print to screen the final part of the output files +which is similar to Unix ``tail``, but a bit smarter: +it prints only the final part of the output files of the tasks that are ``RUNNING``. -If you have matplotlib_ installed, you may want to use:: +If matplotlib_ is installed, you may want to use:: $ abirun.py FLOWDIR inspect -Several AbiPy tasks, indeed, provide an ``inspect`` method producing matplotlib figures +Several AbiPy tasks provide an ``inspect`` method that produces matplotlib figures with data extracted from the output files. -For example, a ``GsTask`` prints the evolution of the ground-state SCF cycle. -The inspect command of :ref:`abirun.py` just loops over the tasks of the flow and -calls the ``inspect`` method on each of them. +For example, a ``GsTask`` plots the evolution of the ground-state SCF cycle. +The ``inspect`` command of :ref:`abirun.py` simply loops over the tasks of the flow and +calls the ``inspect`` method of each one. The command:: abirun.py FLOWDIR inputs -prints the input files of the different tasks (can use ``--nids`` to select a subset of -tasks or, alternatively, replace ``FLOWDIR`` with the ``FLOWDIR/w0/t0`` syntax) +prints the input files of the tasks (use ``--nids`` to select a subset of +tasks or, alternatively, replace ``FLOWDIR`` with the ``FLOWDIR/w0/t0`` syntax). The command:: abirun.py FLOWDIR listext EXTENSION -prints a table with the nodes of the flow who have produced an Abinit output file with the given -extension. Use e.g.:: +prints a table with the nodes of the flow that have produced an Abinit output file with the given +extension. For example:: abirun.py FLOWDIR listext GSR.nc -to show the nodes of the flow who have produced a GSR.nc_ file. +shows the nodes of the flow that have produced a GSR.nc_ file. The command:: abirun.py FLOWDIR notebook -generates a jupyter_ notebook with pre-defined python code that can be executed -to get a graphical representation of the status of the flow inside a web browser -(requires jupyter_, nbformat_ and, obviously, a web browser). +generates a jupyter_ notebook with predefined Python code that +displays a graphical representation of the status of the flow in a web browser +(requires jupyter_, nbformat_ and, of course, a web browser). -Expert users may want to use:: +Expert users may prefer:: abirun.py FLOWDIR ipython -to open the flow in the ipython_ shell to have direct access to the API provided by the flow. +to open the flow in the ipython_ shell and access its API directly. .. _event-handlers: @@ -727,16 +731,16 @@ to open the flow in the ipython_ shell to have direct access to the API provided Event handlers -------------- -An event handler is an action that is executed in response of a particular event. -The AbiPy tasks are equipped with built-in event handlers that are be executed +An event handler is an action executed in response to a particular event. +AbiPy tasks come with built-in event handlers that are executed to fix typical Abinit runtime errors. -To list the event handlers installed in a given flow use:: +To list the event handlers installed in a given flow, use:: abirun.py FLOWDIR handlers -The ``--verbose`` option produces a more detailed description of the action performed -by the event handlers. +The ``--verbose`` option gives a more detailed description of the actions performed +by the event handlers: .. code-block:: console @@ -788,8 +792,8 @@ by the event handlers. .. NOTE:: - New error handlers will be added in the new versions of Abipy/Abinit. - Please, let us know if you need handlers for errors commonly occuring in your calculations. + New error handlers will be added in future versions of AbiPy/Abinit. + Please let us know if you need handlers for errors that commonly occur in your calculations. .. _flow-troubeshooting: @@ -797,9 +801,9 @@ by the event handlers. Troubleshooting --------------- -There are two :ref:`abirun.py` commands that are very useful especially if something goes wrong: ``events`` and ``debug``. +Two :ref:`abirun.py` commands are especially useful when something goes wrong: ``events`` and ``debug``. -To print the Abinit events (Warnings, Errors, Comments) found in the log files of the different tasks use:: +To print the Abinit events (warnings, errors, comments) found in the log files of the tasks, use:: abirun.py FLOWDIR events @@ -807,16 +811,16 @@ To analyze error files and log files for possible error messages, use:: abirun.py FLOWDIR debug -By default, these commands will analyze the entire flow so the output on the terminal can be very verbose. -If you are interested in a particular task e.g. ``w0/t1`` use the syntax:: +By default, these commands analyze the entire flow, so the terminal output can be very verbose. +To focus on a particular task, e.g. ``w0/t1``, use:: abirun.py FLOWDIR/w0/t1 events -to select all the tasks in a work directory e.g. ``w0`` use:: +To select all the tasks in a work directory, e.g. ``w0``, use:: abirun.py FLOWDIR/w0 events -to select an arbitrary subset of nodes of the flow use the syntax:: +To select an arbitrary subset of nodes of the flow, use:: abirun.py FLOWDIR events -nids=12,13,16 @@ -824,11 +828,11 @@ where ``nids`` is a list of AbiPy node identifiers. .. TIP:: - ``abirun.py events --help`` is your best friend + ``abirun.py events --help`` is your best friend. .. command-output:: abirun.py events --help -To get information on the Abinit executable called by AbiPy, use:: +To get information about the Abinit executable called by AbiPy, use:: abirun.py abibuild @@ -844,20 +848,20 @@ TODO: How to reset tasks TaskPolicy ---------- -At this point, you may wonder why we need to specify all these parameters in the configuration file. -The reason is that, before submitting a job to a resource manager, AbiPy will use the autoparal +At this point, you may wonder why all these parameters are needed in the configuration file. +The reason is that, before submitting a job to a resource manager, AbiPy uses the autoparal feature of ABINIT to get all the possible parallel configurations with ``ncpus <= max_cores``. -On the basis of these results, AbiPy selects the "optimal" one, and changes the ABINIT input file -and the submission script accordingly . -(this is a very useful feature, especially for calculations done with ``paral_kgb=1`` that require -the specification of ``npkpt``, ``npfft``, ``npband``, etc). -If more than one ``QueueAdapter`` is specified, AbiPy will first compute all the possible -configuration and then select the "optimal" ``QueueAdapter`` according to some kind of policy - -In some cases, you may want to enforce some constraint on the "optimal" configuration. -For example, you may want to select only those configurations whose parallel efficiency is greater than 0.7 -and whose number of MPI nodes is divisible by 4. -One can easily enforce this constraint via the ``condition`` dictionary whose syntax is similar to +Based on these results, AbiPy selects the "optimal" one and updates the ABINIT input file +and the submission script accordingly. +This is a very useful feature, especially for calculations with ``paral_kgb=1``, which require +setting ``npkpt``, ``npfft``, ``npband``, etc. +If more than one ``QueueAdapter`` is specified, AbiPy first computes all the possible +configurations and then selects the "optimal" ``QueueAdapter`` according to a given policy. + +In some cases, you may want to impose constraints on the "optimal" configuration. +For example, you may want to select only the configurations whose parallel efficiency is greater than 0.7 +and whose number of MPI processes is divisible by 4. +Such constraints can be enforced via the ``condition`` dictionary, whose syntax is similar to the one used in mongodb_. .. code-block:: yaml @@ -867,19 +871,19 @@ the one used in mongodb_. max_ncpus: 10 condition: {$and: [ {"efficiency": {$gt: 0.7}}, {"tot_ncpus": {$divisible: 4}} ]} -The parallel efficiency is defined as $\epsilon = \dfrac{T_1}{T_N * N}$ where $N$ is the number -of MPI processes and $T_j$ is the wall time needed to complete the calculation with $j$ MPI processes. -For a perfect scaling implementation $\epsilon$ is equal to one. -The parallel speedup with N processors is given by $S = T_N / T_1$. -Note that ``autoparal = 1`` will automatically change your ``job.sh`` script as well as the input file -so that we can run the job in parallel with the optimal configuration required by the user. -For example, you can use ``paral_kgb = 1`` in GS calculations and AbiPy will automatically set the values -of ``npband``, ``npfft``, ``npkpt`` ... for you! -Note that if no configuration fulfills the given condition, AbiPy will use the optimal configuration -that leads to the highest parallel speedup (not necessarily the most efficient one). +The parallel efficiency is defined as :math:`\epsilon = \dfrac{T_1}{N T_N}`, where :math:`N` is the number +of MPI processes and :math:`T_j` is the wall time needed to complete the calculation with :math:`j` MPI processes. +For perfect scaling, :math:`\epsilon` equals one. +The parallel speedup with :math:`N` processes is given by :math:`S = T_1 / T_N`. +Note that ``autoparal = 1`` automatically modifies both the ``job.sh`` script and the input file +so that the job runs in parallel with the optimal configuration. +For example, you can use ``paral_kgb = 1`` in GS calculations, and AbiPy will automatically set +``npband``, ``npfft``, ``npkpt``, ... for you! +If no configuration satisfies the given condition, AbiPy uses the configuration +with the highest parallel speedup (not necessarily the most efficient one). ``policy`` - This section governs the automatic parallelization of the run: in this case AbiPy will use + This section controls the automatic parallelization of the run. Here, AbiPy uses the ``autoparal`` capabilities of Abinit to determine an optimal configuration with - **maximum** ``max_ncpus`` MPI nodes. Setting ``autoparal`` to 0 disable the automatic parallelization. - Other values of autoparal are not supported. + at **most** ``max_ncpus`` MPI processes. Setting ``autoparal`` to 0 disables automatic parallelization. + Other values of ``autoparal`` are not supported. diff --git a/pyproject.toml b/pyproject.toml index 68dc12e8a..826121f52 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,17 +1,7 @@ # See https://packaging.python.org/en/latest/guides/writing-pyproject-toml/ -#[build-system] -#requires = ["hatchling"] -#build-backend = "hatchling.build" - -#[build-system] -#requires = [ -# # pin NumPy version used in the build -# #"oldest-supported-numpy", -# "setuptools>=65.0.0", -#] - -#build-backend = "setuptools.build_meta" +# Install these groups from the repository's top-level directory with: +# python3 -m pip install --group docs [project] name = "abipy" diff --git a/tasks.py b/tasks.py index 7fac678cb..b7442d362 100644 --- a/tasks.py +++ b/tasks.py @@ -50,17 +50,14 @@ def submodules(ctx): def make_doc(ctx): """Build the website""" with cd(DOCS_DIR): - ctx.run("touch api/index.rst", warn=True) + # --no-toc: don't write modules.rst, index.rst below is the root of the API tree. ctx.run( - "sphinx-apidoc --implicit-namespaces -M -d 1 -o api -f ../abipy ../**/tests/* ../abipy/benchmarks ../abipy/data ../abipy/integration_tests ../abipy/test_files ../abipy/examples" + "sphinx-apidoc --implicit-namespaces --no-toc -M -d 1 -o api -f ../abipy ../**/tests/* ../abipy/benchmarks ../abipy/data ../abipy/integration_tests ../abipy/test_files ../abipy/examples" ) - rst_files = sorted( - [f for f in os.listdir(os.path.join(DOCS_DIR, "api")) if f.endswith(".rst") and f != "modules.rst"] - ) - rst_files = [3 * " " + f for f in rst_files] - # print(rst_files) - + # abipy.rst already includes the subpackages (which include their own subpackages) + # so we only need to reference the top-level package here. + # Listing all the rst files would put each page in multiple toctrees. header = """\ .. _api-index: @@ -69,9 +66,10 @@ def make_doc(ctx): ================= .. toctree:: - :maxdepth: 1 + :maxdepth: 2 -""" + "\n".join(rst_files) + abipy +""" with open(os.path.join(DOCS_DIR, "api", "index.rst"), "wt") as fh: fh.write(header) From 7b5e638abf6a2c9ba1d3d6dbaf76adc0efb93542 Mon Sep 17 00:00:00 2001 From: Matteo Giantomassi Date: Thu, 1 Oct 2026 12:30:39 +0200 Subject: [PATCH 21/23] Fix warnings in docs --- abipy/core/pauli.py | 8 ++-- abipy/dfpt/anaddbnc.py | 17 ------- abipy/dfpt/vzsisa.py | 8 ++-- abipy/dynamics/analyzer.py | 37 +++++++------- abipy/dynamics/cpx.py | 12 ++--- abipy/electrons/abitk.py | 2 +- abipy/electrons/ebands.py | 36 ++++++++------ abipy/electrons/gw.py | 2 +- abipy/electrons/gwr.py | 4 +- abipy/electrons/tchim.py | 27 ++++++----- abipy/eph/gkq.py | 5 +- abipy/eph/gstore.py | 48 +++++++++---------- abipy/eph/rta.py | 5 +- abipy/eph/vpq.py | 4 +- .../flows/run_mgb2_phonons_nkpt_tsmear.py | 2 +- abipy/examples/flows/run_qha_zsisa.py | 4 +- abipy/examples/plot/plot_ddb_asr.py | 2 +- abipy/flowtk/dfpt_flows.py | 2 +- abipy/flowtk/gwr_works.py | 2 +- abipy/flowtk/scheduler_error_parsers.py | 12 ++--- abipy/flowtk/wrappers.py | 20 ++++---- abipy/ml/relax_scanner.py | 1 + abipy/ppcodes/base_parser.py | 6 +-- abipy/scripts/abicomp.py | 10 ++-- abipy/tools/context_managers.py | 2 +- abipy/tools/numtools.py | 1 + docs/conf.py | 7 +++ docs/links.rst | 10 ++++ docs/scripts/abicheck.rst | 2 +- docs/scripts/abicomp.rst | 2 +- docs/scripts/abidoc.rst | 2 +- docs/scripts/abinp.rst | 2 +- docs/scripts/abiopen.rst | 2 +- docs/scripts/abips.rst | 2 +- docs/scripts/abirun.rst | 2 +- docs/scripts/abistruct.rst | 2 +- docs/scripts/abiview.rst | 2 +- docs/scripts/oncv.rst | 2 +- docs/workflows/taskmanager.rst | 10 ++-- 39 files changed, 168 insertions(+), 158 deletions(-) diff --git a/abipy/core/pauli.py b/abipy/core/pauli.py index ef1554760..c02ed190a 100644 --- a/abipy/core/pauli.py +++ b/abipy/core/pauli.py @@ -30,13 +30,13 @@ def project_mats(self, mats: np.ndarray) -> np.ndarray: An array of shape [..., 2, 2], where each trailing 2x2 subarray is a matrix to be projected onto the Pauli basis. - Returns: + Returns ------- np.ndarray An array of shape [..., 4], where the last dimension contains the coefficients (a_0, a_x, a_y, a_z) for the identity matrix, sigma_x, sigma_y, and sigma_z, respectively. - Examples: + Examples -------- >>> import numpy as np >>> mats = np.array([[[1, 0], [0, 1]], [[0, 1], [1, 0]]]) # Shape (2, 2, 2) @@ -72,13 +72,13 @@ def mats_from_projections(self, coefficients: np.ndarray) -> np.ndarray: An array of shape [..., 4], where the last dimension contains the coefficients (a_0, a_x, a_y, a_z) for the identity matrix, sigma_x, sigma_y, and sigma_z, respectively. - Returns: + Returns ------- np.ndarray An array of shape [..., 2, 2], where each trailing 2x2 matrix is reconstructed from the input coefficients. - Examples: + Examples -------- >>> coefficients = np.array([[0.5, 0, 0, 0.5], [0, 0.5, 0, 0]]) # Shape (2, 4) >>> result = reconstruct_mats(coefficients) diff --git a/abipy/dfpt/anaddbnc.py b/abipy/dfpt/anaddbnc.py index 324ca8b64..1435cef0f 100644 --- a/abipy/dfpt/anaddbnc.py +++ b/abipy/dfpt/anaddbnc.py @@ -28,23 +28,6 @@ class AnaddbNcFile(AbinitNcFile, Has_Structure, NotebookWriter): AnaddbNcFile provides a high-level interface to the data stored in the anaddb.nc file. This object is usually instantiated with `abiopen("anaddb.nc")`. - .. attribute:: structure - - |Structure| object. - - .. attribute:: epsinf - - Macroscopic dielectric tensor. None if the file does not contain this information. - - .. attribute:: becs - - Born effective charges. None if the file does not contain this inf - - .. attribute:: ifc - - :class:`InteratomicForceConstants` object with the interatomic force constants calculated by anaddb. - None, if the netcdf file does not contain the IFCs. - .. rubric:: Inheritance Diagram .. inheritance-diagram:: AnaddbNcFile """ diff --git a/abipy/dfpt/vzsisa.py b/abipy/dfpt/vzsisa.py index 09ead32f7..f25ebd66a 100644 --- a/abipy/dfpt/vzsisa.py +++ b/abipy/dfpt/vzsisa.py @@ -14,8 +14,8 @@ from abipy.core.func1d import Function1D from abipy.core.structure import Structure from abipy.dfpt.ddb import DdbFile -from abipy.dfpt.phonons import PhdosFile, PhononDos, PhononDosPlotter -from abipy.electrons.ebands import ElectronDosPlotter +from abipy.dfpt.phonons import PhdosFile, PhononBandsPlotter, PhononDos, PhononDosPlotter +from abipy.electrons.ebands import ElectronBandsPlotter, ElectronDosPlotter from abipy.electrons.gsr import GsrFile from abipy.tools.plotting import add_fig_kwargs, get_ax_fig_plt, set_grid_legend # , get_axarray_fig_plt from abipy.tools.serialization import HasPickleIO @@ -662,13 +662,13 @@ def get_edos_plotter(self) -> ElectronDosPlotter: plotter.add_edos(f"V={volume:.2f} ų", edos) return plotter - def get_ebands_plotter(self) -> ElectronBandPlotter: + def get_ebands_plotter(self) -> ElectronBandsPlotter: """Build and return a ElectronBandsPlotter with electron bands indexed by volume""" if self.ebands_list is None: raise ValueError("ebands_list is not available") plotter = ElectronBandsPlotter() for volume, ebands in zip(self.ph_volumes, self.ebands_list, strict=True): - plotter.add_edos(f"V={volume:.2f} ų", ebands) + plotter.add_ebands(f"V={volume:.2f} ų", ebands) return plotter def _add_lines_to_ax(self, ax, x_or_y: str, what="volume"): diff --git a/abipy/dynamics/analyzer.py b/abipy/dynamics/analyzer.py index 9bae001ff..150f4ac49 100644 --- a/abipy/dynamics/analyzer.py +++ b/abipy/dynamics/analyzer.py @@ -2030,28 +2030,31 @@ class ArrheniusPlotter: In the simplest case, one reads the data from external files in CSV format. Example: - from abipy.dynamics.analyzer import ArrheniusPlotter - key_path = { - "matgl-MD": "diffusion_cLLZO-matgl.csv", - "m3gnet-MD": "diffusion_cLLZO-m3gnet.csv", - } + .. code-block:: python - mpl_style_key = { - "matgl-MD" : dict(c='blue'), - "m3gnet-MD": dict(c='purple'), - } + from abipy.dynamics.analyzer import ArrheniusPlotter - plotter = ArrheniusPlotter() - for key, path in key_path.items(): - plotter.add_entry_from_file(path, key, mpl_style=mpl_style_key[key]) + key_path = { + "matgl-MD": "diffusion_cLLZO-matgl.csv", + "m3gnet-MD": "diffusion_cLLZO-m3gnet.csv", + } - # temperature grid refined - thinvt_arange = (0.6, 2.5, 0.01) - xlims, ylims = (0.5, 2.0), (-7, -4) + mpl_style_key = { + "matgl-MD" : dict(c='blue'), + "m3gnet-MD": dict(c='purple'), + } - plotter.plot(thinvt_arange=thinvt_arange, - xlims=xlims, ylims=ylims, text='LLZO cubic', savefig=None) + plotter = ArrheniusPlotter() + for key, path in key_path.items(): + plotter.add_entry_from_file(path, key, mpl_style=mpl_style_key[key]) + + # temperature grid refined + thinvt_arange = (0.6, 2.5, 0.01) + xlims, ylims = (0.5, 2.0), (-7, -4) + + plotter.plot(thinvt_arange=thinvt_arange, + xlims=xlims, ylims=ylims, text='LLZO cubic', savefig=None) """ diff --git a/abipy/dynamics/cpx.py b/abipy/dynamics/cpx.py index 5b6f80532..ed1730623 100644 --- a/abipy/dynamics/cpx.py +++ b/abipy/dynamics/cpx.py @@ -40,7 +40,7 @@ def parse_file_with_blocks(filepath: PathLike, block_len: int) -> tuple[int, np.ndarray, list]: """ - Parse a QE file whose format is: + Parse a QE file whose format is:: 20 0.00241888 0.31882936800000E+01 0.14832370390000E+02 0.12288296100000E+01 @@ -116,12 +116,12 @@ class EvpFile(TextFile, NotebookWriter): """ The evp file is a file that contains the electronic and ionic energies and pressures for each time step of a CP simulation. - The evp file has the following format: + The evp file has the following format:: - # nfi tps(ps) ekinc Tcell(K) Tion(K) etot enthal econs - 0 0 300 -2099.0164 7.4066063 -2091.6098 19363.353 2188.2406 5.0978969 - 10 0.01 557.43004 -2105.3429 13.762216 -2091.5807 16917.626 2188.2406 5.0978969 - ... + # nfi tps(ps) ekinc Tcell(K) Tion(K) etot enthal econs + 0 0 300 -2099.0164 7.4066063 -2091.6098 19363.353 2188.2406 5.0978969 + 10 0.01 557.43004 -2105.3429 13.762216 -2091.5807 16917.626 2188.2406 5.0978969 + ... NB: Energies are in Hartree and not in Ry. diff --git a/abipy/electrons/abitk.py b/abipy/electrons/abitk.py index c9f4b5dc9..137f78476 100644 --- a/abipy/electrons/abitk.py +++ b/abipy/electrons/abitk.py @@ -25,7 +25,7 @@ class KmeshFile(AbinitNcFile, Has_Structure): """ @classmethod - def from_ngkpt_shifts(cls, ncpath_with_structure, ngkpt, shifts, kptopt=3, chksymbreak=0, verbose=0) -> Kmesh: + def from_ngkpt_shifts(cls, ncpath_with_structure, ngkpt, shifts, kptopt=3, chksymbreak=0, verbose=0) -> KmeshFile: """ Args: ncpath_with_structure: diff --git a/abipy/electrons/ebands.py b/abipy/electrons/ebands.py index af3a025d8..37f692ddb 100644 --- a/abipy/electrons/ebands.py +++ b/abipy/electrons/ebands.py @@ -2463,21 +2463,23 @@ def plot( coordinates of the k-points. The values are the labels. e.g. ``klabels = {(0.0,0.0,0.0): "$\Gamma$", (0.5,0,0):"L"}``. e0: Option used to define the zero of energy in the band structure plot. Possible values: + - ``fermie``: shift all eigenvalues to have zero energy at the Fermi energy (``self.fermie``). - - Number e.g e0=0.5: shift all eigenvalues to have zero energy at 0.5 eV - - None: Don't shift energies, equivalent to e0=0 + - Number e.g e0=0.5: shift all eigenvalues to have zero energy at 0.5 eV + - None: Don't shift energies, equivalent to e0=0 + ax: |matplotlib-Axes| or None if a new figure should be created. ylims: Set the data limits for the y-axis. Accept tuple e.g. ``(left, right)`` or scalar e.g. ``left``. If left (right) is None, default values are used points: Marker object with the position and the size of the marker. Used for plotting purpose e.g. QP energies, energy derivatives etc. with_gaps: True to add markers and arrows showing the fundamental and the direct gap. - IMPORTANT: If the gaps are now showed correctly in a non-magnetic semiconductor, - call `ebands.set_fermie_to_vbm()` to align the Fermi level at the top of the valence - bands before executing `ebands.plot(). - The Fermi energy stored in the object, indeed, comes from the GS calculation - that produced the DEN file. If the k-mesh used for the GS and the CBM is e.g. at Gamma, - the Fermi energy will be underestimated and a manual alignment is needed. + IMPORTANT: If the gaps are not shown correctly in a non-magnetic semiconductor, + call ``ebands.set_fermie_to_vbm()`` to align the Fermi level at the top of the valence + bands before executing ``ebands.plot()``. + The Fermi energy stored in the object, indeed, comes from the GS calculation + that produced the DEN file. If the k-mesh used for the GS and the CBM is e.g. at Gamma, + the Fermi energy will be underestimated and a manual alignment is needed. with_band_index: Show band index in plot. max_phfreq: Max phonon frequency in eV to activate scatterplot showing possible phonon absorption/emission processes based on energy-conservation alone. @@ -2617,18 +2619,20 @@ def plotly( coordinates of the k-points. The values are the labels. e.g. ``klabels = {(0.0,0.0,0.0): "$\Gamma$", (0.5,0,0):"L"}``. e0: Option used to define the zero of energy in the band structure plot. Possible values: + - ``fermie``: shift all eigenvalues to have zero energy at the Fermi energy (``self.fermie``). - - Number e.g e0=0.5: shift all eigenvalues to have zero energy at 0.5 eV - - None: Don't shift energies, equivalent to e0=0 + - Number e.g e0=0.5: shift all eigenvalues to have zero energy at 0.5 eV + - None: Don't shift energies, equivalent to e0=0 + fig: plotly figure or None if a new figure should be created. rcd: PlotlyRowColDesc object used when fig is not None to specify the (row, col) of the subplot in the grid. ylims: Set the data limits for the y-axis. Accept tuple e.g. ``(left, right)`` points: Marker object with the position and the size of the marker. Used for plotting purpose e.g. QP energies, energy derivatives. with_gaps: True to add markers and arrows showing the fundamental and the direct gap. - IMPORTANT: If the gaps are now showed correctly in a non-magnetic semiconductor, - call `ebands.set_fermie_to_vbm()` to align the Fermi level at the top of the valence - bands before executing `ebands.plot(). + IMPORTANT: If the gaps are not shown correctly in a non-magnetic semiconductor, + call ``ebands.set_fermie_to_vbm()`` to align the Fermi level at the top of the valence + bands before executing ``ebands.plotly()``. The Fermi energy stored in the object, indeed, comes from the GS calculation that produced the DEN file. If the k-mesh used for the GS and the CBM is e.g. at Gamma, the Fermi energy will be underestimated and a manual alignment is needed. @@ -3400,9 +3404,11 @@ def plot_lws_vs_e0( Args: ax: |matplotlib-Axes| or None if a new figure should be created. e0: Option used to define the zero of energy in the band structure plot. Possible values: + - ``fermie``: shift all eigenvalues to have zero energy at the Fermi energy (``self.fermie``). - - Number e.g e0=0.5: shift all eigenvalues to have zero energy at 0.5 eV - - None: Don't shift energies, equivalent to e0=0 + - Number e.g e0=0.5: shift all eigenvalues to have zero energy at 0.5 eV + - None: Don't shift energies, equivalent to e0=0 + function: Apply this function to the values before plotting exchange_xy: True to exchange x-y axis. xlims, ylims: Set the data limits for the x-axis or the y-axis. Accept tuple e.g. ``(left, right)`` diff --git a/abipy/electrons/gw.py b/abipy/electrons/gw.py index c1ec3a808..0ae0e7cae 100644 --- a/abipy/electrons/gw.py +++ b/abipy/electrons/gw.py @@ -41,7 +41,7 @@ set_grid_legend, set_visible, ) -from abipy.tools.typing import Figure, KptSelect +from abipy.tools.typing import Figure, KptSelect, VectorLike __all__ = [ "QPState", diff --git a/abipy/electrons/gwr.py b/abipy/electrons/gwr.py index 1e12c3b28..aed953629 100644 --- a/abipy/electrons/gwr.py +++ b/abipy/electrons/gwr.py @@ -36,7 +36,7 @@ set_grid_legend, set_visible, ) -from abipy.tools.typing import Figure, KptSelect +from abipy.tools.typing import Figure, KptSelect, VectorLike __all__ = [ "GwrFile", @@ -2257,7 +2257,7 @@ def plot_qpfield_vs_e0( **kwargs, ) -> Figure: """ - For each file in the GWR robot, plot one of the attributes of :class:`QpTempStat + For each file in the GWR robot, plot one of the attributes of :class:`QpTempStat` as a function of the KS energy. Args: diff --git a/abipy/electrons/tchim.py b/abipy/electrons/tchim.py index ade803b92..debcbd860 100644 --- a/abipy/electrons/tchim.py +++ b/abipy/electrons/tchim.py @@ -15,7 +15,7 @@ # import pandas as pd import abipy.core.abinit_units as abu -# from abipy.core.kpoints import Kpoint, KpointList +from abipy.core.kpoints import Kpoint from abipy.core.mixins import AbinitNcFile, Has_ElectronBands, Has_Structure # , NotebookWriter # from monty.termcolor import cprint @@ -468,17 +468,20 @@ class TchimVsSus: produced by the legacy algorithm based on the Adler-Wiser expression. Example: - gpairs = [ - ((0, 0, 0), (1, 0, 0)), - ((1, 0, 0), (0, 1, 0)), - ] - qpoint_list = [ - [0, 0, 0], - [0.5, 0.5, 0], - ] - - with TchimVsSus("runo_DS3_TCHIM.nc", "AW_CD/runo_DS3_SUS.nc") as o: - o.expose_qpoints_gpairs(qpoint_list, gpairs, exposer="mpl") + + .. code-block:: python + + gpairs = [ + ((0, 0, 0), (1, 0, 0)), + ((1, 0, 0), (0, 1, 0)), + ] + qpoint_list = [ + [0, 0, 0], + [0.5, 0.5, 0], + ] + + with TchimVsSus("runo_DS3_TCHIM.nc", "AW_CD/runo_DS3_SUS.nc") as o: + o.expose_qpoints_gpairs(qpoint_list, gpairs, exposer="mpl") """ def __init__(self, tchim_filepath: str, sus_filepath: str): diff --git a/abipy/eph/gkq.py b/abipy/eph/gkq.py index 8cfd4ad47..a252f31ba 100644 --- a/abipy/eph/gkq.py +++ b/abipy/eph/gkq.py @@ -280,7 +280,7 @@ def get_absg_kpoint(self, kpoint, eps_mev: float = 0.01) -> tuple[np.ndarray, np def get_qe_dataframe(self, kpoint) -> pd.DataFrame: """ - Build and return a dataframe with |g(k,q)|^2 for the given k-point and all bands. + Build and return a dataframe with ``|g(k,q)|^2`` for the given k-point and all bands. Args: kpoint: @@ -387,6 +387,7 @@ def plot_diff_with_other(self, other, mode="phonon", ax_list=None, labels=None, """ Produce scatter plot and histogram to compare the gkq matrix elements stored in two files. + Args: other: other GkqFile instance. mode: "phonon" to plot eph matrix elements in the phonon representation, "atom" for atomic representation. @@ -568,7 +569,7 @@ def plot_gkq2_qpath( **kwargs, ) -> Figure: r""" - Plot the magnitude of the electron-phonon matrix elements + Plot the magnitude of the electron-phonon matrix elements ```` for a given set of (band_kq, band, k) as a function of the q-point. Args: diff --git a/abipy/eph/gstore.py b/abipy/eph/gstore.py index 4f4ecf41f..db6c08c9f 100644 --- a/abipy/eph/gstore.py +++ b/abipy/eph/gstore.py @@ -300,12 +300,12 @@ def plot_gwpt_hist( spin: spin index ax: |matplotlib-Axes| or None if a new figure should be created. hist_kwargs: - ratio_min: lower bound used to clip the ratio |g^GWPT|/|g^KS| + ratio_min: lower bound used to clip the ratio ``|g^GWPT|/|g^KS|`` before histogramming. Defaults to 0.0. - ratio_max: upper bound used to clip the ratio |g^GWPT|/|g^KS| + ratio_max: upper bound used to clip the ratio ``|g^GWPT|/|g^KS|`` before histogramming. Defaults to 3.0. Values outside [ratio_min, ratio_max] are dropped (they are usually numerical - artifacts from |g^KS| being close to zero). + artifacts from ``|g^KS|`` being close to zero). fontsize: legend and label fontsize. """ if not self.has_gwpt: @@ -530,10 +530,10 @@ def plot_gwpt_vs_ks_scatter( **kwargs, ) -> Figure: """ - Scatter plot of |g^GW| vs |g^KS| over all matrix elements for a given spin. + Scatter plot of ``|g^GW|`` vs ``|g^KS|`` over all matrix elements for a given spin. Each point is one (q, k, band_kq, perturbation, band_k) tuple. Points are - colored by the ratio |g^GW|/|g^KS|, and a linear least-squares fit is + colored by the ratio ``|g^GW|/|g^KS|``, and a linear least-squares fit is overlaid. An optional inset shows the full data range so outliers are visible without disturbing the zoomed main axes. @@ -545,7 +545,7 @@ def plot_gwpt_vs_ks_scatter( ratio_max: optional upper bound of the ratio window. Points with ratio > ratio_max are dropped. If None (default), no upper bound is applied. - ks_tol: |g^KS| values <= ks_tol are discarded to avoid huge + ks_tol: ``|g^KS|`` values <= ks_tol are discarded to avoid huge ratios from a near-zero denominator. Default 1e-7. fit_intercept: if True, fit y = a*x + b; otherwise fit y = a*x (forced through the origin). @@ -554,7 +554,7 @@ def plot_gwpt_vs_ks_scatter( the 1st/99th percentile of the ratio distribution so a few outliers don't wash out the rest of the colors. zoom_factor: the main axes go from 0 to - zoom_factor * max(median(|g^KS|), median(|g^GW|)) on both axes. + zoom_factor * max(median(``|g^KS|``), median(``|g^GW|``)) on both axes. with_inset: if True, add an inset showing the full data range with a rectangle indicating the zoom window. inset_loc: matplotlib location string for the inset. @@ -804,8 +804,8 @@ def g2_ks(self) -> np.ndarray | None: def get_dataframe(self, what: str = "g2") -> pd.DataFrame: """ - Build and return a dataframe with all the |g(k,q)|^2 if what == "g2" or - all |v_nk|^2 if what == "v2". + Build and return a dataframe with all the ``|g(k,q)|^2`` if what == "g2" or + all ``|v_nk|^2`` if what == "v2". """ if what == "g2": df = nparr_to_df("g2", self.g2, ["iq", "ik", "imode", "m_kq", "n_k"]) @@ -865,7 +865,7 @@ def get_g_qpt_kpt(self, qpoint, kpoint, what) -> np.ndarray: Return numpy array with e-ph matrix elements for the given (qpoint, kpoint) pair. Args: - what="g2" for |g(k,q)|^2, "g" for g(k,q) + what: "g2" for ``|g(k,q)|^2``, "g" for ``g(k,q)``. """ # Find the internal indices of (qpoint, kpoint) iq_g, qpoint = self.gstore.r.find_iq_glob_qpoint(qpoint, self.spin) @@ -880,10 +880,10 @@ def get_g_qpt_kpt(self, qpoint, kpoint, what) -> np.ndarray: def get_gdf_at_qpt_kpt(self, qpoint, kpoint, what="g2") -> pd.DataFrame: """ - Build and return a dataframe with the |g(k,q)|^2 for the given (qpoint, kpoint) pair. + Build and return a dataframe with the ``|g(k,q)|^2`` for the given (qpoint, kpoint) pair. Args: - what="g2" for |g(k,q)|^2, "g" for g(k,q) + what: "g2" for ``|g(k,q)|^2``, "g" for ``g(k,q)``. """ g2_slice = self.get_g_qpt_kpt(qpoint, kpoint, what) df = nparr_to_df(what, g2_slice, ["imode", "m_kq", "n_k"]) @@ -1200,12 +1200,12 @@ def compare_gvals_with_reconstruction(self, ax_list=None, tol: float = 1e-6, mag and then reconstructed by symmetry at the end of the run. The goal of this method is to check that both calculations produce the same results. by printing some statistics and producing, for each spin, a 2x2 grid of parity plots for - the e-ph matrix elements: |g| (top-left), phase of g in degrees (top-right), Re(g) + the e-ph matrix elements: ``|g|`` (top-left), phase of g in degrees (top-right), Re(g) (bottom-left), and Im(g) (bottom-right). A single complex matrix element can be wrong in different ways -- only in magnitude, only in phase, or in a way that's obvious in the - Cartesian (Re, Im) view but not in the polar (|g|, phase) one or vice versa (e.g. a small - |g| with a large phase error can still look fine in Re/Im if both components happen to - be small) -- so looking at |g1 - g2| alone, as the original version of this method did, + Cartesian (Re, Im) view but not in the polar (``|g|``, phase) one or vice versa (e.g. a small + ``|g|`` with a large phase error can still look fine in Re/Im if both components happen to + be small) -- so looking at ``|g1 - g2|`` alone, as the original version of this method did, cannot distinguish these failure modes; all four views are needed together. Only the (k, q) points that were actually reconstructed by symmetry in the first file @@ -1216,22 +1216,22 @@ def compare_gvals_with_reconstruction(self, ax_list=None, tol: float = 1e-6, mag flattening the whole (glob_nq, glob_nk, natom3, nb_kq, nb_k) array, as done previously, buries the actual test: e.g. (k, q) points that reconstruct exactly (diff ~1e-15) get averaged together with (k, q) points that are completely wrong (diff ~O(1)) into a single - "mean |g1-g2|" scalar, and the parity plot is dominated by the many small-magnitude, + "mean ``|g1-g2|``" scalar, and the parity plot is dominated by the many small-magnitude, off-diagonal-like matrix elements shared by both categories, so a ~30/70 exact/wrong split can look like an innocuous scatter around y = x. All four plots share the same matched/mismatched classification, based on the full complex difference (magnitude AND phase), so a point that lands on the y = x diagonal in the magnitude plot but is colored "mismatched" is a pure phase error, and vice versa. - Matrix elements with |g| < mag_tol (in either file) are dropped from the phase plot only, - since the phase of a near-zero complex number is numerically meaningless (Re/Im and |g| - remain well-defined, and are informative, even when |g| is tiny, so they keep every + Matrix elements with ``|g|`` < mag_tol (in either file) are dropped from the phase plot only, + since the phase of a near-zero complex number is numerically meaningless (Re/Im and ``|g|`` + remain well-defined, and are informative, even when ``|g|`` is tiny, so they keep every point). Because phase is an angle, two equal phases can be reported ~360 degrees apart across the +-180 degree branch cut; three parallel y = x, y = x - 360, y = x + 360 reference lines are drawn so such wrapped points still show up "on the diagonal" instead of looking like large, spurious mismatches. - The worst matrix element(s) (largest |g1 - g2|, e.g. the "Max absolute difference" + The worst matrix element(s) (largest ``|g1 - g2|``, e.g. the "Max absolute difference" printed below) are marked with a black-edged star in ALL FOUR plots and their location (global q/k indices, perturbation, and bra/ket band) is printed, since with thousands of tiny (s=1, alpha=0.3) points a lone outlier is otherwise easy to miss by eye even though @@ -1246,11 +1246,11 @@ def compare_gvals_with_reconstruction(self, ax_list=None, tol: float = 1e-6, mag like a huge disagreement in the reported slope/RMSE. Args: - tol: Tolerance on the per-(k, q) max |g1 - g2| used to classify a symmetrized point + tol: Tolerance on the per-(k, q) max ``|g1 - g2|`` used to classify a symmetrized point as an exact match. Drives the color-coding in both the magnitude and phase plots. - mag_tol: Matrix elements with |g| below this threshold (in either file) are excluded + mag_tol: Matrix elements with ``|g|`` below this threshold (in either file) are excluded from the phase parity plot only. - n_outliers: Number of worst matrix elements (by |g1 - g2|) to mark and print per spin. + n_outliers: Number of worst matrix elements (by ``|g1 - g2|``) to mark and print per spin. use_hexbin: If True, render the (typically large) matched-point cloud in each panel as a density-colored hexbin plot instead of a scatter plot -- much faster and more legible when there are many thousands of points. Mismatched points are diff --git a/abipy/eph/rta.py b/abipy/eph/rta.py index 4bacd9732..313153fa1 100644 --- a/abipy/eph/rta.py +++ b/abipy/eph/rta.py @@ -690,9 +690,8 @@ def plot_mobility_kconv( Args: eh: 0 for electrons, 1 for holes. bte: list of transport formalism to plot (serta, mrta, ibte) - mode: mode for the convergence plot. 'full': normal plot of the mobility - 'relative': plot of the mobility relative to - the value obtained with the densest grid + mode: mode for the convergence plot. 'full' for the normal plot of the mobility, + 'relative' to plot the mobility relative to the value obtained with the densest grid. component: Cartesian component to plot ('xx', 'xy', ...) itemp: temperature index. spin: Spin index. diff --git a/abipy/eph/vpq.py b/abipy/eph/vpq.py index f73ff3821..be99bf7a3 100644 --- a/abipy/eph/vpq.py +++ b/abipy/eph/vpq.py @@ -500,7 +500,7 @@ def get_b2_interpolator_state(self, interp_method: str) -> BzRegularGridInterpol def write_a2_bxsf(self, filepath: PathLike, fill_value: float = 0.0) -> None: r""" - Export \sum_n |A_{pnk}|^2 in BXSF format suitable for visualization with xcrysden (use ``xcrysden --bxsf FILE``). + Export ``\sum_n |A_{pnk}|^2`` in BXSF format suitable for visualization with xcrysden (use ``xcrysden --bxsf FILE``). Requires gamma-centered k-mesh. Args: @@ -518,7 +518,7 @@ def write_a2_bxsf(self, filepath: PathLike, fill_value: float = 0.0) -> None: def write_b2_bxsf(self, filepath: PathLike, fill_value: float = 0.0) -> None: r""" - Export \sum_{\nu} |B_{q\nu}|^2 in BXSF format suitable for visualization with xcrysden (use ``xcrysden --bxsf FILE``). + Export ``\sum_{\nu} |B_{q\nu}|^2`` in BXSF format suitable for visualization with xcrysden (use ``xcrysden --bxsf FILE``). Args: filepath: BXSF filename. diff --git a/abipy/examples/flows/run_mgb2_phonons_nkpt_tsmear.py b/abipy/examples/flows/run_mgb2_phonons_nkpt_tsmear.py index 48bbe850f..33526ef8a 100755 --- a/abipy/examples/flows/run_mgb2_phonons_nkpt_tsmear.py +++ b/abipy/examples/flows/run_mgb2_phonons_nkpt_tsmear.py @@ -103,7 +103,7 @@ def main(options): # # .. code-block:: shell # -# abicomp.py ddb flow_mgb2_phonons_nkpt_tsmear/w*/outdata/*_DDB -ipy +# abicomp.py ddb flow_mgb2_phonons_nkpt_tsmear/w*/outdata/*_DDB -ipy # # to build a robot from the output DDB files and start the ipython shell. # diff --git a/abipy/examples/flows/run_qha_zsisa.py b/abipy/examples/flows/run_qha_zsisa.py index f5105da8c..8165b9645 100755 --- a/abipy/examples/flows/run_qha_zsisa.py +++ b/abipy/examples/flows/run_qha_zsisa.py @@ -45,7 +45,8 @@ JSON file with the location of the different files (GSR.nc, DDB) on the filesystem. To reconstruct a python object from file, use: -``` + .. code-block:: python + from abipy.zsisa import ZsisaResults data = ZsisaResults.json_load("ABSPATH_TO_FILE") @@ -53,7 +54,6 @@ data.get_dataframe() data.plot_lattice_vs_temp() data.plot_thermal_expansion() -``` """ import os diff --git a/abipy/examples/plot/plot_ddb_asr.py b/abipy/examples/plot/plot_ddb_asr.py index bcd0af44a..cf9ff56aa 100755 --- a/abipy/examples/plot/plot_ddb_asr.py +++ b/abipy/examples/plot/plot_ddb_asr.py @@ -43,7 +43,7 @@ plotter.combiplotly() # %% -# To disable the DOS computation, set ``nqsmall` to 0: +# To disable the DOS computation, set ``nqsmall`` to 0: plotter = ddb.anacompare_asr(asr_list=(0, 2), nqsmall=0, ndivsm=10, dipdip=-1) diff --git a/abipy/flowtk/dfpt_flows.py b/abipy/flowtk/dfpt_flows.py index 85f77d396..e755febf8 100644 --- a/abipy/flowtk/dfpt_flows.py +++ b/abipy/flowtk/dfpt_flows.py @@ -36,7 +36,7 @@ def from_scf_input( with_quad: bool = True, with_flexoe: bool = False, manager=None, - ) -> ConvBecsEpsinfFlow: + ) -> ConvBecsEpsFlow: """ Build a flow for convergence studies wrt ngkpt from an |AbinitInput| representing a GS-SCF calculation. diff --git a/abipy/flowtk/gwr_works.py b/abipy/flowtk/gwr_works.py index fb9ee908b..4578ed3fb 100644 --- a/abipy/flowtk/gwr_works.py +++ b/abipy/flowtk/gwr_works.py @@ -127,7 +127,7 @@ class GWRChiCompareWork(_BaseGWRWork): so that one can compare the two quantities. .. rubric:: Inheritance Diagram - .. inheritance-diagram:: GWRChiCompareConvWork + .. inheritance-diagram:: GWRChiCompareWork """ @classmethod diff --git a/abipy/flowtk/scheduler_error_parsers.py b/abipy/flowtk/scheduler_error_parsers.py index 98b5409e1..74b2ae0f1 100644 --- a/abipy/flowtk/scheduler_error_parsers.py +++ b/abipy/flowtk/scheduler_error_parsers.py @@ -242,14 +242,14 @@ class AbstractErrorParser(metaclass=ABCMeta): program itself, i.e. segmentation faults. A concrete implementation of this class for a specific scheduler needs a class attribute ERRORS for containing a - dictionary specifying error: + dictionary specifying error:: - ERRORS = {ErrorClass: { - 'file_specifier' : { - 'string': "the string to be looked for", - 'meta_filter': "string specifing the regular expression to obtain the meta data" + ERRORS = {ErrorClass: { + 'file_specifier' : { + 'string': "the string to be looked for", + 'meta_filter': "string specifing the regular expression to obtain the meta data" + } } - } """ diff --git a/abipy/flowtk/wrappers.py b/abipy/flowtk/wrappers.py index 2bdf9f702..cc8021e2a 100644 --- a/abipy/flowtk/wrappers.py +++ b/abipy/flowtk/wrappers.py @@ -392,17 +392,17 @@ def plot_ftinterp_parity(self, dvdb_path, ngqpt, workdir=None, coarse_ngqpt=None group=None, min_mag_frac=1e-6, bins=200, **kwargs) -> Figure: """ Run :meth:`test_ftinterp` and produce a two-panel parity plot comparing ab-initio and - Fourier-interpolated V1(r): |V1(r)| (log-log) and arg(V1(r)) (radians), both ab-initio + Fourier-interpolated V1(r): ``|V1(r)|`` (log-log) and arg(V1(r)) (radians), both ab-initio (x-axis) vs interpolated (y-axis), as density-colored hexbins with a y=x reference line. Args: - dvdb_path, ngqpt, workdir, coarse_ngqpt, ddb_path, dvdb_add_lr, rspace_cell, - symv1scf, qdamp, potfile: See :meth:`test_ftinterp`. + dvdb_path, ngqpt, workdir, coarse_ngqpt, ddb_path, dvdb_add_lr, rspace_cell, symv1scf, qdamp, potfile: + See :meth:`test_ftinterp`. group: "self" (native-mesh round-trip) or "coarse" (the real accuracy test, requires ``coarse_ngqpt``). If None, defaults to "coarse" if ``coarse_ngqpt`` is given, else "self". - min_mag_frac: Both panels exclude points with |V1_abinitio| below this fraction of - max|V1_abinitio|: such points are dominated by FFT/roundoff noise rather than + min_mag_frac: Both panels exclude points with ``|V1_abinitio|`` below this fraction of + ``max|V1_abinitio|``: such points are dominated by FFT/roundoff noise rather than real signal, and phase is meaningless there. bins: hexbin grid resolution. @@ -539,17 +539,17 @@ def plot_symcheck_parity(self, dvdb_path, ngqpt, qpt, workdir=None, ddb_path="", rspace_cell=0, symv1scf=0, qdamp=0.1, potfile=None, min_mag_frac=1e-6, bins=200, **kwargs) -> Figure: """ - Run :meth:`test_symcheck` and produce a two-panel parity plot: |V1(r)| (log-log) and + Run :meth:`test_symcheck` and produce a two-panel parity plot: ``|V1(r)|`` (log-log) and arg(V1(r)) (radians), independently-interpolated target (x-axis) vs the `v1phq_rotate`-predicted value from the source q-point (y-axis), pooled over every symmetry operation and both signs of time reversal, as density-colored hexbins with a y=x reference line. Args: - dvdb_path, ngqpt, qpt, workdir, ddb_path, dvdb_add_lr, rspace_cell, symv1scf, - qdamp, potfile: See :meth:`test_symcheck`. - min_mag_frac: Both panels exclude points with |V1_target| below this fraction of - max|V1_target|: such points are dominated by FFT/roundoff noise rather than + dvdb_path, ngqpt, qpt, workdir, ddb_path, dvdb_add_lr, rspace_cell, symv1scf, qdamp, potfile: + See :meth:`test_symcheck`. + min_mag_frac: Both panels exclude points with ``|V1_target|`` below this fraction of + ``max|V1_target|``: such points are dominated by FFT/roundoff noise rather than real signal, and phase is meaningless there. bins: hexbin grid resolution. diff --git a/abipy/ml/relax_scanner.py b/abipy/ml/relax_scanner.py index c1078e550..2591bed6d 100644 --- a/abipy/ml/relax_scanner.py +++ b/abipy/ml/relax_scanner.py @@ -14,6 +14,7 @@ import numpy as np import pandas as pd +from ase import Atoms from ase.io.vasp import write_vasp # write_vasp_xdatcar, from pymatgen.core.lattice import Lattice from pymatgen.util.coord import pbc_shortest_vectors diff --git a/abipy/ppcodes/base_parser.py b/abipy/ppcodes/base_parser.py index 634393967..96cef85dd 100644 --- a/abipy/ppcodes/base_parser.py +++ b/abipy/ppcodes/base_parser.py @@ -15,10 +15,6 @@ class BaseParser(metaclass=abc.ABCMeta): Abstract class defining the interface that must be provided by the parsers used to extract results from the output file of a pseudopotential generator a.k.a. ppgen - - Attributes: - errors: List of strings with errors reported by the pp generator - warnings: List of strings with the warnings reported by the pp generator. """ Error = ParserError @@ -41,7 +37,7 @@ def errors(self) -> list[str]: @property def warnings(self) -> list[str]: - """List of strings with possible errors reported by the generator at run-time.""" + """List of strings with possible warnings reported by the generator at run-time.""" return self._warnings @abc.abstractmethod diff --git a/abipy/scripts/abicomp.py b/abipy/scripts/abicomp.py index 2bc9b5617..894350dda 100755 --- a/abipy/scripts/abicomp.py +++ b/abipy/scripts/abicomp.py @@ -16,19 +16,19 @@ Examples: Compare lattice parameters for a list of CIF/netcdf files: - $ abicomp.py structure *.cif + ``$ abicomp.py structure *.cif`` Compare electron band structures from two GSR files: - $ abicomp.py ebands run1_GSR.nc run2_GSR.nc + ``$ abicomp.py ebands run1_GSR.nc run2_GSR.nc`` Group structures by similarity (using pymatgen's StructureMatcher): - $ abicomp.py structure --group *.poscar + ``$ abicomp.py structure --group *.poscar`` Compare space group recognition between Abinit and spglib: - $ abicomp.py spg out_GSR.nc + ``$ abicomp.py spg out_GSR.nc`` Batch compare results from all GSR files in a directory: - $ abicomp.py gsr . + ``$ abicomp.py gsr .`` """ from __future__ import annotations diff --git a/abipy/tools/context_managers.py b/abipy/tools/context_managers.py index a6437a4c7..bc3be38f1 100644 --- a/abipy/tools/context_managers.py +++ b/abipy/tools/context_managers.py @@ -56,7 +56,7 @@ def temporary_change_attributes(something, **kwargs): """ https://stackoverflow.com/questions/38531851/how-to-assign-member-variables-temporarily/38532086 - Usage: + Usage:: class Something(object): def __init__(self, x, y): diff --git a/abipy/tools/numtools.py b/abipy/tools/numtools.py index d6b1f9f84..eb7c23241 100644 --- a/abipy/tools/numtools.py +++ b/abipy/tools/numtools.py @@ -7,6 +7,7 @@ from monty.collections import dict2namedtuple from abipy.tools import duck +from abipy.tools.typing import Figure def print_stats_arr(arr: np.ndarray, take_abs=False) -> None: diff --git a/docs/conf.py b/docs/conf.py index 5e73c6cfa..68b857317 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -91,7 +91,11 @@ def load_mod(filepath): # font='sans-serif', font_scale=1, color_codes=False, rc=None) +# Local extensions (youtube directive) +sys.path.insert(0, os.path.join(ABIPY_ROOT, "docs", "my_extensions")) + extensions += [ + "youtube", "IPython.sphinxext.ipython_directive", "IPython.sphinxext.ipython_console_highlighting", "matplotlib.sphinxext.plot_directive", @@ -472,6 +476,9 @@ def setup(app): with open("links.rst", "rt") as fh: rst_epilog = fh.read() +# sphinx_gallery_conf contains functions and cannot be pickled: harmless, don't warn. +suppress_warnings = ["config.cache"] + # http://www.sphinx-doc.org/en/stable/ext/extlinks.html#confval-extlinks # :abivar:`ecut` # ABINIT_DOCS_URL = diff --git a/docs/links.rst b/docs/links.rst index d0af61091..c41988772 100644 --- a/docs/links.rst +++ b/docs/links.rst @@ -74,6 +74,7 @@ .. _abicomp.py: https://abinit.github.io/abipy/scripts/abicomp.html .. _abinp.py: https://abinit.github.io/abipy/scripts/abinp.html .. _abicheck.py: https://abinit.github.io/abipy/scripts/abicheck.html +.. _abirun.py: https://abinit.github.io/abipy/scripts/abirun.html .. _abips.py: https://abinit.github.io/abipy/scripts/abips.html .. _oncv.py: https://abinit.github.io/abipy/scripts/oncv.html @@ -107,6 +108,13 @@ .. |SkwInterpolator| replace:: :class:`abipy.core.skw.SkwInterpolator` .. |ElectronDos| replace:: :class:`abipy.electrons.ebands.ElectronDos` .. |ElectronDosPlotter| replace:: :class:`abipy.electrons.ebands.ElectronDosPlotter` +.. |ElectronBands3D| replace:: :class:`abipy.electrons.ebands.ElectronBands3D` +.. |Gqk| replace:: :class:`abipy.eph.gstore.Gqk` +.. |EventHandler| replace:: :class:`abipy.flowtk.events.EventHandler` +.. |NodeResults| replace:: :class:`abipy.flowtk.nodes.NodeResults` +.. |WorkResults| replace:: :class:`abipy.flowtk.works.WorkResults` +.. |AtdepTask| replace:: :class:`abipy.flowtk.tasks.AtdepTask` +.. |abiopen| replace:: :func:`abipy.abilab.abiopen` .. |PhononBands| replace:: :class:`abipy.dfpt.phonons.PhononBands` .. |Node| replace:: :class:`abipy.flowtk.nodes.Node` .. |Task| replace:: :class:`abipy.flowtk.tasks.Task` @@ -154,6 +162,8 @@ .. |numpy-array| replace:: :class:`numpy.ndarray` .. |plotly.graph_objects.Figure| replace:: :class:`plotly.graph_objects.Figure` .. |plotly-Figure| replace:: :class:`plotly.graph_objects.Figure` +.. |plotly.graph_objects.scatter| replace:: :class:`plotly.graph_objects.Scatter` +.. |plotly.graph_objects.scatter.Line| replace:: :class:`plotly.graph_objects.scatter.Line` .. Badges .. |pypi-version| image:: https://badge.fury.io/py/abipy.svg diff --git a/docs/scripts/abicheck.rst b/docs/scripts/abicheck.rst index 687a88ad8..93113f447 100644 --- a/docs/scripts/abicheck.rst +++ b/docs/scripts/abicheck.rst @@ -1,4 +1,4 @@ -.. _abicheck.py: +.. _abicheck-script: ^^^^^^^^^^^^^^^ ``abicheck.py`` diff --git a/docs/scripts/abicomp.rst b/docs/scripts/abicomp.rst index b0fb670d9..d8337f960 100644 --- a/docs/scripts/abicomp.rst +++ b/docs/scripts/abicomp.rst @@ -1,4 +1,4 @@ -.. _abicomp.py: +.. _abicomp-script: ^^^^^^^^^^^^^^ ``abicomp.py`` diff --git a/docs/scripts/abidoc.rst b/docs/scripts/abidoc.rst index 6b0f906a2..25dcd8611 100644 --- a/docs/scripts/abidoc.rst +++ b/docs/scripts/abidoc.rst @@ -1,4 +1,4 @@ -.. _abidoc.py: +.. _abidoc-script: ^^^^^^^^^^^^^ ``abidoc.py`` diff --git a/docs/scripts/abinp.rst b/docs/scripts/abinp.rst index 05b9f778e..1ed8a5098 100644 --- a/docs/scripts/abinp.rst +++ b/docs/scripts/abinp.rst @@ -1,4 +1,4 @@ -.. _abinp.py: +.. _abinp-script: ^^^^^^^^^^^^ ``abinp.py`` diff --git a/docs/scripts/abiopen.rst b/docs/scripts/abiopen.rst index 444729911..43e81e1e6 100644 --- a/docs/scripts/abiopen.rst +++ b/docs/scripts/abiopen.rst @@ -1,4 +1,4 @@ -.. _abiopen.py: +.. _abiopen-script: ^^^^^^^^^^^^^^ ``abiopen.py`` diff --git a/docs/scripts/abips.rst b/docs/scripts/abips.rst index 8db453619..722b70364 100644 --- a/docs/scripts/abips.rst +++ b/docs/scripts/abips.rst @@ -1,4 +1,4 @@ -.. _abips.py: +.. _abips-script: ^^^^^^^^^^^^ ``abips.py`` diff --git a/docs/scripts/abirun.rst b/docs/scripts/abirun.rst index cae3fb020..3d54502c8 100644 --- a/docs/scripts/abirun.rst +++ b/docs/scripts/abirun.rst @@ -1,4 +1,4 @@ -.. _abirun.py: +.. _abirun-script: ^^^^^^^^^^^^^ ``abirun.py`` diff --git a/docs/scripts/abistruct.rst b/docs/scripts/abistruct.rst index dccaba9c7..b7b55867e 100644 --- a/docs/scripts/abistruct.rst +++ b/docs/scripts/abistruct.rst @@ -1,4 +1,4 @@ -.. _abistruct.py: +.. _abistruct-script: ^^^^^^^^^^^^^^^^ ``abistruct.py`` diff --git a/docs/scripts/abiview.rst b/docs/scripts/abiview.rst index c286f1393..2c25fbc48 100644 --- a/docs/scripts/abiview.rst +++ b/docs/scripts/abiview.rst @@ -1,4 +1,4 @@ -.. _abiview.py: +.. _abiview-script: ^^^^^^^^^^^^^^ ``abiview.py`` diff --git a/docs/scripts/oncv.rst b/docs/scripts/oncv.rst index 50f7ee5da..7d40fa542 100644 --- a/docs/scripts/oncv.rst +++ b/docs/scripts/oncv.rst @@ -1,4 +1,4 @@ -.. _oncv.py: +.. _oncv-script: ^^^^^^^^^^^ ``oncv.py`` diff --git a/docs/workflows/taskmanager.rst b/docs/workflows/taskmanager.rst index f32d66a06..e8a312ec5 100644 --- a/docs/workflows/taskmanager.rst +++ b/docs/workflows/taskmanager.rst @@ -231,7 +231,7 @@ The ``job.sh`` script has been generated by the ``TaskManager`` from the informa Since we are using ``qtype: shell``, it is a simple shell script that executes the code directly. The script becomes more complex when jobs are submitted to a resource manager on a cluster. -We usually interact with an AbiPy flow via the :ref:`abirun.py` script, whose syntax is:: +We usually interact with an AbiPy flow via the :ref:`abirun.py ` script, whose syntax is:: abirun.py FLOWDIR command [options] @@ -305,7 +305,7 @@ to a given policy, and submits the task with the optimized parameters. Since no other task can be executed at this point, the script exits, and we have to wait for the SCF task to complete before running the second part of the flow. -At each iteration, :ref:`abirun.py` prints a table with the status of the tasks. +At each iteration, :ref:`abirun.py ` prints a table with the status of the tasks. The columns have the following meaning: ``Queue`` @@ -673,7 +673,7 @@ and reconnect the next day to collect the results. Inspecting the Flow ------------------- -:ref:`abirun.py` also provides tools to analyze the results of the flow at runtime. +:ref:`abirun.py ` also provides tools to analyze the results of the flow at runtime. The simplest command is:: abirun.py FLOWDIR tail @@ -689,7 +689,7 @@ If matplotlib_ is installed, you may want to use:: Several AbiPy tasks provide an ``inspect`` method that produces matplotlib figures with data extracted from the output files. For example, a ``GsTask`` plots the evolution of the ground-state SCF cycle. -The ``inspect`` command of :ref:`abirun.py` simply loops over the tasks of the flow and +The ``inspect`` command of :ref:`abirun.py ` simply loops over the tasks of the flow and calls the ``inspect`` method of each one. The command:: @@ -801,7 +801,7 @@ by the event handlers: Troubleshooting --------------- -Two :ref:`abirun.py` commands are especially useful when something goes wrong: ``events`` and ``debug``. +Two :ref:`abirun.py ` commands are especially useful when something goes wrong: ``events`` and ``debug``. To print the Abinit events (warnings, errors, comments) found in the log files of the tasks, use:: From ba87482fe32e94218d9457908faaced795202f49 Mon Sep 17 00:00:00 2001 From: Matteo Giantomassi Date: Thu, 1 Oct 2026 12:45:44 +0200 Subject: [PATCH 22/23] Fix warnings in docs --- abipy/electrons/ebands.py | 8 ++------ abipy/examples/flows/README.txt | 2 +- abipy/flowtk/tasks.py | 8 ++++---- abipy/tools/typing.py | 2 +- docs/conf.py | 20 ++++++++++++++++++++ 5 files changed, 28 insertions(+), 12 deletions(-) diff --git a/abipy/electrons/ebands.py b/abipy/electrons/ebands.py index 37f692ddb..f3a754aab 100644 --- a/abipy/electrons/ebands.py +++ b/abipy/electrons/ebands.py @@ -4974,15 +4974,11 @@ def __init__(self, mesh, spin_dos, nelect, fermie=None, spin_idos=None): Args: mesh: array-like object with the mesh points in eV. spin_dos: array-like object with the DOS for the different spins (even if spin-unpolarized calculation). - Shape is: - (1, nw) if spin-unpolarized. - (2, nw) if spin-polarized. + Shape is (1, nw) if spin-unpolarized, (2, nw) if spin-polarized. nelect: Number of electrons in the unit cell. fermie: Fermi level in eV. If None, fermie is obtained from the idos integral. spin_idos: array-like object with the IDOS for the different spins (even if spin-unpolarized calculation). - Shape is: - (1, nw) if spin-unpolarized. - (2, nw) if spin-polarized case. + Shape is (1, nw) if spin-unpolarized, (2, nw) if spin-polarized. This argument is usually used when we have an IDOS computed with a more accurate method e.g. tetrahedron integration so that we can use these values instead of integrating the input DOS. diff --git a/abipy/examples/flows/README.txt b/abipy/examples/flows/README.txt index 87eaf3d3c..e22676605 100644 --- a/abipy/examples/flows/README.txt +++ b/abipy/examples/flows/README.txt @@ -5,7 +5,7 @@ Flow Gallery This gallery contains python scripts to generate AbiPy flows from the command line. -Run the scripts to generate the directory with the flow, then use the :ref:`abirun.py` script to execute the flow. +Run the scripts to generate the directory with the flow, then use the :ref:`abirun.py ` script to execute the flow. Alternatively, one can use the ``-s`` option to generate the flow and run it immediately with the scheduler. Use ``--help`` for further information on the available options. diff --git a/abipy/flowtk/tasks.py b/abipy/flowtk/tasks.py index b75d01104..21d4cbae1 100644 --- a/abipy/flowtk/tasks.py +++ b/abipy/flowtk/tasks.py @@ -485,11 +485,11 @@ class TaskPolicy: @classmethod def as_policy(cls, obj: Any) -> TaskPolicy: """ - Converts an object obj into a `:class:`TaskPolicy. Accepts: + Converts an object obj into a :class:`TaskPolicy`. Accepts: - * None - * TaskPolicy - * dict-like object + * None + * TaskPolicy + * dict-like object """ if obj is None: # Use default policy. diff --git a/abipy/tools/typing.py b/abipy/tools/typing.py index c2a9d3b69..0211e0eba 100644 --- a/abipy/tools/typing.py +++ b/abipy/tools/typing.py @@ -31,7 +31,7 @@ # Abipy objects KptLike = Union["Kpoint", VectorLike] -KptSelect = Union[int, "Kpoint", "VectorLike"] +KptSelect = Union[int, "Kpoint", VectorLike] GvecSelect = Union[int, IVectorLike] diff --git a/docs/conf.py b/docs/conf.py index 68b857317..3cab57704 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -11,6 +11,8 @@ # Remove matplotlib agg warnings from generated doc when using plt.show +import logging +import re import warnings # warnings.filterwarnings("ignore", category=UserWarning, @@ -479,6 +481,24 @@ def setup(app): # sphinx_gallery_conf contains functions and cannot be pickled: harmless, don't warn. suppress_warnings = ["config.cache"] + +class _ThirdPartyForwardRefFilter(logging.Filter): + """ + Drop sphinx_autodoc_typehints forward-reference warnings for objects defined in third-party + packages (e.g. numpy, pymatgen) that are imported in AbiPy modules. + These annotations cannot be fixed in AbiPy, while warnings for AbiPy code are kept. + """ + + def filter(self, record: logging.LogRecord) -> bool: + msg = record.getMessage() + if "Cannot resolve forward reference" not in msg: + return True + m = re.search(r"\(module ([\w.]+)\)", msg) + return m is None or m.group(1).split(".")[0] == "abipy" + + +logging.getLogger("sphinx.sphinx_autodoc_typehints").addFilter(_ThirdPartyForwardRefFilter()) + # http://www.sphinx-doc.org/en/stable/ext/extlinks.html#confval-extlinks # :abivar:`ecut` # ABINIT_DOCS_URL = From 789db56f6939af1b074fde4feb5081753e7550bf Mon Sep 17 00:00:00 2001 From: Matteo Giantomassi Date: Sat, 3 Oct 2026 17:38:10 +0200 Subject: [PATCH 23/23] Add skills --- .agents/skills/abipy-cli/SKILL.md | 152 ++++++++++++++++ .agents/skills/abipy-docs-examples/SKILL.md | 169 +++++++++++++++++ .agents/skills/abipy-file-reader/SKILL.md | 125 +++++++++++++ .agents/skills/abipy-flowtk/SKILL.md | 171 ++++++++++++++++++ .agents/skills/abipy-inputs/SKILL.md | 136 ++++++++++++++ .../skills/abipy-integration-tests/SKILL.md | 166 +++++++++++++++++ .agents/skills/abipy-navigate/SKILL.md | 65 +++++++ .agents/skills/abipy-panels/SKILL.md | 106 +++++++++++ .agents/skills/abipy-performance/SKILL.md | 117 ++++++++++++ .agents/skills/abipy-plotting/SKILL.md | 130 +++++++++++++ .agents/skills/abipy-reference-data/SKILL.md | 131 ++++++++++++++ .agents/skills/abipy-robots/SKILL.md | 115 ++++++++++++ .agents/skills/abipy-run-tests/SKILL.md | 57 ++++++ .agents/skills/abipy-serialization/SKILL.md | 111 ++++++++++++ .agents/skills/netcdf/SKILL.md | 61 +++++++ .agents/skills/python-virtual-env/SKILL.md | 75 ++++++++ .claude/skills | 1 + 17 files changed, 1888 insertions(+) create mode 100644 .agents/skills/abipy-cli/SKILL.md create mode 100644 .agents/skills/abipy-docs-examples/SKILL.md create mode 100644 .agents/skills/abipy-file-reader/SKILL.md create mode 100644 .agents/skills/abipy-flowtk/SKILL.md create mode 100644 .agents/skills/abipy-inputs/SKILL.md create mode 100644 .agents/skills/abipy-integration-tests/SKILL.md create mode 100644 .agents/skills/abipy-navigate/SKILL.md create mode 100644 .agents/skills/abipy-panels/SKILL.md create mode 100644 .agents/skills/abipy-performance/SKILL.md create mode 100644 .agents/skills/abipy-plotting/SKILL.md create mode 100644 .agents/skills/abipy-reference-data/SKILL.md create mode 100644 .agents/skills/abipy-robots/SKILL.md create mode 100644 .agents/skills/abipy-run-tests/SKILL.md create mode 100644 .agents/skills/abipy-serialization/SKILL.md create mode 100644 .agents/skills/netcdf/SKILL.md create mode 100644 .agents/skills/python-virtual-env/SKILL.md create mode 120000 .claude/skills diff --git a/.agents/skills/abipy-cli/SKILL.md b/.agents/skills/abipy-cli/SKILL.md new file mode 100644 index 000000000..09cc854b0 --- /dev/null +++ b/.agents/skills/abipy-cli/SKILL.md @@ -0,0 +1,152 @@ +--- +name: abipy-cli +description: Add or modify AbiPy command-line tools and subcommands, preserving parser, dispatch, output, exit-code, optional-dependency, safety, packaging, and subprocess-test conventions. Use for scripts under abipy/scripts and their shared CLI helpers; not for domain logic that belongs in library modules. +--- + +# Develop AbiPy command-line tools + +Keep the CLI thin: parse user intent, validate boundaries, call reusable AbiPy APIs, format results, and return a +meaningful exit code. Put scientific algorithms, readers, input construction, and workflow mechanics in their domain +modules so they are usable without a subprocess. + +Use `abipy-navigate` to locate the underlying API, `python-virtual-env` before running commands, and +`abipy-run-tests` for focused validation. Use `abipy-flowtk` when a command inspects or mutates a flow. + +## Match the command's existing framework + +Most modules in `abipy/scripts` use `argparse`, a `get_parser(with_epilog=False)` function, and +`@abipy.tools.cli_parsers.prof_main`. `abiml.py` uses Click and its decorator helpers. Extend the framework already +used by the command; do not mix Click and argparse inside one command merely for a new subcommand. + +For argparse commands: + +- keep reusable parent parsers for options shared by several subcommands; +- use `dest="command"` dispatch consistently with neighboring branches; +- provide actionable positional and option help, defaults, units, and constrained `choices` where appropriate; +- include examples in the raw-text epilog when syntax is not obvious; +- configure logging through `cli_parsers.set_loglevel` or the established local equivalent; +- reuse `EnumAction`, `range_from_str`, Panel-serving, plotting, and profiling helpers instead of duplicating them. + +For Click commands, follow the established option decorators, context usage, configuration callbacks, and +Click-native path/type validation. + +All top-level tools should support useful `--help` and `--version` behavior. Preserve profiling through `prof`, +`tuna`, and `snakeviz` when the script uses `@prof_main`. + +## Packaging and entry points + +AbiPy currently packages every Python file under `abipy/scripts` through the `scripts=` mechanism in `setup.py`, not +through `[project.scripts]` console entry points. A new top-level command therefore needs a script file with the +project shebang/main convention and an executable installation path. Do not add a second packaging mechanism for a +single command without an intentional project-wide migration. + +Prefer adding a subcommand to the tool that already owns the domain. Create a new top-level script only when its +purpose and option space are distinct enough to be discoverable independently. + +## Dispatch and exit codes + +Keep parsing, dispatch, and command implementation visibly separated. A command handler should return an integer: + +- `0` for success; +- nonzero for an expected failure the caller can act on; +- argparse/Click usage errors for invalid syntax. + +`@prof_main` ultimately calls `sys.exit(main())`, so returned values become process exit codes. Do not print an error +and then return success. Avoid catching broad exceptions solely to turn every defect into an uninformative message; +when handling an expected exception, preserve enough context for diagnosis and return nonzero. + +Write primary command results to stdout and warnings/errors to stderr when practical. Keep ordinary output stable +enough for shell use, and do not add decorative text to a branch intended to emit JSON, CSV, YAML, or another +machine-readable format. Respect existing no-color/no-logo options and avoid terminal control codes when output is +redirected. + +## Paths, files, and AbiPy objects + +Use `abilab.abiopen` or the appropriate domain loader rather than reproducing suffix dispatch. Close file-backed +objects deterministically, preferably with a context manager. Use `abipy.data` only for bundled examples/tests, not +as an implicit substitute for a missing user path. + +Resolve and validate input paths before expensive work. For output paths: + +- distinguish printing to stdout from writing a file; +- state the selected format and destination; +- do not overwrite an existing file or directory silently unless overwrite behavior is already explicit in that + command; +- create parent directories only when the command contract promises it; +- report partial output if a later operation fails. + +Treat pickles as trusted-input formats. Do not imply that arbitrary pickle files are safe to open. + +## Optional and interactive features + +Import optional dependencies inside the branch that needs them so `--help`, `--version`, and unrelated subcommands +remain usable. On a missing optional package, identify both the requested feature and dependency; do not mask an +unrelated import or runtime error as an installation problem. + +Plotting, IPython, Jupyter, Panel servers, clipboard operations, web browsers, and GUI viewers require interactive +resources. Keep noninteractive commands headless, honor options such as `--no-browser`, and configure Matplotlib +before importing plotting backends when the existing helper expects that order. + +Network-backed identifiers or downloads must be explicit in the command and should produce actionable failures +when credentials or connectivity are missing. Do not introduce network access into a formerly local operation as an +implicit fallback. + +## Mutating and external operations + +Classify each subcommand before implementing it: + +- inspection/formatting; +- local file creation or modification; +- external process execution; +- flow or scheduler mutation; +- destructive cleanup. + +The latter categories need clear help text and explicit flags. Before deleting, overwriting, submitting, cancelling, +restarting, or modifying a persisted flow, resolve the exact target and use the confirmation/dry-run convention of +the parent command. A `--yes` or force option is authorization for the documented target only, not broader cleanup. + +Do not prompt from commands intended for pipelines unless the user selected an interactive mode. In noninteractive +contexts, a missing required confirmation should fail rather than assume yes. Keep analysis commands read-only even +when an underlying object exposes mutating methods. + +## Reuse shared behavior + +Place a helper in `abipy/tools/cli_parsers.py` only when multiple commands genuinely share it. Keep domain-specific +formatting or dispatch near its command or, preferably, in the domain library if useful programmatically. + +Common reusable facilities already include: + +- log-level setup; +- Panel server options and keyword conversion; +- Matplotlib/seaborn and figure-exposure options; +- enum parsing and range parsing; +- OpenMP thread normalization; +- profiling of `main`. + +Do not broaden a shared helper with command-specific assumptions that could change other scripts. + +## Tests + +Add subprocess-level coverage in `abipy/scripts/tests/test_scripts.py` or a focused neighboring test module. The +existing `ScriptTest` pattern uses `scripttest.TestFileEnvironment`, an isolated working directory, and a headless +Matplotlib backend. + +At minimum, test: + +- `--help` and `--version` for a new top-level tool; +- the new subcommand's smallest successful invocation; +- return code and relevant stdout/stderr content; +- invalid syntax or a representative expected failure; +- output-file creation and overwrite behavior when applicable; +- missing optional dependency behavior if the branch can be isolated reliably. + +Use small files from `abipy.data` and `abipy/test_files`. Do not open browsers, GUIs, notebooks, or Panel servers in +unit tests. Mock external services and scheduler mutations; skip only when the test genuinely requires an optional +executable or dependency. + +Also test the underlying library function directly in its domain test module. CLI tests should prove parsing, +dispatch, formatting, and process semantics, not duplicate an entire scientific test suite. + +Run the script through the same path users exercise, not only by calling `main()` in process. Report the exact +invocation, exit code, important output, and whether the command created files, launched a process, accessed the +network, or mutated a flow. diff --git a/.agents/skills/abipy-docs-examples/SKILL.md b/.agents/skills/abipy-docs-examples/SKILL.md new file mode 100644 index 000000000..035accf39 --- /dev/null +++ b/.agents/skills/abipy-docs-examples/SKILL.md @@ -0,0 +1,169 @@ +--- +name: abipy-docs-examples +description: Add and maintain AbiPy Sphinx documentation, API pages, CLI references, and executable Sphinx-Gallery plot or flow examples. Use for docs and examples under docs/ and abipy/examples; distinguish generated API/gallery output from maintained sources. +--- + +# Develop AbiPy documentation and examples + +Document the public behavior implemented in code and keep examples executable, small, and scientifically honest. +Do not use documentation changes to conceal an unclear API; improve the library interface first when needed. + +Use `abipy-plotting` for plotting API conventions, `abipy-flowtk` for workflow examples, `abipy-cli` for command +references, and `abipy-reference-data` for bundled example inputs. + +## Know maintained sources from generated output + +The main maintained documentation sources are under `docs/`, with `docs/index.rst` defining the top-level toctrees. +Important areas include: + +- `docs/tutorials`, `docs/workflows`, and topical `.rst` pages for narrative guides; +- `docs/scripts` for command-line documentation; +- `docs/abiref.bib` for citations and `docs/links.rst` for global substitutions/links; +- `abipy/examples/plot` and `abipy/examples/flows` for executable gallery sources; +- Python docstrings for API reference content. + +`docs/api` is regenerated by `sphinx-apidoc`. `docs/gallery` and `docs/flow_gallery` are generated by Sphinx Gallery. +Edit the Python modules, docstrings, example sources, or generator configuration—not generated gallery pages. When +tracked API stubs change, regenerate them through the established command instead of hand-maintaining a module list. + +Before editing or regenerating, check the working tree so generated output does not overwrite unrelated user work. + +## Write narrative documentation + +Follow the surrounding reStructuredText style and add a new page to the appropriate `toctree`; an unreferenced page +may build but remain undiscoverable. Give stable sections explicit labels when other pages should link to them. + +Prefer semantic Sphinx roles and cross-references over literal names and raw URLs: + +- Python objects: `:class:`, `:meth:`, `:func:`, `:mod:`; +- documents and sections: `:doc:` and `:ref:`; +- commands and files: `:program:` and `:file:`; +- citations: `:cite:` with an entry in `docs/abiref.bib`. + +Reuse aliases already defined in `docs/links.rst`. Add a global alias only when several pages benefit; otherwise keep +the link local. Use notes and warnings for consequential information, not ordinary prose. + +Keep commands copyable and specify their working directory, required environment, and whether they write files, +launch programs, submit jobs, or use the network. Do not document a destructive or scheduler command as though it +were an inspection command. + +## Docstrings and API pages + +AbiPy docstrings use Google-style sections interpreted by Napoleon. Document public parameters, units, shapes, +return values, exceptions, side effects, optional dependencies, and index conventions that are not obvious from the +signature. Keep examples short enough for the docstring; move complete workflows to the gallery. + +New public modules are discovered by the `sphinx-apidoc` command used in `tasks.py`. The generated API excludes +tests, benchmarks, data, integration tests, test files, and examples. If a public object is intentionally exported, +also follow the package's `__all__` or public-import convention so autodoc and users see the same API. + +Regenerate API stubs with the command encoded in `tasks.py` or with `invoke make-doc` only when an interactive full +workflow is desired. `invoke make-doc` also cleans, builds, and opens the HTML site in a browser, so it is not the +preferred headless verification command. + +## CLI documentation + +CLI pages under `docs/scripts` normally combine narrative examples with the `sphinxarg.ext` directive: + +```rst +.. argparse:: + :ref: abipy.scripts.abiopen.get_parser + :prog: abiopen.py +``` + +Keep the parser importable without executing the command, opening a GUI, accessing the network, or requiring an +optional runtime dependency. Use `.. command-output::` only for deterministic, fast, read-only commands available in +the documentation environment. + +Update the scripts toctree when adding a maintained CLI page. The parser's own help remains the source of truth for +the complete option list; narrative docs should explain workflows and important safety constraints rather than +duplicate every flag manually. + +## Plot gallery examples + +Plot examples live in `abipy/examples/plot` and are selected by the gallery filename pattern `plot*`. Start with a +raw reStructuredText module docstring containing a concise title and underline: + +```python +r""" +Example title +============= + +Explain the scientific question and the data used. +""" +``` + +Use `# %%` blocks followed by explanatory comments to interleave narrative and executable code. Load bundled inputs +through `abipy.data`, close file-backed objects with context managers, and call public APIs as a user would. Let +Sphinx Gallery capture figures; do not save generated PNG/PDF files in the source directory. + +Keep examples deterministic and modest in memory/runtime. Avoid credentials, network downloads, personal paths, +interactive prompts, GUI-only backends, and unavailable external executables. The docs configure Matplotlib `Agg` +and disable Plotly's default show behavior, so examples must not depend on browser display. + +Add a new example only when it teaches a distinct workflow. Extend an existing example when the new call is a small +variation of the same concept. + +## Flow gallery examples + +Flow examples live in `abipy/examples/flows` and are selected by the pattern `run*`. Follow the established split: + +- a `build_flow(options)` function creates and returns the graph; +- `@flowtk.flow_main` wraps `main(options)` for normal user execution; +- workdir and manager come from the supplied options; +- bundled structures and pseudos replace machine-specific inputs. + +Documentation execution may build, validate, or visualize a graph, but it must not submit calculations. Follow the +nearest maintained `READTHEDOCS` guard for gallery-specific graph generation. Never add `--scheduler`, queue +submission, or cleanup of arbitrary work directories to documentation execution. + +Choose minimal meshes/cutoffs when calculations or ABINIT queries cannot be avoided, while preserving the topology +being demonstrated. Clearly label pedagogical parameters that are not suitable for production science. + +The full docs Makefile removes `abipy/examples/flows/flow_*` before gallery execution. Treat those as generated flow +directories and verify that no user-owned work is present there before running the full target. + +## Build and verification levels + +Activate the correct Python environment and install/use the existing `docs` dependency group. Do not install or +upgrade documentation packages implicitly merely because a build reports a missing dependency. + +Use verification proportional to the change: + +1. Run affected library/CLI tests and execute a new example directly with a headless backend where possible. +2. For prose, docstrings, or API links, build without executing galleries: + + ```bash + cd docs + READTHEDOCS=1 sphinx-build -D plot_gallery=0 -b html -d _build/doctrees . _build/html + ``` + +3. Regenerate API stubs when public module structure changed. +4. Run the full `make html` from `docs` when gallery execution or full integration matters. It runs + `generate_rst_files.py`, cleans generated flow directories, and executes gallery examples. +5. Use `make linkcheck` when external links changed, recognizing that it requires network access and can fail for + reasons outside the repository. + +For stricter review, add `-W -n --keep-going` to a focused Sphinx build, but distinguish new warnings caused by the +change from existing project warnings. The normal Makefile does not enable warnings-as-errors. + +Do not open the generated site with `open`, a browser, or `invoke make-doc` in a headless agent session. Inspect the +build result and relevant HTML files directly. + +## Review generated changes + +After a build, inspect `git status` before accepting changes. Do not commit `_build`, gallery caches, notebooks, +images, zip files, flow work directories, or example output artifacts unless the repository intentionally tracks +that exact generated class. + +Check that: + +- new pages appear in the intended toctree; +- cross-references resolve and code examples match the current API; +- galleries execute without unexpected failures; +- no example submits work or depends on local configuration; +- API regeneration changes only the expected modules; +- generated artifacts have not leaked into source directories. + +Report source pages/examples changed, generated API stubs changed, build command and environment, gallery execution +status, new versus pre-existing warnings, and any optional example not executed with the reason. diff --git a/.agents/skills/abipy-file-reader/SKILL.md b/.agents/skills/abipy-file-reader/SKILL.md new file mode 100644 index 000000000..964f885d1 --- /dev/null +++ b/.agents/skills/abipy-file-reader/SKILL.md @@ -0,0 +1,125 @@ +--- +name: abipy-file-reader +description: Add or extend AbiPy readers and high-level objects for ABINIT output files, using abisrc.py to derive the format from the Fortran writer and integrating the result with abiopen, reference data, tests, and optional Robot or plotting APIs. +--- + +# Implement an AbiPy file reader + +Treat the ABINIT writer and a representative output file as the format specification. Trace the complete path from +the Fortran definitions and writes to AbiPy's low-level reader, semantic file object, public registration, and tests. + +Use the `netcdf` skill for detailed axis-order or value discrepancies, `abipy-navigate` to locate related Python +code, and `abipy-run-tests` when executing tests. + +## Establish the schema from ABINIT + +Locate the active ABINIT checkout rather than assuming the sibling repository is the right version. When it is +`../abinit`, run `abisrc.py` from that repository root so its source paths and caches are correct. + +For a NetCDF format, start with: + +```bash +cd ../abinit +./abisrc.py nc_explain +./abisrc.py nc_explain WRITER_PROCEDURE --follow 2 +./abisrc.py nc_explain WRITER_PROCEDURE --follow 2 --check /path/to/example_FILE.nc +``` + +Without a procedure name, `nc_explain` lists routines that define NetCDF content. For a selected writer it reports +dimensions, variables, Fortran and NetCDF dimension order, types, groups, conditions, attributes, units, write +slices (`start`/`count`), fill values, and nested writer calls. `--check` compares the inferred schema with an actual +file; a mismatch can mean the file came from a different ABINIT version. + +Use the other structural queries when names or semantics remain unclear: + +```bash +./abisrc.py where NAME +./abisrc.py source NAME --decls --doc +./abisrc.py context PROCEDURE --no-tests +./abisrc.py callers PROCEDURE -d 2 +./abisrc.py callees PROCEDURE -d 2 +./abisrc.py callsites PROCEDURE +``` + +Prefer these focused queries to reading whole Fortran files. Fall back to `rg -in` for dynamically constructed +names, macros, or relationships the parser cannot resolve. Fortran is case-insensitive. + +Before implementing, record: + +- file suffix and the routine that creates it; +- dimensions and their physical meanings; +- variable names, types, units, groups, and conditional presence; +- NetCDF order as observed by Python; +- partial writes and fill-value semantics; +- one-based indices that must become zero-based in Python; +- complex-number representation and any version-dependent names. + +Do not infer a transpose from reversed dimension listings alone. The NetCDF Fortran interface commonly exposes +Fortran `x(n1,n2,n3)` as `(n3,n2,n1)` to Python. Check the exact write call and slice. + +## Match an existing AbiPy reader + +Choose a nearby reader in the same scientific domain before designing a new abstraction. Typical layers are: + +1. A specialized reader derived from `ETSF_Reader`, `ElectronsReader`, `BaseEphReader`, or another domain reader. +2. A high-level file object derived from `AbinitNcFile` plus applicable mixins such as `Has_Header`, + `Has_Structure`, `Has_ElectronBands`, and `NotebookWriter`. +3. Optionally, a `Robot` for meaningful comparison or convergence analysis across multiple files. + +The file object should own and close its reader. Existing code may expect both names, so follow the closest mature +implementation when assigning `self.r` and `self.reader`. Use `cached_property` for expensive immutable data, but +do not eagerly load large arrays merely to construct the object. + +Keep low-level schema decoding in the reader and physical interpretation in well-named methods or domain objects. +Make unit conversions explicit with AbiPy or pymatgen unit helpers. Document array shapes in Python order and state +whether indices are zero- or one-based. Preserve masked/fill values when they carry meaning. + +For compatibility across ABINIT versions, distinguish required variables from optional or renamed ones. Check +`rootgrp.variables`, groups, or use a supported `default` argument only when absence has a defined meaning. Do not +hide malformed required data behind broad fallbacks. + +## Public integration + +For a generally supported file format: + +- import the file class in `abipy/abilab.py`; +- register its suffix in `abiext2ncfile` for NetCDF or `ext2file` for other formats; +- expose intentionally public classes through the module's established `__all__`/package pattern; +- verify `abilab.abiopen(path)` returns the new class; +- implement informative `to_string`/`__str__` output and deterministic `close` behavior. + +Filename matching order matters when suffixes overlap. Follow the existing registry convention and test the actual +basename used by ABINIT. + +Add these only when they provide real value: + +- `Robot` with an `EXT`, dataframe, or comparison API for collections of files; +- `plot_*` methods using AbiPy plotting helpers and `@add_fig_kwargs`; +- `yield_figs` for automatic `abiopen -e` output; +- `write_notebook` or Panel support for interactive exploration. + +Do not require every format to implement the entire presentation stack. + +## Tests and reference data + +Put tests in the nearest domain `tests/` directory. Prefer an existing file from `abipy/data/refs`, accessed via +`abipy.data.ref_file`, over a hard-coded repository path. Before adding a binary fixture, check its size, provenance, +and whether an existing file exercises the same schema. + +Cover the behavior that proves the integration: + +- construction and context-manager closing; +- representative dimensions, scalars, array shapes, units, and index conversion; +- conditional or version-dependent variables when supported; +- derived scientific quantities with known values or invariants; +- `abiopen` dispatch for a newly registered suffix; +- Robot or plotting behavior only when those features were added. + +Use a real reference file for schema integration and small synthetic objects or mocks only for isolated transforms +and edge cases. Do not update numerical expectations or binary references merely to silence a failure. + +## Completion check + +Run the narrow test module first, then the affected package tests. Report the ABINIT source/version used to infer the +schema, the reference file inspected, supported compatibility behavior, and any schema fields intentionally left +unexposed. diff --git a/.agents/skills/abipy-flowtk/SKILL.md b/.agents/skills/abipy-flowtk/SKILL.md new file mode 100644 index 000000000..feba55c1a --- /dev/null +++ b/.agents/skills/abipy-flowtk/SKILL.md @@ -0,0 +1,171 @@ +--- +name: abipy-flowtk +description: Build, extend, inspect, persist, test, and troubleshoot AbiPy Flow/Work/Task workflows, including file dependencies, managers, schedulers, callbacks, task states, restarts, and event handling. Use for execution orchestration; use abipy-inputs for calculation input semantics alone. +--- + +# Work with AbiPy flowtk + +Model execution as a graph of `Flow`, `Work`, and `Task` nodes. Inputs describe individual calculations; +`flowtk` owns their directories, file dependencies, execution policy, state transitions, recovery, and persistence. + +Use `abipy-inputs` for constructing coherent inputs, `abipy-navigate` to find domain workflows, and +`python-virtual-env` plus `abipy-run-tests` before executing tests or workflows. + +## Choose the highest existing abstraction + +Search `abipy/flowtk/*_flows.py`, `*_works.py`, `flows.py`, and the examples before assembling nodes manually. + +- Use an existing `Flow` constructor or specialized `Work` when it already represents the scientific workflow. +- Use `Flow.from_inputs` only for independent tasks; its API explicitly does not represent dependencies among them. +- Assemble a generic `Work` for a small, static group of related tasks. +- Add a specialized `Work` when coordination, post-processing, or `on_all_ok` behavior belongs to that group. +- Add a specialized `Task` only when executable invocation, output products, restart behavior, or event handling differs + from existing task classes. +- Use a dynamic callback only when later topology genuinely depends on completed results and cannot be known when the + flow is built. + +Keep physical input policy in factories and workflow topology in `flowtk`. Do not make an input factory register +tasks or encode filesystem dependencies. + +## Construct the graph + +The usual static pattern is: + +```python +flow = flowtk.Flow(workdir=workdir, manager=manager) +work = flowtk.Work() +scf_task = work.register_scf_task(scf_input) +nscf_task = work.register_nscf_task(nscf_input, deps={scf_task: "DEN"}) +flow.register_work(work) +flow.allocate() +``` + +Prefer typed registration methods such as `register_scf_task`, `register_nscf_task`, `register_phonon_task`, and +`register_eph_task`; they document intent and select the appropriate task class. + +Dependencies map a producer node to one or more ABINIT products: + +```python +deps={producer_task: "DEN WFK"} +``` + +Use only registered ABINIT extensions and request the minimum products required by the consumer. `Product` maps the +extension to the connecting input variables and expected output path. Do not pass a path as an informal dependency +when a producer node exists. File paths are appropriate for deliberate external inputs. + +Use dependency getters such as `@structure` only for their implemented semantics. A dependency may combine products +and getters, but the consumer must remain scientifically valid after the getter changes its input. + +Dependencies can be attached to a task or an entire work. Check parent/child relationships after `allocate()` and +run `flow.check_dependencies()` to detect invalid or cyclic topology. + +## Allocation, building, and persistence + +Registration creates the logical graph. `flow.allocate()` propagates work directories, managers, node positions, +and relationships. `flow.build()` creates runtime files and directories. `flow.build_and_pickle_dump()` builds and +persists the graph in `__AbinitFlow__.pickle`. + +Do not treat these operations as interchangeable, and do not allocate repeatedly with a different work directory. +Use an explicit temporary directory in tests. + +Flow state is persisted in its pickle database. For read-only inspection, load with the default spectator mode: + +```python +flow = flowtk.Flow.pickle_load(workdir) +``` + +Spectator mode avoids signal-driven mutations. Removing a pickle lock is an exceptional recovery operation; first +establish that no scheduler or writer is active. Never delete or replace an existing flow work directory merely to +resolve a construction error. + +Options such as `remove=True` and `flow_main --remove` delete the existing work directory. Use them only when the +user explicitly intends to discard that flow and after resolving the exact path. + +## Managers and execution + +`TaskManager` selects queue adapters, resource limits, launch commands, environment setup, and parallel policy. An +implicit manager is loaded first from `manager.yml` in the current directory and then from +`~/.abinit/abipy/manager.yml`. For reproducible tests and scripts, pass or construct the manager explicitly. + +Inspect manager documentation with: + +```bash +abidoc.py manager +abidoc.py manager slurm +``` + +Do not silently rewrite a user's manager configuration to make a workflow pass. Resource limits can be specialized +by task class; preserve that behavior when copying or replacing managers. Use `to_shell_manager` only when local +shell execution is intended and compatible with the executable environment. + +The following operations can execute or submit jobs and are not mere graph validation: + +- `flow.make_scheduler().start()`; +- `flow.rapidfire()` and `flow.single_shot()`; +- `PyLauncher` methods; +- task `start`, `restart`, `cancel`, and queue operations; +- scripts decorated with `flow_main` when invoked with `--scheduler`. + +Obtain the required authorization before submitting, cancelling, or restarting external jobs. Use +`flow.abivalidate_inputs()` or `flow_main --abivalidate` when only ABINIT input validation is needed. + +## Status and recovery + +Interpret states precisely: `Done` means execution ended, not that results are correct; `Completed` is success. +`AbiCritical`, `QCritical`, `Unconverged`, and `Error` require different diagnosis. Call `check_status()` and inspect +task history, events, output, log, stderr, queue diagnostics, and corrections before proposing recovery. + +Let task and event-handler APIs perform state transitions. Do not force status values or edit persisted state to +hide a failure. A restart must preserve the scientifically required products and update the dependency graph or +input only through established restart/correction mechanisms. + +When adding recovery logic: + +- distinguish ABINIT events from queue/submission failures; +- make corrections bounded and record them in node history; +- avoid retry loops without a clear stopping condition; +- confirm restart files exist before advertising restartability; +- preserve idempotence when status checks run repeatedly. + +## Specialized works and callbacks + +A specialized `Work` should register its internal tasks using the normal dependency API and keep group-level +finalization in lifecycle hooks such as `on_all_ok`. Hook code may be called after reload, so avoid assumptions based +only on transient process state. + +For dynamic flows, register callbacks through the Flow API with serializable callback data and explicit dependency +products. A callback must be safe to evaluate after persistence/reload and must not create duplicate works if status +checking occurs more than once. Prefer a static graph whenever all tasks are knowable up front. + +Expose new generally useful task/work/flow classes through `abipy.flowtk` following the existing import pattern. +Avoid expanding the public API for a one-off example. + +## Flow scripts + +For reusable example scripts, follow the established `@flowtk.flow_main` pattern and return a fully constructed +flow from `main(options)`. Respect the supplied `options.workdir` and `options.manager`; do not substitute personal +paths or configurations. Building a flow should not submit it unless the caller selects scheduler execution. + +Keep examples small enough to communicate topology and use `abipy.data` structures and pseudos where appropriate. + +## Tests + +Put tests beside the affected layer in `abipy/flowtk/tests`. Separate three levels: + +1. Pure graph tests with a temporary work directory and an explicit manager string/object. +2. Lifecycle tests using `abipy.flowtk.mocks` to simulate starts, statuses, and results. +3. Executable-backed integration tests only when real ABINIT or scheduler behavior is essential. + +For graph tests, verify node/task classes, task counts, positions, dependencies and requested products, manager +propagation, `check_dependencies`, build output, and pickle reload. Use `Flow.temporary_flow()` where suitable and +clean up test-local state such as the configured user manager. + +Do not submit real queue jobs from unit tests. Mock status changes through the provided helpers rather than editing +private fields when a helper exists. For executable-backed tests, state the ABINIT, manager, and scheduler +requirements and skip cleanly when they are unavailable. + +## Completion information + +Report the graph shape, dependency products, manager source, whether the flow was only allocated/built or actually +executed, the final task-status summary, and the focused tests used. If jobs were submitted or cancelled, report the +affected flow and scheduler identifiers. diff --git a/.agents/skills/abipy-inputs/SKILL.md b/.agents/skills/abipy-inputs/SKILL.md new file mode 100644 index 000000000..7f664001b --- /dev/null +++ b/.agents/skills/abipy-inputs/SKILL.md @@ -0,0 +1,136 @@ +--- +name: abipy-inputs +description: Create, transform, validate, and test AbiPy AbinitInput and MultiDataset objects, including structures, pseudopotentials, k-point sampling, factories, decorators, DFPT inputs, and ABINIT variable semantics. Use for programmatic ABINIT input generation; not for merely parsing an existing .abi text file. +--- + +# Work with AbiPy inputs + +Build inputs through AbiPy's domain objects and preserve the relationships among structure, pseudopotentials, +sampling, run level, tolerances, and file dependencies. Prefer an established factory or transformation from a +ground-state input when it represents the requested workflow. + +Use `abipy-navigate` to find related implementations, `python-virtual-env` before executing Python, and +`abipy-run-tests` for test selection. + +## Understand variables before setting them + +Use AbiPy's variable database for names, defaults, dimensions, and documentation: + +```bash +abidoc.py man ecut +abidoc.py apropos phonon +abidoc.py find eph +abidoc.py withdim natom +``` + +The same data is available through `abipy.abio.abivars_db`. For implementation details in the active ABINIT source, +run from its repository root: + +```bash +./abisrc.py var VARIABLE +./abisrc.py var VARIABLE -v +``` + +`abisrc.py var` shows where a variable is declared, defaulted, read, checked, printed, documented, used, and set by +tests. Use it when behavior depends on the ABINIT version or the documentation does not explain a constraint. + +Keep spell checking enabled. Do not disable it to accept an unknown variable unless the task explicitly targets a +new ABINIT variable that AbiPy's database does not contain yet; update the database through the established project +workflow instead of normalizing permanent spell-check bypasses. + +## Choose the construction path + +- Use `AbinitInput(structure, pseudos)` for a genuinely custom single calculation. +- Use a function in `abipy/abio/factories.py` for established SCF, bands, relaxation, GW, DFPT, phonon, conductivity, + or related workflows. Inspect the factory signature and tests rather than duplicating its coupled defaults. +- Use transformations such as `*_from_gsinput` when a downstream calculation must inherit a validated ground-state + setup. These functions handle details such as removing stale input-file-read variables and selecting compatible + tolerances. +- Use `MultiDataset` for related datasets with the same pseudopotentials. Apply shared settings to the container, + specialize individual entries, then call `split_datasets()` when registering tasks or returning independent inputs. + +Do not mutate a caller-owned template unless the API promises in-place modification. Use `deepcopy`, `new_with_vars`, +`replicate`, or `MultiDataset.replicate_input` as appropriate. + +## Structure and pseudopotential invariants + +Pass any supported structure representation through `Structure`/`Structure.as_structure`. Do not set ABINIT geometry +variables such as `acell`, `rprim`, `xred`, `typat`, or `znucl` with `set_vars`; `AbinitInput` deliberately rejects +geometry variables. Use `set_structure` or construct a new input. + +Let `PseudoTable` match and order pseudopotentials for the structure. Verify that every species has exactly one +compatible pseudo and do not depend on the order supplied by the caller. PAW and norm-conserving inputs have +different cutoff requirements; use pseudo hints or existing factory helpers rather than inventing `ecut` and +`pawecutdg` defaults. + +Use `enforce_znucl` and `enforce_typat` only when compatibility with an external ABINIT file requires the original +type ordering. `typat` remains one-based in this interface and must match `natom`. Preserve these fields when copying, +serializing, or assembling a `MultiDataset`. + +All entries in a `MultiDataset` must use the same pseudopotential set. Inputs may have different structures only +when their atomic types remain compatible with that set. + +## Set coherent variables + +Prefer semantic helpers over manually coordinating related variables: + +- `set_kmesh`, `set_autokmesh`, `set_kpath`, and `set_qpath` for sampling; +- `set_cutoffs_for_accuracy` when pseudo hints are the intended source; +- `add_abiobjects` for objects exposing `to_abivars`; +- domain factories for perturbations and response-function datasets. + +`set_vars` updates certain associated dimensions such as `nshiftk`, but do not assume it resolves every ABINIT +constraint. Assign arrays in the shapes expected by the helper or variable documentation. + +An input should contain one appropriate SCF tolerance. Assigning a member of the SCF tolerance family replaces the +previous one. Choose the tolerance for the run level rather than layering `tolvrs`, `toldfe`, `tolwfr`, and similar +variables indiscriminately. + +Use `set_vars_ifnotin` for defaults that must respect caller overrides. Use `pop_vars` for optional cleanup and +`remove_vars(..., strict=True)` when absence indicates a programming error. Preserve comments, tags, decorators, +and enforced type ordering across transformations when they remain semantically applicable. + +## Executable-backed operations + +Methods beginning with `abiget_` and `abivalidate` invoke ABINIT through a task and may create temporary work files. +They require a verified Python environment, ABINIT executable, and usable `TaskManager`. Do not present these as +pure in-memory checks. + +Validate at the level justified by the change: + +1. Inspect `to_string()` and object invariants without invoking ABINIT. +2. Test serialization or transformations when relevant. +3. Use `abivalidate()` for parser and cross-variable consistency when ABINIT is configured. +4. Run a real calculation only when scientific runtime behavior must be established. + +On validation failure, inspect the returned log and stderr. Do not weaken variables or skip validation merely to get +a zero return code. + +## Implementing or changing factories + +Keep shared physical policy in the factory and return ordinary `AbinitInput`/`MultiDataset` objects. Reuse helper +functions for cutoffs, shifts, band counts, electronic settings, and stopping criteria. Make caller overrides +explicit in the signature and avoid silently overriding them later. + +For a transformation from a ground-state input: + +- copy the source input; +- remove variables that read files inappropriate for the new task; +- replace sampling, run-level, band-count, output, and tolerance variables coherently; +- preserve structure, pseudos, spin configuration, and intentional metadata; +- document assumptions about prerequisite files and task dependencies. + +Do not encode Flow/Task dependency wiring inside an input factory; that belongs in `flowtk`. + +## Tests + +Add focused coverage in `abipy/abio/tests/test_inputs.py`, `test_factories.py`, or `test_decorators.py` according to +the changed layer. Use structures and pseudos from `abipy.data` rather than machine-specific paths. + +Test observable invariants: returned type and dataset count, required variables and shapes, preservation of the +source input, pseudo/type ordering, serialization when supported, and expected failure for invalid combinations. +Use `AbipyTest.abivalidate_input` or `abivalidate_multi` only for tests that are already executable-backed and skip +cleanly when their ABINIT requirement is unavailable. + +Report whether validation was in-memory, dry-run through ABINIT, or a real calculation, together with the interpreter +and ABINIT version when they affected the result. diff --git a/.agents/skills/abipy-integration-tests/SKILL.md b/.agents/skills/abipy-integration-tests/SKILL.md new file mode 100644 index 000000000..fc1a93810 --- /dev/null +++ b/.agents/skills/abipy-integration-tests/SKILL.md @@ -0,0 +1,166 @@ +--- +name: abipy-integration-tests +description: Add, run, and diagnose AbiPy integration tests that execute ABINIT flows through TaskManager and PyFlowScheduler, including MPI parameterization, timeouts, cleanup, restarts, handlers, and scientific output checks. Use for abipy/integration_tests; use abipy-run-tests for ordinary unit tests. +--- + +# Develop AbiPy integration tests + +Use an integration test only when correctness depends on a real ABINIT executable, task filesystem products, +dependency transfer, scheduler lifecycle, restart behavior, event handling, or multi-step scientific output. Keep +pure input, graph, reader, and transformation behavior in the faster domain unit tests. + +Use `abipy-inputs` for input semantics, `abipy-flowtk` for workflow lifecycle, `python-virtual-env` before executing +pytest, and `abipy-reference-data` if the test requires bundled input or comparison data. + +## Understand the harness + +Tests live in `abipy/integration_tests` and are collected by its `pytest.ini`: + +- files use `itest_*.py`; +- test functions use the `itest_` prefix; +- temporary results use `_integration_tests_` as the pytest base temporary directory; +- the default per-test timeout is 180 seconds when `pytest-timeout` is installed. + +The shared `fwp` fixture provides: + +- a pytest-managed temporary `workdir`; +- a `TaskManager` derived from `~/.abinit/abipy/manager.yml`; +- a configured `PyFlowScheduler` from the user scheduler configuration; +- `AbinitBuild` information for capability/version checks. + +The `tvars` fixture parameterizes ABINIT variables such as `paral_kgb`. Manager configurations are parameterized as +well: fixed MPI execution is the default, controlled by `ABIPY_ITEST_MPI_PROCS` (default 2), while +`ABIPY_ITEST_AUTOPARAL=1` adds an autoparal configuration. + +Use these fixtures rather than loading personal configuration or creating arbitrary work directories inside each +test. The autouse guard also: + +- applies scheduler exception limits; +- adds ABINIT `autoparal 1` in the narrow supported case when AbiPy autoparal is disabled; +- tracks ShellAdapter processes and kills surviving process groups after failures/timeouts; +- appends task error-file tails and the flow workdir to failed pytest reports. + +Do not bypass this harness without a concrete lifecycle requirement. + +## Preflight before running + +Verify the selected Python environment, working-tree import, pytest and `pytest-timeout`, the ABINIT executable, and +the manager/scheduler files. Inspect the active manager's queue-adapter type and resource limits before starting. + +The suite can execute through the user's configured queue adapter. A command that reaches Slurm, PBS, or another +shared scheduler can submit and cancel real jobs; obtain explicit authorization for that external mutation. Do not +assume “run tests” means queue submission. Prefer a deliberately configured shell manager for local development +when it represents the behavior under test. + +Confirm the intended MPI process count and ABINIT build capabilities. Do not silently replace the user's manager, +MPI launcher, executable path, or modules merely to make a failing environment run. + +## Add a focused test + +Build the smallest scientifically meaningful system and workflow. Use structures and pseudopotentials from +`abipy.data`, low but valid cutoffs and meshes, relaxed tolerances appropriate to the assertion, and as few tasks as +the behavior requires. Label deliberately non-production parameters in comments. + +Accept `fwp` whenever the test creates a flow and `tvars` when the behavior should be checked across the suite's +parallel-variable matrix: + +```python +def itest_feature(fwp, tvars): + inputs = make_inputs(tvars) + flow = build_flow(fwp.workdir, inputs, manager=fwp.manager) + scheduler = run_flow(flow) + assert scientific_invariant(flow) +``` + +Use `abipy.integration_tests.helpers.run_flow` for the normal scheduler-and-check path. Use `assert_flow_ok` when the +test needs custom scheduler steps or direct task execution. These helpers check `flow.all_ok`, scheduler exceptions, +and work finalization, and produce useful failure reports. + +Do not duplicate scheduler polling loops or merely assert a zero scheduler return code. `Done` is not success; +verify `Completed`/`flow.all_ok` and finalization unless the test intentionally targets incomplete behavior. + +## What to assert + +Test the contract that requires integration, not every intermediate implementation detail. Depending on the case, +assert: + +- graph dependencies and required products before execution; +- task states and bounded launch/restart/correction counts; +- existence and readability of essential output files; +- representative dimensions, units, values, conservation laws, or symmetry invariants; +- correct work finalization and post-processing outputs; +- event-handler corrections and preserved history for recovery tests; +- scheduler termination under deadlock or no-runnable-task conditions. + +Use tolerances justified by the numerical setup and stable across supported platforms. Do not make a test pass by +loosening a tolerance without examining whether the difference is physical, parallel-order noise, or a regression. +Avoid exact text comparisons of ABINIT logs unless the text is itself the compatibility contract. + +Assert exact `scheduler.nlaunch` only when the graph and restart policy make the count deterministic across the +parameterized managers. Otherwise assert the task/result behavior. + +## Restarts, failures, and handlers + +For a restart test, deliberately create a bounded and understood first failure, verify its status and restart +products, apply the documented correction, restart through the public API, and assert both the restart count and +final scientific result. Never use an unbounded retry to wait for an intermittent outcome. + +For event-handler tests, trigger a specific ABINIT event with a minimal input and assert the correction's event type +and effect. If the triggering behavior changed in a newer ABINIT version, use a version/capability condition or remove +the obsolete test; do not leave unconditional `xfail` as permanent coverage. + +Scheduler failure tests may use `abipy.flowtk.mocks` when the target is scheduler graph logic rather than a real +ABINIT failure. This keeps the failure deterministic while still exercising scheduler termination and deadlock +detection. + +## Skips, xfails, and portability + +Prefer skip conditions based on the actual missing capability: ABINIT version/build option, optional executable, +library, MPI feature, or scheduler support. Hostname lists are a last resort and must explain the concrete platform +limitation. Do not mark a scientifically failing test skipped merely because it is slow or inconvenient. + +Use `xfail` only for a known, tracked incompatibility whose failure is still informative. Give a precise reason and +remove the marker when the underlying behavior is fixed. An unconditional xfail is not evidence that a handler or +workflow remains functional. + +Override the timeout with `@pytest.mark.timeout(seconds)` only when the minimal valid calculation demonstrably needs +more than the suite default. Keep scheduler `frozen_timeout` below the pytest timeout so a stalled task is diagnosed +before pytest kills the test process. + +## Run narrowly and preserve diagnostics + +From the repository or integration-test directory, begin with one node and display parameter IDs: + +```bash +python -m pytest abipy/integration_tests/itest_file.py::itest_feature -vv -s +``` + +Then expand to the affected integration module. Enable `ABIPY_ITEST_AUTOPARAL=1` only when the change concerns +autoparal or after the fixed-MPI case passes; it multiplies runtime and may exercise different decompositions. + +Do not run the entire integration suite as the first check. It launches many ABINIT calculations and the ordinary +top-level `invoke pytest` intentionally excludes it. + +On failure, preserve the reported flow workdir until the cause is understood. Start with the pytest report sections, +then inspect task status/history and the relevant `run.err`, `queue.qerr`, `__ABI_MPIABORTFILE__`, `run.log`, and +`run.abo`. Separate: + +- invalid input or ABINIT scientific failure; +- missing dependency product; +- queue/launcher/environment failure; +- timeout or frozen output; +- parser/reader assertion failure after a successful calculation; +- nondeterminism across MPI decompositions. + +Do not rerun repeatedly without changing the diagnosis. The teardown guard kills tracked local shell processes, but +after a timeout or harness failure also verify that no authorized external scheduler jobs remain. + +## Cleanup and completion + +Keep all produced files inside `fwp.workdir` or a pytest temporary directory. Avoid manual fixed paths and do not +write new outputs into `abipy/data`, the repository root, or a user's flow directory. Let pytest manage its base temp +tree; retain a failed workdir only long enough for diagnosis. + +Report the exact pytest node, parameter IDs, interpreter, ABINIT version/build, manager adapter and MPI settings, +whether external jobs were submitted, elapsed time, pass/fail/skip summary, final flow status, and preserved failure +workdir when applicable. diff --git a/.agents/skills/abipy-navigate/SKILL.md b/.agents/skills/abipy-navigate/SKILL.md new file mode 100644 index 000000000..9eab3cca2 --- /dev/null +++ b/.agents/skills/abipy-navigate/SKILL.md @@ -0,0 +1,65 @@ +--- +name: abipy-navigate +description: Locate AbiPy file readers, domain objects, flows, command-line entry points, reference data, and tests. Use when tracing behavior or deciding where an AbiPy change belongs. +--- + +# Navigate AbiPy + +Use `rg` and the maps below to trace behavior from public entry points to implementation and tests. Activate the +project environment first when importing modules or running Python. + +## Main entry points + +- `abipy/abilab.py`: public convenience imports and `abiopen` file-extension dispatch. Start here when determining + which class opens an ABINIT output file. +- `abipy//`: scientific objects and file readers. Major domains include `electrons`, `eph`, `dfpt`, `waves`, + `dynamics`, `wannier90`, and `lumi`. +- `abipy/iotools/`: common readers, NetCDF helpers, visualizers, and serialization utilities. +- `abipy/abio/`: ABINIT inputs, outputs, variable database, factories, and timers. +- `abipy/flowtk/`: flows, works, tasks, managers, schedulers, events, wrappers, and ABINIT execution machinery. +- `abipy/scripts/`: command implementations. Their tests are in `abipy/scripts/tests`. +- `abipy/panels/`: Panel-based user interfaces. +- `abipy/data/`: bundled structures, pseudopotentials, and reference outputs exposed through `abipy.data` helpers. +- `abipy/core/testing.py`: `AbipyTest`, dependency checks, numerical assertions, and test helpers. + +## Search recipes + +Find a public symbol, its implementation, and tests: + +```bash +rg -n 'SymbolName' abipy/abilab.py abipy +rg -n 'class SymbolName|def symbol_name' abipy +rg -n 'SymbolName|symbol_name' abipy --glob '**/tests/**' +``` + +Find a file reader or NetCDF variable: + +```bash +rg -n 'EXT\.nc|class .*File|abiext2ncfile' abipy/abilab.py abipy +rg -n 'variable_name|read_value|read_variable' abipy +``` + +Find CLI wiring and behavior: + +```bash +rg -n 'def main|argparse|click|command' abipy/scripts abipy/flowtk +rg -n 'COMMAND_NAME' abipy/scripts/tests +``` + +Find bundled data through its API before hard-coding a path: + +```bash +rg -n 'def (ref_file|cif_file|pseudos|structure_from_ucell)' abipy/data/__init__.py +rg -n 'BASENAME' abipy/data abipy +``` + +## Change placement + +Keep domain behavior in its domain module, shared file-format mechanics in `iotools`, execution orchestration in +`flowtk`, and convenience exposure in `abilab.py`. Match an existing sibling reader or object before introducing a +new abstraction. Put unit tests in the nearest `tests/` directory and reuse `abipy.data` reference files when +possible. + +Avoid navigating generated caches, build outputs, `_integration_tests_`, or submodule contents unless the task +specifically concerns them. Preserve lazy/optional dependency behavior: inspect nearby import patterns before adding +top-level imports for optional packages. diff --git a/.agents/skills/abipy-panels/SKILL.md b/.agents/skills/abipy-panels/SKILL.md new file mode 100644 index 000000000..421437846 --- /dev/null +++ b/.agents/skills/abipy-panels/SKILL.md @@ -0,0 +1,106 @@ +--- +name: abipy-panels +description: Build, extend, and test AbiPy Panel dashboards for files, structures, Robots, and FlowTK objects using the repository's Parameterized classes, lazy callbacks, panes, and templates. Use for interactive Panel UI behavior; not for the underlying scientific computation or standalone plotting API. +--- + +# Develop AbiPy Panel interfaces + +Keep the scientific operation on its domain object and make the Panel layer a thin, lazy interactive adapter. Inspect +`abipy/panels/core.py` and the nearest domain panel before choosing widgets, callback structure, or layout. Use +`abipy-plotting` when the underlying figure API must change, `abipy-robots` for collection semantics, and +`abipy-flowtk` for workflow behavior rather than dashboard presentation. + +## Locate the integration point + +Panel implementations live in `abipy/panels`. File and domain objects usually expose `get_panel`, which imports the +panel class locally so importing the scientific module does not require Panel. Reuse the most specific base class: + +- `AbipyParameterized` for common verbosity, execution, plotting-template, and server-mode behavior; +- `PanelWithStructure` for structure viewers, analysis, and structure-derived inputs; +- `PanelWithElectronBands` for electronic-band and DOS controls; +- `BaseRobotPanel` or `PanelWithEbandsRobot` for multi-file interfaces; +- existing node, task, work, or flow panels for FlowTK dashboards. + +Do not copy a large inherited section into a specialized panel. Add shared behavior to `core.py` only when multiple +panels genuinely need the same semantics. + +## Define parameters and widgets + +Declare user-controlled state with `param` descriptors on the class. Give selectors explicit objects, numerical +parameters meaningful bounds, and controls clear documentation. Keep transient computation results out of shared +class-level mutable state. + +Build widgets through Param or existing AbiPy helpers when possible. Reuse `mpl`, `ply`, and `dfc` for Matplotlib, +Plotly, and dataframe presentation instead of embedding backend-specific display logic. Preserve the repository's +sizing and template conventions; do not set global Panel, Bokeh, Matplotlib, or Plotly configuration from a domain +panel. + +`has_remote_server` is a functional safety mode, not decoration. Disable or constrain operations that assume a local +desktop, unrestricted paths, arbitrary commands, excessive MPI resources, or trusted uploaded content. Do not +weaken those restrictions to make a local-only feature appear in a served application. + +## Make expensive work lazy + +Calculations, filesystem scans, external programs, and substantial plots should run only after an explicit user +action. Follow the existing button pattern: + +```python +run_btn = param.Action(lambda self: self.param.trigger("run_btn"), label="Run") + +@depends_on_btn_click("run_btn") +def on_run_btn(self): + """Explain what will be computed when the button is pressed.""" + return mpl(self.obj.plot_result(show=False)) +``` + +`depends_on_btn_click` uses the button's click count, shows the callback docstring before the first click, manages +the busy state, and normally converts exceptions into an inspectable pane. Use it instead of an eager `pn.bind` or +`param.depends` callback when the operation is costly or has side effects. + +Do not perform work in `get_panel` merely because a tab is constructed. Cache only results whose inputs and +invalidation rules are clear. If widgets are shared across tabs, retain the shared-widget warning or arrange for +dependent output to recompute; stale output must not silently look current. + +## Assemble the view + +Follow the prevalent `get_panel(as_dict=False, **kwargs)` contract. Construct a deterministic mapping of descriptive +tab names to Panel objects, then return that mapping when `as_dict=True` or the appropriate tabs/template when +false. Preserve any established signature on the associated domain object's `get_panel` method. + +Keep layout code readable: group controls separately from results, put advanced or expensive operations in their own +tabs, and avoid deeply nested anonymous rows and columns when a helper has clearer meaning. A callback should return +a Panel-compatible object consistently across successful branches, including a useful message for an empty result. + +Use existing helpers for Markdown, dataframes, JSON, terminal output, loading indicators, clipboard content, and +figures. Escape or render untrusted text as text; do not interpolate uploaded or external content into raw HTML. + +## Separate execution and UI concerns + +A panel may invoke an existing calculation, reader, Robot, or Flow method, but it should not become the only home of +scientific logic. First implement reusable computation that returns a domain object, arrays, a dataframe, or a +figure; then adapt it to panes. + +Treat buttons that run ABINIT, anaddb, schedulers, shell commands, file removal, or other mutations according to the +underlying API's execution and authorization constraints. Rendering a dashboard must never start jobs. Use temporary +paths for generated files unless the user deliberately selected a destination. + +## Tests + +Panel is optional, so use the repository's optional-dependency guard and place focused assertions beside the domain +object or relevant Panel module. Prefer tests that instantiate the panel without starting a server or browser and +verify: + +- the expected panel/template object and tab names; +- `as_dict=True` behavior where supported; +- parameter bounds, selector contents, and remote-server restrictions; +- pre-click callbacks do not execute expensive work; +- a simulated button trigger returns the expected pane or figure wrapper; +- exception and empty-result paths remain visible to the user; +- the associated object's `get_panel` performs its local import correctly. + +Patch or use small reference objects for expensive executables and network operations. Do not launch `panel serve`, +open a browser, contact Materials Project, or submit FlowTK jobs in unit tests. For a regression that depends on live +server callbacks, add the smallest integration check and document the extra requirement. + +Report the domain object and panel class changed, new controls and callback triggers, any remote-server restrictions, +and the focused headless tests used. diff --git a/.agents/skills/abipy-performance/SKILL.md b/.agents/skills/abipy-performance/SKILL.md new file mode 100644 index 000000000..90683f7e2 --- /dev/null +++ b/.agents/skills/abipy-performance/SKILL.md @@ -0,0 +1,117 @@ +--- +name: abipy-performance +description: Measure, diagnose, optimize, and regression-test AbiPy and ABINIT performance, including Python CPU, memory and import profiling, large-file access, FFT results, and BenchmarkFlow parallel scaling. Use when runtime or resource behavior is an explicit goal; not for ordinary correctness testing. +--- + +# Work on AbiPy performance + +Start with a reproducible measurement and optimize the dominant cost while preserving scientific results. Separate +Python performance from ABINIT executable scaling: they need different profilers, environments, and evidence. Use +`python-virtual-env` before Python measurements, `netcdf` for large-file layout issues, `abipy-flowtk` for execution +mechanics, and `abipy-plotting` for presentation of benchmark results. + +## Define the measurement + +Record the operation, representative input, dataset size and shape, environment, dependency versions, machine and +CPU count, thread settings, cold/warm-cache state, and metric. Decide whether the target is elapsed time, CPU time, +peak/resident memory, allocations, import latency, I/O volume, or parallel efficiency. + +Use the smallest workload that retains the bottleneck, but confirm the result on a realistic size before claiming an +improvement. Measure a baseline and candidate in the same process model and environment. Repeat short operations, +include warm-up where imports, JITs, filesystem cache, or lazy properties matter, and report a distribution or robust +summary rather than one best run. + +Do not mix correctness setup, queue wait time, plotting/display time, and the code under investigation unless they +are deliberately part of the metric. Avoid timing with debug logging or an interactive backend enabled. + +## Profile Python and imports + +Use a coarse timer first, then a profiler that matches the question. `cProfile` and `pstats` identify cumulative CPU +cost; `python -X importtime -c "import abipy"` plus the repository's `invoke tuna` workflow diagnoses imports; +allocation or RSS tools are needed for memory. Do not infer a memory leak from peak RSS alone. + +Profile the actual public call with representative data. Inspect cumulative time, call count, and callers before +editing. A hot function may be expensive because its caller invokes it redundantly, not because its inner loop is +slow. Compare profiles after the change using the same command and input. + +Keep optional dependencies lazy and avoid moving heavyweight imports into AbiPy's common import path. When reducing +import time, verify both `import abipy` and the first use of the moved feature so initialization cost has not merely +become a surprising runtime spike. + +## Optimize scientific Python safely + +Preserve units, indexing, shapes, dtypes, masks, tolerances, ordering, and lazy-loading behavior. Add or retain a +correctness test before changing vectorization, caching, chunking, parallelism, or numerical libraries. + +For NetCDF-backed objects, read only needed variables and slices, avoid repeated decoding in loops, and distinguish +disk I/O from transformations. Cache an immutable expensive property only when the object's source and parameters +cannot change; bound caches whose keys can grow. Avoid eager materialization of a large array to save a small number +of calls. + +Vectorization is useful when it reduces Python overhead without creating much larger temporaries. Estimate temporary +array sizes and preserve precision. Chunk work when full broadcasting increases peak memory beyond realistic files. +Do not add multiprocessing or threads until the profile shows parallel work large enough to repay startup, copying, +serialization, and oversubscription costs. + +## Benchmark ABINIT scaling + +Use scripts under `abipy/benchmarks` and `BenchmarkFlow` for ABINIT MPI/OpenMP studies. A benchmark script should +build a scientifically fixed workload while varying only the intended parallel configuration. Reuse `bench_main`, +`build_bench_main_parser`, and the patched options: + +- `--mpi-list` and `--omp-list` define tested layouts; +- `--min-ncpus`, `--max-ncpus`, and `--min-eff` bound the matrix; +- `options.accept_mpi_omp` or `accept_conf` filters configurations; +- `options.get_workdir(__file__)` supplies the conventional benchmark work directory. + +Use `BenchmarkFlow.exclude_from_benchmark` for prerequisite tasks whose timing is not part of the comparison. Do not +silently change cutoffs, meshes, algorithms, convergence criteria, task manager, or executable between scaling +points. Record MPI processes, OpenMP threads, total cores, nodes, affinity/binding, manager/queue adapter, ABINIT +version/build, compiler, math/FFT libraries, and relevant hardware. + +`BenchmarkFlow.get_parser` includes successful non-excluded tasks and delegates to the ABINIT timer parser. Check for +missing timing sections and failed tasks before analyzing speedup. Define the reference configuration explicitly: + +```text +speedup(N) = T(reference) / T(N) +efficiency(N) = speedup(N) * reference_cores / N +``` + +Do not compare different scientific outputs as if they were scaling points. Verify representative energies, forces, +iteration counts, or other invariants when a parallel algorithm could change the computation. + +Building a benchmark flow does not execute it. `--scheduler` can submit real jobs, and running a local benchmark can +consume substantial CPU time. Obtain the required authorization before execution or submission, bound the resource +matrix, and use a new or explicitly disposable work directory. Never remove an existing benchmark directory merely +because `--remove` is available. + +## FFT and timing results + +Use `FFTBenchmark.from_file` to analyze existing ABINIT `PROF_*` output and `FFTProf` only when deliberately running +the external FFT profiler. Compare algorithms and thread counts against a clearly identified reference. Preserve +FFT grid and cutoff alignment; do not divide arrays from different problem sizes to compute speedup. + +Use `AbinitTimerParser` for ABINIT timing sections. Treat elapsed, CPU, and section percentages as different metrics, +and confirm all expected files parsed. Queue wait time and scheduler overhead should be reported separately from +ABINIT wall time. + +## Regression tests and acceptance + +Ordinary unit tests should validate parsing, data reduction, configuration generation, and scientific equivalence, +not assert tight wall-clock limits. Shared CI hosts are noisy. Use a dedicated benchmark or a generously bounded +smoke threshold only when a catastrophic complexity regression cannot be detected structurally. + +For a claimed optimization, report baseline and candidate samples, median or another stated statistic, variability, +speedup, peak memory when relevant, and unchanged correctness checks. Prefer an input-size series when algorithmic +complexity is the concern. A result within measurement noise is inconclusive, not an improvement. + +Tests for `abipy/benchmarks` should construct flows in temporary directories, verify task counts and resource +configurations, and build/pickle without scheduling. Tests for parsers should use maintained small output files. Do +not run the full benchmark matrix or open graphical windows in pytest. + +## Completion information + +Report the bottleneck demonstrated by the profile, benchmark command and input, environment and hardware, repetitions +and variability, before/after metrics, numerical equivalence checks, memory tradeoffs, and whether any external jobs +were submitted. Keep raw profiles and large benchmark outputs out of the repository unless they are intentional, +small reference artifacts. diff --git a/.agents/skills/abipy-plotting/SKILL.md b/.agents/skills/abipy-plotting/SKILL.md new file mode 100644 index 000000000..1cc78c367 --- /dev/null +++ b/.agents/skills/abipy-plotting/SKILL.md @@ -0,0 +1,130 @@ +--- +name: abipy-plotting +description: Add, extend, and test AbiPy Matplotlib and Plotly visualization APIs, including plot methods, caller-supplied axes, figure decorators, Robot convergence plots, yield_figs integration, and headless examples. Use for scientific plotting code; not for Panel application layout. +--- + +# Implement AbiPy plotting + +Keep data preparation separable from rendering, follow the plotting conventions of the nearest domain object, and +return figure objects that callers can compose, save, test, or display. Use `abipy-reference-data` when a real file +is needed and `abipy-run-tests` for focused validation. + +## Match the established API + +Matplotlib methods normally: + +- use a `plot_*` name; +- accept `ax=None` for a single axes or an appropriate axes-array argument for composed plots; +- accept domain options plus `**kwargs`; +- use `@abipy.tools.plotting.add_fig_kwargs`; +- return a Matplotlib `Figure`, or `None` only when the documented data/mode cannot be plotted. + +Plotly methods normally use a `plotly_*` name, `get_fig_plotly`/`get_figs_plotly`, and +`@add_plotly_fig_kwargs`. Do not implement Plotly by mechanically converting Matplotlib when a native interactive +figure needs different traces, hover data, or subplot behavior. + +Inspect a mature nearby object before adding a new signature. Preserve established parameter names such as +`fontsize`, `xlims`, `ylims`, `sortby`, `hue`, and `with_legend` when their semantics match. + +## Matplotlib figure ownership + +Use AbiPy helpers instead of calling `plt.subplots` directly when the method supports composition: + +```python +ax, fig, plt = get_ax_fig_plt(ax=ax) +ax_array, fig, plt = get_axarray_fig_plt( + ax_array, nrows=nrows, ncols=ncols, squeeze=False, +) +``` + +When the caller supplies axes, draw into them and return their existing figure. Do not clear unrelated artists, +change global Matplotlib state, call `plt.show`, or close the figure inside the core function. + +Let `@add_fig_kwargs` handle `show`, `savefig`, `title`, `size_kwargs`, `tight_layout`, grids, annotations, closure, +and optional Matplotlib-to-Plotly conversion. Nested calls to another decorated plotting method must pass +`show=False` so a composite plot does not display intermediate figures. + +For arrays of axes, normalize to a predictable shape, fill axes deterministically, and hide unused panels. Do not +depend on Matplotlib's squeezed scalar/one-dimensional return shape unless the helper call explicitly requests it. + +## Scientific presentation + +Labels must state physical quantities and units. Apply conversions before plotting and keep the converted data +available for tests where practical. Be explicit about energy references, normalization, spin/channel selection, +band or atom indexing, and whether coordinates are reduced or Cartesian. + +Choose defaults that reveal the physical signal without silently discarding data. Filtering non-finite values, +clipping ranges, wrapping angles, smoothing, interpolation, or logarithmic scaling must be documented and should be +optional when it changes interpretation. Do not hide outliers merely to improve appearance. + +Use `set_grid_legend`, `set_axlims`, `set_ax_xylabels`, shared-axis helpers, and existing color/marker conventions. +Honor caller style kwargs and avoid hard-coding a global seaborn style, backend, or rcParams in a library method. + +Legends and colorbars should identify all encodings without obscuring data. For convergence plots, make the sort +variable and hue grouping explicit and deterministic. Preserve input order when no sort is requested. + +## Separate computation from rendering + +Move substantial extraction, aggregation, fitting, or statistical logic into a method that returns arrays, +dataframes, or a small result object. The plotting method should orchestrate these results and axes. This makes the +scientific transformation testable without inspecting pixels and lets Matplotlib and Plotly share the same data. + +Do not reread a large NetCDF variable once per subplot when it can be loaded or reduced once. Conversely, avoid +eagerly materializing an entire large dataset when the plot needs a small slice. + +## File objects, Robots, and automatic figures + +Put a single-file scientific view on the file/domain object. Put cross-file comparison and convergence plots on its +`Robot`. Robot methods should use the existing label/path mapping, `sortby` and `hue` conventions, and dataframe or +parameter helpers rather than reopen files independently. + +Add a plot to `yield_figs` only when it is useful as a default automatic view for `abiopen -e`. Yield figures with +display disabled and avoid expensive combinatorial plots. An object may expose useful plotting methods without +including all of them in `yield_figs`. + +Add notebook cells or Plotly/Panel integration only when the corresponding object already supports that layer. A +Matplotlib plot does not automatically require a new notebook or dashboard API. + +## Plotly behavior + +Construct traces with meaningful names, legend groups, axes labels, hover text, and units. Respect a caller-provided +figure and the requested subplot row/column. Use the global Plotly show setting and `@add_plotly_fig_kwargs` rather +than calling `fig.show()` unconditionally. + +Keep Matplotlib and Plotly numerically consistent when they represent the same method, but allow presentation to +differ where native interaction benefits from it. Test shared data generation separately from backend-specific +trace construction. + +## Examples and documentation + +Add an example under `abipy/examples/plot` when the plot introduces a user-facing workflow not already demonstrated. +Use bundled data through `abipy.data`, keep runtime modest, and write the example so it works with a noninteractive +backend. Do not commit generated PDFs, PNGs, notebooks, or text exports from running the example unless they are +intentional maintained artifacts. + +Examples may call plotting methods with their normal display defaults for gallery use. Automated checks must select +the `Agg` backend or pass `show=False`. + +## Tests + +Place tests beside the domain object. Guard optional backends with `AbipyTest.has_matplotlib()` or +`has_plotly()` as established in the suite. + +For Matplotlib, call the method with `show=False` and assert the returned figure plus meaningful invariants such as: + +- expected axes count and visibility; +- line, image, collection, or trace count; +- axis labels and units; +- plotted numerical data for a representative slice; +- support for a caller-provided axes; +- important option branches and documented `None` cases. + +Close figures created by tests when a loop or large suite could accumulate them. Do not use interactive windows, +browsers, clipboard integration, or `show=True` in automated tests. Prefer semantic assertions to image snapshots; +use an image comparison only for a genuine layout/rendering regression that structural checks cannot capture. + +For Plotly, assert figure type, trace/subplot count, names, axes labels, and representative trace data with display +disabled. Do not require Chart Studio or a browser. + +Report the new public methods, backend coverage, data transformations, default `yield_figs` impact, example added, +and the headless test commands used. diff --git a/.agents/skills/abipy-reference-data/SKILL.md b/.agents/skills/abipy-reference-data/SKILL.md new file mode 100644 index 000000000..74e5d4a94 --- /dev/null +++ b/.agents/skills/abipy-reference-data/SKILL.md @@ -0,0 +1,131 @@ +--- +name: abipy-reference-data +description: Find, add, regenerate, package, and validate AbiPy structures, pseudopotentials, scientific reference outputs, and test fixtures under abipy/data. Use when tests, examples, or readers need bundled data; avoid for transient outputs or large datasets better stored externally. +--- + +# Manage AbiPy reference data + +Treat bundled data as maintained scientific test inputs, not as a convenient dump of calculation outputs. Reuse an +existing fixture whenever it exercises the required schema and values; add data only when it enables meaningful +coverage that cannot be obtained cheaply with a small synthetic object. + +Use `abipy-file-reader` when the fixture supports a new file format, `netcdf` to inspect NetCDF content, and +`abipy-run-tests` when validating consumers. + +## Find existing data first + +Search both filenames and consumers: + +```bash +find abipy/data -type f | sort +rg -n 'BASENAME|ref_file\(|cif_file\(|pseudo\(' abipy +``` + +Use the public helpers rather than checkout-relative paths: + +- `abipy.data.cif_file` / `cif_files` for structures in `abipy/data/cifs`; +- `abipy.data.pseudo` / `pseudos` for bundled pseudopotentials; +- `abipy.data.ref_file` / `ref_files` for scientific outputs and other data-relative paths; +- `abipy.data.structure_from_ucell` for built-in unit cells; +- `abipy.data.pyscript` for examples. + +`ref_file` indexes every `.nc` below `abipy/data/refs` by basename. NetCDF basenames should therefore be unique; +duplicates produce an ambiguous-data warning. For non-NetCDF files and explicit nested paths, pass the path relative +to `abipy/data`, for example `refs/case/file_DDB`. + +Do not expose a new helper or module-level file list unless multiple consumers need a stable semantic API. A test +that needs one fixture can call `ref_file` directly. + +## Choose the location + +- Put reusable crystal structures in `abipy/data/cifs`. +- Put small redistributable pseudopotentials in the established pseudo directories only after checking format, + species, provenance, and redistribution terms. +- Put related ABINIT outputs in a descriptive subdirectory of `abipy/data/refs` when several files form one + calculation or comparison set. +- Put a single broadly reused NetCDF output at the appropriate existing location and keep its basename unique. +- Use `abipy/test_files` for CLI/parser fixtures that are not part of the public `abipy.data` scientific API. +- Keep transient work directories, scheduler artifacts, caches, plots, and generated scratch files out of the data + tree. + +Match the nearest existing dataset layout. Do not create a new directory hierarchy for one tiny file when an +established related reference set exists. + +## Minimize and document scientific content + +Before adding a binary file, inspect its size and contents: + +```bash +du -h /path/to/file +ncdump -h /path/to/file.nc +``` + +Retain only variables and companion files required to reproduce or understand the tested behavior, but do not +rewrite an ABINIT NetCDF file with an ad hoc tool if doing so would make it cease to represent real ABINIT output. +Prefer a smaller physical calculation over post-hoc binary surgery. + +For generated scientific outputs, preserve enough provenance in an existing input, log, generator script, or nearby +metadata convention to identify: + +- producing program and version/commit; +- input variables and pseudopotentials; +- why this case is needed and which behavior it exercises; +- any intentional corruption, truncation, legacy schema, or post-processing. + +Do not replace a legacy fixture merely because a new ABINIT version writes different metadata; compatibility tests +may depend on the old schema. Add or regenerate data only after deciding whether the expected behavior is backward +compatibility or adoption of the new format. + +Avoid committing large outputs casually. If a fixture is several megabytes, estimate its repository and package +cost, look for a smaller calculation, and confirm that the test cannot isolate the behavior with mocks or arrays. +Datasets used for benchmarks, tutorials, or broad research analysis may belong in an external versioned dataset +rather than the Python package. + +## Generate or update fixtures + +Use the established `FilesGenerator`, `AbinitFilesGenerator`, or `AnaddbFilesGenerator` pattern when it fits. These +operations execute scientific codes and clean/rename outputs; run them only in a dedicated work directory with the +intended executables and environment. + +Never generate directly inside `abipy/data/refs`. Generate in a temporary or dedicated calculation directory, +inspect results, then copy only the resolved files into the repository. Do not overwrite an existing fixture until +its consumers and compatibility purpose have been identified. + +When changing a fixture, compare old and new schemas and representative values. Review changes in dimensions, +units, indexing, fill values, attributes, and numerical tolerances rather than accepting a new binary solely because +the producing calculation completed. + +## Packaging + +Being present in the source tree does not guarantee inclusion in both sdist and wheel. `MANIFEST.in` includes only +selected extensions recursively, while `setup.py` has explicit `package_data` patterns and a finite list of nested +reference directories. + +When adding a new file type or nested reference directory: + +1. update the narrowest appropriate packaging rule; +2. avoid broad wildcards that pull scratch files or large unrelated data into distributions; +3. build both sdist and wheel when packaging behavior changed; +4. inspect the archives and verify the installed package can resolve the fixture through `abipy.data`. + +Do not rely on an editable checkout test as proof that packaged data is available. + +## Tests and review + +Add or update the nearest scientific consumer test. Add a focused assertion in `abipy/data/tests/test_data.py` only +when the public data helper itself changed. + +Verify: + +- the helper returns an existing regular file; +- the basename is unambiguous where basename lookup is used; +- the relevant reader opens and closes it; +- a small set of stable schema/value invariants proves it is the intended fixture; +- all known consumers still pass; +- packaging includes it when the file is part of distributions. + +Avoid checksums as the only scientific test: they detect any byte change but do not explain correctness. Checksums +can supplement schema and value assertions when exact identity is required. + +Report files added or replaced, byte sizes, provenance, producing-code version, affected consumers, package archive +verification, and whether an old fixture remains available for compatibility coverage. diff --git a/.agents/skills/abipy-robots/SKILL.md b/.agents/skills/abipy-robots/SKILL.md new file mode 100644 index 000000000..6a551c44c --- /dev/null +++ b/.agents/skills/abipy-robots/SKILL.md @@ -0,0 +1,115 @@ +--- +name: abipy-robots +description: Build, extend, and test AbiPy Robot classes for lifecycle-safe analysis, comparison, convergence, grouping, and plotting across collections of output files. Use for multi-file APIs; not for a single-file reader or generic plotting changes. +--- + +# Develop AbiPy Robots + +A Robot owns a labeled collection of compatible AbiPy file objects and provides analysis that is meaningful across +files. Keep single-file decoding and physics on the file/domain object; add a Robot when comparison, aggregation, or +convergence is the actual abstraction. Use `abipy-file-reader` for a new format, `abipy-plotting` for figure +conventions, and `abipy-reference-data` plus `abipy-run-tests` for fixtures and validation. + +## Start from the base contract + +Subclass `abipy.abio.robots.Robot` and define the canonical `EXT` handled by the associated file class. Inspect a +mature Robot in the same scientific domain before designing dataframe columns, convergence methods, notebook cells, +or mixins such as `RobotWithEbands` and `RobotWithPhbands`. + +Ensure `class_handles_filename` recognizes real produced basenames, especially formats with special names such as +`anaddb.nc` or exclusions such as `_DDB.nc`. A generally supported Robot must be discoverable through +`Robot.class_for_ext` and exported through the same `abilab` or package path as comparable classes. + +Do not introduce a Robot merely to mirror one file's methods. A small collection with no meaningful cross-file +operation can use the base machinery until a stable comparison API emerges. + +## Construct collections deliberately + +Support the base constructors rather than inventing parallel discovery logic: + +- `from_files` for explicit inputs and optional labels; +- `from_dir`, `from_dirs`, or `from_dir_glob` for extension-based scanning; +- `from_flow` or `from_work` for products already present in a workflow; +- JSON reconstruction only when path-based persistence is appropriate. + +Labels are stable user-facing identifiers and dataframe indices, not necessarily filepaths. Require uniqueness, +preserve insertion order, and use `change_labels`, `remap_labels`, or `trim_paths` rather than mutating `_abifiles` +from client code. `abspath` controls labels; file objects still retain their actual paths. + +When building from a Flow, honor `outdirs`, `nids`, `ext`, and `task_class` filtering and use node output-directory +helpers. Do not rerun tasks or infer missing products during collection construction. + +## Preserve file ownership + +Robots opened from path strings own those handles and must close them. File objects supplied by the caller are not +automatically owned. Maintain the base `_do_close` semantics when adding, filtering, removing, or popping entries. + +Use Robots as context managers in scripts and tests: + +```python +with abilab.GsrRobot.from_files(paths, labels=labels) as robot: + frame = robot.get_dataframe() +``` + +If a candidate opened from a path is rejected by a filter or insertion fails, close the newly owned object. Do not +close caller-owned objects or reopen every file inside each analysis method. `remove()` deletes underlying files and +is materially different from `close()`; use it only when deletion is explicitly intended. + +## Design comparison data + +Provide a `get_dataframe` method when tabular comparison is useful. Use labels or normalized paths as a deterministic +index and make optional sections explicit, following nearby names such as `with_geo`, `with_params`, `with_spin`, +and `abspath`. Start from each file's semantic properties and `params`; do not reach through a low-level NetCDF +reader repeatedly when a high-level property exists. + +Column names must identify quantities and units where ambiguity is possible. Preserve numerical dtypes, use +well-defined missing values for genuinely optional data, and keep row order aligned with Robot order. Accept custom +`funcs` only through the established `(name, value)` callback convention so failures are recorded in +`robot.exceptions` rather than corrupting unrelated columns. + +Reuse `get_params_dataframe`, structure-dataframe helpers, `sortby`, and `group_and_sortby`. Their selectors may be +callables, dotted attributes, or keys in `abifile.params`; raise an informative error for an unresolved selector +instead of silently substituting labels or array indices. + +## Implement convergence and plots + +Put cross-file plots on the Robot and single-file plots on the file object. For convergence methods, use the base +sorting and hue grouping so callable selectors, dotted attributes, parameter keys, labels, and group order behave +consistently. Preserve input order when sorting is not requested and label axes with the selected quantity and units. + +Separate dataframe or array construction from rendering when the transformation is substantial. Follow +`abipy-plotting` for `@add_fig_kwargs`, caller-supplied axes, `show=False` in nested calls, Plotly behavior, and +headless tests. Do not let plotting methods reopen files or mutate Robot labels. + +`yield_figs` should expose a small, inexpensive set of useful automatic comparisons. Notebook generation should use +the base Robot code cells and reconstruct the intended labels/paths; it is optional unless nearby Robots support it. + +## Serialization constraints + +Base MSON serialization stores filepaths needed to reconstruct the Robot, not loaded scientific arrays or live file +handles. Keep this representation portable and deterministic. `trim_paths` changes labels for presentation; it does +not rewrite the stored file object's path. + +When adding fields to serialization, verify a round trip and decide explicitly whether paths should be absolute or +relative to a documented base. Do not promise that a serialized Robot is self-contained when it still depends on +external output files. + +## Tests + +Put generic base behavior in `abipy/abio/tests/test_robots.py` and domain behavior in the owning package's tests. Use +small files from `abipy.data` and context managers. Cover the applicable invariants: + +- filename handling and `class_for_ext` registration; +- construction from one file, several files, directories, and a Flow when relevant; +- stable unique labels, path trimming, sorting, and hue grouping; +- dataframe index, columns, units, row order, representative values, and optional branches; +- owned handles close while caller-owned file objects remain usable; +- JSON/MSON reconstruction when supported; +- convergence figures with display disabled; +- empty, duplicate-label, missing-selector, filtered-file, and heterogeneous-file behavior. + +Do not delete reference outputs, scan large directory trees, start jobs, or require a graphical display. Test +scientific comparisons with meaningful invariants rather than only checking that a dataframe or figure is non-null. + +Report the Robot class and `EXT`, supported construction paths, ownership behavior, dataframe/comparison APIs, +public registration, and focused tests used. diff --git a/.agents/skills/abipy-run-tests/SKILL.md b/.agents/skills/abipy-run-tests/SKILL.md new file mode 100644 index 000000000..c00fbe14a --- /dev/null +++ b/.agents/skills/abipy-run-tests/SKILL.md @@ -0,0 +1,57 @@ +--- +name: abipy-run-tests +description: Select and run focused AbiPy pytest tests, distinguish unit from ABINIT-backed integration tests, and use AbiPy's test helpers and reference data. Use when validating AbiPy changes or diagnosing test failures. +--- + +# Run AbiPy tests + +Activate and verify the project Python environment first. Run from the repository root and prefer +`python -m pytest` so the selected interpreter supplies pytest. + +## Start focused + +Run the closest test module or node first: + +```bash +python -m pytest abipy/electrons/tests/test_gsr.py -q +python -m pytest abipy/electrons/tests/test_gsr.py::GsrFileTest::test_gsr -q +``` + +Then expand to the package tests affected by the change: + +```bash +python -m pytest abipy/electrons/tests -q +``` + +Use `-x` while iterating, `-vv` for detailed collection/output, `-s` only when captured output hides relevant +diagnostics, and `--lf` only when the previous pytest cache is relevant to the current tree. + +The repository-wide Invoke task runs coverage, doctests, and parallel workers while excluding integration tests, +reference data, scripts, examples, flows, and GUI code: + +```bash +invoke pytest +``` + +Use it as a broader check, not as the first diagnostic command. + +## Test categories + +- Unit and file-reader tests live beside modules in `abipy/**/tests` and often derive from + `abipy.core.testing.AbipyTest`. +- CLI tests live in `abipy/scripts/tests` and may exercise subprocess behavior. +- `abipy/integration_tests` can launch ABINIT workflows and depends on executables, managers, pseudopotentials, and + machine configuration. Run these only when the change requires them and the environment is configured. +- Examples and bundled reference files are not automatically covered by the top-level Invoke task. + +Inspect `abipy/core/testing.py` before recreating helpers. It provides dependency checks, temporary directories, +numerical assertions, and access patterns for data under `abipy/data`. Prefer `abipy.data.ref_file`, `cif_file`, +`pseudos`, and related helpers over paths tied to the checkout layout. + +## Failure triage + +Confirm that `abipy.__file__` points to this working tree. Separate missing optional dependencies, unavailable ABINIT +executables, absent external test data, and genuine assertion failures. Do not weaken tolerances, update binary +reference files, or turn failures into skips without establishing that the expected scientific behavior changed. + +Report the exact test command, environment/interpreter, and pass/fail/skip summary. diff --git a/.agents/skills/abipy-serialization/SKILL.md b/.agents/skills/abipy-serialization/SKILL.md new file mode 100644 index 000000000..40153df4e --- /dev/null +++ b/.agents/skills/abipy-serialization/SKILL.md @@ -0,0 +1,111 @@ +--- +name: abipy-serialization +description: Add, evolve, and test AbiPy object serialization with Monty/MSON JSON, pickle helpers, slot state, Flow persistence, and generated notebooks. Use for persistence and round-trip compatibility; not for NetCDF scientific file readers. +--- + +# Develop AbiPy serialization + +Choose the representation from the persistence contract, not convenience. JSON/MSON is inspectable and suitable for +portable object state; pickle preserves richer Python graphs but is version-sensitive and unsafe for untrusted +input; notebooks are executable reconstructions, not serialized data. Use `netcdf` or `abipy-file-reader` for ABINIT +scientific file formats and `abipy-flowtk` for workflow semantics beyond persistence. + +## Select the established mechanism + +Inspect `abipy/tools/serialization.py`, `abipy/core/mixins.py`, and a nearby object with the same lifetime. + +- Use Monty's `MontyEncoder`/`MontyDecoder` and `mjson_write`, `mjson_load`, or `mjson_loads` for MSONable JSON. +- Derive small result containers needing both JSON and pickle file helpers from `Serializable`. +- Use `HasPickleIO` when the established API persists an object under a work directory and conventional basename. +- Use `SlotPickleMixin` only for classes with `__slots__` whose slot values form their complete pickle state. +- Use the specialized `Flow.pickle_*` implementation for Flow graphs; do not replace it with a generic mixin. +- Use `NotebookWriter` only when an object can generate a useful, reproducible analysis notebook. + +Do not create another wrapper when one of these contracts fits. Avoid mixing YAML configuration, NetCDF output, and +object persistence merely because all are file I/O. + +## Implement MSON round trips + +An MSONable object provides `as_dict` and a compatible `from_dict`. Decorate `as_dict` with `@pmg_serialize` when the +method does not otherwise add `@module` and `@class`; the decoder needs those exact importable identifiers. + +Serialize constructor-level semantic state rather than caches, readers, open handles, callbacks, loggers, or derived +arrays that can be rebuilt cheaply. Use nested objects' own `as_dict` representation and let Monty recursively encode +NumPy, datetime, pathlib, and other supported values. Do not manually stringify a rich object unless the string is +the actual stable contract. + +`from_dict` must tolerate Monty having already decoded nested objects. Reconstruct through public constructors where +possible so validation and normalization still occur. Do not mutate the caller's dictionary while popping metadata +or compatibility fields; copy it first. + +Treat the serialized keys as a compatibility surface. When renaming or adding state: + +- give new optional fields a documented default when old files have an unambiguous meaning; +- accept legacy keys narrowly and normalize them in one place; +- reject missing required or malformed state with a useful error; +- never silently substitute scientifically different defaults. + +Include an explicit schema/version field only when real migrations require it. Do not add version machinery without +a compatibility policy and tests for an older representation. + +## Use pickle with the right safety model + +Never load a pickle from an untrusted or unexplained source; unpickling can execute arbitrary code. JSON is not a +drop-in safe format either, but ordinary parsing does not carry pickle's execution semantics. + +Pickles generally require importable class paths and compatible Python/library definitions. Do not advertise them as +long-term or cross-version interchange. Exclude or reconstruct resources that cannot be pickled reliably, such as +open NetCDF handles, subprocesses, locks, weak references, and live scheduler connections. + +For `__slots__`, ensure `SlotPickleMixin.__getstate__` covers every slot that determines behavior and that +`__setstate__` can restore a valid instance. If inheritance contributes slots or extra state, implement the combined +state deliberately rather than assuming the mixin discovers it. + +Flow persistence is transactional and concurrency-sensitive. Preserve `FileLock`, `AtomicFile`, the configured +pickle protocol, `PmgPickler` handling of external pymatgen objects, Flow version checks, and spectator-mode loading. +Removing a `.lock` file is a recovery action: first establish that no scheduler or writer is active. Loading a Flow +may call `check_status`; it is not equivalent to inert JSON parsing. + +## Paths and external resources + +State clearly whether a serialized object embeds data or only refers to files. Robot and Flow JSON commonly stores +paths needed to reconstruct an object; moving or deleting those files breaks reconstruction. + +Normalize path-like values consistently, but do not replace absolute paths with relative paths unless a stable base +directory is part of the contract. Never persist machine-specific temporary paths as a supposedly portable fixture. +When a reader is reconstructed from a path, keep ownership and closing behavior consistent with the original class. + +Write persistent state atomically when partial writes could corrupt a reusable database. Use AbiPy's established +atomic/file-lock pattern rather than open-coded temporary-file renames around Flow state. + +## Generate notebooks deliberately + +`write_notebook` should call `get_nbformat_nbv_nb`, append focused Markdown and code cells, and finish with +`_write_nb_nbpath`. Generated code must import from public AbiPy APIs and reconstruct the object from stable inputs. + +Do not embed a live object through an opaque temporary pickle unless the existing object explicitly uses that +short-lived pattern. Quote paths safely, avoid machine-specific environment assumptions, and do not execute the +notebook during generation. Notebook creation must not open a browser or call `expose`. + +## Tests + +Use a pytest temporary directory and test the actual public round trip: + +- `MontyEncoder` to `MontyDecoder`, plus `mjson_write`/`mjson_load` when file helpers are part of the API; +- pickle dump/load for supported objects, using the correct specialized loader; +- equality of semantic values, array dtype/shape, units, optional fields, and nested types; +- legacy dictionaries when backward compatibility is intentional; +- type checks and useful failures for incompatible or malformed state; +- slot state, path behavior, and exclusion/reconstruction of transient resources; +- notebook JSON validity, key cells, and explicit output paths without executing a kernel. + +Do not merely assert that decoding returns the same class. Compare the state that determines scientific behavior and +verify the reconstructed object remains usable. Avoid committing generated pickle files: their bytes and protocol +are not stable fixtures. A JSON fixture is appropriate only when it represents a maintained compatibility contract. + +For Flow persistence, use a temporary Flow and verify graph identity, dependencies, manager/state behavior, version +handling, and spectator mode without submitting jobs. Use `abipy-integration-tests` only when scheduler execution or +real task products are essential. + +Report the serialization format and public helpers used, embedded versus referenced state, compatibility behavior, +security or version limitations, and round-trip tests run. diff --git a/.agents/skills/netcdf/SKILL.md b/.agents/skills/netcdf/SKILL.md new file mode 100644 index 000000000..d8994c046 --- /dev/null +++ b/.agents/skills/netcdf/SKILL.md @@ -0,0 +1,61 @@ +--- +name: netcdf +description: Diagnose NetCDF schemas and values across AbiPy's Python readers and ABINIT's Fortran writers, including dimensions, slices, units, complex values, and Fortran/C axis ordering. Use for .nc parsing or data discrepancies. +--- + +# Diagnose NetCDF data + +Trace a value from the ABINIT writer to the file schema and then to the AbiPy reader. Determine whether a discrepancy +comes from the value constructed by ABINIT, serialization, units, axis order, or AbiPy interpretation. + +## Start from both ends + +In AbiPy, locate the reader with searches for the variable name, `read_value`, `read_variable`, `ETSF_Reader`, and the +relevant `*File` class. Check transformations after reading: transpose/reshape operations, unit conversion, complex +reconstruction, spin conventions, and index normalization. + +In an ABINIT checkout, locate the corresponding `nf90_def_var` and `nf90_put_var` calls and inspect the exact array or +slice written. If its `abisrc.py` supports `nc_explain`, prefer: + +```bash +./abisrc.py nc_explain PROCEDURE --follow 2 +./abisrc.py nc_explain PROCEDURE --check FILE.nc +``` + +Otherwise search the Fortran source directly. Do not assume the file was produced by the currently checked-out +ABINIT version. + +## Axis ordering + +The NetCDF Fortran interface maps Fortran array order to the declared file dimension order. C-model tools such as +Python `netCDF4`, xarray, `ncdump`, and `h5dump` commonly show dimensions in reverse order relative to the Fortran +declaration. For example, a Fortran `x(n1,n2,n3)` can appear as `(n3,n2,n1)` in Python. + +This is not by itself evidence of a bad transpose. Confirm the dimension definitions and write call. Never reverse +axes mechanically when the call uses `start`, `count`, an array slice, or an intermediate buffer. + +## Investigation checklist + +1. Inspect the file header and variable attributes with `ncdump -h FILE.nc` or Python. +2. Record dimension names, not just sizes, plus units, fill values, groups, and dtype. +3. Locate the exact AbiPy read path and every transformation applied afterward. +4. Locate the exact Fortran declaration, construction, and write call or slice. +5. Account for unit conversion, packed complex numbers (often a final axis of size 2), one-based indices, symmetry, + parallel decomposition, and unwritten/fill entries. +6. Compare a few representative physical indices rather than raw memory layouts. + +Minimal Python inspection: + +```python +from netCDF4 import Dataset + +with Dataset("file.nc") as nc: + var = nc.variables["variable_name"] + print(var.dimensions, var.shape, var.dtype) + print(var.__dict__) + print(var[:]) +``` + +When changing a reader, add or update a focused test beside its module and use a small file from `abipy/data/refs` +when one already exercises the schema. Do not add large binary fixtures casually; first check whether an existing +reference file covers the case. diff --git a/.agents/skills/python-virtual-env/SKILL.md b/.agents/skills/python-virtual-env/SKILL.md new file mode 100644 index 000000000..e7b36032e --- /dev/null +++ b/.agents/skills/python-virtual-env/SKILL.md @@ -0,0 +1,75 @@ +--- +name: python-virtual-env +description: Select and activate the correct existing Python environment before running Python tools, tests, or build scripts. Prefer Conda environments under ~/miniconda3; ask when repository evidence does not identify a reliable environment. +--- + +# Select a Python environment + +Choose and activate the correct existing Python environment before running project Python commands. Do not assume +that `python`, `pip`, or `pytest` on the default `PATH` belongs to the repository. + +Use this skill for Python tools, tests, documentation builders, import diagnostics, and dependency checks. Skip +discovery only when the user supplied an absolute interpreter or the active interpreter has been verified in the +current command session. + +## Selection policy + +Use evidence in this order: + +1. An environment or interpreter explicitly named by the user. +2. Repository instructions and environment files. +3. An active environment whose interpreter and relevant imports have been verified. +4. Names and package contents of existing Conda environments. + +Never select an environment only because its Python version seems plausible. If multiple environments remain +plausible and the choice could affect results, ask the user. Do not create an environment or install packages merely +to avoid that question. + +## Discover and activate Conda environments + +The user normally installs Miniconda under `$HOME/miniconda3`. In a non-interactive shell: + +```bash +source "$HOME/miniconda3/etc/profile.d/conda.sh" +conda env list +``` + +If that installation does not exist, use `command -v conda` or ask where Conda is installed. Do not run +`conda init`; it changes shell configuration and is unnecessary for one command. + +Activation and the dependent command must run in the same shell invocation: + +```bash +source "$HOME/miniconda3/etc/profile.d/conda.sh" +conda activate ENVIRONMENT_NAME +python --version +python -c 'import sys; print(sys.executable)' +python -c 'import abipy; print(abipy.__file__)' +``` + +`conda run -n ENVIRONMENT_NAME python ...` is an alternative when activation is impractical. Do not silently switch +away from an explicitly requested environment if activation fails. + +## Verify suitability + +Before a long or mutating workflow, verify the interpreter and important project import: + +```bash +which python +python --version +python -c 'import sys; print(sys.executable)' +python -c 'import abipy; print(abipy.__file__)' +``` + +For this repository, the `abipy` path should resolve to the working tree unless an installed-package test was +explicitly requested. Prefer `python -m pytest` so pytest belongs to the selected interpreter. + +## Package changes + +Install or update packages only when requested or when it is an authorized, necessary part of the task. Prefer the +project's established package manager and use `python -m pip` instead of bare `pip`. Never install into Conda `base` +by default, and do not perform bulk environment updates as routine troubleshooting. + +Environment creation, export, and bulk updates are separate mutations and require explicit user intent. + +When environment selection affected the task, report the environment name and interpreter path. diff --git a/.claude/skills b/.claude/skills new file mode 120000 index 000000000..ac173151d --- /dev/null +++ b/.claude/skills @@ -0,0 +1 @@ +../.agents/skills/ \ No newline at end of file