### DFT+U Tutorial: Basic Setup Source: https://docs.abinit.org/tutorial/dftu This is the initial setup for the DFT+U tutorial, defining spin polarization, structural parameters, and k-point grid. It is used as a base for subsequent examples. ```Abinit Input #Spin nsppol 1 nspden 2 nspinor 1 spinat 0 0 1 0 0 -1 0 0 0 0 0 0 #Parameters nstep 50 ecut 15 pawecutdg 30 toldfe 1.0d-8 nband 40 occopt 7 tsmear 0.015 #Structural parameters natom 4 ntypat 2 typat 1 1 2 2 znucl 28 8 xred 0 0 0 0.0 0.0 0.5 0.5 0.5 0.25 0.5 0.5 0.75 acell 3*7.92 rprim 0.0 1/2 1/2 1/2 0.0 1/2 1.0 1.0 0.0 # Kpoint Grid ngkpt 2 2 2 chksymbreak 0 # The k point grid is not symmetric, but the calculations being for the ground-state, this is not a problem. pp_dirpath "$ABI_PSPDIR" pseudos "Psdj_paw_pbe_std/Ni.xml, Psdj_paw_pbe_std/O.xml" ############################################################## # This section is used only for regression testing of ABINIT # ############################################################## #%% #%% [setup] #%% executable = abinit #%% [files] #%% files_to_test = #%% tdftu_1.abo, tolnlines= 4, tolabs= 2.000e-06, tolrel= 2.000e-03, fld_options = -medium #%% output_file = "tdftu_1.abo" #%% [paral_info] #%% max_nprocs = 1 #%% [extra_info] #%% authors = Unknown #%% keywords = DFTU, PAW #%% description = first run of the DFT+U tutorial #%% ``` -------------------------------- ### Example Input File for Ghost State Analysis Source: https://docs.abinit.org/tutorial/paw2 This is an example input file used to demonstrate the presence and resolution of ghost states in ATOMPAW calculations. It serves as a starting point for troubleshooting. ```input view tutorial/paw2_assets/Ni.ghost.atompaw.input ``` -------------------------------- ### Install ABINIT Source: https://docs.abinit.org/INSTALL_MacOS Install ABINIT to the system. This step is optional. ```bash make install ``` -------------------------------- ### PAW2 Tutorial Test Setup Source: https://docs.abinit.org/tutorial/paw2 This snippet outlines the setup for the PAW2 tutorial regression test. It specifies the executable, files to test with tolerance parameters, output file, and parallel processing information. ```bash #%% #%% [setup] #%% executable = abinit #%% [files] #%% files_to_test = #%% tpaw2_2.abo, tolnlines= 25, tolabs= 1.1e-1, tolrel= 5.0e-1, fld_options=-easy #%% output_file = "tpaw2_2.abo" #%% [paral_info] #%% max_nprocs = 6 #%% [extra_info] #%% authors = M. Torrent #%% keywords = PAW #%% description = #%% Input for PAW2 tutorial #%% Nickel ferromagnetic fcc structure #%% Testing ecut convergence #%% ``` -------------------------------- ### Input File Path Example Source: https://docs.abinit.org/tutorial/paw2 Specifies an input file path for a test case related to the RSO tutorial. ```text tests/tutorial/Input/tpaw2_1.abi ``` -------------------------------- ### RSO Configuration Example Source: https://docs.abinit.org/tutorial/paw2 This snippet shows a basic configuration for the Real Space Optimization (RSO) method, including numerical parameters and output format selection. ```text 3 0. troulliermartins 2.0 2.0 2.0 2.0 2.0 2.0 XMLOUT default END ``` -------------------------------- ### Install ATOMPAW using Homebrew (macOS) Source: https://docs.abinit.org/tutorial/paw2 Installs the ATOMPAW package on macOS using the Homebrew package manager. ```bash brew install atompaw/repo/atompaw ``` -------------------------------- ### Close Command Example Source: https://docs.abinit.org/tutorial/paw2 Demonstrates the 'Close' command, likely used to finalize or exit a process related to the RSO configuration. ```text Close ``` -------------------------------- ### AtomPaw Calculation Summary Source: https://docs.abinit.org/tutorial/paw2 Example output from an AtomPaw calculation, showing a summary of PAW energies. This output is used to assess the convergence and accuracy of the calculation. ```text Summary of PAW energies Total valence energy -185.18230027710337 Smooth energy 11.634042318422193 One center -196.81634259552555 Smooth kinetic 15.117782033814152 Vloc energy -2.8024659321861067 Smooth exch-corr -3.3712015132649102 One-center xc -123.08319475096027 ``` -------------------------------- ### Partial-Waves Basis - Generation Scheme (Bloechl) Source: https://docs.abinit.org/tutorial/paw2 Specifies the generation scheme for pseudo partial waves and projectors. 'bloechl' is used as a starting point. ```atompaw bloechl ``` -------------------------------- ### ABINIT Output: Total Energy Convergence (RRKJ Pseudization) Source: https://docs.abinit.org/tutorial/paw2 This output shows the total energy convergence using the RRKJ pseudization scheme. It indicates improved convergence compared to the initial Bloechl projector setup. ```text ecut1 8.00000000E+00 Hartree ecut2 1.00000000E+01 Hartree ecut3 1.20000000E+01 Hartree ecut4 1.40000000E+01 Hartree ecut5 1.60000000E+01 Hartree ecut6 1.80000000E+01 Hartree ecut7 2.00000000E+01 Hartree ecut8 2.20000000E+01 Hartree etotal1 -3.9599860476E+01 etotal2 -3.9626919903E+01 etotal3 -3.9627249378E+01 etotal4 -3.9627836846E+01 etotal5 -3.9628304332E+01 etotal6 -3.9628429611E+01 etotal7 -3.9628436662E+01 etotal8 -3.9628455467E+01 ``` -------------------------------- ### MPICH Installation Confirmation Message Source: https://docs.abinit.org/tutorial/abinit_build Example output message indicating where libraries have been installed and how to link against them. ```text ---------------------------------------------------------------------- Libraries have been installed in: /home/gmatteo/local/lib If you ever happen to want to link against installed libraries in a given directory, LIBDIR, you must either use libtool, and specify the full pathname of the library, or use the '-LLIBDIR' flag during linking and do at least one of the following: - add LIBDIR to the 'LD_LIBRARY_PATH' environment variable during execution - add LIBDIR to the 'LD_RUN_PATH' environment variable during linking - use the '-Wl,-rpath -Wl,LIBDIR' linker flag - have your system administrator add LIBDIR to '/etc/ld.so.conf' See any operating system documentation about shared libraries for more information, such as the ld(1) and ld.so(8) manual pages. ---------------------------------------------------------------------- ``` -------------------------------- ### Setup Calculation Directory Source: https://docs.abinit.org/tutorial/z2pack Navigate to the tutorial directory, create a working subdirectory, and copy the initial ABINIT input file. ```bash cd $ABI_TESTS/tutoplugs/Input mkdir Work_z2pack && cd Work_z2pack cp ../tz2_2.abi . ``` -------------------------------- ### Core and Valence Electron Designation Source: https://docs.abinit.org/tutorial/paw2 Designates shells as core ('c') or valence ('v'). This example marks 1s, 2s, 3s, 2p as core and 4s, 4p, 3d as valence. ```atompaw c c c v c c v v ``` -------------------------------- ### Wannier90 Configuration File Example Source: https://docs.abinit.org/tutorial/wannier90 Example content for a configuration file (myconf.ac9) to enable Wannier90 support during ABINIT compilation. It specifies the installation path for the PSML I/O library. ```shell #Install prefix of the PSML I/O library (e.g. # /usr/local). with_wannier90="/usr/local" ``` -------------------------------- ### Setup Working Directory and Copy Input File Source: https://docs.abinit.org/tutorial/dmft_triqs Navigate to the tutorial input directory, create a new working folder, and copy the initial ABINIT input file for the calculation. ```bash cd $ABI_TESTS/tutoparal/Input mkdir Work_dmft_triqs cd Work_dmft_triqs cp ../tdmft_triqs_1.abi . ``` -------------------------------- ### Setup Working Directory and Copy Input File Source: https://docs.abinit.org/tutorial/gw2 Creates a new directory for the GW2 calculations, changes into it, and copies the necessary input file. This is the initial setup step for the tutorial. ```bash mkdir Work_gw2 cd Work_gw2 cp $ABI_TESTS/tutorial/Input/tgw2_1.abi . ``` -------------------------------- ### Get gfortran Version Source: https://docs.abinit.org/tutorial/abinit_build Retrieves the version information for the installed GNU Fortran compiler. ```bash gfortran --version GNU Fortran (GCC) 5.3.1 20160406 (Red Hat 5.3.1-6) Copyright (C) 2015 Free Software Foundation, Inc. ``` -------------------------------- ### Set up Input Directory and Files Source: https://docs.abinit.org/tutorial/elastic Navigate to the input directory, create a working directory, and copy the necessary input file. ```bash cd $ABI_TESTS/tutorespfn/Input mkdir Work_elast cd Work_elast cp ../telast_1.abi . ``` -------------------------------- ### Setting up Working Directory and Input File Source: https://docs.abinit.org/tutorial/base4 Prepare a working directory for the tutorial, copy the input file, and navigate into the directory. This sets up the environment for running the ABINIT calculation. ```shell cd $ABI_TESTS/tutorial/Input mkdir Work4 cd Work4 cp ../tbase4_1.abi . ``` -------------------------------- ### Install ABINIT Dependencies via MacPorts Source: https://docs.abinit.org/INSTALL_MacOS Install essential libraries for ABINIT using MacPorts, including GCC, OpenBLAS, OpenMPI, FFTW, HDF5, NetCDF, and libxc. This example uses GCC 11. ```bash sudo port install gcc11 sudo port install OpenBLAS +gcc11+fortran sudo port install openmpi-gcc11 +gfortran sudo port install fftw-3 +gfortran sudo port install fftw-3-single +gfortran sudo port install fftw-3-long +gfortran sudo port install hdf5 +cxx+gcc11+hl+openmpi sudo port install netcdf +cdf5+dap+x+gcc11+netcdf4+openmpi sudo port install netcdf-fortran +gcc11+openmpi sudo port install libxc4 +gcc11 ``` -------------------------------- ### Setting up Working Directory and Input File Source: https://docs.abinit.org/tutorial/base3 Prepare a working directory for the tutorial calculations and copy the necessary input file. This involves changing directories, creating a new directory, and copying the input file. ```shell cd $ABI_TESTS/tutorial/Input mkdir Work3 cd Work3 cp ../tbase3_1.abi . ``` -------------------------------- ### ABINIT File Header Example Source: https://docs.abinit.org/tutorial/eph4zpr An example of the ABINIT file header, showing various parameters such as code version, system dimensions, perturbation case, and energy cutoffs. This information is crucial for understanding the calculation setup. ```text =============================================================================== ECHO of part of the ABINIT file header First record : .codvsn,headform,fform = 9.2.0 80 111 Second record : bantot,intxc,ixc,natom = 480 0 11 2 ngfft(1:3),nkpt = 32 32 32 40 nspden,nspinor = 1 1 nsppol,nsym,npsp,ntypat = 1 48 2 2 occopt,pertcase,usepaw = 1 4 0 ecut,ecutdg,ecutsm = 3.5000000000E+01 3.5000000000E+01 0.0000000000E+00 ecut_eff = 3.5000000000E+01 qptn(1:3) = 5.0000000000E-01 0.0000000000E+00 0.0000000000E+00 rprimd(1:3,1) = 0.0000000000E+00 4.0182361526E+00 4.0182361526E+00 rprimd(1:3,2) = 4.0182361526E+00 0.0000000000E+00 4.0182361526E+00 rprimd(1:3,3) = 4.0182361526E+00 4.0182361526E+00 0.0000000000E+00 stmbias,tphysel,tsmear = 0.0000000000E+00 0.0000000000E+00 1.0000000000E-02 The header contain 4 additional records. ``` -------------------------------- ### Navigate to Tutorial Directory Source: https://docs.abinit.org/tutorial/base3 Change the current directory to the ABINIT tutorial work directory and copy the input file for the k-point convergence study. ```bash cd $ABI_TESTS/tutorial/Work3 cp ../tbase3_3.abi . ``` -------------------------------- ### Setup Working Directory and Copy Input Files Source: https://docs.abinit.org/tutorial/lruj Navigate to the tutorial input directory, create a working directory for LRUJ calculations, and copy the necessary input files. ```bash cd $ABI_TESTS/tutorial/Input mkdir work_lruj cd work_lruj cp ../tlruj_1.abi . cp ../tlruj_2.abi . ``` -------------------------------- ### Example of Negative getXXX Variable Usage Source: https://docs.abinit.org/variables/files This example illustrates how a negative value for a 'get' variable indicates the number of datasets to go backward to find the needed file. It refers to dataset 2 when dataset 4 is initialized. ```fortran ndtset 3 jdtset 1 2 4 getXXX -1 ``` -------------------------------- ### Configure NetCDF-Fortran Prefix (Detailed) Source: https://docs.abinit.org/developers/autoconf_examples Specifies the installation prefix for the NetCDF-Fortran library, including version details. This path should be accurate for your setup. ```shell with_netcdf_fortran="${FALLBACKS_HOME}_10.6/${FB}/netcdf4_fortran/4.6.2" ``` -------------------------------- ### Range Object Example Source: https://docs.abinit.org/developers/abimkdocs This YAML-like structure defines a range of values from start to stop, used for default values in Abinit input files. ```yaml !range start: 1 stop: N ``` -------------------------------- ### Example Configuration File Syntax Source: https://docs.abinit.org/tutorial/abinit_build Illustrates the syntax for an ABINIT configuration file, showing how to normalize configure options and use shell variables. ```text # -------------------------------------------------------------------------- # ``` -------------------------------- ### Create and Navigate to Working Directory Source: https://docs.abinit.org/tutorial/eph4vpq Prepare a working directory for tutorial execution by creating a subdirectory and navigating into it. ```shell cd $ABI_TESTS/tutorespfn/Input mkdir Work_eph4vpq cd Work_eph4vpq ``` -------------------------------- ### Relaxed Ion Calculation Setup Source: https://docs.abinit.org/tutorial/polarization This section indicates the start of a calculation for relaxed-ion piezoelectric constants. It uses the same Berry phase method and dataset configuration as the clamped-ion calculation. ```abinit # Finite difference calculation of the relaxed ion # piezoelectric constants of AlP # # The calculation proceeds by computing the change in cell # polarization by a Berrys phase formula, due to changes # in the strain of the unit cell. In this case, the ion positions # will be allowed to relax to to their new equilibrium positions # within the strain cell. # Berry phase calculation of the polarization # berryopt -1 triggers the implementation of M. Viethen berryopt -1 # three cell geometries will be computed ndtset 3 #Definition of the unit cell acell 3*7.2728565836E+00 # rprim = strain tensor x rprim0, where # rprim0 is the unstrained rprim ``` -------------------------------- ### Timing Results for Different Distributions Source: https://docs.abinit.org/tutorial/paral_bandpw Example output showing the processor timing for various `npband` x `npfft` configurations. This data is used to determine the most efficient setup. ```text tparal_bandpw_02.04.16.abo:- Proc. 0 individual time (sec): cpu= 62.9 wall= 69.4 tparal_bandpw_02.08.08.abo:- Proc. 0 individual time (sec): cpu= 57.9 wall= 64.0 tparal_bandpw_02.16.04.abo:- Proc. 0 individual time (sec): cpu= 56.0 wall= 61.8 tparal_bandpw_02.32.02.abo:- Proc. 0 individual time (sec): cpu= 57.1 wall= 62.8 tparal_bandpw_02.64.01.abo:- Proc. 0 individual time (sec): cpu= 60.7 wall= 66.4 ``` -------------------------------- ### Setup Working Directory and Copy Input Files Source: https://docs.abinit.org/tutorial/eph_tdep_legacy Prepare a working directory for the Abinit calculation by creating a subdirectory and copying necessary input files. ```bash cd ~/abinit/tests/tutorespfn/Input mkdir Work cd Work cp ../teph_tdep_legacy*in . ``` -------------------------------- ### Set up Input Directory and Copy File Source: https://docs.abinit.org/tutorial/base2 Navigate to the input directory, create a new working directory, and copy the necessary input file. ```bash cd $ABI_TESTS/tutorial/Input mkdir Work2 cd Work2 cp ../tbase2_1.abi . ``` -------------------------------- ### Plane-Wave Basis and k-point Grid Setup Source: https://docs.abinit.org/tutorial/paw1 Defines the kinetic energy cut-off for plane waves and the PAW double grid, and specifies the k-point grid generation. This example uses a 10x10x10 grid. ```abinit ecut 20.0 ecutsm 0.5 pawecutdg 50. kptopt 1 ngkpt 10 10 10 nshiftk 4 shiftk 0.5 0.5 0.5 0.5 0.0 0.0 0.0 0.5 0.0 0.0 0.0 0.5 ``` -------------------------------- ### ABINIT Parallelization Output Example Source: https://docs.abinit.org/tutorial/paral_bandpw This output shows a sample of ABINIT's suggested processor distributions for parallel execution, based on the number of CPUs. It includes columns for np_spkpt, npfft, npband, bandpp, #MPI(proc), and WEIGHT, guiding the user to select an optimal configuration. ```text Searching for all possible proc distributions for this input with #CPUs<=64: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | np_spkpt| npfft| npband| bandpp| #MPI(proc)| WEIGHT| | 1<< 1| 1<< 22| 1<< 64| 1<< 640| 1<< 64| <= 64| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | 1| 4| 16| 10| 64| 42.328| | 1| 8| 8| 20| 64| 41.844| | 1| 16| 4| 40| 64| 41.730| | 1| 6| 10| 16| 60| 40.093| | 1| 15| 4| 40| 60| 39.054| | 1| 4| 16| 8| 64| 39.043| | 1| 12| 5| 32| 60| 39.026| | 1| 8| 8| 16| 64| 38.598| | 1| 16| 4| 32| 64| 38.493| | 1| 3| 20| 8| 60| 38.319| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Only the best possible choices for nproc are printed... ``` -------------------------------- ### Create and Navigate to Working Directory Source: https://docs.abinit.org/tutorial/eph4zpr Prepare a working directory for tutorial execution. This involves changing to the input directory, creating a new subdirectory for the tutorial, and then navigating into it. ```shell cd $ABI_TESTS/tutorespfn/Input mkdir Work_eph4zpr cd Work_eph4zpr ``` -------------------------------- ### BSE Input File Example for Crystalline Silicon Source: https://docs.abinit.org/tutorial/bse This input file demonstrates the setup for a Bethe-Salpeter Equation (BSE) calculation for crystalline silicon. It includes steps for ground-state calculation, NSCF runs for WFK file generation on symmetric and symmetry-breaking k-meshes, and SCR calculation for the screening matrix. ```input # Crystalline silicon # Preparatory run for BS calculations # # There are four datasets specified in this input: # 1) Ground-state calculation to get the density. # 2) NSCF run to generate the WFK file on a symmetric k-mesh (4x4x4, gamma-centered) # 3) NSCF run to generate another WFK file on a shifted 4x4x4 k-mesh that breaks the symmetry of the BZ sampling # 4) SCR calculation with the WFK file generated in the second dataset # ndtset 4 # Definition of the k-point grid kptopt 1 # Option for the automatic generation of k points, ngkpt 4 4 4 # This mesh is too coarse for optical properties. nshiftk 1 shiftk 0.0 0.0 0.0 # Gamma-centered k-mesh # Dataset1: self-consistent calculation # tolvrs1 1.0d-8 prtden1 1 # Dataset2: definition of parameters for the calculation of the WFK file on the symmetric k-mesh. # iscf2 -2 # NSCF run getden2 1 # Read previous density file tolwfr2 1.0d-8 nband2 105 # bands treated in the CG algorithm nbdbuf2 5 # The last five states are excluded from the converge check # to facilitate the convergence # Dataset3: calculation of the WFK file on the shifted k-mesh to break the symmetry. # iscf3 -2 getden3 1 tolwfr3 1.0d-8 nband3 15 # Here we can reduce the number of bands since this WFK file # will be used to construct the transition space nbdbuf3 5 chksymbreak3 0 # To skip the check on the k-mesh. shiftk3 0.11 0.21 0.31 # This shift breaks the symmetry of the k-mesh. # Dataset3: creation of the screening (eps^-1) matrix # optdriver4 3 gwpara4 2 inclvkb4 2 awtr4 1 symchi4 1 getwfk4 2 ecuteps4 6 ecutwfn4 12 nband4 100 # This value leads to well converged QP energies, see the first GW tutorial nfreqre4 1 # Only the static limit is needed for standard BSE calculations. nfreqim4 0 # VARIABLES COMMON TO THE DIFFERENT DATASETS # Definition of the unit cell: fcc acell 3*10.217 # This is equivalent to 10.217 10.217 10.217 rprim 0.0 0.5 0.5 # FCC primitive vectors (to be scaled by acell) 0.5 0.0 0.5 0.5 0.5 0.0 # Definition of the atom types ntypat 1 # There is only one type of atom znucl 14 # The keyword "zatnum" refers to the atomic number of the # possible type(s) of atom. The pseudopotential(s) # mentioned in the "files" file must correspond # to the type(s) of atom. Here, the only type is Silicon. # Definition of the atoms natom 2 # There are two atoms typat 1 1 # They both are of type 1, that is, Silicon. xred # Reduced coordinate of atoms 0.0 0.0 0.0 0.25 0.25 0.25 ``` -------------------------------- ### Prepare Working Directory and Copy Input File Source: https://docs.abinit.org/tutorial/gwr1 Create a dedicated working directory for the tutorial and copy the initial input file (tgwr_1.abi) into it. This sets up the environment for the first calculation step. ```shell mkdir Work_gwr cd Work_gwr cp ../tgwr_1.abi . ``` -------------------------------- ### List Installed Libraries Source: https://docs.abinit.org/tutorial/abinit_build Lists the OpenBLAS library files installed in the lib directory of the local installation. This confirms successful installation. ```bash ls $HOME/local/lib/libopenblas* ``` -------------------------------- ### Setup Spin Calculation Directory Source: https://docs.abinit.org/tutorial/spin Prepare the working directory and copy the input file for the spin tutorial. This sets up the environment for the calculation. ```bash cd $ABI_TESTS/tutorial/Input mkdir Work_spin cd Work_spin cp ../tspin_1.abi . ```