feat(input, kpoints): support shifted kspacing mesh with koffset and kmesh_type#7247
Merged
Cstandardlib merged 10 commits intodeepmodeling:developfrom Apr 17, 2026
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Adds configurable shifted automatic k-point meshes for the kspacing workflow by introducing koffset and kmesh_type, and updates documentation/tests accordingly.
Changes:
- Added new INPUT parameters
koffset(3 reals) andkmesh_type(gamma/mp) with parsing/validation. - Updated
kspacingauto-generatedK_POINTSto use the configured mesh type and offset. - Added unit tests for shifted Gamma and Monkhorst-Pack paths; updated docs.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
source/source_io/module_parameter/read_input_item_system.cpp |
Registers/parses koffset and kmesh_type input items. |
source/source_io/module_parameter/input_parameter.h |
Adds koffset and kmesh_type to Input_para. |
source/source_cell/klist.cpp |
Uses kmesh_type and koffset when writing auto K_POINTS for kspacing. |
source/source_cell/test/klist_test.cpp |
Adds/updates tests to cover shifted Gamma/MP meshes under kspacing. |
docs/parameters.yaml |
Documents new parameters (and includes other OFDFT doc changes). |
docs/advanced/input_files/input-main.md |
Adds new parameter sections for koffset/kmesh_type (but also alters OFDFT docs). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
xinchenhou
approved these changes
Apr 17, 2026
mohanchen
approved these changes
Apr 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Linked Issue
Refs #7242
Description
This PR adds shifted k-point mesh support for the kspacing workflow.
Previously, when
kspacing> 0, ABACUS always generated a Gamma mesh with fixed offset 0 0 0.Now users can configure both mesh type and offset for auto-generated K_POINTS.
What's changed?
Added new INPUT parameters:
koffset: 3 real values, default 0.0 0.0 0.0kmesh_type: gamma or mp, default gammaExtended input parsing and validation:
koffsetmust provide exactly 3 valueskmesh_typeaccepts gamma/mp (case-insensitive handling, normalized internally)Updated kspacing auto K_POINTS generation:
kmesh_typekoffsetinstead of hardcoded 0 0 0Updated documentation with new options
Unit Tests and/or Case Tests for my changes
Any changes of core modules?
kspacingbranch now supports configurable mesh type and offset.