<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=utf-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <pre>Hi,

I had too the issue with starting random velocities.
I think I've fixed it in the merge request <a class="moz-txt-link-freetext" href="https://gitlab.com/QEF/q-e/merge_requests/189">https://gitlab.com/QEF/q-e/merge_requests/189</a>, can you please give it a try?


Regarding the reading of the velocities from the input:
the documentation was wrong, because the units of the velocities were not correctly stated, it was corrected few months ago. I think that it works also without CG.
But please note that after manually setting the velocities you should do a step of CG, that in fact does two steps in this case
(one with the starting ions position and one with the position updated with the new velocities), to set the initial wavefunction velocity to a reasonable value with respect to the ions velocities.
In my experience, if you don't do this, the kinetic energy that the wfc gain at the end is bigger than the kinetic energy that you get with the electron velocities calculated in the "correct" way.

Note also that in the new version, I added an option "change_step" also for the electron_velocities when you change step. This was a little modification to allow a smoother change
(before the electron velocities was not updated if the timestep changed, increasing the kinetic energy of the electrons that were no more moving, in some sense, following the ions).
</pre>
    <table style="border-color: #b5b500; border-style: solid;
      border-width: 2; margin-bottom: 10; table-layout: auto;
      background-color: #FFFFFF;" width="100%">
      <tbody>
        <tr>
          <th style="background: #ffff99; padding: 2 2 2 10; "
            width="20%" valign="top" align="left">electron_velocities</th>
          <td style="text-align: left; vertical-align: top; background:
            #ffffc3; padding: 2 2 2 5; ">CHARACTER</td>
        </tr>
        <tr>
          <td colspan="2" valign="top" align="left">
            <blockquote>
              <pre style="margin-bottom: -1em;">'zero'      : restart setting electronic velocities to zero
'default'   : restart using electronic velocities of the
            previous run
'change_step' : restart simulation using electronic velocities of the
            previous run, with rescaling due to the timestep change.
            specify the old step via tolp as in
            tolp = 'old_time_step_value' in au.
            Note that you may want to specify
             ion_velocities = 'change_step'
         </pre>
            </blockquote>
          </td>
        </tr>
      </tbody>
    </table>
    <pre>
Note also that the change of dt is correctly implemented in the autopilot module
(so, it is not necessary to use a restart file, and you can change easily dt on the fly and try more values of it)


Best regards



Riccardo Bertossa


<blockquote type="cite"><pre>Quoting GIUSEPPE MATTIOLI</pre></blockquote><blockquote type="cite"><pre><pre>Hi Paolo and Eduardo
</pre>I would like to add some consideration, because I have a similar  
problem. I'm going to simulate the subtraction of one electron from a  
thermalized system. To do this, in previous cp.x versions (up to  
4.3.2, AFAIK), it was possible to: 1) run a cp.x dynamics  
(electrons+ions) with tot_charge=0.0; 2) minimize the electrons with  
tot_charge=+1.0 using the last geometry saved in the previous run; 3a)  
restart a new cp.x dynamics (electrons+ions) by using wavefunctions  
optimized in step 2) and the last velocities saved in step 1)  
(ion_velocities='from_input'), and run a few steps with a short dt to  
assess the equilibration of the dynamics; 3b) restart again  
(ion_velocities='change_step') by using the same dt as in 1).

However, it is apparently not possible in recent versions, as the cp.x  
manual states that

                    'from_input'  : restart the simulation with atomic  
velocities read
                                    from standard input - see card  
'ATOMIC_VELOCITIES'
                                    BEWARE: works only if  
restart_mode='from_scratch',
                                    tested only with electrons_dynamics='cg'

As long as you know what you are doing, the simulation of oxidation or  
reduction processes in thermalized systems was a desirable feature of  
cp.x...
Best
Giuseppe


Quoting Paolo Giannozzi <<a href="https://lists.quantum-espresso.org/mailman/listinfo/users">p.giannozzi at gmail.com</a>>:

