Fix Bloch phases for fully symmetry-reduced k-point grids (#5581)

Co-authored-by: Thomas D. Kuehne <tkuehne@cp2k.org>
This commit is contained in:
Dynamics of Condensed Matter 2026-07-13 19:41:54 +02:00 committed by GitHub
parent 668b9a7f8c
commit 97cfbf5b46
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
26 changed files with 887 additions and 67 deletions

View file

@ -898,9 +898,7 @@ CONTAINS
duplicate = .FALSE.
DO jop = 1, nrot
IF (ALL(frot == srot(:, :, jop)) .AND. &
ALL(ABS(csym%translations(1:3, iop) - csym%vt(1:3, jop) - &
ANINT(csym%translations(1:3, iop) - csym%vt(1:3, jop))) <= eps)) THEN
IF (ALL(frot == srot(:, :, jop))) THEN
duplicate = .TRUE.
EXIT
END IF
@ -1716,12 +1714,14 @@ CONTAINS
REAL(KIND=dp), DIMENSION(3), INTENT(IN) :: a1, a2, a3, b1, b2, b3
REAL(KIND=dp), INTENT(IN) :: alat
INTEGER :: i, ibsign, iop, j, kr, nkpts
INTEGER :: i, ibsign, iop, j, kr, nkpts, &
nskipped_overlaps
REAL(KIND=dp) :: eps
REAL(KIND=dp), DIMENSION(3) :: diff, rr, wcart
nkpts = SIZE(wkp)
eps = MAX(1.e-12_dp, 10.0_dp*csym%delta)
nskipped_overlaps = 0
wkp = 0.0_dp
kpop = 0
@ -1755,8 +1755,11 @@ CONTAINS
csym%kplink(1, j) = i
wkp(i) = wkp(i) + 1.0_dp
kpop(j) = kr
ELSE
CPASSERT(csym%kplink(1, j) == i)
ELSEIF (csym%kplink(1, j) /= i) THEN
! Approximate K290 operation sets need not be closed for structures whose
! coordinates lie close to several symmetry tolerances. Keep the existing
! disjoint orbit instead of aborting or double-counting this mesh point.
nskipped_overlaps = nskipped_overlaps + 1
END IF
EXIT
END IF
@ -1767,10 +1770,28 @@ CONTAINS
END DO
END DO
DO i = 1, nkpts
CPASSERT(csym%kplink(1, i) /= 0)
CPASSERT(kpop(i) /= 0)
END DO
IF (nskipped_overlaps > 0) THEN
wkp = 1.0_dp
CALL inversion_symm(xkp, wkp, csym%kplink(1, :))
DO i = 1, nkpts
IF (wkp(i) > 0.0_dp) THEN
kpop(i) = 1
ELSE
kpop(i) = 2
END IF
END DO
csym%nrtot = 0
csym%inversion_only = .TRUE.
CALL cp_warn(__LOCATION__, &
"The K290 k-point operations produced overlapping, non-closed mesh orbits; "// &
"falling back to inversion/time-reversal symmetry. Use SYMMETRY_BACKEND SPGLIB "// &
"for full reduction by a closed crystallographic symmetry group.")
ELSE
DO i = 1, nkpts
CPASSERT(csym%kplink(1, i) /= 0)
CPASSERT(kpop(i) /= 0)
END DO
END IF
END SUBROUTINE reduce_kpoint_mesh

View file

@ -248,9 +248,9 @@ CONTAINS
! density matrices in real space
tempmat => matrix_s(1, 1)%matrix
CALL kpoint_density_transform(ec_env%kpoints, matrix_p, .FALSE., tempmat, &
ec_env%sab_orb, fmwork)
ec_env%sab_orb, fmwork, overlap_rs=matrix_s)
CALL kpoint_density_transform(ec_env%kpoints, matrix_w, .TRUE., tempmat, &
ec_env%sab_orb, fmwork)
ec_env%sab_orb, fmwork, overlap_rs=matrix_s)
ec_env%ekTS = 0.0_dp
mos => ec_env%kpoints%kp_env(1)%kpoint_env%mos
@ -711,4 +711,3 @@ CONTAINS
END SUBROUTINE ec_ls_solver
END MODULE ec_diag_solver

View file

@ -543,11 +543,14 @@ CONTAINS
TYPE(force_env_type), POINTER :: force_env
LOGICAL, INTENT(IN) :: fd_energy
REAL(KIND=dp), PARAMETER :: eps_cell = 1.0E-14_dp
CHARACTER(LEN=default_string_length) :: kp_scheme
INTEGER :: run_type_id
LOGICAL :: debug_full_kpoint_symmetry, debug_inversion_only, do_kpoints, dynamic_symmetry, &
full_grid, input_full_grid, input_inversion_symmetry_only, inversion_symmetry_only, &
kpoint_symmetry, moving_geometry, use_full_grid, use_inversion_symmetry_only
LOGICAL :: debug_full_kpoint_symmetry, debug_full_kpoint_symmetry_explicit, &
debug_inversion_only, do_kpoints, dynamic_symmetry, force_full_debug_symmetry, full_grid, &
input_full_grid, input_inversion_symmetry_only, inversion_symmetry_only, kpoint_symmetry, &
moving_geometry, non_lower_triangular_cell, use_full_grid, use_inversion_symmetry_only
TYPE(cell_type), POINTER :: cell
TYPE(cp_blacs_env_type), POINTER :: blacs_env
TYPE(dft_control_type), POINTER :: dft_control
@ -599,23 +602,36 @@ CONTAINS
input_full_grid = full_grid
input_inversion_symmetry_only = inversion_symmetry_only
debug_full_kpoint_symmetry = .FALSE.
debug_full_kpoint_symmetry_explicit = .FALSE.
IF (ASSOCIATED(input)) THEN
kpoint_section => section_vals_get_subs_vals(input, "DFT%KPOINTS")
CALL section_vals_val_get(kpoint_section, "FULL_GRID", l_val=input_full_grid)
CALL section_vals_val_get(kpoint_section, "INVERSION_SYMMETRY_ONLY", &
l_val=input_inversion_symmetry_only)
CALL section_vals_val_get(kpoint_section, "DEBUG_FULL_KPOINT_SYMMETRY", &
l_val=debug_full_kpoint_symmetry)
l_val=debug_full_kpoint_symmetry, &
explicit=debug_full_kpoint_symmetry_explicit)
END IF
! Moving geometries and DEBUG finite differences must not reuse atomic symmetry from
! another geometry. Rebuild the k-point symmetry from the current cell and positions.
! Keep numerical finite-difference energies and DFTB DEBUG checks on the established
! inversion/time-reversal reduction.
! An explicit DEBUG_FULL_KPOINT_SYMMETRY OFF keeps numerical finite-difference
! energies and DFTB DEBUG checks on inversion/time-reversal reduction.
debug_inversion_only = run_type_id == debug_run .AND. .NOT. debug_full_kpoint_symmetry .AND. &
(fd_energy .OR. dft_control%qs_control%dftb)
force_full_debug_symmetry = run_type_id == debug_run .AND. debug_full_kpoint_symmetry_explicit .AND. &
debug_full_kpoint_symmetry
use_full_grid = input_full_grid
use_inversion_symmetry_only = (input_inversion_symmetry_only .OR. debug_inversion_only) .AND. &
(.NOT. use_full_grid)
! Preserve restrictions selected during initial setup. The explicit DEBUG expert option
! remains available for symmetry diagnostics on otherwise unsupported cell matrices.
IF (inversion_symmetry_only .AND. .NOT. force_full_debug_symmetry .AND. .NOT. use_full_grid) &
use_inversion_symmetry_only = .TRUE.
non_lower_triangular_cell = (ABS(cell%hmat(2, 1)) > eps_cell) .OR. &
(ABS(cell%hmat(3, 1)) > eps_cell) .OR. &
(ABS(cell%hmat(3, 2)) > eps_cell)
IF (non_lower_triangular_cell .AND. .NOT. force_full_debug_symmetry .AND. .NOT. use_full_grid) &
use_inversion_symmetry_only = .TRUE.
dynamic_symmetry = kpoint_symmetry .AND. .NOT. use_full_grid .AND. &
.NOT. use_inversion_symmetry_only
IF (run_type_id == debug_run .AND. .NOT. fd_energy .AND. .NOT. dynamic_symmetry .AND. &

View file

@ -152,11 +152,11 @@ CONTAINS
CALL keyword_create(keyword, __LOCATION__, name="DEBUG_FULL_KPOINT_SYMMETRY", &
description="Use full atomic k-point symmetry also for DEBUG finite-difference "// &
"points. This is an expert option: the default keeps finite-difference energies "// &
"on inversion/time-reversal symmetry to avoid comparing slightly different "// &
"irreducible k-point sets.", &
"points. This is enabled by default so analytical and finite-difference "// &
"evaluations use the symmetry of their current geometry. Disable it to restrict "// &
"DEBUG finite-difference energies to inversion/time-reversal symmetry.", &
usage="DEBUG_FULL_KPOINT_SYMMETRY <LOGICAL>", &
default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
default_l_val=.TRUE., lone_keyword_l_val=.TRUE.)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)

