Skip to content

Commit 11a68f5

Browse files
authored
Merge branch 'develop' into 2026-08-29
2 parents bff0e8f + 94c4bc5 commit 11a68f5

142 files changed

Lines changed: 16256 additions & 3638 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

docs/advanced/acceleration/cuda.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ The ABACUS program will automatically determine whether the current ELPA support
4444
## Run with the GPU support by editing the INPUT script:
4545

4646
In `INPUT` file we need to set the input parameter [device](../input_files/input-main.md#device) to `gpu`. If this parameter is not set, ABACUS will try to determine if there are available GPUs.
47-
- Set `ks_solver`: For the PW basis, CG, BPCG and Davidson methods are supported on GPU; set the input parameter [ks_solver](../input_files/input-main.md#ks_solver) to `cg`, `bpcg` or `dav`. For the LCAO basis, `cusolver`, `cusolvermp` and `elpa` is supported on GPU.
47+
- Set `ks_solver`: For the PW basis, CG, BPCG, Davidson, and Davidson subspace methods are supported on GPU; set the input parameter [ks_solver](../input_files/input-main.md#ks_solver) to `cg`, `bpcg`, `dav`, or `dav_subspace`. For the LCAO basis, `cusolver`, `cusolvermp`, and `elpa` are supported on GPU.
4848
- **single-card**: ABACUS allows for single-GPU acceleration. You can run ABACUS without any MPI process by command `abacus`, and `ks_solver cusolver` is recommended for the LCAO basis. *note: avoid using `mpirun -n 1 abacus`*.
4949
- **multi-cards**: ABACUS allows for multi-GPU acceleration. If you have multiple GPU cards, you can run ABACUS with several MPI processes, and each process will utilize one GPU card. For example, the command `mpirun -n 2 abacus` will by default launch two GPUs for computation. If you only have one card, this command will only start one GPU. *note: the number of MPI processes SHOULD be equal to the number of GPU cards, unless you are using MPS in your computer.*
5050

@@ -58,4 +58,4 @@ PW basis:
5858

5959
LCAO basis:
6060
- Unless there is a specific reason, avoid using multiple GPUs, as it can be slower than using a single GPU. This is because the generalized eigenvalue solution of the LCAO basis set will incur additional communication overhead when calculated on multiple cards. When the memory limit of a GPU card makes it insufficient to complete the task, it is recommended to use multiple cards for calculation.
61-
- When using elpa on GPUs, some ELPA internal logs will be output.
61+
- When using elpa on GPUs, some ELPA internal logs will be output.

docs/advanced/input_files/input-main.md

Lines changed: 81 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
- [System variables](#system-variables)
99
- [suffix](#suffix)
1010
- [ntype](#ntype)
11+
- [cell\_replica](#cell_replica)
1112
- [calculation](#calculation)
1213
- [esolver\_type](#esolver_type)
1314
- [symmetry](#symmetry)
@@ -356,6 +357,8 @@
356357
- [md\_restart](#md_restart)
357358
- [md\_restartfreq](#md_restartfreq)
358359
- [md\_dumpfreq](#md_dumpfreq)
360+
- [md\_neighbor\_skin](#md_neighbor_skin)
361+
- [md\_out\_force](#md_out_force)
359362
- [dump\_force](#dump_force)
360363
- [dump\_vel](#dump_vel)
361364
- [dump\_virial](#dump_virial)
@@ -586,6 +589,14 @@
586589
- [Reduced Density Matrix Functional Theory](#reduced-density-matrix-functional-theory)
587590
- [rdmft](#rdmft)
588591
- [rdmft\_power\_alpha](#rdmft_power_alpha)
592+
- [Density functional perturbation theory](#density-functional-perturbation-theory)
593+
- [dfpt\_qmesh](#dfpt_qmesh)
594+
- [dfpt\_qfile](#dfpt_qfile)
595+
- [dfpt\_compute\_q0](#dfpt_compute_q0)
596+
- [dfpt\_loto](#dfpt_loto)
597+
- [dfpt\_conv\_thr](#dfpt_conv_thr)
598+
- [dfpt\_max\_iter](#dfpt_max_iter)
599+
- [dfpt\_mix\_beta](#dfpt_mix_beta)
589600

590601
## System variables
591602

@@ -601,6 +612,12 @@
601612
- **Description**: Number of different atom species in the calculation.
602613
- **Default**: 0
603614

615+
### cell_replica
616+
617+
- **Type**: Three Integers
618+
- **Description**: Replicate the input STRU by Na, Nb, and Nc along its lattice vectors for distributed MDCell workflows. This parameter is only used for classical potentials or machine-learned interatomic potentials. The default is 1 1 1, which preserves the input structure.
619+
- **Default**: 1 1 1
620+
604621
### calculation
605622

606623
- **Type**: String
@@ -634,6 +651,7 @@
634651
- nep: Neuroevolution Potential
635652
- ks-lr: Kohn-Sham density functional theory + LR-TDDFT (Under Development Feature)
636653
- lr: LR-TDDFT with given KS orbitals (Under Development Feature)
654+
- dfpt: density functional perturbation theory (Under Development Feature)
637655
- **Default**: ksdft
638656

639657
### symmetry
@@ -3504,15 +3522,28 @@
35043522
### md_restartfreq
35053523

35063524
- **Type**: Integer
3507-
- **Description**: The output frequency of OUT.{suffix}/STRIU/, which are used to restart molecular dynamics calculations, see md_restart in detail.
3525+
- **Description**: The output frequency of OUT.{suffix}/STRU_MD_*, which are used to restart molecular dynamics calculations, see md_restart in detail. Set to 0 to disable MD restart output.
35083526
- **Default**: 5
35093527

35103528
### md_dumpfreq
35113529

35123530
- **Type**: Integer
3513-
- **Description**: The output frequency of OUT.${suffix}/MD_dump in molecular dynamics calculations, which including the information of lattices and atoms.
3531+
- **Description**: The output frequency of OUT.${suffix}/MD_dump in molecular dynamics calculations, which includes lattice and atomic information. Set to 0 to disable MD_dump output.
35143532
- **Default**: 1
35153533

3534+
### md_neighbor_skin
3535+
3536+
- **Type**: Real
3537+
- **Description**: The extra neighbor-list radius in Angstrom for MDCell molecular dynamics. This parameter is only used for classical potentials or machine-learned interatomic potentials. A positive value reuses the cutoff-plus-skin candidate list until an atom has moved by half this distance; 0 rebuilds the list every force evaluation.
3538+
- **Default**: 0.0
3539+
- **Unit**: Angstrom
3540+
3541+
### md_out_force
3542+
3543+
- **Type**: Boolean
3544+
- **Description**: Whether to output the TOTAL-FORCE table in OUT.${suffix}/running_md.log for MDCell molecular dynamics. This does not affect force calculation or molecular dynamics integration.
3545+
- **Default**: True
3546+
35163547
### dump_force
35173548

35183549
- **Type**: Boolean
@@ -3535,8 +3566,8 @@
35353566

35363567
- **Type**: Integer
35373568
- **Description**: The random seed to initialize random numbers used in molecular dynamics calculations.
3538-
- < 0: No srand() function is called.
3539-
- >= 0: The function srand(md_seed) is called.
3569+
- < 0: Each MPI rank uses the default seed 1 plus its rank.
3570+
- >= 0: Each MPI rank uses md_seed plus its rank.
35403571
- **Default**: -1
35413572

35423573
### md_tfreq
@@ -5170,3 +5201,49 @@
51705201
- **Default**: 0.656
51715202

51725203
[back to top](#full-list-of-input-keywords)
5204+
5205+
## Density functional perturbation theory
5206+
5207+
### dfpt_qmesh
5208+
5209+
- **Type**: Vector of Int (1 or 3 values)
5210+
- **Description**: Set the Monkhorst-Pack q mesh (gamma-centered) for DFPT phonon calculations. The q mesh must be commensurate with the ground-state k mesh: k + q must be a point of the k list (modulo a reciprocal lattice vector). For example, a 4x4x4 KPT mesh is commensurate with dfpt_qmesh values of 1, 2, or 4 along each direction. This parameter is ignored when dfpt_qfile is set.
5211+
- **Default**: 1 1 1
5212+
5213+
### dfpt_qfile
5214+
5215+
- **Type**: String
5216+
- **Description**: Set the file containing the q points for DFPT, in the same format as the KPT file (Q_POINTS card: Gamma/Monkhorst-Pack mesh, or an explicit Direct/Cartesian list; symmetry reduction is not applied to file q lists). When set, it overrides dfpt_qmesh. Each q point must still be commensurate with the ground-state k mesh.
5217+
- **Default**: ""
5218+
5219+
### dfpt_compute_q0
5220+
5221+
- **Type**: Boolean
5222+
- **Description**: Whether to compute the macroscopic dielectric tensor (epsilon_inf) and the Born effective charges at q = 0 within the same DFPT run. Requires a q point at Gamma (the default dfpt_qmesh 1 1 1).
5223+
- **Default**: false
5224+
5225+
### dfpt_loto
5226+
5227+
- **Type**: Boolean
5228+
- **Description**: Whether to apply the Lyddane-Sachs-Teller non-analytic correction to the Gamma-point dynamical matrix, which splits the longitudinal and transverse optical modes. Requires dfpt_compute_q0 to be true, since the correction is built from epsilon_inf and the Born effective charges.
5229+
- **Default**: false
5230+
5231+
### dfpt_conv_thr
5232+
5233+
- **Type**: Real
5234+
- **Description**: Set the convergence threshold of the self-consistent DFPT cycle: the iteration stops when the relative residual of the first-order density ||drho_out - drho_in|| / ||drho_out|| drops below this value for every displacement.
5235+
- **Default**: 1.0e-8
5236+
5237+
### dfpt_max_iter
5238+
5239+
- **Type**: Integer
5240+
- **Description**: Set the maximum number of self-consistent DFPT iterations for each atomic displacement.
5241+
- **Default**: 100
5242+
5243+
### dfpt_mix_beta
5244+
5245+
- **Type**: Real
5246+
- **Description**: Set the plain-mixing coefficient of the first-order density in the self-consistent DFPT cycle. The response Jacobian has strongly negative eigenvalues on the smallest-G shells (Coulomb stiffness), so beta must stay below 2 / (1 + |lambda_min|); the default 0.4 keeps margin up to |lambda_min| ~ 3. A larger value accelerates convergence for weakly screened systems but may diverge.
5247+
- **Default**: 0.4
5248+
5249+
[back to top](#full-list-of-input-keywords)

docs/parameters.yaml

Lines changed: 85 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,14 @@ parameters:
1717
default_value: "0"
1818
unit: ""
1919
availability: ""
20+
- name: cell_replica
21+
category: System variables
22+
type: Three Integers
23+
description: |
24+
Replicate the input STRU by Na, Nb, and Nc along its lattice vectors for distributed MDCell workflows. This parameter is only used for classical potentials or machine-learned interatomic potentials. The default is 1 1 1, which preserves the input structure.
25+
default_value: 1 1 1
26+
unit: ""
27+
availability: ""
2028
- name: calculation
2129
category: System variables
2230
type: String
@@ -53,6 +61,7 @@ parameters:
5361
* nep: Neuroevolution Potential
5462
* ks-lr: Kohn-Sham density functional theory + LR-TDDFT (Under Development Feature)
5563
* lr: LR-TDDFT with given KS orbitals (Under Development Feature)
64+
* dfpt: density functional perturbation theory (Under Development Feature)
5665
default_value: ksdft
5766
unit: ""
5867
availability: ""
@@ -1449,18 +1458,34 @@ parameters:
14491458
category: Molecular dynamics
14501459
type: Integer
14511460
description: |
1452-
The output frequency of OUT.{suffix}/STRIU/, which are used to restart molecular dynamics calculations, see md_restart in detail.
1461+
The output frequency of OUT.{suffix}/STRU_MD_*, which are used to restart molecular dynamics calculations, see md_restart in detail. Set to 0 to disable MD restart output.
14531462
default_value: "5"
14541463
unit: ""
14551464
availability: ""
14561465
- name: md_dumpfreq
14571466
category: Molecular dynamics
14581467
type: Integer
14591468
description: |
1460-
The output frequency of OUT.${suffix}/MD_dump in molecular dynamics calculations, which including the information of lattices and atoms.
1469+
The output frequency of OUT.${suffix}/MD_dump in molecular dynamics calculations, which includes lattice and atomic information. Set to 0 to disable MD_dump output.
14611470
default_value: "1"
14621471
unit: ""
14631472
availability: ""
1473+
- name: md_neighbor_skin
1474+
category: Molecular dynamics
1475+
type: Real
1476+
description: |
1477+
The extra neighbor-list radius in Angstrom for MDCell molecular dynamics. This parameter is only used for classical potentials or machine-learned interatomic potentials. A positive value reuses the cutoff-plus-skin candidate list until an atom has moved by half this distance; 0 rebuilds the list every force evaluation.
1478+
default_value: "0.0"
1479+
unit: Angstrom
1480+
availability: ""
1481+
- name: md_out_force
1482+
category: Molecular dynamics
1483+
type: Boolean
1484+
description: |
1485+
Whether to output the TOTAL-FORCE table in OUT.${suffix}/running_md.log for MDCell molecular dynamics. This does not affect force calculation or molecular dynamics integration.
1486+
default_value: "True"
1487+
unit: ""
1488+
availability: ""
14641489
- name: dump_force
14651490
category: Molecular dynamics
14661491
type: Boolean
@@ -1490,8 +1515,8 @@ parameters:
14901515
type: Integer
14911516
description: |
14921517
The random seed to initialize random numbers used in molecular dynamics calculations.
1493-
* < 0: No srand() function is called.
1494-
* >= 0: The function srand(md_seed) is called.
1518+
* < 0: Each MPI rank uses the default seed 1 plus its rank.
1519+
* >= 0: Each MPI rank uses md_seed plus its rank.
14951520
default_value: "-1"
14961521
unit: ""
14971522
availability: ""
@@ -3022,6 +3047,62 @@ parameters:
30223047
default_value: "-1 2 -1 2"
30233048
unit: primitive cells
30243049
availability: "lr_solver==plot and exciton_plot_format in [slice, both]"
3050+
- name: dfpt_qmesh
3051+
category: Density functional perturbation theory
3052+
type: Vector of Int (1 or 3 values)
3053+
description: |
3054+
Set the Monkhorst-Pack q mesh (gamma-centered) for DFPT phonon calculations. The q mesh must be commensurate with the ground-state k mesh: k + q must be a point of the k list (modulo a reciprocal lattice vector). For example, a 4x4x4 KPT mesh is commensurate with dfpt_qmesh values of 1, 2, or 4 along each direction. This parameter is ignored when dfpt_qfile is set.
3055+
default_value: 1 1 1
3056+
unit: ""
3057+
availability: ""
3058+
- name: dfpt_qfile
3059+
category: Density functional perturbation theory
3060+
type: String
3061+
description: |
3062+
Set the file containing the q points for DFPT, in the same format as the KPT file (Q_POINTS card: Gamma/Monkhorst-Pack mesh, or an explicit Direct/Cartesian list; symmetry reduction is not applied to file q lists). When set, it overrides dfpt_qmesh. Each q point must still be commensurate with the ground-state k mesh.
3063+
default_value: "\"\""
3064+
unit: ""
3065+
availability: ""
3066+
- name: dfpt_compute_q0
3067+
category: Density functional perturbation theory
3068+
type: Boolean
3069+
description: |
3070+
Whether to compute the macroscopic dielectric tensor (epsilon_inf) and the Born effective charges at q = 0 within the same DFPT run. Requires a q point at Gamma (the default dfpt_qmesh 1 1 1).
3071+
default_value: "false"
3072+
unit: ""
3073+
availability: ""
3074+
- name: dfpt_loto
3075+
category: Density functional perturbation theory
3076+
type: Boolean
3077+
description: |
3078+
Whether to apply the Lyddane-Sachs-Teller non-analytic correction to the Gamma-point dynamical matrix, which splits the longitudinal and transverse optical modes. Requires dfpt_compute_q0 to be true, since the correction is built from epsilon_inf and the Born effective charges.
3079+
default_value: "false"
3080+
unit: ""
3081+
availability: ""
3082+
- name: dfpt_conv_thr
3083+
category: Density functional perturbation theory
3084+
type: Real
3085+
description: |
3086+
Set the convergence threshold of the self-consistent DFPT cycle: the iteration stops when the relative residual of the first-order density ||drho_out - drho_in|| / ||drho_out|| drops below this value for every displacement.
3087+
default_value: "1.0e-8"
3088+
unit: ""
3089+
availability: ""
3090+
- name: dfpt_max_iter
3091+
category: Density functional perturbation theory
3092+
type: Integer
3093+
description: |
3094+
Set the maximum number of self-consistent DFPT iterations for each atomic displacement.
3095+
default_value: "100"
3096+
unit: ""
3097+
availability: ""
3098+
- name: dfpt_mix_beta
3099+
category: Density functional perturbation theory
3100+
type: Real
3101+
description: |
3102+
Set the plain-mixing coefficient of the first-order density in the self-consistent DFPT cycle. The response Jacobian has strongly negative eigenvalues on the smallest-G shells (Coulomb stiffness), so beta must stay below 2 / (1 + |lambda_min|); the default 0.4 keeps margin up to |lambda_min| ~ 3. A larger value accelerates convergence for weakly screened systems but may diverge.
3103+
default_value: "0.4"
3104+
unit: ""
3105+
availability: ""
30253106
- name: out_freq_ion
30263107
category: Output information
30273108
type: Integer

python/pyabacus/CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ To contribute to the `pyabacus` project, follow these steps:
375375

376376
@staticmethod
377377
def sphbes_zeros(l: int, n: int, zeros: NDArray[np.float64]) -> None:
378-
super().sphbes_zeros(l, n, zeros)
378+
_Sphbes.sphbes_zeros(l, n, zeros)
379379
```
380380

381381
## Conclusion

python/pyabacus/src/pyabacus/ModuleBase/_module_base.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def dsphbesj(self, *args, **kwargs):
4848

4949
@staticmethod
5050
def sphbes_zeros(l: int, n: int, zeros: NDArray[np.float64]) -> None:
51-
super().sphbes_zeros(l, n, zeros)
51+
_Sphbes.sphbes_zeros(l, n, zeros)
5252

5353
class Integral(_Integral):
5454
def __init__(self) -> None:
@@ -81,7 +81,7 @@ def Simpson_Integral_0toall(
8181
rab: NDArray[np.float64],
8282
asum: NDArray[np.float64]
8383
) -> None:
84-
super().Simpson_Integral_0toall(mesh, func, rab, asum)
84+
_Integral.Simpson_Integral_0toall(mesh, func, rab, asum)
8585

8686
@staticmethod
8787
def Simpson_Integral_alltoinf(
@@ -90,7 +90,7 @@ def Simpson_Integral_alltoinf(
9090
rab: NDArray[np.float64],
9191
asum: NDArray[np.float64]
9292
) -> None:
93-
super().Simpson_Integral_alltoinf(mesh, func, rab, asum)
93+
_Integral.Simpson_Integral_alltoinf(mesh, func, rab, asum)
9494

9595
@overload
9696
@staticmethod

python/pyabacus/tests/test_base_math.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,23 @@ def test_sphbes():
1313
assert s.sphbesj(0, 0.0) == 1.0
1414
assert s.sphbesj(1, np.array([0.0]), 1, 1, np.zeros(1)) == None
1515

16+
def test_static_array_wrappers():
17+
zeros = np.zeros(2)
18+
base.Sphbes.sphbes_zeros(0, 2, zeros)
19+
np.testing.assert_allclose(zeros, [np.pi, 2 * np.pi])
20+
21+
mesh = 3
22+
func = np.ones(mesh)
23+
rab = np.ones(mesh)
24+
integral_from_zero = np.zeros(mesh)
25+
integral_to_infinity = np.zeros(mesh)
26+
27+
base.Integral.Simpson_Integral_0toall(mesh, func, rab, integral_from_zero)
28+
base.Integral.Simpson_Integral_alltoinf(mesh, func, rab, integral_to_infinity)
29+
30+
np.testing.assert_allclose(integral_from_zero, [0.0, 1.0, 2.0])
31+
np.testing.assert_allclose(integral_to_infinity, [2.0, 1.0, 0.0])
32+
1633
def test_sbt():
1734
sbt = base.SphericalBesselTransformer()
1835

source/Makefile.Objects

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,7 @@ OBJS_CELL=atom_pseudo.o\
212212
setup_nonlocal.o\
213213
klist.o\
214214
k_vector_utils.o\
215+
reciprocal_grid.o\
215216
cell_index.o\
216217
cell_tools.o\
217218
check_atomic_stru.o\
@@ -375,6 +376,8 @@ OBJS_HAMILT_OF=kedf_tf.o\
375376
evolve_ofdft.o\
376377

377378
OBJS_DFPT=dfpt_metal.o\
379+
dfpt_hamilt_shift.o\
380+
dfpt_kq_basis.o\
378381
dfpt_pert.o\
379382
dfpt_phon.o\
380383
dfpt_pw.o\
@@ -564,6 +567,7 @@ OBJS_SYMMETRY=symm_other.o\
564567
symm_magnetic.o\
565568
symm_pricell.o\
566569
symm_rho.o\
570+
little_group.o\
567571
symmetry.o\
568572

569573
OBJS_XC=xc_functional.o\
@@ -674,6 +678,7 @@ OBJS_IO=module_parameter/input_conv.o\
674678
module_parameter/read_inp_model.o\
675679
module_parameter/read_inp_postproc.o\
676680
module_parameter/read_inp_exx_dftu.o\
681+
module_parameter/read_inp_dfpt.o\
677682
module_parameter/read_inp_other.o\
678683
module_parameter/read_inp_out.o\
679684
module_parameter/read_set_globalv.o\
@@ -772,7 +777,7 @@ OBJS_MODULE_RI=conv_coulomb_pot_k.o\
772777
singular_value.o\
773778

774779
OBJS_PARALLEL=parallel_common.o\
775-
communication_domain.o\
780+
parallel_cell.o\
776781
parallel_global.o\
777782
parallel_comm.o\
778783
parallel_grid.o\

0 commit comments

Comments
 (0)