><i> Hi Eduardo
</i>><i>
</i>><i> apparently ions_velocities="random" does not set random initial velocities,
</i>><i> but  velocity rescaling. Not sure why. In any event: I am not sure that
</i>><i> starting the CP dynamics from ground-state positions and electrons and
</i>><i> nonzero initial velocities is a good idea.
</i>><i>
</i>><i> Paolo
</i>><i>
</i>><i> On Sun, Oct 14, 2018 at 8:21 PM Eduardo Menendez <<a href="https://lists.quantum-espresso.org/mailman/listinfo/users">eariel99 at gmail.com</a>> wrote:
</i>><i>
</i>>><i> Hi,
</i>>><i> I am unable to start a MD with CP with random velocities setting an
</i>>><i> initial temperature, using QE 6.3. Reading the input description I
</i>>><i> understood that I could start it using              ion_velocities =
</i>>><i> 'random', tempw= starting T. However, I always start with 0 temperature.
</i>>><i>
</i>>><i> This is my output
</i>>><i> &CONTROL
</i>>><i>                  calculation = 'cp' ,
</i>>><i>                 restart_mode = 'restart' ,
</i>>><i>                   pseudo_dir = './' ,
</i>>><i>                         outdir='./tmp',
</i>>><i>                         wfcdir='./tmp',
</i>>><i>                         prefix='mapi',
</i>>><i>                         nstep = 500,
</i>>><i>                            dt = 4.13413733424,
</i>>><i>             ndr = 51,
</i>>><i>             ndw = 51,
</i>>><i>             iprint =50,
</i>>><i>             isave = 50,
</i>>><i> /
</i>>><i> &SYSTEM
</i>>><i>                          ibrav=0,
</i>>><i>                        celldm(1)=1.889726132885 ,
</i>>><i>                           nat=768,
</i>>><i>                         ntyp=5,
</i>>><i>                         ecutwfc=35.0  ! 50,
</i>>><i>                      ecutrho=200.0 ,  ! 180,
</i>>><i>                     input_dft = 'pbesol',
</i>>><i>               nr1b=21, nr2b=21, nr3b=21,  ! nr1b=(2*r_cut)/(Lx)*nr1
</i>>><i>                           nbnd = 1700,
</i>>><i> /
</i>>><i> &ELECTRONS
</i>>><i>                         conv_thr = 1.0e-5,
</i>>><i> !  options for CP
</i>>><i>             emass = 400.d0, ! default, Mosconi et al,PCCP 16,16137 (2014),
</i>>><i> doi: 10.1039/C4CP00569D
</i>>><i>             emass_cutoff = 2.5d0, ! default
</i>>><i>             electron_dynamics = 'verlet' ,
</i>>><i>
</i>>><i> /
</i>>><i>  &IONS
</i>>><i>                 ion_dynamics = 'verlet' , !  'verlet' ,
</i>>><i> !             ion_temperature = 'not_controlled',
</i>>><i>              ion_velocities = 'random',
</i>>><i>                        tempw = 600.0 ,
</i>>><i>  /
</i>>><i> &CELL
</i>>><i>                 cell_dynamics = 'none'
</i>>><i> /
</i>>><i> In the output I read
</i>>><i>    Ionic position will be re-read from restart file
</i>>><i>    All atoms are allowed to move
</i>>><i>    Ionic temperature control via canonical velocities rescaling :
</i>>><i>    temperature required =  600.00000K, tolerance =  100.00000K
</i>>><i> ......
</i>>><i>   nfi     ekinc              temph  tempp     etot
</i>>><i> enthal               econs                econt              vnhh
</i>>><i> xnhh0   vnhp    xnhp0
</i>>><i>       5    0.000002129555068    0.0    0.00  -12738.991035174058
</i>>><i> -12738.991035174058  -12738.991033373713  -12738.991031244159   0.0000
</i>>><i> 0.0000   0.0000   0.0000
</i>>><i>       6    0.000005713182507    0.0    0.00  -12738.991057915813
</i>>><i> -12738.991057915813  -12738.991042309621  -12738.991036596439   0.0000
</i>>><i> 0.0000   0.0000   0.0000
</i>>><i>
</i>>><i> nfi begins at 5 because there were 4 previous steepest descent dynamics
</i>>><i> (ould I reset the nfi counter? ), which got the wfc from a PWSCF
</i>>><i> self-consistent run.
</i>>><i>
</i>>><i> Thanks,
</i>>><i>
</i>>><i> Eduardo Menendez Proupin
</i>>><i> University of Chile
</i>>><i> <a class="moz-txt-link-abbreviated" href="http://www.gnm.cl/emenendez">www.gnm.cl/emenendez</a>
</i>>><i> _______________________________________________
</i>>><i> users mailing list
</i>>><i> <a href="https://lists.quantum-espresso.org/mailman/listinfo/users">users at lists.quantum-espresso.org</a>
</i>>><i> <a href="https://lists.quantum-espresso.org/mailman/listinfo/users">https://lists.quantum-espresso.org/mailman/listinfo/users</a>
</i>><i>
</i>><i>
</i>><i>
</i>><i> --
</i>><i> Paolo Giannozzi, Dip. Scienze Matematiche Informatiche e Fisiche,
</i>><i> Univ. Udine, via delle Scienze 208, 33100 Udine, Italy
</i>><i> Phone +39-0432-558216, fax +39-0432-558222
</i>


GIUSEPPE MATTIOLI
CNR - ISTITUTO DI STRUTTURA DELLA MATERIA
Via Salaria Km 29,300 - C.P. 10
I-00015 - Monterotondo Scalo (RM)
Mob (*preferred*) +39 373 7305625
Tel + 39 06 90672342 - Fax +39 06 90672316
E-mail: <<a href="https://lists.quantum-espresso.org/mailman/listinfo/users">giuseppe.mattioli at ism.cnr.it</a>></pre>


</blockquote>

</pre>
  </body>
</html>