View file

@ -15,6 +15,7 @@
MODULE kpoint_methods
USE atomic_kind_types, ONLY: get_atomic_kind
USE cell_types, ONLY: cell_type,&
pbc,&
real_to_scaled
USE cp_blacs_env, ONLY: cp_blacs_env_create,&
cp_blacs_env_type
@ -32,6 +33,7 @@ MODULE kpoint_methods
dbcsr_iterator_start, dbcsr_iterator_stop, dbcsr_iterator_type, dbcsr_p_type, &
dbcsr_replicate_all, dbcsr_set, dbcsr_type, dbcsr_type_antisymmetric, &
dbcsr_type_no_symmetry, dbcsr_type_symmetric
USE cp_dbcsr_contrib, ONLY: dbcsr_dot
USE cp_dbcsr_cp2k_link, ONLY: cp_dbcsr_alloc_block_from_nbl
USE cp_dbcsr_operations, ONLY: copy_fm_to_dbcsr
USE cp_fm_basic_linalg, ONLY: cp_fm_column_scale
@ -133,7 +135,7 @@ CONTAINS
LOGICAL :: spez
REAL(KIND=dp) :: eps_kpoint, wsum
REAL(KIND=dp), ALLOCATABLE, DIMENSION(:, :) :: coord, scoord
REAL(KIND=dp), DIMENSION(3) :: diff, kgvec, srot
REAL(KIND=dp), DIMENSION(3) :: diff, kgvec, r_pbc, scoord_pbc, srot
REAL(KIND=dp), DIMENSION(3, 3) :: srotmat
REAL(KIND=dp), DIMENSION(:), POINTER :: wkp_full
REAL(KIND=dp), DIMENSION(:, :), POINTER :: xkp_full
@ -184,11 +186,16 @@ CONTAINS
! kind type list
ALLOCATE (kpoint%atype(natom))
kpoint%atype = atype
! Match the periodic gauge used by the k-space matrices.
! Match the atom images used by CP2K's periodic neighbor lists.
ALLOCATE (agauge(3, natom))
DO i = 1, natom
agauge(1:3, i) = -FLOOR(scoord(1:3, i) + 0.5_dp - kpoint%eps_geo)
END DO
agauge = 0
IF (kpoint%symmetry) THEN
DO i = 1, natom
r_pbc(1:3) = pbc(particle_set(i)%r(1:3), cell)
CALL real_to_scaled(scoord_pbc, r_pbc, cell)
agauge(1:3, i) = NINT(scoord_pbc(1:3) - scoord(1:3, i))
END DO
END IF
CALL crys_sym_gen(crys_sym, scoord, atype, cell%hmat, delta=kpoint%eps_geo, iounit=iounit, &
use_spglib=kpoint%symmetry)
@ -198,6 +205,7 @@ CONTAINS
use_spglib_reduction= &
kpoint%symmetry_reduction_method == use_spglib_kpoint_symmetry, &
use_spglib_backend=kpoint%symmetry_backend == use_spglib_kpoint_backend)
IF (crys_sym%inversion_only) kpoint%inversion_symmetry_only = .TRUE.
kpoint%nkp = crys_sym%nkpoint
ALLOCATE (kpoint%xkp(3, kpoint%nkp), kpoint%wkp(kpoint%nkp))
wsum = SUM(crys_sym%wkpoint)
@ -250,6 +258,9 @@ CONTAINS
ALLOCATE (kpsym%rotp(ns))
ALLOCATE (kpsym%f0(natom, ns))
ALLOCATE (kpsym%fcell(3, natom, ns))
ALLOCATE (kpsym%fcell_gauge(3, natom, ns))
ALLOCATE (kpsym%phase_mode(ns))
kpsym%phase_mode = 0
ALLOCATE (kpsym%kgphase(natom, ns))
nr = 0
DO is = 1, SIZE(crys_sym%kplink, 2)
@ -274,6 +285,8 @@ CONTAINS
DO j = 1, natom
srot(1:3) = MATMUL(srotmat, scoord(1:3, j)) + crys_sym%vt(1:3, ic)
kpsym%fcell(1:3, j, nr) = &
NINT(srot(1:3) - scoord(1:3, kpsym%f0(j, nr)))
kpsym%fcell_gauge(1:3, j, nr) = &
NINT(srot(1:3) - scoord(1:3, kpsym%f0(j, nr))) + &
MATMUL(frot(1:3, 1:3), agauge(1:3, j)) - &
agauge(1:3, kpsym%f0(j, nr))
@ -311,6 +324,8 @@ CONTAINS
DO j = 1, natom
srot(1:3) = MATMUL(srotmat, scoord(1:3, j)) + crys_sym%vt(1:3, ic)
kpsym%fcell(1:3, j, nr) = &
NINT(srot(1:3) - scoord(1:3, kpsym%f0(j, nr)))
kpsym%fcell_gauge(1:3, j, nr) = &
NINT(srot(1:3) - scoord(1:3, kpsym%f0(j, nr))) + &
MATMUL(frot(1:3, 1:3), agauge(1:3, j)) - &
agauge(1:3, kpsym%f0(j, nr))
@ -391,7 +406,9 @@ CONTAINS
kpoint%atype = atype
ALLOCATE (agauge(3, natom))
DO i = 1, natom
agauge(1:3, i) = -FLOOR(scoord(1:3, i) + 0.5_dp - kpoint%eps_geo)
r_pbc(1:3) = pbc(particle_set(i)%r(1:3), cell)
CALL real_to_scaled(scoord_pbc, r_pbc, cell)
agauge(1:3, i) = NINT(scoord_pbc(1:3) - scoord(1:3, i))
END DO
CALL crys_sym_gen(crys_sym, scoord, atype, cell%hmat, delta=kpoint%eps_geo, iounit=iounit, &
@ -403,6 +420,7 @@ CONTAINS
use_spglib_reduction= &
kpoint%symmetry_reduction_method == use_spglib_kpoint_symmetry, &
use_spglib_backend=kpoint%symmetry_backend == use_spglib_kpoint_backend)
IF (crys_sym%inversion_only) kpoint%inversion_symmetry_only = .TRUE.
IF (ASSOCIATED(kpoint%xkp)) THEN
DEALLOCATE (kpoint%xkp)
NULLIFY (kpoint%xkp)
@ -458,6 +476,9 @@ CONTAINS
ALLOCATE (kpsym%rotp(ns))
ALLOCATE (kpsym%f0(natom, ns))
ALLOCATE (kpsym%fcell(3, natom, ns))
ALLOCATE (kpsym%fcell_gauge(3, natom, ns))
ALLOCATE (kpsym%phase_mode(ns))
kpsym%phase_mode = 0
ALLOCATE (kpsym%kgphase(natom, ns))
nr = 0
DO is = 1, SIZE(crys_sym%kplink, 2)
@ -482,6 +503,8 @@ CONTAINS
DO j = 1, natom
srot(1:3) = MATMUL(srotmat, scoord(1:3, j)) + crys_sym%vt(1:3, ic)
kpsym%fcell(1:3, j, nr) = &
NINT(srot(1:3) - scoord(1:3, kpsym%f0(j, nr)))
kpsym%fcell_gauge(1:3, j, nr) = &
NINT(srot(1:3) - scoord(1:3, kpsym%f0(j, nr))) + &
MATMUL(frot(1:3, 1:3), agauge(1:3, j)) - &
agauge(1:3, kpsym%f0(j, nr))
@ -519,6 +542,8 @@ CONTAINS
DO j = 1, natom
srot(1:3) = MATMUL(srotmat, scoord(1:3, j)) + crys_sym%vt(1:3, ic)
kpsym%fcell(1:3, j, nr) = &
NINT(srot(1:3) - scoord(1:3, kpsym%f0(j, nr)))
kpsym%fcell_gauge(1:3, j, nr) = &
NINT(srot(1:3) - scoord(1:3, kpsym%f0(j, nr))) + &
MATMUL(frot(1:3, 1:3), agauge(1:3, j)) - &
agauge(1:3, kpsym%f0(j, nr))
@ -1736,8 +1761,10 @@ CONTAINS
!> \param fmwork FM work matrices (kpoint group)
!> \param for_aux_fit ...
!> \param pmat_ext ...
!> \param overlap_rs ...
! **************************************************************************************************
SUBROUTINE kpoint_density_transform(kpoint, denmat, wtype, tempmat, sab_nl, fmwork, for_aux_fit, pmat_ext)
SUBROUTINE kpoint_density_transform(kpoint, denmat, wtype, tempmat, sab_nl, fmwork, for_aux_fit, &
pmat_ext, overlap_rs)
TYPE(kpoint_type), POINTER :: kpoint
TYPE(dbcsr_p_type), DIMENSION(:, :) :: denmat
@ -1749,6 +1776,8 @@ CONTAINS
LOGICAL, OPTIONAL :: for_aux_fit
TYPE(cp_fm_type), DIMENSION(:, :, :), INTENT(IN), &
OPTIONAL :: pmat_ext
TYPE(dbcsr_p_type), DIMENSION(:, :), OPTIONAL, &
POINTER :: overlap_rs
CHARACTER(LEN=*), PARAMETER :: routineN = 'kpoint_density_transform'
@ -1809,6 +1838,9 @@ CONTAINS
CALL get_kpoint_info(kpoint, nkp=nkp, xkp=xkp, wkp=wkp, &
cell_to_index=cell_to_index)
IF (PRESENT(overlap_rs)) THEN
CALL calibrate_symmetry_phases(kpoint, overlap_rs, tempmat, sab_nl, cell_to_index)
END IF
! initialize real space density matrices
IF (aux_fit) THEN
kp => kpoint%kp_aux_env(1)%kpoint_env
@ -1819,8 +1851,6 @@ CONTAINS
nc = SIZE(kp%mos, 1)
nimg = SIZE(denmat, 2)
real_only = (nc == 1)
! Gamma-centered even grids store atom-cell shifts in the opposite Bloch-phase convention.
reverse_phase = kpoint%gamma_centered .AND. ANY(MOD(kpoint%nkp_grid(1:3), 2) == 0)
para_env => kpoint%blacs_env_all%para_env
ALLOCATE (info(nspin*nkp*nc))
@ -1900,10 +1930,12 @@ CONTAINS
END DO
CPASSERT(ira > 0)
kind_rot => kpoint%kind_rotmat(ira, :)
CPASSERT(kpsym%phase_mode(is) > 0)
reverse_phase = kpsym%phase_mode(is) == 2
CALL symtrans_phase(srpmat, scpmat, rpmat, cpmat, real_only, kind_rot, &
kpsym%rot(1:3, 1:3, is), kpsym%f0(:, is), &
kpsym%fcell(:, :, is), kpoint%atype, kpsym%xkp(1:3, is), &
kpsym%rotp(is) < 0, reverse_phase)
kpsym%fcell_gauge(:, :, is), kpoint%atype, &
kpsym%xkp(1:3, is), kpsym%rotp(is) < 0, reverse_phase)
CALL transform_dmat(denmat, srpmat, scpmat, ispin, real_only, sab_nl, &
cell_to_index, kpsym%xkp(1:3, is), wkpx)
END DO
@ -2063,6 +2095,129 @@ CONTAINS
END SUBROUTINE ensure_work_matrix
! **************************************************************************************************
!> \brief Select the Bloch-phase convention that preserves overlap covariance.
!> \param kpoint ...
!> \param overlap_rs ...
!> \param tempmat ...
!> \param sab_nl ...
!> \param cell_to_index ...
! **************************************************************************************************
SUBROUTINE calibrate_symmetry_phases(kpoint, overlap_rs, tempmat, sab_nl, cell_to_index)
TYPE(kpoint_type), POINTER :: kpoint
TYPE(dbcsr_p_type), DIMENSION(:, :), POINTER :: overlap_rs
TYPE(dbcsr_type), POINTER :: tempmat
TYPE(neighbor_list_set_p_type), DIMENSION(:), &
POINTER :: sab_nl
INTEGER, DIMENSION(:, :, :), POINTER :: cell_to_index
CHARACTER(LEN=256) :: phase_error
INTEGER :: best_mode, ik, ir, ira, is, jr, mode
LOGICAL :: needs_calibration, reverse
REAL(KIND=dp) :: best_residual, candidate_norm, &
direct_norm, overlap_dot, &
phase_tolerance, relative_residual
TYPE(dbcsr_type), POINTER :: direct_c, direct_r, source_c, source_r, &
sym_c, sym_r
TYPE(kind_rotmat_type), DIMENSION(:), POINTER :: kind_rot
TYPE(kpoint_sym_type), POINTER :: kpsym
needs_calibration = .FALSE.
DO ik = 1, kpoint%nkp
kpsym => kpoint%kp_sym(ik)%kpoint_sym
IF (kpsym%apply_symmetry) THEN
IF (ANY(kpsym%phase_mode == 0)) THEN
needs_calibration = .TRUE.
EXIT
END IF
END IF
END DO
IF (.NOT. needs_calibration) RETURN
ALLOCATE (source_r, source_c, direct_r, direct_c, sym_r, sym_c)
CALL dbcsr_create(source_r, template=tempmat, matrix_type=dbcsr_type_symmetric)
CALL dbcsr_create(source_c, template=tempmat, matrix_type=dbcsr_type_antisymmetric)
CALL dbcsr_create(direct_r, template=tempmat, matrix_type=dbcsr_type_symmetric)
CALL dbcsr_create(direct_c, template=tempmat, matrix_type=dbcsr_type_antisymmetric)
CALL dbcsr_create(sym_r, template=tempmat, matrix_type=dbcsr_type_symmetric)
CALL dbcsr_create(sym_c, template=tempmat, matrix_type=dbcsr_type_antisymmetric)
CALL cp_dbcsr_alloc_block_from_nbl(source_r, sab_nl)
CALL cp_dbcsr_alloc_block_from_nbl(source_c, sab_nl)
CALL cp_dbcsr_alloc_block_from_nbl(direct_r, sab_nl)
CALL cp_dbcsr_alloc_block_from_nbl(direct_c, sab_nl)
CALL cp_dbcsr_alloc_block_from_nbl(sym_r, sab_nl)
CALL cp_dbcsr_alloc_block_from_nbl(sym_c, sab_nl)
phase_tolerance = MAX(1.0e-6_dp, 100.0_dp*kpoint%eps_geo)
DO ik = 1, kpoint%nkp
kpsym => kpoint%kp_sym(ik)%kpoint_sym
IF (.NOT. kpsym%apply_symmetry) CYCLE
IF (ALL(kpsym%phase_mode > 0)) CYCLE
CALL dbcsr_set(source_r, 0.0_dp)
CALL dbcsr_set(source_c, 0.0_dp)
CALL rskp_transform(source_r, source_c, overlap_rs, 1, kpoint%xkp(1:3, ik), &
cell_to_index, sab_nl)
DO is = 1, kpsym%nwght
IF (kpsym%phase_mode(is) > 0) CYCLE
CALL dbcsr_set(direct_r, 0.0_dp)
CALL dbcsr_set(direct_c, 0.0_dp)
CALL rskp_transform(direct_r, direct_c, overlap_rs, 1, kpsym%xkp(1:3, is), &
cell_to_index, sab_nl)
CALL dbcsr_dot(direct_r, direct_r, direct_norm)
CALL dbcsr_dot(direct_c, direct_c, candidate_norm)
direct_norm = direct_norm + candidate_norm
ir = ABS(kpsym%rotp(is))
ira = 0
DO jr = 1, SIZE(kpoint%ibrot)
IF (ir == kpoint%ibrot(jr)) ira = jr
END DO
CPASSERT(ira > 0)
kind_rot => kpoint%kind_rotmat(ira, :)
best_mode = 0
best_residual = HUGE(1.0_dp)
DO mode = 1, 2
reverse = mode == 2
CALL symtrans_phase(sym_r, sym_c, source_r, source_c, .FALSE., kind_rot, &
kpsym%rot(1:3, 1:3, is), kpsym%f0(:, is), &
kpsym%fcell_gauge(:, :, is), kpoint%atype, &
kpsym%xkp(1:3, is), kpsym%rotp(is) < 0, reverse)
CALL dbcsr_dot(sym_r, sym_r, candidate_norm)
CALL dbcsr_dot(sym_c, sym_c, relative_residual)
candidate_norm = candidate_norm + relative_residual
CALL dbcsr_dot(sym_r, direct_r, overlap_dot)
CALL dbcsr_dot(sym_c, direct_c, relative_residual)
overlap_dot = overlap_dot + relative_residual
relative_residual = SQRT(MAX(0.0_dp, candidate_norm + direct_norm - &
2.0_dp*overlap_dot)/MAX(direct_norm, TINY(1.0_dp)))
IF (relative_residual < best_residual) THEN
best_residual = relative_residual
best_mode = mode
END IF
END DO
IF (best_residual > phase_tolerance) THEN
WRITE (phase_error, '(A,ES12.4,A,I0,A,I0)') &
"No Bloch-phase direction preserves overlap covariance; residual=", &
best_residual, ", irreducible k-point=", ik, ", operation=", is
CALL cp_abort(__LOCATION__, TRIM(phase_error))
END IF
kpsym%phase_mode(is) = best_mode
END DO
END DO
CALL dbcsr_deallocate_matrix(source_r)
CALL dbcsr_deallocate_matrix(source_c)
CALL dbcsr_deallocate_matrix(direct_r)
CALL dbcsr_deallocate_matrix(direct_c)
CALL dbcsr_deallocate_matrix(sym_r)
CALL dbcsr_deallocate_matrix(sym_c)
END SUBROUTINE calibrate_symmetry_phases
! **************************************************************************************************
!> \brief Symmetrize a complex k-point matrix including Bloch phase shifts
!> \param srpmat real part of transformed matrix
@ -2167,8 +2322,8 @@ CONTAINS
ELSE
shift = fcell(1:3, icol) - fcell(1:3, irow)
END IF
arg = REAL(shift(1), dp)*xkp(1) + REAL(shift(2), dp)*xkp(2) + REAL(shift(3), dp)*xkp(3)
! The Bloch phase depends only on the mapped atom-cell shifts and the target k-point.
arg = REAL(shift(1), dp)*xkp(1) + REAL(shift(2), dp)*xkp(2) + &
REAL(shift(3), dp)*xkp(3)
coskl = COS(twopi*arg)
sinkl = SIN(twopi*arg)
IF (real_only) THEN

