Ejemplo n.º 1
0
def redfield_relaxation(self):
    print("Redfield rate calculation")

    #
    # Correlation function
    #
    params = {
        "ftype": world.ctype,
        "reorg": world.reorg,
        "cortime": world.ctime,
        "T": world.temp,
        "matsubara": world.mats
    }

    # FIXME: also time_units, temperature_units
    with energy_units(world.e_units):
        cf = CorrelationFunction(world.ta, params)

    #
    # Homodimer
    #
    with energy_units(world.h_units):
        en = world.senergy
        m1 = Molecule([0.0, en], "mol1")
        m2 = Molecule([0.0, en], "mol2")
#        m3 = Molecule("mol2", [0.0, en])

    m1.set_egcf((0, 1), cf)
    m2.set_egcf((0, 1), cf)
    #    m3.set_egcf((0,1), cf)

    agg = Aggregate(name="Homodimer")

    agg.add_Molecule(m1)
    agg.add_Molecule(m2)
    #    agg.add_Molecule(m3)

    #    with energy_units("1/cm"):
    #        Hm = m1.get_Hamiltonian()
    #        print(Hm)
    #        print(m.convert_energy_2_current_u(Hm._data))

    with energy_units(world.r_units):
        agg.set_resonance_coupling(0, 1, world.r_coupl)


#        agg.set_resonance_coupling(1,2,world.r_coupl)

    agg.build()

    H = agg.get_Hamiltonian()

    #    with energy_units("1/cm"):
    #        print(H)
    #        print(m.convert_energy_2_current_u(H._data))

    sbi = agg.get_SystemBathInteraction()

    RRM = RedfieldRateMatrix(H, sbi)

    world.K12 = numpy.real(RRM.data[1, 2])

    dim = H.dim
    rates_M = numpy.zeros(dim * dim)
    k = 0
    for i in range(dim):
        for j in range(dim):
            rates_M[k] = RRM.data[i, j]
            k += 1

    world.rates_M = rates_M
Ejemplo n.º 2
0
def redfield_tensor(self):
    print("Redfield tensor calculation")

    #
    # Correlation function
    #
    params = {
        "ftype": world.ctype,
        "reorg": world.reorg,
        "cortime": world.ctime,
        "T": world.temp,
        "matsubara": world.mats
    }

    # FIXME: also time_units, temperature_units
    with energy_units(world.e_units):
        cf = CorrelationFunction(world.ta, params)

    #
    # Homodimer
    #
    with energy_units(world.h_units):
        en = world.senergy
        m1 = Molecule("mol1", [0.0, en])
        m2 = Molecule("mol2", [0.0, en])

    m1.set_egcf((0, 1), cf)
    m2.set_egcf((0, 1), cf)

    agg = Aggregate("Homodimer")

    agg.add_Molecule(m1)
    agg.add_Molecule(m2)

    #    m = Manager()
    ##
    #    with energy_units("1/cm"):
    #        Hm = m1.get_Hamiltonian()
    #        print(Hm)
    #        print(m.convert_energy_2_current_u(Hm._data))

    with energy_units(world.r_units):
        agg.set_resonance_coupling(0, 1, world.r_coupl)

    agg.build()

    H = agg.get_Hamiltonian()
    world.HH = H

    ##
    #    with energy_units("1/cm"):
    #        print(H)
    #        print(m.convert_energy_2_current_u(H._data))

    sbi = agg.get_SystemBathInteraction()

    H.protect_basis()
    with eigenbasis_of(H):
        RRT = RedfieldRelaxationTensor(H, sbi)

        dim = H.dim
        rates_T = numpy.zeros(dim * dim)
        k = 0

        world.K12 = numpy.real(RRT.data[1, 1, 2, 2])
        for i in range(dim):
            for j in range(dim):
                rates_T[k] = numpy.real(RRT.data[i, i, j, j])
                k += 1

    world.rates_T = rates_T
Ejemplo n.º 3
0
    

SS = H.diagonalize()
H.undiagonalize()

print("\nHamiltonian in internal units")
print(H)

print("\nTransformation matrix")
print(SS)

print("\nAll states")
k = 0
for st in ag.allstates(mult=mult, save_indices=True):
    print(st[0], ag.elsigs[k])
    k += 1

sbi = ag.get_SystemBathInteraction()
cfm = sbi.CC
print("\nReorganization energies")
for ic in range(cfm.nof):
    with energy_units("1/cm"):
        print(ic, cfm.cfuncs[ic+1].get_reorganization_energy())
    
print("\nSBI:")
print(sbi)

print(ag)

print(ag.which_band)
print(ag.vibindices)
Ejemplo n.º 4
0
#plt.title('aggregate: 12 perylenes, linear dense zigzag ')
#plt.savefig('L12per_pbl_spec.pdf')

plt.show()

with energy_units("1/cm"):
    aAnth.plot(axis=[10000,15000,0.0,1.1])


# Redfield Tensor 
print("Calculating relaxation tensor ...")
start = tm.time()
# System bath interaction
#sbi = AG.get_system_bath_coupling()
sbi = AG.get_SystemBathInteraction()
# Hamiltonian 
HH = AG.get_Hamiltonian()

