diff --git a/doc/dftb+/manual/dftbp.tex b/doc/dftb+/manual/dftbp.tex index b238d158bc..a3b314f425 100644 --- a/doc/dftb+/manual/dftbp.tex +++ b/doc/dftb+/manual/dftbp.tex @@ -1404,6 +1404,7 @@ \subsection{Density Functional based Tight Binding} \kw{CustomisedHubbards} & p & SCC = Yes & & \\ \kw{CustomisedOccupations} & p & SCC = Yes & & \\ \kw{TruncateSKRange} & p & & & \\ + \kw{HelicalSymmetryTol} & r & Helical = Yes & 1e-6 & \\ \hline \end{ptable} @@ -1758,6 +1759,10 @@ \subsection{Density Functional based Tight Binding} } \end{verbatim} +\item[\is{HelicalSymmetryTol}] Sets the tolerance for testing whether + provided $k$-points are consistent with the $C_n$ rotational + symmetry around the $z$-axis. + \end{description} diff --git a/src/dftbp/dftbplus/initprogram.F90 b/src/dftbp/dftbplus/initprogram.F90 index 7e5695a9f7..29157a44ac 100644 --- a/src/dftbp/dftbplus/initprogram.F90 +++ b/src/dftbp/dftbplus/initprogram.F90 @@ -1444,9 +1444,9 @@ subroutine initProgramVariables(this, input, env) end if this%kWeight(:) = input%ctrl%kWeight / sum(input%ctrl%kWeight) if (this%tHelical) then - if (any(abs(this%kPoint(2,:)*nint(this%latVec(3,1))& - & -nint(this%kPoint(2,:)*nint(this%latVec(3,1)))) > epsilon(1.0_dp))) then - call error("Specified k-value(s) incommensurate with C_n symmetry operation.") + if (any(abs(this%kPoint(2,:) * nint(this%latVec(3,1)) - nint(this%kPoint(2,:) *& + & nint(this%latVec(3,1)))) > input%ctrl%helicalSymTol)) then + call warning("Specified k-value(s) incommensurate with C_n symmetry operation.") end if end if else diff --git a/src/dftbp/dftbplus/inputdata.F90 b/src/dftbp/dftbplus/inputdata.F90 index 8ddb94962a..fcf95de13d 100644 --- a/src/dftbp/dftbplus/inputdata.F90 +++ b/src/dftbp/dftbplus/inputdata.F90 @@ -390,6 +390,10 @@ module dftbp_dftbplus_inputdata !> Three diagonal elements of supercell folding coefficient matrix integer, allocatable :: supercellFoldingDiag(:) + !> Tolerance for helical symmetry determination of acceptable k-points commensurate with the + !! C_n symmetry + real(dp) :: helicalSymTol = 1.0E-8_dp + !> Cell pressure if periodic real(dp) :: pressure = 0.0_dp logical :: tBarostat = .false. diff --git a/src/dftbp/dftbplus/parser.F90 b/src/dftbp/dftbplus/parser.F90 index 4198728027..614ddbd464 100644 --- a/src/dftbp/dftbplus/parser.F90 +++ b/src/dftbp/dftbplus/parser.F90 @@ -3251,6 +3251,11 @@ subroutine readSccOptions(node, ctrl, geo) call getChildValue(node, "EwaldTolerance", ctrl%tolEwald, 1.0e-9_dp) end if + if (geo%tHelical) then + ! Tolerance for k-points being commensurate with C_n rotation + call getChildValue(node, "HelicalSymmetryTol", ctrl%helicalSymTol, 1.0E-6_dp) + end if + ! self consistency required or not to proceed call getChildValue(node, "ConvergentSCCOnly", ctrl%isSccConvRequired, .true.) diff --git a/test/app/dftb+/helical/1000-0-C_1000/_autotest.tag b/test/app/dftb+/helical/1000-0-C_1000/_autotest.tag new file mode 100644 index 0000000000..63637d15d8 --- /dev/null +++ b/test/app/dftb+/helical/1000-0-C_1000/_autotest.tag @@ -0,0 +1,16 @@ +orbital_charges :real:2:4,2 + 0.118265905191236E+001 0.906912703185028E+000 0.910429629105889E+000 + 0.999998615798086E+000 0.118265905191236E+001 0.906911351322849E+000 + 0.910429629105891E+000 0.999999967660211E+000 +forces :real:2:3,2 + -0.135883592621597E-004 -0.257276019866323E-004 0.487848350050682E-005 + -0.252590348144546E-004 -0.144407246777132E-004 -0.487848360036010E-005 +mermin_energy :real:0: + -0.346998900251157E+001 +end_coords :real:2:3,2 + 0.520851743555333E+003 0.538562725303199E+003 0.338316082389766E+001 + 0.520852141674625E+003 0.538562340276018E+003 0.681493936987640E+000 +dipole_moments :real:2:3,1 + -0.139528793261655E-008 -0.144273209457530E-008 -0.551705143600771E-011 +scaled_dipole :real:2:3,1 + -0.139528793261655E-008 -0.144273209457530E-008 -0.551705143600771E-011 diff --git a/test/app/dftb+/helical/1000-0-C_1000/dftb_in.hsd b/test/app/dftb+/helical/1000-0-C_1000/dftb_in.hsd new file mode 100644 index 0000000000..10881a70d2 --- /dev/null +++ b/test/app/dftb+/helical/1000-0-C_1000/dftb_in.hsd @@ -0,0 +1,39 @@ +Geometry = GenFormat { + 2 H + C + 1 1 0.2756230044E+03 0.2849950460E+03 0.1794011798E+01 + 2 1 0.2756230044E+03 0.2849950460E+03 0.3569110265E+00 + 0 0 0 + 0.2140932670E+01 1.8E-1 1000 +} + +Driver = LBFGS {} + +Hamiltonian = DFTB { + SCC = No + MaxAngularMomentum = { + C = "p" + } + Filling = Fermi { + Temperature [Kelvin] = 100.0 + } + SlaterKosterFiles = Type2FileNames { + Prefix = {slakos/origin/mio-1-1/} + Separator = "-" + Suffix = ".skf" + } + KPointsAndWeights = HelicalSampled {10 200 0.5 0.5} +} + +Options = { + WriteAutotestTag = Yes +} + +Analysis = { + CalculateForces = Yes + MullikenAnalysis = Yes +} + +ParserOptions = { + ParserVersion = 10 +} diff --git a/test/app/dftb+/tests b/test/app/dftb+/tests index 8261622180..cdb4e77044 100644 --- a/test/app/dftb+/tests +++ b/test/app/dftb+/tests @@ -53,6 +53,7 @@ helical/10-0Ctube #? MPI_PROCS <= 2 helical/10-0CtubeC_10 #? MPI_PROCS == 1 helical/10-0CtubeC_10_origin #? MPI_PROCS == 1 helical/10-0CtubeC_10_sampled #? MPI_PROCS == 1 +helical/1000-0-C_1000 #? MPI_PROCS == 1 helical/C6H6_stack #? MPI_PROCS == 1 helical/10-0Ctube_ELPA #? WITH_ELSI and MPI_PROCS <= 8 and MPI_PROCS % 2 == 0 and OMP_THREADS == 1 helical/C6H6_stack_ELPA #? WITH_ELSI and MPI_PROCS == 1 and OMP_THREADS == 1