View file

@ -115,6 +115,8 @@ MODULE kpoint_types
!> \param rot rotation matrices
!> \param f0 atom permutation
!> \param fcell atom cell shifts generated by the symmetry operation
!> \param fcell_gauge atom cell shifts in CP2K's internal PBC gauge
!> \param phase_mode Bloch phase direction selected from overlap covariance
!> \param kgphase atom Bloch gauge from reciprocal-lattice folding of the mapped k-point
!> \author JGH
! **************************************************************************************************
@ -127,6 +129,8 @@ MODULE kpoint_types
INTEGER, DIMENSION(:), POINTER :: rotp => NULL()
INTEGER, DIMENSION(:, :), POINTER :: f0 => NULL()
INTEGER, DIMENSION(:, :, :), POINTER :: fcell => NULL()
INTEGER, DIMENSION(:, :, :), POINTER :: fcell_gauge => NULL()
INTEGER, DIMENSION(:), POINTER :: phase_mode => NULL()
REAL(KIND=dp), DIMENSION(:, :), POINTER :: kgphase => NULL()
END TYPE kpoint_sym_type
@ -738,7 +742,7 @@ CONTAINS
INTEGER :: i, n_rep, nval, wfntype
LOGICAL :: available, backend_explicit, &
non_lower_triangular_cell, &
non_orthogonal_cell, reduction_explicit
reduction_explicit
REAL(KIND=dp) :: ff
REAL(KIND=dp), DIMENSION(3, 3) :: cart_a_vec
REAL(KIND=dp), DIMENSION(:), POINTER :: reallist
@ -850,18 +854,7 @@ CONTAINS
non_lower_triangular_cell = (ABS(a_vec(2, 1)) > eps_cell) .OR. &
(ABS(a_vec(3, 1)) > eps_cell) .OR. &
(ABS(a_vec(3, 2)) > eps_cell)
non_orthogonal_cell = (ABS(DOT_PRODUCT(a_vec(:, 1), a_vec(:, 2))) > eps_cell) .OR. &
(ABS(DOT_PRODUCT(a_vec(:, 1), a_vec(:, 3))) > eps_cell) .OR. &
(ABS(DOT_PRODUCT(a_vec(:, 2), a_vec(:, 3))) > eps_cell)
! The full point-group density-matrix transform is not charge-conserving for skew cells.
IF (non_orthogonal_cell) THEN
kpoint%inversion_symmetry_only = .TRUE.
CALL cp_warn(__LOCATION__, &
"Full atomic k-point symmetry was requested for a non-orthogonal cell. "// &
"Falling back to KPOINTS%INVERSION_SYMMETRY_ONLY because the full "// &
"point-group density-matrix symmetrization is only charge-conserving for "// &
"orthogonal cell matrices.")
ELSEIF (non_lower_triangular_cell) THEN
IF (non_lower_triangular_cell) THEN
kpoint%inversion_symmetry_only = .TRUE.
CALL cp_warn(__LOCATION__, &
"Full atomic k-point symmetry was requested for a cell matrix that does "// &
@ -1144,6 +1137,8 @@ CONTAINS
NULLIFY (kp_sym%rotp)
NULLIFY (kp_sym%f0)
NULLIFY (kp_sym%fcell)
NULLIFY (kp_sym%fcell_gauge)
NULLIFY (kp_sym%phase_mode)
NULLIFY (kp_sym%kgphase)
END SUBROUTINE kpoint_sym_create
@ -1170,6 +1165,12 @@ CONTAINS
IF (ASSOCIATED(kp_sym%fcell)) THEN
DEALLOCATE (kp_sym%fcell)
END IF
IF (ASSOCIATED(kp_sym%fcell_gauge)) THEN
DEALLOCATE (kp_sym%fcell_gauge)
END IF
IF (ASSOCIATED(kp_sym%phase_mode)) THEN
DEALLOCATE (kp_sym%phase_mode)
END IF
IF (ASSOCIATED(kp_sym%kgphase)) THEN
DEALLOCATE (kp_sym%kgphase)
END IF

View file

@ -761,7 +761,7 @@ CONTAINS
CALL kpoint_density_matrices(kpoints)
! density matrices in real space
CALL kpoint_density_transform(kpoints, scf_env%p_mix_new, .FALSE., &
matrix_s(1, 1)%matrix, sab_nl, fmwork)
matrix_s(1, 1)%matrix, sab_nl, fmwork, overlap_rs=matrix_s)
END IF
CALL dbcsr_deallocate_matrix(rmatrix)

