def test_transition(): X = cse.Cse('O2', dirpath='../../examples/potentials', suffix='.dat', VT=['X3S-1'], en=800) B = cse.Cse('O2', dirpath='../../examples/potentials', suffix='.dat', VT=['B3S-1']) BX = cse.Transition(B, X, dipolemoment=[1]) BX.calculate_xs(transition_energy=[51968,]) npt.assert_almost_equal(BX.wavenumber, 51968.39, decimal=2)
def test_coupled_channel(): X = cse.Cse('O2', dirpath='../../examples/potentials', suffix='.dat', VT=['X3S-1'], en=800) BE = cse.Cse('O2', dirpath='../../examples/potentials', suffix='.dat', VT=['B3S-1', 'E3S-1'], coup=[4000]) BEX = cse.Transition(BE, X, dipolemoment=[1, 0]) # O₂ Longest-band BEX.calculate_xs(transition_energy=np.arange(81300, 81390, 4)) npt.assert_almost_equal(BEX.wavenumber[BEX.xs[:, 0].argmax()], 81344, decimal=0)
import numpy as np import cse import scipy.constants as C from scipy.integrate.quadrature import simps import matplotlib.pyplot as plt # ground state O2X = cse.Cse('16O16O', VT=['potentials/X3S-1.dat'], en=800) O2B = cse.Cse('16O16O', VT=['potentials/B3S-1.dat']) O2 = cse.Transition(O2B, O2X, dipolemoment=['transitionmoments/dipole_b_valence.dat']) R = O2.gs.R # B-X transition energy guesses bands = [ 49357, 50045, 50710, 51352, 51968, 52560, 53123, 53655, 54157, 54622, 55051, 55439, 55785, 56086, 56341, 56551, 56720, 56853, 56955, 57032, 57087, 57121 ] # alternatively evaluate transition energies via calculation # O2.us.levels(vmax=21) # B-state energy levels (cm-1) # print(O2.us) # view levels # bands = np.array(sorted([i[0] for i in O2.us.calc.values()])) - O2.gs.cm # transition energies (cm-1) O2.calculate_xs(transition_energy=bands) osc = O2.xs Yv, Yosc, Yerr = np.loadtxt("data/O2osc-Yoshino.dat", unpack=True)
fexp = np.loadtxt('data/O2osc-Yoshino.dat', unpack=True) # energy ranges for calculation in cm-1 bands = np.array([ 49357.4, 50044.9, 50710, 51351.5, 51968.4, 52559.6, 53122.6, 53655.3, 54156.5, 54622.1, 55051, 55439.5, 55784.8, 56085.6, 56340.7, 56551.1, 56720.1, 56852.7, 56955.2, 57032.5, 57086.9, 57120.7 ]) continuum = np.arange(57300, 85000, 100) # CSE model Schumann-Runge B ^3Sigma_u^- <- X ^3Sigma_g^- single channel ---- O2X = cse.Cse('16O16', VT=['potentials/X3S-1.dat'], en=800) O2B = cse.Cse('16O16', VT=['potentials/B3S-1.dat']) O2bands = cse.Transition( O2B, O2X, dipolemoment=['transitionmoments/dipole_b_valence.dat']) # transition energies may also be determined from the next 2 lines # O2bands.us.levels() # bands = sorted([i[0] for i in O2bands.us.results.values()]) - O2bands.gs.cm # transition energies (cm-1) lb = len(bands) vib = np.arange(lb) # CSE ^3Sigma_u^- valence and Rydbergs coupled channels ------- O2Bcoup = cse.Cse('16O16', VT=[ 'potentials/3S-1v.dat', 'potentials/3S-1r.dat', 'potentials/3S-1r2.dat' ], coup=[4033, 2023, 0])
evcm = 8065.541 # conversion factor eV -> cm-1 wavelength = np.arange(110, 174.1, 0.1) # nm # O2 ground state X X = cse.Cse('O2', VT=['potentials/X3S-1.dat'], en=800) # O2 upper coupled B-state B = cse.Cse('O2', dirpath='potentials', suffix='.dat', VT=['B3S-1', '3P1', 'E3S-1', '3PR1'], coup=[40, 4000, 0, 0, 7000, 0]) # transition BX = cse.Transition(B, X, dipolemoment=[1, 0, 0, 0.3]) print('CSE: calculating cross section speeded by Python multiprocessing' ' Pool.map') print(f' from {wavelength[0]:.0f} to {wavelength[-1]:.0f} in ' f'{wavelength[1]-wavelength[0]:.2f} nm steps ... ') t0 = time.time() BX.calculate_xs(transition_energy=wavelength) print(f'CSE: ... in {time.time()-t0:.2g} seconds') print(f'CSE: E(v"={BX.gs.vib:d}) = {BX.gs.cm:.2f} cm-1, {BX.gs.energy:.3g} eV') # graphics --------------------------------------- ax0 = plt.subplot2grid((2, 4), (0, 0), colspan=2, rowspan=2) ax1 = plt.subplot2grid((2, 4), (0, 2), colspan=2, rowspan=2)
ax0.axis(xmin=0.5, xmax=3, ymin=-10000, ymax=80000) # C2 D-X FCF calculation # published values Sorkhabi et al. J. Molec. Spectrosc. 188, 200-208 (1998) # DXFCF[v", v'] Sorkhabi_FCF = np.array([[0.9972, 2.72e-3, 8.807e-5, 3.676e-7, 5.04e-9], [2.642e-3, 0.9922, 4.842e-3, 2.692e-4, 1.929e-6], [1.644e-4, 4.547e-3, 0.9883, 6.447e-3, 5.494e-4], [5.995e-6, 4.596e-4, 5.846e-3, 0.9847, 8.00e-3], [2.59e-7, 1.76e-8, 0.001, 0.017, 0.9802]]) # CSE calculation --------------------- print("\nCSE FCF calculation -------------------") C2X = cse.Cse('12C12C', VT=[(RX, X1S0)]) C2D = cse.Cse('12C12C', VT=[(RD, D1S0)]) C2 = cse.Transition(C2D, C2X, dipolemoment=[1]) C2.gs.solve(1000) print(f'X(v"={C2.gs.vib:d}) = {C2.gs.cm:10.5f} cm-1') ax0.plot(C2.gs.R, C2.gs.wavefunction.T[0, 0]*4000+C2.gs.energy) # ground state eigenvalues - calculate every vibrational level = slow # C2.gs.levels(4) # enX = C2.gs.results[0][0] # upper state eigenvalues - all levels = slow, but need the accurate # print('calculating upper state eigenvalues, will take a little while ...') # C2.us.levels(4) # vibD = C2.us.results.keys() # enD = np.asarray(list(zip(*C2.us.results.values()))[0])
import numpy as np import cse import matplotlib.pyplot as plt # instance O2X = cse.Cse('16O16O', VT=['potentials/X3S-1.dat'], en=800) O2B = cse.Cse('16O16O', VT=['potentials/B3S-1.dat']) O2 = cse.Transition(O2B, O2X, dipolemoment=[1]) # B-X transition energy guesses bands = [ 49357, 50045, 50710, 51352, 51968, 52560, 53123, 53655, 54157, 54622, 55051, 55439, 55785, 56086, 56341, 56551, 56720, 56853, 56955, 57032, 57087, 57121 ] O2.calculate_xs(transition_energy=bands) osc = O2.xs Kvd, Kvdd, KdE, Kfcf = np.loadtxt("data/O2BX-FCF-Krupenie.dat", unpack=True) Kv0 = int(Kvd[0]) fcf = [] print(r" v' FCF_cse FCF_Krupenie") for v, f in enumerate(osc): f = f[0] * 1.0e6 / bands[v] / 3 fcf.append(f) if v in Kvd: print(f'{v:2d} {f:10.3e} {Kfcf[v-Kv0]:10.3e}') else: