Example #1
0
            if time_fs == t2:
                for i in range(tot_grid):
                    bra_ex[i, :] = np.dot(dipol[:, :], bra_gs[i, :])
                    bra_gs[i, :] = complex(0.0, 0.0)

            # 3- compute the WF after interaction with laser at time t=t3.
            if time_fs == t3:
                for i in range(tot_grid):
                    ket_ex[i, :] = np.dot(dipol[:, :], ket_gs[i, :])
                    ket_gs[i, :] = complex(0.0, 0.0)

            # 4- compute the response function.
            if (time_fs >= t3) and (step == out):
                for i in range(tot_grid):
                    temp[i, :] = np.dot(dipol[:, :], ket_ex[i, :])
                correlation = response(temp[:, 1], bra_gs[:, 1])

                GB_file.write(
                    str(t2) + " " + str(time_fs) + " " +
                    str(np.real(correlation)) + " " +
                    str(np.imag(correlation)) + " " + str(abs(correlation)) +
                    "\n")

            # Compute the bra and ket at time t during the propagation.
            bra_gs, bra_ex = pg.EOF(dt, bra_gs, bra_ex, tot_grid, freq, w_eg,
                                    reorg_erg, d, g, n_fock, freq_cavity)
            ket_gs, ket_ex = pg.EOF(dt, ket_gs, ket_ex, tot_grid, freq, w_eg,
                                    reorg_erg, d, g, n_fock, freq_cavity)

    GB_file.close()
Example #2
0
 ket_ex=np.zeros((tot_grid),dtype=complex)

 temp=np.zeros((tot_grid),dtype=complex)
#------------------------------------------------

#------------------------------------------------
# Run the propagation.

 l_file=open("response.txt", "w+")

 for step in range(t_step):
  time_fs=dt_fs*step
  out=int(step/output)*output

  if step==0:
   ket_ex[:]=coef[:,0].astype(complex)
   bra_gs[:]=coef[:,0].astype(complex)

  if step==out:
   for i in range(tot_grid):
    temp[i]=1.0*ket_ex[i]+0.0*ket_gs[i]
   correlation=response(temp[:],bra_gs[:])
   l_file.write(str(time_fs)+" "+str(np.real(correlation))+ " "+str(np.imag(correlation))+" "+ str(abs(correlation))+ "\n")

  # Compute the bra and ket at time t during the propagation.
  bra_gs,bra_ex=pg.EOF(dt,bra_gs,bra_ex,tot_grid,freq,w_eg,reorg_erg,d)
  ket_gs,ket_ex=pg.EOF(dt,ket_gs,ket_ex,tot_grid,freq,w_eg,reorg_erg,d)

 l_file.close()