View file

@ -2751,6 +2751,9 @@ CONTAINS
time_reversal = kpsym%rotp(isym) < 0
reverse_phase = qs_kpoint%gamma_centered .AND. ANY(MOD(qs_kpoint%nkp_grid, 2) == 0)
IF (ASSOCIATED(kpsym%phase_mode)) THEN
IF (kpsym%phase_mode(isym) > 0) reverse_phase = kpsym%phase_mode(isym) == 2
END IF
xkp_phase(1:3) = kpsym%xkp(1:3, isym)
DO iatom = 1, natom
source_atom = iatom
@ -2764,9 +2767,9 @@ CONTAINS
DEALLOCATE (src_r, src_i, dst_r, dst_i, ao_start, ao_size)
RETURN
END IF
arg = REAL(kpsym%fcell(1, source_atom, isym), KIND=dp)*xkp_phase(1) + &
REAL(kpsym%fcell(2, source_atom, isym), KIND=dp)*xkp_phase(2) + &
REAL(kpsym%fcell(3, source_atom, isym), KIND=dp)*xkp_phase(3)
arg = REAL(kpsym%fcell_gauge(1, source_atom, isym), KIND=dp)*xkp_phase(1) + &
REAL(kpsym%fcell_gauge(2, source_atom, isym), KIND=dp)*xkp_phase(2) + &
REAL(kpsym%fcell_gauge(3, source_atom, isym), KIND=dp)*xkp_phase(3)
IF (ASSOCIATED(kpsym%kgphase)) THEN
arg = arg + kpsym%kgphase(source_atom, isym)
END IF

