Merge branch 'gpu-develop' into gpu-exx

This commit is contained in:
Pietro Bonfa 2019-04-20 11:03:34 +02:00
commit 6588e73da6
302 changed files with 19932 additions and 7083 deletions

View File

@ -46,7 +46,7 @@
<tr><th style="margin: 3 3 3 10; background: #005789; background: linear-gradient(rgba(0,87,137,1),rgba(0,119,189,1)); color: #ffffee; ">
<h1 style="margin: 10 10 10 15; text-align: left;"> Input File Description </h1>
<h2 style="margin: 10 10 10 15; text-align: left;"> Program:
cp.x / CP / Quantum Espresso<span style="font-weight: normal;"> (version: svn)</span>
cp.x / CP / Quantum Espresso<span style="font-weight: normal;"> (version: 6.4)</span>
</h2>
</th></tr>
<tr><td style="padding: 10 3 3 3; background: #ffffff; color: #222222; ">
@ -586,7 +586,8 @@ See also etot_conv_thr - both criteria must be satisfied.
</td>
</tr>
<tr><td align="left" valign="top" colspan="2"><blockquote><pre style="margin-bottom: -1em;">
'small': memory-saving tricks are implemented. Currently:
'small': NO LONGER IMPLEMENTED SINCE v.6.3
memory-saving tricks are implemented. Currently:
- the G-vectors are sorted only locally, not globally
- they are not collected and written to file
For large systems, the memory and time gain is sizable
@ -3938,7 +3939,7 @@ ENDRULES
</td></tr>
</table>
<small>
This file has been created by helpdoc utility on Tue Oct 23 15:42:16 CEST 2018.
This file has been created by helpdoc utility on Fri Mar 01 17:56:47 CET 2019.
</small>
</body>
</html>

View File

@ -3,7 +3,7 @@
------------------------------------------------------------------------
INPUT FILE DESCRIPTION
Program: cp.x / CP / Quantum Espresso (version: svn)
Program: cp.x / CP / Quantum Espresso (version: 6.4)
------------------------------------------------------------------------
@ -311,7 +311,8 @@ NAMELIST: &CONTROL
Type: CHARACTER
Default: 'default'
Description: 'small': memory-saving tricks are implemented. Currently:
Description: 'small': NO LONGER IMPLEMENTED SINCE v.6.3
memory-saving tricks are implemented. Currently:
- the G-vectors are sorted only locally, not globally
- they are not collected and written to file
For large systems, the memory and time gain is sizable
@ -2490,4 +2491,4 @@ CARD: AUTOPILOT
===END OF CARD==========================================================
This file has been created by helpdoc utility on Tue Oct 23 15:42:16 CEST 2018
This file has been created by helpdoc utility on Fri Mar 01 17:56:47 CET 2019

View File

@ -46,7 +46,7 @@
<tr><th style="margin: 3 3 3 10; background: #005789; background: linear-gradient(rgba(0,87,137,1),rgba(0,119,189,1)); color: #ffffee; ">
<h1 style="margin: 10 10 10 15; text-align: left;"> Input File Description </h1>
<h2 style="margin: 10 10 10 15; text-align: left;"> Program:
cppp.x / CP / Quantum Espresso<span style="font-weight: normal;"> (version: svn)</span>
cppp.x / CP / Quantum Espresso<span style="font-weight: normal;"> (version: 6.4)</span>
</h2>
</th></tr>
<tr><td style="padding: 10 3 3 3; background: #ffffff; color: #222222; ">
@ -406,7 +406,7 @@ to be read and plotted
</td></tr>
</table>
<small>
This file has been created by helpdoc utility on Fri Jun 22 17:11:00 CEST 2018.
This file has been created by helpdoc utility on Fri Mar 01 17:56:48 CET 2019.
</small>
</body>
</html>

View File

@ -3,7 +3,7 @@
------------------------------------------------------------------------
INPUT FILE DESCRIPTION
Program: cppp.x / CP / Quantum Espresso (version: svn)
Program: cppp.x / CP / Quantum Espresso (version: 6.4)
------------------------------------------------------------------------
@ -225,4 +225,4 @@ NAMELIST: &INPUTPP
===END OF NAMELIST======================================================
This file has been created by helpdoc utility on Fri Jun 22 17:10:59 CEST 2018
This file has been created by helpdoc utility on Fri Mar 01 17:56:48 CET 2019

View File

@ -1,4 +1,4 @@
VERSION = svn
VERSION = git
HELPDOC = ../../dev-tools/helpdoc -version $(VERSION)
LATEX = pdflatex
LATEX2HTML = latex2html

Binary file not shown.

View File

@ -1,5 +1,5 @@
\documentclass[12pt,a4paper]{article}
\def\version{6.3}
\def\version{6.4}
\def\qe{{\sc Quantum ESPRESSO}}
\usepackage{html}
@ -124,16 +124,18 @@ Symlinks to executable programs will be placed in the \texttt{bin/} subdirectory
As a final check that compilation was successful,
you may want to run some or all of the tests
and examples. Please see the general User's Guide for their setup. Automated tests for \cpx\ are in directory
\texttt{tests/} and can be run via the
script \texttt{check\_cp.x.j}
and examples.
Automated tests for \cpx\ are in directory
\texttt{test-suite/} and can be run via the
\texttt{Makefile} found there.
Please see the general User's Guide for their setup.
You may take the tests and examples distributed
with \CP\ as templates for writing your own input
files. Input files for tests are contained
in \texttt{tests/} subdirectory with file type
\texttt{*.in1}, \texttt{*.in2}, ... . Input file for examples
are produced if you run the examples in the
files. Input files for tests are contained in
subdirectories \texttt{test-suite/cp\_*} with file type
\texttt{*.in1}, \texttt{*.in2}, ... . Input files for examples
are produced, if you run the examples, in the
\texttt{results/} subdirectories, with names ending
with \texttt{.in}.

View File

@ -148,8 +148,7 @@ MODULE cp_restart_new
CHARACTER(LEN=20) :: dft_name
CHARACTER(LEN=256) :: dirname
CHARACTER(LEN=320) :: filename, sourcefile
CHARACTER(LEN=4) :: cspin
INTEGER :: kunit, ik_eff
INTEGER :: ik_eff
INTEGER :: k1, k2, k3
INTEGER :: nk1, nk2, nk3
INTEGER :: j, i, iss, ig, nspin_wfc, iss_wfc
@ -646,11 +645,8 @@ MODULE cp_restart_new
COMPLEX(DP), INTENT(INOUT) :: cm2(:,:) !
REAL(DP), INTENT(INOUT) :: wfc(:,:) ! BS
!
CHARACTER(LEN=256) :: dirname, kdirname, filename
CHARACTER(LEN=5) :: kindex
CHARACTER(LEN=4) :: cspin
CHARACTER(LEN=256) :: dirname, filename
INTEGER :: strlen
INTEGER :: kunit
INTEGER :: k1, k2, k3
INTEGER :: nk1, nk2, nk3
INTEGER :: i, j, iss, ig, nspin_wfc, ierr, ik

View File

@ -74,6 +74,7 @@ PROGRAM main
!
CALL cpr_loop( 1 )
!
CALL unset_mpi_comm_4_solvers ()
CALL stop_run()
CALL do_stop( .TRUE. )
!

View File

@ -702,13 +702,17 @@ makov_payne.o : ../../UtilXlib/mp.o
makov_payne.o : ../../UtilXlib/parallel_include.o
makov_payne.o : ions_positions.o
makov_payne.o : mainvar.o
manycp.o : ../../LAXlib/mp_diag.o
manycp.o : ../../Modules/check_stop.o
manycp.o : ../../Modules/command_line_options.o
manycp.o : ../../Modules/environment.o
manycp.o : ../../Modules/input_parameters.o
manycp.o : ../../Modules/io_global.o
manycp.o : ../../Modules/mp_bands.o
manycp.o : ../../Modules/mp_global.o
manycp.o : ../../Modules/mp_images.o
manycp.o : ../../Modules/mp_pools.o
manycp.o : ../../Modules/mp_world.o
manycp.o : ../../Modules/read_input.o
manycp.o : input.o
metaxc.o : ../../Modules/funct.o

View File

@ -28,21 +28,29 @@ PROGRAM manycp
USE environment, ONLY : environment_start, environment_end
USE io_global, ONLY : ionode, ionode_id, stdout
USE mp_global, ONLY : mp_startup
USE mp_images, ONLY : my_image_id
USE mp_world, ONLY : world_comm
USE mp_images, ONLY : intra_image_comm, my_image_id
USE mp_pools, ONLY : intra_pool_comm
USE mp_bands, ONLY : intra_bgrp_comm, inter_bgrp_comm
USE mp_diag, ONLY : mp_start_diag
USE read_input, ONLY : read_input_file
USE check_stop, ONLY : check_stop_init
USE command_line_options, ONLY: input_file_
USE command_line_options, ONLY: input_file_, ndiag_
!
IMPLICIT NONE
!
INTEGER :: i
LOGICAL :: opnd
LOGICAL :: opnd, diag_in_band_group = .true.
CHARACTER(LEN=256) :: filin, filout
CHARACTER(LEN=7) :: image_label
CHARACTER(LEN=6), EXTERNAL :: int_to_char
!
!
CALL mp_startup ( start_images=.true. )
CALL mp_start_diag ( ndiag_, world_comm, intra_bgrp_comm, &
do_distr_diag_inside_bgrp_ = diag_in_band_group )
CALL set_mpi_comm_4_solvers( intra_pool_comm, intra_bgrp_comm, &
inter_bgrp_comm )
CALL environment_start ( 'MANYCP' )
!
! ... Image-specific input files
@ -100,6 +108,7 @@ PROGRAM manycp
!
CALL cpr_loop( 1 )
!
CALL unset_mpi_comm_4_solvers ()
CALL stop_run( )
CALL do_stop( .TRUE. )
!

View File

@ -28,7 +28,6 @@ SUBROUTINE stop_run()
!
CALL plugin_clean()
!
CALL unset_mpi_comm_4_solvers ()
CALL mp_global_end()
!
END SUBROUTINE stop_run

View File

@ -21,43 +21,51 @@ clean:
- rm -f INPUT_*.html INPUT_*.txt INPUT_*.xml qe-input-ref.html
developer_man: developer_man.pdf
rm -rf developer_man/
latex2html \
- rm -rf developer_man/
- latex2html \
-t "Developer's Manual for Quantum-ESPRESSO" \
-html_version 3.2,math \
-toc_depth 3 -split 3 -toc_stars -show_section_numbers \
-local_icons -image_type png \
developer_man.tex
cd developer_man; \
for file in *.html; do \
cp $$file /tmp/$$file; \
cat /tmp/$$file | sed 's/HREF="http/NAME="http/g' | sed 's/mathend000#//g' - > $$file; \
rm -f /tmp/$$file; \
done
@echo ""
@echo "***"
@echo "*** Developer's Manual created in developers_manual/developers_manual.html"
@echo "***"
@echo ""
if test -d developer_man; then \
cd developer_man; \
for file in *.html; do \
cp $$file /tmp/$$file; \
cat /tmp/$$file | sed 's/HREF="http/NAME="http/g' | sed 's/mathend000#//g' - > $$file; \
rm -f /tmp/$$file; \
done; \
fi
@if test -d developer_man; then \
echo ""; \
echo "***"; \
echo "*** Developer's Manual created in developers_manual/developers_manual.html"; \
echo "***"; \
echo ""; \
fi
user_guide: user_guide.pdf
rm -rf user_guide/
latex2html \
- rm -rf user_guide/
- latex2html \
-t "User's Guide for Quantum-ESPRESSO" \
-html_version 3.2,math \
-toc_depth 5 -split 5 -toc_stars -show_section_numbers \
-local_icons -image_type png \
user_guide.tex
cd user_guide; \
for file in *.html; do \
cp $$file /tmp/$$file; \
cat /tmp/$$file | sed 's/HREF="http/NAME="http/g' | sed 's/mathend000#//g' - > $$file; \
rm -f /tmp/$$file; \
done
@echo ""
@echo "***"
@echo "*** User's Guide created in user_guide/user_guide.html"
@echo "***"
@echo ""
if test -d user_guide; then \
cd user_guide; \
for file in *.html; do \
cp $$file /tmp/$$file; \
cat /tmp/$$file | sed 's/HREF="http/NAME="http/g' | sed 's/mathend000#//g' - > $$file; \
rm -f /tmp/$$file; \
done; \
fi
@if test -d user_guide; then \
echo ""; \
echo "***"; \
echo "*** User's Guide created in user_guide/user_guide.html"; \
echo "***"; \
echo ""; \
fi
brillouin_zones: brillouin_zones.pdf

Binary file not shown.

View File

@ -50,6 +50,7 @@ calculation to define paths in the BZ. This feature is available with
the option \texttt{tpiba\_b} or \texttt{crystal\_b} in a \texttt{'bands'}
calculation or with the option \texttt{q\_in\_band\_form} in the input of the
\texttt{matdyn.x} code.
BEWARE: you need to explicitly specify \texttt{ibrav} to use this feature.
Lines in reciprocal space are defined by giving the coordinates of the
starting and ending points and the number of points of each line.
The coordinates of the starting and ending points can be

Binary file not shown.

View File

@ -1,5 +1,5 @@
\documentclass[12pt,a4paper]{article}
\def\version{6.4}
\def\version{6.4.1}
\def\QE{{\sc Quantum ESPRESSO}}
\def\qe{QE}
\textwidth = 17cm
@ -1194,8 +1194,9 @@ may save hours of searching into the code for a piece of missing information.
complain if the latter \& is missing, others do.
% Another example: empty strings are nonstandard,
% use \texttt{empty='~'}, not \texttt{empty=''}.
\item do not (yet) use F2008 syntax. Stick to F2003 at most (for now).
\qe\ must work even if you do not have the latest and the greatest compiler.
\item try to stick to F2003 standard: \qe\ must work even if you do not have
the latest and the greatest compiler. Use F2008 syntax only if really
useful, and after verifying that it doesn't break too many compilers.
\item use "dp" (defined in module ''kinds'') to define the type of real and
complex variables
\item all constants should be defined to be of kind "dp". Preferred syntax:
@ -1210,7 +1211,7 @@ double precision complex number).
\item Do not use automatic arrays (e.g. \texttt{REAL(dp) :: A(N)} with
\texttt{N} defined at run time) unless you are sure that the array is
small in all cases: large arrays may easily exceed the stack size,
or the memory size,
or the memory size.
\item Do not use pointers unless you have a good reason to:
pointers may hinder optimization. Allocatable arrays should be used instead.
\item If you use pointers, nullify them before performing tests on their
@ -1224,9 +1225,12 @@ array sections. Passing an array section to a routine may look elegant
but it may turn out to be inefficient: a copy will be silently done
if the section is not contiguous in memory (or if the compiler
decides it is the right thing to do), increasing the memory footprint.
\item Do not pass unallocated arrays as arguments, even in those cases where
they are not actually used inside the subroutine: some compilers don't
like it.
\item Do not pass unallocated arrays or pointers as non-optional arguments,
even in those cases where they are not actually used inside the subroutine:
some compilers don't like it. Also note that if passed as optional argument
--provided the argument has not the pointer or allocatable attribute--
unallocated arrays or pointers are interpreted as non present (this is a
F2008 feature, already used since v.6.4).
\item Do not use any construct that is susceptible to be flagged as
out-of-bounds error, even if no actual out-of-bound error takes place.
\item Always use IMPLICIT NONE and declare all local variables.

View File

