Skip to content

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

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

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

Conversation

@Cstandardlib

@Cstandardlib Cstandardlib commented Jul 3, 2026

Copy link
Copy Markdown
Collaborator

Linked Issue

Fix #7125

What's changed?

Tests

Tests not required for now. A dedicated PR #7592 will be submitted to handle the docs & source consistency.

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 thread source/source_io/module_parameter/read_input_item_elec_stru.cpp
Comment thread source/source_io/module_parameter/read_input_item_elec_stru.cpp
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
@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

@Cstandardlib

Copy link
Copy Markdown
Collaborator Author

Update docs to include advice by @QuantumMisaka.
Update input-main.
I note that input-main update is checked and required by agent governance but not by instructions.

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