View file

@ -9,11 +9,11 @@
"dftb3_h2o_force.inp" = [{matcher="M042", tol=1.0E-6, ref=0.0}]
"dftb3_h2o_uks_force.inp" = [{matcher="M042", tol=1.0E-6, ref=0.0}]
"dftb3_h2o_gamma_stress.inp" = [{matcher="M042", tol=1.0E-6, ref=0.0}]
"dftb3_h2o_kp_force.inp" = [{matcher="N_special_kpoints", tol=0.0, ref=4},
"dftb3_h2o_kp_force.inp" = [{matcher="N_special_kpoints", tol=0.0, ref=2},
{matcher="M042", tol=1.0E-6, ref=0.0}]
"dftb3_h2o_kp_stress.inp" = [{matcher="N_special_kpoints", tol=0.0, ref=4},
{matcher="M042", tol=1.0E-6, ref=0.0}]
"dftb3_h2o_kp_spglib_backend_force.inp" = [{matcher="N_special_kpoints", tol=0.0, ref=4},
"dftb3_h2o_kp_spglib_backend_force.inp" = [{matcher="N_special_kpoints", tol=0.0, ref=2},
{matcher="M042", tol=1.0E-6, ref=0.0}]
"dftb3_h2o_kp_spglib_backend_stress.inp" = [{matcher="N_special_kpoints", tol=0.0, ref=4},
{matcher="M042", tol=1.0E-6, ref=0.0}]

View file

@ -61,7 +61,7 @@
"c_kp1.inp" = [{matcher="E_total", tol=1.0E-14, ref=-13.76936385283589}]
"c_gamma_ls.inp" = [{matcher="M011", tol=1.0E-10, ref=-13.37701309109568}]
"c_kp1_kpsym_debug_stress.inp" = [{matcher="E_total", tol=1.0E-12, ref=-13.76936385283589},
{matcher="N_special_kpoints", tol=0.0, ref=32},
{matcher="N_special_kpoints", tol=0.0, ref=4},
{matcher="M042", tol=1.0E-5, ref=0.0}]
"c_kp2.inp" = [{matcher="E_total", tol=7e-14, ref=-13.76786045921772}]
"c_kp2_stress.inp" = [{matcher="E_total", tol=1.0E-12, ref=-13.76771748328116},

View file

@ -6,7 +6,7 @@
#
# spglib-dependent tests
"c_cell_opt_kpsym_guard.inp" = [{matcher="N_special_kpoints", tol=0.0, ref=1}]
"c_debug_kpsym_default.inp" = [{matcher="N_special_kpoints", tol=0.0, ref=4}]
"c_debug_kpsym_default.inp" = [{matcher="N_special_kpoints", tol=0.0, ref=3}]
"c_debug_kpsym_full.inp" = [{matcher="N_special_kpoints", tol=0.0, ref=3}]
"c_geo_opt_kpsym_spglib.inp" = [{matcher="N_special_kpoints", tol=0.0, ref=1}]
"c_spglib_backend_gamma_real_wfn.inp" = [{matcher="E_total", tol=1e-13, ref=-45.10384660417728},
@ -16,7 +16,12 @@
"h_hex_c3_sym_red.inp" = [{matcher="E_total", tol=1e-8, ref=-9.17691856252346},
{matcher="N_special_kpoints", tol=0.0, ref=9}]
"h_hex_c3_gamma_spglib.inp" = [{matcher="E_total", tol=1e-7, ref=-9.29840881688658},
{matcher="N_special_kpoints", tol=0.0, ref=20}]
{matcher="N_special_kpoints", tol=0.0, ref=8}]
"h_hex_c3_gamma_macdonald_spglib.inp" = [{matcher="E_total", tol=1e-7, ref=-9.29866167374671},
{matcher="N_special_kpoints", tol=0.0, ref=32}]
{matcher="N_special_kpoints", tol=0.0, ref=12}]
"he_monoclinic_full_symmetry.inp" = [{matcher="E_total", tol=1e-10, ref=-11.32544952043517},
{matcher="N_special_kpoints", tol=0.0, ref=2}]
"he_monoclinic_full_symmetry_debug.inp" = [{matcher="DEBUG_stress_sum", tol=1.0e-8, ref=0.0},
{matcher="DEBUG_force_sum", tol=1.0e-8, ref=0.0},
{matcher="N_special_kpoints", tol=0.0, ref=4}]
#EOF

View file

@ -0,0 +1,65 @@
&GLOBAL
PRINT_LEVEL MEDIUM
PROJECT HE_MONOCLINIC_FULL_SYMMETRY
RUN_TYPE ENERGY
&END GLOBAL
&FORCE_EVAL
METHOD QS
&DFT
BASIS_SET_FILE_NAME GTH_BASIS_SETS
POTENTIAL_FILE_NAME POTENTIAL
&KPOINTS
FULL_GRID OFF
SCHEME MACDONALD 2 2 2 0.0 0.0 0.0
SYMMETRY ON
SYMMETRY_BACKEND SPGLIB
SYMMETRY_REDUCTION_METHOD SPGLIB
VERBOSE T
WAVEFUNCTIONS COMPLEX
&END KPOINTS
&MGRID
CUTOFF 300
REL_CUTOFF 50
&END MGRID
&QS
EPS_DEFAULT 1.0E-12
METHOD GPW
&END QS
&SCF
EPS_SCF 1.0E-10
MAX_SCF 150
SCF_GUESS ATOMIC
&MIXING
ALPHA 0.4
METHOD DIRECT_P_MIXING
&END MIXING
&PRINT
&RESTART OFF
&END RESTART
&END PRINT
&END SCF
&XC
&XC_FUNCTIONAL PADE
&END XC_FUNCTIONAL
&END XC
&END DFT
&SUBSYS
&CELL
ABC 4.0 5.0 6.0
ALPHA_BETA_GAMMA 90.0 110.0 90.0
PERIODIC XYZ
&END CELL
&COORD
SCALED
He 0.13 0.21 0.17
He 0.87 0.21 0.83
He 0.13 0.79 0.17
He 0.87 0.79 0.83
&END COORD
&KIND He
BASIS_SET DZVP-GTH
POTENTIAL GTH-PADE-q2
&END KIND
&END SUBSYS
&END FORCE_EVAL

View file

@ -0,0 +1,74 @@
&GLOBAL
PRINT_LEVEL MEDIUM
PROJECT HE_MONOCLINIC_FULL_SYMMETRY_DEBUG
RUN_TYPE DEBUG
&END GLOBAL
&DEBUG
CHECK_ATOM_FORCE 1 Z
DEBUG_FORCES T
DEBUG_STRESS_TENSOR T
DX 1.0E-4
MAX_RELATIVE_ERROR 0.5
STOP_ON_MISMATCH F
&END DEBUG
&FORCE_EVAL
METHOD QS
STRESS_TENSOR ANALYTICAL
&DFT
BASIS_SET_FILE_NAME GTH_BASIS_SETS
POTENTIAL_FILE_NAME POTENTIAL
&KPOINTS
EPS_SYMMETRY 1.0E-8
FULL_GRID OFF
SCHEME MACDONALD 2 2 2 0.0 0.0 0.0
SYMMETRY ON
SYMMETRY_BACKEND SPGLIB
SYMMETRY_REDUCTION_METHOD SPGLIB
VERBOSE T
WAVEFUNCTIONS COMPLEX
&END KPOINTS
&MGRID
CUTOFF 300
REL_CUTOFF 50
&END MGRID
&QS
EPS_DEFAULT 1.0E-12
METHOD GPW
&END QS
&SCF
EPS_SCF 1.0E-9
MAX_SCF 80
SCF_GUESS ATOMIC
&MIXING
ALPHA 0.7
METHOD DIRECT_P_MIXING
&END MIXING
&PRINT
&RESTART OFF
&END RESTART
&END PRINT
&END SCF
&XC
&XC_FUNCTIONAL PADE
&END XC_FUNCTIONAL
&END XC
&END DFT
&SUBSYS
&CELL
ABC 4.0 5.0 6.0
ALPHA_BETA_GAMMA 90.0 110.0 90.0
PERIODIC XYZ
&END CELL
&COORD
SCALED
He 0.13 0.00 0.17
He 0.87 0.00 0.83
&END COORD
&KIND He
BASIS_SET DZVP-GTH
POTENTIAL GTH-PADE-q2
&END KIND
&END SUBSYS
&END FORCE_EVAL

View file

@ -29,7 +29,7 @@
"h_ortho_sym_red.inp" = [{matcher="E_total", tol=1e-8, ref=-2.73592238316042}]
"h_mono_sym_red.inp" = [{matcher="E_total", tol=1e-10, ref=-3.15139711262736}]
"h_hex_c3_gamma_k290.inp" = [{matcher="E_total", tol=1e-7, ref=-9.29840881688658},
{matcher="N_special_kpoints", tol=0.0, ref=20}]
{matcher="N_special_kpoints", tol=0.0, ref=8}]
"h_fcc_wannier90_scf_mp.inp" = [{matcher="E_total", tol=1e-13, ref=-4.34524388359536},
{matcher="N_special_kpoints", tol=0.0, ref=1},
{matcher="WANNIER90_SCF_MO_REUSE"},

View file

@ -1,7 +1,7 @@
"diamond_gapw_tc.inp" = [{matcher="M011", tol=1.0E-10, ref=-75.317785150617567}]
"diamond_gpw_extRI.inp" = [{matcher="M011", tol=1.0E-10, ref=-8.128239211260716}]
"diamond_gpw_extRI_kpsym.inp" = [{matcher="M011", tol=1.0E-10, ref=-8.128239211227628},
{matcher="N_special_kpoints", tol=0.0, ref=4}]
{matcher="N_special_kpoints", tol=0.0, ref=2}]
"hBN_gapw_ovlp.inp" = [{matcher="M011", tol=1.0E-10, ref=-86.213599739489808}]
"hBN_gapw_tc.inp" = [{matcher="M011", tol=1.0E-10, ref=-77.588144157636464}]
"hBN_gapw_mix_cl_tc.inp" = [{matcher="M011", tol=1.0E-10, ref=-81.58088407995704}]

View file

@ -5,4 +5,14 @@
{matcher="N_special_kpoints", tol=0.0, ref=4}]
"si_kp_tblite_mixer_spglib.inp" = [{matcher="E_total", tol=6.0E-7, ref=-14.73197235360055},
{matcher="N_special_kpoints", tol=0.0, ref=1}]
"bn_gfn1_kp_spglib_phase.inp" = [{matcher="E_total", tol=1.0E-10, ref=-18.86184474675449},
{matcher="N_special_kpoints", tol=0.0, ref=4}]
"urea_gfn1_kp_spglib_boundary.inp" = [{matcher="E_total", tol=1.0E-10, ref=-30.88452203095506},
{matcher="N_special_kpoints", tol=0.0, ref=6}]
"urea_gfn1_kp_spglib_cellopt.inp" = [{matcher="M011", tol=1.0E-8, ref=-30.88891308320623},
{matcher="N_special_kpoints", tol=0.0, ref=6}]
"ice_viii_gfn2_kp_spglib_nonsymmorphic.inp" = [{matcher="E_total", tol=1.0E-10, ref=-40.76699240612732},
{matcher="N_special_kpoints", tol=0.0, ref=6}]
"ice_ix_gfn2_kp_k290_nonsymmorphic.inp" = [{matcher="E_total", tol=1.0E-10, ref=-61.12461062282138},
{matcher="N_special_kpoints", tol=0.0, ref=14}]
#EOF

