curr1 = np.array([]) curr2 = np.array([]) for WorkFunction in [WorkFunction]: i = 0 for V in Voltages: if (V != 0.0): nV = int(abs(V / eta) + 1) print("Voltage: ", V, "; number of integration steps: ", nV) for eta in [eta]: current0 = PS.dIdV(V, WorkFunction, eta, eigEn, tip_r2, Ratin, coefs, orbs=orbs, s=1.0, px=0.0, py=0.0, pz=0.0) WF_decay = 1 # ( tunnelling barrier changes 1:1 with applied sample bias) current1 = PS.STM(V, nV, WorkFunction, eta, eigEn, tip_r2, Ratin, coefs, orbs=orbs,
didv_b = False STM_b = False states_b = False if ((scan_type == 'didv') or (scan_type == 'dIdV') or (scan_type == 'didv-single')): didv = np.array([ PS.dIdV(V, WorkFunction, eta, eigEn, tip_r, Ratin, coefs, orbs=sample_orbs, s=tc[0], px=tc[1], py=tc[2], pz=tc[3], dz2=tc[4], dxz=tc[5], dyz=tc[6]) ]) didv_b = True WF_decay = 0.0 #print "DEBUG: didv.shape ", didv.shape elif ((scan_type == 'states') or (scan_type == 'STATES')): states = np.sort(eigEn) mask = states >= V states = states[mask]
# print "DEBUG: eigEn.shape ", eigEn.shape # print "DEBUG: coefs.shape ", coefs.shape # print "DEBUG: Ratin.shape ", Ratin.shape print("energies prepared, coeffecients read") # --- the Main calculations --- # # 'didv'='dIdV''='didv-single' -- only dIdV for one voltage = V ; 'v-scan'='V-scan'='Voltage-scan' -- both STM & dIdV scan - V .. Vmax; 'STM'='STM-single' -- STM for one Voltage = V, use V-scan rather # didv_b = False STM_b = False states_b = False if ((scan_type == 'didv') or (scan_type == 'dIdV') or (scan_type == 'didv-single')): didv = np.array([PS.dIdV(V, WorkFunction, eta, eigEn, tip_r, Ratin, coefs, orbs=sample_orbs, s=tc[0], px=tc[1], py=tc[2], pz=tc[3], dz2=tc[4], dxz=tc[5], dyz=tc[6])]) didv_b = True; WF_decay = 0.0; # print "DEBUG: didv.shape ", didv.shape elif ((scan_type == 'states') or (scan_type == 'STATES')): states = np.sort(eigEn); mask = states >= V; states = states[mask]; del mask; mask = states <= V_max; states = states[mask]; del mask; fst = True print("DEBUG: states:", states) for isi in states: if fst: didv = np.array([PS.dIdV(isi, WorkFunction, eta, eigEn, tip_r, Ratin, coefs, orbs=sample_orbs, s=tc[0], px=tc[1], py=tc[2], pz=tc[3], dz2=tc[4], dxz=tc[5], dyz=tc[6])]) fst = False else: didv = np.append(didv, [PS.dIdV(isi, WorkFunction, eta, eigEn, tip_r, Ratin, coefs, orbs=sample_orbs, s=tc[0], px=tc[1], py=tc[2], pz=tc[3], dz2=tc[4], dxz=tc[5], dyz=tc[6])], axis=0)