@@ -106,10 +106,13 @@ struct PlaneWaveBasis{T,
106
106
# # Symmetry operations that leave the discretized model (k and r grids) invariant.
107
107
# Subset of model.symmetries.
108
108
symmetries:: Vector{SymOp{VT}}
109
- # Whether the symmetry operations leave the rgrid invariant
109
+ # Whether the symmetry operations leave the rgrid invariant.
110
110
# If this is true, the symmetries are a property of the complete discretized model.
111
111
# Therefore, all quantities should be symmetric to machine precision
112
112
symmetries_respect_rgrid:: Bool
113
+ # Whether the symmetry operations leave the basis invariant. Otherwise the symmetry
114
+ # operations will leave the lattice invariant.
115
+ symmetries_respect_basis:: Bool
113
116
# Whether symmetry is used to reduce the number of explicit k-points to the
114
117
# irreducible BZMesh. This is a debug option, useful when a part in the code does
115
118
# not yet implement symmetry. See `unfold_bz` as a convenient way to use this.
175
178
function PlaneWaveBasis (model:: Model{T} , Ecut:: Real , fft_size:: Tuple{Int, Int, Int} ,
176
179
variational:: Bool , kgrid:: AbstractKgrid ,
177
180
symmetries_respect_rgrid:: Bool ,
181
+ symmetries_respect_basis:: Bool ,
178
182
use_symmetries_for_kpoint_reduction:: Bool ,
179
183
comm_kpts, architecture:: Arch
180
184
) where {T <: Real , Arch <: AbstractArchitecture }
@@ -209,7 +213,11 @@ function PlaneWaveBasis(model::Model{T}, Ecut::Real, fft_size::Tuple{Int, Int, I
209
213
if symmetries_respect_rgrid
210
214
symmetries = symmetries_preserving_rgrid (symmetries, fft_size)
211
215
end
212
- symmetries = symmetries_preserving_kgrid (symmetries, kgrid)
216
+ # If false, symmetries will respect the model (leave the lattice invariant), as is the
217
+ # default behaviour for Abinit (nsym 0).
218
+ if symmetries_respect_basis
219
+ symmetries = symmetries_preserving_kgrid (symmetries, kgrid)
220
+ end
213
221
214
222
# Build the irreducible k-point coordinates
215
223
if use_symmetries_for_kpoint_reduction
@@ -317,7 +325,7 @@ function PlaneWaveBasis(model::Model{T}, Ecut::Real, fft_size::Tuple{Int, Int, I
317
325
kpoints, kweights, kgrid,
318
326
kcoords_global, kweights_global,
319
327
comm_kpts, krange_thisproc, krange_allprocs, krange_thisproc_allspin,
320
- architecture, symmetries, symmetries_respect_rgrid,
328
+ architecture, symmetries, symmetries_respect_rgrid, symmetries_respect_basis,
321
329
use_symmetries_for_kpoint_reduction, terms)
322
330
323
331
# Instantiate the terms with the basis
@@ -342,6 +350,7 @@ with a maximal spacing of `2π * 0.022` per Bohr.
342
350
kshift= [0 , 0 , 0 ],
343
351
variational= true , fft_size= nothing ,
344
352
symmetries_respect_rgrid= isnothing (fft_size),
353
+ symmetries_respect_basis= true ,
345
354
use_symmetries_for_kpoint_reduction= true ,
346
355
comm_kpts= MPI. COMM_WORLD, architecture= CPU ()) where {T <: Real }
347
356
if isnothing (fft_size)
@@ -372,8 +381,8 @@ with a maximal spacing of `2π * 0.022` per Bohr.
372
381
end
373
382
374
383
PlaneWaveBasis (model, austrip (Ecut), fft_size, variational, kgrid_inner,
375
- symmetries_respect_rgrid, use_symmetries_for_kpoint_reduction ,
376
- comm_kpts, architecture)
384
+ symmetries_respect_rgrid, symmetries_respect_basis ,
385
+ use_symmetries_for_kpoint_reduction, comm_kpts, architecture)
377
386
end
378
387
379
388
"""
@@ -383,7 +392,7 @@ e.g. an [`MonkhorstPack`](@ref) or a [`ExplicitKpoints`](@ref) grid.
383
392
@timing function PlaneWaveBasis (basis:: PlaneWaveBasis , kgrid:: AbstractKgrid )
384
393
PlaneWaveBasis (basis. model, basis. Ecut,
385
394
basis. fft_size, basis. variational,
386
- kgrid, basis. symmetries_respect_rgrid,
395
+ kgrid, basis. symmetries_respect_rgrid, basis . symmetries_respect_basis,
387
396
basis. use_symmetries_for_kpoint_reduction,
388
397
basis. comm_kpts, basis. architecture)
389
398
end
@@ -544,6 +553,7 @@ function gather_kpts(basis::PlaneWaveBasis)
544
553
basis. variational,
545
554
basis. kgrid,
546
555
basis. symmetries_respect_rgrid,
556
+ basis. symmetries_respect_basis,
547
557
basis. use_symmetries_for_kpoint_reduction,
548
558
MPI. COMM_SELF,
549
559
basis. architecture)
0 commit comments