示例#1
0
def calcTwoD(loopNum):
    ''' Caculates a 2d spectrum for both perpendicular and parael lasers
    using aceto bands and accurate lineshapes'''

    container = []
    agg = qr.Aggregate(molecules=forAggregate)

    with qr.energy_units('1/cm'):
        for i in range(len(forAggregate)):
            agg.monomers[i].set_energy(1, random.gauss(energy, staticDis))

    agg.set_coupling_by_dipole_dipole(epsr=1.21)
    agg.build(mult=2)
    agg.diagonalize()

    tcalc_para = qr.TwoDResponseCalculator(t1axis=t13, t2axis=t2s, t3axis=t13, system=agg)
    tcalc_para.bootstrap(rwa, pad=padding, verbose=True, lab=labPara, printEigen=False, printResp='paraResp')#, printResp='paraResp'
    twods_para = tcalc_para.calculate()
    paraContainer = twods_para.get_TwoDSpectrumContainer()
    container.append(paraContainer)

    tcalc_perp = qr.TwoDResponseCalculator(t1axis=t13, t2axis=t2s, t3axis=t13, system=agg)
    tcalc_perp.bootstrap(rwa, pad=padding, verbose=True, lab=labPerp, printEigen=False)#, printResp='perpResp'
    twods_perp = tcalc_perp.calculate()
    perpContainer = twods_perp.get_TwoDSpectrumContainer()
    container.append(perpContainer)

    return container
示例#2
0
    def test_TwoDResponseCalculator(self):
        """Testing basic functions of the TwoDSpectrumCalculator class
        
        """
        t1 = qr.TimeAxis(0.0, 1000, 1.0)
        t3 = qr.TimeAxis(0.0, 1000, 1.0)

        t2 = qr.TimeAxis(30, 10, 10.0)

        twod_calc = qr.TwoDResponseCalculator(t1, t2, t3)
示例#3
0
    def twod_setup(self, ax2, ax13):

        self.resp_calc = qr.TwoDResponseCalculator(
            t1axis=ax13,
            t2axis=ax2,
            t3axis=ax13,
            system=self.agg
            )

        self.t1axis = ax13
        self.t2axis = ax2
示例#4
0
def calcTwoD(n_loopsum):  #
    ''' Caculates a 2d spectrum for both perpendicular and parael lasers
    using aceto bands and accurate lineshapes'''

    container = []

    #energies0 = [energy - (100 * num_mol / 2) + i * 100 for i in range(num_mol)]
    #energies0 = [energy] * num_mol
    # Giving random energies to the moleucles according to a gauss dist
    with qr.energy_units("1/cm"):
        for i, mol in enumerate(for_agg):
            mol.set_energy(1, random.gauss(energy, static_dis))
            #mol.set_energy(1, energies0[i])

    agg = qr.Aggregate(molecules=for_agg)
    agg.set_coupling_by_dipole_dipole(epsr=1.21)
    agg.build(mult=2)
    print(np.diagonal(agg.HH[1:num_mol + 1, 1:num_mol + 1]))
    agg.diagonalize()
    rwa = agg.get_RWA_suggestion()

    print(np.diagonal(agg.HH[1:num_mol + 1, 1:num_mol + 1]))

    # Initialising the twod response calculator for the paralell laser
    resp_calc_temp = qr.TwoDResponseCalculator(t1axis=t13_ax,
                                               t2axis=t2_ax,
                                               t3axis=t13_ax,
                                               system=agg)

    # Bootstrap is the place to add 0-padding to the response signal
    # printEigen=True prints eigenvalues, printResp='string' prints response
    # Response is calculated Converted into spectrum Stored in a container
    for lab in labs:
        resp_calc = copy.deepcopy(resp_calc_temp)
        resp_calc.bootstrap(rwa, pad=padding, lab=lab)
        resp_cont = resp_calc.calculate()
        spec_cont = resp_cont.get_TwoDSpectrumContainer()
        container.append(spec_cont)

    return container
