Skip to content

Docs: suggesting smaller mixing parameters for non converging spin-polarized calculations#7589

Open
Cstandardlib wants to merge 2 commits into
deepmodeling:developfrom
Cstandardlib:fix/mixing
Open

Docs: suggesting smaller mixing parameters for non converging spin-polarized calculations#7589
Cstandardlib wants to merge 2 commits into
deepmodeling:developfrom
Cstandardlib:fix/mixing

Conversation

@Cstandardlib

Copy link
Copy Markdown
Collaborator

Linked Issue

Fix #7125

What's changed?

Copilot AI review requested due to automatic review settings July 3, 2026 17:53

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates ABACUS input-parameter documentation (and the corresponding built-in help text) to advise smaller/paired mixing parameters for hard-to-converge spin-polarized SCF calculations, in response to issue #7125.

Changes:

  • Extend mixing_beta help text to recommend reducing mixing_beta and mixing_beta_mag together for difficult spin-polarized SCF.
  • Extend mixing_beta_mag help text with the same paired-reduction guidance.
  • Update docs/parameters.yaml mixing sections accordingly (but also includes multiple unrelated documentation changes beyond the stated PR scope).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 11 comments.

File Description
source/source_io/module_parameter/read_input_item_elec_stru.cpp Updates built-in parameter descriptions for mixing_beta and mixing_beta_mag.
docs/parameters.yaml Updates parameter docs for mixing guidance and includes several additional documentation edits across other parameters.

Comment on lines 579 to +583
* 0.1 or less: if convergence of SCF calculation is difficult to reach, please try 0 < mixing_beta < 0.1.

Note: For low-dimensional large systems, the setup of mixing_beta=0.1, mixing_ndim=20, and mixing_gg0=1.0 usually works well.)";
Note: For low-dimensional large systems, the setup of mixing_beta=0.1, mixing_ndim=20, and mixing_gg0=1.0 usually works well.

For spin-polarized calculations (nspin=2 or nspin=4) that are difficult to converge, try reducing both mixing_beta and mixing_beta_mag simultaneously, e.g., mixing_beta=0.1 and mixing_beta_mag=0.1 or lower.)";
Comment on lines +616 to +619
item.description = R"(Mixing parameter of magnetic density.

If SCF convergence is difficult with spin polarization (nspin=2 or nspin=4), try reducing both mixing_beta and mixing_beta_mag simultaneously, e.g., mixing_beta=0.1 and mixing_beta_mag=0.1 or lower.)";

Comment thread docs/parameters.yaml
Comment thread docs/parameters.yaml
Comment thread docs/parameters.yaml
type: Real
description: |
It's the density threshold for electronic iteration. It represents the charge density error between two sequential densities from electronic iterations. This criterion is always enabled. If `scf_ene_thr` is set, the total-energy criterion (`scf_ene_thr`) is evaluated conditionally after the charge-density criterion (`scf_thr`) is satisfied, and not on the first iteration. For local-orbital calculations, 1e-6 is usually accurate enough.
It's the density threshold for electronic iteration. It represents the charge density error between two sequential densities from electronic iterations. Usually for local orbitals, usually 1e-6 may be accurate enough.
Comment thread docs/parameters.yaml
Comment on lines 1395 to 1399
* nhc: Nose-Hoover chain, see md_tfreq and md_tchain in detail.
* anderson: Anderson thermostat, see md_nraise in detail.
* berendsen: Berendsen thermostat, see md_nraise in detail.
* rescaling: velocity Rescaling method 1, see md_tolerance in detail.
* rescale_v: velocity Rescaling method 2, see md_nraise in detail.
Comment thread docs/parameters.yaml
type: Boolean
description: |
Whether to print Hamiltonian matrices H(R) in npz format. The output files are named output_HR0.npz, output_HR1.npz, and so on according to spin channel. This feature requires ABACUS to be built with CNPY.
Whether to print Hamiltonian matrices H(R) in npz format. This feature does not work for gamma-only calculations.
Comment thread docs/parameters.yaml
availability: sc_mag_switch is true
- name: sc_scan_lambda_start
category: Spin-Constrained DFT
type: Float
Comment thread docs/parameters.yaml
availability: sc_lambda_strategy is linear_scan
- name: sc_scan_lambda_end
category: Spin-Constrained DFT
type: Float
Comment thread docs/parameters.yaml
Comment on lines +140 to +153
- name: assume_isolated
category: System variables
type: String
description: |
Used to perform a calculation assuming an isolated system in a 3D supercell.

Available options are:
* none: regular periodic calculation without isolated-system correction.
* makov-payne, m-p, mp: compute the Makov-Payne correction to the total energy and estimate a corrected vacuum level for eigenvalue alignment. This option is available only for cubic lattices (latname = sc, fcc, or bcc).

Theory: G. Makov and M. C. Payne, Phys. Rev. B 51, 4014 (1995).
default_value: none
unit: ""
availability: ""
@Cstandardlib

Cstandardlib commented Jul 4, 2026

Copy link
Copy Markdown
Collaborator Author

Some PRs are making changes to docs without following the instructions after v3.9.0.24, so the documentation lags behind the source code.
And the agents do not allow the generate-parameters-yaml workflow now.

For example, #7384, #7354, #7280 update docs or add new params but did NOT update parameter.yaml, so the changes are not even present in input-main.md.

@QuantumMisaka

Copy link
Copy Markdown
Collaborator

My practices for mixing_beta tuning: 0.4 -> 0.1 -> 0.025 is a general way

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BUG: USPP hard to converge and yields incorrect magnetic moments

3 participants