# Relaxation tensor
RT = RedfieldRelaxationTensor(HH,sbi)
#RT = TDRedfieldRelaxationTensor(HH,sbi)
RT.secularize()
print("... done in ",tm.time()-start)

#for n in range(4):
#    print(numpy.real(RT.data[n,n,5,5]))
#
#RR = RedfieldRateMatrix(HH,sbi)
#for n in range(4):
#    print(numpy.real(RR.data[n,5]))    
Ejemplo n.º 5
0
    print(D.data[0, 3, :])

SS = H.diagonalize()
H.undiagonalize()

print("\nHamiltonian in internal units")
print(H)

print("\nTransformation matrix")
print(SS)

print("\nAll states")
k = 0
for st in ag.allstates(mult=mult, save_indices=True):
    print(st[0], ag.elsigs[k])
    k += 1

sbi = ag.get_SystemBathInteraction()
cfm = sbi.CC
print("\nReorganization energies")
for ic in range(cfm.nof):
    with energy_units("1/cm"):
        print(ic, cfm.cfuncs[ic + 1].get_reorganization_energy())

print("\nSBI:")
print(sbi)

print(ag)

print(ag.which_band)
print(ag.vibindices)
Ejemplo n.º 6
0
def redfield_relaxation(self):
    print("Redfield rate calculation")

    
    #
    # Correlation function
    #
    params = {"ftype":    world.ctype,
              "reorg":    world.reorg,
              "cortime":  world.ctime,
              "T":        world.temp,
              "matsubara":world.mats}
              
    # FIXME: also time_units, temperature_units
    with energy_units(world.e_units):
        cf = CorrelationFunction(world.ta,params) 

    
    #
    # Homodimer
    #
    with energy_units(world.h_units):
        en = world.senergy
        m1 = Molecule([0.0, en],"mol1")
        m2 = Molecule([0.0, en], "mol2")
#        m3 = Molecule("mol2", [0.0, en])
        
    m1.set_egcf((0,1), cf)
    m2.set_egcf((0,1), cf)
#    m3.set_egcf((0,1), cf) 
    
    agg = Aggregate(name="Homodimer")
    
    agg.add_Molecule(m1)
    agg.add_Molecule(m2)
#    agg.add_Molecule(m3)
    
#    with energy_units("1/cm"):
#        Hm = m1.get_Hamiltonian()
#        print(Hm)
#        print(m.convert_energy_2_current_u(Hm._data)) 
        
    with energy_units(world.r_units):
        agg.set_resonance_coupling(0,1,world.r_coupl)
#        agg.set_resonance_coupling(1,2,world.r_coupl)
        
    agg.build()
    
    H = agg.get_Hamiltonian()

#    with energy_units("1/cm"):
#        print(H)
#        print(m.convert_energy_2_current_u(H._data))    
    
    sbi = agg.get_SystemBathInteraction()
        
    RRM = RedfieldRateMatrix(H, sbi)
    
    world.K12 = numpy.real(RRM.data[1,2])
    
    dim = H.dim
    rates_M = numpy.zeros(dim*dim)
    k = 0
    for i in range(dim):
        for j in range(dim):
            rates_M[k] = RRM.data[i,j]
            k += 1
            
    world.rates_M = rates_M
Ejemplo n.º 7
0
def redfield_tensor(self):
    print("Redfield tensor calculation")

    
    #
    # Correlation function
    #
    params = {"ftype":    world.ctype,
              "reorg":    world.reorg,
              "cortime":  world.ctime,
              "T":        world.temp,
              "matsubara":world.mats}
              
    # FIXME: also time_units, temperature_units
    with energy_units(world.e_units):
        cf = CorrelationFunction(world.ta,params) 

    
    #
    # Homodimer
    #
    with energy_units(world.h_units):
        en = world.senergy
        m1 = Molecule([0.0, en], "mol1")
        m2 = Molecule([0.0, en], "mol2")
        
    m1.set_egcf((0,1), cf)
    m2.set_egcf((0,1), cf)
        
    agg = Aggregate(name="Homodimer")
    
    agg.add_Molecule(m1)
    agg.add_Molecule(m2)
    
#    m = Manager()
##
#    with energy_units("1/cm"):
#        Hm = m1.get_Hamiltonian()
#        print(Hm)
#        print(m.convert_energy_2_current_u(Hm._data)) 
        
    with energy_units(world.r_units):
        agg.set_resonance_coupling(0,1,world.r_coupl)
        
    agg.build()
    
    H = agg.get_Hamiltonian()
    world.HH = H

##
#    with energy_units("1/cm"):
#        print(H)
#        print(m.convert_energy_2_current_u(H._data))    
    
    sbi = agg.get_SystemBathInteraction()
    
    H.protect_basis()
    with eigenbasis_of(H):    
        RRT = RedfieldRelaxationTensor(H, sbi)
    
        dim = H.dim
        rates_T = numpy.zeros(dim*dim)
        k = 0

        world.K12 = numpy.real(RRT.data[1,1,2,2])
        for i in range(dim):
            for j in range(dim):
                rates_T[k] = numpy.real(RRT.data[i,i,j,j])
                k += 1
                
    world.rates_T = rates_T