View file

@ -0,0 +1,63 @@
&GLOBAL
PRINT_LEVEL LOW
PROJECT bn_gfn1_kp_spglib_phase
RUN_TYPE ENERGY
&END GLOBAL
&FORCE_EVAL
METHOD Quickstep
&DFT
&KPOINTS
EPS_SYMMETRY 1.0E-8
FULL_GRID OFF
SCHEME MACDONALD 3 3 3 0 0 0
SYMMETRY ON
SYMMETRY_BACKEND SPGLIB
SYMMETRY_REDUCTION_METHOD SPGLIB
VERBOSE T
&END KPOINTS
&QS
EPS_DEFAULT 1.0E-12
METHOD xTB
&XTB
GFN_TYPE TBLITE
&TBLITE
ACCURACY 0.05
METHOD GFN1
&END TBLITE
&END XTB
&END QS
&SCF
EPS_SCF 1.0E-9
MAX_SCF 300
SCF_GUESS MOPAC
&MIXING
ALPHA 0.2
METHOD DIRECT_P_MIXING
&END MIXING
&PRINT
&RESTART OFF
&END RESTART
&END PRINT
&END SCF
&END DFT
&SUBSYS
&CELL
ABC 3.608972409874 3.608972409874 3.608972409874
CANONICALIZE TRUE
PERIODIC XYZ
SYMMETRY CUBIC
&END CELL
&COORD
SCALED
B 0.00 0.00 0.00
B 0.00 0.50 0.50
B 0.50 0.00 0.50
B 0.50 0.50 0.00
N 0.25 0.25 0.25
N 0.25 0.75 0.75
N 0.75 0.25 0.75
N 0.75 0.75 0.25
&END COORD
&END SUBSYS
&END FORCE_EVAL

View file

@ -0,0 +1,90 @@
&GLOBAL
PRINT_LEVEL LOW
PROJECT ice_ix_gfn2_kp_k290_nonsymmorphic
RUN_TYPE ENERGY
&END GLOBAL
&FORCE_EVAL
METHOD Quickstep
&DFT
&KPOINTS
FULL_GRID F
SCHEME MACDONALD 3 3 3 0.0 0.0 0.0
SYMMETRY T
SYMMETRY_BACKEND K290
SYMMETRY_REDUCTION_METHOD K290
VERBOSE T
&END KPOINTS
&QS
EPS_DEFAULT 1.0E-12
METHOD xTB
&XTB
GFN_TYPE TBLITE
&TBLITE
ACCURACY 0.1
METHOD GFN2
&END TBLITE
&END XTB
&END QS
&SCF
EPS_SCF 1.0E-9
MAX_SCF 300
SCF_GUESS MOPAC
&MIXING
ALPHA 0.2
METHOD DIRECT_P_MIXING
&END MIXING
&PRINT
&RESTART OFF
&END RESTART
&END PRINT
&END SCF
&END DFT
&SUBSYS
&CELL
A 6.784903000000 0.000000000000 0.000000000000
B 0.000000000000 6.784903000000 0.000000000000
C 0.000000000000 0.000000000000 6.807916000000
PERIODIC XYZ
&END CELL
&COORD
SCALED
H -0.006830000000 0.340009000000 0.190161000000
H 0.113981000000 0.164412000000 0.283330000000
H 0.309270000000 0.370346000000 0.106284000000
H 0.159991000000 0.493170000000 0.440161000000
H 0.335588000000 0.613981000000 0.533330000000
H 0.129654000000 0.809270000000 0.356284000000
H 0.840009000000 0.506830000000 -0.059839000000
H 0.664412000000 0.386019000000 0.033330000000
H 0.870346000000 0.190730000000 0.856284000000
H 0.506830000000 0.840009000000 1.059839000000
H 0.386019000000 0.664412000000 0.966670000000
H 0.190730000000 0.870346000000 0.143716000000
H 0.493170000000 0.159991000000 0.559839000000
H 0.613981000000 0.335588000000 0.466670000000
H 0.809270000000 0.129654000000 0.643716000000
H 0.370346000000 0.309270000000 -0.106284000000
H 0.659991000000 1.006830000000 0.309839000000
H 0.835588000000 0.886019000000 0.216670000000
H 0.629654000000 0.690730000000 0.393716000000
H 1.006830000000 0.659991000000 0.690161000000
H 0.886019000000 0.835588000000 0.783330000000
H 0.690730000000 0.629654000000 0.606284000000
H 0.340009000000 -0.006830000000 0.809839000000
H 0.164412000000 0.113981000000 0.716670000000
O 0.114088000000 0.310030000000 0.267366000000
O 0.189970000000 0.614088000000 0.517366000000
O 0.810030000000 0.385912000000 0.017365000000
O 0.385912000000 0.810030000000 0.982634000000
O 0.614088000000 0.189970000000 0.482634000000
O 0.689970000000 0.885912000000 0.232634000000
O 0.885912000000 0.689970000000 0.767366000000
O 0.310030000000 0.114088000000 0.732634000000
O 0.404256000000 0.404256000000 0.000000000000
O 0.095744000000 0.904256000000 0.250000000000
O 0.904256000000 0.095744000000 0.750000000000
O 0.595744000000 0.595744000000 0.500000000000
&END COORD
&END SUBSYS
&END FORCE_EVAL

