├── tests ├── __init__.py ├── resources │ ├── dummy │ │ ├── instance.csv │ │ ├── instance.json │ │ ├── instance_json │ │ ├── instance.yaml │ │ ├── instance_yaml │ │ ├── instance.xml │ │ ├── instance_xml │ │ ├── incomplete.xml │ │ ├── schema.xsd │ │ └── incomplete.xsd │ ├── tddfpt │ │ ├── CH4.tddfpt.in.test │ │ ├── CH4.tddfpt_pp.in.test │ │ ├── Ag.tddfpt-eels.in.test │ │ ├── Benzene.dav.in.test │ │ ├── CH4.tddfpt_pp.xml │ │ ├── CH4.tddfpt.xml │ │ ├── Ag.tddfpt-eels.xml │ │ └── Benzene.dav.xml │ ├── ph │ │ ├── sio2_dielectric.in.test │ │ ├── sio2_prova_disp.in.test │ │ ├── ch4_nm.in.test │ │ ├── nat_todo.in.test │ │ ├── nat_todo_zero.in.test │ │ ├── alas_ph.in.test │ │ ├── al.elph.in.test │ │ ├── alas_recover.in.test │ │ ├── sio2_prova_qplot.in.test │ │ ├── sio2_dielectric.xml │ │ ├── nat_todo_zero.xml │ │ ├── nat_todo.xml │ │ ├── ch4_nm.xml │ │ ├── sio2_prova_disp.xml │ │ ├── alas_ph.xml │ │ ├── alas_recover.xml │ │ ├── al.elph.xml │ │ └── sio2_prova_qplot.xml │ ├── epw │ │ ├── epw_test1.in.test │ │ ├── epw_test2.in.test │ │ ├── epw_test1.xml │ │ └── epw_test2.xml │ ├── xspectra │ │ ├── Cu_L23_xspectra.in.test │ │ ├── NiO_xspectra_dip.in.test │ │ ├── xspectra_example_full.in │ │ ├── Cu_L23_xspectra.xml │ │ ├── NiO_xspectra_dip.xml │ │ └── xspectra_example_full.xml │ ├── pw │ │ ├── Pt_spinorbit.in.test │ │ ├── CO_bgfs_relax.in.test │ │ ├── PbTiO3_scf.in.test │ │ ├── Fe_crystal_crystal_positions.in.test │ │ ├── Fe_noncolin.in.test │ │ ├── Fe_Im-3m_0_dftd3.in.test │ │ ├── Al001_rlx_damp.in.test │ │ ├── CO_bgfs_relax_with_external_forces.in.test │ │ ├── FeO_LDAU_with_no_U_230310.in.test │ │ ├── FeO_LDAU_standard_230310.in.test │ │ ├── PbTiO3_BerryPhase.in.test │ │ ├── Fe_non_collinear_penalty.in.test │ │ ├── FeO_LDAU_standard.in.test │ │ ├── PbTiO3_bc3_fcp_opt.in.test │ │ ├── FeO_LDAU_with_no_U.in.test │ │ ├── Al001_relax_bfgs.in.test │ │ ├── FeO_LDAU_with_starting_ns.in.test │ │ ├── Si_md.in.test │ │ ├── Al_bands.in.test │ │ ├── FeO_LDAU_with_starting_ns_230210.in.test │ │ ├── Al001_relax_bfgs-input.yml │ │ ├── ESM_2Dxy.in.test │ │ ├── Fe_crystal_crystal_positions.xml │ │ ├── Fe_Im-3m_0_dftd3.xml │ │ ├── Al001_relax_bfgs.yml │ │ ├── Pt_spinorbit.xml │ │ ├── CO_bgfs_relax.xml │ │ ├── PbTiO3_scf.xml │ │ ├── PbTiO3_bc3_fcp_opt.xml │ │ ├── PbTiO3_BerryPhase.xml │ │ ├── Al001_rlx_damp.xml │ │ └── ESM_2Dxy.xml │ └── neb │ │ ├── H2+H_crystal.in.test │ │ ├── H2+H.in.test │ │ ├── Al001+H_pbc.in.test │ │ ├── Al001_plus_H_bc3.in.test │ │ ├── periodic_dft_65_WaterP1_0_neb_0.in.test │ │ └── periodic_dft_65_WaterP1_0_neb_0.xml ├── test_hdf5.py ├── test_upf.py └── test_converters.py ├── docs ├── intro.rst ├── index.rst ├── Makefile ├── make.bat ├── usage.rst ├── api.rst └── conf.py ├── requirements-dev.txt ├── .gitignore ├── MANIFEST.in ├── .coveragerc ├── qeschema ├── exceptions.py ├── __init__.py ├── namespaces.py ├── hdf5 │ └── __init__.py ├── schemas │ ├── releases │ │ ├── qes_spectrum-20180511.xsd │ │ └── qes_spectrum-20180517.xsd │ └── qes_spectrum.xsd └── upf.py ├── .github └── workflows │ └── test.yml ├── LICENSE ├── tox.ini ├── .travis.yml ├── README.rst ├── setup.py └── scripts ├── yaml2qeinput.py └── xml2qeinput.py /tests/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/resources/dummy/instance.csv: -------------------------------------------------------------------------------- 1 | ,, -------------------------------------------------------------------------------- /tests/resources/dummy/instance.json: -------------------------------------------------------------------------------- 1 | {"root": {"node": [null, null, null]}} -------------------------------------------------------------------------------- /tests/resources/dummy/instance_json: -------------------------------------------------------------------------------- 1 | {"root": {"node": [null, {"$": "value"}, null]}} -------------------------------------------------------------------------------- /tests/resources/dummy/instance.yaml: -------------------------------------------------------------------------------- 1 | root: 2 | node: 3 | - null 4 | - null 5 | - null 6 | -------------------------------------------------------------------------------- /tests/resources/dummy/instance_yaml: -------------------------------------------------------------------------------- 1 | root: 2 | node: 3 | - null 4 | - $: value 5 | - null 6 | -------------------------------------------------------------------------------- /docs/intro.rst: -------------------------------------------------------------------------------- 1 | ************ 2 | Introduction 3 | ************ 4 | 5 | 6 | .. include:: ../README.rst 7 | :start-after: qeschema-introduction 8 | -------------------------------------------------------------------------------- /tests/resources/dummy/instance.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | value 5 | 6 | -------------------------------------------------------------------------------- /tests/resources/dummy/instance_xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | value 5 | 6 | -------------------------------------------------------------------------------- /tests/resources/dummy/incomplete.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /tests/resources/tddfpt/CH4.tddfpt.in.test: -------------------------------------------------------------------------------- 1 | &lr_input 2 | outdir='./out' 3 | prefix='CH4' 4 | restart = .false. 5 | restart_step=250 6 | / 7 | &lr_control 8 | ipol=4 9 | itermax=500 10 | / -------------------------------------------------------------------------------- /tests/resources/ph/sio2_dielectric.in.test: -------------------------------------------------------------------------------- 1 | &INPUTPH 2 | epsil=.true. 3 | fildyn='SiO2_36-2.dynG' 4 | prefix='SiO2_OR_36-2' 5 | tr2_ph=1e-14 6 | trans=.true. 7 | zeu=.true. 8 | zue=.false. 9 | / 10 | 0.0000 0.0000 0.0000 11 | -------------------------------------------------------------------------------- /tests/resources/tddfpt/CH4.tddfpt_pp.in.test: -------------------------------------------------------------------------------- 1 | &lr_input 2 | end=3.5 3 | epsil=0.01 4 | extrapolation='osc' 5 | increment=0.001 6 | ipol=4 7 | itermax=10000 8 | itermax0=500 9 | outdir='./out' 10 | prefix='CH4' 11 | start=0.0 12 | / -------------------------------------------------------------------------------- /requirements-dev.txt: -------------------------------------------------------------------------------- 1 | # Requirements for setup a development environment for the qeschema package. 2 | setuptools 3 | tox>=4.0 4 | flake8 5 | coverage 6 | xmlschema>=2.5.1, <4.0.0 7 | pyyaml 8 | numpy 9 | h5py 10 | Sphinx 11 | sphinx_rtd_theme 12 | -e . 13 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.pyc 2 | *.pyo 3 | *~ 4 | *.swp 5 | *.in 6 | !MANIFEST.in 7 | .tox/ 8 | *.egg-info 9 | .idea/ 10 | .project 11 | .coverage* 12 | !.coveragerc 13 | .*/ 14 | !.github/ 15 | dist/ 16 | build/ 17 | tests/examples/dummy/write_test_file 18 | docs/_*/ 19 | -------------------------------------------------------------------------------- /tests/resources/ph/sio2_prova_disp.in.test: -------------------------------------------------------------------------------- 1 | &INPUTPH 2 | epsil=.false. 3 | fildyn='SiO2_36-2.dynG' 4 | ldisp=.true. 5 | nq1=4 6 | nq2=4 7 | nq3=4 8 | prefix='SiO2_OR_36-2' 9 | tr2_ph=1e-14 10 | trans=.false. 11 | zeu=.false. 12 | zue=.false. 13 | / 14 | -------------------------------------------------------------------------------- /tests/resources/tddfpt/Ag.tddfpt-eels.in.test: -------------------------------------------------------------------------------- 1 | &lr_input 2 | outdir='./out' 3 | prefix='Ag' 4 | restart = .false. 5 | restart_step=250 6 | / 7 | &lr_control 8 | itermax=500 9 | pseudo_hermitian = .true. 10 | q1=0.0 11 | q2=0.0 12 | q3=0.051045 13 | / 14 | -------------------------------------------------------------------------------- /tests/resources/ph/ch4_nm.in.test: -------------------------------------------------------------------------------- 1 | &INPUTPH 2 | amass(1)= 1.000 3 | amass(2)= 12.000 4 | epsil=.true. 5 | fildyn='ch4.dyn' 6 | outdir='./' 7 | prefix='ch4' 8 | tr2_ph=1e-17 9 | trans=.true. 10 | zeu=.false. 11 | zue=.true. 12 | / 13 | 0.0000 0.0000 0.0000 -------------------------------------------------------------------------------- /tests/resources/ph/nat_todo.in.test: -------------------------------------------------------------------------------- 1 | &INPUTPH 2 | epsil=.true. 3 | fildyn='nat_todo.dyn' 4 | ldisp=.true. 5 | lraman=.false. 6 | nat_todo=3 7 | nq1=2 8 | nq2=2 9 | nq3=2 10 | prefix='nat_todo' 11 | tr2_ph=1e-14 12 | trans=.true. 13 | zeu=.false. 14 | zue=.false. 15 | / 16 | 1 3 5 -------------------------------------------------------------------------------- /tests/resources/ph/nat_todo_zero.in.test: -------------------------------------------------------------------------------- 1 | &INPUTPH 2 | epsil=.false. 3 | fildyn='nat_todo_zero.dyn' 4 | ldisp=.true. 5 | lraman=.false. 6 | nat_todo=0 7 | nq1=1 8 | nq2=1 9 | nq3=1 10 | prefix='nat_todo_zero' 11 | tr2_ph=1e-14 12 | trans=.true. 13 | zeu=.false. 14 | zue=.false. 15 | / -------------------------------------------------------------------------------- /MANIFEST.in: -------------------------------------------------------------------------------- 1 | include LICENSE 2 | include MANIFEST.in 3 | include README.rst 4 | include setup.py 5 | include requirements-dev.txt 6 | include tox.ini 7 | include docs/* 8 | recursive-include qeschema * 9 | include scripts/* 10 | recursive-include tests * 11 | 12 | global-exclude __pycache__ 13 | global-exclude *.py[cod] 14 | -------------------------------------------------------------------------------- /tests/resources/ph/alas_ph.in.test: -------------------------------------------------------------------------------- 1 | &INPUTPH 2 | amass(1)= 26.980 3 | amass(2)= 74.920 4 | epsil=.false. 5 | fildyn='alas.dyn' 6 | ldisp=.true. 7 | nq1=4 8 | nq2=4 9 | nq3=4 10 | outdir='/home/pietro/espresso-svn/tempdir/' 11 | prefix='alas' 12 | tr2_ph=1e-12 13 | trans=.false. 14 | zeu=.false. 15 | zue=.false. 16 | / 17 | -------------------------------------------------------------------------------- /tests/resources/tddfpt/Benzene.dav.in.test: -------------------------------------------------------------------------------- 1 | &lr_input 2 | outdir='./out' 3 | prefix='Benzene' 4 | restart = .false. 5 | / 6 | &lr_dav 7 | broadening=0.005 8 | finish=0.7 9 | num_basis_max=120 10 | num_eign=5 11 | num_init=10 12 | p_nbnd_occ=5 13 | p_nbnd_virt=15 14 | reference=0.5 15 | res_conv_thr=0.0001 16 | start=0.4 17 | step=0.0002 18 | / -------------------------------------------------------------------------------- /tests/resources/ph/al.elph.in.test: -------------------------------------------------------------------------------- 1 | &INPUTPH 2 | amass(1)= 26.980 3 | electron_phonon='interpolated' 4 | epsil=.false. 5 | fildvscf='aldv' 6 | fildyn='al.dyn' 7 | ldisp=.true. 8 | nq1=4 9 | nq2=4 10 | nq3=4 11 | outdir='/home/pietro/espresso-svn/tempdir/' 12 | prefix='aluminum' 13 | tr2_ph=1e-10 14 | trans=.true. 15 | zeu=.false. 16 | zue=.false. 17 | / 18 | -------------------------------------------------------------------------------- /tests/resources/ph/alas_recover.in.test: -------------------------------------------------------------------------------- 1 | &INPUTPH 2 | amass(1)= 26.980 3 | amass(2)= 74.920 4 | epsil=.true. 5 | fildrho='alas.drho' 6 | fildyn='alas.dynG' 7 | ldisp=.false. 8 | outdir='/home/pietro/espresso-svn/tempdir/' 9 | prefix='alas' 10 | recover=.true. 11 | tr2_ph=1e-12 12 | trans=.true. 13 | zeu=.true. 14 | zue=.true. 15 | / 16 | 0.0000 0.0000 0.0000 17 | -------------------------------------------------------------------------------- /.coveragerc: -------------------------------------------------------------------------------- 1 | [run] 2 | branch = True 3 | source = qeschema/ 4 | 5 | [report] 6 | exclude_lines = 7 | # Exclude not implemented features 8 | pragma: no cover 9 | raise NotImplementedError() 10 | 11 | # Exclude lines where yaml library is not installed 12 | except ImportError\: 13 | yaml = None 14 | raise RuntimeError\(\"PyYAML library is not installed\!\"\) 15 | -------------------------------------------------------------------------------- /tests/resources/ph/sio2_prova_qplot.in.test: -------------------------------------------------------------------------------- 1 | &INPUTPH 2 | epsil=.true. 3 | fildyn='SiO2_36-2.dynG' 4 | prefix='SiO2_OR_36-2' 5 | qplot=.true. 6 | tr2_ph=1e-14 7 | trans=.true. 8 | zeu=.true. 9 | zue=.false. 10 | / 11 | 10 12 | 0.1 0.0 0.0 0.1 13 | 0.2 0.0 0.0 0.1 14 | 0.3 0.0 0.0 0.1 15 | 0.4 0.0 0.0 0.1 16 | 0.5 0.0 0.0 0.1 17 | 0.6 0.0 0.0 0.1 18 | 0.7 0.0 0.0 0.1 19 | 0.8 0.0 0.0 0.1 20 | 0.9 0.0 0.0 0.1 21 | 1.0 0.0 0.0 0.1 22 | -------------------------------------------------------------------------------- /tests/resources/epw/epw_test1.in.test: -------------------------------------------------------------------------------- 1 | diamond 2 | &inputepw 3 | amass(1)= 12.011 4 | dis_frox_max=7.0 5 | dis_win_max=12.0 6 | elph=.true. 7 | epbwrite=.true. 8 | epwread=.false. 9 | iprint=0 10 | iverbosity=0 11 | mp_mesh_k=.false. 12 | nbndsub=4 13 | nk1=3 14 | nk2=3 15 | nk3=3 16 | nq1=3 17 | nq2=3 18 | nq3=3 19 | num_iter=300 20 | outdir='./' 21 | prefix='diam' 22 | proj(1)='f=0,0,0:l=3' 23 | wannier_plot=.false. 24 | wannierize=.true. 25 | / -------------------------------------------------------------------------------- /docs/index.rst: -------------------------------------------------------------------------------- 1 | .. qeschema documentation master file, created by 2 | sphinx-quickstart on Fri Oct 25 15:14:13 2019. 3 | You can adapt this file completely to your liking, but it should at least 4 | contain the root `toctree` directive. 5 | 6 | =============================================== 7 | Quantum Espresso XML Schema tools documentation 8 | =============================================== 9 | 10 | .. toctree:: 11 | :maxdepth: 2 12 | :caption: Contents: 13 | 14 | intro 15 | usage 16 | api 17 | usage 18 | -------------------------------------------------------------------------------- /tests/resources/xspectra/Cu_L23_xspectra.in.test: -------------------------------------------------------------------------------- 1 | &input_xspectra 2 | calculation='xanes_dipole' 3 | edge='L2' 4 | outdir='$TMP_DIR/' 5 | prefix='Cu' 6 | verbosity='high' 7 | xcheck_conv=500 8 | xe0=11.5335 9 | xepsilon(1)=1.0 10 | xepsilon(2)=1.0 11 | xepsilon(3)=1.0 12 | xerror=0.01 13 | xniter=5000 14 | / 15 | &plot 16 | cut_occ_states=.true. 17 | terminator=.true. 18 | xemax=-10.0 19 | xemin=80.0 20 | xgamma=0.5 21 | xnepoint=1000 22 | / 23 | &pseudos 24 | filecore='Cu.wfc' 25 | r_paw(0)=2.0 26 | r_paw(2)=2.0 27 | / 28 | &cut_occ 29 | / 30 | 3 3 3 0 0 0 -------------------------------------------------------------------------------- /tests/resources/xspectra/NiO_xspectra_dip.in.test: -------------------------------------------------------------------------------- 1 | &input_xspectra 2 | calculation='xanes_dipole' 3 | outdir='$TMP_DIR/' 4 | prefix='NiO' 5 | x_save_file='NiO.xspectra_dip.sav' 6 | xcheck_conv=50 7 | xepsilon(1)=1.0 8 | xepsilon(2)=0.0 9 | xepsilon(3)=0.0 10 | xerror=0.001 11 | xiabs=1 12 | xniter=1000 13 | / 14 | &plot 15 | cut_occ_states=.true. 16 | terminator=.true. 17 | xemax=20.0 18 | xemin=-10.0 19 | xgamma=0.8 20 | xnepoint=300 21 | / 22 | &pseudos 23 | filecore='Ni.wfc' 24 | r_paw(1)=1.5 25 | / 26 | &cut_occ 27 | cut_desmooth=0.1 28 | / 29 | 2 2 2 0 0 0 -------------------------------------------------------------------------------- /docs/Makefile: -------------------------------------------------------------------------------- 1 | # Minimal makefile for Sphinx documentation 2 | # 3 | 4 | # You can set these variables from the command line, and also 5 | # from the environment for the first two. 6 | SPHINXOPTS ?= 7 | SPHINXBUILD ?= sphinx-build 8 | SOURCEDIR = . 9 | BUILDDIR = _build 10 | 11 | # Put it first so that "make" without argument is like "make help". 12 | help: 13 | @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 14 | 15 | .PHONY: help Makefile 16 | 17 | # Catch-all target: route all unknown targets to Sphinx using the new 18 | # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). 19 | %: Makefile 20 | @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 21 | -------------------------------------------------------------------------------- /tests/resources/tddfpt/CH4.tddfpt_pp.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | CH4 6 | ./out 7 | 10000 8 | 500 9 | osc 10 | 0.0 11 | 3.50 12 | 0.001 13 | 4 14 | 0.01 15 | 16 | 17 | -------------------------------------------------------------------------------- /tests/resources/tddfpt/CH4.tddfpt.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | lanczos 7 | 8 | CH4 9 | false 10 | 250 11 | ./out 12 | 13 | 14 | 500 15 | 4 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /tests/resources/dummy/schema.xsd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /tests/resources/ph/sio2_dielectric.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 1.0e-14 7 | 8 | 9 | SiO2_OR_36-2 10 | SiO2_36-2.dynG 11 | 12 | 13 | true 14 | true 15 | true 16 | false 17 | 18 | 0.0 0.0 0.0 19 | 20 | 21 | -------------------------------------------------------------------------------- /tests/resources/ph/nat_todo_zero.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | nat_todo_zero 7 | nat_todo_zero.dyn 8 | 9 | 10 | 1.0e-14 11 | 12 | 13 | true 14 | false 15 | true 16 | false 17 | false 18 | false 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /tests/resources/tddfpt/Ag.tddfpt-eels.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | eels 7 | 8 | Ag 9 | false 10 | 250 11 | ./out 12 | 13 | 14 | 500 15 | true 16 | 0.0 17 | 0.0 18 | 0.051045000 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /qeschema/exceptions.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c), 2015-2020, Quantum Espresso Foundation and SISSA (Scuola 3 | # Internazionale Superiore di Studi Avanzati). All rights reserved. 4 | # This file is distributed under the terms of the MIT License. See the 5 | # file 'LICENSE' in the root directory of the present distribution, or 6 | # http://opensource.org/licenses/MIT. 7 | # 8 | # Authors: Davide Brunato 9 | # 10 | import logging 11 | 12 | logger = logging.getLogger('qeschema') 13 | 14 | 15 | class QESchemaError(Exception): 16 | pass 17 | 18 | 19 | class XmlDocumentError(QESchemaError, RuntimeError): 20 | """An error or a wrong condition with an XML document instance.""" 21 | 22 | def __init__(self, message): 23 | Exception.__init__(self, message) 24 | logger.debug('!XmlDocumentError: {0}'.format(message)) 25 | -------------------------------------------------------------------------------- /tests/resources/ph/nat_todo.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | nat_todo 7 | nat_todo.dyn 8 | 9 | 10 | 1.0e-14 11 | 12 | 13 | true 14 | true 15 | true 16 | false 17 | false 18 | false 19 | 20 | 21 | 22 | 1 23 | 3 24 | 5 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /tests/resources/epw/epw_test2.in.test: -------------------------------------------------------------------------------- 1 | sic 2 | &inputepw 3 | amass(2)= 12.011 4 | amass(1)= 28.085 5 | dis_frox_max=7.0 6 | dis_win_max=12.0 7 | elph=.true. 8 | epbread=.false. 9 | epbwrite=.true. 10 | epwread=.false. 11 | epwwrite=.true. 12 | etcmem=1 13 | iprint=2 14 | iverbosity=0 15 | lphase=.true. 16 | lpolar=.true. 17 | mp_mesh_k=.false. 18 | nbndsub=4 19 | nk1=3 20 | nk2=3 21 | nk3=3 22 | nq1=3 23 | nq2=3 24 | nq3=3 25 | num_iter=300 26 | outdir='./' 27 | prefix='sic' 28 | proj(1)='Si:sp3' 29 | vme='dipole' 30 | wannier_plot=.true. 31 | wannierize=.true. 32 | wdata(1) = 'bands_plot = .true.' 33 | wdata(2) = 'begin kpoint_path' 34 | wdata(3) = 'L 0.50 0.00 0.00 G 0.00 0.00 0.00' 35 | wdata(4) = 'G 0.00 0.00 0.00 X 0.50 0.50 0.00' 36 | wdata(5) = 'end kpoint_path' 37 | wdata6 = 'bands_plot_format = gnuplot' 38 | wdata(7) = 'use_ws_distance = T' 39 | / 40 | -------------------------------------------------------------------------------- /tests/resources/ph/ch4_nm.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 1.0e-17 7 | 8 | 9 | ch4 10 | ./ 11 | ch4.dyn 12 | 13 | 14 | true 15 | true 16 | false 17 | true 18 | 19 | 20 | 1.0 21 | 12 22 | 23 | 0.0 0.0 0.0 24 | 25 | 26 | -------------------------------------------------------------------------------- /docs/make.bat: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | 3 | pushd %~dp0 4 | 5 | REM Command file for Sphinx documentation 6 | 7 | if "%SPHINXBUILD%" == "" ( 8 | set SPHINXBUILD=sphinx-build 9 | ) 10 | set SOURCEDIR=. 11 | set BUILDDIR=_build 12 | 13 | if "%1" == "" goto help 14 | 15 | %SPHINXBUILD% >NUL 2>NUL 16 | if errorlevel 9009 ( 17 | echo. 18 | echo.The 'sphinx-build' command was not found. Make sure you have Sphinx 19 | echo.installed, then set the SPHINXBUILD environment variable to point 20 | echo.to the full path of the 'sphinx-build' executable. Alternatively you 21 | echo.may add the Sphinx directory to PATH. 22 | echo. 23 | echo.If you don't have Sphinx installed, grab it from 24 | echo.http://sphinx-doc.org/ 25 | exit /b 1 26 | ) 27 | 28 | %SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% 29 | goto end 30 | 31 | :help 32 | %SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% 33 | 34 | :end 35 | popd 36 | -------------------------------------------------------------------------------- /tests/resources/ph/sio2_prova_disp.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 1.0e-14 7 | 8 | 9 | SiO2_OR_36-2 10 | SiO2_36-2.dynG 11 | 12 | 13 | true 14 | false 15 | false 16 | false 17 | false 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /tests/resources/tddfpt/Benzene.dav.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | davidson 7 | 8 | Benzene 9 | false 10 | ./out 11 | 12 | 13 | 5 14 | 10 15 | 120 16 | 1.0e-4 17 | 0.5 18 | 0.005 19 | 0.4 20 | 0.7 21 | 0.0002 22 | 5 23 | 15 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /tests/resources/ph/alas_ph.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 1.0e-12 7 | 8 | 9 | alas 10 | /home/pietro/espresso-svn/tempdir/ 11 | alas.dyn 12 | 13 | 14 | true 15 | false 16 | false 17 | false 18 | false 19 | 20 | 21 | 26.98 22 | 74.92 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /.github/workflows/test.yml: -------------------------------------------------------------------------------- 1 | name: Test deployment 2 | on: 3 | push: 4 | branches: 5 | - master 6 | - develop 7 | pull_request: 8 | branches: 9 | - master 10 | - develop 11 | 12 | jobs: 13 | build: 14 | runs-on: ${{ matrix.os }} 15 | strategy: 16 | matrix: 17 | os: [ubuntu-latest, macos-latest, windows-latest] 18 | python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] 19 | steps: 20 | - uses: actions/checkout@v4 21 | - name: Set up Python 22 | uses: actions/setup-python@v5 23 | with: 24 | python-version: ${{ matrix.python-version }} 25 | - name: Display Python version 26 | run: python -c "import sys; print(sys.version)" 27 | - name: Install dependencies 28 | run: | 29 | python -m pip install --upgrade pip 30 | pip install -r requirements-dev.txt 31 | - name: Lint with flake8 32 | run: | 33 | flake8 qeschema --max-line-length=100 --statistics 34 | - name: Run tests 35 | run: | 36 | python -m unittest 37 | -------------------------------------------------------------------------------- /tests/resources/ph/alas_recover.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 1.0e-12 7 | 8 | 9 | alas 10 | /home/pietro/espresso-svn/tempdir/ 11 | alas.dynG 12 | alas.drho 13 | 14 | 15 | false 16 | true 17 | true 18 | true 19 | true 20 | 21 | 22 | true 23 | 24 | 25 | 26.98 26 | 74.92 27 | 28 | 0.0 0.0 0.0 29 | 30 | 31 | -------------------------------------------------------------------------------- /docs/usage.rst: -------------------------------------------------------------------------------- 1 | ******************************** 2 | Extracting data from XML files 3 | ******************************** 4 | 5 | PwDocument instances can be used to extract data from XML data files converting them to dictionaries. 6 | One has just to create a PwDocument object use it to read the XML file and then use the decoders provided 7 | by qeschema. 8 | 9 | .. testsetup:: 10 | 11 | import os 12 | project_dir = os.path.dirname(os.path.abspath('.')) 13 | os.chdir(project_dir) 14 | 15 | .. doctest:: 16 | 17 | >>> import qeschema 18 | >>> doc = qeschema.PwDocument(schema='qes.xsd') 19 | >>> doc.read('tests/resources/pw/Si.xml') 20 | >>> pw_data = doc.to_dict() 21 | >>> control_variables = pw_data['qes:espresso']['input']['control_variables'] 22 | 23 | 24 | One can also use the elementpath and xmlschema functionalities of the PwDocument object and obtain directly 25 | the desired dictionary: 26 | 27 | .. doctest:: 28 | 29 | >>> import qeschema 30 | >>> doc = qeschema.PwDocument() 31 | >>> doc.read('tests/resources/pw/CO_bgfs_relax.xml') 32 | >>> path = './/input/atomic_species' 33 | >>> bsdict = doc.to_dict(path=path) 34 | -------------------------------------------------------------------------------- /tests/resources/epw/epw_test1.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | diamond 8 | diam 9 | ./ 10 | 0 11 | true 12 | true 13 | false 14 | 4 15 | 12.01078 16 | 3 17 | 3 18 | 3 19 | 3 20 | 3 21 | 3 22 | false 23 | true 24 | 25 | 26 | 300 27 | 12 28 | 7 29 | f=0,0,0:l=3 30 | 0 31 | false 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /tests/resources/dummy/incomplete.xsd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c), 2015-2022, Quantum Espresso Foundation and SISSA (Scuola 4 | Internazionale Superiore di Studi Avanzati). All rights reserved. 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /tests/resources/ph/al.elph.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 1.0e-10 7 | 8 | 9 | aluminum 10 | /home/pietro/espresso-svn/tempdir/ 11 | al.dyn 12 | aldv 13 | 14 | 15 | true 16 | false 17 | true 18 | false 19 | false 20 | 21 | 22 | 26.98 23 | 24 | 25 | interpolated 26 | 0.005 27 | 10 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /tests/resources/xspectra/xspectra_example_full.in: -------------------------------------------------------------------------------- 1 | &input_xspectra 2 | calculation='xanes_dipole' 3 | edge='L2' 4 | ef_r=0.45 5 | lminus=.false. 6 | lplus=.false. 7 | neldw=1 8 | nelup=1 9 | outdir='bubu' 10 | prefix='$TMP_DIR/' 11 | restart_mode='from_scratch' 12 | show_status=.false. 13 | time_limit=100000000.0 14 | U_projection_type='atomic' 15 | verbosity='high' 16 | x_save_file='xanes.sav' 17 | xcheck_conv=5 18 | xcoordcrys=.true. 19 | xe0=0.0 20 | xepsilon(1)=0.01 21 | xepsilon(2)=0.02 22 | xepsilon(3)=0.03 23 | xerror=1e-10 24 | xiabs=1 25 | xkvec(1)=10.0 26 | xkvec(2)=20.0 27 | xkvec(3)=30.0 28 | xniter=50 29 | xread_wf=.false. 30 | / 31 | &plot 32 | cut_occ_states=.false. 33 | gamma_energy=0.0 34 | gamma_file='gamma.dat' 35 | gamma_mode='constant' 36 | gamma_value=10.0 37 | terminator=.false. 38 | xanes_file='xanes.dat' 39 | xemax=10.0 40 | xemin=0.0 41 | xgamma=0.1 42 | xnepoint=200 43 | / 44 | &pseudos 45 | filecore='Core.wfc' 46 | filerecon='bubu' 47 | r_paw(0)=1.01 48 | r_paw(1)=2.02 49 | r_paw(2)=3.03 50 | r_paw(3)=4.04 51 | / 52 | &cut_occ 53 | cut_desmooth=0.0001 54 | cut_ierror=1e-10 55 | cut_nmeml=10000 56 | cut_nmemu=10000 57 | cut_startt=1.0 58 | cut_stepl=0.0001 59 | cut_stepu=0.0001 60 | cut_tinf=1e-06 61 | cut_tsup=100.0 62 | / 63 | 1 1 1 0 0 0 -------------------------------------------------------------------------------- /qeschema/__init__.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c), 2015-2022, Quantum Espresso Foundation and SISSA (Scuola 3 | # Internazionale Superiore di Studi Avanzati). All rights reserved. 4 | # This file is distributed under the terms of the MIT License. See the 5 | # file 'LICENSE' in the root directory of the present distribution, or 6 | # http://opensource.org/licenses/MIT. 7 | # 8 | # Authors: Davide Brunato 9 | # 10 | from .documents import XmlDocument, QeDocument, PwDocument, PhononDocument, \ 11 | NebDocument, TdDocument, TdSpectrumDocument, XSpectraDocument, EPWDocument 12 | from .converters import RawInputConverter, PwInputConverter, \ 13 | PhononInputConverter, NebInputConverter, TdInputConverter, \ 14 | TdSpectrumInputConverter, XSpectraInputConverter, EPWInputConverter 15 | from .exceptions import QESchemaError, XmlDocumentError 16 | from .utils import set_logger 17 | 18 | __version__ = '1.5.2' 19 | 20 | __all__ = [ 21 | 'XmlDocument', 'QeDocument', 'PwDocument', 'PhononDocument', 'NebDocument', 22 | 'TdDocument', 'TdSpectrumDocument', 'EPWDocument', 'RawInputConverter', 23 | 'PwInputConverter', 'PhononInputConverter', 'TdInputConverter', 24 | 'TdSpectrumInputConverter', 'NebInputConverter', 'QESchemaError', 25 | 'XmlDocumentError', 'set_logger', 'hdf5', 'XSpectraDocument', 26 | 'XSpectraInputConverter', 'EPWInputConverter' 27 | ] 28 | -------------------------------------------------------------------------------- /tests/test_hdf5.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # 3 | # Copyright (c), 2021, Quantum Espresso Foundation and SISSA (Scuola 4 | # Internazionale Superiore di Studi Avanzati). All rights reserved. 5 | # This file is distributed under the terms of the MIT License. See the 6 | # file 'LICENSE' in the root directory of the present distribution, or 7 | # http://opensource.org/licenses/MIT. 8 | # Authors: Davide Brunato 9 | # 10 | import unittest 11 | import numpy as np 12 | from pathlib import Path 13 | 14 | try: 15 | import yaml 16 | except ImportError: 17 | yaml = None 18 | else: 19 | from qeschema.hdf5 import read_charge_file, get_wavefunctions, \ 20 | get_wf_attributes, get_wfc_miller_indices 21 | 22 | 23 | # TODO: Fetch appropriate HDF5 files for testing 24 | 25 | @unittest.SkipTest 26 | class TestHdf5Utils(unittest.TestCase): 27 | 28 | def test_read_charge_file(self): 29 | hdf5_file = Path(__file__).parent.joinpath('resources/hdf5/???') 30 | 31 | def test_get_wf_attributes(self): 32 | hdf5_file = Path(__file__).parent.joinpath('resources/hdf5/???') 33 | 34 | def test_get_wavefunctions(self): 35 | hdf5_file = Path(__file__).parent.joinpath('resources/hdf5/???') 36 | 37 | def test_get_wfc_miller_indices(self): 38 | hdf5_file = Path(__file__).parent.joinpath('resources/hdf5/???') 39 | 40 | 41 | if __name__ == '__main__': 42 | unittest.main() 43 | -------------------------------------------------------------------------------- /tests/test_upf.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # 3 | # Copyright (c), 2021, Quantum Espresso Foundation and SISSA (Scuola 4 | # Internazionale Superiore di Studi Avanzati). All rights reserved. 5 | # This file is distributed under the terms of the MIT License. See the 6 | # file 'LICENSE' in the root directory of the present distribution, or 7 | # http://opensource.org/licenses/MIT. 8 | # Authors: Davide Brunato 9 | # 10 | import unittest 11 | import numpy as np 12 | from pathlib import Path 13 | 14 | from qeschema.upf import read_pseudo_file 15 | 16 | 17 | class TestUpfUtils(unittest.TestCase): 18 | 19 | def test_read_pseudo_file(self): 20 | upf_file = Path(__file__).parent.joinpath('resources/upf/N.pz-vbc.UPF') 21 | 22 | obj = read_pseudo_file(str(upf_file)) 23 | self.assertIsInstance(obj, dict) 24 | self.assertListEqual(list(obj), ['PP_INFO', 'PP_HEADER', 'PP_MESH', 25 | 'PP_LOCAL', 'PP_RHOATOM', 'PP_NONLOCAL']) 26 | 27 | self.assertIsInstance(obj['PP_INFO'], dict) 28 | self.assertIsInstance(obj['PP_HEADER'], dict) 29 | self.assertIsInstance(obj['PP_MESH'], dict) 30 | self.assertIsInstance(obj['PP_MESH']['PP_R'], np.ndarray) 31 | self.assertIsInstance(obj['PP_LOCAL'], np.ndarray) 32 | self.assertIsInstance(obj['PP_RHOATOM'], np.ndarray) 33 | self.assertIsInstance(obj['PP_NONLOCAL'], dict) 34 | 35 | 36 | if __name__ == '__main__': 37 | unittest.main() 38 | -------------------------------------------------------------------------------- /tests/resources/xspectra/Cu_L23_xspectra.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | xanes_dipole 8 | L2 9 | high 10 | Cu 11 | $TMP_DIR/ 12 | 5000 13 | 500 14 | 1.0 15 | 1.0 16 | 1.0 17 | 11.5335 18 | 0.01 19 | 20 | 21 | 1000 22 | 0.5 23 | -10. 24 | 80.0 25 | true 26 | true 27 | 28 | 29 | Cu.wfc 30 | 2.0 31 | 2.0 32 | 33 | 34 | K-point mesh 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /tests/resources/xspectra/NiO_xspectra_dip.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | xanes_dipole 8 | NiO 9 | $TMP_DIR/ 10 | 1000 11 | 50 12 | 13 | 1.0 14 | 0.0 15 | 0.0 16 | 1 17 | NiO.xspectra_dip.sav 18 | 0.001 19 | 20 | 21 | 300 22 | 0.8 23 | -10.0 24 | 20.0 25 | true 26 | true 27 | 28 | 29 | Ni.wfc 30 | 1.5 31 | 32 | 33 | 0.1 34 | 35 | 36 | K-point mesh 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /tests/resources/ph/sio2_prova_qplot.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 1.0e-14 7 | 8 | 9 | SiO2_OR_36-2 10 | SiO2_36-2.dynG 11 | 12 | 13 | true 14 | true 15 | true 16 | false 17 | 18 | 19 | true 20 | 21 | 22 | 10 23 | 24 | 0.1 0.0 0.0 25 | 0.2 0.0 0.0 26 | 0.3 0.0 0.0 27 | 0.4 0.0 0.0 28 | 0.5 0.0 0.0 29 | 0.6 0.0 0.0 30 | 0.7 0.0 0.0 31 | 0.8 0.0 0.0 32 | 0.9 0.0 0.0 33 | 1.0 0.0 0.0 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /tox.ini: -------------------------------------------------------------------------------- 1 | # Tox (http://tox.testrun.org/) is a tool for running tests 2 | # in multiple virtualenvs. This configuration file will run the 3 | # test suite on all supported python versions. To use it, "pip install tox" 4 | # and then run "tox" from this directory. 5 | 6 | [tox] 7 | envlist = py{37,38,39,310,311,312,312}, xmlschema{251,301,331}, docs, flake8, coverage 8 | skip_missing_interpreters = true 9 | 10 | [testenv] 11 | deps = 12 | xmlschema>=2.5.1,<4.0.0 13 | pyyaml 14 | numpy 15 | h5py 16 | docs: Sphinx 17 | docs: sphinx_rtd_theme 18 | coverage: coverage 19 | commands = python -m unittest 20 | allowlist_externals = make 21 | 22 | [testenv:xmlschema251] 23 | deps = 24 | xmlschema==2.5.1 25 | pyyaml 26 | numpy 27 | h5py 28 | 29 | [testenv:xmlschema301] 30 | deps = 31 | xmlschema==3.0.1 32 | pyyaml 33 | numpy 34 | h5py 35 | 36 | [testenv:xmlschema331] 37 | deps = 38 | xmlschema==3.3.1 39 | pyyaml 40 | numpy 41 | h5py 42 | 43 | [testenv:docs] 44 | commands = 45 | make -C docs html 46 | make -C docs doctest 47 | make -C docs latexpdf 48 | 49 | [flake8] 50 | max-line-length = 100 51 | 52 | [testenv:flake8] 53 | deps = 54 | flake8 55 | commands = 56 | flake8 qeschema 57 | 58 | [testenv:coverage] 59 | commands = 60 | coverage run -p -m unittest 61 | coverage combine 62 | coverage report -m 63 | 64 | [testenv:build] 65 | deps = 66 | setuptools 67 | wheel 68 | commands = 69 | python setup.py clean --all 70 | python setup.py sdist --dist-dir {toxinidir}/dist 71 | python setup.py bdist_wheel --dist-dir {toxinidir}/dist 72 | -------------------------------------------------------------------------------- /qeschema/namespaces.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c), 2015-2020, Quantum Espresso Foundation and SISSA (Scuola 3 | # Internazionale Superiore di Studi Avanzati). All rights reserved. 4 | # This file is distributed under the terms of the MIT License. See the 5 | # file 'LICENSE' in the root directory of the present distribution, or 6 | # http://opensource.org/licenses/MIT. 7 | # 8 | # Authors: Davide Brunato 9 | # 10 | 11 | ### 12 | # XML Schema namespaces 13 | 14 | XSD_NAMESPACE = 'http://www.w3.org/2001/XMLSchema' 15 | "URI of the XML Schema Definition namespace (xs|xsd)" 16 | 17 | XSI_NAMESPACE = 'http://www.w3.org/2001/XMLSchema-instance' 18 | "URI of the XML Schema Instance namespace (xsi)" 19 | 20 | XML_NAMESPACE = 'http://www.w3.org/XML/1998/namespace' 21 | "URI of the XML namespace (xml)" 22 | 23 | ### 24 | # QE namespaces 25 | 26 | PW_NAMESPACE = "http://www.quantum-espresso.org/ns/qes/qes-1.0" 27 | "URI of the Quantum Espresso namespace for PW application" 28 | 29 | PHONON_NAMESPACE = "http://www.quantum-espresso.org/ns/qes/qes_ph_1.0" 30 | "URI of the Quantum Espresso namespace for Phonon application" 31 | 32 | NEB_NAMESPACE = "http://www.quantum-espresso.org/ns/neb" 33 | "URI of the Quantum Espresso namespace for NEB application" 34 | 35 | TD_NAMESPACE = "http://www.quantum-espresso.org/ns/neb" 36 | "URI of the Quantum Espresso namespace for TDDFPT application" 37 | 38 | TD_SPECTRUM_NAMESPACE = "http://www.quantum-espresso.org/ns/qes/qes_spectrum-1.0" 39 | "URI of the Quantum Espresso namespace for turbo-spectrum application" 40 | 41 | # XSpectra namespace 42 | XSPECTRA_NAMESPACE = "http://www.quantum-espresso.org/ns/qes/qes_xspectra-1.0" 43 | "URI of the Quantum Espresso namespace for XSPECTRA application" 44 | -------------------------------------------------------------------------------- /tests/resources/epw/epw_test2.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | sic 8 | sic 9 | ./ 10 | 0 11 | true 12 | false 13 | true 14 | false 15 | true 16 | 1 17 | 4 18 | 12.01078 19 | 28.0855 20 | 3 21 | 3 22 | 3 23 | 3 24 | 3 25 | 3 26 | false 27 | dipole 28 | true 29 | true 30 | true 31 | 32 | 33 | 300 34 | 12 35 | 7 36 | Si:sp3 37 | 2 38 | true 39 | 40 | L 0.50 0.00 0.00 G 0.00 0.00 0.00 41 | 42 | 43 | G 0.00 0.00 0.00 X 0.50 0.50 0.00 44 | 45 | true 46 | gnuplot 47 | 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /tests/resources/pw/Pt_spinorbit.in.test: -------------------------------------------------------------------------------- 1 | &CONTROL 2 | calculation='scf' 3 | disk_io='low' 4 | etot_conv_thr=0.0001 5 | forc_conv_thr=0.001 6 | input_xml_schema_file='Pt_spinorbit.xml' 7 | iprint=100000 8 | max_seconds=10000000 9 | outdir='/scratch/pdelugas/espresso-xsd/tempdir/' 10 | prefix='Pt' 11 | pseudo_dir='/scratch/pdelugas/espresso-xsd/pseudo/' 12 | restart_mode='from_scratch' 13 | title='Pt_fullyRelativistic' 14 | tprnfor=.true. 15 | tstress=.true. 16 | verbosity='low' 17 | wf_collect=.false. 18 | / 19 | &SYSTEM 20 | degauss=0.02 21 | ecutrho=250.0 22 | ecutwfc=30.0 23 | force_symmorphic=.false. 24 | ibrav=0 25 | input_dft='PZ' 26 | lspinorb=.true. 27 | nat=1 28 | no_t_rev=.false. 29 | noinv=.false. 30 | noncolin=.false. 31 | nosym=.false. 32 | nosym_evc=.false. 33 | nspin=1 34 | ntyp=1 35 | occupations='smearing' 36 | smearing='mp' 37 | starting_magnetization(1)=0.0 38 | tot_charge=0.0 39 | use_all_frac=.false. 40 | / 41 | &ELECTRONS 42 | conv_thr=1e-08 43 | diago_cg_maxiter=20 44 | diago_full_acc=.false. 45 | diago_thr_init=0.0 46 | diagonalization='davidson' 47 | electron_maxstep=100 48 | mixing_beta=0.7 49 | mixing_mode='plain' 50 | mixing_ndim=8 51 | tbeta_smoothing=.false. 52 | tq_smoothing=.false. 53 | tqr=.false. 54 | / 55 | &IONS 56 | ion_dynamics='none' 57 | refold_pos=.false. 58 | remove_rigid_rot=.false. 59 | / 60 | &CELL 61 | cell_dynamics='none' 62 | cell_factor=0.0 63 | press=0.0 64 | press_conv_thr=0.5 65 | wmass=177802.7 66 | / 67 | ATOMIC_SPECIES 68 | Pt 0.0 Pt.rel-pz-n-rrkjus.UPF 69 | ATOMIC_POSITIONS bohr 70 | Pt 0.00000000 0.00000000 0.00000000 71 | K_POINTS automatic 72 | 4 4 4 1 1 1 73 | CELL_PARAMETERS bohr 74 | -0.50000000 0.00000000 0.50000000 75 | 0.00000000 0.50000000 0.50000000 76 | -0.50000000 0.50000000 0.00000000 77 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: python 2 | python: 3 | - "3.6" 4 | - "3.7" 5 | - "3.8" 6 | - "3.9" 7 | install: 8 | - pip install -r requirements-dev.txt 9 | script: 10 | - python -m unittest 11 | matrix: 12 | include: 13 | - name: "Python 3.7.4 on macOS 10.14.4" 14 | os: osx 15 | osx_image: xcode11.2 16 | language: shell 17 | before_install: 18 | - python3 --version 19 | - pip3 install --upgrade pip 20 | install: pip3 install -r requirements-dev.txt 21 | script: python3 -m unittest 22 | - name: "Python 3.7.7 on macOS 10.14.6" 23 | os: osx 24 | osx_image: xcode11.3 25 | language: shell 26 | before_install: 27 | - python3 --version 28 | - pip3 install --upgrade pip 29 | install: pip3 install -r requirements-dev.txt 30 | script: python3 -m unittest 31 | - name: "Python 3.7.7 on macOS 10.15.4" 32 | os: osx 33 | osx_image: xcode11.4 34 | language: shell 35 | before_install: 36 | - python3 --version 37 | - pip3 install --upgrade pip 38 | install: pip3 install -r requirements-dev.txt 39 | script: python3 -m unittest 40 | - name: "Python 3.7.7 on Windows" 41 | os: windows 42 | language: shell 43 | before_install: 44 | - choco install python --version 3.7.7 45 | - python --version 46 | - python -m pip install --upgrade pip 47 | - python -m pip install certifi 48 | env: PATH=/c/Python37:/c/Python37/Scripts:$PATH 49 | - name: "Python 3.8.3 on Windows" 50 | os: windows 51 | language: shell 52 | before_install: 53 | - choco install python --version 3.8.3 54 | - python --version 55 | - python -m pip install --upgrade pip 56 | - python -m pip install certifi 57 | env: PATH=/c/Python38:/c/Python38/Scripts:$PATH 58 | -------------------------------------------------------------------------------- /tests/resources/pw/CO_bgfs_relax.in.test: -------------------------------------------------------------------------------- 1 | &CONTROL 2 | calculation='relax' 3 | disk_io='low' 4 | etot_conv_thr=5e-05 5 | forc_conv_thr=0.0005 6 | input_xml_schema_file='CO_bgfs_relax.xml' 7 | iprint=100000 8 | max_seconds=10000000 9 | nstep=50 10 | outdir='./' 11 | prefix='CO' 12 | pseudo_dir='./' 13 | restart_mode='from_scratch' 14 | title='CO bfgs relaxation' 15 | tprnfor=.false. 16 | tstress=.false. 17 | verbosity='low' 18 | wf_collect=.false. 19 | / 20 | &SYSTEM 21 | ecutrho=72.0 22 | ecutwfc=12.0 23 | force_symmorphic=.false. 24 | ibrav=0 25 | input_dft='PZ' 26 | lspinorb=.false. 27 | nat=2 28 | no_t_rev=.false. 29 | noinv=.false. 30 | noncolin=.false. 31 | nosym=.false. 32 | nosym_evc=.false. 33 | nspin=1 34 | ntyp=2 35 | occupations='fixed' 36 | starting_magnetization(1)=0.0 37 | starting_magnetization(2)=0.0 38 | tot_charge=0.0 39 | use_all_frac=.false. 40 | / 41 | &ELECTRONS 42 | conv_thr=5e-08 43 | diago_cg_maxiter=20 44 | diago_full_acc=.false. 45 | diago_thr_init=0.0 46 | diagonalization='davidson' 47 | electron_maxstep=100 48 | mixing_beta=0.7 49 | mixing_mode='plain' 50 | mixing_ndim=8 51 | tbeta_smoothing=.false. 52 | tq_smoothing=.false. 53 | tqr=.false. 54 | / 55 | &IONS 56 | bfgs_ndim=1 57 | ion_dynamics='bfgs' 58 | refold_pos=.false. 59 | remove_rigid_rot=.false. 60 | trust_radius_ini=0.5 61 | trust_radius_max=0.8 62 | trust_radius_min=0.0001 63 | upscale=100.0 64 | w_1=0.01 65 | w_2=0.5 66 | / 67 | &CELL 68 | cell_dofree = 'all' 69 | cell_dynamics='none' 70 | press=0.0 71 | press_conv_thr=0.5 72 | wmass=0.0 73 | / 74 | ATOMIC_SPECIES 75 | O 1.0 O.pbesol-n-kjpaw_psl.0.1.UPF 76 | C 1.0 C.pbesol-n-kjpaw_psl.1.0.0.UPF 77 | ATOMIC_POSITIONS bohr 78 | C 0.18800000 0.00000000 0.00000000 79 | O 0.00000000 0.00000000 0.00000000 0 0 0 80 | K_POINTS gamma 81 | CELL_PARAMETERS bohr 82 | 10.00000000 0.00000000 0.00000000 83 | 0.00000000 10.00000000 0.00000000 84 | 0.00000000 0.00000000 10.00000000 -------------------------------------------------------------------------------- /tests/resources/pw/PbTiO3_scf.in.test: -------------------------------------------------------------------------------- 1 | &CONTROL 2 | calculation='scf' 3 | disk_io='low' 4 | etot_conv_thr=0.0001 5 | forc_conv_thr=0.001 6 | input_xml_schema_file='PbTiO3_scf.xml' 7 | iprint=100000 8 | max_seconds=10000000 9 | outdir='/scratch/pdelugas/espresso-xsd/tempdir/' 10 | prefix='pwscf' 11 | pseudo_dir='/scratch/pdelugas/espresso-xsd/pseudo/' 12 | restart_mode='from_scratch' 13 | title='PBTiO3_scf' 14 | tprnfor=.false. 15 | tstress=.false. 16 | verbosity='low' 17 | wf_collect=.false. 18 | / 19 | &SYSTEM 20 | ecutwfc=30.0 21 | force_symmorphic=.false. 22 | ibrav=0 23 | input_dft='PZ' 24 | lspinorb=.false. 25 | nat=5 26 | nbnd=25 27 | no_t_rev=.false. 28 | noinv=.false. 29 | noncolin=.false. 30 | nosym=.false. 31 | nosym_evc=.false. 32 | nspin=1 33 | ntyp=3 34 | occupations='fixed' 35 | starting_magnetization(1)=0.0 36 | starting_magnetization(2)=0.0 37 | starting_magnetization(3)=0.0 38 | tot_charge=0.0 39 | use_all_frac=.false. 40 | / 41 | &ELECTRONS 42 | conv_thr=1e-12 43 | diago_cg_maxiter=20 44 | diago_full_acc=.false. 45 | diago_thr_init=0.0 46 | diagonalization='davidson' 47 | electron_maxstep=100 48 | mixing_beta=0.3 49 | mixing_mode='plain' 50 | mixing_ndim=8 51 | tbeta_smoothing=.false. 52 | tq_smoothing=.false. 53 | tqr=.false. 54 | / 55 | &IONS 56 | ion_dynamics='none' 57 | refold_pos=.false. 58 | remove_rigid_rot=.false. 59 | / 60 | &CELL 61 | cell_dynamics='none' 62 | cell_factor=0.0 63 | press=0.0 64 | press_conv_thr=0.5 65 | wmass=276227.0 66 | / 67 | ATOMIC_SPECIES 68 | Pb 207.2 Pb.pz-d-van.UPF 69 | Ti 47.867 Ti.pz-sp-van_ak.UPF 70 | O 15.9994 O.pz-van_ak.UPF 71 | ATOMIC_POSITIONS bohr 72 | Pb 0.00000000 0.00000000 0.00135687 73 | Ti 0.06784353 0.06784353 0.06784353 74 | O 0.00000000 0.06784353 0.06784353 75 | O 0.06784353 0.06784353 0.00000000 76 | O 0.06784353 0.00000000 0.06784353 77 | K_POINTS automatic 78 | 4 4 4 1 1 1 79 | CELL_PARAMETERS bohr 80 | 1.00000000 0.00000000 0.00000000 81 | 0.00000000 1.00000000 0.00000000 82 | 0.00000000 0.00000000 1.00000000 83 | -------------------------------------------------------------------------------- /README.rst: -------------------------------------------------------------------------------- 1 | ===================================================== 2 | Quantum Espresso tools for XML Schema based documents 3 | ===================================================== 4 | 5 | .. qeschema-introduction 6 | 7 | The `qeschema `_ package provides tools for 8 | converting XML data produced by the Quantum ESPRESSO suite of codes (ESPRESSO: 9 | opEn-Source Package for Research in Electronic Structure, Simulation and Optimization). 10 | 11 | Requirements 12 | ------------ 13 | 14 | * Python_ 3.7+ 15 | * xmlschema_ (Python library for processing XML Schema based documents) 16 | 17 | .. _Python: http://www.python.org/ 18 | .. _xmlschema: https://github.com/brunato/xmlschema 19 | 20 | 21 | Installation 22 | ------------ 23 | 24 | You can install the library with *pip* in a Python 3.7+ environment:: 25 | 26 | pip install qeschema 27 | 28 | If you need HDF5 utilities and/or the YAML format, install the extra 29 | features using the appropriate command from these alternatives:: 30 | 31 | pip install qeschema[HDF5] 32 | pip install qeschema[YAML] 33 | pip install qeschema[HDF5,YAML] 34 | 35 | 36 | Usage 37 | ----- 38 | 39 | Define you data document using: 40 | 41 | .. code-block:: pycon 42 | 43 | >>> import qeschema 44 | >>> pw_document = qeschema.PwDocument() 45 | 46 | and then read XML data from a file processed by the corresponding application of 47 | Quantum ESPRESSO suite: 48 | 49 | .. code-block:: pycon 50 | 51 | >>> pw_document.read("tests/examples/pw/Si.xml") 52 | 53 | Loaded data can be decoded to Python data dictionary or written to JSON or YAML formats: 54 | 55 | .. code-block:: pycon 56 | 57 | >>> xml_data = pw_document.to_dict() 58 | >>> json_data = pw_document.to_json() 59 | 60 | 61 | Authors 62 | ------- 63 | * Davide Brunato 64 | * Pietro Delugas 65 | * Giovanni Borghi 66 | * Alexandr Fonari 67 | 68 | 69 | License 70 | ------- 71 | This software is distributed under the terms of the MIT License. 72 | See the file 'LICENSE' in the root directory of the present 73 | distribution, or http://opensource.org/licenses/MIT. 74 | 75 | -------------------------------------------------------------------------------- /tests/resources/pw/Fe_crystal_crystal_positions.in.test: -------------------------------------------------------------------------------- 1 | &CONTROL 2 | calculation='relax' 3 | disk_io='low' 4 | dt=41.3414 5 | etot_conv_thr=1e-05 6 | forc_conv_thr=0.001 7 | input_xml_schema_file='Fe_crystal_crystal_positions.xml' 8 | iprint=100000 9 | max_seconds=10000000 10 | nstep=50 11 | outdir='./' 12 | prefix='Fe_crystal_crystal_positions' 13 | pseudo_dir='./' 14 | restart_mode='from_scratch' 15 | title='Fe_crystal_crystal_positions' 16 | tprnfor=.false. 17 | tstress=.false. 18 | verbosity='low' 19 | wf_collect=.false. 20 | / 21 | &SYSTEM 22 | degauss=0.01 23 | ecutrho=100.0 24 | ecutwfc=20.0 25 | force_symmorphic=.false. 26 | ibrav=0 27 | input_dft='BLYP' 28 | lspinorb=.false. 29 | nat=2 30 | nbnd=26 31 | no_t_rev=.false. 32 | noinv=.false. 33 | noncolin=.false. 34 | nosym=.false. 35 | nosym_evc=.false. 36 | nspin=2 37 | ntyp=2 38 | occupations='smearing' 39 | smearing='gaussian' 40 | spline_ps=.false. 41 | starting_magnetization(1)=0.4 42 | starting_magnetization(2)=0.6 43 | tot_charge=0.0 44 | tot_magnetization=-1.0 45 | use_all_frac=.false. 46 | / 47 | &ELECTRONS 48 | conv_thr=1e-06 49 | diago_cg_maxiter=20 50 | diago_full_acc=.false. 51 | diago_thr_init=0.0 52 | diagonalization='davidson' 53 | electron_maxstep=100 54 | mixing_beta=0.7 55 | mixing_mode='plain' 56 | mixing_ndim=8 57 | tbeta_smoothing=.false. 58 | tq_smoothing=.false. 59 | tqr=.false. 60 | / 61 | &IONS 62 | delta_t=1.0 63 | ion_dynamics='bfgs' 64 | ion_temperature='rescale-v' 65 | nraise=1 66 | pot_extrapolation='atomic' 67 | tempw=300.0 68 | tolp=100.0 69 | wfc_extrapolation='none' 70 | / 71 | &CELL 72 | cell_dynamics='bfgs' 73 | cell_factor=2.0 74 | press=0.0 75 | press_conv_thr=0.5 76 | / 77 | ATOMIC_SPECIES 78 | Fe 55.845 fe_pbe_v1.5.uspp.F.UPF 79 | Fe1 55.845 fe_pbe_v1.5.uspp.F.UPF 80 | ATOMIC_POSITIONS crystal 81 | Fe 0.00000000 0.00000000 0.00000000 82 | Fe1 0.50000000 0.50000000 0.50000000 83 | K_POINTS automatic 84 | 2 2 2 1 1 1 85 | CELL_PARAMETERS bohr 86 | 5.40650600 0.00000000 0.00000000 87 | 0.00000000 5.40650600 0.00000000 88 | 0.00000000 0.00000000 5.40650600 -------------------------------------------------------------------------------- /tests/resources/pw/Fe_noncolin.in.test: -------------------------------------------------------------------------------- 1 | &CONTROL 2 | calculation='scf' 3 | disk_io='low' 4 | etot_conv_thr=0.0001 5 | forc_conv_thr=0.001 6 | input_xml_schema_file='Fe_noncolin.xml' 7 | iprint=100000 8 | max_seconds=10000000 9 | outdir='/scratch/pdelugas/espresso-xsd/tempdir/' 10 | prefix='fe' 11 | pseudo_dir='/scratch/pdelugas/espresso-xsd/pseudo/' 12 | restart_mode='from_scratch' 13 | title='Fe_non_collinear' 14 | tprnfor=.false. 15 | tstress=.false. 16 | verbosity='low' 17 | wf_collect=.false. 18 | / 19 | &SYSTEM 20 | degauss=0.05 21 | ecutrho=200.0 22 | ecutwfc=25.0 23 | force_symmorphic=.false. 24 | ibrav=0 25 | input_dft='PZ' 26 | lspinorb=.false. 27 | nat=1 28 | no_t_rev=.false. 29 | noinv=.false. 30 | noncolin=.true. 31 | nosym=.false. 32 | nosym_evc=.false. 33 | nspin=4 34 | ntyp=1 35 | occupations='smearing' 36 | smearing='mv' 37 | starting_magnetization(1)=0.5 38 | tot_charge=0.0 39 | use_all_frac=.false. 40 | / 41 | &ELECTRONS 42 | conv_thr=1e-08 43 | diago_cg_maxiter=20 44 | diago_full_acc=.false. 45 | diago_thr_init=0.0 46 | diagonalization='davidson' 47 | electron_maxstep=100 48 | mixing_beta=0.2 49 | mixing_mode='plain' 50 | mixing_ndim=8 51 | tbeta_smoothing=.false. 52 | tq_smoothing=.false. 53 | tqr=.false. 54 | / 55 | &IONS 56 | ion_dynamics='none' 57 | refold_pos=.false. 58 | remove_rigid_rot=.false. 59 | / 60 | &CELL 61 | cell_dynamics='none' 62 | cell_factor=0.0 63 | press=0.0 64 | press_conv_thr=0.5 65 | wmass=50901.43 66 | / 67 | ATOMIC_SPECIES 68 | Fe 55.847 Fe.pz-nd-rrkjus.UPF 69 | ATOMIC_POSITIONS bohr 70 | Fe 0.00000000 0.00000000 0.00000000 71 | K_POINTS 72 | 11 73 | 0.0625 0.0625 0.0625 1.0 74 | 0.0625 0.0625 0.1875 3.0 75 | 0.0625 0.0625 0.3125 3.0 76 | 0.0625 0.0625 0.4375 3.0 77 | 0.0625 0.0625 0.5625 3.0 78 | 0.0625 0.0625 0.6875 3.0 79 | 0.0625 0.0625 0.8125 3.0 80 | 0.0625 0.0625 0.9375 3.0 81 | 0.0625 0.1875 0.1875 3.0 82 | 0.0625 0.1875 0.3125 6.0 83 | 0.0625 0.1875 0.4375 6.0 84 | CELL_PARAMETERS bohr 85 | 2.60850000 2.60850000 2.60850000 86 | -2.60850000 2.60850000 2.60850000 87 | -2.60850000 -2.60850000 2.60850000 88 | -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # 3 | # Copyright (c), 2015-2022, Quantum Espresso Foundation and SISSA (Scuola 4 | # Internazionale Superiore di Studi Avanzati). All rights reserved. 5 | # This file is distributed under the terms of the MIT License. See the 6 | # file 'LICENSE' in the root directory of the present distribution, or 7 | # http://opensource.org/licenses/MIT. 8 | # 9 | # @author Davide Brunato 10 | # 11 | from setuptools import setup 12 | 13 | with open("README.rst") as readme: 14 | long_description = readme.read() 15 | 16 | setup( 17 | name='qeschema', 18 | version='1.5.2', 19 | install_requires=['xmlschema>=2.5.1,<4.0.0', 'numpy'], 20 | extras_require={ 21 | 'HDF5': ['h5py'], 22 | 'YAML': ['pyyaml'], 23 | }, 24 | packages=['qeschema', 'qeschema.hdf5'], 25 | package_data={'qeschema': ['schemas/*.xsd', 'schemas/releases/*.xsd']}, 26 | scripts = ['scripts/xml2qeinput.py', 'scripts/yaml2qeinput.py'], 27 | url='https://github.com/QEF/qeschema', 28 | authors='Davide Brunato,Pietro Delugas,Giovanni Borghi,Alexandr Fonari', 29 | license='MIT', 30 | license_file='LICENSE', 31 | description='Schema-based tools and interfaces for Quantum Espresso data', 32 | long_description=long_description, 33 | classifiers=[ 34 | 'Development Status :: 5 - Production/Stable', 35 | 'Intended Audience :: Science/Research', 36 | 'License :: OSI Approved :: MIT License', 37 | 'Operating System :: OS Independent', 38 | 'Programming Language :: Python', 39 | 'Programming Language :: Python :: 3', 40 | 'Programming Language :: Python :: 3 :: Only', 41 | 'Programming Language :: Python :: 3.7', 42 | 'Programming Language :: Python :: 3.8', 43 | 'Programming Language :: Python :: 3.9', 44 | 'Programming Language :: Python :: 3.10', 45 | 'Programming Language :: Python :: 3.11', 46 | 'Programming Language :: Python :: 3.12', 47 | 'Programming Language :: Python :: Implementation :: CPython', 48 | 'Topic :: Scientific/Engineering :: Physics', 49 | 'Topic :: Utilities', 50 | ] 51 | ) 52 | -------------------------------------------------------------------------------- /tests/resources/pw/Fe_Im-3m_0_dftd3.in.test: -------------------------------------------------------------------------------- 1 | &CONTROL 2 | calculation='relax' 3 | disk_io='low' 4 | dt=41.3414 5 | etot_conv_thr=1e-05 6 | forc_conv_thr=0.001 7 | input_xml_schema_file='Fe_Im-3m_0_dftd3.xml' 8 | iprint=100000 9 | max_seconds=10000000 10 | nstep=50 11 | outdir='./' 12 | prefix='Fe_Im-3m_0_dftd3' 13 | pseudo_dir='./' 14 | restart_mode='from_scratch' 15 | title='Fe_Im-3m_0_dftd3' 16 | tprnfor=.false. 17 | tstress=.false. 18 | verbosity='low' 19 | wf_collect=.false. 20 | / 21 | &SYSTEM 22 | degauss=0.01 23 | dftd3_threebody=.true. 24 | dftd3_version=4 25 | ecutrho=100.0 26 | ecutwfc=20.0 27 | force_symmorphic=.false. 28 | ibrav=0 29 | input_dft='PBE' 30 | lspinorb=.false. 31 | nat=2 32 | nbnd=26 33 | no_t_rev=.false. 34 | noinv=.false. 35 | noncolin=.false. 36 | nosym=.false. 37 | nosym_evc=.false. 38 | nspin=2 39 | ntyp=2 40 | occupations='smearing' 41 | smearing='gaussian' 42 | spline_ps=.false. 43 | starting_magnetization(1)=0.4 44 | starting_magnetization(2)=0.6 45 | tot_charge=0.0 46 | tot_magnetization=-1.0 47 | use_all_frac=.false. 48 | vdw_corr='DFT-D3' 49 | / 50 | &ELECTRONS 51 | conv_thr=1e-06 52 | diago_cg_maxiter=20 53 | diago_full_acc=.false. 54 | diago_thr_init=0.0 55 | diagonalization='davidson' 56 | electron_maxstep=100 57 | mixing_beta=0.7 58 | mixing_mode='plain' 59 | mixing_ndim=8 60 | tbeta_smoothing=.false. 61 | tq_smoothing=.false. 62 | tqr=.false. 63 | / 64 | &IONS 65 | delta_t=1.0 66 | ion_dynamics='bfgs' 67 | ion_temperature='rescale-v' 68 | nraise=1 69 | pot_extrapolation='atomic' 70 | tempw=300.0 71 | tolp=100.0 72 | wfc_extrapolation='none' 73 | / 74 | &CELL 75 | cell_dynamics='bfgs' 76 | cell_factor=2.0 77 | press=0.0 78 | press_conv_thr=0.5 79 | / 80 | ATOMIC_SPECIES 81 | Fe 55.845 fe_pbe_v1.5.uspp.F.UPF 82 | Fe1 55.845 fe_pbe_v1.5.uspp.F.UPF 83 | ATOMIC_POSITIONS crystal 84 | Fe 0.00000000 0.00000000 0.00000000 85 | Fe1 0.50000000 0.50000000 0.50000000 86 | K_POINTS automatic 87 | 2 2 2 1 1 1 88 | CELL_PARAMETERS bohr 89 | 5.40650600 0.00000000 0.00000000 90 | 0.00000000 5.40650600 0.00000000 91 | 0.00000000 0.00000000 5.40650600 -------------------------------------------------------------------------------- /tests/resources/pw/Al001_rlx_damp.in.test: -------------------------------------------------------------------------------- 1 | &CONTROL 2 | calculation='relax' 3 | disk_io='low' 4 | etot_conv_thr=0.0001 5 | forc_conv_thr=0.001 6 | input_xml_schema_file='Al001_rlx_damp.xml' 7 | iprint=100000 8 | max_seconds=10000000 9 | outdir='/scratch/pdelugas/espresso-xsd/tempdir' 10 | prefix='Al' 11 | pseudo_dir='/scratch/pdelugas/espresso-xsd/pseudo' 12 | restart_mode='from_scratch' 13 | title='Al001 relaxation with damped dynamics' 14 | tprnfor=.false. 15 | tstress=.false. 16 | verbosity='low' 17 | wf_collect=.false. 18 | / 19 | &SYSTEM 20 | degauss=0.05 21 | ecutwfc=12.0 22 | force_symmorphic=.false. 23 | ibrav=0 24 | input_dft='PZ' 25 | lspinorb=.false. 26 | nat=7 27 | no_t_rev=.false. 28 | noinv=.false. 29 | noncolin=.false. 30 | nosym=.false. 31 | nosym_evc=.false. 32 | nspin=1 33 | ntyp=1 34 | occupations='smearing' 35 | smearing='gaussian' 36 | starting_magnetization(1)=0.0 37 | tot_charge=0.0 38 | use_all_frac=.false. 39 | / 40 | &ELECTRONS 41 | conv_thr=1e-07 42 | diago_cg_maxiter=20 43 | diago_full_acc=.false. 44 | diago_thr_init=0.0 45 | diagonalization='davidson' 46 | electron_maxstep=100 47 | mixing_beta=0.3 48 | mixing_mode='plain' 49 | mixing_ndim=8 50 | tbeta_smoothing=.false. 51 | tq_smoothing=.false. 52 | tqr=.false. 53 | / 54 | &IONS 55 | ion_dynamics='damp' 56 | refold_pos=.false. 57 | remove_rigid_rot=.false. 58 | / 59 | &CELL 60 | cell_dynamics='none' 61 | cell_factor=0.0 62 | press=0.0 63 | press_conv_thr=0.5 64 | wmass=6380.11 65 | / 66 | ATOMIC_SPECIES 67 | Al 1.0 Al.pz-vbc.UPF 68 | ATOMIC_POSITIONS bohr 69 | Al 0.09428092 0.09428092 -0.40000000 70 | Al 0.00000000 0.00000000 -0.26666660 71 | Al 0.09428092 0.09428092 -0.13333340 72 | Al 0.00000000 0.00000000 0.00000000 73 | Al 0.09428092 0.09428092 0.13333340 74 | Al 0.00000000 0.00000000 0.26666660 75 | Al 0.09428092 0.09428092 0.40000000 76 | K_POINTS 77 | 3 78 | 0.125 0.125 0.0 1.0 79 | 0.125 0.375 0.0 2.0 80 | 0.375 0.375 0.0 1.0 81 | CELL_PARAMETERS bohr 82 | 1.00000000 0.00000000 0.00000000 83 | 0.00000000 1.00000000 0.00000000 84 | 0.00000000 0.00000000 8.00000000 85 | -------------------------------------------------------------------------------- /tests/resources/pw/CO_bgfs_relax_with_external_forces.in.test: -------------------------------------------------------------------------------- 1 | &CONTROL 2 | calculation='relax' 3 | disk_io='low' 4 | etot_conv_thr=0.0001 5 | forc_conv_thr=0.001 6 | input_xml_schema_file='CO_bgfs_relax_with_external_forces.xml' 7 | iprint=100000 8 | max_seconds=10000000 9 | outdir='/scratch/pdelugas/espresso-xsd/tempdir' 10 | prefix='CO' 11 | pseudo_dir='/scratch/pdelugas/espresso-xsd/pseudo' 12 | restart_mode='from_scratch' 13 | title='CO bfgs relaxation' 14 | tprnfor=.false. 15 | tstress=.false. 16 | verbosity='low' 17 | wf_collect=.false. 18 | / 19 | &SYSTEM 20 | ecutrho=144.0 21 | ecutwfc=24.0 22 | force_symmorphic=.false. 23 | ibrav=0 24 | input_dft='PZ' 25 | lspinorb=.false. 26 | nat=2 27 | no_t_rev=.false. 28 | noinv=.false. 29 | noncolin=.false. 30 | nosym=.false. 31 | nosym_evc=.false. 32 | nspin=1 33 | ntyp=2 34 | occupations='fixed' 35 | starting_magnetization(1)=0.0 36 | starting_magnetization(2)=0.0 37 | tot_charge=0.0 38 | use_all_frac=.false. 39 | / 40 | &ELECTRONS 41 | conv_thr=1e-07 42 | diago_cg_maxiter=20 43 | diago_full_acc=.false. 44 | diago_thr_init=0.0 45 | diagonalization='davidson' 46 | electron_maxstep=100 47 | mixing_beta=0.7 48 | mixing_mode='plain' 49 | mixing_ndim=8 50 | tbeta_smoothing=.false. 51 | tq_smoothing=.false. 52 | tqr=.false. 53 | / 54 | &IONS 55 | bfgs_ndim=1 56 | ion_dynamics='bfgs' 57 | refold_pos=.false. 58 | remove_rigid_rot=.false. 59 | trust_radius_ini=0.5 60 | trust_radius_max=0.8 61 | trust_radius_min=0.0001 62 | upscale=100.0 63 | w_1=0.01 64 | w_2=0.5 65 | / 66 | &CELL 67 | cell_dynamics='none' 68 | cell_factor=0.0 69 | press=0.0 70 | press_conv_thr=0.5 71 | wmass=1822.888 72 | / 73 | ATOMIC_SPECIES 74 | O 1.0 O.pz-rrkjus.UPF 75 | C 1.0 C.pz-rrkjus.UPF 76 | ATOMIC_POSITIONS bohr 77 | C 0.18800000 0.00000000 0.00000000 78 | O 0.00000000 0.00000000 0.00000000 0 0 0 79 | K_POINTS gamma 80 | CELL_PARAMETERS bohr 81 | 1.00000000 0.00000000 0.00000000 82 | 0.00000000 1.00000000 0.00000000 83 | 0.00000000 0.00000000 1.00000000 84 | ATOMIC_FORCES 85 | C 0.10000000 0.00000000 0.00000000 86 | O -0.10000000 0.00000000 0.00000000 -------------------------------------------------------------------------------- /tests/resources/pw/FeO_LDAU_with_no_U_230310.in.test: -------------------------------------------------------------------------------- 1 | &CONTROL 2 | calculation='scf' 3 | disk_io='low' 4 | etot_conv_thr=0.0001 5 | forc_conv_thr=0.001 6 | input_xml_schema_file='FeO_LDAU_with_no_U_230310.xml' 7 | iprint=100000 8 | max_seconds=10000000 9 | outdir='/scratch/pdelugas/espresso-xsd/tempdir/' 10 | prefix='feo_af' 11 | pseudo_dir='/scratch/pdelugas/espresso-xsd/pseudo/' 12 | restart_mode='from_scratch' 13 | title='FeO_LDA+U=0' 14 | tprnfor=.true. 15 | tstress=.true. 16 | verbosity='low' 17 | wf_collect=.false. 18 | / 19 | &SYSTEM 20 | degauss=0.01 21 | ecutrho=240.0 22 | ecutwfc=30.0 23 | force_symmorphic=.false. 24 | ibrav=0 25 | input_dft='PZ' 26 | lspinorb=.false. 27 | nat=4 28 | nbnd=20 29 | no_t_rev=.false. 30 | noinv=.false. 31 | noncolin=.false. 32 | nosym=.false. 33 | nosym_evc=.false. 34 | nspin=2 35 | ntyp=3 36 | occupations='smearing' 37 | smearing='gaussian' 38 | starting_magnetization(1)=0.0 39 | starting_magnetization(2)=0.5 40 | starting_magnetization(3)=-0.5 41 | tot_charge=0.0 42 | use_all_frac=.false. 43 | / 44 | &ELECTRONS 45 | conv_thr=1e-06 46 | diago_cg_maxiter=20 47 | diago_full_acc=.false. 48 | diago_thr_init=0.0 49 | diagonalization='davidson' 50 | electron_maxstep=100 51 | mixing_beta=0.3 52 | mixing_mode='plain' 53 | mixing_ndim=8 54 | tbeta_smoothing=.false. 55 | tq_smoothing=.false. 56 | tqr=.false. 57 | / 58 | &IONS 59 | ion_dynamics='none' 60 | refold_pos=.false. 61 | remove_rigid_rot=.false. 62 | / 63 | &CELL 64 | cell_dynamics='none' 65 | cell_factor=0.0 66 | press=0.0 67 | press_conv_thr=0.5 68 | wmass=3645.777 69 | / 70 | ATOMIC_SPECIES 71 | O1 1.0 O.pz-rrkjus.UPF 72 | Fe1 1.0 Fe.pz-nd-rrkjus.UPF 73 | Fe2 1.0 Fe.pz-nd-rrkjus.UPF 74 | ATOMIC_POSITIONS bohr 75 | O1 0.50000000 0.50000000 0.50000000 76 | O1 1.50000000 1.50000000 1.50000000 77 | Fe1 0.00000000 0.00000000 0.00000000 78 | Fe2 1.00000000 1.00000000 1.00000000 79 | K_POINTS automatic 80 | 2 2 2 0 0 0 81 | CELL_PARAMETERS bohr 82 | 0.50000000 0.50000000 1.00000000 83 | 0.50000000 1.00000000 0.50000000 84 | 1.00000000 0.50000000 0.50000000 85 | HUBBARD atomic 86 | U Fe1-3d 0.000 87 | U Fe2-3d 0.000 -------------------------------------------------------------------------------- /tests/resources/pw/FeO_LDAU_standard_230310.in.test: -------------------------------------------------------------------------------- 1 | &CONTROL 2 | calculation='scf' 3 | disk_io='low' 4 | etot_conv_thr=0.0001 5 | forc_conv_thr=0.001 6 | input_xml_schema_file='FeO_LDAU_standard_230310.xml' 7 | iprint=100000 8 | max_seconds=10000000 9 | outdir='/scratch/pdelugas/espresso-xsd/tempdir/' 10 | prefix='feo_af' 11 | pseudo_dir='/scratch/pdelugas/espresso-xsd/pseudo/' 12 | restart_mode='from_scratch' 13 | title='FeO_LDA+U' 14 | tprnfor=.true. 15 | tstress=.true. 16 | verbosity='low' 17 | wf_collect=.false. 18 | / 19 | &SYSTEM 20 | degauss=0.01 21 | ecutrho=240.0 22 | ecutwfc=30.0 23 | force_symmorphic=.false. 24 | ibrav=0 25 | input_dft='PZ' 26 | lspinorb=.false. 27 | nat=4 28 | nbnd=20 29 | no_t_rev=.false. 30 | noinv=.false. 31 | noncolin=.false. 32 | nosym=.false. 33 | nosym_evc=.false. 34 | nspin=2 35 | ntyp=3 36 | occupations='smearing' 37 | smearing='gaussian' 38 | starting_magnetization(1)=0.0 39 | starting_magnetization(2)=0.5 40 | starting_magnetization(3)=-0.5 41 | tot_charge=0.0 42 | use_all_frac=.false. 43 | / 44 | &ELECTRONS 45 | conv_thr=1e-06 46 | diago_cg_maxiter=20 47 | diago_full_acc=.false. 48 | diago_thr_init=0.0 49 | diagonalization='davidson' 50 | electron_maxstep=100 51 | mixing_beta=0.3 52 | mixing_mode='plain' 53 | mixing_ndim=8 54 | tbeta_smoothing=.false. 55 | tq_smoothing=.false. 56 | tqr=.false. 57 | / 58 | &IONS 59 | ion_dynamics='none' 60 | refold_pos=.false. 61 | remove_rigid_rot=.false. 62 | / 63 | &CELL 64 | cell_dynamics='none' 65 | cell_factor=0.0 66 | press=0.0 67 | press_conv_thr=0.5 68 | wmass=3645.777 69 | / 70 | ATOMIC_SPECIES 71 | O1 1.0 O.pz-rrkjus.UPF 72 | Fe1 1.0 Fe.pz-nd-rrkjus.UPF 73 | Fe2 1.0 Fe.pz-nd-rrkjus.UPF 74 | ATOMIC_POSITIONS bohr 75 | O1 0.50000000 0.50000000 0.50000000 76 | O1 1.50000000 1.50000000 1.50000000 77 | Fe1 0.00000000 0.00000000 0.00000000 78 | Fe2 1.00000000 1.00000000 1.00000000 79 | K_POINTS automatic 80 | 2 2 2 0 0 0 81 | CELL_PARAMETERS bohr 82 | 0.50000000 0.50000000 1.00000000 83 | 0.50000000 1.00000000 0.50000000 84 | 1.00000000 0.50000000 0.50000000 85 | HUBBARD atomic 86 | U Fe1-3d 0.316 87 | U Fe2-3d 0.326 88 | J0 Fe2-3d 0.410 -------------------------------------------------------------------------------- /tests/resources/pw/PbTiO3_BerryPhase.in.test: -------------------------------------------------------------------------------- 1 | &CONTROL 2 | calculation='nscf' 3 | disk_io='low' 4 | etot_conv_thr=0.0001 5 | forc_conv_thr=0.001 6 | gdir=3 7 | input_xml_schema_file='PbTiO3_BerryPhase.xml' 8 | iprint=100000 9 | lberry=.true. 10 | lelfield=.false. 11 | max_seconds=10000000 12 | outdir='/scratch/pdelugas/espresso-xsd/tempdir/' 13 | prefix='pwscf' 14 | pseudo_dir='/scratch/pdelugas/espresso-xsd/pseudo/' 15 | restart_mode='from_scratch' 16 | tefield=.false. 17 | title='PbTiO_3_BerryPhase' 18 | tprnfor=.false. 19 | tstress=.false. 20 | verbosity='low' 21 | wf_collect=.false. 22 | / 23 | &SYSTEM 24 | ecutwfc=30.0 25 | force_symmorphic=.false. 26 | ibrav=0 27 | input_dft='PZ' 28 | lspinorb=.false. 29 | nat=5 30 | nbnd=22 31 | no_t_rev=.false. 32 | noinv=.false. 33 | noncolin=.false. 34 | nosym=.false. 35 | nosym_evc=.false. 36 | nspin=1 37 | ntyp=3 38 | occupations='fixed' 39 | starting_magnetization(1)=0.0 40 | starting_magnetization(2)=0.0 41 | starting_magnetization(3)=0.0 42 | tot_charge=0.0 43 | use_all_frac=.false. 44 | / 45 | &ELECTRONS 46 | conv_thr=1e-05 47 | diago_cg_maxiter=20 48 | diago_full_acc=.false. 49 | diago_thr_init=0.0 50 | diagonalization='davidson' 51 | efield_cart=[0.0, 0.0, 0.0] 52 | electron_maxstep=100 53 | mixing_beta=0.3 54 | mixing_mode='plain' 55 | mixing_ndim=8 56 | tbeta_smoothing=.false. 57 | tq_smoothing=.false. 58 | tqr=.false. 59 | / 60 | &IONS 61 | ion_dynamics='none' 62 | refold_pos=.false. 63 | remove_rigid_rot=.false. 64 | / 65 | &CELL 66 | cell_dynamics='none' 67 | cell_factor=0.0 68 | press=0.0 69 | press_conv_thr=0.5 70 | wmass=276227.0 71 | / 72 | ATOMIC_SPECIES 73 | Pb 207.2 Pb.pz-d-van.UPF 74 | Ti 47.867 Ti.pz-sp-van_ak.UPF 75 | O 15.9994 O.pz-van_ak.UPF 76 | ATOMIC_POSITIONS bohr 77 | Pb 0.00000000 0.00000000 0.00135687 78 | Ti 0.06784353 0.06784353 0.06784353 79 | O 0.00000000 0.06784353 0.06784353 80 | O 0.06784353 0.06784353 0.00000000 81 | O 0.06784353 0.00000000 0.06784353 82 | K_POINTS automatic 83 | 4 4 7 1 1 1 84 | CELL_PARAMETERS bohr 85 | 1.00000000 0.00000000 0.00000000 86 | 0.00000000 1.00000000 0.00000000 87 | 0.00000000 0.00000000 1.00000000 88 | -------------------------------------------------------------------------------- /tests/resources/pw/Fe_non_collinear_penalty.in.test: -------------------------------------------------------------------------------- 1 | &CONTROL 2 | calculation='scf' 3 | disk_io='low' 4 | etot_conv_thr=0.0001 5 | forc_conv_thr=0.001 6 | input_xml_schema_file='Fe_non_collinear_penalty.xml' 7 | iprint=100000 8 | max_seconds=10000000 9 | outdir='/scratch/pdelugas/espresso-xsd/tempdir/' 10 | prefix='fe' 11 | pseudo_dir='/scratch/pdelugas/espresso-xsd/pseudo/' 12 | restart_mode='from_scratch' 13 | title='' 14 | tprnfor=.false. 15 | tstress=.false. 16 | verbosity='low' 17 | wf_collect=.false. 18 | / 19 | &SYSTEM 20 | constrained_magnetization='atomic' 21 | degauss=0.05 22 | ecutrho=200.0 23 | ecutwfc=25.0 24 | fixed_magnetization=[0.0, 0.0, 0.0] 25 | force_symmorphic=.false. 26 | ibrav=0 27 | input_dft='PZ' 28 | lambda=1.0 29 | lspinorb=.false. 30 | nat=1 31 | no_t_rev=.false. 32 | noinv=.false. 33 | noncolin=.false. 34 | nosym=.false. 35 | nosym_evc=.false. 36 | nspin=1 37 | ntyp=1 38 | occupations='smearing' 39 | smearing='mv' 40 | starting_magnetization(1)=0.5 41 | tot_charge=0.0 42 | use_all_frac=.false. 43 | / 44 | &ELECTRONS 45 | conv_thr=1e-08 46 | diago_cg_maxiter=20 47 | diago_full_acc=.false. 48 | diago_thr_init=0.0 49 | diagonalization='davidson' 50 | electron_maxstep=100 51 | mixing_beta=0.2 52 | mixing_mode='plain' 53 | mixing_ndim=8 54 | tbeta_smoothing=.false. 55 | tq_smoothing=.false. 56 | tqr=.false. 57 | / 58 | &IONS 59 | ion_dynamics='none' 60 | refold_pos=.false. 61 | remove_rigid_rot=.false. 62 | / 63 | &CELL 64 | cell_dynamics='none' 65 | cell_factor=0.0 66 | press=0.0 67 | press_conv_thr=0.5 68 | wmass=50901.43 69 | / 70 | ATOMIC_SPECIES 71 | Fe 55.847 Fe.pz-nd-rrkjus.UPF 72 | ATOMIC_POSITIONS bohr 73 | Fe 0.00000000 0.00000000 0.00000000 74 | K_POINTS 75 | 11 76 | 0.0625 0.0625 0.0625 1.0 77 | 0.0625 0.0625 0.1875 3.0 78 | 0.0625 0.0625 0.3125 3.0 79 | 0.0625 0.0625 0.4375 3.0 80 | 0.0625 0.0625 0.5625 3.0 81 | 0.0625 0.0625 0.6875 3.0 82 | 0.0625 0.0625 0.8125 3.0 83 | 0.0625 0.0625 0.9375 3.0 84 | 0.0625 0.1875 0.1875 3.0 85 | 0.0625 0.1875 0.3125 6.0 86 | 0.0625 0.1875 0.4375 6.0 87 | CELL_PARAMETERS bohr 88 | 0.50000000 0.50000000 0.50000000 89 | -0.50000000 0.50000000 0.50000000 90 | -0.50000000 -0.50000000 0.50000000 91 | -------------------------------------------------------------------------------- /tests/resources/pw/FeO_LDAU_standard.in.test: -------------------------------------------------------------------------------- 1 | &CONTROL 2 | calculation='scf' 3 | disk_io='low' 4 | etot_conv_thr=0.0001 5 | forc_conv_thr=0.001 6 | input_xml_schema_file='FeO_LDAU_standard.xml' 7 | iprint=100000 8 | max_seconds=10000000 9 | outdir='/scratch/pdelugas/espresso-xsd/tempdir/' 10 | prefix='feo_af' 11 | pseudo_dir='/scratch/pdelugas/espresso-xsd/pseudo/' 12 | restart_mode='from_scratch' 13 | title='FeO_LDA+U' 14 | tprnfor=.true. 15 | tstress=.true. 16 | verbosity='low' 17 | wf_collect=.false. 18 | / 19 | &SYSTEM 20 | degauss=0.01 21 | ecutrho=240.0 22 | ecutwfc=30.0 23 | force_symmorphic=.false. 24 | Hubbard_U(2)=0.3160442 25 | Hubbard_U(3)=0.3160442 26 | ibrav=0 27 | input_dft='PZ' 28 | lda_plus_u = .true. 29 | lda_plus_u_kind = 0 30 | lspinorb=.false. 31 | nat=4 32 | nbnd=20 33 | no_t_rev=.false. 34 | noinv=.false. 35 | noncolin=.false. 36 | nosym=.false. 37 | nosym_evc=.false. 38 | nspin=2 39 | ntyp=3 40 | occupations='smearing' 41 | smearing='gaussian' 42 | starting_magnetization(1)=0.0 43 | starting_magnetization(2)=0.5 44 | starting_magnetization(3)=-0.5 45 | tot_charge=0.0 46 | U_projection_type = 'atomic' 47 | use_all_frac=.false. 48 | / 49 | &ELECTRONS 50 | conv_thr=1e-06 51 | diago_cg_maxiter=20 52 | diago_full_acc=.false. 53 | diago_thr_init=0.0 54 | diagonalization='davidson' 55 | electron_maxstep=100 56 | mixing_beta=0.3 57 | mixing_mode='plain' 58 | mixing_ndim=8 59 | tbeta_smoothing=.false. 60 | tq_smoothing=.false. 61 | tqr=.false. 62 | / 63 | &IONS 64 | ion_dynamics='none' 65 | refold_pos=.false. 66 | remove_rigid_rot=.false. 67 | / 68 | &CELL 69 | cell_dynamics='none' 70 | cell_factor=0.0 71 | press=0.0 72 | press_conv_thr=0.5 73 | wmass=3645.777 74 | / 75 | ATOMIC_SPECIES 76 | O1 1.0 O.pz-rrkjus.UPF 77 | Fe1 1.0 Fe.pz-nd-rrkjus.UPF 78 | Fe2 1.0 Fe.pz-nd-rrkjus.UPF 79 | ATOMIC_POSITIONS bohr 80 | O1 0.50000000 0.50000000 0.50000000 81 | O1 1.50000000 1.50000000 1.50000000 82 | Fe1 0.00000000 0.00000000 0.00000000 83 | Fe2 1.00000000 1.00000000 1.00000000 84 | K_POINTS automatic 85 | 2 2 2 0 0 0 86 | CELL_PARAMETERS bohr 87 | 0.50000000 0.50000000 1.00000000 88 | 0.50000000 1.00000000 0.50000000 89 | 1.00000000 0.50000000 0.50000000 90 | -------------------------------------------------------------------------------- /tests/resources/pw/PbTiO3_bc3_fcp_opt.in.test: -------------------------------------------------------------------------------- 1 | &CONTROL 2 | calculation='scf' 3 | disk_io='low' 4 | etot_conv_thr=0.0001 5 | forc_conv_thr=0.001 6 | input_xml_schema_file='PbTiO3_bc3_fcp_opt.xml' 7 | iprint=100000 8 | lfcp=.true. 9 | max_seconds=10000000 10 | outdir='/scratch/pdelugas/espresso-xsd/tempdir/' 11 | prefix='pwscf' 12 | pseudo_dir='/scratch/pdelugas/espresso-xsd/pseudo/' 13 | restart_mode='from_scratch' 14 | title='PBTiO3_scf' 15 | tprnfor=.false. 16 | tstress=.false. 17 | verbosity='low' 18 | wf_collect=.false. 19 | / 20 | &SYSTEM 21 | assume_isolated='esm' 22 | ecutwfc=30.0 23 | esm_bc='bc3' 24 | esm_efield=0.1 25 | esm_nfit=5 26 | esm_w=1.2 27 | force_symmorphic=.false. 28 | ibrav=0 29 | input_dft='PZ' 30 | lspinorb=.false. 31 | nat=5 32 | nbnd=25 33 | no_t_rev=.false. 34 | noinv=.false. 35 | noncolin=.false. 36 | nosym=.false. 37 | nosym_evc=.false. 38 | nspin=1 39 | ntyp=3 40 | occupations='fixed' 41 | starting_magnetization(1)=0.0 42 | starting_magnetization(2)=0.0 43 | starting_magnetization(3)=0.0 44 | tot_charge=0.0 45 | use_all_frac=.false. 46 | / 47 | &ELECTRONS 48 | conv_thr=1e-12 49 | diago_cg_maxiter=20 50 | diago_full_acc=.false. 51 | diago_thr_init=0.0 52 | diagonalization='davidson' 53 | electron_maxstep=100 54 | mixing_beta=0.3 55 | mixing_mode='plain' 56 | mixing_ndim=8 57 | tbeta_smoothing=.false. 58 | tq_smoothing=.false. 59 | tqr=.false. 60 | / 61 | &IONS 62 | ion_dynamics='none' 63 | refold_pos=.false. 64 | remove_rigid_rot=.false. 65 | / 66 | &CELL 67 | cell_dynamics='none' 68 | cell_factor=0.0 69 | press=0.0 70 | press_conv_thr=0.5 71 | wmass=276227.0 72 | / 73 | &FCP 74 | fcp_mu=-0.036749 75 | / 76 | ATOMIC_SPECIES 77 | Pb 207.2 Pb.pz-d-van.UPF 78 | Ti 47.867 Ti.pz-sp-van_ak.UPF 79 | O 15.9994 O.pz-van_ak.UPF 80 | ATOMIC_POSITIONS bohr 81 | Pb 0.00000000 0.00000000 0.00135687 82 | Ti 0.06784353 0.06784353 0.06784353 83 | O 0.00000000 0.06784353 0.06784353 84 | O 0.06784353 0.06784353 0.00000000 85 | O 0.06784353 0.00000000 0.06784353 86 | K_POINTS automatic 87 | 4 4 4 1 1 1 88 | CELL_PARAMETERS bohr 89 | 1.00000000 0.00000000 0.00000000 90 | 0.00000000 1.00000000 0.00000000 91 | 0.00000000 0.00000000 1.00000000 92 | -------------------------------------------------------------------------------- /tests/resources/pw/FeO_LDAU_with_no_U.in.test: -------------------------------------------------------------------------------- 1 | &CONTROL 2 | calculation='scf' 3 | disk_io='low' 4 | etot_conv_thr=0.0001 5 | forc_conv_thr=0.001 6 | input_xml_schema_file='FeO_LDAU_with_no_U.xml' 7 | iprint=100000 8 | max_seconds=10000000 9 | outdir='/scratch/pdelugas/espresso-xsd/tempdir/' 10 | prefix='feo_af' 11 | pseudo_dir='/scratch/pdelugas/espresso-xsd/pseudo/' 12 | restart_mode='from_scratch' 13 | title='FeO_LDA+U=0' 14 | tprnfor=.true. 15 | tstress=.true. 16 | verbosity='low' 17 | wf_collect=.false. 18 | / 19 | &SYSTEM 20 | degauss=0.01 21 | ecutrho=240.0 22 | ecutwfc=30.0 23 | force_symmorphic=.false. 24 | Hubbard_U(2)=7.349865e-10 25 | Hubbard_U(3)=7.349865e-10 26 | ibrav=0 27 | input_dft='PZ' 28 | lda_plus_u = .true. 29 | lda_plus_u_kind = 0 30 | lspinorb=.false. 31 | nat=4 32 | nbnd=20 33 | no_t_rev=.false. 34 | noinv=.false. 35 | noncolin=.false. 36 | nosym=.false. 37 | nosym_evc=.false. 38 | nspin=2 39 | ntyp=3 40 | occupations='smearing' 41 | smearing='gaussian' 42 | starting_magnetization(1)=0.0 43 | starting_magnetization(2)=0.5 44 | starting_magnetization(3)=-0.5 45 | tot_charge=0.0 46 | U_projection_type = 'atomic' 47 | use_all_frac=.false. 48 | / 49 | &ELECTRONS 50 | conv_thr=1e-06 51 | diago_cg_maxiter=20 52 | diago_full_acc=.false. 53 | diago_thr_init=0.0 54 | diagonalization='davidson' 55 | electron_maxstep=100 56 | mixing_beta=0.3 57 | mixing_mode='plain' 58 | mixing_ndim=8 59 | tbeta_smoothing=.false. 60 | tq_smoothing=.false. 61 | tqr=.false. 62 | / 63 | &IONS 64 | ion_dynamics='none' 65 | refold_pos=.false. 66 | remove_rigid_rot=.false. 67 | / 68 | &CELL 69 | cell_dynamics='none' 70 | cell_factor=0.0 71 | press=0.0 72 | press_conv_thr=0.5 73 | wmass=3645.777 74 | / 75 | ATOMIC_SPECIES 76 | O1 1.0 O.pz-rrkjus.UPF 77 | Fe1 1.0 Fe.pz-nd-rrkjus.UPF 78 | Fe2 1.0 Fe.pz-nd-rrkjus.UPF 79 | ATOMIC_POSITIONS bohr 80 | O1 0.50000000 0.50000000 0.50000000 81 | O1 1.50000000 1.50000000 1.50000000 82 | Fe1 0.00000000 0.00000000 0.00000000 83 | Fe2 1.00000000 1.00000000 1.00000000 84 | K_POINTS automatic 85 | 2 2 2 0 0 0 86 | CELL_PARAMETERS bohr 87 | 0.50000000 0.50000000 1.00000000 88 | 0.50000000 1.00000000 0.50000000 89 | 1.00000000 0.50000000 0.50000000 90 | -------------------------------------------------------------------------------- /tests/resources/pw/Al001_relax_bfgs.in.test: -------------------------------------------------------------------------------- 1 | &CONTROL 2 | calculation='relax' 3 | disk_io='low' 4 | etot_conv_thr=0.0001 5 | forc_conv_thr=0.001 6 | input_xml_schema_file='Al001_relax_bfgs.xml' 7 | iprint=100000 8 | max_seconds=10000000 9 | outdir='/scratch/pdelugas/espresso-xsd/tempdir' 10 | prefix='Al' 11 | pseudo_dir='/scratch/pdelugas/espresso-xsd/pseudo' 12 | restart_mode='from_scratch' 13 | title='' 14 | tprnfor=.false. 15 | tstress=.false. 16 | verbosity='high' 17 | wf_collect=.false. 18 | / 19 | &SYSTEM 20 | degauss=0.05 21 | ecutwfc=12.0 22 | force_symmorphic=.false. 23 | ibrav=0 24 | input_dft='PZ' 25 | lspinorb=.false. 26 | nat=7 27 | no_t_rev=.false. 28 | noinv=.false. 29 | noncolin=.false. 30 | nosym=.false. 31 | nosym_evc=.false. 32 | nspin=1 33 | ntyp=1 34 | occupations='smearing' 35 | smearing='gaussian' 36 | starting_magnetization(1)=0.0 37 | tot_charge=0.0 38 | use_all_frac=.false. 39 | / 40 | &ELECTRONS 41 | conv_thr=1e-06 42 | diago_cg_maxiter=20 43 | diago_full_acc=.false. 44 | diago_thr_init=0.0 45 | diagonalization='davidson' 46 | electron_maxstep=100 47 | mixing_beta=0.3 48 | mixing_mode='plain' 49 | mixing_ndim=8 50 | tbeta_smoothing=.false. 51 | tq_smoothing=.false. 52 | tqr=.false. 53 | / 54 | &IONS 55 | bfgs_ndim=3 56 | ion_dynamics='bfgs' 57 | refold_pos=.false. 58 | remove_rigid_rot=.false. 59 | trust_radius_ini=0.5 60 | trust_radius_max=0.8 61 | trust_radius_min=0.0001 62 | upscale=100.0 63 | w_1=0.01 64 | w_2=0.5 65 | / 66 | &CELL 67 | cell_dynamics='none' 68 | cell_factor=0.0 69 | press=0.0 70 | press_conv_thr=0.5 71 | wmass=6380.11 72 | / 73 | ATOMIC_SPECIES 74 | Al 1.0 Al.pz-vbc.UPF 75 | ATOMIC_POSITIONS bohr 76 | Al 0.09428092 0.09428092 -0.40000000 77 | Al 0.00000000 0.00000000 -0.26666660 78 | Al 0.09428092 0.09428092 -0.13333340 79 | Al 0.00000000 0.00000000 0.00000000 80 | Al 0.09428092 0.09428092 0.13333340 81 | Al 0.00000000 0.00000000 0.26666660 82 | Al 0.09428092 0.09428092 0.40000000 83 | K_POINTS 84 | 3 85 | 0.125 0.125 0.0 1.0 86 | 0.125 0.375 0.0 2.0 87 | 0.375 0.375 0.0 1.0 88 | CELL_PARAMETERS bohr 89 | 1.00000000 0.00000000 0.00000000 90 | 0.00000000 1.00000000 0.00000000 91 | 0.00000000 0.00000000 8.00000000 92 | -------------------------------------------------------------------------------- /tests/resources/pw/FeO_LDAU_with_starting_ns.in.test: -------------------------------------------------------------------------------- 1 | &CONTROL 2 | calculation='scf' 3 | disk_io='low' 4 | etot_conv_thr=0.0001 5 | forc_conv_thr=0.001 6 | input_xml_schema_file='FeO_LDAU_with_starting_ns.xml' 7 | iprint=100000 8 | max_seconds=10000000 9 | outdir='./' 10 | prefix='pwscf' 11 | pseudo_dir='/u/cm/pdelugas/espresso/pseudo/' 12 | restart_mode='from_scratch' 13 | title='uffa' 14 | tprnfor=.false. 15 | tstress=.false. 16 | verbosity='low' 17 | wf_collect=.false. 18 | / 19 | &SYSTEM 20 | degauss=0.01 21 | ecutrho=240.0 22 | ecutwfc=30.0 23 | force_symmorphic=.false. 24 | Hubbard_U(2)=0.3160442 25 | Hubbard_U(3)=0.3160442 26 | ibrav=0 27 | input_dft='PZ' 28 | lda_plus_u = .true. 29 | lda_plus_u_kind = 0 30 | lspinorb=.false. 31 | nat=4 32 | nbnd=20 33 | no_t_rev=.false. 34 | noinv=.false. 35 | noncolin=.false. 36 | nosym=.false. 37 | nosym_evc=.false. 38 | nspin=2 39 | ntyp=3 40 | occupations='smearing' 41 | smearing='gaussian' 42 | starting_magnetization(1)=0.0 43 | starting_magnetization(2)=0.5 44 | starting_magnetization(3)=-0.5 45 | starting_ns_eigenvalue(3,1,3)=1.0 46 | starting_ns_eigenvalue(3,2,2)=1.0 47 | tot_charge=0.0 48 | U_projection_type = 'atomic' 49 | use_all_frac=.false. 50 | / 51 | &ELECTRONS 52 | conv_thr=1e-08 53 | diago_cg_maxiter=20 54 | diago_full_acc=.false. 55 | diago_thr_init=0.0 56 | diagonalization='davidson' 57 | electron_maxstep=100 58 | mixing_beta=0.3 59 | mixing_mode='plain' 60 | mixing_ndim=8 61 | tbeta_smoothing=.false. 62 | tq_smoothing=.false. 63 | tqr=.false. 64 | / 65 | &IONS 66 | ion_dynamics='none' 67 | refold_pos=.false. 68 | remove_rigid_rot=.false. 69 | / 70 | &CELL 71 | cell_dynamics='none' 72 | cell_factor=0.0 73 | press=0.0 74 | press_conv_thr=0.5 75 | wmass=3645.777 76 | / 77 | ATOMIC_SPECIES 78 | O1 1.0 O.pz-rrkjus.UPF 79 | Fe1 1.0 Fe.pz-nd-rrkjus.UPF 80 | Fe2 1.0 Fe.pz-nd-rrkjus.UPF 81 | ATOMIC_POSITIONS bohr 82 | O1 4.09500000 4.09500000 4.09500000 83 | O1 12.28500000 12.28500000 12.28500000 84 | Fe1 0.00000000 0.00000000 0.00000000 85 | Fe2 8.19000000 8.19000000 8.19000000 86 | K_POINTS automatic 87 | 2 2 2 0 0 0 88 | CELL_PARAMETERS bohr 89 | 4.09500000 4.09500000 8.19000000 90 | 4.09500000 8.19000000 4.09500000 91 | 8.19000000 4.09500000 4.09500000 92 | -------------------------------------------------------------------------------- /tests/resources/pw/Si_md.in.test: -------------------------------------------------------------------------------- 1 | &CONTROL 2 | calculation='md' 3 | disk_io='high' 4 | dt=20.0 5 | etot_conv_thr=0.0001 6 | forc_conv_thr=0.001 7 | input_xml_schema_file='Si_md.xml' 8 | iprint=100000 9 | max_seconds=10000000 10 | outdir='/scratch/pdelugas/espresso-xsd/tempdir/' 11 | prefix='pwscf' 12 | pseudo_dir='/scratch/pdelugas/espresso-xsd/pseudo/' 13 | restart_mode='from_scratch' 14 | title='Si_molecular_dynamics' 15 | tprnfor=.false. 16 | tstress=.false. 17 | verbosity='low' 18 | wf_collect=.false. 19 | / 20 | &SYSTEM 21 | ecutwfc=8.0 22 | force_symmorphic=.false. 23 | ibrav=0 24 | input_dft='PZ' 25 | lspinorb=.false. 26 | nat=8 27 | no_t_rev=.true. 28 | noinv=.true. 29 | noncolin=.false. 30 | nosym=.true. 31 | nosym_evc=.true. 32 | nspin=1 33 | ntyp=1 34 | occupations='fixed' 35 | starting_magnetization(1)=0.0 36 | tot_charge=0.0 37 | use_all_frac=.false. 38 | / 39 | &ELECTRONS 40 | conv_thr=1e-08 41 | diago_cg_maxiter=20 42 | diago_full_acc=.false. 43 | diago_thr_init=0.0 44 | diagonalization='davidson' 45 | electron_maxstep=100 46 | mixing_beta=0.7 47 | mixing_mode='plain' 48 | mixing_ndim=8 49 | tbeta_smoothing=.false. 50 | tq_smoothing=.false. 51 | tqr=.false. 52 | / 53 | &IONS 54 | delta_t=1.0 55 | ion_dynamics='verlet' 56 | ion_temperature='not_controlled' 57 | nraise=1 58 | pot_extrapolation='second-order' 59 | refold_pos=.false. 60 | remove_rigid_rot=.false. 61 | tempw=300.0 62 | tolp=100.0 63 | wfc_extrapolation='second-order' 64 | / 65 | &CELL 66 | cell_dynamics='none' 67 | cell_factor=0.0 68 | press=0.0 69 | press_conv_thr=0.5 70 | wmass=204790.6 71 | / 72 | ATOMIC_SPECIES 73 | Si 28.086 Si.pz-vbc.UPF 74 | ATOMIC_POSITIONS bohr 75 | Si -0.01208251 -0.01208251 -0.01208251 1 0 1 76 | Si 0.03703340 0.03703340 -0.01208251 1 0 1 77 | Si 0.03703340 -0.01208251 0.03703340 78 | Si -0.01208251 0.03703340 0.03703340 1 0 1 79 | Si 0.01208251 0.01208251 0.01208251 1 0 1 80 | Si 0.06119843 0.06119843 0.01208251 1 0 1 81 | Si 0.06119843 0.01208251 0.06119843 1 0 1 82 | Si 0.01208251 0.06119843 0.06119843 1 0 1 83 | K_POINTS automatic 84 | 1 1 1 0 0 0 85 | CELL_PARAMETERS bohr 86 | 1.00000000 0.00000000 0.00000000 87 | 0.00000000 1.00000000 0.00000000 88 | 0.00000000 0.00000000 1.00000000 -------------------------------------------------------------------------------- /tests/resources/neb/H2+H_crystal.in.test: -------------------------------------------------------------------------------- 1 | BEGIN 2 | BEGIN_PATH_INPUT 3 | &PATH 4 | CI_scheme='auto' 5 | ds=2.0 6 | first_last_opt=.false. 7 | k_max=0.3 8 | k_min=0.2 9 | minimum_image=.false. 10 | nstep_path=20 11 | num_of_images=7 12 | opt_scheme='broyden' 13 | path_thr=0.1 14 | string_method='neb' 15 | use_freezing=.false. 16 | use_masses=.false. 17 | / 18 | END_PATH_INPUT 19 | BEGIN_ENGINE_INPUT 20 | &CONTROL 21 | calculation='scf' 22 | disk_io='low' 23 | etot_conv_thr=0.0001 24 | forc_conv_thr=0.001 25 | iprint=100000 26 | max_seconds=10000000 27 | outdir='/scratch/pdelugas/espresso/tempdir' 28 | prefix='H2+H' 29 | pseudo_dir='/scratch/pdelugas/espresso/pseudo' 30 | restart_mode='from_scratch' 31 | tprnfor=.false. 32 | tstress=.false. 33 | verbosity='low' 34 | wf_collect=.false. 35 | / 36 | &SYSTEM 37 | degauss=0.03 38 | ecutrho=50.0 39 | ecutwfc=10.0 40 | force_symmorphic=.false. 41 | ibrav=0 42 | input_dft='PBE' 43 | lspinorb=.false. 44 | nat = 3 45 | no_t_rev=.false. 46 | noinv=.false. 47 | noncolin=.false. 48 | nosym=.false. 49 | nosym_evc=.false. 50 | nspin=2 51 | ntyp=1 52 | occupations='smearing' 53 | smearing='gaussian' 54 | starting_magnetization(1)=0.0 55 | tot_charge=0.0 56 | use_all_frac=.false. 57 | / 58 | &ELECTRONS 59 | conv_thr=1e-08 60 | diago_cg_maxiter=100 61 | diago_full_acc=.false. 62 | diago_thr_init=0.0 63 | diagonalization='davidson' 64 | electron_maxstep=100 65 | mixing_beta=0.3 66 | mixing_mode='plain' 67 | mixing_ndim=8 68 | tbeta_smoothing=.false. 69 | tq_smoothing=.false. 70 | tqr=.false. 71 | / 72 | &IONS 73 | ion_dynamics='bfgs' 74 | / 75 | &CELL 76 | press_conv_thr=0.5 77 | / 78 | 79 | ATOMIC_SPECIES 80 | H 1.00794 HUSPBE.RRKJ3 81 | BEGIN_POSITIONS 82 | FIRST_IMAGE 83 | ATOMIC_POSITIONS { crystal } 84 | H -0.38055834 0.00000000 0.00000000 0 1 0 85 | H 0.00000000 0.00000000 0.00000000 86 | H 0.12981390 0.00000000 0.00000000 1 0 1 87 | LAST_IMAGE 88 | ATOMIC_POSITIONS { crystal } 89 | H -0.12981390 0.00000000 0.00000000 0 1 0 90 | H 0.00000000 0.00000000 0.00000000 91 | H 0.38055834 0.00000000 0.00000000 1 0 1 92 | END_POSITIONS 93 | K_POINTS gamma 94 | CELL_PARAMETERS bohr 95 | 12.00000000 0.00000000 0.00000000 96 | 0.00000000 12.00000000 0.00000000 97 | 0.00000000 0.00000000 12.00000000 98 | END_ENGINE_INPUT 99 | END -------------------------------------------------------------------------------- /tests/resources/pw/Al_bands.in.test: -------------------------------------------------------------------------------- 1 | &CONTROL 2 | calculation='bands' 3 | disk_io='low' 4 | etot_conv_thr=0.0001 5 | forc_conv_thr=0.001 6 | input_xml_schema_file='Al_bands.xml' 7 | iprint=100000 8 | max_seconds=10000000 9 | outdir='/scratch/pdelugas/espresso-xsd/tempdir/' 10 | prefix='al' 11 | pseudo_dir='/scratch/pdelugas/espresso-xsd/pseudo/' 12 | restart_mode='from_scratch' 13 | title='' 14 | tprnfor=.false. 15 | tstress=.false. 16 | verbosity='low' 17 | wf_collect=.false. 18 | / 19 | &SYSTEM 20 | ecutwfc=15.0 21 | force_symmorphic=.false. 22 | ibrav=0 23 | input_dft='PZ' 24 | lspinorb=.false. 25 | nat=1 26 | nbnd=8 27 | no_t_rev=.false. 28 | noinv=.false. 29 | noncolin=.false. 30 | nosym=.false. 31 | nosym_evc=.false. 32 | nspin=1 33 | ntyp=1 34 | occupations='fixed' 35 | starting_magnetization(1)=0.0 36 | use_all_frac=.false. 37 | / 38 | &ELECTRONS 39 | conv_thr=1e-06 40 | diago_cg_maxiter=20 41 | diago_full_acc=.false. 42 | diago_thr_init=0.0 43 | diagonalization='davidson' 44 | electron_maxstep=100 45 | mixing_beta=0.7 46 | mixing_mode='plain' 47 | mixing_ndim=8 48 | tbeta_smoothing=.false. 49 | tq_smoothing=.false. 50 | tqr=.false. 51 | / 52 | &IONS 53 | ion_dynamics='none' 54 | refold_pos=.false. 55 | remove_rigid_rot=.false. 56 | / 57 | &CELL 58 | cell_dynamics='none' 59 | cell_factor=0.0 60 | press=0.0 61 | press_conv_thr=0.5 62 | wmass=24590.77 63 | / 64 | ATOMIC_SPECIES 65 | Al 26.98 Al.pz-vbc.UPF 66 | ATOMIC_POSITIONS bohr 67 | Al 0.00000000 0.00000000 0.00000000 68 | K_POINTS 69 | 28 70 | 0.0 0.0 0.0 1.0 71 | 0.0 0.0 0.1 1.0 72 | 0.0 0.0 0.2 1.0 73 | 0.0 0.0 0.3 1.0 74 | 0.0 0.0 0.4 1.0 75 | 0.0 0.0 0.5 1.0 76 | 0.0 0.0 0.6 1.0 77 | 0.0 0.0 0.7 1.0 78 | 0.0 0.0 0.8 1.0 79 | 0.0 0.0 0.9 1.0 80 | 0.0 0.0 1.0 1.0 81 | 0.0 0.0 0.0 1.0 82 | 0.0 0.1 0.1 1.0 83 | 0.0 0.2 0.2 1.0 84 | 0.0 0.3 0.3 1.0 85 | 0.0 0.4 0.4 1.0 86 | 0.0 0.5 0.5 1.0 87 | 0.0 0.6 0.6 1.0 88 | 0.0 0.7 0.7 1.0 89 | 0.0 0.8 0.8 1.0 90 | 0.0 0.9 0.9 1.0 91 | 0.0 1.0 1.0 1.0 92 | 0.0 0.0 0.0 1.0 93 | 0.1 0.1 0.1 1.0 94 | 0.2 0.2 0.2 1.0 95 | 0.3 0.3 0.3 1.0 96 | 0.4 0.4 0.4 1.0 97 | 0.5 0.5 0.5 1.0 98 | CELL_PARAMETERS bohr 99 | -0.50000000 0.00000000 0.50000000 100 | 0.00000000 0.50000000 0.50000000 101 | -0.50000000 0.50000000 0.00000000 102 | -------------------------------------------------------------------------------- /tests/resources/neb/H2+H.in.test: -------------------------------------------------------------------------------- 1 | BEGIN 2 | BEGIN_PATH_INPUT 3 | &PATH 4 | CI_scheme='auto' 5 | ds=2.0 6 | first_last_opt=.false. 7 | k_max=0.3 8 | k_min=0.2 9 | minimum_image=.false. 10 | nstep_path=20 11 | num_of_images=7 12 | opt_scheme='broyden' 13 | path_thr=0.1 14 | string_method='neb' 15 | use_freezing=.false. 16 | use_masses=.false. 17 | / 18 | END_PATH_INPUT 19 | BEGIN_ENGINE_INPUT 20 | &CONTROL 21 | calculation='scf' 22 | disk_io='low' 23 | etot_conv_thr=0.0001 24 | forc_conv_thr=0.001 25 | iprint=100000 26 | max_seconds=10000000 27 | outdir='/scratch/pdelugas/espresso/tempdir' 28 | prefix='H2+H' 29 | pseudo_dir='/scratch/pdelugas/espresso/pseudo' 30 | restart_mode='from_scratch' 31 | tprnfor=.false. 32 | tstress=.false. 33 | verbosity='low' 34 | wf_collect=.false. 35 | / 36 | &SYSTEM 37 | degauss=0.03 38 | ecutrho=50.0 39 | ecutwfc=10.0 40 | force_symmorphic=.false. 41 | ibrav=0 42 | input_dft='PBE' 43 | lspinorb=.false. 44 | nat = 3 45 | no_t_rev=.false. 46 | noinv=.false. 47 | noncolin=.false. 48 | nosym=.false. 49 | nosym_evc=.false. 50 | nspin=2 51 | ntyp=1 52 | occupations='smearing' 53 | smearing='gaussian' 54 | starting_magnetization(1)=0.0 55 | tot_charge=0.0 56 | use_all_frac=.false. 57 | / 58 | &ELECTRONS 59 | conv_thr=1e-08 60 | diago_cg_maxiter=100 61 | diago_full_acc=.false. 62 | diago_thr_init=0.0 63 | diagonalization='davidson' 64 | electron_maxstep=100 65 | mixing_beta=0.3 66 | mixing_mode='plain' 67 | mixing_ndim=8 68 | tbeta_smoothing=.false. 69 | tq_smoothing=.false. 70 | tqr=.false. 71 | / 72 | &IONS 73 | ion_dynamics='bfgs' 74 | / 75 | &CELL 76 | press_conv_thr=0.5 77 | / 78 | 79 | ATOMIC_SPECIES 80 | H 1.00794 HUSPBE.RRKJ3 81 | BEGIN_POSITIONS 82 | FIRST_IMAGE 83 | ATOMIC_POSITIONS { bohr } 84 | H -4.56670009 0.00000000 0.00000000 85 | H 0.00000000 0.00000000 0.00000000 86 | H 1.55776676 0.00000000 0.00000000 87 | LAST_IMAGE 88 | ATOMIC_POSITIONS { bohr } 89 | H -1.55776676 0.00000000 0.00000000 90 | H 0.00000000 0.00000000 0.00000000 91 | H 4.56670009 0.00000000 0.00000000 92 | END_POSITIONS 93 | K_POINTS gamma 94 | CELL_PARAMETERS bohr 95 | 12.00000000 0.00000000 0.00000000 96 | 0.00000000 12.00000000 0.00000000 97 | 0.00000000 0.00000000 12.00000000 98 | END_ENGINE_INPUT 99 | END 100 | -------------------------------------------------------------------------------- /tests/resources/neb/Al001+H_pbc.in.test: -------------------------------------------------------------------------------- 1 | BEGIN 2 | BEGIN_PATH_INPUT 3 | &PATH 4 | CI_scheme='no-CI' 5 | ds=1.0 6 | first_last_opt=.false. 7 | k_max=0.1 8 | k_min=0.1 9 | minimum_image=.false. 10 | nstep_path=50 11 | opt_scheme='broyden' 12 | path_thr=0.05 13 | string_method='neb' 14 | use_freezing=.false. 15 | use_masses=.false. 16 | / 17 | END_PATH_INPUT 18 | BEGIN_ENGINE_INPUT 19 | &CONTROL 20 | calculation='scf' 21 | disk_io='low' 22 | etot_conv_thr=1e-06 23 | forc_conv_thr=1e-05 24 | iprint=100 25 | max_seconds=10000000 26 | nstep=250 27 | outdir='/scratch/pdelugas/espresso/tempdir/' 28 | prefix='Al001+H_pbc' 29 | pseudo_dir='/scratch/pdelugas/espresso/pseudo/' 30 | restart_mode='from_scratch' 31 | title='Al001+H_pbc' 32 | tprnfor=.true. 33 | tstress=.false. 34 | verbosity='low' 35 | wf_collect=.false. 36 | / 37 | &SYSTEM 38 | degauss=0.02 39 | ecutwfc=20.0 40 | ibrav=0 41 | input_dft='PBE' 42 | lspinorb=.false. 43 | nat = 5 44 | noncolin=.false. 45 | nspin=1 46 | occupations='smearing' 47 | smearing='mv' 48 | starting_magnetization(1)=0.0 49 | starting_magnetization(2)=0.0 50 | tot_charge=0.0 51 | / 52 | &ELECTRONS 53 | conv_thr=1e-06 54 | diago_full_acc=.false. 55 | diago_thr_init=0.001 56 | diagonalization='davidson' 57 | electron_maxstep=100 58 | mixing_beta=0.3 59 | mixing_mode='plain' 60 | mixing_ndim=8 61 | tbeta_smoothing=.true. 62 | tq_smoothing=.true. 63 | tqr=.false. 64 | / 65 | &IONS 66 | ion_dynamics='bfgs' 67 | / 68 | &CELL 69 | press_conv_thr=0.001 70 | / 71 | 72 | ATOMIC_SPECIES 73 | Al 26.981538 Al.pbe-n-van.UPF 74 | H 1.00794 H.pbe-van_ak.UPF 75 | BEGIN_POSITIONS 76 | FIRST_IMAGE 77 | ATOMIC_POSITIONS { bohr } 78 | Al 0.00000000 0.00000000 0.00000000 0 0 0 79 | Al 5.41111110 0.00000000 0.00000000 0 0 0 80 | Al 0.00000000 5.41113843 0.00000000 0 0 0 81 | Al 5.41113843 5.41113843 0.00000000 0 0 0 82 | H 0.00000000 0.00000000 3.11055670 0 0 1 83 | LAST_IMAGE 84 | ATOMIC_POSITIONS { bohr } 85 | Al 0.00000000 0.00000000 0.00000000 0 0 0 86 | Al 5.41111110 0.00000000 0.00000000 0 0 0 87 | Al 0.00000000 5.41113843 0.00000000 0 0 0 88 | Al 5.41113843 5.41113843 0.00000000 0 0 0 89 | H 5.41113843 5.41113843 3.11055670 0 0 1 90 | END_POSITIONS 91 | K_POINTS automatic 92 | 6 6 1 1 1 1 93 | CELL_PARAMETERS bohr 94 | 10.82227686 0.00000000 0.00000000 95 | 0.00000000 10.82227686 0.00000000 96 | 0.00000000 0.00000000 22.67672253 97 | END_ENGINE_INPUT 98 | END -------------------------------------------------------------------------------- /tests/resources/neb/Al001_plus_H_bc3.in.test: -------------------------------------------------------------------------------- 1 | BEGIN 2 | BEGIN_PATH_INPUT 3 | &PATH 4 | CI_scheme='no-CI' 5 | ds=1.0 6 | first_last_opt=.false. 7 | k_max=0.1 8 | k_min=0.1 9 | lfcp=.true. 10 | minimum_image=.false. 11 | nstep_path=50 12 | opt_scheme='broyden' 13 | path_thr=0.05 14 | string_method='neb' 15 | use_freezing=.false. 16 | use_masses=.false. 17 | / 18 | END_PATH_INPUT 19 | BEGIN_ENGINE_INPUT 20 | &CONTROL 21 | calculation='scf' 22 | disk_io='low' 23 | etot_conv_thr=1e-06 24 | forc_conv_thr=1e-05 25 | iprint=100 26 | max_seconds=10000000 27 | outdir='/scratch/pdelugas/espresso/tempdir/' 28 | prefix='Al00+H_bc3' 29 | pseudo_dir='/scratch/pdelugas/espresso/pseudo/' 30 | restart_mode='from_scratch' 31 | title='Al001+H_bc3' 32 | tprnfor=.true. 33 | tstress=.false. 34 | verbosity='low' 35 | wf_collect=.false. 36 | / 37 | &SYSTEM 38 | degauss=0.02 39 | ecutwfc=20.0 40 | ibrav=0 41 | input_dft='PBE' 42 | lspinorb=.false. 43 | nat = 5 44 | noncolin=.false. 45 | nspin=1 46 | occupations='smearing' 47 | smearing='mv' 48 | starting_magnetization(1)=0.0 49 | starting_magnetization(2)=0.0 50 | tot_charge=0.0 51 | / 52 | &ELECTRONS 53 | conv_thr=1e-06 54 | diago_full_acc=.false. 55 | diago_thr_init=0.001 56 | diagonalization='davidson' 57 | electron_maxstep=100 58 | mixing_beta=0.3 59 | mixing_mode='plain' 60 | mixing_ndim=8 61 | tbeta_smoothing=.false. 62 | tq_smoothing=.false. 63 | tqr=.false. 64 | / 65 | &IONS 66 | ion_dynamics='bfgs' 67 | / 68 | &CELL 69 | press_conv_thr=0.001 70 | / 71 | 72 | ATOMIC_SPECIES 73 | Al 26.981538 Al.pbe-n-van.UPF 74 | H 1.00794 H.pbe-van_ak.UPF 75 | BEGIN_POSITIONS 76 | FIRST_IMAGE 77 | ATOMIC_POSITIONS { bohr } 78 | Al 0.00000000 0.00000000 0.00000000 0 0 0 79 | Al 5.41111110 0.00000000 0.00000000 0 0 0 80 | Al 5.41113843 5.41113843 0.00000000 0 0 0 81 | Al 5.41113843 5.41113843 0.00000000 0 0 0 82 | H 0.00000000 0.00000000 3.11055670 0 0 1 83 | LAST_IMAGE 84 | ATOMIC_POSITIONS { bohr } 85 | Al 0.00000000 0.00000000 0.00000000 0 0 0 86 | Al 5.41111110 0.00000000 0.00000000 0 0 0 87 | Al 5.41113843 5.41113843 0.00000000 0 0 0 88 | Al 5.41113843 5.41113843 0.00000000 0 0 0 89 | H 5.41113843 5.41113843 3.11055670 0 0 1 90 | END_POSITIONS 91 | K_POINTS automatic 92 | 6 6 1 1 1 0 93 | CELL_PARAMETERS bohr 94 | 10.82227686 0.00000000 0.00000000 95 | 0.00000000 10.82227686 0.00000000 96 | 0.00000000 0.00000000 22.67672253 97 | END_ENGINE_INPUT 98 | END -------------------------------------------------------------------------------- /tests/resources/pw/FeO_LDAU_with_starting_ns_230210.in.test: -------------------------------------------------------------------------------- 1 | &CONTROL 2 | calculation='scf' 3 | disk_io='low' 4 | etot_conv_thr=0.0001 5 | forc_conv_thr=0.001 6 | input_xml_schema_file='FeO_LDAU_with_starting_ns_230210.xml' 7 | iprint=100000 8 | max_seconds=10000000 9 | outdir='./' 10 | prefix='pwscf' 11 | pseudo_dir='/u/cm/pdelugas/espresso/pseudo/' 12 | restart_mode='from_scratch' 13 | title='uffa' 14 | tprnfor=.false. 15 | tstress=.false. 16 | verbosity='low' 17 | wf_collect=.false. 18 | / 19 | &SYSTEM 20 | degauss=0.01 21 | ecutrho=240.0 22 | ecutwfc=30.0 23 | force_symmorphic=.false. 24 | ibrav=0 25 | input_dft='PZ' 26 | lspinorb=.false. 27 | nat=4 28 | nbnd=20 29 | no_t_rev=.false. 30 | noinv=.false. 31 | noncolin=.false. 32 | nosym=.false. 33 | nosym_evc=.false. 34 | nspin=2 35 | ntyp=3 36 | occupations='smearing' 37 | smearing='gaussian' 38 | starting_magnetization(1)=0.0 39 | starting_magnetization(2)=0.5 40 | starting_magnetization(3)=-0.5 41 | starting_ns_eigenvalue(3,1,3)=1.0 42 | starting_ns_eigenvalue(3,2,2)=1.0 43 | tot_charge=0.0 44 | use_all_frac=.false. 45 | / 46 | &ELECTRONS 47 | conv_thr=1e-08 48 | diago_cg_maxiter=20 49 | diago_full_acc=.false. 50 | diago_thr_init=0.0 51 | diagonalization='davidson' 52 | electron_maxstep=100 53 | mixing_beta=0.3 54 | mixing_mode='plain' 55 | mixing_ndim=8 56 | tbeta_smoothing=.false. 57 | tq_smoothing=.false. 58 | tqr=.false. 59 | / 60 | &IONS 61 | ion_dynamics='none' 62 | refold_pos=.false. 63 | remove_rigid_rot=.false. 64 | / 65 | &CELL 66 | cell_dynamics='none' 67 | cell_factor=0.0 68 | press=0.0 69 | press_conv_thr=0.5 70 | wmass=3645.777 71 | / 72 | ATOMIC_SPECIES 73 | O1 1.0 O.pz-rrkjus.UPF 74 | Fe1 1.0 Fe.pz-nd-rrkjus.UPF 75 | Fe2 1.0 Fe.pz-nd-rrkjus.UPF 76 | ATOMIC_POSITIONS bohr 77 | O1 4.09500000 4.09500000 4.09500000 78 | O1 12.28500000 12.28500000 12.28500000 79 | Fe1 0.00000000 0.00000000 0.00000000 80 | Fe2 8.19000000 8.19000000 8.19000000 81 | K_POINTS automatic 82 | 2 2 2 0 0 0 83 | CELL_PARAMETERS bohr 84 | 4.09500000 4.09500000 8.19000000 85 | 4.09500000 8.19000000 4.09500000 86 | 8.19000000 4.09500000 4.09500000 87 | HUBBARD atomic 88 | U Fe1-3d 0.316 89 | U Fe2-3d 0.316 90 | J0 Fe1-3d 0.000 91 | J0 Fe2-3d 0.000 92 | alpha Fe1-3d 0.000 93 | alpha Fe2-3d 0.000 94 | beta Fe1-3d 0.000 95 | beta Fe2-3d 0.000 96 | J Fe1-3d 0.000 97 | B Fe1-3d 0.000 98 | J Fe2-3d 0.000 99 | B Fe2-3d 0.000 100 | -------------------------------------------------------------------------------- /tests/resources/pw/Al001_relax_bfgs-input.yml: -------------------------------------------------------------------------------- 1 | '@xmlns:qes': http://www.quantum-espresso.org/ns/qes/qes-1.0 2 | '@xmlns:xsi': http://www.w3.org/2001/XMLSchema-instance 3 | '@xsi:schemaLocation': http://www.quantum-espresso.org/ns/qes/qes-1.0 ../../../qeschema/schemas/qes.xsd 4 | input: 5 | control_variables: {title: "\n ", calculation: relax, restart_mode: from_scratch, 6 | prefix: Al, pseudo_dir: /scratch/pdelugas/espresso-xsd/pseudo, outdir: /scratch/pdelugas/espresso-xsd/tempdir, 7 | stress: false, forces: false, wf_collect: false, disk_io: low, max_seconds: 10000000, 8 | etot_conv_thr: 0.0001, forc_conv_thr: 0.001, press_conv_thr: 0.5, verbosity: high, 9 | print_every: 100000} 10 | atomic_species: 11 | '@ntyp': 1 12 | species: 13 | - {'@name': Al, mass: 1.0, pseudo_file: Al.pz-vbc.UPF} 14 | atomic_structure: 15 | '@nat': 7 16 | '@alat': 5.3033 17 | atomic_positions: 18 | atom: 19 | - '@name': Al 20 | $: [0.09428092, 0.09428092, -0.4] 21 | - '@name': Al 22 | $: [0.0, 0.0, -0.2666666] 23 | - '@name': Al 24 | $: [0.09428092, 0.09428092, -0.1333334] 25 | - '@name': Al 26 | $: [0.0, 0.0, 0.0] 27 | - '@name': Al 28 | $: [0.09428092, 0.09428092, 0.1333334] 29 | - '@name': Al 30 | $: [0.0, 0.0, 0.2666666] 31 | - '@name': Al 32 | $: [0.09428092, 0.09428092, 0.4] 33 | cell: 34 | a1: [1.0, 0.0, 0.0] 35 | a2: [0.0, 1.0, 0.0] 36 | a3: [0.0, 0.0, 8.0] 37 | dft: {functional: PZ} 38 | spin: {lsda: false, noncolin: false, spinorbit: false} 39 | bands: 40 | smearing: {'@degauss': 0.05, $: gaussian} 41 | tot_charge: 0.0 42 | occupations: smearing 43 | basis: {ecutwfc: 12.0} 44 | electron_control: {diagonalization: davidson, mixing_mode: plain, mixing_beta: 0.3, 45 | conv_thr: 1.0e-06, mixing_ndim: 8, max_nstep: 100, real_space_q: false, tq_smoothing: false, 46 | tbeta_smoothing: false, diago_thr_init: 0.0, diago_full_acc: false, diago_cg_maxiter: 20} 47 | k_points_IBZ: 48 | nk: 3 49 | k_point: 50 | - '@weight': 1.0 51 | $: [0.125, 0.125, 0.0] 52 | - '@weight': 2.0 53 | $: [0.125, 0.375, 0.0] 54 | - '@weight': 1.0 55 | $: [0.375, 0.375, 0.0] 56 | ion_control: 57 | ion_dynamics: "\nbfgs\n " 58 | upscale: 100.0 59 | remove_rigid_rot: false 60 | refold_pos: false 61 | bfgs: {ndim: 3, trust_radius_min: 0.0001, trust_radius_max: 0.8, trust_radius_init: 0.5, 62 | w1: 0.01, w2: 0.5} 63 | cell_control: 64 | cell_dynamics: "\nnone\n " 65 | pressure: 0.0 66 | wmass: 6380.11 67 | cell_factor: 0.0 68 | free_cell: 69 | '@dims': [3, 3] 70 | '@rank': 2 71 | $: [1, 1, 1, 1, 1, 1, 1, 1, 1] 72 | symmetry_flags: 73 | nosym: false 74 | nosym_evc: false 75 | noinv: false 76 | no_t_rev: false, 77 | force_symmorphic: false 78 | use_all_frac: false 79 | free_positions: 80 | '@rank': 2 81 | '@dims': [3, 7] 82 | $: [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 83 | -------------------------------------------------------------------------------- /tests/resources/xspectra/xspectra_example_full.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | xanes_dipole 8 | high 9 | $TMP_DIR/ 10 | bubu 11 | 1 12 | 13 | 10.0 14 | 30.0 15 | 20.0 16 | 17 | 0.010 18 | 0.020 19 | 0.030 20 | xanes.sav 21 | 50 22 | 5 23 | false 24 | false 25 | 1.e-10 26 | 0.45 27 | 0.0 28 | true 29 | false 30 | atomic 31 | from_scratch 32 | 1.e8 33 | L2 34 | false 35 | false 36 | 1 37 | 1 38 | 39 | 40 | 41 | 200 42 | 0.1e0 43 | 10.e0 44 | 0.e0 45 | false 46 | false 47 | constant 48 | gamma.dat 49 | xanes.dat 50 | 10.e0 51 | 0.e0 52 | 53 | 54 | 55 | Core.wfc 56 | bubu 57 | 1.01 58 | 2.02 59 | 3.03 60 | 4.04 61 | 62 | 63 | 1.e-10 64 | 1.e-4 65 | 1.e-4 66 | 1.e-0 67 | 1.e-6 68 | 100.e0 69 | 1.e-4 70 | 10000 71 | 10000 72 | 73 | 74 | 75 | K-point mesh 76 | 77 | 78 | 79 | -------------------------------------------------------------------------------- /scripts/yaml2qeinput.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # 3 | # Copyright (c), 2015-2020, Quantum Espresso Foundation and SISSA (Scuola 4 | # Internazionale Superiore di Studi Avanzati). All rights reserved. 5 | # This file is distributed under the terms of the MIT License. See the 6 | # file 'LICENSE' in the root directory of the present distribution, or 7 | # http://opensource.org/licenses/MIT. 8 | # Authors: Davide Brunato, Giovanni Borghi 9 | # 10 | """ 11 | Convert from XML input to Fortran input 12 | """ 13 | import sys 14 | 15 | 16 | def parse_args(): 17 | """Command arguments parsing""" 18 | import argparse 19 | 20 | parser = argparse.ArgumentParser( 21 | description="This program converts a YAML formatted input to the an equivalent " 22 | "input file written in a format that is natively readable " 23 | "by Fortran's codes of Quantum Espresso" 24 | ) 25 | parser.add_argument("-v", "--verbosity", action="count", default=1, 26 | help="Increase output verbosity.") 27 | parser.add_argument('-in', metavar='FILE', required=True, help="YAML input filename.") 28 | parser.add_argument('-schema', metavar='FILE', required=False, 29 | help="Specify XSD schema in input", default=None) 30 | 31 | return parser.parse_args() 32 | 33 | 34 | if __name__ == '__main__': 35 | 36 | if sys.version_info < (3, 7, 0): 37 | sys.stderr.write("You need python 3.7 or later to run this program\n") 38 | sys.exit(1) 39 | 40 | args = parse_args() 41 | print("Create Fortran input from YAML file %r ...\n" % getattr(args, 'in')) 42 | 43 | if __package__ is None: 44 | from os import path 45 | sys.path.append(path.abspath(path.dirname(__file__)+'/../')) 46 | 47 | import qeschema 48 | import os 49 | import yaml 50 | 51 | qeschema.set_logger(args.verbosity) 52 | 53 | input_fn = getattr(args, 'in') 54 | schema_fn = getattr(args, 'schema', None) 55 | 56 | with open(input_fn) as f: 57 | data = yaml.load(f, Loader=yaml.Loader) 58 | 59 | for key in data: 60 | element_name = key.split('}')[-1] 61 | if element_name == 'espresso': 62 | xml_document = qeschema.PwDocument(schema=schema_fn) 63 | elif element_name == 'nebRun': 64 | xml_document = qeschema.NebDocument(schema=schema_fn) 65 | elif element_name == 'espressoph': 66 | xml_document = qeschema.PhononDocument(schema=schema_fn) 67 | elif element_name == 'tddfpt': 68 | xml_document = qeschema.TdDocument(schema=schema_fn) 69 | elif element_name == 'spectrumDoc': 70 | xml_document = qeschema.TdSpectrumDocument(schema=schema_fn) 71 | else: 72 | continue 73 | break 74 | else: 75 | sys.stderr.write("Could not find correct document root in %r, exiting...\n" % input_fn) 76 | sys.exit(1) 77 | 78 | xml_document.read(input_fn) 79 | qe_in = xml_document.get_fortran_input() 80 | 81 | input_fn_name, input_fn_ext = os.path.splitext(input_fn) 82 | outfile = input_fn_name + '.in' 83 | 84 | with open(outfile, mode='w') as f: 85 | f.write(qe_in) 86 | print("Input configuration written to file '%s' ..." % outfile) 87 | -------------------------------------------------------------------------------- /tests/resources/neb/periodic_dft_65_WaterP1_0_neb_0.in.test: -------------------------------------------------------------------------------- 1 | BEGIN 2 | BEGIN_PATH_INPUT 3 | &PATH 4 | CI_scheme='no-CI' 5 | ds=1.0 6 | first_last_opt=.false. 7 | k_max=0.1 8 | k_min=0.1 9 | minimum_image=.true. 10 | nstep_path=50 11 | num_of_images=4 12 | opt_scheme='broyden' 13 | path_thr=10.0 14 | string_method='neb' 15 | use_freezing=.false. 16 | use_masses=.false. 17 | / 18 | END_PATH_INPUT 19 | BEGIN_ENGINE_INPUT 20 | &CONTROL 21 | calculation='scf' 22 | disk_io='low' 23 | dt=41.3414 24 | etot_conv_thr=1e-05 25 | forc_conv_thr=0.001 26 | iprint=100000 27 | max_seconds=10000000 28 | nstep=50 29 | outdir='./' 30 | prefix='periodic_dft_65_WaterP1_0_neb_0' 31 | pseudo_dir='./' 32 | restart_mode='from_scratch' 33 | title='periodic_dft_65_WaterP1_0_neb_0' 34 | tprnfor=.false. 35 | tstress=.false. 36 | verbosity='low' 37 | wf_collect=.false. 38 | / 39 | &SYSTEM 40 | degauss=0.01 41 | ecutrho=200.0 42 | ecutwfc=40.0 43 | force_symmorphic=.false. 44 | ibrav=0 45 | input_dft='PZ' 46 | lspinorb=.false. 47 | nat = 3 48 | nbnd=12 49 | no_t_rev=.false. 50 | noinv=.false. 51 | noncolin=.false. 52 | nosym=.false. 53 | nosym_evc=.false. 54 | nspin=1 55 | ntyp=1 56 | occupations='smearing' 57 | smearing='gaussian' 58 | spline_ps=.false. 59 | starting_magnetization(1)=0.0 60 | tot_charge=0.0 61 | tot_magnetization=-1.0 62 | use_all_frac=.false. 63 | / 64 | &ELECTRONS 65 | conv_thr=1e-06 66 | diago_cg_maxiter=20 67 | diago_full_acc=.false. 68 | diago_thr_init=0.0 69 | diagonalization='davidson' 70 | electron_maxstep=100 71 | mixing_beta=0.7 72 | mixing_mode='plain' 73 | mixing_ndim=8 74 | tbeta_smoothing=.false. 75 | tq_smoothing=.false. 76 | tqr=.false. 77 | / 78 | &IONS 79 | delta_t=1.0 80 | ion_dynamics='bfgs' 81 | ion_temperature='rescale-v' 82 | nraise=1 83 | pot_extrapolation='atomic' 84 | tempw=300.0 85 | tolp=100.0 86 | wfc_extrapolation='none' 87 | / 88 | &CELL 89 | cell_dynamics='bfgs' 90 | cell_factor=2.0 91 | press=0.0 92 | press_conv_thr=0.5 93 | / 94 | 95 | ATOMIC_SPECIES 96 | H 1.00794 h_pbe_v0.4.nc.UPF 97 | BEGIN_POSITIONS 98 | FIRST_IMAGE 99 | ATOMIC_POSITIONS { crystal } 100 | H 0.61944200 0.00000000 0.00000000 0 1 0 101 | H 0.00000000 0.00000000 0.00000000 102 | H 0.12981400 0.00000000 0.00000000 1 0 1 103 | INTERMEDIATE_IMAGE 104 | ATOMIC_POSITIONS { crystal } 105 | H 0.45623300 0.00000000 0.00000000 0 1 0 106 | H 0.00000000 0.00000000 0.00000000 107 | H 0.29302300 0.00000000 0.00000000 1 0 1 108 | INTERMEDIATE_IMAGE 109 | ATOMIC_POSITIONS { crystal } 110 | H 0.29302300 0.00000000 0.00000000 0 1 0 111 | H 0.00000000 0.00000000 0.00000000 112 | H 0.45623300 0.00000000 0.00000000 1 0 1 113 | LAST_IMAGE 114 | ATOMIC_POSITIONS { crystal } 115 | H 0.12981400 0.00000000 0.00000000 0 1 0 116 | H 0.00000000 0.00000000 0.00000000 117 | H 0.61944200 0.00000000 0.00000000 1 0 1 118 | END_POSITIONS 119 | K_POINTS automatic 120 | 1 1 1 0 0 0 121 | CELL_PARAMETERS bohr 122 | 12.00000700 0.00000000 100.00000000 123 | 0.00000000 12.00000700 0.00000000 124 | 0.00000000 0.00000000 12.00000700 125 | END_ENGINE_INPUT 126 | END -------------------------------------------------------------------------------- /tests/resources/pw/ESM_2Dxy.in.test: -------------------------------------------------------------------------------- 1 | &CONTROL 2 | calculation='relax' 3 | disk_io='low' 4 | dt=41.3414 5 | etot_conv_thr=1e-05 6 | forc_conv_thr=0.001 7 | input_xml_schema_file='ESM_2Dxy.xml' 8 | iprint=100000 9 | max_seconds=10000000 10 | nstep=2 11 | outdir='./' 12 | prefix='ESM_2Dxy' 13 | pseudo_dir='./' 14 | restart_mode='from_scratch' 15 | title='ESM_2Dxy' 16 | tprnfor=.false. 17 | tstress=.false. 18 | verbosity='low' 19 | wf_collect=.false. 20 | / 21 | &SYSTEM 22 | assume_isolated='esm' 23 | degauss=0.01 24 | ecutrho=200.0 25 | ecutwfc=40.0 26 | esm_bc='bc3' 27 | esm_efield=0.0 28 | esm_nfit=4 29 | esm_w=0.0 30 | force_symmorphic=.false. 31 | ibrav=0 32 | input_dft='PBE' 33 | lspinorb=.false. 34 | nat=25 35 | nbnd=42 36 | no_t_rev=.false. 37 | noinv=.false. 38 | noncolin=.false. 39 | nosym=.true. 40 | nosym_evc=.false. 41 | nspin=1 42 | ntyp=2 43 | occupations='smearing' 44 | smearing='gaussian' 45 | spline_ps=.false. 46 | starting_magnetization(1)=0.0 47 | starting_magnetization(2)=0.0 48 | tot_charge=-0.01 49 | tot_magnetization=-1.0 50 | use_all_frac=.false. 51 | / 52 | &ELECTRONS 53 | conv_thr=1e-06 54 | diago_cg_maxiter=20 55 | diago_full_acc=.false. 56 | diago_thr_init=0.0 57 | diagonalization='davidson' 58 | electron_maxstep=10 59 | mixing_beta=0.7 60 | mixing_mode='plain' 61 | mixing_ndim=8 62 | tbeta_smoothing=.false. 63 | tq_smoothing=.false. 64 | tqr=.false. 65 | / 66 | &IONS 67 | delta_t=1.0 68 | ion_dynamics='damp' 69 | ion_temperature='rescale-v' 70 | nraise=1 71 | pot_extrapolation='atomic' 72 | tempw=300.0 73 | tolp=100.0 74 | wfc_extrapolation='none' 75 | / 76 | &CELL 77 | cell_dofree = '2Dxy' 78 | cell_dynamics='damp-pr' 79 | cell_factor=2.0 80 | press=0.0 81 | press_conv_thr=0.5 82 | / 83 | ATOMIC_SPECIES 84 | C 12.0107 c_pbe_v0.4.nc.UPF 85 | H 1.00794 h_pbe_v0.4.nc.UPF 86 | ATOMIC_POSITIONS crystal 87 | C -0.29463100 0.19161700 -0.12509200 88 | C -0.14272000 0.19161700 -0.12509200 89 | C -0.06676400 0.00000000 -0.12509200 90 | C -0.14272000 -0.19161700 -0.12509200 91 | C -0.29463100 -0.19161700 -0.12509200 92 | C -0.37058700 0.00000000 -0.12509200 93 | C 0.09718900 0.00000000 -0.12509200 94 | C 0.15184000 0.00000000 0.01633000 95 | C 0.17715900 0.19161700 0.08184700 96 | C 0.22779600 0.19161700 0.21288100 97 | C 0.25311400 0.00000000 0.27839800 98 | C 0.22779600 -0.19161700 0.21288100 99 | C 0.17715900 -0.19161700 0.08184700 100 | H -0.35376700 0.34080000 -0.12509200 101 | H -0.08358500 0.34080000 -0.12509200 102 | H -0.08358500 -0.34080000 -0.12509200 103 | H -0.35376600 -0.34080000 -0.12509200 104 | H -0.48885800 0.00000000 -0.12509200 105 | H 0.13690200 -0.14168500 -0.17647500 106 | H 0.13690200 0.14168500 -0.17647500 107 | H 0.15744700 0.34080000 0.03083800 108 | H 0.24750800 0.34080000 0.26388900 109 | H 0.29253800 0.00000000 0.38041500 110 | H 0.24750800 -0.34080000 0.26388900 111 | H 0.15744700 -0.34080000 0.03083800 112 | K_POINTS gamma 113 | CELL_PARAMETERS bohr 114 | 17.28899500 0.00000000 0.00000000 115 | 0.00000000 11.87016300 0.00000000 116 | 0.00000000 0.00000000 18.89726100 -------------------------------------------------------------------------------- /docs/api.rst: -------------------------------------------------------------------------------- 1 | ************ 2 | qeschema API 3 | ************ 4 | 5 | The package includes a base class for generic XML documents and some 6 | specialized classes for Quantum Espresso applications. 7 | 8 | 9 | Generic XML document API 10 | ------------------------ 11 | 12 | .. autoclass:: qeschema.XmlDocument 13 | 14 | .. autoattribute:: namespaces 15 | .. automethod:: read 16 | .. automethod:: from_xml 17 | .. automethod:: from_json 18 | .. automethod:: from_yaml 19 | .. automethod:: from_dict 20 | .. automethod:: write 21 | .. automethod:: to_dict 22 | .. automethod:: to_json 23 | .. automethod:: to_yaml 24 | .. automethod:: iter 25 | .. automethod:: find 26 | .. automethod:: findall 27 | 28 | 29 | QE applications XML document API 30 | -------------------------------- 31 | 32 | Specialized classes for QE applications can extend the base class :class:`qeschema.XmlDocument` 33 | with helper functions for extracting data from XML data files produced by each application. 34 | These classes have a common base class :class:`qeschema.QeDocument` that defines common methods 35 | an properties for accessing input and ouput data and for converting XML input to legacy 36 | Fortran namelist input. 37 | 38 | .. autoclass:: qeschema.QeDocument 39 | 40 | .. autoattribute:: input_path 41 | .. autoattribute:: output_path 42 | 43 | .. automethod:: get_fortran_input 44 | .. automethod:: write_fortran_input 45 | 46 | .. autoclass:: qeschema.PwDocument 47 | 48 | .. automethod:: get_atomic_positions 49 | .. automethod:: get_cell_parameters 50 | .. automethod:: get_stress 51 | .. automethod:: get_forces 52 | .. automethod:: get_k_points 53 | .. automethod:: get_ks_eigenvalues 54 | .. automethod:: get_total_energy 55 | 56 | .. autoclass:: qeschema.PhononDocument 57 | 58 | .. automethod:: get_fortran_input 59 | 60 | .. autoclass:: qeschema.NebDocument 61 | .. autoclass:: qeschema.TdDocument 62 | .. autoclass:: qeschema.TdSpectrumDocument 63 | 64 | 65 | Other API 66 | --------- 67 | 68 | These API calls can be useful for programmers that wants to make more complex scripts 69 | or to debug data. 70 | 71 | XML input to namelist format converters 72 | ....................................... 73 | 74 | Each QE application uses a converter to produce Fortran input (namelist) from XML input 75 | data. A converter object is associated with the attribute *input_builder* of the instance. 76 | 77 | .. autoclass:: qeschema.RawInputConverter 78 | .. autoclass:: qeschema.PwInputConverter 79 | .. autoclass:: qeschema.PhononInputConverter 80 | .. autoclass:: qeschema.NebInputConverter 81 | .. autoclass:: qeschema.TdInputConverter 82 | .. autoclass:: qeschema.TdSpectrumInputConverter 83 | 84 | Exception classes and utilities 85 | ............................... 86 | 87 | .. autoclass:: qeschema.QESchemaError 88 | .. autoclass:: qeschema.XmlDocumentError 89 | 90 | .. autofunction:: qeschema.set_logger 91 | 92 | 93 | HDF5 utilities 94 | .............. 95 | 96 | .. note:: 97 | The following functions can be used if the *h5py* package is installed. 98 | 99 | 100 | .. autofunction:: qeschema.hdf5.read_charge_file 101 | .. autofunction:: qeschema.hdf5.get_wf_attributes 102 | .. autofunction:: qeschema.hdf5.get_wavefunctions 103 | .. autofunction:: qeschema.hdf5.get_wfc_miller_indices 104 | -------------------------------------------------------------------------------- /qeschema/hdf5/__init__.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c), 2021, Quantum Espresso Foundation and SISSA (Scuola 3 | # Internazionale Superiore di Studi Avanzati). All rights reserved. 4 | # This file is distributed under the terms of the MIT License. See the 5 | # file 'LICENSE' in the root directory of the present distribution, or 6 | # http://opensource.org/licenses/MIT. 7 | # 8 | import numpy as np 9 | import h5py 10 | 11 | __all__ = ['read_charge_file', 'get_wf_attributes', 'get_wavefunctions', 12 | 'get_wfc_miller_indices'] 13 | 14 | 15 | def read_charge_file(filename): 16 | """ 17 | Reads a PW charge file in HDF5 format. 18 | 19 | :param filename: the name of the HDF5 file to read. 20 | :return: a dictionary describing the content of file \ 21 | keys=[nr, ngm_g, gamma_only, rhog_, MillerIndexes] 22 | """ 23 | with h5py.File(filename, "r") as h5f: 24 | MI = h5f.get('MillerIndices')[:] 25 | nr1 = 2 * max(abs(MI[:, 0])) + 1 26 | nr2 = 2 * max(abs(MI[:, 1])) + 1 27 | nr3 = 2 * max(abs(MI[:, 2])) + 1 28 | nr = np.array([nr1, nr2, nr3]) 29 | res = dict(h5f.attrs.items()) 30 | res.update({'MillInd': MI, 'nr_min': nr}) 31 | rhog = h5f['rhotot_g'][:].reshape(res['ngm_g'], 2).dot([1.e0, 1.e0j]) 32 | res['rhotot_g'] = rhog 33 | if 'rhodiff_g' in h5f.keys(): 34 | rhog = h5f['rhodiff_g'][:].reshape(res['ngm_g'], 2).dot([1.e0, 1.e0j]) 35 | res['rhodiff_g'] = rhog 36 | return res 37 | 38 | 39 | # TODO update to the new format 40 | def get_wf_attributes(filename): 41 | """ 42 | Read attributes from a wfc HDF5 file. 43 | 44 | :param filename: the path to the wfc file 45 | :return: a dictionary with all attributes included reciprocal vectors 46 | """ 47 | with h5py.File(filename, "r") as f: 48 | res = dict(f.attrs) 49 | mi_attrs = f.get('MillerIndices').attrs 50 | bg = np.array(mi_attrs.get(x) for x in ['bg1', 'bg2', 'bg3']) 51 | res.update({'bg': bg}) 52 | return res 53 | 54 | 55 | def get_wavefunctions(filename, start_band=None, stop_band=None): 56 | """ 57 | Returns a numpy array with the wave functions for bands from start_band to 58 | stop_band. If not specified starts from 1st band and ends with last one. 59 | Band numbering is Python style starts from 0.abs 60 | 61 | :param filename: path to the wfc file 62 | :param start_band: first band to read, default first band in the file 63 | :param stop_band: last band to read, default last band in the file 64 | :return: a numpy array with shape [nbnd,npw] 65 | """ 66 | with h5py.File(filename, "r") as f: 67 | igwx = f.attrs.get('igwx') 68 | if start_band is None: 69 | start_band = 0 70 | if stop_band is None: 71 | stop_band = f.attrs.get('nbnd') 72 | if stop_band == start_band: 73 | stop_band = start_band + 1 74 | res = f.get('evc')[start_band:stop_band, :] 75 | 76 | res = np.asarray(x.reshape([igwx, 2]).dot([1.e0, 1.e0j]) for x in res[:]) 77 | return res 78 | 79 | 80 | def get_wfc_miller_indices(filename): 81 | """ 82 | Reads miller indices from the wfc file 83 | 84 | :param filename: path to the wfc HDF5 file 85 | :return: a np.array of integers with shape [igwx,3] 86 | """ 87 | with h5py.File(filename, "r") as f: 88 | res = f.get("MillerIndices")[:, :] 89 | return res 90 | -------------------------------------------------------------------------------- /scripts/xml2qeinput.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # 3 | # Copyright (c), 2015-2020, Quantum Espresso Foundation and SISSA (Scuola 4 | # Internazionale Superiore di Studi Avanzati). All rights reserved. 5 | # This file is distributed under the terms of the MIT License. See the 6 | # file 'LICENSE' in the root directory of the present distribution, or 7 | # http://opensource.org/licenses/MIT. 8 | # Authors: Davide Brunato, Giovanni Borghi 9 | # 10 | """ 11 | Convert from XML input to Fortran input 12 | """ 13 | 14 | import sys 15 | 16 | 17 | def parse_args(): 18 | """Command arguments parsing""" 19 | import argparse 20 | 21 | parser = argparse.ArgumentParser( 22 | description="This program converts an XML input to the an equivalent " 23 | "input file written in a format that is natively readable " 24 | "by Fortran's codes of Quantum Espresso" 25 | ) 26 | parser.add_argument("-v", "--verbosity", action="count", default=1, 27 | help="Increase output verbosity.") 28 | parser.add_argument('-in', metavar='FILE', required=True, help="XML input filename.") 29 | parser.add_argument('-schema', metavar='FILE', required=False, 30 | help="Specify XSD schema in input", default=None) 31 | return parser.parse_args() 32 | 33 | 34 | if __name__ == '__main__': 35 | 36 | if sys.version_info < (3, 7, 0): 37 | sys.stderr.write("You need python 3.7 or later to run this program\n") 38 | sys.exit(1) 39 | 40 | args = parse_args() 41 | print("Create Fortran input from XML file %r ...\n" % getattr(args, 'in')) 42 | 43 | if __package__ is None: 44 | from os import path 45 | sys.path.append(path.abspath(path.dirname(__file__)+'/../')) 46 | 47 | import qeschema 48 | import os 49 | import xml.etree.ElementTree as Etree 50 | 51 | qeschema.set_logger(args.verbosity) 52 | 53 | input_fn = getattr(args, 'in') 54 | schema_fn = getattr(args, 'schema', None) 55 | tree = Etree.parse(input_fn) 56 | root = tree.getroot() 57 | element_name = root.tag.split('}')[-1] 58 | if element_name == 'espresso': 59 | xml_document = qeschema.PwDocument(source=input_fn, schema=schema_fn) 60 | elif element_name == 'nebRun': 61 | xml_document = qeschema.NebDocument(source=input_fn, schema=schema_fn) 62 | elif element_name == 'espressoph': 63 | xml_document = qeschema.PhononDocument(source=input_fn, schema=schema_fn) 64 | elif element_name == 'tddfpt': 65 | xml_document = qeschema.TdDocument(source=input_fn, schema=schema_fn) 66 | elif element_name == 'spectrumDoc': 67 | xml_document = qeschema.TdSpectrumDocument(source=input_fn, schema=schema_fn) 68 | elif element_name == 'xspectra': 69 | xml_document = qeschema.XSpectraDocument(source=input_fn, schema=schema_fn) 70 | elif element_name == 'epw': 71 | xml_document = qeschema.EPWDocument(souce=input_fn, schema=schema_fn) 72 | else: 73 | sys.stderr.write("Could not find correct XML in %s, exiting...\n" % input_fn) 74 | sys.exit(1) 75 | 76 | root = None 77 | tree = None 78 | 79 | qe_in = xml_document.get_fortran_input() 80 | 81 | input_fn_name, input_fn_ext = os.path.splitext(input_fn) 82 | outfile = input_fn_name + '.in' 83 | 84 | with open(outfile, mode='w') as f: 85 | f.write(qe_in) 86 | print("Input configuration written to file '%s' ..." % outfile) 87 | -------------------------------------------------------------------------------- /qeschema/schemas/releases/qes_spectrum-20180511.xsd: -------------------------------------------------------------------------------- 1 | 2 | 9 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /qeschema/schemas/qes_spectrum.xsd: -------------------------------------------------------------------------------- 1 | 2 | 9 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | -------------------------------------------------------------------------------- /qeschema/schemas/releases/qes_spectrum-20180517.xsd: -------------------------------------------------------------------------------- 1 | 2 | 9 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | -------------------------------------------------------------------------------- /tests/resources/pw/Fe_crystal_crystal_positions.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | Fe_crystal_crystal_positions 7 | relax 8 | from_scratch 9 | Fe_crystal_crystal_positions 10 | ./ 11 | ./ 12 | false 13 | false 14 | false 15 | low 16 | 10000000 17 | 50 18 | 1.00000e-05 19 | 1.00000e-03 20 | 5.00000e-01 21 | low 22 | 100000 23 | 24 | 25 | 26 | 55.845000 27 | fe_pbe_v1.5.uspp.F.UPF 28 | 0.400000 29 | 30 | 31 | 55.845000 32 | fe_pbe_v1.5.uspp.F.UPF 33 | 0.600000 34 | 35 | 36 | 37 | 38 | 39 | 0.000000 0.000000 0.000000 40 | 41 | 42 | 0.500000 0.500000 0.500000 43 | 44 | 45 | 46 | 5.406506 0.000000 0.000000 47 | 0.000000 5.406506 0.000000 48 | 0.000000 0.000000 5.406506 49 | 50 | 51 | 52 | BLYP 53 | 54 | 55 | true 56 | false 57 | false 58 | 59 | 60 | 26 61 | gaussian 62 | 0.000000 63 | -1.000000 64 | smearing 65 | 66 | 67 | false 68 | 20.000000 69 | 100.000000 70 | false 71 | 72 | 73 | davidson 74 | plain 75 | 0.700000 76 | 1.00000e-06 77 | 8 78 | 100 79 | false 80 | false 81 | false 82 | 0.000000 83 | false 84 | 20 85 | 86 | 87 | K-point mesh 88 | 89 | 90 | bfgs 91 | 92 | atomic 93 | none 94 | rescale-v 95 | 4.13414e+01 96 | 3.00000e+02 97 | 100. 98 | 1.00000e+00 99 | 1 100 | 101 | 102 | 103 | bfgs 104 | 0.000000 105 | 2.000000 106 | 107 | 108 | false 109 | false 110 | false 111 | false 112 | false 113 | false 114 | 115 | 116 | 1 1 1 117 | 1 1 1 118 | 119 | 120 | 121 | -------------------------------------------------------------------------------- /tests/resources/pw/Fe_Im-3m_0_dftd3.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | Fe_Im-3m_0_dftd3 7 | relax 8 | from_scratch 9 | Fe_Im-3m_0_dftd3 10 | ./ 11 | ./ 12 | false 13 | false 14 | false 15 | low 16 | 10000000 17 | 50 18 | 1.00000e-05 19 | 1.00000e-03 20 | 5.00000e-01 21 | low 22 | 100000 23 | 24 | 25 | 26 | 55.845000 27 | fe_pbe_v1.5.uspp.F.UPF 28 | 0.400000 29 | 30 | 31 | 55.845000 32 | fe_pbe_v1.5.uspp.F.UPF 33 | 0.600000 34 | 35 | 36 | 37 | 38 | 39 | 0.000000 0.000000 0.000000 40 | 41 | 42 | 0.500000 0.500000 0.500000 43 | 44 | 45 | 46 | 5.406506 0.000000 0.000000 47 | 0.000000 5.406506 0.000000 48 | 0.000000 0.000000 5.406506 49 | 50 | 51 | 52 | PBE 53 | 54 | DFT-D3 55 | 4 56 | true 57 | 58 | 59 | 60 | true 61 | false 62 | false 63 | 64 | 65 | 26 66 | gaussian 67 | 0.000000 68 | -1.000000 69 | smearing 70 | 71 | 72 | false 73 | 20.000000 74 | 100.000000 75 | false 76 | 77 | 78 | davidson 79 | plain 80 | 0.700000 81 | 1.00000e-06 82 | 8 83 | 100 84 | false 85 | false 86 | false 87 | 0.000000 88 | false 89 | 20 90 | 91 | 92 | K-point mesh 93 | 94 | 95 | bfgs 96 | 97 | atomic 98 | none 99 | rescale-v 100 | 4.13414e+01 101 | 3.00000e+02 102 | 100. 103 | 1.00000e+00 104 | 1 105 | 106 | 107 | 108 | bfgs 109 | 0.000000 110 | 2.000000 111 | 112 | 113 | false 114 | false 115 | false 116 | false 117 | false 118 | false 119 | 120 | 121 | 1 1 1 122 | 1 1 1 123 | 124 | 125 | 126 | -------------------------------------------------------------------------------- /docs/conf.py: -------------------------------------------------------------------------------- 1 | # Configuration file for the Sphinx documentation builder. 2 | # 3 | # This file only contains a selection of the most common options. For a full 4 | # list see the documentation: 5 | # http://www.sphinx-doc.org/en/master/config 6 | 7 | # -- Path setup -------------------------------------------------------------- 8 | 9 | # If extensions (or modules to document with autodoc) are in another directory, 10 | # add these directories to sys.path here. If the directory is relative to the 11 | # documentation root, use os.path.abspath to make it absolute, like shown here. 12 | # 13 | # import os 14 | # import sys 15 | # sys.path.insert(0, os.path.abspath('.')) 16 | 17 | 18 | # -- Project information ----------------------------------------------------- 19 | 20 | project = 'qeschema' 21 | copyright = '2015-2024, Quantum Espresso Foundation and SISSA' 22 | author = 'Davide Brunato, Pietro Delugas' 23 | 24 | # The full version, including alpha/beta/rc tags 25 | release = '1.5.2' 26 | 27 | 28 | # -- General configuration --------------------------------------------------- 29 | 30 | # Add any Sphinx extension module names here, as strings. They can be 31 | # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom 32 | # ones. 33 | extensions = [ 34 | 'sphinx.ext.autodoc', 35 | 'sphinx.ext.doctest', 36 | ] 37 | 38 | # Add any paths that contain templates here, relative to this directory. 39 | templates_path = ['_templates'] 40 | 41 | # List of patterns, relative to source directory, that match files and 42 | # directories to ignore when looking for source files. 43 | # This pattern also affects html_static_path and html_extra_path. 44 | exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] 45 | 46 | # The master toctree document. 47 | master_doc = 'index' 48 | 49 | 50 | # -- Options for HTML output ------------------------------------------------- 51 | 52 | # The theme to use for HTML and HTML Help pages. See the documentation for 53 | # a list of builtin themes. 54 | # 55 | html_theme = 'alabaster' 56 | 57 | # Add any paths that contain custom static files (such as style sheets) here, 58 | # relative to this directory. They are copied after the builtin static files, 59 | # so a file named "default.css" will overwrite the builtin "default.css". 60 | html_static_path = ['_static'] 61 | 62 | 63 | # -- Options for LaTeX output --------------------------------------------- 64 | 65 | latex_elements = { 66 | # The paper size ('letterpaper' or 'a4paper'). 67 | # 68 | # 'papersize': 'letterpaper', 69 | 70 | # The font size ('10pt', '11pt' or '12pt'). 71 | # 72 | # 'pointsize': '10pt', 73 | 74 | # Additional stuff for the LaTeX preamble. 75 | # 76 | # 'preamble': '', 77 | 78 | # Latex figure (float) alignment 79 | # 80 | # 'figure_align': 'htbp', 81 | } 82 | 83 | # Grouping the document tree into LaTeX files. List of tuples 84 | # (source start file, target name, title, 85 | # author, documentclass [howto, manual, or own class]). 86 | latex_documents = [ 87 | (master_doc, 'qeschema.tex', 'qeschema Documentation', 88 | 'Davide Brunato, Pietro Delugas', 'manual'), 89 | ] 90 | 91 | 92 | # -- Options for manual page output --------------------------------------- 93 | 94 | # One entry per manual page. List of tuples 95 | # (source start file, name, description, authors, manual section). 96 | man_pages = [ 97 | (master_doc, 'qeschema', 'qeschema Documentation', 98 | [author], 1) 99 | ] 100 | 101 | 102 | # -- Options for Texinfo output ------------------------------------------- 103 | 104 | # Grouping the document tree into Texinfo files. List of tuples 105 | # (source start file, target name, title, author, 106 | # dir menu entry, description, category) 107 | texinfo_documents = [ 108 | (master_doc, 'qeschema', 'qeschema Documentation', 109 | author, 'qeschema', 'Quantum Espresso tools for XML Schema based documents.', 110 | 'Miscellaneous'), 111 | ] 112 | 113 | 114 | 115 | # -- Options for Epub output ---------------------------------------------- 116 | 117 | # Bibliographic Dublin Core info. 118 | epub_title = project 119 | epub_author = author 120 | epub_publisher = author 121 | epub_copyright = copyright 122 | 123 | # The unique identifier of the text. This can be a ISBN number 124 | # or the project homepage. 125 | # 126 | # epub_identifier = '' 127 | 128 | # A unique identification for the text. 129 | # 130 | # epub_uid = '' 131 | 132 | # A list of files that should not be packed into the epub file. 133 | epub_exclude_files = ['search.html'] 134 | 135 | 136 | 137 | -------------------------------------------------------------------------------- /tests/resources/pw/Al001_relax_bfgs.yml: -------------------------------------------------------------------------------- 1 | '{http://www.quantum-espresso.org/ns/qes/qes-1.0}espresso': 2 | '@{http://www.w3.org/2001/XMLSchema-instance}schemaLocation': http://www.quantum-espresso.org/ns/qes/qes-1.0 3 | releases/qes_190719.xsd 4 | input: 5 | atomic_species: 6 | '@ntyp': 1 7 | species: 8 | - '@name': Al 9 | mass: 1.0 10 | pseudo_file: Al.pz-vbc.UPF 11 | atomic_structure: 12 | '@alat': 5.3033 13 | '@nat': 7 14 | atomic_positions: 15 | atom: 16 | - $: 17 | - 0.09428092 18 | - 0.09428092 19 | - -0.4 20 | '@name': Al 21 | - $: 22 | - 0.0 23 | - 0.0 24 | - -0.2666666 25 | '@name': Al 26 | - $: 27 | - 0.09428092 28 | - 0.09428092 29 | - -0.1333334 30 | '@name': Al 31 | - $: 32 | - 0.0 33 | - 0.0 34 | - 0.0 35 | '@name': Al 36 | - $: 37 | - 0.09428092 38 | - 0.09428092 39 | - 0.1333334 40 | '@name': Al 41 | - $: 42 | - 0.0 43 | - 0.0 44 | - 0.2666666 45 | '@name': Al 46 | - $: 47 | - 0.09428092 48 | - 0.09428092 49 | - 0.4 50 | '@name': Al 51 | cell: 52 | a1: 53 | - 1.0 54 | - 0.0 55 | - 0.0 56 | a2: 57 | - 0.0 58 | - 1.0 59 | - 0.0 60 | a3: 61 | - 0.0 62 | - 0.0 63 | - 8.0 64 | bands: 65 | occupations: smearing 66 | smearing: 67 | $: gaussian 68 | '@degauss': 0.05 69 | tot_charge: 0.0 70 | basis: 71 | ecutwfc: 12.0 72 | cell_control: 73 | cell_dynamics: "\nnone\n " 74 | cell_factor: 0.0 75 | free_cell: 76 | $: 77 | - 1 78 | - 1 79 | - 1 80 | - 1 81 | - 1 82 | - 1 83 | - 1 84 | - 1 85 | - 1 86 | '@dims': 87 | - 3 88 | - 3 89 | '@rank': 2 90 | pressure: 0.0 91 | wmass: 6380.11 92 | control_variables: 93 | calculation: relax 94 | disk_io: low 95 | etot_conv_thr: 0.0001 96 | forc_conv_thr: 0.001 97 | forces: false 98 | max_seconds: 10000000 99 | outdir: /scratch/pdelugas/espresso-xsd/tempdir 100 | prefix: Al 101 | press_conv_thr: 0.5 102 | print_every: 100000 103 | pseudo_dir: /scratch/pdelugas/espresso-xsd/pseudo 104 | restart_mode: from_scratch 105 | stress: false 106 | title: "\n " 107 | verbosity: high 108 | wf_collect: false 109 | dft: 110 | functional: PZ 111 | electron_control: 112 | conv_thr: 1.0e-06 113 | diago_cg_maxiter: 20 114 | diago_full_acc: false 115 | diago_thr_init: 0.0 116 | diagonalization: davidson 117 | max_nstep: 100 118 | mixing_beta: 0.3 119 | mixing_mode: plain 120 | mixing_ndim: 8 121 | real_space_q: false 122 | tbeta_smoothing: false 123 | tq_smoothing: false 124 | free_positions: 125 | $: 126 | - 1 127 | - 1 128 | - 1 129 | - 1 130 | - 1 131 | - 1 132 | - 1 133 | - 1 134 | - 1 135 | - 1 136 | - 1 137 | - 1 138 | - 1 139 | - 1 140 | - 1 141 | - 1 142 | - 1 143 | - 1 144 | - 1 145 | - 1 146 | - 1 147 | '@dims': 148 | - 3 149 | - 7 150 | '@rank': 2 151 | ion_control: 152 | bfgs: 153 | ndim: 3 154 | trust_radius_init: 0.5 155 | trust_radius_max: 0.8 156 | trust_radius_min: 0.0001 157 | w1: 0.01 158 | w2: 0.5 159 | ion_dynamics: "\nbfgs\n " 160 | refold_pos: false 161 | remove_rigid_rot: false 162 | upscale: 100.0 163 | k_points_IBZ: 164 | k_point: 165 | - $: 166 | - 0.125 167 | - 0.125 168 | - 0.0 169 | '@weight': 1.0 170 | - $: 171 | - 0.125 172 | - 0.375 173 | - 0.0 174 | '@weight': 2.0 175 | - $: 176 | - 0.375 177 | - 0.375 178 | - 0.0 179 | '@weight': 1.0 180 | nk: 3 181 | spin: 182 | lsda: false 183 | noncolin: false 184 | spinorbit: false 185 | symmetry_flags: 186 | force_symmorphic: false 187 | no_t_rev: false 188 | noinv: false 189 | nosym: false 190 | nosym_evc: false 191 | use_all_frac: false 192 | -------------------------------------------------------------------------------- /qeschema/upf.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c), 2021, Quantum Espresso Foundation and SISSA (Scuola 3 | # Internazionale Superiore di Studi Avanzati). All rights reserved. 4 | # This file is distributed under the terms of the MIT License. See the 5 | # file 'LICENSE' in the root directory of the present distribution, or 6 | # http://opensource.org/licenses/MIT. 7 | # 8 | """ 9 | A collection of functions for reading different files and quantities. 10 | """ 11 | import numpy as np 12 | from xml.etree import ElementTree 13 | 14 | __all__ = ['read_pseudo_file'] 15 | 16 | 17 | def read_pseudo_file(xml_file): 18 | """ 19 | Reads a pseudo-potential XML-like file in the QE UPF format (text), returning 20 | the content of each tag in a dictionary. The file is read in strings and 21 | completed with a root UPF tag when it lacks, to avoids an XML syntax error. 22 | 23 | TODO: add support for UPF-schema files 24 | """ 25 | def iter_upf_file(): 26 | """ 27 | Creates an iterator over the lines of an UPF file, 28 | inserting the root tag when missing. 29 | """ 30 | with open(xml_file, 'r') as f: 31 | fake_root = None 32 | for line in f: 33 | if fake_root is not None: 34 | line = line.replace('&input', '&input') 35 | line = line.replace('&inputp', '&inputp') 36 | yield line 37 | else: 38 | line = line.strip() 39 | if line.startswith("', ' '): 40 | yield line 41 | fake_root = False 42 | elif line: 43 | yield "" 44 | yield line 45 | fake_root = True 46 | if fake_root is True: 47 | yield "" 48 | 49 | pseudo = {} 50 | psroot = ElementTree.fromstringlist(list(iter_upf_file())) 51 | 52 | # PP_INFO 53 | try: 54 | pp_info = psroot.find('PP_INFO').text 55 | except AttributeError: 56 | pp_info = "" 57 | try: 58 | pp_input = psroot.find('PP_INFO/PP_INPUTFILE').text 59 | except AttributeError: 60 | pp_input = "" 61 | pseudo.update(PP_INFO=dict(INFO=pp_info, PP_INPUT=pp_input)) 62 | 63 | # PP_HEADER 64 | pseudo.update(PP_HEADER=dict(psroot.find('PP_HEADER').attrib)) 65 | 66 | # PP_MESH 67 | pp_mesh = dict(psroot.find('PP_MESH').attrib) 68 | pp_r = np.array([float(x) for x in psroot.find('PP_MESH/PP_R').text.split()]) 69 | pp_rab = np.array([float(x) for x in psroot.find('PP_MESH/PP_RAB').text.split()]) 70 | pp_mesh.update(PP_R=pp_r, PP_RAB=pp_rab) 71 | pseudo.update(PP_MESH=pp_mesh) 72 | 73 | # PP_LOCAL 74 | node = psroot.find('PP_LOCAL') 75 | if node is not None: 76 | pp_local = np.array([x for x in map(float, node.text.split())]) 77 | else: 78 | pp_local = None 79 | pseudo.update(PP_LOCAL=pp_local) 80 | 81 | # PP_RHOATOM 82 | node = psroot.find('PP_RHOATOM') 83 | if node is not None: 84 | pp_rhoatom = np.array([v for v in map(float, node.text.split())]) 85 | else: 86 | pp_rhoatom = None 87 | pseudo.update(PP_RHOATOM=pp_rhoatom) 88 | 89 | # PP_NONLOCAL 90 | node = psroot.find('PP_NONLOCAL') 91 | if node is not None: 92 | betas = list() 93 | dij = None 94 | pp_aug = None 95 | pp_q = None 96 | for el in node: 97 | if 'PP_BETA' in el.tag: 98 | beta = dict(el.attrib) 99 | val = np.array(x for x in map(float, el.text.split())) 100 | beta.update(beta=val) 101 | betas.append(beta) 102 | elif 'PP_DIJ' in el.tag: 103 | text = '\n'.join(el.text.strip().split('\n')[1:]) 104 | dij = np.array([x for x in map(float, text.split())]) 105 | elif 'PP_AUGMENTATION' in el.tag: 106 | pp_aug = dict(el.attrib) 107 | pp_qijl = list() 108 | pp_qij = list() 109 | for q in el: 110 | if 'PP_QIJL' in q.tag: 111 | qijl = dict(q.attrib) 112 | val = np.array(x for x in map(float, q.text.split())) 113 | qijl.update(qijl=val) 114 | pp_qijl.append(qijl) 115 | elif 'PP_QIJ' in q.tag: 116 | qij = dict(q.attrib) 117 | val = np.array(x for x in map(float, q.text.split())) 118 | qij.update(qij=val) 119 | pp_qij.append(qij) 120 | elif q.tag == 'PP_Q': 121 | pp_q = np.array(x for x in map(float, q.text.split())) 122 | pp_aug.update(PP_QIJL=pp_qijl, PP_QIJ=pp_qij, PP_Q=pp_q) 123 | pp_nonlocal = dict(PP_BETA=betas, PP_DIJ=dij, PP_AUGMENTATION=pp_aug) 124 | else: 125 | pp_nonlocal = None 126 | 127 | pseudo.update(PP_NONLOCAL=pp_nonlocal) 128 | return pseudo 129 | -------------------------------------------------------------------------------- /tests/resources/pw/Pt_spinorbit.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | Pt_fullyRelativistic 7 | scf 8 | from_scratch 9 | Pt 10 | /scratch/pdelugas/espresso-xsd/pseudo/ 11 | /scratch/pdelugas/espresso-xsd/tempdir/ 12 | 13 | true 14 | 15 | 16 | true 17 | 18 | 19 | false 20 | 21 | low 22 | 23 | 10000000 24 | 25 | 26 | 0.1000000E-03 27 | 28 | 29 | 0.1000000E-02 30 | 31 | 32 | 0.5000000E+00 33 | 34 | low 35 | 36 | 100000 37 | 38 | 39 | 40 | 41 | 42 | 0.0000000E+00 43 | 44 | Pt.rel-pz-n-rrkjus.UPF 45 | 46 | 0.0000000E+00 47 | 48 | 49 | 0.0000000E+00 50 | 51 | 52 | 0.0000000E+00 53 | 54 | 55 | 56 | 57 | 58 | 59 | 0.0000000E+00 0.0000000E+00 0.0000000E+00 60 | 61 | 62 | 63 | 64 | -0.5000000E+00 0.0000000E+00 0.5000000E+00 65 | 66 | 67 | 0.0000000E+00 0.5000000E+00 0.5000000E+00 68 | 69 | 70 | -0.5000000E+00 0.5000000E+00 0.0000000E+00 71 | 72 | 73 | 74 | 75 | PZ 76 | 77 | 78 | 79 | false 80 | 81 | 82 | false 83 | 84 | 85 | true 86 | 87 | 88 | 89 | mp 90 | 91 | 0.0000000E+00 92 | 93 | smearing 94 | 95 | 96 | 97 | 0.3000000E+02 98 | 99 | 100 | 0.2500000E+03 101 | 102 | 103 | 104 | davidson 105 | plain 106 | 107 | 0.7000000E+00 108 | 109 | 110 | 0.1000000E-07 111 | 112 | 113 | 8 114 | 115 | 116 | 100 117 | 118 | 119 | false 120 | 121 | false 122 | false 123 | 124 | 0.0000000E+00 125 | 126 | 127 | false 128 | 129 | 130 | 20 131 | 132 | 133 | 134 | 135 | Uniform grid with offset 136 | 137 | 138 | 139 | none 140 | 141 | false 142 | 143 | 144 | false 145 | 146 | 147 | 148 | none 149 | 0.0 150 | 151 | 0.1778027E+06 152 | 153 | 154 | 0.0000000E+00 155 | 156 | 157 | 1 1 1 158 | 1 1 1 159 | 1 1 1 160 | 161 | 162 | 163 | 164 | false 165 | 166 | 167 | false 168 | 169 | 170 | false 171 | 172 | 173 | false 174 | 175 | 176 | false 177 | 178 | 179 | false 180 | 181 | 182 | 183 | 184 | -------------------------------------------------------------------------------- /tests/resources/pw/CO_bgfs_relax.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | CO bfgs relaxation 7 | relax 8 | from_scratch 9 | CO 10 | ./ 11 | ./ 12 | false 13 | false 14 | false 15 | low 16 | 10000000 17 | 50 18 | 5.000000000000000E-005 19 | 5.000000000000000E-004 20 | 5.000000000000000E-001 21 | low 22 | 100000 23 | false 24 | false 25 | 26 | 27 | 28 | 1.000000000000000E+000 29 | O.pbesol-n-kjpaw_psl.0.1.UPF 30 | 31 | 32 | 1.000000000000000E+000 33 | C.pbesol-n-kjpaw_psl.1.0.0.UPF 34 | 35 | 36 | 37 | 38 | 39 | 1.880000000000000E-001 0.000000000000000E+000 0.000000000000000E+000 40 | 41 | 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 42 | 43 | 44 | 1.000000000000000E+001 0.000000000000000E+000 0.000000000000000E+000 45 | 0.000000000000000E+000 1.000000000000000E+001 0.000000000000000E+000 46 | 0.000000000000000E+000 0.000000000000000E+000 1.000000000000000E+001 47 | 48 | 49 | 50 | PZ 51 | 52 | 53 | false 54 | false 55 | false 56 | 57 | 58 | 0.000000000000000E+000 59 | fixed 60 | 61 | 62 | true 63 | 1.200000000000000E+001 64 | 7.200000000000000E+001 65 | 66 | 67 | davidson 68 | plain 69 | 7.000000000000000E-001 70 | 5.000000000000000E-008 71 | 8 72 | 100 73 | 100 74 | false 75 | false 76 | false 77 | false 78 | 0.000000000000000E+000 79 | false 80 | 20 81 | 20 82 | 4 83 | 16 84 | false 85 | 86 | 87 | 1 88 | 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 89 | 90 | 91 | bfgs 92 | 1.000000000000000E+002 93 | false 94 | false 95 | 96 | 1 97 | 1.000000000000000E-004 98 | 8.000000000000000E-001 99 | 5.000000000000000E-001 100 | 1.000000000000000E-002 101 | 5.000000000000000E-001 102 | 103 | 104 | 105 | none 106 | 0.000000000000000E+000 107 | 0.000000000000000E+000 108 | all 109 | 110 | 111 | false 112 | false 113 | false 114 | false 115 | false 116 | false 117 | 118 | 119 | 1 1 1 120 | 0 0 0 121 | 122 | 123 | 124 | -------------------------------------------------------------------------------- /tests/resources/pw/PbTiO3_scf.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | PBTiO3_scf 7 | scf 8 | from_scratch 9 | pwscf 10 | /scratch/pdelugas/espresso-xsd/pseudo/ 11 | /scratch/pdelugas/espresso-xsd/tempdir/ 12 | 13 | false 14 | 15 | 16 | false 17 | 18 | 19 | false 20 | 21 | low 22 | 23 | 10000000 24 | 25 | 26 | 0.1000000E-03 27 | 28 | 29 | 0.1000000E-02 30 | 31 | 32 | 0.5000000E+00 33 | 34 | low 35 | 36 | 100000 37 | 38 | 39 | 40 | 41 | 42 | 0.2072000E+03 43 | 44 | Pb.pz-d-van.UPF 45 | 46 | 47 | 48 | 0.4786700E+02 49 | 50 | Ti.pz-sp-van_ak.UPF 51 | 52 | 53 | 54 | 0.1599940E+02 55 | 56 | O.pz-van_ak.UPF 57 | 58 | 59 | 60 | 61 | 62 | 0.0000000E+00 0.0000000E+00 0.1356871E-02 63 | 64 | 65 | 0.6784353E-01 0.6784353E-01 0.6784353E-01 66 | 67 | 68 | 0.0000000E+00 0.6784353E-01 0.6784353E-01 69 | 70 | 71 | 0.6784353E-01 0.6784353E-01 0.0000000E+00 72 | 73 | 74 | 0.6784353E-01 0.0000000E+00 0.6784353E-01 75 | 76 | 77 | 78 | 79 | 0.1000000E+01 0.0000000E+00 0.0000000E+00 80 | 81 | 82 | 0.0000000E+00 0.1000000E+01 0.0000000E+00 83 | 84 | 85 | 0.0000000E+00 0.0000000E+00 0.1000000E+01 86 | 87 | 88 | 89 | 90 | PZ 91 | 92 | 93 | 94 | false 95 | 96 | 97 | false 98 | 99 | 100 | false 101 | 102 | 103 | 104 | 105 | 25 106 | 107 | 108 | 0.0000000E+00 109 | 110 | fixed 111 | 112 | 113 | 114 | 0.3000000E+02 115 | 116 | 117 | 118 | davidson 119 | plain 120 | 121 | 0.3000000E+00 122 | 123 | 124 | 0.1000000E-11 125 | 126 | 127 | 8 128 | 129 | 130 | 100 131 | 132 | false 133 | false 134 | false 135 | 136 | 0.0000000E+00 137 | 138 | false 139 | 140 | 20 141 | 142 | 143 | 144 | 145 | Uniform grid with offset 146 | 147 | 148 | 149 | none 150 | 151 | false 152 | 153 | 154 | false 155 | 156 | 157 | 158 | none 159 | 0.0 160 | 161 | 0.2762270E+06 162 | 163 | 164 | 0.0000000E+00 165 | 166 | 167 | 1 1 1 168 | 1 1 1 169 | 1 1 1 170 | 171 | 172 | 173 | 174 | false 175 | 176 | 177 | false 178 | 179 | 180 | false 181 | 182 | 183 | false 184 | 185 | 186 | false 187 | 188 | 189 | false 190 | 191 | 192 | 193 | 194 | -------------------------------------------------------------------------------- /tests/test_converters.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # 3 | # Copyright (c), 2015-2019, Quantum Espresso Foundation and SISSA (Scuola 4 | # Internazionale Superiore di Studi Avanzati). All rights reserved. 5 | # This file is distributed under the terms of the MIT License. See the 6 | # file 'LICENSE' in the root directory of the present distribution, or 7 | # http://opensource.org/licenses/MIT. 8 | # Authors: Davide Brunato 9 | # 10 | """ 11 | Test classes for Quantum Espresso input converters. 12 | """ 13 | import unittest 14 | import os 15 | import glob 16 | import platform 17 | import xml.etree.ElementTree as ElementTree 18 | 19 | try: 20 | import yaml 21 | except ImportError: 22 | yaml = None 23 | 24 | import qeschema 25 | 26 | 27 | def make_test_function(xml_file, ref_in_file): 28 | def test(self): 29 | tree = ElementTree.parse(xml_file) 30 | root = tree.getroot() 31 | 32 | element_name = root.tag.split('}')[-1] 33 | 34 | if element_name == 'espresso': 35 | xml_conf = qeschema.PwDocument(source=xml_file) 36 | elif element_name == 'nebRun': 37 | xml_conf = qeschema.NebDocument(source=xml_file, schema='qes_neb_test_ref.xsd') 38 | elif element_name == 'espressoph': 39 | xml_conf = qeschema.PhononDocument(source=xml_file) 40 | elif element_name == 'tddfpt': 41 | xml_conf = qeschema.TdDocument(source=xml_file) 42 | elif element_name == 'spectrumDoc': 43 | xml_conf = qeschema.TdSpectrumDocument(source=xml_file) 44 | elif element_name == 'xspectra': 45 | xml_conf = qeschema.XSpectraDocument(source=xml_file) 46 | elif element_name == 'epw': 47 | xml_conf = qeschema.EPWDocument(source=xml_file) 48 | else: 49 | raise ValueError("XML file %r is not a Quantum ESPRESSO document!" % xml_file) 50 | 51 | xml_conf.read(xml_file) 52 | qe_input = xml_conf.get_fortran_input().split('\n') 53 | with open(ref_in_file, 'r') as qe_input_file: 54 | k = 0 55 | are_equals = True 56 | for ref_line in qe_input_file: 57 | ref_line = ref_line.rstrip('\n').strip(' \t') 58 | in_line = qe_input[k].strip(' \t') 59 | if ref_line != in_line: 60 | print("Unmatched lines: '%s' != '%s'" % (in_line, ref_line)) 61 | are_equals = False 62 | break 63 | else: 64 | k += 1 65 | self.assertTrue(are_equals, xml_file) 66 | return test 67 | 68 | 69 | class ConverterTestCase(unittest.TestCase): 70 | 71 | @classmethod 72 | def setUpClass(cls): 73 | cls.test_dir = os.path.dirname(os.path.abspath(__file__)) 74 | cls.pkg_folder = os.path.dirname(cls.test_dir) 75 | 76 | def test_xml2qeinput_script(self): 77 | xml_filename = os.path.join(self.test_dir, 'resources/pw/Al001_relax_bfgs.xml') 78 | in_filename = xml_filename[:-4] + '.in' 79 | py_filename = os.path.join(self.pkg_folder, 'scripts/xml2qeinput.py') 80 | if os.path.isfile(in_filename): 81 | os.remove(in_filename) 82 | 83 | if platform.system() == 'Windows': 84 | os.system("python %s -in %s" % (py_filename, xml_filename)) 85 | self.assertTrue('Al001_relax_bfgs.in' in os.listdir(os.path.dirname(xml_filename))) 86 | else: 87 | if platform.system() == 'Linux': 88 | command = 'python %s -in %s 1> /dev/null 2> /dev/null' 89 | else: 90 | command = 'python3 %s -in %s 1> /dev/null 2> /dev/null' 91 | 92 | os.system(command % (py_filename, xml_filename)) 93 | self.assertTrue(os.path.isfile(in_filename), 94 | 'Test output file %r missing!' % in_filename) 95 | 96 | @unittest.skipIf(yaml is None, "PyYAML library is not installed") 97 | def test_yaml2qeinput_script(self): 98 | xml_filename = os.path.join(self.test_dir, 'resources/pw/Al001_relax_bfgs.yml') 99 | in_filename = xml_filename[:-4] + '.in' 100 | py_filename = os.path.join(self.pkg_folder, 'scripts/yaml2qeinput.py') 101 | if os.path.isfile(in_filename): 102 | os.remove(in_filename) 103 | 104 | if platform.system() == 'Windows': 105 | os.system("python %s -schema qes_test_ref.xsd -in %s" % (py_filename, xml_filename)) 106 | self.assertTrue('Al001_relax_bfgs.in' in os.listdir(os.path.dirname(xml_filename))) 107 | else: 108 | if platform.system() == 'Linux': 109 | command = 'python %s -schema qes_test_ref.xsd -in %s 1> /dev/null 2> /dev/null' 110 | else: 111 | command = 'python3 %s -schema qes_test_ref.xsd -in %s 1> /dev/null 2> /dev/null' 112 | 113 | os.system(command % (py_filename, xml_filename)) 114 | self.assertTrue(os.path.isfile(in_filename), 115 | 'Test output file %r missing!' % in_filename) 116 | 117 | 118 | ## 119 | # Create test classes for examples 120 | # 121 | test_dir = os.path.dirname(os.path.abspath(__file__)) 122 | 123 | for filename in glob.glob(os.path.join(test_dir, "resources/*/*.xml")): 124 | qe_input_filename = '%s.in.test' % filename[:-4] 125 | if not os.path.isfile(qe_input_filename): 126 | continue 127 | 128 | test_func = make_test_function(filename, qe_input_filename) 129 | test_name = os.path.relpath(filename) 130 | klassname = 'Test_{0}'.format(test_name.replace('/', '__')) 131 | globals()[klassname] = type( 132 | klassname, (unittest.TestCase,), 133 | {'test_converter_{0}'.format(test_name): test_func, 'longMessage': True} 134 | ) 135 | 136 | 137 | if __name__ == '__main__': 138 | unittest.main() 139 | -------------------------------------------------------------------------------- /tests/resources/pw/PbTiO3_bc3_fcp_opt.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | PBTiO3_scf 7 | scf 8 | from_scratch 9 | pwscf 10 | /scratch/pdelugas/espresso-xsd/pseudo/ 11 | /scratch/pdelugas/espresso-xsd/tempdir/ 12 | 13 | false 14 | 15 | 16 | false 17 | 18 | 19 | false 20 | 21 | low 22 | 23 | 10000000 24 | 25 | 26 | 0.1000000E-03 27 | 28 | 29 | 0.1000000E-02 30 | 31 | 32 | 0.5000000E+00 33 | 34 | low 35 | 36 | 100000 37 | 38 | 39 | 40 | 41 | 42 | 0.2072000E+03 43 | 44 | Pb.pz-d-van.UPF 45 | 46 | 47 | 48 | 0.4786700E+02 49 | 50 | Ti.pz-sp-van_ak.UPF 51 | 52 | 53 | 54 | 0.1599940E+02 55 | 56 | O.pz-van_ak.UPF 57 | 58 | 59 | 60 | 61 | 62 | 0.0000000E+00 0.0000000E+00 0.1356871E-02 63 | 64 | 65 | 0.6784353E-01 0.6784353E-01 0.6784353E-01 66 | 67 | 68 | 0.0000000E+00 0.6784353E-01 0.6784353E-01 69 | 70 | 71 | 0.6784353E-01 0.6784353E-01 0.0000000E+00 72 | 73 | 74 | 0.6784353E-01 0.0000000E+00 0.6784353E-01 75 | 76 | 77 | 78 | 79 | 0.1000000E+01 0.0000000E+00 0.0000000E+00 80 | 81 | 82 | 0.0000000E+00 0.1000000E+01 0.0000000E+00 83 | 84 | 85 | 0.0000000E+00 0.0000000E+00 0.1000000E+01 86 | 87 | 88 | 89 | 90 | PZ 91 | 92 | 93 | 94 | false 95 | 96 | 97 | false 98 | 99 | 100 | false 101 | 102 | 103 | 104 | 105 | 25 106 | 107 | 108 | 0.0000000E+00 109 | 110 | fixed 111 | 112 | 113 | 114 | 0.3000000E+02 115 | 116 | 117 | 118 | davidson 119 | plain 120 | 121 | 0.3000000E+00 122 | 123 | 124 | 0.1000000E-11 125 | 126 | 127 | 8 128 | 129 | 130 | 100 131 | 132 | false 133 | false 134 | false 135 | 136 | 0.0000000E+00 137 | 138 | false 139 | 140 | 20 141 | 142 | 143 | 144 | 145 | Uniform grid with offset 146 | 147 | 148 | 149 | none 150 | 151 | false 152 | 153 | 154 | false 155 | 156 | 157 | 158 | none 159 | 0.0 160 | 161 | 0.2762270E+06 162 | 163 | 164 | 0.0000000E+00 165 | 166 | 167 | 1 1 1 168 | 1 1 1 169 | 1 1 1 170 | 171 | 172 | 173 | 174 | false 175 | 176 | 177 | false 178 | 179 | 180 | false 181 | 182 | 183 | false 184 | 185 | 186 | false 187 | 188 | 189 | false 190 | 191 | 192 | 193 | esm 194 | 195 | bc3 196 | 5 197 | 1.2 198 | 0.1 199 | 200 | true 201 | -0.036749 202 | 203 | 204 | 205 | -------------------------------------------------------------------------------- /tests/resources/neb/periodic_dft_65_WaterP1_0_neb_0.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | neb 7 | from_scratch 8 | 50 9 | 4 10 | broyden 11 | no-CI 12 | false 13 | true 14 | 1. 15 | 1.00000e+01 16 | 0.1 17 | 0.1 18 | false 19 | false 20 | 21 | 22 | 23 | periodic_dft_65_WaterP1_0_neb_0 24 | scf 25 | from_scratch 26 | periodic_dft_65_WaterP1_0_neb_0 27 | ./ 28 | ./ 29 | false 30 | false 31 | false 32 | low 33 | 10000000 34 | 50 35 | 1.00000e-05 36 | 1.00000e-03 37 | 5.00000e-01 38 | low 39 | 100000 40 | 41 | 42 | 43 | 1.007940 44 | h_pbe_v0.4.nc.UPF 45 | 0.000000 46 | 47 | 48 | 49 | 50 | 51 | 0.619442 0.000000 0.000000 52 | 53 | 54 | 0.000000 0.000000 0.000000 55 | 56 | 57 | 0.129814 0.000000 0.000000 58 | 59 | 60 | 61 | 12.000007 0.000000 100.000000 62 | 0.000000 12.000007 0.000000 63 | 0.000000 0.000000 12.000007 64 | 65 | 66 | 67 | 68 | 69 | 0.456233 0.000000 0.000000 70 | 71 | 72 | 0.000000 0.000000 0.000000 73 | 74 | 75 | 0.293023 0.000000 0.000000 76 | 77 | 78 | 79 | 12.000007 0.000000 0.000000 80 | 0.000000 12.000007 0.000000 81 | 0.000000 0.000000 12.000007 82 | 83 | 84 | 85 | 86 | 87 | 0.293023 0.000000 0.000000 88 | 89 | 90 | 0.000000 0.000000 0.000000 91 | 92 | 93 | 0.456233 0.000000 0.000000 94 | 95 | 96 | 97 | 12.000007 0.000000 0.000000 98 | 0.000000 12.000007 0.000000 99 | 0.000000 0.000000 12.000007 100 | 101 | 102 | 103 | 104 | 105 | 0.129814 0.000000 0.000000 106 | 107 | 108 | 0.000000 0.000000 0.000000 109 | 110 | 111 | 0.619442 0.000000 0.000000 112 | 113 | 114 | 115 | 12.000007 0.000000 0.000000 116 | 0.000000 12.000007 0.000000 117 | 0.000000 0.000000 12.000007 118 | 119 | 120 | 121 | PZ 122 | 123 | 124 | false 125 | false 126 | false 127 | 128 | 129 | 12 130 | gaussian 131 | 0.000000 132 | -1.000000 133 | smearing 134 | 135 | 136 | false 137 | 40.000000 138 | 200.000000 139 | false 140 | 141 | 142 | davidson 143 | plain 144 | 0.700000 145 | 1.00000e-06 146 | 8 147 | 100 148 | false 149 | false 150 | false 151 | 0.000000 152 | false 153 | 20 154 | 155 | 156 | K-point mesh 157 | 158 | 159 | bfgs 160 | 161 | atomic 162 | none 163 | rescale-v 164 | 4.13414e+01 165 | 3.00000e+02 166 | 100. 167 | 1.00000e+00 168 | 1 169 | 170 | 171 | 172 | bfgs 173 | 0.000000 174 | 2.000000 175 | 176 | 177 | false 178 | false 179 | false 180 | false 181 | false 182 | false 183 | 184 | 185 | 0 1 0 186 | 1 1 1 187 | 1 0 1 188 | 189 | 190 | 191 | 192 | -------------------------------------------------------------------------------- /tests/resources/pw/PbTiO3_BerryPhase.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | PbTiO_3_BerryPhase 7 | nscf 8 | from_scratch 9 | pwscf 10 | /scratch/pdelugas/espresso-xsd/pseudo/ 11 | /scratch/pdelugas/espresso-xsd/tempdir/ 12 | 13 | false 14 | 15 | 16 | false 17 | 18 | 19 | false 20 | 21 | low 22 | 23 | 10000000 24 | 25 | 26 | 0.1000000E-03 27 | 28 | 29 | 0.1000000E-02 30 | 31 | 32 | 0.5000000E+00 33 | 34 | low 35 | 36 | 100000 37 | 38 | 39 | 40 | 41 | 42 | 0.2072000E+03 43 | 44 | Pb.pz-d-van.UPF 45 | 46 | 47 | 48 | 0.4786700E+02 49 | 50 | Ti.pz-sp-van_ak.UPF 51 | 52 | 53 | 54 | 0.1599940E+02 55 | 56 | O.pz-van_ak.UPF 57 | 58 | 59 | 60 | 61 | 62 | 0.0000000E+00 0.0000000E+00 0.1356871E-02 63 | 64 | 65 | 0.6784353E-01 0.6784353E-01 0.6784353E-01 66 | 67 | 68 | 0.0000000E+00 0.6784353E-01 0.6784353E-01 69 | 70 | 71 | 0.6784353E-01 0.6784353E-01 0.0000000E+00 72 | 73 | 74 | 0.6784353E-01 0.0000000E+00 0.6784353E-01 75 | 76 | 77 | 78 | 79 | 0.1000000E+01 0.0000000E+00 0.0000000E+00 80 | 81 | 82 | 0.0000000E+00 0.1000000E+01 0.0000000E+00 83 | 84 | 85 | 0.0000000E+00 0.0000000E+00 0.1000000E+01 86 | 87 | 88 | 89 | 90 | PZ 91 | 92 | 93 | 94 | false 95 | 96 | 97 | false 98 | 99 | 100 | false 101 | 102 | 103 | 104 | 105 | 22 106 | 107 | 108 | 0.0000000E+00 109 | 110 | fixed 111 | 112 | 113 | 114 | 0.3000000E+02 115 | 116 | 117 | 118 | davidson 119 | plain 120 | 121 | 0.3000000E+00 122 | 123 | 124 | 0.1000000E-04 125 | 126 | 127 | 8 128 | 129 | 130 | 100 131 | 132 | 133 | false 134 | 135 | false 136 | false 137 | 138 | 0.0000000E+00 139 | 140 | 141 | false 142 | 143 | 144 | 20 145 | 146 | 147 | 148 | 149 | Uniform grid with offset 150 | 151 | 152 | 153 | none 154 | 155 | false 156 | 157 | 158 | false 159 | 160 | 161 | 162 | none 163 | 0.0 164 | 165 | 0.2762270E+06 166 | 167 | 168 | 0.0000000E+00 169 | 170 | 171 | 1 1 1 172 | 1 1 1 173 | 1 1 1 174 | 175 | 176 | 177 | 178 | false 179 | 180 | 181 | false 182 | 183 | 184 | false 185 | 186 | 187 | false 188 | 189 | 190 | false 191 | 192 | 193 | false 194 | 195 | 196 | 197 | Berry_Phase 198 | 199 | 3 200 | 201 | 202 | 0.0000000E+00 0.0000000E+00 0.0000000E+00 203 | 204 | 205 | 206 | 207 | -------------------------------------------------------------------------------- /tests/resources/pw/Al001_rlx_damp.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | Al001 relaxation with damped dynamics 7 | relax 8 | from_scratch 9 | Al 10 | /scratch/pdelugas/espresso-xsd/pseudo 11 | /scratch/pdelugas/espresso-xsd/tempdir 12 | 13 | false 14 | 15 | 16 | false 17 | 18 | 19 | false 20 | 21 | low 22 | 23 | 10000000 24 | 25 | 26 | 0.1000000E-03 27 | 28 | 29 | 0.1000000E-02 30 | 31 | 32 | 0.5000000E+00 33 | 34 | low 35 | 36 | 100000 37 | 38 | 39 | 40 | 41 | 42 | 0.1000000E+01 43 | 44 | Al.pz-vbc.UPF 45 | 46 | 47 | 48 | 49 | 50 | 0.9428092E-01 0.9428092E-01 -0.4000000E+00 51 | 52 | 53 | 0.0000000E+00 0.0000000E+00 -0.2666666E+00 54 | 55 | 56 | 0.9428092E-01 0.9428092E-01 -0.1333334E+00 57 | 58 | 59 | 0.0000000E+00 0.0000000E+00 0.0000000E+00 60 | 61 | 62 | 0.9428092E-01 0.9428092E-01 0.1333334E+00 63 | 64 | 65 | 0.0000000E+00 0.0000000E+00 0.2666666E+00 66 | 67 | 68 | 0.9428092E-01 0.9428092E-01 0.4000000E+00 69 | 70 | 71 | 72 | 73 | 0.1000000E+01 0.0000000E+00 0.0000000E+00 74 | 75 | 76 | 0.0000000E+00 0.1000000E+01 0.0000000E+00 77 | 78 | 79 | 0.0000000E+00 0.0000000E+00 0.8000000E+01 80 | 81 | 82 | 83 | 84 | PZ 85 | 86 | 87 | 88 | false 89 | 90 | 91 | false 92 | 93 | 94 | false 95 | 96 | 97 | 98 | gaussian 99 | 100 | 0.0000000E+00 101 | 102 | smearing 103 | 104 | 105 | 106 | 0.1200000E+02 107 | 108 | 109 | 110 | davidson 111 | plain 112 | 113 | 0.3000000E+00 114 | 115 | 116 | 0.1000000E-06 117 | 118 | 119 | 8 120 | 121 | 122 | 100 123 | 124 | 125 | false 126 | 127 | false 128 | false 129 | 130 | 0.0000000E+00 131 | 132 | 133 | false 134 | 135 | 136 | 20 137 | 138 | 139 | 140 | 141 | 3 142 | 143 | 144 | 0.1250000E+00 0.1250000E+00 0.0000000E+00 145 | 146 | 147 | 0.1250000E+00 0.3750000E+00 0.0000000E+00 148 | 149 | 150 | 0.3750000E+00 0.3750000E+00 0.0000000E+00 151 | 152 | 153 | 154 | 155 | damp 156 | 157 | 158 | false 159 | 160 | 161 | false 162 | 163 | 164 | 165 | none 166 | 0.0 167 | 168 | 0.6380110E+04 169 | 170 | 171 | 0.0000000E+00 172 | 173 | 174 | 1 1 1 175 | 1 1 1 176 | 1 1 1 177 | 178 | 179 | 180 | 181 | false 182 | 183 | 184 | false 185 | 186 | 187 | false 188 | 189 | 190 | false 191 | 192 | 193 | false 194 | 195 | 196 | false 197 | 198 | 199 | 200 | 1 1 1 201 | 1 1 1 202 | 1 1 1 203 | 1 1 1 204 | 1 1 1 205 | 1 1 1 206 | 1 1 1 207 | 208 | 209 | 210 | -------------------------------------------------------------------------------- /tests/resources/pw/ESM_2Dxy.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | ESM_2Dxy 7 | relax 8 | from_scratch 9 | ESM_2Dxy 10 | ./ 11 | ./ 12 | false 13 | false 14 | false 15 | low 16 | 10000000 17 | 2 18 | 1.00000e-05 19 | 1.00000e-03 20 | 5.00000e-01 21 | low 22 | 100000 23 | 24 | 25 | 26 | 12.010700 27 | c_pbe_v0.4.nc.UPF 28 | 0.000000 29 | 30 | 31 | 1.007940 32 | h_pbe_v0.4.nc.UPF 33 | 0.000000 34 | 35 | 36 | 37 | 38 | 39 | -0.294631 0.191617 -0.125092 40 | 41 | 42 | -0.142720 0.191617 -0.125092 43 | 44 | 45 | -0.066764 0.000000 -0.125092 46 | 47 | 48 | -0.142720 -0.191617 -0.125092 49 | 50 | 51 | -0.294631 -0.191617 -0.125092 52 | 53 | 54 | -0.370587 0.000000 -0.125092 55 | 56 | 57 | 0.097189 0.000000 -0.125092 58 | 59 | 60 | 0.151840 0.000000 0.016330 61 | 62 | 63 | 0.177159 0.191617 0.081847 64 | 65 | 66 | 0.227796 0.191617 0.212881 67 | 68 | 69 | 0.253114 0.000000 0.278398 70 | 71 | 72 | 0.227796 -0.191617 0.212881 73 | 74 | 75 | 0.177159 -0.191617 0.081847 76 | 77 | 78 | -0.353767 0.340800 -0.125092 79 | 80 | 81 | -0.083585 0.340800 -0.125092 82 | 83 | 84 | -0.083585 -0.340800 -0.125092 85 | 86 | 87 | -0.353766 -0.340800 -0.125092 88 | 89 | 90 | -0.488858 0.000000 -0.125092 91 | 92 | 93 | 0.136902 -0.141685 -0.176475 94 | 95 | 96 | 0.136902 0.141685 -0.176475 97 | 98 | 99 | 0.157447 0.340800 0.030838 100 | 101 | 102 | 0.247508 0.340800 0.263889 103 | 104 | 105 | 0.292538 0.000000 0.380415 106 | 107 | 108 | 0.247508 -0.340800 0.263889 109 | 110 | 111 | 0.157447 -0.340800 0.030838 112 | 113 | 114 | 115 | 17.288995 0.000000 0.000000 116 | 0.000000 11.870163 0.000000 117 | 0.000000 0.000000 18.897261 118 | 119 | 120 | 121 | PBE 122 | 123 | 124 | false 125 | false 126 | false 127 | 128 | 129 | 42 130 | gaussian 131 | -0.010000 132 | -1.000000 133 | smearing 134 | 135 | 136 | true 137 | 40.000000 138 | 200.000000 139 | false 140 | 141 | 142 | davidson 143 | plain 144 | 0.700000 145 | 1.00000e-06 146 | 8 147 | 10 148 | false 149 | false 150 | false 151 | 0.000000 152 | false 153 | 20 154 | 155 | 156 | K-point mesh 157 | 158 | 159 | damp 160 | 161 | atomic 162 | none 163 | rescale-v 164 | 4.13414e+01 165 | 3.00000e+02 166 | 100. 167 | 1.00000e+00 168 | 1 169 | 170 | 171 | 172 | damp-pr 173 | 0.000000 174 | 2.000000 175 | 2Dxy 176 | 177 | 178 | true 179 | false 180 | false 181 | false 182 | false 183 | false 184 | 185 | 186 | esm 187 | 188 | bc3 189 | 4 190 | 0.0 191 | 0.0 192 | 193 | 194 | 195 | 1 1 1 196 | 1 1 1 197 | 1 1 1 198 | 1 1 1 199 | 1 1 1 200 | 1 1 1 201 | 1 1 1 202 | 1 1 1 203 | 1 1 1 204 | 1 1 1 205 | 1 1 1 206 | 1 1 1 207 | 1 1 1 208 | 1 1 1 209 | 1 1 1 210 | 1 1 1 211 | 1 1 1 212 | 1 1 1 213 | 1 1 1 214 | 1 1 1 215 | 1 1 1 216 | 1 1 1 217 | 1 1 1 218 | 1 1 1 219 | 1 1 1 220 | 221 | 222 | 223 | --------------------------------------------------------------------------------