示例#5
0
def calcTwoD(n_loopsum):  #
    ''' Caculates a 2d spectrum for both perpendicular and parael lasers
    using aceto bands and accurate lineshapes'''

    resp_container = []

    #energies0 = [energy - (100 * num_mol / 2) + i * 100 for i in range(num_mol)]
    #energies0 = [energy] * num_mol
    # Giving random energies to the moleucles according to a gauss dist
    with qr.energy_units("1/cm"):
        for i, mol in enumerate(for_agg):
            mol.set_energy(1, random.gauss(energy, static_dis))
            #mol.set_energy(1, energies0[i])

    agg = qr.Aggregate(molecules=for_agg)

    agg_rates = copy.deepcopy(agg)
    agg_rates.set_coupling_by_dipole_dipole(epsr=1.21)
    agg_rates.build(mult=2)

    if _forster_:
        KK = agg_rates.get_FoersterRateMatrix()
    else:
        KK = agg_rates.get_RedfieldRateMatrix()
        agg.set_coupling_by_dipole_dipole(epsr=1.21)
    agg.build(mult=2)
    rwa = agg.get_RWA_suggestion()

    HH = agg_rates.get_Hamiltonian()
    pig_ens = np.diagonal(HH.data[1:num_mol+1,1:num_mol+1])\
     / (2.0*const.pi*const.c*1.0e-13)
    en_order = np.argsort(pig_ens)
    SS = HH.diagonalize()
    eig_vecs = np.transpose(SS[1:num_mol + 1, 1:num_mol + 1])
    state_ens = np.diagonal(HH.data[1:num_mol+1,1:num_mol+1])\
     / (2.0*const.pi*const.c*1.0e-13)
    agg_rates.diagonalize()
    dips = agg_rates.D2[0][1:num_mol + 1]
    dip_order = np.flip(np.argsort(dips))

    # Initialising the twod response calculator for the paralell laser
    resp_calc_temp = qr.TwoDResponseCalculator(t1axis=t13_ax,
                                               t2axis=t2_ax,
                                               t3axis=t13_ax,
                                               system=agg,
                                               rate_matrix=KK)

    # keep_resp saves the reponse int he object. write_resp writes to numpy
    # Response is calculated Converted into spectrum Stored in a container
    for i, lab in enumerate(labs):
        resp_calc = copy.deepcopy(resp_calc_temp)
        resp_calc.bootstrap(
            rwa, lab=lab, verbose=False,
            keep_resp=True)  #write_resp = save_dir + las_pol[i] + '_resp',
        resp_cont = resp_calc.calculate()
        resp_container.append(resp_calc.responses)

    state_data = {
        'pig_ens': pig_ens,
        'en_order': en_order,
        'eig_vecs': eig_vecs,
        'state_ens': state_ens,
        'dips': dips,
        'dip_order': dip_order,
        'rwa': rwa
    }

    return resp_container, state_data
示例#6
0
agg_2D.diagonalize()

# laboratory settings
lab = qr.LabSetup()
lab.set_polarizations(pulse_polarizations=(X, X, X), detection_polarization=X)

#
#
#
#
#
#from quantarhei.spectroscopy.mocktwodcalculator \
#    import MockTwoDResponseCalculator as TwoDResponseCalculator
#
#calc = TwoDResponseCalculator(t1_axis, t2_axis, t3_axis)
calc = qr.TwoDResponseCalculator(t1_axis, t2_axis, t3_axis, system=agg_2D)
with qr.energy_units("1/cm"):
    calc.bootstrap(rwa=12100.0, pad=Npad)

#calc.bootstrap(rwa=qr.convert(12100.0,"1/cm","int"), pad=1000)

print("Calculating", Nt2, "spectra")
tcont = calc.calculate()
qr.done_in(True)

tcont = tcont.get_TwoDSpectrumContainer()

T2 = 3 * dt2
twod = tcont.get_spectrum(T2)

### short test of addition of data
示例#7
0
rwa = agg.get_RWA_suggestion()

#agg.diagonalize()

#
# Prepare for calculation of 2D spectra
#

# TimeAxis for t2 waiting time

t2s = qr.TimeAxis(0.0, 10, 20.0)

#
# Set up calculator
#
tcalc = qr.TwoDResponseCalculator(t1axis=ta, t2axis=t2s, t3axis=ta,
                               system=agg)

tcalc.bootstrap(rwa, verbose=True, lab=lab)


#
# Calculate 2D spectra, display and save them
#    

w1_min = rwa_cm - 700.0
w1_max = rwa_cm + 700.0
w3_min = rwa_cm - 700.0
w3_max = rwa_cm + 700.0

window_2D = [w1_min, w1_max, w3_min, w3_max]
t_start = time.time()
示例#8
0
文件: twod.py 项目: foxfoxfox7/mySci
agg = qr.Aggregate(molecules=for_agg)
agg.set_coupling_by_dipole_dipole(epsr=1.21)
agg.build(mult=2)

# Can save the hamiltoniam diag matrix, diaged hamiltonian and dipoles
if _save_:
    myFuncs.save_eigen_data(agg=agg, file=eigen_file)

agg.diagonalize()
rwa = agg.get_RWA_suggestion()
with qr.energy_units('1/cm'):
    print(agg.get_Hamiltonian())

# Initialising the twod response calculator for the paralell laser
resp_cal_para = qr.TwoDResponseCalculator(t1axis=t13_ax,
                                          t2axis=t2_ax,
                                          t3axis=t13_ax,
                                          system=agg)
# Copying the response calculator for the perpendicular laser
resp_cal_perp = copy.deepcopy(resp_cal_para)

# Bootstrap is the place to add 0-padding to the response signal
# printEigen=True prints eigenvalues, printResp='string' prints response
# Response is calculated Converted into spectrum Stored in a container
resp_cal_para.bootstrap(rwa,
                        verbose=True,
                        pad=padding,
                        printResp=para_resp_dir,
                        lab=lab_para)
resp_para_cont = resp_cal_para.calculate()
spec_cont_para = resp_para_cont.get_TwoDSpectrumContainer()