View file

@ -0,0 +1,77 @@
&GLOBAL
PRINT_LEVEL LOW
PROJECT ice_viii_gfn2_kp_spglib_nonsymmorphic
RUN_TYPE ENERGY
&END GLOBAL
&FORCE_EVAL
METHOD Quickstep
&DFT
&KPOINTS
FULL_GRID F
SCHEME MACDONALD 3 3 3 0.0 0.0 0.0
SYMMETRY T
SYMMETRY_BACKEND SPGLIB
SYMMETRY_REDUCTION_METHOD SPGLIB
VERBOSE T
&END KPOINTS
&QS
EPS_DEFAULT 1.0E-12
METHOD xTB
&XTB
GFN_TYPE TBLITE
&TBLITE
ACCURACY 0.1
METHOD GFN2
&END TBLITE
&END XTB
&END QS
&SCF
EPS_SCF 1.0E-9
MAX_SCF 300
SCF_GUESS MOPAC
&MIXING
ALPHA 0.2
METHOD DIRECT_P_MIXING
&END MIXING
&PRINT
&RESTART OFF
&END RESTART
&END PRINT
&END SCF
&END DFT
&SUBSYS
&CELL
A 4.849465370000 0.000000000000 0.000000000000
B 0.000000000000 4.849465370000 0.000000000000
C 0.000000000000 0.000000000000 7.056513790000
PERIODIC XYZ
&END CELL
&COORD
H 6.781516750000 7.563033500000 6.966619500000
H 9.206249250000 9.987766000000 10.494876500000
H 6.000000000000 9.206249250000 8.730748000000
H 9.987766000000 6.781516750000 12.259005000000
H 9.206249250000 7.563033500000 7.764128500000
H 9.206249250000 6.000000000000 7.764128500000
H 9.987766000000 9.206249250000 6.000000000000
H 6.000000000000 6.781516750000 9.528257000000
H 8.424732500000 9.206249250000 6.000000000000
H 8.424732500000 6.781516750000 12.259005000000
H 6.781516750000 6.000000000000 6.966619500000
H 7.563033500000 9.206249250000 8.730748000000
H 7.563033500000 6.781516750000 9.528257000000
H 9.206249250000 8.424732500000 10.494876500000
H 6.781516750000 9.987766000000 11.292385500000
H 6.781516750000 8.424732500000 11.292385500000
O 6.781516750000 6.781516750000 6.368001500000
O 6.781516750000 9.206249250000 8.132130000000
O 9.206249250000 6.781516750000 11.660387000000
O 9.206249250000 6.781516750000 8.362746500000
O 9.206249250000 9.206249250000 6.598618000000
O 6.781516750000 6.781516750000 10.126875000000
O 9.206249250000 9.206249250000 9.896258500000
O 6.781516750000 9.206249250000 11.891003500000
&END COORD
&END SUBSYS
&END FORCE_EVAL

View file

@ -0,0 +1,78 @@
&GLOBAL
PRINT_LEVEL LOW
PROJECT_NAME "urea_gfn1_kp_spglib_boundary"
RUN_TYPE ENERGY
&END GLOBAL
&FORCE_EVAL
METHOD QS
STRESS_TENSOR ANALYTICAL
&DFT
&KPOINTS
EPS_SYMMETRY 1.0E-8
FULL_GRID F
SCHEME MACDONALD 2 2 2 0.25 0.25 0.25
SYMMETRY T
SYMMETRY_BACKEND SPGLIB
SYMMETRY_REDUCTION_METHOD SPGLIB
VERBOSE T
&END KPOINTS
&QS
EPS_DEFAULT 9.9999999999999998E-013
METHOD XTB
&XTB
GFN_TYPE TBLITE
&TBLITE T
ACCURACY 1.0000000000000001E-001
METHOD GFN1
&END TBLITE
&END XTB
&END QS
&SCF
EPS_SCF 1.0000000000000001E-009
MAX_SCF 300
SCF_GUESS MOPAC
&MIXING T
ALPHA 2.0000000000000001E-001
METHOD DIRECT_P_MIXING
&END MIXING
&PRINT
&RESTART OFF
&END RESTART
&END PRINT
&END SCF
&END DFT
&SUBSYS
&CELL
A 5.2159966903739186E+000 0.0000000000000000E+000 0.0000000000000000E+000
B 0.0000000000000000E+000 5.2159966903737809E+000 0.0000000000000000E+000
C 0.0000000000000000E+000 0.0000000000000000E+000 4.9491754758942879E+000
CANONICALIZE TRUE
MULTIPLE_UNIT_CELL 1 1 1
PERIODIC XYZ
&END CELL
&COORD
C 9.9999999999999878E-001 4.9999999999999933E-001 3.2101388247716989E-001
C 5.0000000000000022E-001 -1.0340691003044431E-015 6.7898611723238622E-001
O 9.9999999999999900E-001 4.9999999999999956E-001 5.7123643787624401E-001
O 5.0000000000000033E-001 7.9227636698446263E-016 4.2876356225551016E-001
N 1.5582226440252989E-001 6.5582226440257119E-001 1.7818364409247928E-001
N 6.5582226442015923E-001 8.4417773557979969E-001 8.2181635603715397E-001
N 3.4417773557983750E-001 1.5582226442019881E-001 8.2181635603715109E-001
N 8.4417773559747156E-001 3.4417773559743020E-001 1.7818364409247456E-001
H 2.7312356664824483E-001 7.7312356664827964E-001 2.8290207445821941E-001
H 7.7312356665118154E-001 7.2687643334878826E-001 7.1709792553130869E-001
H 2.2687643334882171E-001 2.7312356665121323E-001 7.1709792553131035E-001
H 7.2687643335175167E-001 2.2687643335171906E-001 2.8290207445822330E-001
H 1.5659886877892482E-001 6.5659886877895290E-001 9.7604046944000633E-001
H 6.5659886878433193E-001 8.4340113121563576E-001 2.3959530520177012E-002
H 3.4340113121566673E-001 1.5659886878436219E-001 2.3959530520177613E-002
H 8.4340113122107319E-001 3.4340113122104521E-001 9.7604046944000944E-001
SCALED T
&END COORD
&TOPOLOGY
MULTIPLE_UNIT_CELL 1 1 1
NUMBER_OF_ATOMS 16
&END TOPOLOGY
&END SUBSYS
&END FORCE_EVAL

View file

