-
Notifications
You must be signed in to change notification settings - Fork 22
Tutorial TDDFT
Authors: Xavier Andrade and Alfredo Correa
In this tutorial you will learn how to do an Ehrenfest-TDDFT molecular-dynamics simulation with Qball. We will be doing a calculation of electronic stopping of a proton in Aluminum. This is the force that fast particule feels when entering a material.
First, we generate a file with the coordinates of an aluminum supercell with 32 atoms (for actual calculations you probably need a larger cell). Call it al32.sys and copy the following content:
set cell 15.306 0.0 0.0 0.0 15.306 0.0 0.0 0.0 15.306
species aluminum Al.xml
atom Al1 aluminum 0.000000 0.000000 0.000000
atom Al2 aluminum 3.826500 3.826500 0.000000
atom Al3 aluminum 3.826500 0.000000 3.826500
atom Al4 aluminum 0.000000 3.826500 3.826500
atom Al5 aluminum -7.653000 0.000000 0.000000
atom Al6 aluminum -3.826500 3.826500 0.000000
atom Al7 aluminum -3.826500 0.000000 3.826500
atom Al8 aluminum -7.653000 3.826500 3.826500
atom Al9 aluminum 0.000000 -7.653000 0.000000
atom Al10 aluminum 3.826500 -3.826500 0.000000
atom Al11 aluminum 3.826500 -7.653000 3.826500
atom Al12 aluminum 0.000000 -3.826500 3.826500
atom Al13 aluminum 0.000000 0.000000 -7.653000
atom Al14 aluminum 3.826500 3.826500 -7.653000
atom Al15 aluminum 3.826500 0.000000 -3.826500
atom Al16 aluminum 0.000000 3.826500 -3.826500
atom Al17 aluminum 0.000000 -7.653000 -7.653000
atom Al18 aluminum 3.826500 -3.826500 -7.653000
atom Al19 aluminum 3.826500 -7.653000 -3.826500
atom Al20 aluminum 0.000000 -3.826500 -3.826500
atom Al21 aluminum -7.653000 0.000000 -7.653000
atom Al22 aluminum -3.826500 3.826500 -7.653000
atom Al23 aluminum -3.826500 0.000000 -3.826500
atom Al24 aluminum -7.653000 3.826500 -3.826500
atom Al25 aluminum -7.653000 -7.653000 0.000000
atom Al26 aluminum -3.826500 -3.826500 0.000000
atom Al27 aluminum -3.826500 -7.653000 3.826500
atom Al28 aluminum -7.653000 -3.826500 3.826500
atom Al29 aluminum -7.653000 -7.653000 -7.653000
atom Al30 aluminum -3.826500 -3.826500 -7.653000
atom Al31 aluminum -3.826500 -7.653000 -3.826500
atom Al32 aluminum -7.653000 -3.826500 -3.826500
Make sure you understand what the commands in the file do. You will need the Al.xml pseudopotential file.
Now, lets create the input file for a ground state calculation. You could call it gs.i. First, you need to force Qball to use complex wave-functions with the force_complex variable.
set force_complex_wf ON
This is necessary since in TDDFT the wave-functions are always complex.
Then we load the atoms of the aluminum supercell, simply by putting the name of the file
al32.sys
Now we need to add the proton to the system. First you will need a pseudopotential for hydrogen, you can find it here. Place the proton at coordinates 0.00000 1.91325 1.91325 using the atom command. To add an atom without electrons we have to append a + sign to the name of the atom, for example call it "+proton".
Now add the standard commands to set a ground state calculation, using an energy cutoff of 30 Rydberg, a preconditioner cutoff of 4 Rydberg, and a threshold of 1e-6 for 5 steps. If you don't know how to set this, we recommend you to have a look the ground state tutorial.
Since the system is metallic we have to adjust a few parameters. First, we will use the PSDA diagonalizer (wf_dyn variable). We need to add some empty states with
set nempty 12
and now add some smearing with an electronic temperature of 1000 K (0.006333621 Rydberg). This is done with the commands
set smearing fermi
set smearing_width 0.006333621
Finally we reduce a bit the amount of charge mixing with
set charge_mix_coeff 0.6
(the default is 0.5).
We now can randomize the wave-functions and issue the run command, this time we tell qball to do 5 optimization steps per SCF iteration by passing a third value to run as this
run 0 200 5
We still have to add a few command so after the calculation is done, the results are saved to use them as a starting point for the real-time calculation. First we save the coordinates using the savesys command
savesys md.sys
This will generate an file in the Qball input format, that we can load from other input files. Then, we save the wave-functions with the save command
save -states restart/md
This command saves several files, one per state, in the restart/ directory.
You can now go ahead and tell Qball to execute the newly created input file. After it is done, I recommend you to have a look to the md.sys to see what it is saved there.
Now that we have the set of ground-state orbitals, we can setup the real-time calculation. Create a new input file for this, call it td.i.
As before, we need to set the force_complex_wf variable to force Qball to work with complex states.