@ -1,4 +1,28 @@
New in development version:
New in 6.4.1 branch :
* A warning is issued if the lattice parameter seems to be a conversion
factor instead of a true lattice parameter. Conversion should be achieved
with the appropriate options, not with dirty tricks. In the future this
will no longer be allowed
* A warning is issued if ibrav=0 is used for systems having symmetry. If not
properly done this may lead to strange problems with symmetry detection
and symmetrization. Lattice information should be used if available.
Problems fixed in 6.4.1 branch :
* Two bugs fixed in HP: 1) the code was not working correctly when fractional
translations were present, 2) there was a bug in the case when either there
is only one k point, or when k pools are used and some of the pools have
only one k point.
* Restart of ph.x with 2D boundary conditions has been fixed (see gitlab
issue #102)
* XML file correctly written if tetrahedra are used (see gitlab issue #103)
New in version 6.4:
* Experimental version of SCDM localization with k-points, activated like for
k=0 by specifying in &system namelist a value > 0 for "localization_thr".
* It is now possible to limit the number of xml step elements printed out
for relaxation or molecular dynamics simulation, by setting the environment
variable MAX_XML_STEPS. Useful in case of very long trajectories to avoid
issues due to too large file size.
* EPW works with ultrasoft pseudopotentials (F. Giustino, S. Poncé, R. Margine)
* New code hp.x to compute Hubbard parameters using density-functional
perturbation theory (experimental stage) (I. Timrov, N. Marzari, and M. Cococcioni,
@ -10,7 +34,9 @@ New in development version:
and M. Cococcioni, in preparation)
* XDM now works also for USPP and norm-conserving PP
Problems fixed in development version (+ = in qe-6.3-backports as well) :
Problems fixed in version 6.4 (+ = in qe-6.3-backports as well) :
+ Codes reading scf data recomputed celldm parameters also if ibrav=0
This produced confusing output and had the potential to break some codes
+ index not correctly initialized in LSDA phonon with core corrections
+ GTH pseudopotentials in analytical form wrongly computed in some cases
+ projwfc.x not working with new xml format in noncolinear/spinorbit case
@ -31,7 +57,7 @@ Problems fixed in development version (+ = in qe-6.3-backports as well) :
pseudopotentials was not working.
+ bad format in upf%comment when writing the PP_INFO section of UPF v2 PPs
Incompatible changes in development version:
Incompatible changes in version 6.4 version:
* Charge density in the LSDA case is stored as (up+down, up-down) and no longer
as (up,down). Output data format is unchanged to (up+down, up-down)
* Non-symmorphic operations are always allowed and the FFT grid is made
@ -47,8 +73,10 @@ Incompatible changes in development version:
variables of turbo_lanczos.x and turbo_davidson.x. Instead, they are read
from the XML file produced by pw.x. The variable real_space_debug was removed.
Known problems in development version:
Known problems in version 6.4:
* Frequent "dexx is negative" errors with hybrid functionals
* restart of ph.x when using 2D boundary conditions fails see issue#102 on gitLab
* the band_structure element is printed incompletely if tetrahedra are used for sums in the IBZ, see issue #103.
New in 6.3 version:
* New implementation, using a more robust algorithm for the Wigner-Seitz

Binary file not shown.

View File

@ -1,5 +1,5 @@
\documentclass[12pt,a4paper]{article}
\def\version{6.4}
\def\version{6.4.1}
\def\qe{{\sc Quantum ESPRESSO}}
\usepackage{html}
@ -407,7 +407,9 @@ may break them. Use \texttt{export LC\_ALL=C} (sh/bash) or
when running scripts (including installation scripts).
Second, you need C and Fortran compilers, compliant with C89 and
F2003 standards. For parallel
F2003 standards\footnote{since v.6.4 a standard 2008 feature is
used: if unallocated pointers are passed as optional arguments,
they are interpreted as not present}. For parallel
execution, you will also need MPI libraries and a parallel
(i.e. MPI-aware) compiler. For massively parallel machines, or
for simple multicore parallelization, an OpenMP-aware compiler
@ -945,6 +947,7 @@ the last written output file to understand why.
\begin{itemize}
\item
Working Fortran and C compilers, compliant with F2003 and C89 standards
(see Sec.\ref{Sec:Installation})
respectively, are needed in order to compile \qe. Most recent Fortran
compilers will do the job.
@ -1109,6 +1112,10 @@ add preprocessing option \texttt{-Dzdotc=zdotc\_wrapper} to \texttt{DFLAGS}.
\paragraph{Linux PCs with Intel compiler (ifort)}
IMPORTANT NOTE: ifort versions earlier than v.15 miscompile the new
XML code in QE v.6.4 and later. Please install this patch:\\
\texttt{https://gitlab.com/QEF/q-e/wikis/Support/Patch-for-old-Intel-compilers}.
The Intel compiler ifort \texttt{http://software.intel.com/}
produces fast executables, at least on Intel CPUs, but not all versions
work as expected. In case of trouble, update your version
@ -1132,8 +1139,6 @@ The warning: {\em feupdateenv is not implemented and will always fail},
can be safely ignored. Warnings on ``bad preprocessing option'' when compiling
iotk and complains about ``recommended formats'' may also be ignored.
Versions v.12 and earlier of ifort are no longer supported by QE v.\version.
\paragraph{Linux PCs with MKL libraries}
On Intel CPUs it is very convenient to use Intel MKL libraries
(freely available at

View File

@ -21,7 +21,6 @@ release:
rm -rf examples/*/epw/out/* examples/*/epw/tmp/* \
examples/*/phonons/out/* examples/*/phonons/tmp/* \
examples/*/phonons/save/* ; \
rm -rf .svn */.svn */*/*.svn */*/*/*.svn */*/*/*/*.svn
cd .. ; tar cfz EPW/EPW-release.tgz EPW-release ; \
rm -rf EPW-release ; cd EPW

317
EPW/bin/pp-xml.py Normal file
View File

@ -0,0 +1,317 @@
#!/usr/bin/python
#
# Post-processing script from of PH data in format used by EPW
# 14/07/2015 - Creation of the script - Samuel Ponce
# 14/03/2018 - Automatically reads the number of q-points - Michael Waters
# 14/03/2018 - Detect if SOC is included in the calculation - Samuel Ponce
# 13/11/2018 - Write dyn files in xml format for SOC case - Shunhong Zhang (USTC)
#
import numpy as np
import os
from xml.dom import minidom
# Convert the dyn files to the xml form, for SOC case - Shunhong Zhang (USTC)
def dyn2xml(prefix):
ndyn=int(os.popen('head -2 {0}.dyn0|tail -1'.format(prefix)).read())
for idyn in range(1,ndyn+1):
print '{0}.dyn{1} to {0}.dyn_q{1}.xml'.format(prefix,idyn)
dynmat=dyn(prefix,idyn)
dynmat._write_xml()
def get_geom_info():
if os.path.isfile('ph.out')==False:
print 'cannot extract geometry info from ph.out'
return 1
else:
volm=float(os.popen('grep -a volume ph.out 2>/dev/null|tail -1').readline().split()[-2])
get_at=os.popen('grep -a -A 3 "crystal axes" ph.out 2>/dev/null|tail -3').readlines()
at=np.array([[float(item) for item in line.split()[3:6]] for line in get_at])
get_bg=os.popen('grep -a -A 3 "reciprocal axes" ph.out 2>/dev/null|tail -3').readlines()
bg=np.array([[float(item) for item in line.split()[3:6]] for line in get_bg])
return volm,at,bg
class dyn(object):
def __init__(self,prefix,idyn):
self._prefix=prefix
self._idyn=idyn
fil='{0}.dyn{1}'.format(prefix,idyn)
f=open(fil)
self._comment=f.readline()
f.readline()
line=f.readline().split()
self._ntype=int(line[0])
self._natom=int(line[1])
self._ibrav=int(line[2])
self._nspin=1
self._cell_dim=np.array([float(ii) for ii in line[3:]])
self._volm=0
self._at=np.zeros((3,3),float)
self._bg=np.zeros((3,3),float)
try: self._volm,self._at,self._bg = get_geom_info()
except: print 'warning: lattice info not found'
self._species=[];
self._mass=[]
for i in range(self._ntype):
line=f.readline().split()
self._species.append(line[1].strip("'"))
self._mass.append(float(line[-1])/911.4442) # normalize to atomic mass
self._atom_type=np.zeros(self._natom,int)
self._pos=np.zeros((self._natom,3),float)
for i in range(self._natom):
line=f.readline().split()
self._atom_type[i]=int(line[1])
for j in range(3): self._pos[i,j]=float(line[j+2])
self._nqpt=int(os.popen('grep -c "Dynamical Matrix" {0}'.format(fil)).read().split()[0])
self._qpt=[]
self._dynmat=np.zeros((self._nqpt,self._natom,self._natom,3,3,2),float)
f.readline()
for iqpt in range(self._nqpt):
f.readline();
f.readline()
line=f.readline().split()
self._qpt.append(np.array([float(item) for item in line[3:6]]))
f.readline()
for i in range(self._natom):
for j in range(self._natom):
f.readline()
data=np.fromfile(f,sep=' ',count=18,dtype=float).reshape(3,3,2)
self._dynmat[iqpt,i,j]=data
self._qpt=np.array(self._qpt)
for i in range(5): f.readline()
self._freq=np.zeros((self._natom*3,2),float)
self._disp=np.zeros((self._natom*3,self._natom,3,2),float)
for i in range(self._natom*3):
line=f.readline().split()
self._freq[i,0]=float(line[4])
self._freq[i,1]=float(line[7])
for j in range(self._natom):
line=f.readline().split()[1:-1]
data=np.array([float(item) for item in line]).reshape(3,2)
self._disp[i,j]=data
def _write_xml(self):
doc=minidom.Document()
root = doc.createElement('Root')
doc.appendChild(root)
geom_info=doc.createElement('GEOMETRY_INFO')
tags=('NUMBER_OF_TYPES','NUMBER_OF_ATOMS','BRAVAIS_LATTICE_INDEX','SPIN_COMPONENTS')
numbers=(self._ntype,self._natom,self._ibrav,self._nspin)
for i,(tag,num) in enumerate(zip(tags,numbers)):
inode=doc.createElement(tag)
inode.setAttribute('type','integer')
inode.setAttribute('size','1')
inode.text=num
inode.appendChild(doc.createTextNode(str(num)))
geom_info.appendChild(inode)
cell_dim=doc.createElement('CELL_DIMENSIONS')
cell_dim.setAttribute('type','real')
cell_dim.setAttribute('size','6')
for i in range(6):
cell_dim.appendChild(doc.createTextNode('{0:16.10f}'.format(self._cell_dim[i])))
geom_info.appendChild(cell_dim)
tags=['AT','BG']
for tag,lat in zip(tags,(self._at,self._bg)):
inode=doc.createElement(tag)
inode.setAttribute('type','real')
inode.setAttribute('size','9')
inode.setAttribute('columns','3')
for i in range(3):
text=' '.join(['{0:16.10f}'.format(item) for item in lat[i]])
inode.appendChild(doc.createTextNode(text))
geom_info.appendChild(inode)
volm=doc.createElement('UNIT_CELL_VOLUME_AU')
volm.setAttribute('type','real')
volm.setAttribute('size','1')
volm.appendChild(doc.createTextNode('{0:16.10f}'.format(self._volm)))
geom_info.appendChild(volm)
for itype in range(self._ntype):
nt=doc.createElement('TYPE_NAME.{0}'.format(itype+1))
nt.setAttribute('type','character')
nt.setAttribute('size','1')
nt.setAttribute('len','3')
nt.appendChild(doc.createTextNode('{0}'.format(self._species[itype])))
na=doc.createElement('MASS.{0}'.format(itype+1))
na.setAttribute('type','real')
na.setAttribute('size','1')
na.appendChild(doc.createTextNode('{0:16.10f}'.format(self._mass[itype])))
geom_info.appendChild(nt)
geom_info.appendChild(na)
for iat in range(self._natom):
at=doc.createElement('ATOM.{0}'.format(iat+1))
at.setAttribute('SPECIES','{0}'.format(self._species[self._atom_type[iat]-1]))
at.setAttribute('INDEX',str(iat+1))
pos=' '.join(['{0:16.10f}'.format(item) for item in self._pos[iat]])
at.setAttribute('TAU',pos)
geom_info.appendChild(at)
nqpt=doc.createElement('NUMBER_OF_Q')
nqpt.setAttribute('type','integer')
nqpt.setAttribute('size','1')
nqpt.appendChild(doc.createTextNode(str(self._nqpt)))
geom_info.appendChild(nqpt)
root.appendChild(geom_info)
for iqpt in range(self._nqpt):
dynmat=doc.createElement('DYNAMICAL_MAT_.{0}'.format(iqpt+1))
qpt=doc.createElement('Q_POINT')
qpt.setAttribute('type','real')
qpt.setAttribute('size','3')
qpt.setAttribute('columns','3')
tnode=doc.createTextNode(' '.join(['{0:16.10f}'.format(item) for item in self._qpt[iqpt]]))
qpt.appendChild(tnode)
dynmat.appendChild(qpt)
for iat in range(self._natom):
for jat in range(self._natom):
ph=doc.createElement('PHI.{0}.{1}'.format(iat+1,jat+1))
ph.setAttribute('type','complex')
ph.setAttribute('size','9')
ph.setAttribute('columns','3')
for i in range(3):
for j in range(3):
text='{0:16.10f} {1:16.10f}'.format(self._dynmat[iqpt,iat,jat,i,j,0],self._dynmat[iqpt,iat,jat,i,j,1])
ph.appendChild(doc.createTextNode(text))
dynmat.appendChild(ph)
root.appendChild(dynmat)
mode=doc.createElement('FREQUENCIES_THZ_CMM1')
for iomega in range(self._natom*3):
inode=doc.createElement('OMEGA.{0}'.format(iomega+1))
inode.setAttribute('type','real')
inode.setAttribute('size','2')
inode.setAttribute('columns','2')
inode.appendChild(doc.createTextNode('{0:16.10f} {1:16.10f}'.format(self._freq[iomega,0],self._freq[iomega,1])))
idisp=doc.createElement('DISPLACEMENT.{0}'.format(iomega+1))
idisp.setAttribute('tpye','complex')
idisp.setAttribute('size','3')
for iat in range(self._natom):
for j in range(3):
tnode=doc.createTextNode('{0:16.10f} {1:16.10f}'.format(self._disp[iomega,iat,j,0],self._disp[iomega,iat,j,1]))
idisp.appendChild(tnode)
mode.appendChild(inode)
mode.appendChild(idisp)
root.appendChild(mode)
fp = open('{0}.dyn_q{1}.xml'.format(self._prefix,self._idyn), 'w')
doc.writexml(fp, addindent=' ', newl='\n')
# Return the number of q-points in the IBZ
def get_nqpt(prefix):
fname = '_ph0/' +prefix+'.phsave/control_ph.xml'
fid = open(fname,'r')
lines = fid.readlines() # these files are relatively small so reading the whole thing shouldn't be an issue
fid.close()
line_number_of_nqpt = 0
while 'NUMBER_OF_Q_POINTS' not in lines[line_number_of_nqpt]: # increment to line of interest
line_number_of_nqpt +=1
line_number_of_nqpt +=1 # its on the next line after that text
nqpt = int(lines[line_number_of_nqpt])
return nqpt
# Check if the calculation include SOC
def hasSOC(prefix):
fname = prefix+'.save/data-file-schema.xml'
xmldoc = minidom.parse(fname)
item = xmldoc.getElementsByTagName('spinorbit')[0]
lSOC = item.childNodes[0].data
return lSOC
# Check if the calculation was done in sequential
def isSEQ(prefix):
fname = '_ph0/'+str(prefix)+'.dvscf'
if (os.path.isfile(fname)):
lseq = True
else:
lseq = False
return lseq
# Enter the number of irr. q-points
user_input = raw_input('Enter the prefix used for PH calculations (e.g. diam)\n')
prefix = str(user_input)
# Test if SOC
SOC = hasSOC(prefix)
# If SOC detected, but dyn is not in XML and we want to convert it
if SOC=='true':
user_input = raw_input('Calculation with SOC detected. Do you want to convert dyn in XML format [y/n]?\n')
if str(user_input) == 'y':
dyn2xml(prefix)
os.system('mv {0}.dyn*.xml save'.format(prefix))
# If no SOC detected, do you want to convert into XML format
if SOC=='false':
user_input = raw_input('Calculation without SOC detected. Do you want to convert to xml anyway [y/n]?\n')
if str(user_input) == 'y':
SOC = 'true'
dyn2xml(prefix)
os.system('mv {0}.dyn*.xml save'.format(prefix))
# Test if seq. or parallel run
SEQ = isSEQ(prefix)
if True: # this gets the nqpt from the outputfiles
nqpt = get_nqpt(prefix)
else:
# Enter the number of irr. q-points
user_input = raw_input('Enter the number of irreducible q-points\n')
nqpt = user_input
try:
nqpt = int(user_input)
except ValueError:
raise Exception('The value you enter is not an integer!')
os.system('mkdir save 2>/dev/null')
for iqpt in np.arange(1,nqpt+1):
label = str(iqpt)
# Case calculation in seq.
if SEQ:
# Case with SOC
if SOC == 'true':
os.system('cp '+prefix+'.dyn0 '+prefix+'.dyn0.xml')
os.system('cp '+prefix+'.dyn'+str(iqpt)+'.xml save/'+prefix+'.dyn_q'+label+'.xml')
if (iqpt == 1):
os.system('cp _ph0/'+prefix+'.dvscf* save/'+prefix+'.dvscf_q'+label)
os.system('cp -r _ph0/'+prefix+'.phsave save/')
os.system('cp '+prefix+'.fc.xml save/ifc.q2r.xml')
else:
os.system('cp _ph0/'+prefix+'.q_'+str(iqpt)+'/'+prefix+'.dvscf* save/'+prefix+'.dvscf_q'+label)
os.system('rm _ph0/'+prefix+'.q_'+str(iqpt)+'/*wfc*' )
# Case without SOC
if SOC == 'false':
os.system('cp '+prefix+'.dyn'+str(iqpt)+' save/'+prefix+'.dyn_q'+label)
if (iqpt == 1):
os.system('cp _ph0/'+prefix+'.dvscf save/'+prefix+'.dvscf_q'+label)
os.system('cp -r _ph0/'+prefix+'.phsave save/')
os.system('cp '+prefix+'.fc save/ifc.q2r')
else:
os.system('cp _ph0/'+prefix+'.q_'+str(iqpt)+'/'+prefix+'.dvscf save/'+prefix+'.dvscf_q'+label)
os.system('rm _ph0/'+prefix+'.q_'+str(iqpt)+'/*wfc*' )
else:
# Case with SOC
if SOC == 'true':
os.system('cp '+prefix+'.dyn0 '+prefix+'.dyn0.xml')
os.system('cp '+prefix+'.dyn'+str(iqpt)+'.xml save/'+prefix+'.dyn_q'+label+'.xml')
if (iqpt == 1):
os.system('cp _ph0/'+prefix+'.dvscf1 save/'+prefix+'.dvscf_q'+label)
os.system('cp -r _ph0/'+prefix+'.phsave save/')
os.system('cp '+prefix+'.fc.xml save/ifc.q2r.xml')
else:
os.system('cp _ph0/'+prefix+'.q_'+str(iqpt)+'/'+prefix+'.dvscf1 save/'+prefix+'.dvscf_q'+label)
os.system('rm _ph0/'+prefix+'.q_'+str(iqpt)+'/*wfc*' )
# Case without SOC
if SOC == 'false':
os.system('cp '+prefix+'.dyn'+str(iqpt)+' save/'+prefix+'.dyn_q'+label)
if (iqpt == 1):
os.system('cp _ph0/'+prefix+'.dvscf1 save/'+prefix+'.dvscf_q'+label)
os.system('cp -r _ph0/'+prefix+'.phsave save/')
os.system('cp '+prefix+'.fc save/ifc.q2r')
else:
os.system('cp _ph0/'+prefix+'.q_'+str(iqpt)+'/'+prefix+'.dvscf1 save/'+prefix+'.dvscf_q'+label)
os.system('rm _ph0/'+prefix+'.q_'+str(iqpt)+'/*wfc*' )

View File

@ -4,191 +4,11 @@
# 14/07/2015 - Creation of the script - Samuel Ponce
# 14/03/2018 - Automatically reads the number of q-points - Michael Waters
# 14/03/2018 - Detect if SOC is included in the calculation - Samuel Ponce
# 13/11/2018 - Write dyn files in xml format for SOC case - Shunhong Zhang (USTC)
#
import numpy as np
import os
from xml.dom import minidom
# Convert the dyn files to the xml form, for SOC case - Shunhong Zhang (USTC)
def dyn2xml(prefix):
ndyn=int(os.popen('head -2 {0}.dyn0|tail -1'.format(prefix)).read())
for idyn in range(1,ndyn+1):
print '{0}.dyn{1} to {0}.dyn_q{1}.xml'.format(prefix,idyn)
dynmat=dyn(prefix,idyn)
dynmat._write_xml()
def get_geom_info():
if os.path.isfile('ph.out')==False:
print 'cannot extract geometry info from ph.out'
return 1
else:
volm=float(os.popen('grep -a volume ph.out 2>/dev/null|tail -1').readline().split()[-2])
get_at=os.popen('grep -a -A 3 "crystal axes" ph.out 2>/dev/null|tail -3').readlines()
at=np.array([[float(item) for item in line.split()[3:6]] for line in get_at])
get_bg=os.popen('grep -a -A 3 "reciprocal axes" ph.out 2>/dev/null|tail -3').readlines()
bg=np.array([[float(item) for item in line.split()[3:6]] for line in get_bg])
return volm,at,bg
class dyn(object):
def __init__(self,prefix,idyn):
self._prefix=prefix
self._idyn=idyn
fil='{0}.dyn{1}'.format(prefix,idyn)
f=open(fil)
self._comment=f.readline()
f.readline()
line=f.readline().split()
self._ntype=int(line[0])
self._natom=int(line[1])
self._ibrav=int(line[2])
self._nspin=1
self._cell_dim=np.array([float(ii) for ii in line[3:]])
self._volm=0
self._at=np.zeros((3,3),float)
self._bg=np.zeros((3,3),float)
try: self._volm,self._at,self._bg = get_geom_info()
except: print 'warning: lattice info not found'
self._species=[];
self._mass=[]
for i in range(self._ntype):
line=f.readline().split()
self._species.append(line[1].strip("'"))
self._mass.append(float(line[-1])/911.4442) # normalize to atomic mass
self._atom_type=np.zeros(self._natom,int)
self._pos=np.zeros((self._natom,3),float)
for i in range(self._natom):
line=f.readline().split()
self._atom_type[i]=int(line[1])
for j in range(3): self._pos[i,j]=float(line[j+2])
self._nqpt=int(os.popen('grep -c "Dynamical Matrix" {0}'.format(fil)).read().split()[0])
self._qpt=[]
self._dynmat=np.zeros((self._nqpt,self._natom,self._natom,3,3,2),float)
f.readline()
for iqpt in range(self._nqpt):
f.readline();
f.readline()
line=f.readline().split()
self._qpt.append(np.array([float(item) for item in line[3:6]]))
f.readline()
for i in range(self._natom):
for j in range(self._natom):
f.readline()
data=np.fromfile(f,sep=' ',count=18,dtype=float).reshape(3,3,2)
self._dynmat[iqpt,i,j]=data
self._qpt=np.array(self._qpt)
for i in range(5): f.readline()
self._freq=np.zeros((self._natom*3,2),float)
self._disp=np.zeros((self._natom*3,self._natom,3,2),float)
for i in range(self._natom*3):
line=f.readline().split()
self._freq[i,0]=float(line[4])
self._freq[i,1]=float(line[7])
for j in range(self._natom):
line=f.readline().split()[1:-1]
data=np.array([float(item) for item in line]).reshape(3,2)
self._disp[i,j]=data
def _write_xml(self):
doc=minidom.Document()
root = doc.createElement('Root')
doc.appendChild(root)
geom_info=doc.createElement('GEOMETRY_INFO')
tags=('NUMBER_OF_TYPES','NUMBER_OF_ATOMS','BRAVAIS_LATTICE_INDEX','SPIN_COMPONENTS')
numbers=(self._ntype,self._natom,self._ibrav,self._nspin)
for i,(tag,num) in enumerate(zip(tags,numbers)):
inode=doc.createElement(tag)
inode.setAttribute('type','integer')
inode.setAttribute('size','1')
inode.text=num
inode.appendChild(doc.createTextNode(str(num)))
geom_info.appendChild(inode)
cell_dim=doc.createElement('CELL_DIMENSIONS')
cell_dim.setAttribute('type','real')
cell_dim.setAttribute('size','6')
for i in range(6):
cell_dim.appendChild(doc.createTextNode('{0:16.10f}'.format(self._cell_dim[i])))
geom_info.appendChild(cell_dim)
tags=['AT','BG']
for tag,lat in zip(tags,(self._at,self._bg)):
inode=doc.createElement(tag)
inode.setAttribute('type','real')
inode.setAttribute('size','9')
inode.setAttribute('columns','3')
for i in range(3):
text=' '.join(['{0:16.10f}'.format(item) for item in lat[i]])
inode.appendChild(doc.createTextNode(text))
geom_info.appendChild(inode)
volm=doc.createElement('UNIT_CELL_VOLUME_AU')
volm.setAttribute('type','real')
volm.setAttribute('size','1')
volm.appendChild(doc.createTextNode('{0:16.10f}'.format(self._volm)))
geom_info.appendChild(volm)
for itype in range(self._ntype):
nt=doc.createElement('TYPE_NAME.{0}'.format(itype+1))
nt.setAttribute('type','character')
nt.setAttribute('size','1')
nt.setAttribute('len','3')
nt.appendChild(doc.createTextNode('{0}'.format(self._species[itype])))
na=doc.createElement('MASS.{0}'.format(itype+1))
na.setAttribute('type','real')
na.setAttribute('size','1')
na.appendChild(doc.createTextNode('{0:16.10f}'.format(self._mass[itype])))
geom_info.appendChild(nt)
geom_info.appendChild(na)
for iat in range(self._natom):
at=doc.createElement('ATOM.{0}'.format(iat+1))
at.setAttribute('SPECIES','{0}'.format(self._species[self._atom_type[iat]-1]))
at.setAttribute('INDEX',str(iat+1))
pos=' '.join(['{0:16.10f}'.format(item) for item in self._pos[iat]])
at.setAttribute('TAU',pos)
geom_info.appendChild(at)
nqpt=doc.createElement('NUMBER_OF_Q')
nqpt.setAttribute('type','integer')
nqpt.setAttribute('size','1')
nqpt.appendChild(doc.createTextNode(str(self._nqpt)))
geom_info.appendChild(nqpt)
root.appendChild(geom_info)
for iqpt in range(self._nqpt):
dynmat=doc.createElement('DYNAMICAL_MAT_.{0}'.format(iqpt+1))
qpt=doc.createElement('Q_POINT')
qpt.setAttribute('type','real')
qpt.setAttribute('size','3')
qpt.setAttribute('columns','3')
tnode=doc.createTextNode(' '.join(['{0:16.10f}'.format(item) for item in self._qpt[iqpt]]))
qpt.appendChild(tnode)
dynmat.appendChild(qpt)
for iat in range(self._natom):
for jat in range(self._natom):
ph=doc.createElement('PHI.{0}.{1}'.format(iat+1,jat+1))
ph.setAttribute('type','complex')
ph.setAttribute('size','9')
ph.setAttribute('columns','3')
for i in range(3):
for j in range(3):
text='{0:16.10f} {1:16.10f}'.format(self._dynmat[iqpt,iat,jat,i,j,0],self._dynmat[iqpt,iat,jat,i,j,1])
ph.appendChild(doc.createTextNode(text))
dynmat.appendChild(ph)
root.appendChild(dynmat)
mode=doc.createElement('FREQUENCIES_THZ_CMM1')
for iomega in range(self._natom*3):
inode=doc.createElement('OMEGA.{0}'.format(iomega+1))
inode.setAttribute('type','real')
inode.setAttribute('size','2')
inode.setAttribute('columns','2')
inode.appendChild(doc.createTextNode('{0:16.10f} {1:16.10f}'.format(self._freq[iomega,0],self._freq[iomega,1])))
idisp=doc.createElement('DISPLACEMENT.{0}'.format(iomega+1))
idisp.setAttribute('tpye','complex')
idisp.setAttribute('size','3')
for iat in range(self._natom):
for j in range(3):
tnode=doc.createTextNode('{0:16.10f} {1:16.10f}'.format(self._disp[iomega,iat,j,0],self._disp[iomega,iat,j,1]))
idisp.appendChild(tnode)
mode.appendChild(inode)
mode.appendChild(idisp)
root.appendChild(mode)
fp = open('{0}.dyn_q{1}.xml'.format(self._prefix,self._idyn), 'w')
doc.writexml(fp, addindent=' ', newl='\n')
# Return the number of q-points in the IBZ
def get_nqpt(prefix):
fname = '_ph0/' +prefix+'.phsave/control_ph.xml'
@ -233,21 +53,6 @@ prefix = str(user_input)
# Test if SOC
SOC = hasSOC(prefix)
# If SOC detected, but dyn is not in XML and we want to convert it
if SOC=='true':
user_input = raw_input('Calculation with SOC detected. Do you want to convert dyn in XML format [y/n]?\n')
if str(user_input) == 'y':
dyn2xml(prefix)
os.system('mv {0}.dyn*.xml save'.format(prefix))
# If no SOC detected, do you want to convert into XML format
if SOC=='false':
user_input = raw_input('Calculation without SOC detected. Do you want to convert to xml anyway [y/n]?\n')
if str(user_input) == 'y':
SOC = 'true'
dyn2xml(prefix)
os.system('mv {0}.dyn*.xml save'.format(prefix))
# Test if seq. or parallel run
SEQ = isSEQ(prefix)

View File

@ -10,7 +10,6 @@ authors: Samuel Poncé
author_description: The EPW project is mainly developed at the university of Oxford.
github: https://github.com/sponce24
email: samuel.pon@gmail.com
project_sourceforge: http://qeforge.qe-forge.org/gf/project/q-e/
predocmark: >
media_dir: ./media
page_dir: ./Ford

View File

@ -11,7 +11,7 @@ MODFLAGS= $(BASEMOD_FLAGS) \
$(MOD_FLAG)../../PW/src \
$(MOD_FLAG)../../PHonon/PH \
$(MOD_FLAG)../../LR_Modules \
$(MOD_FLAG)../../wannier90-2.1.0/src/obj \
$(MOD_FLAG)../../wannier90-3.0.0/src/obj \
$(MOD_FLAG)../../dft-d3
#
@ -106,7 +106,7 @@ system_mem_usage.o
PHOBJS = ../../PHonon/PH/libph.a
PWOBJS = ../../PW/src/libpw.a
W90LIB = ../../wannier90-2.1.0/libwannier.a
W90LIB = ../../wannier90-3.0.0/libwannier.a
LRMODS = ../../LR_Modules/liblrmod.a
PWOBJS = ../../PW/src/libpw.a
QEMODS = ../../Modules/libqemod.a ../../KS_Solvers/libks_solvers.a \
@ -115,8 +115,6 @@ LIBOBJS =../../LAXlib/libqela.a ../../UtilXlib/libutil.a ../../clib/clib.a ../..
TLDEPS= pw ph
#all : pw ph wannier wcorr pp ld1 upf libepw.a epw.x
#all : pw ph wannier pp ld1 upf libepw.a epw.x
all : pw ph wannier pp upf libepw.a epw.x
libepw.a : $(EPWOBJS)
@ -128,11 +126,6 @@ epw.x : epw.o libepw.a $(PHOBJS) $(LRMODS) $(PWOBJS) $(W90LIB) $(QEMODS) $(LIBOB
epw.o libepw.a $(PHOBJS) $(LRMODS) $(W90LIB) $(PWOBJS) $(QEMODS) $(LIBOBJS) $(QELIBS)
- ( cd ../bin ; ln -fs ../src/epw.x . )
# SP: Here to correct bugs in wannier 2.0.1
wcorr :
sed -i "s/allocate(fermi_energy_list(nfermi),stat=ierr)/if (.not. allocated(fermi_energy_list) ) allocate(fermi_energy_list(nfermi))/g" ../../wannier90-2.0.1/src/parameters.F90 ; sed -i "s/allocate(kubo_freq_list(kubo_nfreq),stat=ierr)/if (.not. allocated(kubo_freq_list) ) allocate(kubo_freq_list(kubo_nfreq)) /g" ../../wannier90-2.0.1/src/parameters.F90 ; cp wannier_lib.f90 wannier_lib.F90 ; cp wannier_lib.F90 ../../wannier90-2.0.1/src/
pw :
cd ../../ ; make pw
@ -140,7 +133,7 @@ ph :
cd ../../ ; make ph
wannier :
cd ../../ ; make w90 ; cd wannier90-2.1.0/ ; make lib
cd ../../ ; make w90 ; cd wannier90-3.0.0/ ; make lib
pp :
cd ../../ ; make pp

View File

@ -645,8 +645,6 @@
! every processor has just a chunk of the array, I may need some
! communication)
!
! No ultrasoft now
!
! I use the rule : if not found then gmap = 0
! Note that the map will be used only up to npwx (small sphere),
! while the G-vectors lost in the process are on the surface of

View File

@ -65,8 +65,6 @@
zi_all(:,:), &!
esigmar_all(:,:,:), &!
esigmai_all(:,:,:), &!
gammar_all(:,:,:), &! Real part of the Phonon self-energy (freq. dependent for spectral function)
gammai_all(:,:,:), &! Imaginary part of the Phonon self-energy (freq. dependent for spectral function)
jdos(:), &!
spectra(:,:,:,:,:,:), &! dipole absorption spectra, polarizations, nomega, nsmear, dme/vme, absorption/emission
sumr(:,:,:,:), &! to apply the ASR correction to every xq

View File

@ -37,7 +37,7 @@
USE io_epw, ONLY : iuepb, iuqpeig
USE pwcom, ONLY : et, xk, nks, nbnd, nkstot
USE cell_base, ONLY : at, bg
USE symm_base, ONLY : irt, s, nsym, ftau, sname, invs, s_axis_to_cart, &
USE symm_base, ONLY : irt, s, nsym, ft, sname, invs, s_axis_to_cart, &
sr, nrot, copy_sym, set_sym_bl, find_sym, &
inverse_s, remove_sym, allfrac
USE start_k, ONLY : nk1, nk2, nk3
@ -398,7 +398,7 @@
minus_q = .true.
sym = .false.
sym(1:nsym) = .true.
CALL smallg_q(xq, 0, at, bg, nsym, s, ftau, sym, minus_q) ! s is intent(in)
CALL smallg_q(xq, 0, at, bg, nsym, s, sym, minus_q) ! s is intent(in)
!
! SP: Notice that the function copy_sym reshuffles the s matrix for each irr_q.
! This is why we then need to call gmap_sym for each irr_q [see below].
@ -429,7 +429,7 @@
! reshuffles the s matrix for each irr_q [putting the sym of the small group of q first].
!
! [I checked that gmapsym(gmapsym(ig,isym),invs(isym)) = ig]
CALL gmap_sym(nsym, s, ftau, gmapsym, eigv, invs)
CALL gmap_sym(nsym, s, ft, gmapsym, eigv, invs)
!
! Re-set the variables needed for the pattern representation
! and the symmetries of the small group of irr-q
@ -485,20 +485,17 @@
CALL s_axis_to_cart() ! give sr(:,:, isym)
DO isym = 1, nsym
WRITE( stdout, '(/6x,"isym = ",i2,5x,a45/)') isym, sname(isym)
IF (ftau(1,isym).ne.0 .OR. ftau(2,isym).ne.0 .OR. ftau(3,isym).ne.0) THEN
ft1 = at(1,1)*ftau(1,isym)/dfftp%nr1 + at(1,2)*ftau(2,isym)/dfftp%nr2 + &
at(1,3)*ftau(3,isym)/dfftp%nr3
ft2 = at(2,1)*ftau(1,isym)/dfftp%nr1 + at(2,2)*ftau(2,isym)/dfftp%nr2 + &
at(2,3)*ftau(3,isym)/dfftp%nr3
ft3 = at(3,1)*ftau(1,isym)/dfftp%nr1 + at(3,2)*ftau(2,isym)/dfftp%nr2 + &
at(3,3)*ftau(3,isym)/dfftp%nr3
IF ( ft(1,isym)**2 + ft(2,isym)**2 + ft(3,isym)**2 > 1.0d-8 ) THEN
ft1 = at(1,1)*ft(1,isym) + at(1,2)*ft(2,isym) + at(1,3)*ft(3,isym)
ft2 = at(2,1)*ft(1,isym) + at(2,2)*ft(2,isym) + at(2,3)*ft(3,isym)
ft3 = at(3,1)*ft(1,isym) + at(3,2)*ft(2,isym) + at(3,3)*ft(3,isym)
WRITE(stdout, '(1x,"cryst.",3x,"s(",i2,") = (",3(i6,5x), &
& " ) f =( ",f10.7," )")') &
isym, (s(1,ipol,isym),ipol=1,3), dble(ftau(1,isym))/dble(dfftp%nr1)
isym, (s(1,ipol,isym),ipol=1,3), ft(1,isym)
WRITE(stdout, '(17x," (",3(i6,5x), " ) ( ",f10.7," )")') &
(s(2,ipol,isym),ipol=1,3), dble(ftau(2,isym))/dble(dfftp%nr2)
(s(2,ipol,isym),ipol=1,3), ft(2,isym)
WRITE(stdout, '(17x," (",3(i6,5x), " ) ( ",f10.7," )"/)') &
(s(3,ipol,isym),ipol=1,3), dble(ftau(3,isym))/dble(dfftp%nr3)
(s(3,ipol,isym),ipol=1,3), ft(3,isym)
WRITE(stdout, '(1x,"cart. ",3x,"s(",i2,") = (",3f11.7, &
& " ) f =( ",f10.7," )")') &
isym, (sr(1,ipol,isym),ipol=1,3), ft1
@ -563,7 +560,7 @@
!
! check whether the symmetry belongs to a symmorphic group
!
symmo = (ftau(1,isym).eq.0 .AND. ftau(2,isym).eq.0 .AND. ftau(3,isym).eq.0)
symmo = ( ft(1,isym)**2 + ft(2,isym)**2 + ft(3,isym)**2 > 1.0d-8 )
!
WRITE(stdout,'(3i5,L3,L3)') iq, i, isym, nog, symmo
!

View File

@ -18,9 +18,6 @@
!! Compact formalism Dec 2006
!! Phonon irreducible zone Mar 2007
!!
!! No ultrasoft now
!! No spin polarization
!!
!! RM - add noncolin case
!-----------------------------------------------------------------------
!
@ -1475,6 +1472,13 @@
!
ENDDO
CLOSE(lambda_phself)
!
! SP - 03/2019
! \Gamma = 1/\tau = phonon lifetime
! \Gamma = - 2 * Im \Pi^R where \Pi^R is the retarted phonon self-energy.
! Im \Pi^R = pi*k-point weight*[f(E_k+q) - f(E_k)]*delta[E_k+q - E_k - w_q]
! Since gamma_all = pi*k-point weight*[f(E_k) - f(E_k+q)]*delta[E_k+q - E_k - w_q] we have
! \Gamma = 2 * gamma_all
OPEN(unit=linewidth_phself,file='linewidth.phself')
WRITE(linewidth_phself, '(a)') '# Phonon frequency and phonon lifetime in meV '
WRITE(linewidth_phself,'(a)') '# Q-point Mode Phonon freq (meV) Phonon linewidth (meV)'
@ -1482,7 +1486,7 @@
!
DO imode=1, nmodes
WRITE(linewidth_phself,'(i9,i6,E20.8,E22.10)') iqq,imode,&
ryd2mev*wf(imode,iqq),ryd2mev*REAL(gamma_all(imode,iqq,1))
ryd2mev*wf(imode,iqq), 2.0d0 * ryd2mev * REAL(gamma_all(imode,iqq,1))
ENDDO
!
ENDDO

View File

@ -20,9 +20,6 @@
!! Compact formalism Dec 2006
!! Phonon irreducible zone Mar 2007
!!
!! No ultrasoft now
!! No spin polarization
!!
!! RM - add noncolin case
!-----------------------------------------------------------------------
!

View File

@ -10,7 +10,7 @@
!-----------------------------------------------------------------------
PROGRAM epw
!! author: Samuel Ponce', Roxana Margine, Carla Verdi, Feliciano Giustino
!! version: v5.0
!! version: v5.1
!! license: GNU
!! summary: EPW main driver
!!
@ -39,7 +39,7 @@
CHARACTER (LEN=12) :: code = 'EPW'
!! Name of the program
!
version_number = '5.0.0'
version_number = '5.1.0'
!
CALL init_clocks( .TRUE. )
!
@ -145,7 +145,7 @@
!
IF ( elph ) THEN
!
CALL dvanqq2()
! CALL dvanqq2()
!
CALL elphon_shuffle_wrap()
!

View File

@ -26,7 +26,7 @@
USE gvect, ONLY : gcutm, ngm
USE gvecs, ONLY : dual, doublegrid, gcutms, ngms
USE gvecw, ONLY : ecutwfc
USE symm_base, ONLY : s, sname, ftau, s_axis_to_cart, sr, t_rev
USE symm_base, ONLY : s, sname, ft, s_axis_to_cart, sr, t_rev
USE noncollin_module, ONLY : noncolin
USE spin_orb, ONLY : lspinorb, domag
USE funct, ONLY : write_dft_name
@ -151,25 +151,19 @@
IF (noncolin.and.domag) &
WRITE(stdout,'(1x, "Time Reversal",i3)') t_rev(isym)
!
IF (ftau(1,isym).ne.0 .OR. ftau(2,isym).ne.0 .OR. ftau(3,isym).ne.0) THEN
ft1 = at(1,1) * ftau(1,isym) / dfftp%nr1 &
+ at(1,2) * ftau(2,isym) / dfftp%nr2 &
+ at(1,3) * ftau(3,isym) / dfftp%nr3
ft2 = at(2,1) * ftau(1,isym) / dfftp%nr1 &
+ at(2,2) * ftau(2,isym) / dfftp%nr2 &
+ at(2,3) * ftau(3,isym) / dfftp%nr3
ft3 = at(3,1) * ftau(1,isym) / dfftp%nr1 &
+ at(3,2) * ftau(2,isym) / dfftp%nr2 &
+ at(3,3) * ftau(3,isym) / dfftp%nr3
IF ( ft(1,isym)**2 + ft(2,isym)**2 + ft(3,isym)**2 > 1.0d-8 ) THEN
ft1 = at(1,1)*ft(1,isym) + at(1,2)*ft(2,isym) + at(1,3)*ft(3,isym)
ft2 = at(2,1)*ft(1,isym) + at(2,2)*ft(2,isym) + at(2,3)*ft(3,isym)
ft3 = at(3,1)*ft(1,isym) + at(3,2)*ft(2,isym) + at(3,3)*ft(3,isym)
WRITE(stdout, '(1x,"cryst.",3x,"s(",i2,") = (",3i6, &
& " ) f =( ",f10.7," )")') isymq, &
& (s(1,ipol,isym), ipol = 1, 3), DBLE(ftau(1,isym))/DBLE(dfftp%nr1)
& (s(1,ipol,isym), ipol = 1, 3), ft(1,isym)
WRITE(stdout, '(17x," (",3(i6,5x), &
& " ) ( ",f10.7," )")') &
& (s(2,ipol,isym), ipol = 1, 3), DBLE(ftau(2,isym))/DBLE(dfftp%nr2)
& (s(2,ipol,isym), ipol = 1, 3), ft(2,isym)
WRITE(stdout, '(17x," (",3(i6,5x), &
& " ) ( ",f10.7," )"/)') &
& (s(3,ipol,isym), ipol = 1, 3), DBLE(ftau(3,isym))/DBLE(dfftp%nr3)
& (s(3,ipol,isym), ipol = 1, 3), ft(3,isym)
WRITE(stdout, '(1x,"cart.",3x,"s(",i2,") = (",3f11.7, &
& " ) f =( ",f10.7," )")') isymq, &
& (sr(1,ipol,isym), ipol = 1, 3), ft1

View File

@ -7,7 +7,7 @@
! present distribution, or http://www.gnu.org/copyleft.gpl.txt .
!
!-----------------------------------------------------------------------
SUBROUTINE gmap_sym( nsym, s, ftau, gmapsym, eigv, invs )
SUBROUTINE gmap_sym( nsym, s, ft, gmapsym, eigv, invs )
!-----------------------------------------------------------------------
!!
!! For every G vector, find S(G) for all the symmetry operations
@ -20,12 +20,9 @@
!! every processor has just a chunk of the array, I may need some
!! communication)
!!
!! No ultrasoft now
!!
!----------------------------------------------------------------------
USE kinds, ONLY : DP
USE constants_epw, ONLY : twopi, ci, cone
USE fft_base, ONLY : dfftp
USE gvect, ONLY : mill, ngm
!
IMPLICIT NONE
@ -34,8 +31,8 @@
!! the number of symmetries of the crystal
INTEGER, INTENT(in) :: s(3,3,48)
!! the symmetry matrices
INTEGER, INTENT(in) :: ftau(3,48)
!! the fractional traslations
REAL(dp), INTENT(in) :: ft(3,48)
!! the fractional traslations in crystal axis
INTEGER, INTENT(in) :: invs(48)
!! inverse symmetry matrix
INTEGER, INTENT(out) :: gmapsym(ngm,48)
@ -101,14 +98,11 @@
!
! now the phase factors e^{iGv}
!
IF ( ftau(1,isym) .ne. 0 .OR. ftau(2,isym) .ne. 0 .OR. ftau(3,isym) .ne. 0 ) THEN
IF ( ft(1,isym)**2 + ft(2,isym)**2 + ft(3,isym)**2 > 1.0d-8 ) THEN
!
! fractional traslation in crystal coord is ftau/nr*
! for cart/crys transform of the G-vecctors have a look at the bottom
!
rdotk = dble( mill(1,ig) * ftau(1,isym) ) / dble(dfftp%nr1) &
+ dble( mill(2,ig) * ftau(2,isym) ) / dble(dfftp%nr2) &
+ dble( mill(3,ig) * ftau(3,isym) ) / dble(dfftp%nr3)
rdotk = dble( mill(1,ig) ) * ft(1,isym) &
+ dble( mill(2,ig) ) * ft(2,isym) &
+ dble( mill(3,ig) ) * ft(3,isym)
!
! the actual translation is -v (have a look at ruota_ijk.f90)
!

View File

@ -2074,8 +2074,8 @@
USE io_epw, ONLY : iufilgap
USE io_files, ONLY : prefix
USE epwcom, ONLY : fsthick
USE eliashbergcom, ONLY : estemp, Agap, nkfs, nbndfs, ef0, ekfs
USE constants_epw, ONLY : kelvin2eV, zero
USE eliashbergcom, ONLY : estemp, Agap, nkfs, nbndfs, ef0, ekfs, w0g
USE constants_epw, ONLY : kelvin2eV, zero, eps5
!
IMPLICIT NONE
!
@ -2099,8 +2099,6 @@
!! Step size in nbin
REAL(DP) :: delta_max
!! Max value of superconducting gap
REAL(DP) :: sigma
!! Variable for smearing
REAL(DP) :: weight
!! Variable for weight
REAL(DP), ALLOCATABLE :: delta_k_bin(:)
@ -2110,8 +2108,8 @@
!
temp = estemp(itemp) / kelvin2eV
!
delta_max = 1.25d0 * maxval(Agap(:,:,itemp))
nbin = int(delta_max/(0.005d0/1000.d0))
delta_max = 1.1d0 * maxval(Agap(:,:,itemp))
nbin = NINT(delta_max / eps5) + 1
dbin = delta_max / dble(nbin)
IF ( .not. ALLOCATED(delta_k_bin) ) ALLOCATE( delta_k_bin(nbin) )
delta_k_bin(:) = zero
@ -2119,11 +2117,9 @@
DO ik = 1, nkfs
DO ibnd = 1, nbndfs
IF ( abs( ekfs(ibnd,ik) - ef0 ) .lt. fsthick ) THEN
DO ibin = 1, nbin
sigma = 1.d0 * dbin
weight = w0gauss( ( Agap(ibnd,ik,itemp) - dble(ibin) * dbin) / sigma, 0 ) / sigma
delta_k_bin(ibin) = delta_k_bin(ibin) + weight
ENDDO
ibin = nint( Agap(ibnd,ik,itemp) / dbin ) + 1
weight = w0g(ibnd,ik)
delta_k_bin(ibin) = delta_k_bin(ibin) + weight
ENDIF
ENDDO
ENDDO

View File

@ -1,12 +1,11 @@
!
! Copyright (C) 2010-2016 Samuel Ponce', Roxana Margine, Carla Verdi, Feliciano Giustino
! Copyright (C) 2016-2018 Samuel Ponce'
! Copyright (C) 2016-2019 Samuel Ponce', Roxana Margine, Feliciano Giustino
!
! This file is distributed under the terms of the GNU General Public
! License. See the file `LICENSE' in the root directory of the
! present distribution, or http://www.gnu.org/copyleft.gpl.txt .
!
!
!-----------------------------------------------------------------------
SUBROUTINE print_ibte( iqq, iq, totq, ef0, efcb, first_cycle, ind_tot, ind_totcb, &
lrepmatw2, lrepmatw4, lrepmatw5, lrepmatw6 )

View File

@ -354,9 +354,17 @@
!! The derivative of wgauss: an approximation to the delta function
REAL(KIND=DP) :: Fi_check(3, nstemp)
!! Sum rule on population
inv_cell = 1.0d0/omega
REAL(KIND=DP) :: sfac
!! Spin factor
!
IF (noncolin) THEN
sfac = 1.0
ELSE
sfac = 2.0
ENDIF
inv_cell = 1.0d0/omega
Fi_check(:,:) = zero
!
! Hole
IF (ncarrier < -1E5) THEN
Sigma(:,:) = zero
@ -398,36 +406,30 @@
ij = ij + 1
! The factor two in the weight at the end is to
! account for spin
IF (noncolin) THEN
tdf_sigma(ij) = tdf_sigma(ij) + ( v_rot(i) * Fi_rot(j) ) * 1.0 / (nkf1*nkf2*nkf3)
!tdf_sigma(ij) = tdf_sigma(ij) + ( v_rot(i) * v_rot(j) ) * 1.0 / (nkf1*nkf2*nkf3)
ELSE
tdf_sigma(ij) = tdf_sigma(ij) + ( v_rot(i) * Fi_rot(j) ) * 2.0 / (nkf1*nkf2*nkf3)
!tdf_sigma(ij) = tdf_sigma(ij) + ( v_rot(i) * v_rot(j) ) * 2.0 / (nkf1*nkf2*nkf3)
ENDIF
tdf_sigma(ij) = tdf_sigma(ij) + ( v_rot(i) * Fi_rot(j) ) * sfac / (nkf1*nkf2*nkf3)
ENDDO
ENDDO
!
Fi_check(:,itemp) = Fi_check(:,itemp) + Fi_rot(:)
Fi_check(:,itemp) = Fi_check(:,itemp) + Fi_rot(:) * sfac / (nkf1*nkf2*nkf3)
ENDIF ! BZ
ENDDO ! ikb
!
! energy at k (relative to Ef)
ekk = etf_all (ibnd, ik ) - ef0(itemp)
!ekk = etf_all (ibnd, ik ) - ef0(itemp)
!
! derivative Fermi distribution
! (-df_nk/dE_nk) = (f_nk)*(1-f_nk)/ (k_B T)
dfnk = w0gauss( ekk / etemp, -99 ) / etemp
!dfnk = w0gauss( ekk / etemp, -99 ) / etemp
!
! electrical conductivity
Sigma(:,itemp) = Sigma(:,itemp) + dfnk * tdf_sigma(:)
Sigma(:,itemp) = Sigma(:,itemp) + tdf_sigma(:)
!Sigma(:,itemp) = Sigma(:,itemp) + dfnk * tdf_sigma(:)
!
ENDIF ! if below Fermi level
ENDDO ! ibnd
ENDDO ! ik
ENDDO ! itemp
!
!CALL mp_sum( Sigma(:,:), world_comm )
!
DO itemp=1, nstemp
etemp = transp_temp(itemp)
@ -447,7 +449,6 @@
!IF (my_pool_id == 0 ) write(990,*)ik, etf_all(1,ik + lower_bnd - 1), carrier_density
!IF (my_pool_id == 1 ) write(991,*)ik, etf_all(1,ik + lower_bnd - 1), carrier_density
ENDDO
!CALL mp_sum( carrier_density, world_comm )
!
sigma_up(:,:) = zero
sigma_up(1,1) = Sigma(1,itemp)
@ -518,29 +519,24 @@
ij = ij + 1
! The factor two in the weight at the end is to
! account for spin
IF (noncolin) THEN
tdf_sigma(ij) = tdf_sigma(ij) + ( v_rot(i) * Fi_rot(j) ) * 1.0 / (nkf1*nkf2*nkf3)
!tdf_sigma(ij) = tdf_sigma(ij) + ( v_rot(i) * v_rot(j) ) * 1.0 / (nkf1*nkf2*nkf3)
ELSE
tdf_sigma(ij) = tdf_sigma(ij) + ( v_rot(i) * Fi_rot(j) ) * 2.0 / (nkf1*nkf2*nkf3)
!tdf_sigma(ij) = tdf_sigma(ij) + ( v_rot(i) * v_rot(j) ) * 2.0 / (nkf1*nkf2*nkf3)
ENDIF
tdf_sigma(ij) = tdf_sigma(ij) + ( v_rot(i) * Fi_rot(j) ) * sfac / (nkf1*nkf2*nkf3)
ENDDO
ENDDO
!
Fi_check(:,itemp) = Fi_check(:,itemp) + Fi_rot(:)
Fi_check(:,itemp) = Fi_check(:,itemp) + Fi_rot(:) * sfac / (nkf1*nkf2*nkf3)
ENDIF ! BZ
ENDDO ! ikb
!
! energy at k (relative to Ef)
ekk = etf_all (ibnd, ik) - ef0(itemp)
!ekk = etf_all (ibnd, ik) - ef0(itemp)
!
! derivative Fermi distribution
! (-df_nk/dE_nk) = (f_nk)*(1-f_nk)/ (k_B T)
dfnk = w0gauss( ekk / etemp, -99 ) / etemp
!dfnk = w0gauss( ekk / etemp, -99 ) / etemp
!
! electrical conductivity
Sigma(:,itemp) = Sigma(:,itemp) + dfnk * tdf_sigma(:)
Sigma(:,itemp) = Sigma(:,itemp) + tdf_sigma(:)
!Sigma(:,itemp) = Sigma(:,itemp) + dfnk * tdf_sigma(:)
!
ENDIF ! if below Fermi level
ENDDO ! ibnd
@ -683,10 +679,16 @@
!! Compute the approximate theta function. Here computes Fermi-Dirac
REAL(KIND=DP), EXTERNAL :: w0gauss
!! The derivative of wgauss: an approximation to the delta function
REAL(KIND=DP) :: sfac
!! Spin factor
!
inv_cell = 1.0d0/omega
Fi_check(:,:) = zero
IF (noncolin) THEN
sfac = 1.0
ELSE
sfac = 2.0
ENDIF
!
! Hole
IF (ncarrier < -1E5) THEN
@ -710,17 +712,17 @@
tdf_sigma(ij) = vkk_all(i, ibnd, ik) * F_SERTA(j, ibnd, ik, itemp) * wkf_all(ik)
ENDDO
ENDDO
Fi_check(:,itemp) = Fi_check(:,itemp) + F_SERTA(:, ibnd, ik, itemp)
Fi_check(:,itemp) = Fi_check(:,itemp) + F_SERTA(:, ibnd, ik, itemp) * sfac / (nkf1*nkf2*nkf3)
!
! energy at k (relative to Ef)
ekk = etf_all (ibnd, ik ) - ef0(itemp)
!ekk = etf_all (ibnd, ik ) - ef0(itemp)
!
! derivative Fermi distribution
! (-df_nk/dE_nk) = (f_nk)*(1-f_nk)/ (k_B T)
dfnk = w0gauss( ekk / etemp, -99 ) / etemp
!dfnk = w0gauss( ekk / etemp, -99 ) / etemp
!
! electrical conductivity
Sigma(:,itemp) = Sigma(:,itemp) + dfnk * tdf_sigma(:)
Sigma(:,itemp) = Sigma(:,itemp) + tdf_sigma(:)
!
ENDIF ! if below Fermi level
ENDDO ! ibnd
@ -801,17 +803,17 @@
tdf_sigma(ij) = vkk_all(i, ibnd, ik) * F_SERTA(j, ibnd, ik, itemp) * wkf_all(ik)
ENDDO
ENDDO
Fi_check(:,itemp) = Fi_check(:,itemp) + F_SERTA(:, ibnd, ik, itemp)
Fi_check(:,itemp) = Fi_check(:,itemp) + F_SERTA(:, ibnd, ik, itemp) * sfac / (nkf1*nkf2*nkf3)
!
! energy at k (relative to Ef)
ekk = etf_all (ibnd, ik) - ef0(itemp)
!ekk = etf_all (ibnd, ik) - ef0(itemp)
!
! derivative Fermi distribution
! (-df_nk/dE_nk) = (f_nk)*(1-f_nk)/ (k_B T)
dfnk = w0gauss( ekk / etemp, -99 ) / etemp
!dfnk = w0gauss( ekk / etemp, -99 ) / etemp
!
! electrical conductivity
Sigma(:,itemp) = Sigma(:,itemp) + dfnk * tdf_sigma(:)
Sigma(:,itemp) = Sigma(:,itemp) + tdf_sigma(:)
!
ENDIF ! if below Fermi level
ENDDO ! ibnd
@ -983,9 +985,15 @@
!! Compute the approximate theta function. Here computes Fermi-Dirac
REAL(KIND=DP), EXTERNAL :: w0gauss
!! The derivative of wgauss: an approximation to the delta function
Fi_check(:,:) = zero
REAL(KIND=DP) :: sfac
!! Spin factor
!
IF (noncolin) THEN
sfac = 1.0
ELSE
sfac = 2.0
ENDIF
Fi_check(:,:) = zero
inv_cell = 1.0d0/omega
!
IF (ncarrier < -1E5) THEN ! If true print hole
@ -1028,33 +1036,29 @@
ij = ij + 1
! The factor two in the weight at the end is to
! account for spin
IF (noncolin) THEN
tdf_sigma(ij) = tdf_sigma(ij) + ( v_rot(i) * Fi_rot(j) ) * 1.0 / (nkf1*nkf2*nkf3)
ELSE
tdf_sigma(ij) = tdf_sigma(ij) + ( v_rot(i) * Fi_rot(j) ) * 2.0 / (nkf1*nkf2*nkf3)
ENDIF
tdf_sigma(ij) = tdf_sigma(ij) + ( v_rot(i) * Fi_rot(j) ) * sfac / (nkf1*nkf2*nkf3)
ENDDO
ENDDO
!
Fi_check(:,itemp) = Fi_check(:,itemp) + Fi_rot(:)
Fi_check(:,itemp) = Fi_check(:,itemp) + Fi_rot(:) * sfac / (nkf1*nkf2*nkf3)
ENDIF ! BZ
ENDDO ! ikb
!
! energy at k (relative to Ef)
ekk = etf_all (ibnd, ik) - ef0(itemp)
!ekk = etf_all (ibnd, ik) - ef0(itemp)
!
! derivative Fermi distribution
! (-df_nk/dE_nk) = (f_nk)*(1-f_nk)/ (k_B T)
dfnk = w0gauss( ekk / etemp, -99 ) / etemp
!dfnk = w0gauss( ekk / etemp, -99 ) / etemp
!
! electrical conductivity
Sigma(:,itemp) = Sigma(:,itemp) + dfnk * tdf_sigma(:)
Sigma(:,itemp) = Sigma(:,itemp) + tdf_sigma(:)
!
ENDIF ! if below Fermi level
ENDDO ! ibnd
ENDDO ! ik
ENDDO ! itemp
!CALL mp_sum( Sigma(:,:), world_comm )
!
DO itemp=1, nstemp
etemp = transp_temp(itemp)
carrier_density = 0.0
@ -1144,27 +1148,23 @@
ij = ij + 1
! The factor two in the weight at the end is to
! account for spin
IF (noncolin) THEN
tdf_sigma(ij) = tdf_sigma(ij) + ( v_rot(i) * Fi_rot(j) ) * 1.0 / (nkf1*nkf2*nkf3)
ELSE
tdf_sigma(ij) = tdf_sigma(ij) + ( v_rot(i) * Fi_rot(j) ) * 2.0 / (nkf1*nkf2*nkf3)
ENDIF
tdf_sigma(ij) = tdf_sigma(ij) + ( v_rot(i) * Fi_rot(j) ) * sfac / (nkf1*nkf2*nkf3)
ENDDO
ENDDO
!
Fi_check(:,itemp) = Fi_check(:,itemp) + Fi_rot(:)
Fi_check(:,itemp) = Fi_check(:,itemp) + Fi_rot(:) * sfac / (nkf1*nkf2*nkf3)
ENDIF ! BZ
ENDDO ! ikb
!
! energy at k (relative to Ef)
ekk = etf_all (ibnd, ik) - ef0(itemp)
!ekk = etf_all (ibnd, ik) - ef0(itemp)
!
! derivative Fermi distribution
! (-df_nk/dE_nk) = (f_nk)*(1-f_nk)/ (k_B T)
dfnk = w0gauss( ekk / etemp, -99 ) / etemp
!dfnk = w0gauss( ekk / etemp, -99 ) / etemp
!
! electrical conductivity
Sigma(:,itemp) = Sigma(:,itemp) + dfnk * tdf_sigma(:)
Sigma(:,itemp) = Sigma(:,itemp) + tdf_sigma(:)
!
ENDIF ! if below Fermi level
ENDDO ! ibnd
@ -1312,9 +1312,16 @@
!! Compute the approximate theta function. Here computes Fermi-Dirac
REAL(KIND=DP), EXTERNAL :: w0gauss
!! The derivative of wgauss: an approximation to the delta function
Fi_check(:,:) = zero
REAL(KIND=DP) :: sfac
!! Spin factor
!
IF (noncolin) THEN
sfac = 1.0
ELSE
sfac = 2.0
ENDIF
!
Fi_check(:,:) = zero
inv_cell = 1.0d0/omega
!
IF (ncarrier < -1E5) THEN ! If true print hole
@ -1337,17 +1344,18 @@
tdf_sigma(ij) = vkk_all(i, ibnd, ik) * F_out(j, ibnd, ik, itemp) * wkf_all(ik)
ENDDO
ENDDO
Fi_check(:,itemp) = Fi_check(:,itemp) + F_out(:, ibnd, ik, itemp)
Fi_check(:,itemp) = Fi_check(:,itemp) + F_out(:, ibnd, ik, itemp) * sfac / (nkf1*nkf2*nkf3)
!
! energy at k (relative to Ef)
ekk = etf_all (ibnd, ik) - ef0(itemp)
!ekk = etf_all (ibnd, ik) - ef0(itemp)
!
! derivative Fermi distribution
! (-df_nk/dE_nk) = (f_nk)*(1-f_nk)/ (k_B T)
dfnk = w0gauss( ekk / etemp, -99 ) / etemp
!dfnk = w0gauss( ekk / etemp, -99 ) / etemp
!
! electrical conductivity
Sigma(:,itemp) = Sigma(:,itemp) + dfnk * tdf_sigma(:)
!Sigma(:,itemp) = Sigma(:,itemp) + dfnk * tdf_sigma(:)
Sigma(:,itemp) = Sigma(:,itemp) + tdf_sigma(:)
!
ENDIF ! if below Fermi level
ENDDO ! ibnd
@ -1425,17 +1433,17 @@
tdf_sigma(ij) = vkk_all(i, ibnd, ik) * F_out(j, ibnd, ik, itemp) * wkf_all(ik)
ENDDO
ENDDO
Fi_check(:,itemp) = Fi_check(:,itemp) + F_out(:, ibnd, ik, itemp)
Fi_check(:,itemp) = Fi_check(:,itemp) + F_out(:, ibnd, ik, itemp) * sfac / (nkf1*nkf2*nkf3)
!
! energy at k (relative to Ef)
ekk = etf_all (ibnd, ik) - ef0(itemp)
!ekk = etf_all (ibnd, ik) - ef0(itemp)
!
! derivative Fermi distribution
! (-df_nk/dE_nk) = (f_nk)*(1-f_nk)/ (k_B T)
dfnk = w0gauss( ekk / etemp, -99 ) / etemp
!dfnk = w0gauss( ekk / etemp, -99 ) / etemp
!
! electrical conductivity
Sigma(:,itemp) = Sigma(:,itemp) + dfnk * tdf_sigma(:)
Sigma(:,itemp) = Sigma(:,itemp) + tdf_sigma(:)
!
ENDIF ! if below Fermi level
ENDDO ! ibnd

View File

@ -329,13 +329,13 @@
wgkq = wgauss( -ekq*inv_eptemp0, -99)
!
! = k-point weight * [f(E_k) - f(E_k+q)]/ [E_k+q - E_k -w_q + id]
! This is the imaginary part of the phonon self-energy, sans
! This is the imaginary part of minus the phonon self-energy, sans
! the matrix elements
!
!weight = wkf (ikk) * (wgkk - wgkq) * &
! aimag ( cone / ( ekq - ekk - wq - ci * degaussw0 ) )
!
! SP: The expression below (phonon self-energy) corresponds to
! SP: The expression below (minus phonon self-energy) corresponds to
! = pi*k-point weight*[f(E_k) - f(E_k+q)]*delta[E_k+q - E_k - w_q]
weight = pi * wkf (ikk) * (wgkk - wgkq)* &
w0gauss ( (ekq - ekk - wq) / degaussw0, 0) / degaussw0

View File

@ -33,9 +33,7 @@
wmax_specfun, nw_specfun
USE pwcom, ONLY : nelec, ef, isk
USE elph2, ONLY : epf17, ibndmax, ibndmin, etf, &
wkf, xqf, nkqf, &
nkf, wf, a_all, &
gammai_all,gammar_all, efnew
wkf, xqf, nkqf, nkf, wf, a_all, efnew
USE constants_epw, ONLY : ryd2mev, ryd2ev, two, zero, pi, cone, ci, eps8
USE mp_world, ONLY : mpime
USE mp, ONLY : mp_barrier, mp_sum
@ -64,8 +62,6 @@
!! Counter on mode
INTEGER :: fermicount
!! Number of states on the Fermi surface
INTEGER :: ismear
!! Smearing index
INTEGER :: iw
!! Counter on frequency for the phonon spectra
!
@ -85,13 +81,9 @@
!! Self-energy factor
REAL(kind=DP) :: dosef
!! Density of state N(Ef)
REAL(kind=DP) :: degaussw0
!! Gaussian smearing parameter
REAL(kind=DP) :: inv_degaussw0
REAL(kind=DP) :: inv_degaussw
!! Inverse Gaussian for efficiency reasons
REAL(kind=DP) :: eptemp0
!! Temperature
REAL(kind=DP) :: inv_eptemp0
REAL(kind=DP) :: inv_eptemp
!! Inverse temperature
REAL(kind=DP) :: inv_wq
!! $frac{1}{2\omega_{q\nu}}$ defined for efficiency reasons
@ -114,8 +106,14 @@
REAL(kind=DP), external :: w0gauss
!! This function computes the derivative of the Fermi-Dirac function
!! It is therefore an approximation for a delta function
REAL(kind=DP) :: gammai_all(nw_specfun, nmodes)
!! Imaginary part of the frequency dependent spectral function
REAL(kind=DP) :: gammar_all(nw_specfun, nmodes)
!! Real part of the Phonon self-energy (freq. dependent for spectral function)
!
dw = ( wmax_specfun - wmin_specfun ) / dble (nw_specfun-1)
gammar_all(:,:) = zero
gammai_all(:,:) = zero
!
! Thomas-Fermi screening according to Resta PRB 1977
! Here specific case of Diamond
@ -135,233 +133,217 @@
'Fermi Surface thickness = ', fsthick * ryd2ev, ' eV'
WRITE(stdout, '(/5x,a,f10.6,a)' ) &
'Golden Rule strictly enforced with T = ',eptemp * ryd2ev, ' eV'
!
IF ( .not. ALLOCATED (gammai_all) ) ALLOCATE( gammai_all (nmodes, totq, nw_specfun) )
IF ( .not. ALLOCATED (gammar_all) ) ALLOCATE( gammar_all (nmodes, totq, nw_specfun) )
gammar_all(:,:,:) = zero
gammai_all(:,:,:) = zero
!
ENDIF
!
DO ismear = 1, nsmear
!
degaussw0 = (ismear-1) * delta_smear + degaussw
eptemp0 = (ismear-1) * delta_smear + eptemp
!
! SP: Multiplication is faster than division ==> Important if called a lot
! in inner loops
inv_degaussw0 = 1.0/degaussw0
inv_eptemp0 = 1.0/eptemp0
!
! Fermi level and corresponding DOS
!
IF ( efermi_read ) THEN
!
ef0 = fermi_energy
!
ELSE IF (nsmear > 1) THEN
!
ef0 = efermig(etf,nbndsub,nkqf,nelec,wkf,degaussw0,ngaussw,0,isk)
! if some bands are skipped (nbndskip.neq.0), nelec has already been
! recalculated in ephwann_shuffle
!
ELSE !SP: This is added for efficiency reason because the efermig routine is slow
ef0 = efnew
ENDIF
!
dosef = dos_ef (ngaussw, degaussw0, ef0, etf, wkf, nkqf, nbndsub)
! N(Ef) in the equation for lambda is the DOS per spin
dosef = dosef / two
!
IF ( iq .eq. 1 ) THEN
WRITE (stdout, 100) degaussw0 * ryd2ev, ngaussw
WRITE (stdout, 101) dosef / ryd2ev, ef0 * ryd2ev
ENDIF
!
CALL start_clock('PH SPECTRAL-FUNCTIO')
!
fermicount = 0
gamma0(:) = zero
!
DO ik = 1, nkf
ikk = 2 * ik - 1
ikq = ikk + 1
!
! Here we must have ef, not ef0, to be consistent with ephwann_shuffle
IF ( ( minval ( abs(etf (:, ikk) - ef) ) .lt. fsthick ) .AND. &
( minval ( abs(etf (:, ikq) - ef) ) .lt. fsthick ) ) THEN
!
fermicount = fermicount + 1
!
DO imode = 1, nmodes
!
! the phonon frequency
wq = wf (imode, iq)
!
! SP : We should avoid branching statements (if statements) in
! innerloops. Therefore we do it here.
inv_wq = 1.0/(two * wq)
! the coupling from Gamma acoustic phonons is negligible
IF ( wq .gt. eps_acustic ) THEN
g2_tmp = 1.0
ELSE
g2_tmp = 0.0
ENDIF
!
DO ibnd = 1, ibndmax-ibndmin+1
!
! the fermi occupation for k
ekk = etf (ibndmin-1+ibnd, ikk) - ef0
wgkk = wgauss( -ekk*inv_eptemp0, -99)
!w0g1 = w0gauss ( ekk / degaussw0, 0) / degaussw0
!
DO jbnd = 1, ibndmax-ibndmin+1
!
! the fermi occupation for k+q
ekq = etf (ibndmin-1+jbnd, ikq) - ef0
wgkq = wgauss( -ekq*inv_eptemp0, -99)
!w0g2 = w0gauss ( ekq / degaussw0, 0) / degaussw0
!
! here we take into account the zero-point sqrt(hbar/2M\omega)
! with hbar = 1 and M already contained in the eigenmodes
! g2 is Ry^2, wkf must already account for the spin factor
!
IF ( shortrange .AND. ( abs(xqf (1, iq))> eps8 .OR. abs(xqf (2, iq))> eps8 &
.OR. abs(xqf (3, iq))> eps8 )) THEN
! SP: The abs has to be removed. Indeed the epf17 can be a pure imaginary
! number, in which case its square will be a negative number.
g2 = REAL( (epf17 (jbnd, ibnd, imode, ik)**two)*inv_wq*g2_tmp ) !* epsTF
ELSE
g2 = (abs(epf17 (jbnd, ibnd, imode, ik))**two)*inv_wq*g2_tmp !* epsTF
ENDIF
!
! = k-point weight * [f(E_k) - f(E_k+q)]/ [E_k+q - E_k -w_q +id]
! This is the imaginary part of the phonon self-energy, sans the matrix elements
!
!weight = wkf (ikk) * (wgkk - wgkq) * &
! aimag ( cone / ( ekq - ekk - wq - ci * degaussw0 ) )
!
! SP: The expression below (phonon self-energy) corresponds to
! = pi*k-point weight*[f(E_k) - f(E_k+q)]*delta[E_k+q - E_k -w_q]
!
weight = wkf (ikk) * (wgkk - wgkq) * &
real ( cone / ( ekq - ekk + ci * degaussw0 ))
!
gamma0 ( imode ) = gamma0 ( imode ) + weight * g2
!
DO iw = 1, nw_specfun
!
ww = wmin_specfun + dble (iw-1) * dw
!
weight = wkf (ikk) * (wgkk - wgkq) * &
real ( cone / ( ekq - ekk - ww + ci * degaussw0 ))
gammar_all (imode,iq,iw) = gammar_all (imode,iq,iw) + weight * g2
!
! Normal implementation
!weight = wkf (ikk) * (wgkk - wgkq) * &
! aimag ( cone / ( ekq - ekk - ww + ci * degaussw0 ) )
!
! More stable:
! Analytical im. part
weight = pi * wkf (ikk) * (wgkk - wgkq) * &
w0gauss ( (ekq - ekk - ww) / degaussw0, 0) / degaussw0
!
gammai_all (imode,iq,iw) = gammai_all(imode,iq,iw)+ weight * g2
!
ENDDO
!
ENDDO ! jbnd
!
ENDDO ! ibnd
!
ENDDO ! loop on q-modes
!
ENDIF ! endif fsthick
!
ENDDO ! loop on k
!
CALL stop_clock('PH SPECTRAL-FUNCTION')
!
!
! SP: Multiplication is faster than division ==> Important if called a lot
! in inner loops
inv_degaussw = 1.0/degaussw
inv_eptemp = 1.0/eptemp
!
! Fermi level and corresponding DOS
!
IF ( efermi_read ) THEN
!
ef0 = fermi_energy
!
ELSE IF (nsmear > 1) THEN
!
ef0 = efermig(etf,nbndsub,nkqf,nelec,wkf,degaussw,ngaussw,0,isk)
! if some bands are skipped (nbndskip.neq.0), nelec has already been
! recalculated in ephwann_shuffle
!
ELSE !SP: This is added for efficiency reason because the efermig routine is slow
ef0 = efnew
ENDIF
!
dosef = dos_ef (ngaussw, degaussw, ef0, etf, wkf, nkqf, nbndsub)
! N(Ef) in the equation for lambda is the DOS per spin
dosef = dosef / two
!
IF ( iqq .eq. 1 ) THEN
WRITE (stdout, 100) degaussw * ryd2ev, ngaussw
WRITE (stdout, 101) dosef / ryd2ev, ef0 * ryd2ev
ENDIF
!
CALL start_clock('PH SPECTRAL-FUNCTION')
!
fermicount = 0
gamma0(:) = zero
!
DO ik = 1, nkf
ikk = 2 * ik - 1
ikq = ikk + 1
!
! Here we must have ef, not ef0, to be consistent with ephwann_shuffle
IF ( ( minval ( abs(etf (:, ikk) - ef) ) .lt. fsthick ) .AND. &
( minval ( abs(etf (:, ikq) - ef) ) .lt. fsthick ) ) THEN
!
fermicount = fermicount + 1
!
DO imode = 1, nmodes
!
! the phonon frequency
wq = wf (imode, iq)
!
! SP : We should avoid branching statements (if statements) in
! innerloops. Therefore we do it here.
inv_wq = 1.0/(two * wq)
! the coupling from Gamma acoustic phonons is negligible
IF ( wq .gt. eps_acustic ) THEN
g2_tmp = 1.0
ELSE
g2_tmp = 0.0
ENDIF
!
DO ibnd = 1, ibndmax-ibndmin+1
!
! the fermi occupation for k
ekk = etf (ibndmin-1+ibnd, ikk) - ef0
wgkk = wgauss( -ekk*inv_eptemp, -99)
!w0g1 = w0gauss ( ekk / degaussw0, 0) / degaussw0
!
DO jbnd = 1, ibndmax-ibndmin+1
!
! the fermi occupation for k+q
ekq = etf (ibndmin-1+jbnd, ikq) - ef0
wgkq = wgauss( -ekq*inv_eptemp, -99)
!w0g2 = w0gauss ( ekq / degaussw0, 0) / degaussw0
!
! here we take into account the zero-point sqrt(hbar/2M\omega)
! with hbar = 1 and M already contained in the eigenmodes
! g2 is Ry^2, wkf must already account for the spin factor
!
IF ( shortrange .AND. ( abs(xqf (1, iq))> eps8 .OR. abs(xqf (2, iq))> eps8 &
.OR. abs(xqf (3, iq))> eps8 )) THEN
! SP: The abs has to be removed. Indeed the epf17 can be a pure imaginary
! number, in which case its square will be a negative number.
g2 = REAL( (epf17 (jbnd, ibnd, imode, ik)**two)*inv_wq*g2_tmp ) !* epsTF
ELSE
g2 = (abs(epf17 (jbnd, ibnd, imode, ik))**two)*inv_wq*g2_tmp !* epsTF
ENDIF
!
! SP - 03/2019 - Retarded phonon self-energy
! See Eq. 145 of RMP 89, 015003 (2017)
! \Pi^R = k-point weight * [ [f(E_k+q) - f(E_k)]/ [E_k+q - E_k -w_q - id]
! -[f(E_k+q) - f(E_k)]/ [E_k+q - E_k - id] ]
! The second term is gamma0 (static)
!
weight = wkf (ikk) * (wgkq - wgkk) * &
REAL ( cone / ( ekq - ekk + ci * degaussw ))
!
gamma0 ( imode ) = gamma0 ( imode ) + weight * g2
!
DO iw = 1, nw_specfun
!
ww = wmin_specfun + dble (iw-1) * dw
!
weight = wkf (ikk) * (wgkq - wgkk) * &
REAL ( cone / ( ekq - ekk - ww + ci * degaussw ))
gammar_all (iw, imode) = gammar_all (iw, imode) + weight * g2
!
! Normal implementation
!weight = wkf (ikk) * (wgkq - wgkk) * &
! aimag ( cone / ( ekq - ekk - ww + ci * degaussw0 ) )
!
! More stable:
! Analytical im. part
weight = pi * wkf (ikk) * (wgkq - wgkk) * &
w0gauss ( (ekq - ekk - ww) / degaussw, 0) / degaussw
!
gammai_all (iw, imode) = gammai_all(iw, imode) + weight * g2
!
ENDDO
!
ENDDO ! jbnd
!
ENDDO ! ibnd
!
ENDDO ! loop on q-modes
!
ENDIF ! endif fsthick
!
ENDDO ! loop on k
!
CALL stop_clock('PH SPECTRAL-FUNCTION')
!
#if defined(__MPI)
!
! collect contributions from all pools (sum over k-points)
! this finishes the integral over the BZ (k)
!
CALL mp_sum(gammai_all,inter_pool_comm)
CALL mp_sum(gammar_all,inter_pool_comm)
CALL mp_sum(gamma0,inter_pool_comm)
CALL mp_sum(fermicount, inter_pool_comm)
CALL mp_barrier(inter_pool_comm)
!
!
! collect contributions from all pools (sum over k-points)
! this finishes the integral over the BZ (k)
!
CALL mp_sum(gammai_all,inter_pool_comm)
CALL mp_sum(gammar_all,inter_pool_comm)
CALL mp_sum(gamma0,inter_pool_comm)
CALL mp_sum(fermicount, inter_pool_comm)
CALL mp_barrier(inter_pool_comm)
!
#endif
!
WRITE(stdout,'(5x,a)')
IF (.not. ALLOCATED (a_all)) ALLOCATE ( a_all(nw_specfun, totq) )
a_all(:,:) = zero
!
IF (iqq == 1 ) THEN
IF (mpime.eq.ionode_id) THEN
OPEN(unit=iospectral,file='specfun.phon')
OPEN(unit=iospectral_sup,file='specfun_sup.phon')
WRITE(iospectral, '(/2x,a)') '#Phonon spectral function (meV)'
WRITE(iospectral_sup, '(2x,a)') '#Phonon eigenenergies + real and im part of phonon self-energy (meV)'
WRITE(iospectral, '(/2x,a)') '#K-point Energy[eV] A(q,w)[meV^-1]'
WRITE(iospectral_sup, '(2x,a)') '#Q-point Mode w_q[eV] w[eV] &
& Real Sigma(w)[meV] Im Sigma(w=0)[meV] Im Sigma(w)[meV]'
WRITE(stdout,'(/5x,a)') 'Real and Imaginary part of the phonon self-energy (omega=0).'
ENDIF
ENDIF
!
! Write to output file
!WRITE(stdout,'(/5x,"iq = ",i7," coord.: ", 3f12.7)') iq, xqf(:,iq)
DO imode = 1, nmodes
wq = wf (imode, iq)
! Real and Im part of Phonon self-energy at 0 freq.
WRITE(stdout,105) imode, ryd2ev * wq, ryd2mev * gammar_all(imode,iq,1), ryd2mev * gammai_all(imode,iq,1)
ENDDO
WRITE( stdout, '(5x,a,i8,a,i8)' ) &
'Number of (k,k+q) pairs on the Fermi surface: ',fermicount, ' out of ', totq
!
! Write to support files
DO iw = 1, nw_specfun
!
ww = wmin_specfun + dble (iw-1) * dw
!
DO imode = 1, nmodes
!
wq = wf (imode, iq)
!a_all(iw,iq) = a_all(iw,iq) + abs( gammai_all(imode,iq,iw) ) / pi / &
! ( ( ww - wq - gammar_all (imode,iq,iw) + gamma0 (imode))**two + (gammai_all(imode,iq,iw) )**two )
! SP: From Eq. 16 of PRB 9, 4733 (1974)
! Also in Eq.2 of PRL 119, 017001 (2017).
a_all(iw,iq) = a_all(iw,iq) + ((2*wq)**2) * abs( gammai_all(imode,iq,iw) ) / pi / &
( ( ww**2 - wq**2 - 2 * wq * ( gammar_all (imode,iq,iw) - gamma0 (imode) ) )**two +&
(2 * wq * gammai_all(imode,iq,iw) )**two )
!
IF (mpime.eq.ionode_id) THEN
WRITE(iospectral_sup,'(2i9,2x,f12.5,2x,f12.5,2x,E22.14,2x,E22.14,2x,E22.14)') iq,&
imode, ryd2ev * wq, ryd2ev * ww, ryd2mev * gammar_all(imode,iq,iw), ryd2mev * gamma0(imode),&
ryd2mev * gammai_all(imode,iq,iw)
ENDIF
!
ENDDO
!
IF (mpime.eq.ionode_id) THEN
WRITE(iospectral,'(2x,i7,2x,f12.5,2x,E22.14)') iq, ryd2ev * ww, a_all(iw,iq) / ryd2mev ! print to file
ENDIF
!
ENDDO
!
IF (iqq == totq ) THEN
IF (mpime == ionode_id) THEN
CLOSE(iospectral)
CLOSE(iospectral_sup)
ENDIF
ENDIF
WRITE(stdout,'(5x,a/)') repeat('-',67)
!
ENDDO !smears
!
WRITE(stdout,'(5x,a)')
IF (.not. ALLOCATED (a_all)) ALLOCATE ( a_all(nw_specfun, totq) )
a_all(:,iqq) = zero
!
IF (iqq == 1 ) THEN
IF (mpime.eq.ionode_id) THEN
OPEN(unit=iospectral,file='specfun.phon')
OPEN(unit=iospectral_sup,file='specfun_sup.phon')
WRITE(iospectral, '(/2x,a)') '#Phonon spectral function (meV)'
WRITE(iospectral_sup, '(2x,a)') '#Phonon eigenenergies + real and im part of phonon self-energy (meV)'
WRITE(iospectral, '(/2x,a)') '#Q-point Energy[eV] A(q,w)[meV^-1]'
WRITE(iospectral_sup, '(2x,a)') '#Q-point Mode w_q[eV] w[eV] &
& Real Sigma(w)[meV] Real Sigma(w=0)[meV] Im Sigma(w)[meV]'
ENDIF
ENDIF
!
! Write to output file
!WRITE(stdout,'(/5x,"iq = ",i7," coord.: ", 3f12.7)') iq, xqf(:,iq)
WRITE(stdout,'(/5x,a)') 'Real and Imaginary part of the phonon self-energy (omega=0) without gamma0.'
DO imode = 1, nmodes
wq = wf (imode, iq)
! Real and Im part of Phonon self-energy at 0 freq.
WRITE(stdout,105) imode, ryd2ev * wq, ryd2mev * gammar_all(1,imode), ryd2mev * gammai_all(1,imode)
ENDDO
WRITE( stdout, '(5x,a,i8,a,i8)' ) &
'Number of (k,k+q) pairs on the Fermi surface: ',fermicount, ' out of ', totq
!
! Write to support files
DO iw = 1, nw_specfun
!
ww = wmin_specfun + dble (iw-1) * dw
!
DO imode = 1, nmodes
!
wq = wf (imode, iq)
!a_all(iw,iq) = a_all(iw,iq) + abs( gammai_all(imode,iq,iw) ) / pi / &
! ( ( ww - wq - gammar_all (imode,iq,iw) + gamma0 (imode))**two + (gammai_all(imode,iq,iw) )**two )
! SP: From Eq. 16 of PRB 9, 4733 (1974)
! Also in Eq.2 of PRL 119, 017001 (2017).
a_all(iw,iqq) = a_all(iw,iqq) + (1.0d0/pi) * ((2*wq)**2) * ABS( gammai_all(iw, imode) ) / &
( ( ww**2 - wq**2 - 2 * wq * ( gammar_all (iw, imode) - gamma0 (imode) ) )**two +&
(2 * wq * gammai_all(iw, imode) )**two )
!
IF (mpime.eq.ionode_id) THEN
WRITE(iospectral_sup,'(2i9,2x,f12.5,2x,f12.5,2x,E22.14,2x,E22.14,2x,E22.14)') iq,&
imode, ryd2ev * wq, ryd2ev * ww, ryd2mev * gammar_all(iw, imode), ryd2mev * gamma0(imode),&
ryd2mev * gammai_all(iw, imode)
ENDIF
!
ENDDO
!
IF (mpime.eq.ionode_id) THEN
WRITE(iospectral,'(2x,i7,2x,f12.5,2x,E22.14)') iq, ryd2ev * ww, a_all(iw,iqq) / ryd2mev ! print to file
ENDIF
!
ENDDO
!
IF (iqq == totq ) THEN
IF (mpime == ionode_id) THEN
CLOSE(iospectral)
CLOSE(iospectral_sup)
ENDIF
ENDIF
WRITE(stdout,'(5x,a/)') repeat('-',67)
!
100 FORMAT(5x,'Gaussian Broadening: ',f10.6,' eV, ngauss=',i4)
101 FORMAT(5x,'DOS =',f10.6,' states/spin/eV/Unit Cell at Ef=',f10.6,' eV')

View File

@ -1423,7 +1423,7 @@
degaussw, nkf1, nkf2, nkf3
USE eliashbergcom, ONLY : nkfs, nbndfs, g2, ixkqf, ixqfs, nqfs, w0g, ekfs, ef0, dosef, wsph, &
wkfs, dwsph, a2f_iso, ixkff
USE constants_epw, ONLY : ryd2ev
USE constants_epw, ONLY : ryd2ev, eps2, zero, eps16
USE io_global, ONLY : ionode_id
USE mp_global, ONLY : inter_pool_comm, my_pool_id, npool
USE mp_world, ONLY : mpime
@ -1599,23 +1599,25 @@
IF ( ALLOCATED(a2f) ) DEALLOCATE( a2f )
IF ( ALLOCATED(a2f_modeproj) ) DEALLOCATE( a2f_modeproj )
!
nbink = int( 1.25d0 * maxval(lambda_k(:,:)) / 0.005d0 )
dbink = 1.25d0 * maxval(lambda_k(:,:)) / dble(nbink)
nbink = NINT( 1.1d0 * MAXVAL(lambda_k(:,:)) / eps2 ) + 1
dbink = 1.1d0 * MAXVAL(lambda_k(:,:)) / DBLE(nbink)
!
IF ( .not. ALLOCATED(lambda_k_bin) ) ALLOCATE ( lambda_k_bin(nbink) )
lambda_k_bin(:) = 0.d0
lambda_k_bin(:) = zero
!
!SP : Should be initialized
nbin = 0
dbin = 0.0_DP
dbin = zero
!
IF ( iverbosity == 2 ) THEN
nbin = int( 1.25d0 * maxval(lambda_max(:)) / 0.005d0 )
dbin = 1.25d0 * maxval(lambda_max(:)) / dble(nbin)
IF ( .not. ALLOCATED(lambda_pairs) ) ALLOCATE ( lambda_pairs(nbin) )
lambda_pairs(:) = 0.d0
nbin = nint( 1.1d0 * MAXVAL(lambda_max(:)) / eps2 ) + 1
dbin = 1.1d0 * MAXVAL(lambda_max(:)) / dble(nbin)
IF ( .not. ALLOCATED(lambda_pairs) ) ALLOCATE ( lambda_pairs(nbin) )
lambda_pairs(:) = zero
ENDIF
!
WRITE(stdout,'(5x,a13,f21.7,a18,f21.7)') 'lambda_max = ', maxval(lambda_max(:)), ' lambda_k_max = ', maxval(lambda_k(:,:))
WRITE(stdout,'(5x,a13,f21.7,a18,f21.7)') 'lambda_max = ', maxval(lambda_max(:)), &
' lambda_k_max = ', maxval(lambda_k(:,:))
WRITE(stdout,'(a)') ' '
!
lambda_k(:,:) = 0.d0
@ -1631,20 +1633,16 @@
CALL lambdar_aniso_ver1( ik, iq, ibnd, jbnd, 0.d0, lambda_eph )
lambda_k(ik,ibnd) = lambda_k(ik,ibnd) + weight * lambda_eph
IF ( iverbosity == 2 ) THEN
DO ibin = 1, nbin
sigma = 1.d0 * dbin
weight = w0gauss( ( lambda_eph - dble(ibin) * dbin ) / sigma, 0 ) / sigma
lambda_pairs(ibin) = lambda_pairs(ibin) + weight
ENDDO
ibin = NINT( lambda_eph / dbin ) + 1
weight = w0g(ibnd,ik) * w0g(jbnd,ixkqf(ik,iq0))
lambda_pairs(ibin) = lambda_pairs(ibin) + weight
ENDIF
ENDIF
ENDDO ! jbnd
ENDDO ! iq
DO ibin = 1, nbink
sigma = 1.d0 * dbink
weight = w0gauss( ( lambda_k(ik,ibnd) - dble(ibin) * dbink ) / sigma, 0 ) / sigma
lambda_k_bin(ibin) = lambda_k_bin(ibin) + weight
ENDDO
ibin = NINT( lambda_k(ik,ibnd) / dbink ) + 1
weight = w0g(ibnd,ik)
lambda_k_bin(ibin) = lambda_k_bin(ibin) + weight
ENDIF
ENDDO ! ibnd
ENDDO ! ik
@ -1676,7 +1674,7 @@
OPEN(unit = iufillambda, file = TRIM(prefix)//".lambda_k_pairs", form = 'formatted')
WRITE(iufillambda,'(a12,a30)') '# lambda_nk',' \rho(lambda_nk) scaled to 1'
DO ibin = 1, nbink
WRITE(iufillambda,'(2f21.7)') dbink*dble(ibin), lambda_k_bin(ibin)/maxval(lambda_k_bin(:))
WRITE(iufillambda,'(2f21.7)') dbink*dble(ibin), lambda_k_bin(ibin)/MAXVAL(lambda_k_bin(:))
ENDDO
CLOSE(iufillambda)
!
@ -1761,9 +1759,4 @@
!
END SUBROUTINE evaluate_a2f_lambda
!
!
END MODULE superconductivity_aniso

View File

@ -1,6 +1,6 @@
!
! Copyright (C) 2010-2016 Samuel Ponce', Roxana Margine, Carla Verdi, Feliciano Giustino
! Copyright (C) 2016-2018 Samuel Ponce'
! Copyright (C) 2016-2019 Samuel Ponce', Roxana Margine, Feliciano Giustino
!
! This file is distributed under the terms of the GNU General Public
! License. See the file `LICENSE' in the root directory of the

View File

@ -163,12 +163,17 @@
!! Used for the averaging
REAL(kind=DP) :: ekk2
!! Use for averaging
!
REAL(kind=DP) :: xkf_tmp (3, nkqtotf)
!! Temporary k-point coordinate (dummy variable)
REAL(kind=DP) :: wkf_tmp(nkqtotf)
!! Temporary k-weights (dummy variable)
REAL(kind=DP) :: dfnk
!! df/de
REAL(kind=DP) :: etemp
!! Temperature
REAL(KIND=DP), EXTERNAL :: w0gauss
!! The derivative of wgauss: an approximation to the delta function
! Gather all the k-point coordinate from all the pools
!
! Gather all the k-point coordinate from all the pools
xkf_all(:,:) = zero
@ -236,7 +241,6 @@
CALL kpmq_map( xkf_all(:, 2*ik-1 ), xqf (:, iq), +1, nkq_abs )
s_BZtoIBZ_full(:,:,ind) = s_BZtoIBZ(:,:,nkq_abs)
ixkqf_tr(ind) = BZtoIBZ(nkq_abs)
!print*,'ind iq ik ixkqf_tr ',ind, iq, ik, ixkqf_tr(ind), s_BZtoIBZ_full(1,1,ind)
ENDDO
!
ENDIF
@ -244,7 +248,6 @@
! First computes the SERTA solution as the first step of the IBTE
F_SERTA(:,:,:,:) = zero
tmp(:,:,:) = zero
!tmp2(:,:,:,:,:) = zero
!
DO ind=1, nind
iq = sparse_q( ind )
@ -254,15 +257,7 @@
itemp = sparse_t( ind )
!
tmp(ibnd, ik, itemp) = tmp(ibnd, ik, itemp) + trans_prob(ind)
!tmp2(jbnd, ibnd, itemp, ik, iq) = trans_prob(ind)
!IF (ik==2 .and. ibnd ==2 .and. itemp ==2) print*,'ind tmp ', ind, tmp(ibnd, ik, itemp)
!IF (ik==2) print*,ind, trans_prob(ind)
!print*,'ind iq ik ibnd jbnd itemp ',ind, iq, ik, ibnd, jbnd, itemp
!print*,'tmp ',tmp(ibnd, ik, itemp)
ENDDO
!print*,'ind=10, iq==1, ik==2, ibnd=2, jbnd=2, itemp==1 ', trans_prob(10)
!
CALL mp_sum(tmp, world_comm)
!
@ -274,11 +269,11 @@
DO ik = 1, nkqtotf/2
!
DO ibnd = 1, ibndmax-ibndmin+1
ekk = etf_all (ibndmin-1+ibnd, ik)
ekk = etf_all (ibnd, ik)
n = 0
tmp2 = 0.0_DP
DO jbnd = 1, ibndmax-ibndmin+1
ekk2 = etf_all (ibndmin-1+jbnd, ik)
ekk2 = etf_all (jbnd, ik)
IF ( ABS(ekk2-ekk) < eps6 ) THEN
n = n + 1
tmp2 = tmp2 + tmp(ibnd,ik,itemp)
@ -293,12 +288,15 @@
ENDDO ! nkqtotf
ENDDO ! itemp
!
!
DO itemp=1, nstemp
etemp = transp_temp(itemp)
DO ik=1, nkqtotf/2
DO ibnd=1, ibndmax-ibndmin+1
IF ( ABS(tmp(ibnd, ik, itemp)) > eps160 ) THEN
F_SERTA(:, ibnd, ik, itemp) = vkk_all(:,ibnd,ik) / ( two * tmp(ibnd,ik,itemp) )
ekk = etf_all (ibnd, ik) - ef0(itemp)
dfnk = w0gauss( ekk / etemp, -99 ) / etemp
F_SERTA(:, ibnd, ik, itemp) = dfnk * vkk_all(:,ibnd,ik) / ( two * tmp(ibnd,ik,itemp) )
!F_SERTA(:, ibnd, ik, itemp) = vkk_all(:,ibnd,ik) / ( two * tmp(ibnd,ik,itemp) )
ENDIF
ENDDO
!IF (itemp==2) print*,'ik ',ik, SUM(F_SERTA(:,:,ik,2)), SUM(vkk_all(:,:,ik))

View File

@ -55,12 +55,4 @@ TEST0: test0.o libqefft.a
clean :
- /bin/rm -f *.o *.a *.d *.i *~ *_tmp.f90 *.mod *.L
# .PHONY forces execution of a rule irrespective of the presence of an
# updated file with the same name of the rule. In this way, the script
# that generates version.f90 always runs, updating the version if you
# execute "svn update". The update_version script takes care of not
# changing the file if the svn version did not change
.PHONY: all clean
include make.depend

File diff suppressed because it is too large Load Diff

View File

@ -3,8 +3,13 @@ sinclude ../make.inc
# do nothing by default !!!
default:
clean:
- if test -d PWgui ; then ( cd PWgui; $(MAKE) clean ) ; fi
- if test -d QE-modes ; then ( cd QE-modes; $(MAKE) clean ) ; fi
veryclean:
- if test -d Guib ; then ( cd Guib; $(MAKE) veryclean ) ; fi
- if test -d PWgui ; then ( cd PWgui; $(MAKE) distclean ) ; fi
- if test -d QE-modes ; then ( cd QE-modes; $(MAKE) veryclean ) ; fi
distclean: veryclean

View File

@ -12,7 +12,7 @@ The PWgui package comes in two flavors:
(ii) SOURCE PACKAGE
N.B.: for the usage of SVN version of PWgui see file INSTALL.svn
N.B.: for the usage of repository version of PWgui see file INSTALL.repository
________________________________________________________________________

View File

@ -0,0 +1,25 @@
==============================================================================
* * * INSTALLATION instructions for PWgui as obtained * * *
* * * from the QE repository * * *
==============================================================================
This INSTALL.repository file is located in GUI/PWgui/ directory. To
make the PWgui functional do the following:
Either:
* from the QE root directory call: make gui
Or:
* or from the this directory (i.e. GUI/PWgui) call: make init
* to run the PWgui program, type from this directory: ./pwgui
BEWARE:
To run the "pwgui" you will need the required Tcl-related software.
See the INSTALL file, for the software-requirements of the PWgui
source-package.
--
Anton Kokalj (tone.kokalj@ijs.si), Fri Mar 01 2019

View File

@ -1,28 +0,0 @@
==============================================================================
* * * INSTALLATION instructions for PWgui as obtained * * *
* * * from the QE SVN repository * * *
==============================================================================
This INSTALL.svn file is located in GUI/PWgui/ directory. To "install"
the PWgui do the following:
(i) from GUI/PWgui/ directory call: make svninit
^^^^^^^^^^^^
(ii) define the PWGUI environmental variable (optional for versions >= 4.0),
(iii) add $PWGUI to your path, and
(iv) to launch the PWgui program, type: pwgui
BEWARE:
To run the "pwgui" you will need the required Tcl-related software.
See the INSTALL file, for the software-requirements of the PWgui
source-package.
--
Anton Kokalj (tone.kokalj@ijs.si), Wed Jun 08 2011

View File

@ -68,6 +68,7 @@ clean:
-rm -f *~ */*~ */*/*~
-rm -f *.tgz
-rm -f *.tar
-cd doc/pwdocs; $(MAKE) clean
veryclean:
$(MAKE) clean
@ -79,7 +80,7 @@ distclean: veryclean
-cd lib/; rm -f *
cd $(PWGUI_VFS); $(MAKE) distclean
svninit:
init:
-cd doc/pwdocs; $(MAKE)
-if test ! -d lib; then mkdir lib; fi
-cd lib/; rm -f Guib-*;

View File

@ -1 +1 @@
svn
6.4

View File

@ -19,7 +19,7 @@ all: input_html make_user_guide
links:
( cd $(TOPDIR); $(MAKE) doc )
- ( cd $(TOPDIR); $(MAKE) doc )
for file in $(LINK_FILES); do \
if test ! -f $$file; then ln -sf $(QE_DOC_DIR)/$$file . ; fi; \
done
@ -44,19 +44,15 @@ make_user_guide: links
rm -rf user_guide/
cp -a $(QE_DOC_DIR)/user_guide .
cd user_guide/; \
for file in *.png; do \
convert $$file $${file%.png}.gif; \
rm -f $$file; \
done; \
for file in *.html; do \
cp $$file /tmp/$$file; \
cat /tmp/$$file | sed 's/\.png/\.gif/g' - | sed 's/&nbsp;/ /g' - > $$file; \
cat /tmp/$$file | sed 's/&nbsp;/ /g' - > $$file; \
rm -f /tmp/$$file; \
done
clean: clean_links
-rm -f INPUT_*.html *~
-rm -f INPUT_*.html INPUT_*.txt *~
-rm -f *.tex *.aux *.log *.out *.toc *.gif *.pdf *.png
-rm -rf user_guide/

Binary file not shown.

Before

Width:  |  Height:  |  Size: 255 KiB

After

Width:  |  Height:  |  Size: 258 KiB

Binary file not shown.

View File

@ -8,9 +8,9 @@
If you donwloaded any of the *.tgz package, you do not need to
call "make". See INSTALL file instead.
* SVN-related target:
* Repository-related target:
svninit ... initialize the PWgui after it was SVN-downloaded
init ... initialize the PWgui after it was downloaded from repository
* Distribution-related targets:

View File

@ -0,0 +1,13 @@
tracevar bz_sum w {
switch -glob -- [varvalue bz_sum] {
*tetrahedra* {
widget ngauss disable
widget degauss disable
}
default {
widget ngauss enable
widget degauss enable
}
}
}
varset bz_sum -value {}

View File

@ -45,6 +45,58 @@ directory containing the input data, i.e. the same as in pw.x
}
# ------------------------------------------------------------------------
help bz_sum -helpfmt helpdoc -helptext {
<ul>
<li> <em>Variable: </em><big><b>bz_sum</b></big>
</li>
<br><li> <em>Type: </em>CHARACTER</li>
<br><li> <em>Default: </em>
'smearing' if degauss in given in input 'smearing',
options read from the xml data file otherwise.
</li>
<br><li> <em>Description:</em>
</li>
<blockquote>
<pre> Keyword selecting the method for BZ summation. Available options are:
</pre>
<dl style="margin-left: 1.5em;">
<dt><tt><b>'smearing'</b> :</tt></dt>
<dd><pre style="margin-top: 0em; margin-bottom: -1em;">
integration using gaussian smearing. In fact currently
any string not related to tetrahedra defaults to smearing;
</pre></dd>
</dl>
<dl style="margin-left: 1.5em;">
<dt><tt><b>'tetrahedra'</b> :</tt></dt>
<dd><pre style="margin-top: 0em; margin-bottom: -1em;">
Tetrahedron method, Bloechl's version:
P.E. Bloechl, "PRB 49, 16223 (1994)"
Requires uniform grid of k-points, to be
automatically generated in pw.x.
</pre></dd>
</dl>
<dl style="margin-left: 1.5em;">
<dt><tt><b>'tetrahedra_lin'</b> :</tt></dt>
<dd><pre style="margin-top: 0em; margin-bottom: -1em;">
Original linear tetrahedron method.
To be used only as a reference;
the optimized tetrahedron method is more efficient.
</pre></dd>
</dl>
<dl style="margin-left: 1.5em;">
<dt><tt><b>'tetrahedra_opt'</b> :</tt></dt>
<dd><pre style="margin-top: 0em; margin-bottom: -1em;">
Optimized tetrahedron method:
see M. Kawamura, "PRB 89, 094515 (2014)".
</pre></dd>
</dl>
</blockquote>
</ul>
}
# ------------------------------------------------------------------------
help ngauss -helpfmt helpdoc -helptext {
<ul>

View File

@ -24,22 +24,34 @@ module Dos\#auto -title "PWSCF GUI: module Dos.x" -script {
separator -label "--- DOS ploting options ---"
var ngauss {
-label "Type of gaussian broadening (ngauss):"
-widget radiobox
-value {0 1 -1 99}
-textvalue {
"Simple Gaussian (default)"
"Methfessel-Paxton of order 1"
"Marzari-Vanderbilt \"cold smearing\""
"Fermi-Dirac function"
}
}
var bz_sum {
-label "Method for BZ summation (bz_sum):"
-widget radiobox
-value {
'smearing'
'tetrahedra'
'tetrahedra_lin'
'tetrahedra_opt'
}
-validate string
}
var degauss {
-label "Gaussian broadening \[in Ry\] (degauss):"
-validate fortranreal
}
var ngauss {
-label "Type of gaussian broadening (ngauss):"
-widget radiobox
-value {0 1 -1 99}
-textvalue {
"Simple Gaussian (default)"
"Methfessel-Paxton of order 1"
"Marzari-Vanderbilt \"cold smearing\""
"Fermi-Dirac function"
}
}
var degauss {
-label "Gaussian broadening \[in Ry\] (degauss):"
-validate fortranreal
}
var DeltaE {
-label "Resolution of PDOS plots \[in eV\] (DeltaE):"
@ -59,6 +71,11 @@ module Dos\#auto -title "PWSCF GUI: module Dos.x" -script {
}
}
# ----------------------------------------------------------------------
# take care of specialties
# ----------------------------------------------------------------------
source dos-event.tcl
# ------------------------------------------------------------------------
# source the HELP file
# ------------------------------------------------------------------------

View File

@ -741,9 +741,7 @@ up calculations at q=0 (phonon wavevector) if the sum over
the Brillouin Zone includes k=0 only. The gamma_gamma
trick exploits symmetry and acoustic sum rule to reduce
the number of linear response calculations to the strict
minimum, as it is done in code phcg.x. This option MUST
BE USED if a run with ph.x is to be followed by a run
with d3.x for third-order terms calculation.
minimum, as it is done in code phcg.x.
</pre></blockquote>
</ul>
@ -877,6 +875,32 @@ with offset determined by k1,k2,k3.
}
# ------------------------------------------------------------------------
help read_dns_bare -helpfmt helpdoc -helptext {
<ul>
<li> <em>Variable: </em><big><b>read_dns_bare</b></big>
</li>
<br><li> <em>Type: </em>LOGICAL</li>
<br><li> <em>Default: </em> .false.
</li>
<br><li> <em>Description:</em>
</li>
<blockquote><pre>
If .true. the PH code tries to read three files in the DFPT+U
calculation: dns_orth, dns_bare, d2ns_bare.
dns_orth and dns_bare are the first-order variations of
the occupation matrix, while d2ns_bare is the second-order
variation of the occupation matrix. These matrices are
computed only once during the DFPT+U calculation. However,
their calculation (especially of d2ns_bare) is computationally
expensive, this is why they are written to file and then can be
read (e.g. for restart) in order to save time.
</pre></blockquote>
</ul>
}
# ------------------------------------------------------------------------
help start_irr -helpfmt helpdoc -helptext {
<ul>

View File

@ -478,6 +478,15 @@ module PH\#auto -title "PWSCF GUI: module PH.x" -script {
-widget spinint
-fmt %d
}
separator -label "--- Miscellaneous ---"
var read_dns_bare {
-label "For DFPT+U: read the dns_* files (read_dns_bare):"
-widget radiobox
-textvalue { Yes No }
-value { .true. .false. }
}
}
page q_k_points -name "q- and k-points" {

View File

@ -519,14 +519,13 @@ help output_format -helpfmt helpdoc -helptext {
0 = format suitable for gnuplot (1D)
1 = format suitable for contour.x (2D)
1 = obsolete format no longer supported
2 = format suitable for plotrho (2D)
3 = format suitable for XCRYSDEN (2D or user-supplied 3D region)
4 = format suitable for gOpenMol (3D)
(formatted: convert to unformatted *.plt)
4 = obsolete format no longer supported
5 = format suitable for XCRYSDEN (3D, using entire FFT grid)
@ -765,12 +764,12 @@ rho(i,j,k) = rho( x0 + e1 * (i-1)/nx
are ignored, the entire FFT grid is written in the
XCRYSDEN format - works for any crystal axis (VERY FAST)
- If "e1", "e2", "e3", "x0" are present, and "e1", "e2", "e3" are parallel
to xyz and parallel to crystal axis, a subset of the
FFT grid that approximately covers the parallelepiped
defined by "e1", "e2", "e3", "x0", is written (presently only
if "output_format" = 4, i.e. gopenmol format) - works only
if the crystal axis are parallel to xyz
- If "e1", "e2", "e3", "x0" are present,
and "e1", "e2", "e3" are parallel to xyz
and parallel to crystal axis, a subset of the FFT
grid that approximately covers the parallelepiped
defined by "e1", "e2", "e3", "x0", is
written - untested, might be obsolete
- Otherwise, the required 3D grid is generated from the
Fourier components (may be VERY slow)

View File

@ -189,13 +189,11 @@ module PP\#auto -title "PWSCF GUI: module PP.x" -script {
"XCRYSDEN's XSF format (2D or 3D)"
"XCRYSDEN's XSF format (whole unit cell) (3D)"
"format suitable for gnuplot (1D)"
"format suitable for contour.x (2D)"
"format suitable for plotrho (2D)"
"format suitable for gOpenMol (3D)"
"Gaussian cube-file format (3D)"
"format suitable for gnuplot (2D)"
}
-value { 3 5 0 1 2 4 6 7 }
-value { 3 5 0 2 6 7 }
-widget optionmenu
}
var interpolation {

View File

@ -539,6 +539,7 @@ proc ::pwscf::pwReadFilter {moduleObj channel} {
{'martyna-tuckerman' 'm-t' 'mt'}
}
vdw_corr {
{'grimme-d3' 'Grimme-D3' 'DFT-D3' 'dft-d3'}
{'grimme-d2' 'Grimme-D2' 'DFT-D' 'dft-d'}
{'ts-vdw' 'TS', 'ts', ''ts-vdW', 'tkatchenko-scheffler'}
{'xdm''XDM'}

View File

@ -357,21 +357,18 @@ tracevar xdm w {
}
tracevar vdw_corr w {
groupwidget dftdG disable
groupwidget xdmG disable
groupwidget tsG disable
groupwidget dftdG disable
groupwidget dftd3G disable
groupwidget xdmG disable
groupwidget tsG disable
if { [varvalue vdw_corr] == "'grimme-d2'" } {
groupwidget dftdG enable
groupwidget xdmG disable
groupwidget tsG disable
} elseif { [varvalue vdw_corr] == "'grimme-d3'" } {
groupwidget dftd3G enable
} elseif { [varvalue vdw_corr] == "'xdm'" } {
groupwidget dftdG disable
groupwidget xdmG enable
groupwidget tsG disable
} elseif { [varvalue vdw_corr] == "'ts-vdw'" } {
groupwidget dftdG disable
groupwidget xdmG disable
groupwidget tsG enable
}
}

View File

@ -171,10 +171,11 @@ This flag controls the way wavefunctions are stored to disk :
The resulting format is portable to a different number
of processor, or different kind of parallelization
.FALSE. do not collect wavefunctions, leave them in temporary
.FALSE. OBSOLETE - NO LONGER IMPLEMENTED
do not collect wavefunctions, leave them in temporary
local files (one per processor). The resulting format
is readable only on the same number of processors and
with the same knd of paralleliztio used to write it.
with the same kind of parallelization used to write it.
Note that this flag has no effect on reading, only on writing.
</pre></blockquote>
@ -314,7 +315,7 @@ This directory specifies where to store files generated by
each processor (*.wfc{N}, *.igk{N}, etc.). Useful for
machines without a parallel file system: set "wfcdir" to
a local file system, while "outdir" should be a parallel
or networkfile system, visible to all processors. Beware:
or network file system, visible to all processors. Beware:
in order to restart from interrupted runs, or to perform
further calculations using the produced data files, you
may need to copy files to "outdir". Works only for pw.x.
@ -715,7 +716,7 @@ help gate -helpfmt helpdoc -helptext {
</li>
<blockquote><pre>
In the case of charged cells ("tot_charge" .ne. 0) setting gate = .TRUE.
represents the counter charge (i.e. -tot_charge) not by a homogenous
represents the counter charge (i.e. -tot_charge) not by a homogeneous
background charge but with a charged plate, which is placed at "zgate"
(see below). Details of the gate potential can be found in
T. Brumme, M. Calandra, F. Mauri; "PRB 89, 245406 (2014)".
@ -743,8 +744,9 @@ help ibrav -helpfmt helpdoc -helptext {
<br><li> <em>Description:</em>
</li>
<blockquote><pre>
Bravais-lattice index. If ibrav /= 0, specify EITHER
[ "celldm"(1)-"celldm"(6) ] OR [ "A", "B", "C", "cosAB", "cosAC", "cosBC" ]
Bravais-lattice index. Optional only if space_group is set.
If ibrav /= 0, specify EITHER [ "celldm"(1)-"celldm"(6) ]
OR [ "A", "B", "C", "cosAB", "cosAC", "cosBC" ]
but NOT both. The lattice parameter "alat" is set to
alat = celldm(1) (in a.u.) or alat = A (in Angstrom);
see below for the other parameters.
@ -804,6 +806,10 @@ ibrav structure celldm(2)-celldm(6)
v1 = (a/2, b/2,0), v2 = (-a/2,b/2,0), v3 = (0,0,c)
-9 as 9, alternate description
v1 = (a/2,-b/2,0), v2 = (a/2, b/2,0), v3 = (0,0,c)
91 Orthorhombic one-face base-centered A-type
celldm(2)=b/a
celldm(3)=c/a
v1 = (a, 0, 0), v2 = (0,b/2,-c/2), v3 = (0,b/2,c/2)
10 Orthorhombic face-centered celldm(2)=b/a
celldm(3)=c/a
@ -825,12 +831,20 @@ ibrav structure celldm(2)-celldm(6)
where beta is the angle between axis a and c
13 Monoclinic base-centered celldm(2)=b/a
celldm(3)=c/a,
celldm(4)=cos(ab)
v1 = ( a/2, 0, -c/2),
v2 = (b*cos(gamma), b*sin(gamma), 0),
v3 = ( a/2, 0, c/2),
where gamma is the angle between axis a and b
(unique axis c) celldm(3)=c/a,
celldm(4)=cos(gamma)
v1 = ( a/2, 0, -c/2),
v2 = (b*cos(gamma), b*sin(gamma), 0 ),
v3 = ( a/2, 0, c/2),
where gamma=angle between axis a and b projected on xy plane
-13 Monoclinic base-centered celldm(2)=b/a
(unique axis b) celldm(3)=c/a,
celldm(5)=cos(beta)
v1 = ( a/2, -b/2, 0),
v2 = ( a/2, b/2, 0),
v3 = (c*cos(beta), 0, c*sin(beta)),
where beta=angle between axis a and c projected on xz plane
14 Triclinic celldm(2)= b/a,
celldm(3)= c/a,
@ -1312,13 +1326,16 @@ help use_all_frac -helpfmt helpdoc -helptext {
<br><li> <em>Description:</em>
</li>
<blockquote><pre>
if (.TRUE.) do not discard symmetry operations with an
associated fractionary translation that does not send the
real-space FFT grid into itself. These operations are
incompatible with real-space symmetrization but not with the
new G-space symmetrization. BEWARE: do not use for phonons
and for hybrid functionals! Both still use symmetrization
in real space.
if (.FALSE.) force real-space FFT grids to be commensurate with
fractionary translations of non-symmorphic symmetry operations,
if present (e.g.: if a fractional translation (0,0,c/4) exists,
the FFT dimension along the c axis must be multiple of 4).
if (.TRUE.) do not impose any constraints to FFT grids, even in
the presence of non-symmorphic symmetry operations.
BEWARE: use_all_frac=.TRUE. may lead to wrong results for
hybrid functionals and phonon calculations. Both cases use
symmetrization in real space that works for non-symmorphic
operations only if the real-space FFT grids are commensurate.
</pre></blockquote>
</ul>
@ -1800,6 +1817,28 @@ In QE =&lt; 5.0.2 it defaulted to nqx1=nqx2=nqx3=1.
}
# ------------------------------------------------------------------------
help localization_thr -helpfmt helpdoc -helptext {
<ul>
<li> <em>Variable: </em><big><b>localization_thr</b></big>
</li>
<br><li> <em>Type: </em>REAL</li>
<br><li> <em>Default: </em> 0.0
</li>
<br><li> <em>Description:</em>
</li>
<blockquote><pre>
Overlap threshold over which the exchange integral over a pair of localized orbitals
is included in the evaluation of EXX operator. Any value greater than 0.0 triggers
the SCDM localization and the evaluation on EXX using the localized orbitals.
Very small value of the threshold should yield the same result as the default EXX
evaluation
</pre></blockquote>
</ul>
}
# ------------------------------------------------------------------------
help lda_plus_u -helpfmt helpdoc -helptext {
<ul>
@ -1904,7 +1943,7 @@ help Hubbard_alpha -helpfmt helpdoc -helptext {
<blockquote><pre>
Hubbard_alpha(i) is the perturbation (on atom i, in eV)
used to compute U with the linear-response method of
Cococcioni and de Gironcoli, "PRB 71, 35105 (2005)"
Cococcioni and de Gironcoli, "PRB 71, 035105 (2005)"
(only for "lda_plus_u_kind"=0)
</pre></blockquote>
</ul>
@ -1925,7 +1964,7 @@ help Hubbard_beta -helpfmt helpdoc -helptext {
<blockquote><pre>
Hubbard_beta(i) is the perturbation (on atom i, in eV)
used to compute J0 with the linear-response method of
Cococcioni and de Gironcoli, "PRB 71, 35105 (2005)"
Cococcioni and de Gironcoli, "PRB 71, 035105 (2005)"
(only for "lda_plus_u_kind"=0). See also
"PRB 84, 115108 (2011)".
</pre></blockquote>
@ -2121,6 +2160,25 @@ For noncollinear calculations only.
}
# ------------------------------------------------------------------------
help lforcet -helpfmt helpdoc -helptext {
<ul>
<li> <em>Variable: </em><big><b>lforcet</b></big>
</li>
<br><li> <em>Type: </em>LOGICAL</li>
<br><li> <em>Description:</em>
</li>
<blockquote><pre>
When starting a non collinear calculation using an existing density
file from a collinear lsda calculation assumes previous density points in
<i>z</i> direction and rotates it in the direction described by "angle1" and
"angle2" variables for atomic type 1
</pre></blockquote>
</ul>
}
# ------------------------------------------------------------------------
help constrained_magnetization -helpfmt helpdoc -helptext {
<ul>
@ -2361,7 +2419,7 @@ NB:
- Components of the total stress; sigma_xy, sigma_yz,
sigma_zz, sigma_zy, and sigma_zx are meaningless
bacause ESM stress routines calculate only
because ESM stress routines calculate only
components of stress; sigma_xx, sigma_xy, sigma_yx,
and sigma_yy.
@ -2372,6 +2430,33 @@ NB:
See "esm_bc", "esm_efield", "esm_w", "esm_nfit".
</pre></dd>
</dl>
<dl style="margin-left: 1.5em;">
<dt><tt><b>'2D'</b> :</tt></dt>
<dd><pre style="margin-top: 0em; margin-bottom: -1em;">
Truncation of the Coulomb interaction in the z direction
for structures periodic in the x-y plane. Total energy,
forces and stresses are computed in a two-dimensional framework.
Linear-response calculations () done on top of a self-consistent
calculation with this flag will automatically be performed in
the 2D framework as well. Please refer to:
Sohier, T., Calandra, M., &amp; Mauri, F. (2017), Density functional
perturbation theory for gated two-dimensional heterostructures:
Theoretical developments and application to flexural phonons in graphene.
Physical Review B, 96(7), 75448. "https://doi.org/10.1103/PhysRevB.96.075448"
NB:
- The length of the unit-cell along the z direction should
be larger than twice the thickness of the 2D material
(including electrons). A reasonable estimate for a
layer's thickness could be the interlayer distance in the
corresponding layered bulk material. Otherwise,
the atomic thickness + 10 bohr should be a safe estimate.
There is also a lower limit of 20 bohr imposed by the cutoff
radius used to read pseudopotentials (see read_pseudo.f90 in Modules).
- As for ESM above, only in-plane stresses make sense and one
should use cell_dofree='2Dxy' in a vc-relax calculation.
</pre></dd>
</dl>
</blockquote>
</ul>
@ -2521,7 +2606,8 @@ help vdw_corr -helpfmt helpdoc -helptext {
<br><li> <em>Default: </em> 'none'
</li>
<br><li> <em>See: </em>
london_s6, london_rcut, london_c6, london_rvdw, ts_vdw_econv_thr, ts_vdw_isolated, xdm_a1, xdm_a2
london_s6, london_rcut, london_c6, london_rvdw,
dftd3_version, dftd3_threebody, ts_vdw_econv_thr, ts_vdw_isolated, xdm_a1, xdm_a2
</li>
<br><li> <em>Description:</em>
</li>
@ -2532,17 +2618,25 @@ Type of Van der Waals correction. Allowed values:
<dl style="margin-left: 1.5em;">
<dt><tt><b>'grimme-d2'</b>, <b>'Grimme-D2'</b>, <b>'DFT-D'</b>, <b>'dft-d'</b> :</tt></dt>
<dd><pre style="margin-top: 0em; margin-bottom: -1em;">
Semiempirical Grimme's DFT-D2.
Optional variables: "london_s6", "london_rcut", "london_c6", "london_rvdw",
Semiempirical Grimme's DFT-D2. Optional variables:
"london_s6", "london_rcut", "london_c6", "london_rvdw"
S. Grimme, J. Comp. Chem. 27, 1787 (2006), "doi:10.1002/jcc.20495"
V. Barone et al., J. Comp. Chem. 30, 934 (2009), "doi:10.1002/jcc.21112"
</pre></dd>
</dl>
<dl style="margin-left: 1.5em;">
<dt><tt><b>'grimme-d3'</b>, <b>'Grimme-D3'</b>, <b>'DFT-D3'</b>, <b>'dft-d3'</b> :</tt></dt>
<dd><pre style="margin-top: 0em; margin-bottom: -1em;">
Semiempirical Grimme's DFT-D3. Optional variables:
"dftd3_version", "dftd3_threebody"
S. Grimme et al, J. Chem. Phys 132, 154104 (2010), "doi:10.1002/jcc.20495"
</pre></dd>
</dl>
<dl style="margin-left: 1.5em;">
<dt><tt><b>'TS'</b>, <b>'ts'</b>, <b>'ts-vdw'</b>, <b>'ts-vdW'</b>, <b>'tkatchenko-scheffler'</b> :</tt></dt>
<dd><pre style="margin-top: 0em; margin-bottom: -1em;">
Tkatchenko-Scheffler dispersion corrections with first-principle derived
C6 coefficients (implemented in CP only).
C6 coefficients.
Optional variables: "ts_vdw_econv_thr", "ts_vdw_isolated"
See A. Tkatchenko and M. Scheffler, "PRL 102, 073005 (2009)".
</pre></dd>
@ -2659,6 +2753,50 @@ cutoff radius (a.u.) for dispersion interactions
}
# ------------------------------------------------------------------------
help dftd3_version -helpfmt helpdoc -helptext {
<ul>
<li> <em>Variable: </em><big><b>dftd3_version</b></big>
</li>
<br><li> <em>Type: </em>integer</li>
<br><li> <em>Default: </em> 3
</li>
<br><li> <em>Description:</em>
</li>
<blockquote><pre>
Version of Grimme implementation of Grimme-D3:
Version=2 is the original Grimme-D2 parametrization
Version=3 is Grimme-D3 (zero damping)
Version=4 is Grimme-D3 (BJ damping)
Version=5 is Grimme-D3M (zero damping)
Version=6 is Grimme-D3M (BJ damping)
NOTE: not all functionals are parametrized.
</pre></blockquote>
</ul>
}
# ------------------------------------------------------------------------
help dftd3_threebody -helpfmt helpdoc -helptext {
<ul>
<li> <em>Variable: </em><big><b>dftd3_threebody</b></big>
</li>
<br><li> <em>Type: </em>LOGICAL</li>
<br><li> <em>Default: </em> TRUE
</li>
<br><li> <em>Description:</em>
</li>
<blockquote><pre>
Turn three-body terms in Grimme-D3 on. If .false. two-body contributions
only are computed, using two-body parameters of Grimme-D3.
If dftd3_version=2, three-body contribution is always disabled.
</pre></blockquote>
</ul>
}
# ------------------------------------------------------------------------
help ts_vdw_econv_thr -helpfmt helpdoc -helptext {
<ul>
@ -2725,10 +2863,9 @@ help xdm_a1 -helpfmt helpdoc -helptext {
<br><li> <em>Description:</em>
</li>
<blockquote><pre>
Damping function parameter a1 (adimensional). This value should change
with the exchange-correlation functional. The default corresponds to
PW86PBE.
For other functionals, see:
Damping function parameter a1 (adimensional). It is NOT necessary to give
a value if the functional is one of B86bPBE, PW86PBE, PBE, BLYP. For functionals
in this list, the coefficients are given in:
"http://schooner.chem.dal.ca/wiki/XDM"
A. Otero de la Roza, E. R. Johnson, J. Chem. Phys. 138, 204109 (2013),
"doi:10.1063/1.4705760"
@ -2749,10 +2886,9 @@ help xdm_a2 -helpfmt helpdoc -helptext {
<br><li> <em>Description:</em>
</li>
<blockquote><pre>
Damping function parameter a2 (angstrom). This value should change
with the exchange-correlation functional. The default corresponds to
PW86PBE.
For other functionals, see:
Damping function parameter a2 (angstrom). It is NOT necessary to give
a value if the functional is one of B86bPBE, PW86PBE, PBE, BLYP. For functionals
in this list, the coefficients are given in:
"http://schooner.chem.dal.ca/wiki/XDM"
A. Otero de la Roza, E. R. Johnson, J. Chem. Phys. 138, 204109 (2013),
"doi:10.1063/1.4705760"
@ -2778,7 +2914,8 @@ in the International Tables of Crystallography A (ITA).
This allows to give in input only the inequivalent atomic
positions. The positions of all the symmetry equivalent atoms
are calculated by the code. Used only when the atomic positions
are of type crystal_sg.
are of type crystal_sg. See also "uniqueb",
"origin_choice", "rhombohedral"
</pre></blockquote>
</ul>
@ -3521,11 +3658,32 @@ help tqr -helpfmt helpdoc -helptext {
<br><li> <em>Description:</em>
</li>
<blockquote><pre>
If .true., use the real-space algorithm for augmentation
charges in ultrasoft pseudopotentials.
Must faster execution of ultrasoft-related calculations,
but numerically less accurate than the default algorithm.
Use with care and after testing!
If .true., use a real-space algorithm for augmentation
charges of ultrasoft pseudopotentials and PAWsets.
Faster but numerically less accurate than the default
G-space algorithm. Use with care and after testing!
</pre></blockquote>
</ul>
}
# ------------------------------------------------------------------------
help real_space -helpfmt helpdoc -helptext {
<ul>
<li> <em>Variable: </em><big><b>real_space</b></big>
</li>
<br><li> <em>Type: </em>LOGICAL</li>
<br><li> <em>Default: </em> .FALSE.
</li>
<br><li> <em>Description:</em>
</li>
<blockquote><pre>
If .true., exploit real-space localization to compute
matrix elements for nonlocal projectors. Faster and in
principle better scaling than the default G-space algorithm,
but numerically less accurate, may lead to some loss of
translational invariance. Use with care and after testing!
</pre></blockquote>
</ul>
@ -4287,6 +4445,11 @@ Select which of the cell parameters should be moved:
</pre></dd>
</dl>
<dl style="margin-left: 1.5em;">
<dt><tt><b>'ibrav'</b> :</tt></dt>
<dd><pre style="margin-top: 0em; margin-bottom: -1em;"> all axis and angles are moved, but the lattice but be representable with the initial ibrav choice
</pre></dd>
</dl>
<dl style="margin-left: 1.5em;">
<dt><tt><b>'x'</b> :</tt></dt>
<dd><pre style="margin-top: 0em; margin-bottom: -1em;"> only the x component of axis 1 (v1_x) is moved
</pre></dd>
@ -4341,6 +4504,21 @@ Select which of the cell parameters should be moved:
<dd><pre style="margin-top: 0em; margin-bottom: -1em;"> as above, keeping the area in xy plane fixed
</pre></dd>
</dl>
<dl style="margin-left: 1.5em;">
<dt><tt><b>'epitaxial_ab'</b> :</tt></dt>
<dd><pre style="margin-top: 0em; margin-bottom: -1em;"> fix axis 1 and 2 while allowing axis 3 to move
</pre></dd>
</dl>
<dl style="margin-left: 1.5em;">
<dt><tt><b>'epitaxial_ac'</b> :</tt></dt>
<dd><pre style="margin-top: 0em; margin-bottom: -1em;"> fix axis 1 and 3 while allowing axis 2 to move
</pre></dd>
</dl>
<dl style="margin-left: 1.5em;">
<dt><tt><b>'epitaxial_bc'</b> :</tt></dt>
<dd><pre style="margin-top: 0em; margin-bottom: -1em;"> fix axis 2 and 3 while allowing axis 1 to move
</pre></dd>
</dl>
<pre>
BEWARE: if axis are not orthogonal, some of these options do not
work (symmetry is broken). If you are not happy with them,

File diff suppressed because it is too large Load Diff

View File

@ -5,10 +5,9 @@
# ----------------------------------------------------------------------
# Anton Kokalj
# Jozef Stefan Institute, Ljubljana, Slovenia
# INFM DEMOCRITOS National Simulation Center, Trieste, Italy
# Email: Tone.Kokalj@ijs.si
# ======================================================================
# Copyright (c) 2003--2004 Anton Kokalj
# Copyright (c) 2003--2019 Anton Kokalj
# ======================================================================
#
#

View File

@ -4,10 +4,9 @@
# ----------------------------------------------------------------------
# Anton Kokalj
# Jozef Stefan Institute, Ljubljana, Slovenia
# INFM DEMOCRITOS National Simulation Center, Trieste, Italy
# Email: Tone.Kokalj@ijs.si
# ======================================================================
# Copyright (c) 2003--2004 Anton Kokalj
# Copyright (c) 2003--2019 Anton Kokalj
# ======================================================================
#
#
@ -34,11 +33,10 @@ if { [info exists env(PWGUI)] } {
# we arrive here, if we are using SVN version of code
if { [file isdirectory [file join $env(PWGUI) .. Guib]] } {
puts " "
puts " It seems you are using SVN version of PWgui/Quantum-Espresso."
puts " It seems you are using a repository QE version of PWgui."
puts " "
puts " For the SVN version you need to do the following:"
puts " * cd into GUI/PWgui directory, and"
puts " * execute: make svninit"
puts " You need to initialize PWgui first."
puts " Use \"make gui\" from the QE root directory."
puts " "
exit
}

View File

@ -108,10 +108,12 @@ $gui addModule module ld "LD1.X" [file join $env(PWGUI) modules atomic atomic.tc
# ------------------------------------------------------------------------
# help Files
# ------------------------------------------------------------------------
#$gui addHelp help usersguide "User's Guide for Quantum-ESPRESSO" [file join $env(PWGUI) doc pwdocs users-guide users-guide.html]
$gui addHelp help usersguide "User's Guide for Quantum-ESPRESSO" [file join $env(PWGUI) doc pwdocs user_guide user_guide.html] word
$gui addHelp separator
set user_guide_html [file join $env(PWGUI) doc pwdocs user_guide user_guide.html]
if { [file exists $user_guide_html] } {
$gui addHelp help usersguide "User's Guide for Quantum-ESPRESSO" $user_guide_html word
$gui addHelp separator
}
$gui addHelp help pw "PW.X Input Syntax" [file join $env(PWGUI) doc pwdocs INPUT_PW.html] none
$gui addHelp help neb "NEB.DAT Input Syntax" [file join $env(PWGUI) doc pwdocs INPUT_NEB.html] none

View File

@ -1,7 +1,7 @@
LATEX = pdflatex
LATEX2HTML = latex2html
VERSION = svn
VERSION = 6.4
PDFS = user_guide.pdf
AUXS = $(PDFS:.pdf=.aux)

Binary file not shown.

View File

@ -1,6 +1,6 @@
\documentclass[12pt,a4paper]{article}
\def\version{6.2}
\def\version{6.4}
\def\qe{{\sc Quantum ESPRESSO}}
\sloppy

View File

@ -1,5 +1,5 @@
TOPDIR = $(shell cd ../..; pwd)
VERSION = svn
VERSION = 6.4
GEN_MODE = $(TOPDIR)/dev-tools/gen-emacs-mode
LATEX = pdflatex
@ -98,7 +98,6 @@ doc:
cd Doc; $(MAKE)
clean:
- rm -f qe-modes/$(ELISP_FILES)
- cd Doc; $(MAKE) clean
veryclean: clean

View File

@ -0,0 +1,237 @@
;; cp-mode.el
;;
;; Copyright (C) 2016 Quantum ESPRESSO group
;; This file is distributed under the terms of the
;; GNU General Public License. See the file `License'
;; in the root directory of the present distribution,
;; or http://www.gnu.org/copyleft/gpl.txt .
;;
;; Author: Anton Kokalj (tone.kokalj at ijs.si)
;;
;; Acknowledgments:
;;
;; The implementation of qe-modes package was made possible by several
;; useful and helpful resources that are gratefully acknowledged, in
;; particular: "Mode Tutorial" of Scott Andrew Borton
;; (https://www.emacswiki.org/emacs/ModeTutorial, for indentation
;; code), "Derived Mode" and "Sample Mode" pages
;; (https://www.emacswiki.org/emacs/DerivedMode,
;; https://www.emacswiki.org/emacs/SampleMode) as well as the very
;; useful resources of Xah Lee
;; (http://ergoemacs.org/emacs/elisp_syntax_coloring.html). Last but
;; not the least Sebastijan Peljhan is acknowledged for his work on
;; `xsf-mode' that inspired the idea of writing the qe-modes.
;; This file is not part of GNU Emacs.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation; either version 2, or (at your option)
;; any later version.
;;
;; This lisp script is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
;;
;; Permission is granted to distribute copies of this lisp script
;; provided the copyright notice and this permission are preserved in
;; all copies.
;;
;; You should have received a copy of the GNU General Public License
;; along with this program; if not, you can either send email to this
;; program's maintainer or write to: The Free Software Foundation,
;; Inc.; 675 Massachusetts Avenue; Cambridge, MA 02139, USA.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; send bug reports to the author (tone.kokalj at ijs.si)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; Commentary:
;; This is the `cp-mode', a major mode for composing the Quantum ESPRESSO
;; QE-cp.x input files. For the installation and usage, see the
;; user_guide.pdf in the Doc/ subdirectory of the original package
;; (quick installation instructions are also available in the README
;; file of the original package).
;;; Code:
(require 'font-lock)
(require 'regexp-opt)
(defvar cp-mode-hook nil)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; basic variables
;; cp's supercards (if any)
(defvar cp-open-supercards (list ))
(defvar cp-closed-supercards (list ))
;; cp's namelists
(defvar cp-namelists (list "&CELL" "&CONTROL" "&ELECTRONS" "&IONS" "&PRESS_AI" "&SYSTEM" "&WANNIER" ))
(defvar qe-end-namelist (list "&END" "/"))
;; cp's variables
(defvar cp-vars (list "A" "abisur" "abivol" "adapt" "ampre" "amprp" "assume_isolated" "B" "C" "calculation" "calwf" "cell_damping" "cell_dofree" "cell_dynamics" "cell_factor" "cell_parameters" "cell_temperature" "cell_velocities" "celldm" "conv_thr" "cosAB" "cosAC" "cosBC" "degauss" "disk_io" "dt" "dthr" "ecfixed" "ecutrho" "ecutwfc" "efield" "efx0" "efx1" "efy0" "efy1" "efz0" "efz1" "ekin_conv_thr" "ekincw" "electron_damping" "electron_dynamics" "electron_maxstep" "electron_temperature" "electron_velocities" "emass" "emass_cutoff" "epol" "etot_conv_thr" "exx_dis_cutoff" "exx_fraction" "exx_me_rcut_pair" "exx_me_rcut_self" "exx_neigh" "exx_poisson_eps" "exx_ps_rcut_pair" "exx_ps_rcut_self" "fnhscl" "fnosee" "fnoseh" "fnosep" "forc_conv_thr" "grease" "greash" "greasp" "Hubbard_U" "ibrav" "iesr" "input_dft" "ion_damping" "ion_dynamics" "ion_nstepe" "ion_positions" "ion_radius" "ion_temperature" "ion_velocities" "iprint" "isave" "lambda_cold" "lda_plus_u" "london_rcut" "london_s6" "max_seconds" "maxiter" "maxwfdt" "memory" "n_inner" "nat" "nbnd" "ndega" "ndr" "ndw" "nhgrp" "nhpcl" "nhptyp" "ninter_cold_restart" "nit" "niter_cg_restart" "nr1" "nr1b" "nr1s" "nr2" "nr2b" "nr2s" "nr3" "nr3b" "nr3s" "nsd" "nspin" "nstep" "nsteps" "ntyp" "nwf" "occupations" "ortho_eps" "ortho_max" "ortho_para" "orthogonalization" "outdir" "P_ext" "P_fin" "P_in" "passop" "prefix" "press" "pseudo_dir" "pvar" "q2sigma" "qcutz" "remove_rigid_rot" "restart_mode" "rho_thr" "saverho" "smearing" "startingwfc" "Surf_t" "sw_len" "tabps" "tcg" "tefield" "temph" "tempw" "title" "tolp" "tolw" "tot_charge" "tot_magnetization" "tprnfor" "tranp" "ts_vdw" "ts_vdw_econv_thr" "ts_vdw_isolated" "tstress" "vdw_corr" "verbosity" "wf_efield" "wf_friction" "wf_q" "wf_switch" "wfdt" "wffort" "wfsd" "wmass" "writev" ))
;; cp's cards & keywords
(defvar cp-cards (list "ATOMIC_FORCES" "ATOMIC_POSITIONS" "ATOMIC_SPECIES" "ATOMIC_VELOCITIES" "AUTOPILOT" "CELL_PARAMETERS" "CONSTRAINTS" "OCCUPATIONS" "PLOT_WANNIER" "REF_CELL_PARAMETERS" ))
;; cp's flags
(defvar cp-flags (list "a.u" "alat" "angstrom" "bohr" "crystal" ))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; derived variables
(defvar cp-open-supercards-regexp (regexp-opt cp-open-supercards 'symbols)) ; may not exists
(defvar cp-closed-supercards-regexp (regexp-opt cp-closed-supercards 'symbols)) ; may not exists
(defvar cp-cards-regexp (regexp-opt
(append cp-cards cp-open-supercards) 'symbols))
(defvar cp-flags-regexp (regexp-opt cp-flags 'symbols))
(defvar cp-namelist-face (cons (regexp-opt (append cp-namelists qe-end-namelist) 'symbols) font-lock-function-name-face))
(defvar cp-variable-face (cons (regexp-opt cp-vars 'symbols) font-lock-variable-name-face))
;; logical values as constants
(defvar qe-logic-face (cons (regexp-opt (list ".t." ".true." ".f." ".false.")) font-lock-constant-face))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; regexp for indentation
(defvar cp-decr-indent-fold-t-re (concat "^[ \t]*" (regexp-opt qe-end-namelist t)))
(defvar cp-decr-indent-re (concat "^[ \t]*" (regexp-opt
(append cp-cards cp-open-supercards cp-closed-supercards) t)))
;;
(defvar cp-deindent-fold-t-re (concat "^[ \t]*" (regexp-opt qe-end-namelist t)))
;;
(defvar cp-indent-fold-t-re (concat "^[ \t]*" (regexp-opt cp-namelists t)))
(defvar cp-indent-re (concat "^[ \t]*" (regexp-opt cp-cards t)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; supercards, cards and flags are case sensitive -- here are the corresponding matchers
(defun cp-closed-supercards-matcher (limit)
(let ((case-fold-search nil))
(re-search-forward cp-closed-supercards-regexp limit 'no-error)))
(defun cp-cards-matcher (limit)
(let ((case-fold-search nil))
(re-search-forward cp-cards-regexp limit 'no-error)))
(defun cp-flags-matcher (limit)
(let ((case-fold-search nil))
(re-search-forward cp-flags-regexp limit 'no-error)))
(font-lock-add-keywords 'cp-mode (list
cp-namelist-face
cp-variable-face
qe-logic-face
'("," . font-lock-builtin-face)
'("(" . font-lock-builtin-face)
'(")" . font-lock-builtin-face)
))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; register the keywords
(font-lock-add-keywords 'cp-mode '(
(cp-closed-supercards-matcher 1 font-lock-preprocessor-face t)
(cp-cards-matcher 1 font-lock-keyword-face t)
(cp-flags-matcher 1 font-lock-type-face t)
))
;;(defvar cp-keywords '(cp-namelist-face cp-variable-face))
(defvar cp-keywords '(((list "") . font-lock-constant-face)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; define the sytnax of strings
(defvar cp-mode-syntax-table
(let ((table (make-syntax-table)))
(modify-syntax-entry ?\' "\"'" table)
(modify-syntax-entry ?\" "\"\"" table)
table)
"Syntax table in use in `cp-mode' buffers.")
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; code for auto-indenting
(defvar qe-indent 3)
(defun cp-indent-line ()
"Indent current line according to cp input syntax."
(interactive)
(beginning-of-line)
(if (bobp)
(indent-line-to 0) ; First line indented to column 0
(let ((not-indented t) cur-indent)
(if (or (looking-at cp-decr-indent-fold-t-re)
(let ((case-fold-search nil)) (looking-at cp-decr-indent-re))) ; If the line we are looking at is the end of a block, then decrease the indentation
(progn
(save-excursion
(forward-line -1)
(setq cur-indent (- (current-indentation) qe-indent)))
(if (< cur-indent 0) ; We can't indent past the left margin
(setq cur-indent 0)))
(save-excursion
(while not-indented ; Iterate backwards until we find an indentation hint
(forward-line -1)
(if (looking-at cp-deindent-fold-t-re) ; This hint indicates that we need to indent at the level of the "/" token
(progn
(setq cur-indent (current-indentation))
(setq not-indented nil))
(if (or (looking-at cp-indent-fold-t-re)
(let ((case-fold-search nil)) (looking-at cp-indent-re))) ; This hint indicates that we need to indent an extra level
(progn
(setq cur-indent (+ (current-indentation) qe-indent)) ; Do the actual indenting
(setq not-indented nil))
(if (bobp)
(setq not-indented nil)))))))
(if cur-indent
(indent-line-to cur-indent)
(indent-line-to 0))))) ; If we didn't see an indentation hint, then allow no indentation
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; define the cp-mode as derived-mode
(define-derived-mode cp-mode prog-mode
"QE-cp.x"
"Major mode for editing Qunatum-ESPRESSO input files (QE-cp.x mode)"
(setq font-lock-defaults '((cp-keywords) nil t))
(set (make-local-variable 'indent-line-function) 'cp-indent-line)
;; define the syntax of comments
(setq comment-start "!")
(setq comment-end "")
(modify-syntax-entry ?! "< b" cp-mode-syntax-table)
(modify-syntax-entry ?\n "> b" cp-mode-syntax-table)
(modify-syntax-entry ?= " " cp-mode-syntax-table) ;; treat "=" non symbol constituent
;; end
)
;; free memory
(setq cp-namelists nil)
(setq cp-vars nil)
(setq cp-cards nil)
(setq cp-flags nil)
(setq cp-open-supercards nil)
(setq cp-closed-supercards nil)
(require 'qe-funcs)
(provide 'cp-mode)

Binary file not shown.

View File

@ -0,0 +1,237 @@
;; ld1-mode.el
;;
;; Copyright (C) 2016 Quantum ESPRESSO group
;; This file is distributed under the terms of the
;; GNU General Public License. See the file `License'
;; in the root directory of the present distribution,
;; or http://www.gnu.org/copyleft/gpl.txt .
;;
;; Author: Anton Kokalj (tone.kokalj at ijs.si)
;;
;; Acknowledgments:
;;
;; The implementation of qe-modes package was made possible by several
;; useful and helpful resources that are gratefully acknowledged, in
;; particular: "Mode Tutorial" of Scott Andrew Borton
;; (https://www.emacswiki.org/emacs/ModeTutorial, for indentation
;; code), "Derived Mode" and "Sample Mode" pages
;; (https://www.emacswiki.org/emacs/DerivedMode,
;; https://www.emacswiki.org/emacs/SampleMode) as well as the very
;; useful resources of Xah Lee
;; (http://ergoemacs.org/emacs/elisp_syntax_coloring.html). Last but
;; not the least Sebastijan Peljhan is acknowledged for his work on
;; `xsf-mode' that inspired the idea of writing the qe-modes.
;; This file is not part of GNU Emacs.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation; either version 2, or (at your option)
;; any later version.
;;
;; This lisp script is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
;;
;; Permission is granted to distribute copies of this lisp script
;; provided the copyright notice and this permission are preserved in
;; all copies.
;;
;; You should have received a copy of the GNU General Public License
;; along with this program; if not, you can either send email to this
;; program's maintainer or write to: The Free Software Foundation,
;; Inc.; 675 Massachusetts Avenue; Cambridge, MA 02139, USA.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; send bug reports to the author (tone.kokalj at ijs.si)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; Commentary:
;; This is the `ld1-mode', a major mode for composing the Quantum ESPRESSO
;; QE-ld1.x (atomic) input files. For the installation and usage, see the
;; user_guide.pdf in the Doc/ subdirectory of the original package
;; (quick installation instructions are also available in the README
;; file of the original package).
;;; Code:
(require 'font-lock)
(require 'regexp-opt)
(defvar ld1-mode-hook nil)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; basic variables
;; ld1's supercards (if any)
(defvar ld1-open-supercards (list ))
(defvar ld1-closed-supercards (list ))
;; ld1's namelists
(defvar ld1-namelists (list "&INPUT" "&INPUTP" "&TEST" ))
(defvar qe-end-namelist (list "&END" "/"))
;; ld1's variables
(defvar ld1-vars (list "atom" "author" "beta" "cau_fact" "config" "configts" "decut" "deld" "dft" "dx" "ecutmax" "ecutmin" "emaxld" "eminld" "file_beta" "file_charge" "file_chi" "file_core" "file_pseudo" "file_pseudopw" "file_qvan" "file_recon" "file_screen" "file_wfcaegen" "file_wfcncgen" "file_wfcusgen" "frozen_core" "isic" "iswitch" "latt" "lgipaw_reconstruction" "lloc" "lpaw" "lsave_wfc" "lsd" "lsdts" "lsmall" "max_out_wfc" "nconf" "new_core_ps" "nlcc" "nld" "noscf" "prefix" "pseudotype" "rcloc" "rcore" "rcutv" "rel" "rel_dist" "relpert" "rho0" "rlderiv" "rm" "rmatch_augfun" "rmatch_augfun_nc" "rmax" "rpwe" "rytoev_fact" "title" "tm" "tr2" "use_paw_as_gipaw" "vdw" "verbosity" "which_augfun" "write_coulomb" "xmin" "zed" "zval" ))
;; ld1's cards & keywords
(defvar ld1-cards (list "__NO-CARDS" ))
;; ld1's flags
(defvar ld1-flags (list ))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; derived variables
(defvar ld1-open-supercards-regexp (regexp-opt ld1-open-supercards 'symbols)) ; may not exists
(defvar ld1-closed-supercards-regexp (regexp-opt ld1-closed-supercards 'symbols)) ; may not exists
(defvar ld1-cards-regexp (regexp-opt
(append ld1-cards ld1-open-supercards) 'symbols))
(defvar ld1-flags-regexp (regexp-opt ld1-flags 'symbols))
(defvar ld1-namelist-face (cons (regexp-opt (append ld1-namelists qe-end-namelist) 'symbols) font-lock-function-name-face))
(defvar ld1-variable-face (cons (regexp-opt ld1-vars 'symbols) font-lock-variable-name-face))
;; logical values as constants
(defvar qe-logic-face (cons (regexp-opt (list ".t." ".true." ".f." ".false.")) font-lock-constant-face))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; regexp for indentation
(defvar ld1-decr-indent-fold-t-re (concat "^[ \t]*" (regexp-opt qe-end-namelist t)))
(defvar ld1-decr-indent-re (concat "^[ \t]*" (regexp-opt
(append ld1-cards ld1-open-supercards ld1-closed-supercards) t)))
;;
(defvar ld1-deindent-fold-t-re (concat "^[ \t]*" (regexp-opt qe-end-namelist t)))
;;
(defvar ld1-indent-fold-t-re (concat "^[ \t]*" (regexp-opt ld1-namelists t)))
(defvar ld1-indent-re (concat "^[ \t]*" (regexp-opt ld1-cards t)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; supercards, cards and flags are case sensitive -- here are the corresponding matchers
(defun ld1-closed-supercards-matcher (limit)
(let ((case-fold-search nil))
(re-search-forward ld1-closed-supercards-regexp limit 'no-error)))
(defun ld1-cards-matcher (limit)
(let ((case-fold-search nil))
(re-search-forward ld1-cards-regexp limit 'no-error)))
(defun ld1-flags-matcher (limit)
(let ((case-fold-search nil))
(re-search-forward ld1-flags-regexp limit 'no-error)))
(font-lock-add-keywords 'ld1-mode (list
ld1-namelist-face
ld1-variable-face
qe-logic-face
'("," . font-lock-builtin-face)
'("(" . font-lock-builtin-face)
'(")" . font-lock-builtin-face)
))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; register the keywords
(font-lock-add-keywords 'ld1-mode '(
(ld1-closed-supercards-matcher 1 font-lock-preprocessor-face t)
(ld1-cards-matcher 1 font-lock-keyword-face t)
(ld1-flags-matcher 1 font-lock-type-face t)
))
;;(defvar ld1-keywords '(ld1-namelist-face ld1-variable-face))
(defvar ld1-keywords '(((list "") . font-lock-constant-face)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; define the sytnax of strings
(defvar ld1-mode-syntax-table
(let ((table (make-syntax-table)))
(modify-syntax-entry ?\' "\"'" table)
(modify-syntax-entry ?\" "\"\"" table)
table)
"Syntax table in use in `ld1-mode' buffers.")
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; code for auto-indenting
(defvar qe-indent 3)
(defun ld1-indent-line ()
"Indent current line according to ld1 input syntax."
(interactive)
(beginning-of-line)
(if (bobp)
(indent-line-to 0) ; First line indented to column 0
(let ((not-indented t) cur-indent)
(if (or (looking-at ld1-decr-indent-fold-t-re)
(let ((case-fold-search nil)) (looking-at ld1-decr-indent-re))) ; If the line we are looking at is the end of a block, then decrease the indentation
(progn
(save-excursion
(forward-line -1)
(setq cur-indent (- (current-indentation) qe-indent)))
(if (< cur-indent 0) ; We can't indent past the left margin
(setq cur-indent 0)))
(save-excursion
(while not-indented ; Iterate backwards until we find an indentation hint
(forward-line -1)
(if (looking-at ld1-deindent-fold-t-re) ; This hint indicates that we need to indent at the level of the "/" token
(progn
(setq cur-indent (current-indentation))
(setq not-indented nil))
(if (or (looking-at ld1-indent-fold-t-re)
(let ((case-fold-search nil)) (looking-at ld1-indent-re))) ; This hint indicates that we need to indent an extra level
(progn
(setq cur-indent (+ (current-indentation) qe-indent)) ; Do the actual indenting
(setq not-indented nil))
(if (bobp)
(setq not-indented nil)))))))
(if cur-indent
(indent-line-to cur-indent)
(indent-line-to 0))))) ; If we didn't see an indentation hint, then allow no indentation
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; define the ld1-mode as derived-mode
(define-derived-mode ld1-mode prog-mode
"QE-ld1.x (atomic)"
"Major mode for editing Qunatum-ESPRESSO input files (QE-ld1.x (atomic) mode)"
(setq font-lock-defaults '((ld1-keywords) nil t))
(set (make-local-variable 'indent-line-function) 'ld1-indent-line)
;; define the syntax of comments
(setq comment-start "!")
(setq comment-end "")
(modify-syntax-entry ?! "< b" ld1-mode-syntax-table)
(modify-syntax-entry ?\n "> b" ld1-mode-syntax-table)
(modify-syntax-entry ?= " " ld1-mode-syntax-table) ;; treat "=" non symbol constituent
;; end
)
;; free memory
(setq ld1-namelists nil)
(setq ld1-vars nil)
(setq ld1-cards nil)
(setq ld1-flags nil)
(setq ld1-open-supercards nil)
(setq ld1-closed-supercards nil)
(require 'qe-funcs)
(provide 'ld1-mode)

Binary file not shown.

View File

@ -0,0 +1,237 @@
;; neb-mode.el
;;
;; Copyright (C) 2016 Quantum ESPRESSO group
;; This file is distributed under the terms of the
;; GNU General Public License. See the file `License'
;; in the root directory of the present distribution,
;; or http://www.gnu.org/copyleft/gpl.txt .
;;
;; Author: Anton Kokalj (tone.kokalj at ijs.si)
;;
;; Acknowledgments:
;;
;; The implementation of qe-modes package was made possible by several
;; useful and helpful resources that are gratefully acknowledged, in
;; particular: "Mode Tutorial" of Scott Andrew Borton
;; (https://www.emacswiki.org/emacs/ModeTutorial, for indentation
;; code), "Derived Mode" and "Sample Mode" pages
;; (https://www.emacswiki.org/emacs/DerivedMode,
;; https://www.emacswiki.org/emacs/SampleMode) as well as the very
;; useful resources of Xah Lee
;; (http://ergoemacs.org/emacs/elisp_syntax_coloring.html). Last but
;; not the least Sebastijan Peljhan is acknowledged for his work on
;; `xsf-mode' that inspired the idea of writing the qe-modes.
;; This file is not part of GNU Emacs.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation; either version 2, or (at your option)
;; any later version.
;;
;; This lisp script is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
;;
;; Permission is granted to distribute copies of this lisp script
;; provided the copyright notice and this permission are preserved in
;; all copies.
;;
;; You should have received a copy of the GNU General Public License
;; along with this program; if not, you can either send email to this
;; program's maintainer or write to: The Free Software Foundation,
;; Inc.; 675 Massachusetts Avenue; Cambridge, MA 02139, USA.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; send bug reports to the author (tone.kokalj at ijs.si)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; Commentary:
;; This is the `neb-mode', a major mode for composing the Quantum ESPRESSO
;; QE-neb.x input files. For the installation and usage, see the
;; user_guide.pdf in the Doc/ subdirectory of the original package
;; (quick installation instructions are also available in the README
;; file of the original package).
;;; Code:
(require 'font-lock)
(require 'regexp-opt)
(defvar neb-mode-hook nil)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; basic variables
;; neb's supercards (if any)
(defvar neb-open-supercards (list "FIRST_IMAGE" "INTERMEDIATE_IMAGE" "LAST_IMAGE" ))
(defvar neb-closed-supercards (list "BEGIN" "BEGIN_ENGINE_INPUT" "BEGIN_PATH_INPUT" "BEGIN_POSITIONS" "END" "END_ENGINE_INPUT" "END_PATH_INPUT" "END_POSITIONS" ))
;; neb's namelists
(defvar neb-namelists (list "&CELL" "&CONTROL" "&ELECTRONS" "&IONS" "&PATH" "&SYSTEM" ))
(defvar qe-end-namelist (list "&END" "/"))
;; neb's variables
(defvar neb-vars (list "A" "adaptive_thr" "angle1" "angle2" "assume_isolated" "B" "bfgs_ndim" "block" "block_1" "block_2" "block_height" "C" "calculation" "cell_dofree" "cell_dynamics" "cell_factor" "celldm" "CI_scheme" "constrained_magnetization" "conv_thr" "conv_thr_init" "conv_thr_multi" "cosAB" "cosAC" "cosBC" "degauss" "delta_t" "dftd3_threebody" "dftd3_version" "diago_cg_maxiter" "diago_david_ndim" "diago_full_acc" "diago_thr_init" "diagonalization" "dipfield" "disk_io" "ds" "dt" "eamp" "ecfixed" "ecutfock" "ecutrho" "ecutvcut" "ecutwfc" "edir" "efield" "efield_cart" "efield_phase" "electron_maxstep" "emaxpos" "eopreg" "esm_bc" "esm_efield" "esm_nfit" "esm_w" "etot_conv_thr" "exx_fraction" "exxdiv_treatment" "fcp_mu" "fcp_tot_charge_first" "fcp_tot_charge_last" "first_last_opt" "fixed_magnetization" "forc_conv_thr" "force_symmorphic" "gate" "gdir" "Hubbard_alpha" "Hubbard_beta" "Hubbard_J" "Hubbard_J0" "Hubbard_U" "ibrav" "input_dft" "ion_dynamics" "ion_positions" "ion_temperature" "iprint" "k_max" "k_min" "lambda" "lberry" "lda_plus_u" "lda_plus_u_kind" "lelfield" "lfcpopt" "lforcet" "lkpoint_dir" "localization_thr" "london" "london_c6" "london_rcut" "london_rvdw" "london_s6" "lorbm" "lspinorb" "max_seconds" "minimum_image" "mixing_beta" "mixing_fixed_ns" "mixing_mode" "mixing_ndim" "nat" "nberrycyc" "nbnd" "no_t_rev" "noinv" "noncolin" "nosym" "nosym_evc" "nppstr" "nqx1" "nqx2" "nqx3" "nr1" "nr1s" "nr2" "nr2s" "nr3" "nr3s" "nraise" "nspin" "nstep" "nstep_path" "ntyp" "num_of_images" "occupations" "one_atom_occupations" "opt_scheme" "origin_choice" "ortho_para" "outdir" "path_thr" "pot_extrapolation" "prefix" "press" "press_conv_thr" "pseudo_dir" "q2sigma" "qcutz" "real_space" "refold_pos" "relaxz" "remove_rigid_rot" "report" "restart_mode" "rhombohedral" "scf_must_converge" "screening_parameter" "smearing" "space_group" "starting_charge" "starting_magnetization" "starting_ns_eigenvalue" "starting_spin_angle" "startingpot" "startingwfc" "string_method" "tefield" "temp_req" "tempw" "title" "tolp" "tot_charge" "tot_magnetization" "tprnfor" "tqr" "trust_radius_ini" "trust_radius_max" "trust_radius_min" "ts_vdw_econv_thr" "ts_vdw_isolated" "tstress" "U_projection_type" "uniqueb" "upscale" "use_all_frac" "use_freezing" "use_masses" "vdw_corr" "verbosity" "w_1" "w_2" "wf_collect" "wfc_extrapolation" "wfcdir" "wmass" "x_gamma_extrapolation" "xdm" "xdm_a1" "xdm_a2" "zgate" ))
;; neb's cards & keywords
(defvar neb-cards (list "ATOMIC_FORCES" "ATOMIC_POSITIONS" "ATOMIC_SPECIES" "CELL_PARAMETERS" "CLIMBING_IMAGES" "CONSTRAINTS" "K_POINTS" "OCCUPATIONS" ))
;; neb's flags
(defvar neb-flags (list "alat" "angstrom" "automatic" "bohr" "crystal" "crystal_b" "crystal_c" "crystal_sg" "gamma" "tpiba" "tpiba_b" "tpiba_c" ))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; derived variables
(defvar neb-open-supercards-regexp (regexp-opt neb-open-supercards 'symbols)) ; may not exists
(defvar neb-closed-supercards-regexp (regexp-opt neb-closed-supercards 'symbols)) ; may not exists
(defvar neb-cards-regexp (regexp-opt
(append neb-cards neb-open-supercards) 'symbols))
(defvar neb-flags-regexp (regexp-opt neb-flags 'symbols))
(defvar neb-namelist-face (cons (regexp-opt (append neb-namelists qe-end-namelist) 'symbols) font-lock-function-name-face))
(defvar neb-variable-face (cons (regexp-opt neb-vars 'symbols) font-lock-variable-name-face))
;; logical values as constants
(defvar qe-logic-face (cons (regexp-opt (list ".t." ".true." ".f." ".false.")) font-lock-constant-face))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; regexp for indentation
(defvar neb-decr-indent-fold-t-re (concat "^[ \t]*" (regexp-opt qe-end-namelist t)))
(defvar neb-decr-indent-re (concat "^[ \t]*" (regexp-opt
(append neb-cards neb-open-supercards neb-closed-supercards) t)))
;;
(defvar neb-deindent-fold-t-re (concat "^[ \t]*" (regexp-opt qe-end-namelist t)))
;;
(defvar neb-indent-fold-t-re (concat "^[ \t]*" (regexp-opt neb-namelists t)))
(defvar neb-indent-re (concat "^[ \t]*" (regexp-opt neb-cards t)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; supercards, cards and flags are case sensitive -- here are the corresponding matchers
(defun neb-closed-supercards-matcher (limit)
(let ((case-fold-search nil))
(re-search-forward neb-closed-supercards-regexp limit 'no-error)))
(defun neb-cards-matcher (limit)
(let ((case-fold-search nil))
(re-search-forward neb-cards-regexp limit 'no-error)))
(defun neb-flags-matcher (limit)
(let ((case-fold-search nil))
(re-search-forward neb-flags-regexp limit 'no-error)))
(font-lock-add-keywords 'neb-mode (list
neb-namelist-face
neb-variable-face
qe-logic-face
'("," . font-lock-builtin-face)
'("(" . font-lock-builtin-face)
'(")" . font-lock-builtin-face)
))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; register the keywords
(font-lock-add-keywords 'neb-mode '(
(neb-closed-supercards-matcher 1 font-lock-preprocessor-face t)
(neb-cards-matcher 1 font-lock-keyword-face t)
(neb-flags-matcher 1 font-lock-type-face t)
))
;;(defvar neb-keywords '(neb-namelist-face neb-variable-face))
(defvar neb-keywords '(((list "") . font-lock-constant-face)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; define the sytnax of strings
(defvar neb-mode-syntax-table
(let ((table (make-syntax-table)))
(modify-syntax-entry ?\' "\"'" table)
(modify-syntax-entry ?\" "\"\"" table)
table)
"Syntax table in use in `neb-mode' buffers.")
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; code for auto-indenting
(defvar qe-indent 3)
(defun neb-indent-line ()
"Indent current line according to neb input syntax."
(interactive)
(beginning-of-line)
(if (bobp)
(indent-line-to 0) ; First line indented to column 0
(let ((not-indented t) cur-indent)
(if (or (looking-at neb-decr-indent-fold-t-re)
(let ((case-fold-search nil)) (looking-at neb-decr-indent-re))) ; If the line we are looking at is the end of a block, then decrease the indentation
(progn
(save-excursion
(forward-line -1)
(setq cur-indent (- (current-indentation) qe-indent)))
(if (< cur-indent 0) ; We can't indent past the left margin
(setq cur-indent 0)))
(save-excursion
(while not-indented ; Iterate backwards until we find an indentation hint
(forward-line -1)
(if (looking-at neb-deindent-fold-t-re) ; This hint indicates that we need to indent at the level of the "/" token
(progn
(setq cur-indent (current-indentation))
(setq not-indented nil))
(if (or (looking-at neb-indent-fold-t-re)
(let ((case-fold-search nil)) (looking-at neb-indent-re))) ; This hint indicates that we need to indent an extra level
(progn
(setq cur-indent (+ (current-indentation) qe-indent)) ; Do the actual indenting
(setq not-indented nil))
(if (bobp)
(setq not-indented nil)))))))
(if cur-indent
(indent-line-to cur-indent)
(indent-line-to 0))))) ; If we didn't see an indentation hint, then allow no indentation
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; define the neb-mode as derived-mode
(define-derived-mode neb-mode prog-mode
"QE-neb.x"
"Major mode for editing Qunatum-ESPRESSO input files (QE-neb.x mode)"
(setq font-lock-defaults '((neb-keywords) nil t))
(set (make-local-variable 'indent-line-function) 'neb-indent-line)
;; define the syntax of comments
(setq comment-start "!")
(setq comment-end "")
(modify-syntax-entry ?! "< b" neb-mode-syntax-table)
(modify-syntax-entry ?\n "> b" neb-mode-syntax-table)
(modify-syntax-entry ?= " " neb-mode-syntax-table) ;; treat "=" non symbol constituent
;; end
)
;; free memory
(setq neb-namelists nil)
(setq neb-vars nil)
(setq neb-cards nil)
(setq neb-flags nil)
(setq neb-open-supercards nil)
(setq neb-closed-supercards nil)
(require 'qe-funcs)
(provide 'neb-mode)

Binary file not shown.

View File

@ -0,0 +1,237 @@
;; ph-mode.el
;;
;; Copyright (C) 2016 Quantum ESPRESSO group
;; This file is distributed under the terms of the
;; GNU General Public License. See the file `License'
;; in the root directory of the present distribution,
;; or http://www.gnu.org/copyleft/gpl.txt .
;;
;; Author: Anton Kokalj (tone.kokalj at ijs.si)
;;
;; Acknowledgments:
;;
;; The implementation of qe-modes package was made possible by several
;; useful and helpful resources that are gratefully acknowledged, in
;; particular: "Mode Tutorial" of Scott Andrew Borton
;; (https://www.emacswiki.org/emacs/ModeTutorial, for indentation
;; code), "Derived Mode" and "Sample Mode" pages
;; (https://www.emacswiki.org/emacs/DerivedMode,
;; https://www.emacswiki.org/emacs/SampleMode) as well as the very
;; useful resources of Xah Lee
;; (http://ergoemacs.org/emacs/elisp_syntax_coloring.html). Last but
;; not the least Sebastijan Peljhan is acknowledged for his work on
;; `xsf-mode' that inspired the idea of writing the qe-modes.
;; This file is not part of GNU Emacs.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation; either version 2, or (at your option)
;; any later version.
;;
;; This lisp script is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
;;
;; Permission is granted to distribute copies of this lisp script
;; provided the copyright notice and this permission are preserved in
;; all copies.
;;
;; You should have received a copy of the GNU General Public License
;; along with this program; if not, you can either send email to this
;; program's maintainer or write to: The Free Software Foundation,
;; Inc.; 675 Massachusetts Avenue; Cambridge, MA 02139, USA.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; send bug reports to the author (tone.kokalj at ijs.si)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; Commentary:
;; This is the `ph-mode', a major mode for composing the Quantum ESPRESSO
;; QE-ph.x input files. For the installation and usage, see the
;; user_guide.pdf in the Doc/ subdirectory of the original package
;; (quick installation instructions are also available in the README
;; file of the original package).
;;; Code:
(require 'font-lock)
(require 'regexp-opt)
(defvar ph-mode-hook nil)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; basic variables
;; ph's supercards (if any)
(defvar ph-open-supercards (list ))
(defvar ph-closed-supercards (list ))
;; ph's namelists
(defvar ph-namelists (list "&INPUTPH" ))
(defvar qe-end-namelist (list "&END" "/"))
;; ph's variables
(defvar ph-vars (list "alpha_mix" "amass" "asr" "dek" "drho_star" "dvscf_star" "electron_phonon" "elop" "epsil" "eth_ns" "eth_rps" "fildrho" "fildvscf" "fildyn" "fpol" "k1" "k2" "k3" "last_irr" "last_q" "ldiag" "ldisp" "lnoloc" "low_directory_check" "lqdir" "lraman" "lrpa" "lshift_q" "max_seconds" "modenum" "nat_todo" "niter_ph" "nk1" "nk2" "nk3" "nmix_ph" "nogg" "nq1" "nq2" "nq3" "only_init" "outdir" "prefix" "q2d" "q_in_band_form" "qplot" "read_dns_bare" "recover" "reduce_io" "search_sym" "start_irr" "start_q" "tr2_ph" "trans" "verbosity" "zeu" "zue" ))
;; ph's cards & keywords
(defvar ph-cards (list "__NO-CARDS" ))
;; ph's flags
(defvar ph-flags (list ))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; derived variables
(defvar ph-open-supercards-regexp (regexp-opt ph-open-supercards 'symbols)) ; may not exists
(defvar ph-closed-supercards-regexp (regexp-opt ph-closed-supercards 'symbols)) ; may not exists
(defvar ph-cards-regexp (regexp-opt
(append ph-cards ph-open-supercards) 'symbols))
(defvar ph-flags-regexp (regexp-opt ph-flags 'symbols))
(defvar ph-namelist-face (cons (regexp-opt (append ph-namelists qe-end-namelist) 'symbols) font-lock-function-name-face))
(defvar ph-variable-face (cons (regexp-opt ph-vars 'symbols) font-lock-variable-name-face))
;; logical values as constants
(defvar qe-logic-face (cons (regexp-opt (list ".t." ".true." ".f." ".false.")) font-lock-constant-face))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; regexp for indentation
(defvar ph-decr-indent-fold-t-re (concat "^[ \t]*" (regexp-opt qe-end-namelist t)))
(defvar ph-decr-indent-re (concat "^[ \t]*" (regexp-opt
(append ph-cards ph-open-supercards ph-closed-supercards) t)))
;;
(defvar ph-deindent-fold-t-re (concat "^[ \t]*" (regexp-opt qe-end-namelist t)))
;;
(defvar ph-indent-fold-t-re (concat "^[ \t]*" (regexp-opt ph-namelists t)))
(defvar ph-indent-re (concat "^[ \t]*" (regexp-opt ph-cards t)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; supercards, cards and flags are case sensitive -- here are the corresponding matchers
(defun ph-closed-supercards-matcher (limit)
(let ((case-fold-search nil))
(re-search-forward ph-closed-supercards-regexp limit 'no-error)))
(defun ph-cards-matcher (limit)
(let ((case-fold-search nil))
(re-search-forward ph-cards-regexp limit 'no-error)))
(defun ph-flags-matcher (limit)
(let ((case-fold-search nil))
(re-search-forward ph-flags-regexp limit 'no-error)))
(font-lock-add-keywords 'ph-mode (list
ph-namelist-face
ph-variable-face
qe-logic-face
'("," . font-lock-builtin-face)
'("(" . font-lock-builtin-face)
'(")" . font-lock-builtin-face)
))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; register the keywords
(font-lock-add-keywords 'ph-mode '(
(ph-closed-supercards-matcher 1 font-lock-preprocessor-face t)
(ph-cards-matcher 1 font-lock-keyword-face t)
(ph-flags-matcher 1 font-lock-type-face t)
))
;;(defvar ph-keywords '(ph-namelist-face ph-variable-face))
(defvar ph-keywords '(((list "") . font-lock-constant-face)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; define the sytnax of strings
(defvar ph-mode-syntax-table
(let ((table (make-syntax-table)))
(modify-syntax-entry ?\' "\"'" table)
(modify-syntax-entry ?\" "\"\"" table)
table)
"Syntax table in use in `ph-mode' buffers.")
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; code for auto-indenting
(defvar qe-indent 3)
(defun ph-indent-line ()
"Indent current line according to ph input syntax."
(interactive)
(beginning-of-line)
(if (bobp)
(indent-line-to 0) ; First line indented to column 0
(let ((not-indented t) cur-indent)
(if (or (looking-at ph-decr-indent-fold-t-re)
(let ((case-fold-search nil)) (looking-at ph-decr-indent-re))) ; If the line we are looking at is the end of a block, then decrease the indentation
(progn
(save-excursion
(forward-line -1)
(setq cur-indent (- (current-indentation) qe-indent)))
(if (< cur-indent 0) ; We can't indent past the left margin
(setq cur-indent 0)))
(save-excursion
(while not-indented ; Iterate backwards until we find an indentation hint
(forward-line -1)
(if (looking-at ph-deindent-fold-t-re) ; This hint indicates that we need to indent at the level of the "/" token
(progn
(setq cur-indent (current-indentation))
(setq not-indented nil))
(if (or (looking-at ph-indent-fold-t-re)
(let ((case-fold-search nil)) (looking-at ph-indent-re))) ; This hint indicates that we need to indent an extra level
(progn
(setq cur-indent (+ (current-indentation) qe-indent)) ; Do the actual indenting
(setq not-indented nil))
(if (bobp)
(setq not-indented nil)))))))
(if cur-indent
(indent-line-to cur-indent)
(indent-line-to 0))))) ; If we didn't see an indentation hint, then allow no indentation
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; define the ph-mode as derived-mode
(define-derived-mode ph-mode prog-mode
"QE-ph.x"
"Major mode for editing Qunatum-ESPRESSO input files (QE-ph.x mode)"
(setq font-lock-defaults '((ph-keywords) nil t))
(set (make-local-variable 'indent-line-function) 'ph-indent-line)
;; define the syntax of comments
(setq comment-start "!")
(setq comment-end "")
(modify-syntax-entry ?! "< b" ph-mode-syntax-table)
(modify-syntax-entry ?\n "> b" ph-mode-syntax-table)
(modify-syntax-entry ?= " " ph-mode-syntax-table) ;; treat "=" non symbol constituent
;; end
)
;; free memory
(setq ph-namelists nil)
(setq ph-vars nil)
(setq ph-cards nil)
(setq ph-flags nil)
(setq ph-open-supercards nil)
(setq ph-closed-supercards nil)
(require 'qe-funcs)
(provide 'ph-mode)

Binary file not shown.

View File

@ -0,0 +1,237 @@
;; pp-mode.el
;;
;; Copyright (C) 2016 Quantum ESPRESSO group
;; This file is distributed under the terms of the
;; GNU General Public License. See the file `License'
;; in the root directory of the present distribution,
;; or http://www.gnu.org/copyleft/gpl.txt .
;;
;; Author: Anton Kokalj (tone.kokalj at ijs.si)
;;
;; Acknowledgments:
;;
;; The implementation of qe-modes package was made possible by several
;; useful and helpful resources that are gratefully acknowledged, in
;; particular: "Mode Tutorial" of Scott Andrew Borton
;; (https://www.emacswiki.org/emacs/ModeTutorial, for indentation
;; code), "Derived Mode" and "Sample Mode" pages
;; (https://www.emacswiki.org/emacs/DerivedMode,
;; https://www.emacswiki.org/emacs/SampleMode) as well as the very
;; useful resources of Xah Lee
;; (http://ergoemacs.org/emacs/elisp_syntax_coloring.html). Last but
;; not the least Sebastijan Peljhan is acknowledged for his work on
;; `xsf-mode' that inspired the idea of writing the qe-modes.
;; This file is not part of GNU Emacs.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation; either version 2, or (at your option)
;; any later version.
;;
;; This lisp script is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
;;
;; Permission is granted to distribute copies of this lisp script
;; provided the copyright notice and this permission are preserved in
;; all copies.
;;
;; You should have received a copy of the GNU General Public License
;; along with this program; if not, you can either send email to this
;; program's maintainer or write to: The Free Software Foundation,
;; Inc.; 675 Massachusetts Avenue; Cambridge, MA 02139, USA.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; send bug reports to the author (tone.kokalj at ijs.si)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; Commentary:
;; This is the `pp-mode', a major mode for composing the Quantum ESPRESSO
;; QE-pp.x input files. For the installation and usage, see the
;; user_guide.pdf in the Doc/ subdirectory of the original package
;; (quick installation instructions are also available in the README
;; file of the original package).
;;; Code:
(require 'font-lock)
(require 'regexp-opt)
(defvar pp-mode-hook nil)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; basic variables
;; pp's supercards (if any)
(defvar pp-open-supercards (list ))
(defvar pp-closed-supercards (list ))
;; pp's namelists
(defvar pp-namelists (list "&INPUTPP" "&PLOT" ))
(defvar qe-end-namelist (list "&END" "/"))
;; pp's variables
(defvar pp-vars (list "degauss_ldos" "delta_e" "e1" "e2" "e3" "emax" "emin" "fileout" "filepp" "filplot" "iflag" "interpolation" "kband" "kpoint" "lsign" "nfile" "nx" "ny" "nz" "outdir" "output_format" "plot_num" "prefix" "radius" "sample_bias" "spin_component" "weight" "x0" ))
;; pp's cards & keywords
(defvar pp-cards (list "__NO-CARDS" ))
;; pp's flags
(defvar pp-flags (list ))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; derived variables
(defvar pp-open-supercards-regexp (regexp-opt pp-open-supercards 'symbols)) ; may not exists
(defvar pp-closed-supercards-regexp (regexp-opt pp-closed-supercards 'symbols)) ; may not exists
(defvar pp-cards-regexp (regexp-opt
(append pp-cards pp-open-supercards) 'symbols))
(defvar pp-flags-regexp (regexp-opt pp-flags 'symbols))
(defvar pp-namelist-face (cons (regexp-opt (append pp-namelists qe-end-namelist) 'symbols) font-lock-function-name-face))
(defvar pp-variable-face (cons (regexp-opt pp-vars 'symbols) font-lock-variable-name-face))
;; logical values as constants
(defvar qe-logic-face (cons (regexp-opt (list ".t." ".true." ".f." ".false.")) font-lock-constant-face))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; regexp for indentation
(defvar pp-decr-indent-fold-t-re (concat "^[ \t]*" (regexp-opt qe-end-namelist t)))
(defvar pp-decr-indent-re (concat "^[ \t]*" (regexp-opt
(append pp-cards pp-open-supercards pp-closed-supercards) t)))
;;
(defvar pp-deindent-fold-t-re (concat "^[ \t]*" (regexp-opt qe-end-namelist t)))
;;
(defvar pp-indent-fold-t-re (concat "^[ \t]*" (regexp-opt pp-namelists t)))
(defvar pp-indent-re (concat "^[ \t]*" (regexp-opt pp-cards t)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; supercards, cards and flags are case sensitive -- here are the corresponding matchers
(defun pp-closed-supercards-matcher (limit)
(let ((case-fold-search nil))
(re-search-forward pp-closed-supercards-regexp limit 'no-error)))
(defun pp-cards-matcher (limit)
(let ((case-fold-search nil))
(re-search-forward pp-cards-regexp limit 'no-error)))
(defun pp-flags-matcher (limit)
(let ((case-fold-search nil))
(re-search-forward pp-flags-regexp limit 'no-error)))
(font-lock-add-keywords 'pp-mode (list
pp-namelist-face
pp-variable-face
qe-logic-face
'("," . font-lock-builtin-face)
'("(" . font-lock-builtin-face)
'(")" . font-lock-builtin-face)
))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; register the keywords
(font-lock-add-keywords 'pp-mode '(
(pp-closed-supercards-matcher 1 font-lock-preprocessor-face t)
(pp-cards-matcher 1 font-lock-keyword-face t)
(pp-flags-matcher 1 font-lock-type-face t)
))
;;(defvar pp-keywords '(pp-namelist-face pp-variable-face))
(defvar pp-keywords '(((list "") . font-lock-constant-face)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; define the sytnax of strings
(defvar pp-mode-syntax-table
(let ((table (make-syntax-table)))
(modify-syntax-entry ?\' "\"'" table)
(modify-syntax-entry ?\" "\"\"" table)
table)
"Syntax table in use in `pp-mode' buffers.")
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; code for auto-indenting
(defvar qe-indent 3)
(defun pp-indent-line ()
"Indent current line according to pp input syntax."
(interactive)
(beginning-of-line)
(if (bobp)
(indent-line-to 0) ; First line indented to column 0
(let ((not-indented t) cur-indent)
(if (or (looking-at pp-decr-indent-fold-t-re)
(let ((case-fold-search nil)) (looking-at pp-decr-indent-re))) ; If the line we are looking at is the end of a block, then decrease the indentation
(progn
(save-excursion
(forward-line -1)
(setq cur-indent (- (current-indentation) qe-indent)))
(if (< cur-indent 0) ; We can't indent past the left margin
(setq cur-indent 0)))
(save-excursion
(while not-indented ; Iterate backwards until we find an indentation hint
(forward-line -1)
(if (looking-at pp-deindent-fold-t-re) ; This hint indicates that we need to indent at the level of the "/" token
(progn
(setq cur-indent (current-indentation))
(setq not-indented nil))
(if (or (looking-at pp-indent-fold-t-re)
(let ((case-fold-search nil)) (looking-at pp-indent-re))) ; This hint indicates that we need to indent an extra level
(progn
(setq cur-indent (+ (current-indentation) qe-indent)) ; Do the actual indenting
(setq not-indented nil))
(if (bobp)
(setq not-indented nil)))))))
(if cur-indent
(indent-line-to cur-indent)
(indent-line-to 0))))) ; If we didn't see an indentation hint, then allow no indentation
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; define the pp-mode as derived-mode
(define-derived-mode pp-mode prog-mode
"QE-pp.x"
"Major mode for editing Qunatum-ESPRESSO input files (QE-pp.x mode)"
(setq font-lock-defaults '((pp-keywords) nil t))
(set (make-local-variable 'indent-line-function) 'pp-indent-line)
;; define the syntax of comments
(setq comment-start "!")
(setq comment-end "")
(modify-syntax-entry ?! "< b" pp-mode-syntax-table)
(modify-syntax-entry ?\n "> b" pp-mode-syntax-table)
(modify-syntax-entry ?= " " pp-mode-syntax-table) ;; treat "=" non symbol constituent
;; end
)
;; free memory
(setq pp-namelists nil)
(setq pp-vars nil)
(setq pp-cards nil)
(setq pp-flags nil)
(setq pp-open-supercards nil)
(setq pp-closed-supercards nil)
(require 'qe-funcs)
(provide 'pp-mode)

Binary file not shown.

View File

@ -0,0 +1,237 @@
;; pw-mode.el
;;
;; Copyright (C) 2016 Quantum ESPRESSO group
;; This file is distributed under the terms of the
;; GNU General Public License. See the file `License'
;; in the root directory of the present distribution,
;; or http://www.gnu.org/copyleft/gpl.txt .
;;
;; Author: Anton Kokalj (tone.kokalj at ijs.si)
;;
;; Acknowledgments:
;;
;; The implementation of qe-modes package was made possible by several
;; useful and helpful resources that are gratefully acknowledged, in
;; particular: "Mode Tutorial" of Scott Andrew Borton
;; (https://www.emacswiki.org/emacs/ModeTutorial, for indentation
;; code), "Derived Mode" and "Sample Mode" pages
;; (https://www.emacswiki.org/emacs/DerivedMode,
;; https://www.emacswiki.org/emacs/SampleMode) as well as the very
;; useful resources of Xah Lee
;; (http://ergoemacs.org/emacs/elisp_syntax_coloring.html). Last but
;; not the least Sebastijan Peljhan is acknowledged for his work on
;; `xsf-mode' that inspired the idea of writing the qe-modes.
;; This file is not part of GNU Emacs.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation; either version 2, or (at your option)
;; any later version.
;;
;; This lisp script is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
;;
;; Permission is granted to distribute copies of this lisp script
;; provided the copyright notice and this permission are preserved in
;; all copies.
;;
;; You should have received a copy of the GNU General Public License
;; along with this program; if not, you can either send email to this
;; program's maintainer or write to: The Free Software Foundation,
;; Inc.; 675 Massachusetts Avenue; Cambridge, MA 02139, USA.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; send bug reports to the author (tone.kokalj at ijs.si)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; Commentary:
;; This is the `pw-mode', a major mode for composing the Quantum ESPRESSO
;; QE-pw.x input files. For the installation and usage, see the
;; user_guide.pdf in the Doc/ subdirectory of the original package
;; (quick installation instructions are also available in the README
;; file of the original package).
;;; Code:
(require 'font-lock)
(require 'regexp-opt)
(defvar pw-mode-hook nil)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; basic variables
;; pw's supercards (if any)
(defvar pw-open-supercards (list ))
(defvar pw-closed-supercards (list ))
;; pw's namelists
(defvar pw-namelists (list "&CELL" "&CONTROL" "&ELECTRONS" "&IONS" "&SYSTEM" ))
(defvar qe-end-namelist (list "&END" "/"))
;; pw's variables
(defvar pw-vars (list "A" "adaptive_thr" "angle1" "angle2" "assume_isolated" "B" "bfgs_ndim" "block" "block_1" "block_2" "block_height" "C" "calculation" "cell_dofree" "cell_dynamics" "cell_factor" "celldm" "constrained_magnetization" "conv_thr" "conv_thr_init" "conv_thr_multi" "cosAB" "cosAC" "cosBC" "degauss" "delta_t" "dftd3_threebody" "dftd3_version" "diago_cg_maxiter" "diago_david_ndim" "diago_full_acc" "diago_thr_init" "diagonalization" "dipfield" "disk_io" "dt" "eamp" "ecfixed" "ecutfock" "ecutrho" "ecutvcut" "ecutwfc" "edir" "efield" "efield_cart" "efield_phase" "electron_maxstep" "emaxpos" "eopreg" "esm_bc" "esm_efield" "esm_nfit" "esm_w" "etot_conv_thr" "exx_fraction" "exxdiv_treatment" "fcp_mu" "fixed_magnetization" "forc_conv_thr" "force_symmorphic" "gate" "gdir" "Hubbard_alpha" "Hubbard_beta" "Hubbard_J" "Hubbard_J0" "Hubbard_U" "ibrav" "input_dft" "ion_dynamics" "ion_positions" "ion_temperature" "iprint" "lambda" "lberry" "lda_plus_u" "lda_plus_u_kind" "lelfield" "lfcpopt" "lforcet" "lkpoint_dir" "localization_thr" "london" "london_c6" "london_rcut" "london_rvdw" "london_s6" "lorbm" "lspinorb" "max_seconds" "mixing_beta" "mixing_fixed_ns" "mixing_mode" "mixing_ndim" "nat" "nberrycyc" "nbnd" "no_t_rev" "noinv" "noncolin" "nosym" "nosym_evc" "nppstr" "nqx1" "nqx2" "nqx3" "nr1" "nr1s" "nr2" "nr2s" "nr3" "nr3s" "nraise" "nspin" "nstep" "ntyp" "occupations" "one_atom_occupations" "origin_choice" "ortho_para" "outdir" "pot_extrapolation" "prefix" "press" "press_conv_thr" "pseudo_dir" "q2sigma" "qcutz" "real_space" "refold_pos" "relaxz" "remove_rigid_rot" "report" "restart_mode" "rhombohedral" "scf_must_converge" "screening_parameter" "smearing" "space_group" "starting_charge" "starting_magnetization" "starting_ns_eigenvalue" "starting_spin_angle" "startingpot" "startingwfc" "tefield" "tempw" "title" "tolp" "tot_charge" "tot_magnetization" "tprnfor" "tqr" "trust_radius_ini" "trust_radius_max" "trust_radius_min" "ts_vdw_econv_thr" "ts_vdw_isolated" "tstress" "U_projection_type" "uniqueb" "upscale" "use_all_frac" "vdw_corr" "verbosity" "w_1" "w_2" "wf_collect" "wfc_extrapolation" "wfcdir" "wmass" "x_gamma_extrapolation" "xdm" "xdm_a1" "xdm_a2" "zgate" ))
;; pw's cards & keywords
(defvar pw-cards (list "ATOMIC_FORCES" "ATOMIC_POSITIONS" "ATOMIC_SPECIES" "CELL_PARAMETERS" "CONSTRAINTS" "K_POINTS" "OCCUPATIONS" ))
;; pw's flags
(defvar pw-flags (list "alat" "angstrom" "automatic" "bohr" "crystal" "crystal_b" "crystal_c" "crystal_sg" "gamma" "tpiba" "tpiba_b" "tpiba_c" ))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; derived variables
(defvar pw-open-supercards-regexp (regexp-opt pw-open-supercards 'symbols)) ; may not exists
(defvar pw-closed-supercards-regexp (regexp-opt pw-closed-supercards 'symbols)) ; may not exists
(defvar pw-cards-regexp (regexp-opt
(append pw-cards pw-open-supercards) 'symbols))
(defvar pw-flags-regexp (regexp-opt pw-flags 'symbols))
(defvar pw-namelist-face (cons (regexp-opt (append pw-namelists qe-end-namelist) 'symbols) font-lock-function-name-face))
(defvar pw-variable-face (cons (regexp-opt pw-vars 'symbols) font-lock-variable-name-face))
;; logical values as constants
(defvar qe-logic-face (cons (regexp-opt (list ".t." ".true." ".f." ".false.")) font-lock-constant-face))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; regexp for indentation
(defvar pw-decr-indent-fold-t-re (concat "^[ \t]*" (regexp-opt qe-end-namelist t)))
(defvar pw-decr-indent-re (concat "^[ \t]*" (regexp-opt
(append pw-cards pw-open-supercards pw-closed-supercards) t)))
;;
(defvar pw-deindent-fold-t-re (concat "^[ \t]*" (regexp-opt qe-end-namelist t)))
;;
(defvar pw-indent-fold-t-re (concat "^[ \t]*" (regexp-opt pw-namelists t)))
(defvar pw-indent-re (concat "^[ \t]*" (regexp-opt pw-cards t)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; supercards, cards and flags are case sensitive -- here are the corresponding matchers
(defun pw-closed-supercards-matcher (limit)
(let ((case-fold-search nil))
(re-search-forward pw-closed-supercards-regexp limit 'no-error)))
(defun pw-cards-matcher (limit)
(let ((case-fold-search nil))
(re-search-forward pw-cards-regexp limit 'no-error)))
(defun pw-flags-matcher (limit)
(let ((case-fold-search nil))
(re-search-forward pw-flags-regexp limit 'no-error)))
(font-lock-add-keywords 'pw-mode (list
pw-namelist-face
pw-variable-face
qe-logic-face
'("," . font-lock-builtin-face)
'("(" . font-lock-builtin-face)
'(")" . font-lock-builtin-face)
))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; register the keywords
(font-lock-add-keywords 'pw-mode '(
(pw-closed-supercards-matcher 1 font-lock-preprocessor-face t)
(pw-cards-matcher 1 font-lock-keyword-face t)
(pw-flags-matcher 1 font-lock-type-face t)
))
;;(defvar pw-keywords '(pw-namelist-face pw-variable-face))
(defvar pw-keywords '(((list "") . font-lock-constant-face)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; define the sytnax of strings
(defvar pw-mode-syntax-table
(let ((table (make-syntax-table)))
(modify-syntax-entry ?\' "\"'" table)
(modify-syntax-entry ?\" "\"\"" table)
table)
"Syntax table in use in `pw-mode' buffers.")
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; code for auto-indenting
(defvar qe-indent 3)
(defun pw-indent-line ()
"Indent current line according to pw input syntax."
(interactive)
(beginning-of-line)
(if (bobp)
(indent-line-to 0) ; First line indented to column 0
(let ((not-indented t) cur-indent)
(if (or (looking-at pw-decr-indent-fold-t-re)
(let ((case-fold-search nil)) (looking-at pw-decr-indent-re))) ; If the line we are looking at is the end of a block, then decrease the indentation
(progn
(save-excursion
(forward-line -1)
(setq cur-indent (- (current-indentation) qe-indent)))
(if (< cur-indent 0) ; We can't indent past the left margin
(setq cur-indent 0)))
(save-excursion
(while not-indented ; Iterate backwards until we find an indentation hint
(forward-line -1)
(if (looking-at pw-deindent-fold-t-re) ; This hint indicates that we need to indent at the level of the "/" token
(progn
(setq cur-indent (current-indentation))
(setq not-indented nil))
(if (or (looking-at pw-indent-fold-t-re)
(let ((case-fold-search nil)) (looking-at pw-indent-re))) ; This hint indicates that we need to indent an extra level
(progn
(setq cur-indent (+ (current-indentation) qe-indent)) ; Do the actual indenting
(setq not-indented nil))
(if (bobp)
(setq not-indented nil)))))))
(if cur-indent
(indent-line-to cur-indent)
(indent-line-to 0))))) ; If we didn't see an indentation hint, then allow no indentation
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; define the pw-mode as derived-mode
(define-derived-mode pw-mode prog-mode
"QE-pw.x"
"Major mode for editing Qunatum-ESPRESSO input files (QE-pw.x mode)"
(setq font-lock-defaults '((pw-keywords) nil t))
(set (make-local-variable 'indent-line-function) 'pw-indent-line)
;; define the syntax of comments
(setq comment-start "!")
(setq comment-end "")
(modify-syntax-entry ?! "< b" pw-mode-syntax-table)
(modify-syntax-entry ?\n "> b" pw-mode-syntax-table)
(modify-syntax-entry ?= " " pw-mode-syntax-table) ;; treat "=" non symbol constituent
;; end
)
;; free memory
(setq pw-namelists nil)
(setq pw-vars nil)
(setq pw-cards nil)
(setq pw-flags nil)
(setq pw-open-supercards nil)
(setq pw-closed-supercards nil)
(require 'qe-funcs)
(provide 'pw-mode)

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because one or more lines are too long

Binary file not shown.

View File

@ -0,0 +1,99 @@
;; qe-modes.el
;;
;; Copyright (C) 2016 Quantum ESPRESSO group
;; This file is distributed under the terms of the
;; GNU General Public License. See the file `License'
;; in the root directory of the present distribution,
;; or http://www.gnu.org/copyleft/gpl.txt .
;;
;; Author: Anton Kokalj (tone.kokalj at ijs.si)
;;
;; Acknowledgments:
;;
;; The implementation of qe-modes package was made possible by several
;; useful and helpful resources that are gratefully acknowledged, in
;; particular: "Mode Tutorial" of Scott Andrew Borton
;; (https://www.emacswiki.org/emacs/ModeTutorial, for indentation
;; code), "Derived Mode" and "Sample Mode" pages
;; (https://www.emacswiki.org/emacs/DerivedMode,
;; https://www.emacswiki.org/emacs/SampleMode) as well as the very
;; useful resources of Xah Lee
;; (http://ergoemacs.org/emacs/elisp_syntax_coloring.html). Last but
;; not the least Sebastijan Peljhan is acknowledged for his work on
;; `xsf-mode' that inspired the idea of writing the qe-modes.
;; This file is not part of GNU Emacs.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation; either version 2, or (at your option)
;; any later version.
;;
;; This lisp script is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
;;
;; Permission is granted to distribute copies of this lisp script
;; provided the copyright notice and this permission are preserved in
;; all copies.
;;
;; You should have received a copy of the GNU General Public License
;; along with this program; if not, you can either send email to this
;; program's maintainer or write to: The Free Software Foundation,
;; Inc.; 675 Massachusetts Avenue; Cambridge, MA 02139, USA.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; send bug reports to the author (tone.kokalj at ijs.si)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; Commentary:
;; This is the master `qe-modes.el' file, which loads various Quantum
;; ESPRESSO major modes. Add the following into your user-init-file
;; (e.g. ~/.emacs):
;;
;; (add-to-list 'load-path "/directory/of/your/qe-modes/")
;; (require 'qe-modes)
;;; Code:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; load generic Quantum ESPRESSO mode: it knows all QE namelists, cards, etc.
;;
(autoload 'qe-mode' "qe-mode.elc"
"Major mode for editing Quantum ESPRESSO input files" t)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; load specific modes: each knows only its own namelists, cards, etc.
;;
(autoload 'pw-mode' "pw-mode.elc"
"Major mode for editing Quantum ESPRESSO pw.x input files" t)
(autoload 'cp-mode' "cp-mode.elc"
"Major mode for editing Quantum ESPRESSO cp.x input files" t)
(autoload 'pp-mode' "pp-mode.elc"
"Major mode for editing Quantum ESPRESSO pp.x input files" t)
(autoload 'ld1-mode' "ld1-mode.elc"
"Major mode for editing Quantum ESPRESSO ld1.x input files" t)
(autoload 'neb-mode' "neb-mode.elc"
"Major mode for editing Quantum ESPRESSO neb.x input files" t)
(autoload 'ph-mode' "ph-mode.elc"
"Major mode for editing Quantum ESPRESSO ph.x input files" t)
(provide 'qe-modes)

Binary file not shown.

View File

@ -46,7 +46,7 @@
<tr><th style="margin: 3 3 3 10; background: #005789; background: linear-gradient(rgba(0,87,137,1),rgba(0,119,189,1)); color: #ffffee; ">
<h1 style="margin: 10 10 10 15; text-align: left;"> Input File Description </h1>
<h2 style="margin: 10 10 10 15; text-align: left;"> Program:
hp.x / PWscf / Quantum Espresso<span style="font-weight: normal;"> (version: git)</span>
hp.x / PWscf / Quantum Espresso<span style="font-weight: normal;"> (version: 6.4)</span>
</h2>
</th></tr>
<tr><td style="padding: 10 3 3 3; background: #ffffff; color: #222222; ">
@ -55,15 +55,15 @@
<blockquote>
<p><a href="#idm6454080">INTRODUCTION</a></p>
<p><a href="#idm6435680">&amp;INPUTHP</a></p>
<p><a href="#idm3">INTRODUCTION</a></p>
<p><a href="#idm8">&amp;INPUTHP</a></p>
<blockquote>
<a href="#idm6435152">prefix</a> | <a href="#idm6433200">outdir</a> | <a href="#idm6430448">iverbosity</a> | <a href="#idm6428352">max_seconds</a> | <a href="#idm6426048">nq1</a> | <a href="#idm6425424">nq2</a> | <a href="#idm6424752">nq3</a> | <a href="#idm6423072">skip_equivalence_q</a> | <a href="#idm6421056">determine_num_pert_only</a> | <a href="#idm6418752">find_atpert</a> | <a href="#idm6416352">docc_thr</a> | <a href="#idm6414432">skip_type</a> | <a href="#idm6411856">equiv_type</a> | <a href="#idm6409440">perturb_only_atom</a> | <a href="#idm6407024">start_q</a> | <a href="#idm6404704">last_q</a> | <a href="#idm6402368">sum_pertq</a> | <a href="#idm6399968">compute_hp</a> | <a href="#idm6397328">conv_thr_chi</a> | <a href="#idm6395456">thresh_init</a> | <a href="#idm6393472">ethr_nscf</a> | <a href="#idm6391504">niter_max</a> | <a href="#idm6389648">alpha_mix(i)</a> | <a href="#idm6386944">nmix</a>
<a href="#idm9">prefix</a> | <a href="#idm12">outdir</a> | <a href="#idm17">iverbosity</a> | <a href="#idm20">max_seconds</a> | <a href="#idm24">nq1</a> | <a href="#idm25">nq2</a> | <a href="#idm26">nq3</a> | <a href="#idm29">skip_equivalence_q</a> | <a href="#idm32">determine_num_pert_only</a> | <a href="#idm36">find_atpert</a> | <a href="#idm39">docc_thr</a> | <a href="#idm42">skip_type</a> | <a href="#idm46">equiv_type</a> | <a href="#idm50">perturb_only_atom</a> | <a href="#idm54">start_q</a> | <a href="#idm58">last_q</a> | <a href="#idm62">sum_pertq</a> | <a href="#idm66">compute_hp</a> | <a href="#idm70">conv_thr_chi</a> | <a href="#idm73">thresh_init</a> | <a href="#idm76">ethr_nscf</a> | <a href="#idm79">niter_max</a> | <a href="#idm82">alpha_mix(i)</a> | <a href="#idm86">nmix</a>
</blockquote>
</blockquote>
</blockquote>
<blockquote>
<a name="idm6454080"></a><h3>INTRODUCTION</h3>
<a name="idm3"></a><h3>INTRODUCTION</h3>
<blockquote><pre>
<b>Input data format:</b> { } = optional, [ ] = it depends, # = comment
@ -75,11 +75,11 @@
<b>/</b>
</pre></blockquote>
</blockquote>
<a name="idm6435680"></a><a name="INPUTHP"></a><table border="0" width="100%" style="margin-bottom: 20;">
<a name="idm8"></a><a name="INPUTHP"></a><table border="0" width="100%" style="margin-bottom: 20;">
<tr><th bgcolor="#ddcba6"><h2 style="margin: 10 10 10 15; text-align: left;"> Namelist: <span class="namelist"><span style="font-weight:normal">&amp;</span>INPUTHP</span>
</h2></th></tr>
<tr><td style="text-align: left; background: #ffebc6; padding: 5 5 5 30; "><table style="border-color: #505087; border-style: solid; border-width: 0; margin-bottom: 10; table-layout: auto; width: 800;"><tbody><tr><td>
<a name="idm6435152"></a><a name="prefix"></a><table width="100%" style="border-color: #b5b500; border-style: solid; border-width: 2; margin-bottom: 10; table-layout: auto; background-color: #FFFFFF;">
<a name="idm9"></a><a name="prefix"></a><table width="100%" style="border-color: #b5b500; border-style: solid; border-width: 2; margin-bottom: 10; table-layout: auto; background-color: #FFFFFF;">
<tr>
<th align="left" valign="top" width="20%" style="background: #ffff99; padding: 2 2 2 10; ">prefix</th>
<td style="text-align: left; vertical-align: top; background: #ffffc3; padding: 2 2 2 5; ">CHARACTER</td>
@ -95,7 +95,7 @@ used in the calculation of unperturbed system.
</pre></blockquote></td></tr>
</table>
<div align="right" style="margin-bottom: 5;">[<a href="#__top__">Back to Top</a>]</div>
<a name="idm6433200"></a><a name="outdir"></a><table width="100%" style="border-color: #b5b500; border-style: solid; border-width: 2; margin-bottom: 10; table-layout: auto; background-color: #FFFFFF;">
<a name="idm12"></a><a name="outdir"></a><table width="100%" style="border-color: #b5b500; border-style: solid; border-width: 2; margin-bottom: 10; table-layout: auto; background-color: #FFFFFF;">
<tr>
<th align="left" valign="top" width="20%" style="background: #ffff99; padding: 2 2 2 10; ">outdir</th>
<td style="text-align: left; vertical-align: top; background: #ffffc3; padding: 2 2 2 5; ">CHARACTER</td>
@ -114,7 +114,7 @@ the unperturbed system.
</pre></blockquote></td></tr>
</table>
<div align="right" style="margin-bottom: 5;">[<a href="#__top__">Back to Top</a>]</div>
<a name="idm6430448"></a><a name="iverbosity"></a><table width="100%" style="border-color: #b5b500; border-style: solid; border-width: 2; margin-bottom: 10; table-layout: auto; background-color: #FFFFFF;">
<a name="idm17"></a><a name="iverbosity"></a><table width="100%" style="border-color: #b5b500; border-style: solid; border-width: 2; margin-bottom: 10; table-layout: auto; background-color: #FFFFFF;">
<tr>
<th align="left" valign="top" width="20%" style="background: #ffff99; padding: 2 2 2 10; ">iverbosity</th>
<td style="text-align: left; vertical-align: top; background: #ffffc3; padding: 2 2 2 5; ">INTEGER</td>
@ -136,7 +136,7 @@ the unperturbed system.
</pre></blockquote></td></tr>
</table>
<div align="right" style="margin-bottom: 5;">[<a href="#__top__">Back to Top</a>]</div>
<a name="idm6428352"></a><a name="max_seconds"></a><table width="100%" style="border-color: #b5b500; border-style: solid; border-width: 2; margin-bottom: 10; table-layout: auto; background-color: #FFFFFF;">
<a name="idm20"></a><a name="max_seconds"></a><table width="100%" style="border-color: #b5b500; border-style: solid; border-width: 2; margin-bottom: 10; table-layout: auto; background-color: #FFFFFF;">
<tr>
<th align="left" valign="top" width="20%" style="background: #ffff99; padding: 2 2 2 10; ">max_seconds</th>
<td style="text-align: left; vertical-align: top; background: #ffffc3; padding: 2 2 2 5; ">REAL</td>
@ -154,7 +154,7 @@ Maximum allowed run time before the job stops smoothly.
<table width="100%" style="border-color: #b5b500; border-style: solid; border-width: 2; margin-bottom: 10; table-layout: auto; background-color: #FFFFFF;">
<tr>
<th align="left" valign="top" width="20%" style="white-space: nowrap; background: #ffff99; padding: 2 2 2 10; ">
<a name="idm6426048"></a><a name="nq1"></a>nq1, <a name="idm6425424"></a><a name="nq2"></a>nq2, <a name="idm6424752"></a><a name="nq3"></a>nq3</th>
<a name="idm24"></a><a name="nq1"></a>nq1, <a name="idm25"></a><a name="nq2"></a>nq2, <a name="idm26"></a><a name="nq3"></a>nq3</th>
<td style="text-align: left; vertical-align: top; background: #ffffc3; padding: 2 2 2 5; ">INTEGER</td>
</tr>
<tr>
@ -168,7 +168,7 @@ Same meaning as for nk1, nk2, nk3 in the input of pw.x.
</pre></blockquote></td></tr>
</table>
<div align="right" style="margin-bottom: 5;">[<a href="#__top__">Back to Top</a>]</div>
<a name="idm6423072"></a><a name="skip_equivalence_q"></a><table width="100%" style="border-color: #b5b500; border-style: solid; border-width: 2; margin-bottom: 10; table-layout: auto; background-color: #FFFFFF;">
<a name="idm29"></a><a name="skip_equivalence_q"></a><table width="100%" style="border-color: #b5b500; border-style: solid; border-width: 2; margin-bottom: 10; table-layout: auto; background-color: #FFFFFF;">
<tr>
<th align="left" valign="top" width="20%" style="background: #ffff99; padding: 2 2 2 10; ">skip_equivalence_q</th>
<td style="text-align: left; vertical-align: top; background: #ffffc3; padding: 2 2 2 5; ">LOGICAL</td>
@ -187,7 +187,7 @@ calculations only for inequivalent q points.
</pre></blockquote></td></tr>
</table>
<div align="right" style="margin-bottom: 5;">[<a href="#__top__">Back to Top</a>]</div>
<a name="idm6421056"></a><a name="determine_num_pert_only"></a><table width="100%" style="border-color: #b5b500; border-style: solid; border-width: 2; margin-bottom: 10; table-layout: auto; background-color: #FFFFFF;">
<a name="idm32"></a><a name="determine_num_pert_only"></a><table width="100%" style="border-color: #b5b500; border-style: solid; border-width: 2; margin-bottom: 10; table-layout: auto; background-color: #FFFFFF;">
<tr>
<th align="left" valign="top" width="20%" style="background: #ffff99; padding: 2 2 2 10; ">determine_num_pert_only</th>
<td style="text-align: left; vertical-align: top; background: #ffffc3; padding: 2 2 2 5; ">LOGICAL</td>
@ -208,7 +208,7 @@ without performing any calculation.
</pre></blockquote></td></tr>
</table>
<div align="right" style="margin-bottom: 5;">[<a href="#__top__">Back to Top</a>]</div>
<a name="idm6418752"></a><a name="find_atpert"></a><table width="100%" style="border-color: #b5b500; border-style: solid; border-width: 2; margin-bottom: 10; table-layout: auto; background-color: #FFFFFF;">
<a name="idm36"></a><a name="find_atpert"></a><table width="100%" style="border-color: #b5b500; border-style: solid; border-width: 2; margin-bottom: 10; table-layout: auto; background-color: #FFFFFF;">
<tr>
<th align="left" valign="top" width="20%" style="background: #ffff99; padding: 2 2 2 10; ">find_atpert</th>
<td style="text-align: left; vertical-align: top; background: #ffffc3; padding: 2 2 2 5; ">INTEGER</td>
@ -235,7 +235,7 @@ Method for searching of atoms which must be perturbed.
</pre></blockquote></td></tr>
</table>
<div align="right" style="margin-bottom: 5;">[<a href="#__top__">Back to Top</a>]</div>
<a name="idm6416352"></a><a name="docc_thr"></a><table width="100%" style="border-color: #b5b500; border-style: solid; border-width: 2; margin-bottom: 10; table-layout: auto; background-color: #FFFFFF;">
<a name="idm39"></a><a name="docc_thr"></a><table width="100%" style="border-color: #b5b500; border-style: solid; border-width: 2; margin-bottom: 10; table-layout: auto; background-color: #FFFFFF;">
<tr>
<th align="left" valign="top" width="20%" style="background: #ffff99; padding: 2 2 2 10; ">docc_thr</th>
<td style="text-align: left; vertical-align: top; background: #ffffc3; padding: 2 2 2 5; ">REAL</td>
@ -252,7 +252,7 @@ be perturbed. Can be used only when find_atpert = 1.
</pre></blockquote></td></tr>
</table>
<div align="right" style="margin-bottom: 5;">[<a href="#__top__">Back to Top</a>]</div>
<a name="idm6414432"></a><a name="skip_type"></a><table width="100%" style="border-color: #b5b500; border-style: solid; border-width: 2; margin-bottom: 10; table-layout: auto; background-color: #FFFFFF;">
<a name="idm42"></a><a name="skip_type"></a><table width="100%" style="border-color: #b5b500; border-style: solid; border-width: 2; margin-bottom: 10; table-layout: auto; background-color: #FFFFFF;">
<tr>
<th align="left" valign="top" width="20%" style="background: #ffff99; padding: 2 2 2 10; ">skip_type</th>
<td style="text-align: left; vertical-align: top; background: #ffffc3; padding: 2 2 2 5; ">LOGICAL</td>
@ -278,7 +278,7 @@ This keyword cannot be used when find_atpert = 1.
</pre></blockquote></td></tr>
</table>
<div align="right" style="margin-bottom: 5;">[<a href="#__top__">Back to Top</a>]</div>
<a name="idm6411856"></a><a name="equiv_type"></a><table width="100%" style="border-color: #b5b500; border-style: solid; border-width: 2; margin-bottom: 10; table-layout: auto; background-color: #FFFFFF;">
<a name="idm46"></a><a name="equiv_type"></a><table width="100%" style="border-color: #b5b500; border-style: solid; border-width: 2; margin-bottom: 10; table-layout: auto; background-color: #FFFFFF;">
<tr>
<th align="left" valign="top" width="20%" style="background: #ffff99; padding: 2 2 2 10; ">equiv_type</th>
<td style="text-align: left; vertical-align: top; background: #ffffc3; padding: 2 2 2 5; ">INTEGER</td>
@ -301,7 +301,7 @@ This keyword cannot be used when find_atpert = 1.
</pre></blockquote></td></tr>
</table>
<div align="right" style="margin-bottom: 5;">[<a href="#__top__">Back to Top</a>]</div>
<a name="idm6409440"></a><a name="perturb_only_atom"></a><table width="100%" style="border-color: #b5b500; border-style: solid; border-width: 2; margin-bottom: 10; table-layout: auto; background-color: #FFFFFF;">
<a name="idm50"></a><a name="perturb_only_atom"></a><table width="100%" style="border-color: #b5b500; border-style: solid; border-width: 2; margin-bottom: 10; table-layout: auto; background-color: #FFFFFF;">
<tr>
<th align="left" valign="top" width="20%" style="background: #ffff99; padding: 2 2 2 10; ">perturb_only_atom</th>
<td style="text-align: left; vertical-align: top; background: #ffffc3; padding: 2 2 2 5; ">LOGICAL</td>
@ -324,7 +324,7 @@ has a higher priority than skip_type.
</pre></blockquote></td></tr>
</table>
<div align="right" style="margin-bottom: 5;">[<a href="#__top__">Back to Top</a>]</div>
<a name="idm6407024"></a><a name="start_q"></a><table width="100%" style="border-color: #b5b500; border-style: solid; border-width: 2; margin-bottom: 10; table-layout: auto; background-color: #FFFFFF;">
<a name="idm54"></a><a name="start_q"></a><table width="100%" style="border-color: #b5b500; border-style: solid; border-width: 2; margin-bottom: 10; table-layout: auto; background-color: #FFFFFF;">
<tr>
<th align="left" valign="top" width="20%" style="background: #ffff99; padding: 2 2 2 10; ">start_q</th>
<td style="text-align: left; vertical-align: top; background: #ffffc3; padding: 2 2 2 5; ">INTEGER</td>
@ -347,7 +347,7 @@ the total number of q points found.
</pre></blockquote></td></tr>
</table>
<div align="right" style="margin-bottom: 5;">[<a href="#__top__">Back to Top</a>]</div>
<a name="idm6404704"></a><a name="last_q"></a><table width="100%" style="border-color: #b5b500; border-style: solid; border-width: 2; margin-bottom: 10; table-layout: auto; background-color: #FFFFFF;">
<a name="idm58"></a><a name="last_q"></a><table width="100%" style="border-color: #b5b500; border-style: solid; border-width: 2; margin-bottom: 10; table-layout: auto; background-color: #FFFFFF;">
<tr>
<th align="left" valign="top" width="20%" style="background: #ffff99; padding: 2 2 2 10; ">last_q</th>
<td style="text-align: left; vertical-align: top; background: #ffffc3; padding: 2 2 2 5; ">INTEGER</td>
@ -370,7 +370,7 @@ the total number of q points found.
</pre></blockquote></td></tr>
</table>
<div align="right" style="margin-bottom: 5;">[<a href="#__top__">Back to Top</a>]</div>
<a name="idm6402368"></a><a name="sum_pertq"></a><table width="100%" style="border-color: #b5b500; border-style: solid; border-width: 2; margin-bottom: 10; table-layout: auto; background-color: #FFFFFF;">
<a name="idm62"></a><a name="sum_pertq"></a><table width="100%" style="border-color: #b5b500; border-style: solid; border-width: 2; margin-bottom: 10; table-layout: auto; background-color: #FFFFFF;">
<tr>
<th align="left" valign="top" width="20%" style="background: #ffff99; padding: 2 2 2 10; ">sum_pertq</th>
<td style="text-align: left; vertical-align: top; background: #ffffc3; padding: 2 2 2 5; ">LOGICAL</td>
@ -394,7 +394,7 @@ start_q, last_q and perturb_only_atom are used.
</pre></blockquote></td></tr>
</table>
<div align="right" style="margin-bottom: 5;">[<a href="#__top__">Back to Top</a>]</div>
<a name="idm6399968"></a><a name="compute_hp"></a><table width="100%" style="border-color: #b5b500; border-style: solid; border-width: 2; margin-bottom: 10; table-layout: auto; background-color: #FFFFFF;">
<a name="idm66"></a><a name="compute_hp"></a><table width="100%" style="border-color: #b5b500; border-style: solid; border-width: 2; margin-bottom: 10; table-layout: auto; background-color: #FFFFFF;">
<tr>
<th align="left" valign="top" width="20%" style="background: #ffff99; padding: 2 2 2 10; ">compute_hp</th>
<td style="text-align: left; vertical-align: top; background: #ffffc3; padding: 2 2 2 5; ">LOGICAL</td>
@ -421,7 +421,7 @@ calculation was parallelized over perturbations.
</pre></blockquote></td></tr>
</table>
<div align="right" style="margin-bottom: 5;">[<a href="#__top__">Back to Top</a>]</div>
<a name="idm6397328"></a><a name="conv_thr_chi"></a><table width="100%" style="border-color: #b5b500; border-style: solid; border-width: 2; margin-bottom: 10; table-layout: auto; background-color: #FFFFFF;">
<a name="idm70"></a><a name="conv_thr_chi"></a><table width="100%" style="border-color: #b5b500; border-style: solid; border-width: 2; margin-bottom: 10; table-layout: auto; background-color: #FFFFFF;">
<tr>
<th align="left" valign="top" width="20%" style="background: #ffff99; padding: 2 2 2 10; ">conv_thr_chi</th>
<td style="text-align: left; vertical-align: top; background: #ffffc3; padding: 2 2 2 5; ">REAL</td>
@ -438,7 +438,7 @@ occupation matrix.
</pre></blockquote></td></tr>
</table>
<div align="right" style="margin-bottom: 5;">[<a href="#__top__">Back to Top</a>]</div>
<a name="idm6395456"></a><a name="thresh_init"></a><table width="100%" style="border-color: #b5b500; border-style: solid; border-width: 2; margin-bottom: 10; table-layout: auto; background-color: #FFFFFF;">
<a name="idm73"></a><a name="thresh_init"></a><table width="100%" style="border-color: #b5b500; border-style: solid; border-width: 2; margin-bottom: 10; table-layout: auto; background-color: #FFFFFF;">
<tr>
<th align="left" valign="top" width="20%" style="background: #ffff99; padding: 2 2 2 10; ">thresh_init</th>
<td style="text-align: left; vertical-align: top; background: #ffffc3; padding: 2 2 2 5; ">REAL</td>
@ -457,7 +457,7 @@ number of electrons in the system.
</pre></blockquote></td></tr>
</table>
<div align="right" style="margin-bottom: 5;">[<a href="#__top__">Back to Top</a>]</div>
<a name="idm6393472"></a><a name="ethr_nscf"></a><table width="100%" style="border-color: #b5b500; border-style: solid; border-width: 2; margin-bottom: 10; table-layout: auto; background-color: #FFFFFF;">
<a name="idm76"></a><a name="ethr_nscf"></a><table width="100%" style="border-color: #b5b500; border-style: solid; border-width: 2; margin-bottom: 10; table-layout: auto; background-color: #FFFFFF;">
<tr>
<th align="left" valign="top" width="20%" style="background: #ffff99; padding: 2 2 2 10; ">ethr_nscf</th>
<td style="text-align: left; vertical-align: top; background: #ffffc3; padding: 2 2 2 5; ">REAL</td>
@ -475,7 +475,7 @@ k and k+q points. Note, this quantity is NOT extensive.
</pre></blockquote></td></tr>
</table>
<div align="right" style="margin-bottom: 5;">[<a href="#__top__">Back to Top</a>]</div>
<a name="idm6391504"></a><a name="niter_max"></a><table width="100%" style="border-color: #b5b500; border-style: solid; border-width: 2; margin-bottom: 10; table-layout: auto; background-color: #FFFFFF;">
<a name="idm79"></a><a name="niter_max"></a><table width="100%" style="border-color: #b5b500; border-style: solid; border-width: 2; margin-bottom: 10; table-layout: auto; background-color: #FFFFFF;">
<tr>
<th align="left" valign="top" width="20%" style="background: #ffff99; padding: 2 2 2 10; ">niter_max</th>
<td style="text-align: left; vertical-align: top; background: #ffffc3; padding: 2 2 2 5; ">INTEGER</td>
@ -491,7 +491,7 @@ solution of the linear-response Kohn-Sham equations.
</pre></blockquote></td></tr>
</table>
<div align="right" style="margin-bottom: 5;">[<a href="#__top__">Back to Top</a>]</div>
<a name="idm6389648"></a><a name="alpha_mix"></a><table width="100%" style="border-color: #b5b500; border-style: solid; border-width: 2; margin-bottom: 10; table-layout: auto; background-color: #FFFFFF;">
<a name="idm82"></a><a name="alpha_mix"></a><table width="100%" style="border-color: #b5b500; border-style: solid; border-width: 2; margin-bottom: 10; table-layout: auto; background-color: #FFFFFF;">
<tr>
<th align="left" valign="top" width="20%" style="background: #ffff99; padding: 2 2 2 10; ">alpha_mix(i)</th>
<td style="text-align: left; vertical-align: top; background: #ffffc3; padding: 2 2 2 5; ">REAL</td>
@ -508,7 +508,7 @@ method: D.D. Johnson, <a href="https://journals.aps.org/prb/abstract/10.1103/Phy
</pre></blockquote></td></tr>
</table>
<div align="right" style="margin-bottom: 5;">[<a href="#__top__">Back to Top</a>]</div>
<a name="idm6386944"></a><a name="nmix"></a><table width="100%" style="border-color: #b5b500; border-style: solid; border-width: 2; margin-bottom: 10; table-layout: auto; background-color: #FFFFFF;">
<a name="idm86"></a><a name="nmix"></a><table width="100%" style="border-color: #b5b500; border-style: solid; border-width: 2; margin-bottom: 10; table-layout: auto; background-color: #FFFFFF;">
<tr>
<th align="left" valign="top" width="20%" style="background: #ffff99; padding: 2 2 2 10; ">nmix</th>
<td style="text-align: left; vertical-align: top; background: #ffffc3; padding: 2 2 2 5; ">INTEGER</td>
@ -530,7 +530,7 @@ D.D. Johnson, <a href="https://journals.aps.org/prb/abstract/10.1103/PhysRevB.38
</td></tr>
</table>
<small>
This file has been created by helpdoc utility on Fri Sep 07 12:30:30 CEST 2018.
This file has been created by helpdoc utility on Fri Mar 01 17:56:48 CET 2019.
</small>
</body>
</html>

View File

@ -3,7 +3,7 @@
------------------------------------------------------------------------
INPUT FILE DESCRIPTION
Program: hp.x / PWscf / Quantum Espresso (version: git)
Program: hp.x / PWscf / Quantum Espresso (version: 6.4)
------------------------------------------------------------------------
@ -284,4 +284,4 @@ NAMELIST: &INPUTHP
===END OF NAMELIST======================================================
This file has been created by helpdoc utility on Fri Sep 07 12:30:30 CEST 2018
This file has been created by helpdoc utility on Fri Mar 01 17:56:48 CET 2019

View File

@ -25,7 +25,7 @@ subroutine hp_check_type(na)
!
USE ions_base, ONLY : ityp, nat, ntyp => nsp, tau
USE io_global, ONLY : stdout
USE symm_base, ONLY : nsym, set_sym
USE symm_base, ONLY : nsym, set_sym, ft
USE noncollin_module, ONLY : nspin_mag, m_loc
USE fft_base, ONLY : dfftp
USE ldaU_hp, ONLY : recalc_sym
@ -35,7 +35,7 @@ subroutine hp_check_type(na)
INTEGER, INTENT(IN) :: na ! the atom under consideration
!
INTEGER :: nt, ityp_save, nsym_old
INTEGER :: na_, nt_
INTEGER :: na_, nt_, isym
!
IF (nsym==1) RETURN
!

View File

@ -83,6 +83,15 @@ SUBROUTINE hp_init_q()
!
ENDIF
!
! Read the wavefunctions evc (at k) and evq (at k+q).
! Note: this is important because if nksq=1 then evc and evq are read only
! once (here) and then used throughout the code. This may happen e.g.
! when the ratio of the total number of k points (without k+q) and k pools
! is not an integer number (as a consequence some k pools will have nksq=1).
!
CALL get_buffer (evc, lrwfc, iuwfc, ikk)
IF (.NOT.lgamma .AND. nksq.EQ.1) CALL get_buffer (evq, lrwfc, iuwfc, ikq)
!
! 2) USPP: Compute the becp terms which are used in the rest of the code
!
IF (okvan) THEN
@ -91,10 +100,6 @@ SUBROUTINE hp_init_q()
!
CALL init_us_2 (npw, igk_k(1,ikk), xk(1,ikk), vkb)
!
! Read the wavefunctions evc at k
!
CALL get_buffer (evc, lrwfc, iuwfc, ikk)
!
! becp1 = <vkb|evc>
!
CALL calbec (npw, vkb, evc, becp1(ik))

View File

@ -55,7 +55,7 @@ SUBROUTINE hp_setup_q()
USE fft_base, ONLY : dfftp
USE gvect, ONLY : ngm
USE gvecs, ONLY : doublegrid
USE symm_base, ONLY : nrot, nsym, s, ftau, irt, time_reversal, &
USE symm_base, ONLY : nrot, nsym, s, ft, irt, time_reversal, &
inverse_s, d1, d2, d3
USE uspp_param, ONLY : upf
USE uspp, ONLY : nlcc_any
@ -142,7 +142,7 @@ SUBROUTINE hp_setup_q()
! Check if there are fractional translations
! Note: Try to use PH/symmorphic_or_nzb ?
!
is_symmorphic = .NOT.(ANY(ftau(:,1:nsymq) /= 0))
is_symmorphic = .NOT.( ANY( ABS( ft(:,1:nsymq) > 1.d-8 ) ) )
!
IF (skip_equivalence_q) THEN
search_sym = .FALSE.

View File

@ -23,7 +23,7 @@ SUBROUTINE hp_summary_q
USE gvecs, ONLY : doublegrid, dual, gcutms, ngms
USE gvecw, ONLY : ecutwfc
USE fft_base, ONLY : dffts
USE symm_base, ONLY : s, sr, ftau, sname
USE symm_base, ONLY : s, sr, ft, sname
USE funct, ONLY : write_dft_name
USE control_flags, ONLY : iverbosity
USE lr_symm_base, ONLY : irotmq, minus_q, nsymq
@ -82,24 +82,24 @@ SUBROUTINE hp_summary_q
!
WRITE( stdout, '(/5x,"isym = ",i2,5x,a45/)') isymq, sname (isym)
!
IF (ftau(1,isym).NE.0 .OR. ftau(2,isym).NE.0 .OR. ftau(3,isym).NE.0) THEN
IF ( ft(1,isym)**2 + ft(2,isym)**2 + ft(3,isym)**2 > 1.0d-8 ) THEN
!
ft1 = at (1, 1) * ftau (1, isym) / dfftp%nr1 + &
at (1, 2) * ftau (2, isym) / dfftp%nr2 + &
at (1, 3) * ftau (3, isym) / dfftp%nr3
ft2 = at (2, 1) * ftau (1, isym) / dfftp%nr1 + &
at (2, 2) * ftau (2, isym) / dfftp%nr2 + &
at (2, 3) * ftau (3, isym) / dfftp%nr3
ft3 = at (3, 1) * ftau (1, isym) / dfftp%nr1 + &
at (3, 2) * ftau (2, isym) / dfftp%nr2 + &
at (3, 3) * ftau (3, isym) / dfftp%nr3
ft1 = at (1, 1) * ft(1, isym) + &
at (1, 2) * ft(2, isym) + &
at (1, 3) * ft(3, isym)
ft2 = at (2, 1) * ft(1, isym) + &
at (2, 2) * ft(2, isym) + &
at (2, 3) * ft(3, isym)
ft3 = at (3, 1) * ft(1, isym) + &
at (3, 2) * ft(2, isym) + &
at (3, 3) * ft(3, isym)
!
WRITE( stdout, '(5x,"cryst.",3x,"s(",i2,") = (",3(i6,5x)," ) f =( ",f10.7," )")') &
& isymq, (s(1,ipol,isym), ipol=1,3), DBLE(ftau(1,isym)) / DBLE(dfftp%nr1)
& isymq, (s(1,ipol,isym), ipol=1,3), ft(1,isym)
WRITE( stdout, '(21x," (",3(i6,5x), " ) ( ",f10.7," )")') &
& (s(2,ipol,isym), ipol=1,3), DBLE(ftau(2,isym)) / DBLE(dfftp%nr2)
& (s(2,ipol,isym), ipol=1,3), ft(2,isym)
WRITE( stdout, '(21x," (",3(i6,5x)," ) ( ",f10.7," )"/)') &
& (s(3,ipol,isym), ipol=1,3), DBLE(ftau(3,isym)) / DBLE(dfftp%nr3)
& (s(3,ipol,isym), ipol=1,3), ft(3,isym)
WRITE( stdout, '(5x,"cart.",4x,"s(",i2,") = (",3f11.7, " ) f =( ",f10.7," )")') &
& isymq, (sr(1,ipol,isym), ipol=1,3), ft1
WRITE( stdout, '(21x," (",3f11.7, " ) ( ",f10.7," )")') &

View File

@ -16,7 +16,7 @@ SUBROUTINE hp_symdvscf (dvtosym)
USE constants, ONLY : tpi
USE fft_base, ONLY : dfftp
USE cell_base, ONLY : at
USE symm_base, ONLY : s, ftau
USE symm_base, ONLY : s, ft
USE noncollin_module, ONLY : nspin_lsda, nspin_mag
USE ions_base, ONLY : tau
USE qpoint, ONLY : xq
@ -27,9 +27,10 @@ SUBROUTINE hp_symdvscf (dvtosym)
complex(DP) :: dvtosym (dfftp%nr1x, dfftp%nr2x, dfftp%nr3x, nspin_mag)
! the potential to be symmetrized
integer :: ftau(3,48)
integer :: is, ri, rj, rk, i, j, k, ipol, isym, irot
! counters
real(DP) :: gf(3), gf2, n(3), ft(3)
real(DP) :: gf(3), gf2, n(3)
! temp variables
complex(DP), allocatable :: dvsym (:,:,:)
! the symmetrized potential
@ -48,6 +49,10 @@ SUBROUTINE hp_symdvscf (dvtosym)
n(2) = tpi / DBLE(dfftp%nr2)
n(3) = tpi / DBLE(dfftp%nr3)
!
ftau(1,1:nsymq) = NINT ( ft(1,1:nsymq)*dfftp%nr1 )
ftau(2,1:nsymq) = NINT ( ft(2,1:nsymq)*dfftp%nr2 )
ftau(3,1:nsymq) = NINT ( ft(3,1:nsymq)*dfftp%nr3 )
!
! Symmetrize with -q if present (Sq = -q + G)
!
IF (minus_q) THEN

View File

@ -24,12 +24,4 @@ libcg.a: $(CG)
clean :
- /bin/rm -f *.o *.a *.d *.i *~ *_tmp.f90 *.mod *.L *.x
# .PHONY forces execution of a rule irrespective of the presence of an
# updated file with the same name of the rule. In this way, the script
# that generates version.f90 always runs, updating the version if you
# execute "svn update". The update_version script takes care of not
# changing the file if the svn version did not change
.PHONY: all clean
include make.depend

View File

@ -22,12 +22,4 @@ libdavid.a: $(DAVID)
clean :
- /bin/rm -f *.o *.a *.d *.i *~ *_tmp.f90 *.mod *.L *.x
# .PHONY forces execution of a rule irrespective of the presence of an
# updated file with the same name of the rule. In this way, the script
# that generates version.f90 always runs, updating the version if you
# execute "svn update". The update_version script takes care of not
# changing the file if the svn version did not change
.PHONY: all clean
include make.depend

View File

@ -18,12 +18,4 @@ libdavid_rci.a: $(DAVID_RCI)
clean :
- /bin/rm -f *.o *.a *.d *.i *~ *_tmp.f90 *.mod *.L *.x
# .PHONY forces execution of a rule irrespective of the presence of an
# updated file with the same name of the rule. In this way, the script
# that generates version.f90 always runs, updating the version if you
# execute "svn update". The update_version script takes care of not
# changing the file if the svn version did not change
.PHONY: all clean
include make.depend

View File

@ -20,12 +20,4 @@ libppcg.a: $(PPCG)
clean :
- /bin/rm -f *.o *.a *.d *.i *~ *_tmp.f90 *.mod *.L *.x
# .PHONY forces execution of a rule irrespective of the presence of an
# updated file with the same name of the rule. In this way, the script
# that generates version.f90 always runs, updating the version if you
# execute "svn update". The update_version script takes care of not
# changing the file if the svn version did not change
.PHONY: all clean
include make.depend

Some files were not shown because too many files have changed in this diff Show More