@ -0,0 +1,92 @@
&GLOBAL
PRINT_LEVEL LOW
PROJECT_NAME "urea_gfn1_kp_spglib_cellopt"
RUN_TYPE CELL_OPT
&END GLOBAL
&MOTION
&CELL_OPT
EXTERNAL_PRESSURE [bar] 0.0
KEEP_ANGLES T
MAX_ITER 6
OPTIMIZER CG
&CG
&LINE_SEARCH
TYPE 2PNT
&END LINE_SEARCH
&END CG
&END CELL_OPT
&END MOTION
&FORCE_EVAL
METHOD QS
STRESS_TENSOR ANALYTICAL
&DFT
&KPOINTS
EPS_SYMMETRY 1.0E-8
FULL_GRID F
SCHEME MACDONALD 2 2 2 0.25 0.25 0.25
SYMMETRY T
SYMMETRY_BACKEND SPGLIB
SYMMETRY_REDUCTION_METHOD SPGLIB
VERBOSE T
&END KPOINTS
&QS
EPS_DEFAULT 9.9999999999999998E-013
METHOD XTB
&XTB
GFN_TYPE TBLITE
&TBLITE T
ACCURACY 1.0000000000000001E-001
METHOD GFN1
&END TBLITE
&END XTB
&END QS
&SCF
EPS_SCF 1.0000000000000001E-009
MAX_SCF 300
SCF_GUESS MOPAC
&MIXING T
ALPHA 2.0000000000000001E-001
METHOD DIRECT_P_MIXING
&END MIXING
&PRINT
&RESTART OFF
&END RESTART
&END PRINT
&END SCF
&END DFT
&SUBSYS
&CELL
A 5.2159966903739186E+000 0.0000000000000000E+000 0.0000000000000000E+000
B 0.0000000000000000E+000 5.2159966903737809E+000 0.0000000000000000E+000
C 0.0000000000000000E+000 0.0000000000000000E+000 4.9491754758942879E+000
CANONICALIZE TRUE
MULTIPLE_UNIT_CELL 1 1 1
PERIODIC XYZ
&END CELL
&COORD
C 9.9999999999999878E-001 4.9999999999999933E-001 3.2101388247716989E-001
C 5.0000000000000022E-001 -1.0340691003044431E-015 6.7898611723238622E-001
O 9.9999999999999900E-001 4.9999999999999956E-001 5.7123643787624401E-001
O 5.0000000000000033E-001 7.9227636698446263E-016 4.2876356225551016E-001
N 1.5582226440252989E-001 6.5582226440257119E-001 1.7818364409247928E-001
N 6.5582226442015923E-001 8.4417773557979969E-001 8.2181635603715397E-001
N 3.4417773557983750E-001 1.5582226442019881E-001 8.2181635603715109E-001
N 8.4417773559747156E-001 3.4417773559743020E-001 1.7818364409247456E-001
H 2.7312356664824483E-001 7.7312356664827964E-001 2.8290207445821941E-001
H 7.7312356665118154E-001 7.2687643334878826E-001 7.1709792553130869E-001
H 2.2687643334882171E-001 2.7312356665121323E-001 7.1709792553131035E-001
H 7.2687643335175167E-001 2.2687643335171906E-001 2.8290207445822330E-001
H 1.5659886877892482E-001 6.5659886877895290E-001 9.7604046944000633E-001
H 6.5659886878433193E-001 8.4340113121563576E-001 2.3959530520177012E-002
H 3.4340113121566673E-001 1.5659886878436219E-001 2.3959530520177613E-002
H 8.4340113122107319E-001 3.4340113122104521E-001 9.7604046944000944E-001
SCALED T
&END COORD
&TOPOLOGY
MULTIPLE_UNIT_CELL 1 1 1
NUMBER_OF_ATOMS 16
&END TOPOLOGY
&END SUBSYS
&END FORCE_EVAL

View file

@ -26,7 +26,7 @@
"si_kp_spglib_reduction_atomdisp.inp" = [{matcher="E_total", tol=1.0E-11, ref=-13.92586348551223},
{matcher="N_special_kpoints", tol=0.0, ref=12}]
"si_kp_kpsym_debug_stress.inp" = [{matcher="E_total", tol=1.0E-11, ref=-13.92597057189198},
{matcher="N_special_kpoints", tol=0.0, ref=32},
{matcher="N_special_kpoints", tol=0.0, ref=4},
{matcher="M042", tol=1.0E-5, ref=0.0}]
"si_smear.inp" = []
"SiC_virial.inp" = []

View file

@ -27,7 +27,7 @@
{matcher="DEBUG_force_sum", tol=1.0E-6, ref=0.0000000},
{matcher="N_special_kpoints", tol=0.0, ref=2}]
"si_kp_kpsym_debug_stress.inp" = [{matcher="DEBUG_stress_sum", tol=1.0E-6, ref=0.0000000},
{matcher="N_special_kpoints", tol=0.0, ref=4}]
{matcher="N_special_kpoints", tol=0.0, ref=1}]
#
#ch2o_t09.inp 0
#ch2o_t10.inp 0

View file

@ -37,7 +37,7 @@
&END QS
&SCF
ADDED_MOS -1 -1
EPS_SCF 1.e-7
EPS_SCF 5.e-7
MAX_SCF 80
SCF_GUESS MOPAC
&MIXING

View file

@ -0,0 +1,69 @@
&GLOBAL
PRINT_LEVEL MEDIUM
PROJECT Si_gfn2_kp_spglib_shifted
RUN_TYPE ENERGY
&END GLOBAL
&FORCE_EVAL
METHOD QS
&DFT
&KPOINTS
EPS_SYMMETRY 1.e-8
FULL_GRID OFF
PARALLEL_GROUP_SIZE -1
SCHEME MONKHORST-PACK 4 4 4
SYMMETRY ON
SYMMETRY_BACKEND SPGLIB
VERBOSE T
&END KPOINTS
&POISSON
PERIODIC XYZ
POISSON_SOLVER PERIODIC
&END POISSON
&QS
EPS_DEFAULT 1.00E-12
METHOD xTB
&XTB
GFN_TYPE TBLITE
&TBLITE
METHOD GFN2
&END TBLITE
&END XTB
&END QS
&SCF
ADDED_MOS -1 -1
EPS_SCF 1.e-10
MAX_SCF 300
SCF_GUESS MOPAC
&MIXING
ALPHA 0.2
METHOD DIRECT_P_MIXING
&END MIXING
&PRINT
&RESTART OFF
&END RESTART
&END PRINT
&SMEAR ON
ELECTRONIC_TEMPERATURE 300
METHOD FERMI_DIRAC
&END SMEAR
&END SCF
&END DFT
&SUBSYS
&CELL
ABC 5.4310000000 5.4310000000000 5.431000000000
PERIODIC XYZ
&END CELL
&COORD
SCALED
Si 0.010000 0.020000 0.030000
Si 0.510000 0.520000 0.030000
Si 0.510000 0.020000 0.530000
Si 0.010000 0.520000 0.530000
Si 0.260000 0.270000 0.280000
Si 0.260000 0.770000 0.780000
Si 0.760000 0.270000 0.780000
Si 0.760000 0.770000 0.280000
&END COORD
&END SUBSYS
&END FORCE_EVAL

View file

@ -34,15 +34,17 @@
# DEBUG_STRESS_TENSOR matches the final finite-difference cell, whose symmetry is lower.
"Si_gfn2_asym_fd_stress.inp" = [{matcher="DEBUG_stress_sum", tol=5.0E-6, ref=0.0000000}]
"Si_gfn2_kp_stress.inp" = [{matcher="DEBUG_stress_sum", tol=5.0E-5, ref=0.0000000},
{matcher="N_special_kpoints", tol=0.0, ref=4}]
{matcher="N_special_kpoints", tol=0.0, ref=2}]
"Si_gfn2_kp_333_stress.inp" = [{matcher="DEBUG_stress_sum", tol=2.0E-4, ref=0.0000000},
{matcher="N_special_kpoints", tol=0.0, ref=14}]
{matcher="N_special_kpoints", tol=0.0, ref=6}]
"Si_gfn2_kp_kpsym.inp" = [{matcher="E_total", tol=1.0E-8, ref=-13.65677573470654},
{matcher="N_special_kpoints", tol=0.0, ref=4}]
"Si_gfn2_kp_spglib_backend.inp" = [{matcher="E_total", tol=1.0E-8, ref=-13.65677573470654},
{matcher="N_special_kpoints", tol=0.0, ref=4}]
"Si_gfn2_kp_spglib_shifted.inp" = [{matcher="E_total", tol=1.0E-8, ref=-13.65677573470655},
{matcher="N_special_kpoints", tol=0.0, ref=4}]
"Zn_fcc_gfn2_kp_k290.inp" = [{matcher="E_total", tol=1.0E-8, ref=-0.528740963544749},
{matcher="N_special_kpoints", tol=0.0, ref=14}]
{matcher="N_special_kpoints", tol=0.0, ref=4}]
"Ar_fcc_gfn2_ls.inp" = [{matcher="M011", tol=5.0E-8, ref=-17.12154132132343}]
"Ar_fcc_gfn2_force.inp" = [{matcher="M082", tol=1.0E-5, ref=0.0000000}]
"Ar_fcc_gfn2_stress.inp" = [{matcher="M042", tol=1.0E-5, ref=0.0000000}]