Пример #1
0
def main():
    nsite = 2
    nbath = 2

    kB = 0.69352  # in cm-1 / K
    kT = kB * 300.0
    hbar = 5308.8  # in cm-1 * fs

    # System Hamiltonian
    ham_sys = np.array([[100.0, 100.0], [100.0, 0.0]])

    # System part of the the system-bath interaction
    # - a list of length 'nbath'
    # - currently assumes that each term has uncorrelated bath operators
    ham_sysbath = []
    ham_sysbath.append(np.array([[1.0, 0.0], [0.0, 0.0]]))
    ham_sysbath.append(np.array([[0.0, 0.0], [0.0, 1.0]]))

    # Initial reduced density matrix of the system
    rho_0 = np.array([[1.0, 0.0], [0.0, 0.0]])

    for lamda in [100. / 50, 100. / 5, 100., 500.]:
        for tau_c in [100., 500.]:
            omega_c = 1.0 / tau_c  # in 1/fs
            # Spectral densities - a list of length 'nbath'
            spec_densities = [['ohmic-lorentz', lamda, omega_c]] * nbath

            my_ham = ham.Hamiltonian(ham_sys,
                                     ham_sysbath,
                                     spec_densities,
                                     kT,
                                     hbar=hbar)

            for method in ['Redfield', 'TCL2']:
                my_redfield = redfield.Redfield(my_ham, method=method)
                times, rhos_site, rhos_eig = my_redfield.propagate(
                    rho_0, 0.0, 1000.0, 1.0)

                with open(
                        'pop_site_%s_tau-%0.1f_lam-%0.2f.dat' %
                    (method, tau_c, lamda), 'w') as f:
                    for (time, rho_site,
                         rho_eig) in zip(times, rhos_site, rhos_eig):
                        f.write(
                            '%0.8f %0.8f %0.8f\n' %
                            (time, rho_site[0, 0].real, rho_site[1, 1].real))
Пример #2
0
def main():
    nsite = 2
    nbath = 1

    # System Hamiltonian
    ham_sys = np.array([[1.0, 1.0], [1.0, -1.0]])

    # System part of the the system-bath interaction
    # - a list of length 'nbath'
    # - currently assumes that each term has uncorrelated bath operators
    ham_sysbath = []
    ham_sysbath.append(np.array([[1.0, 0.0], [0.0, -1.0]]))

    # Initial reduced density matrix of the system
    rho_0 = np.array([[1.0, 0.0], [0.0, 0.0]])

    for alpha in [0.1, 0.2, 0.4]:
        # Spectral densities - a list of length 'nbath'
        omega_c = 7.5
        lamda = alpha * omega_c / 2.0
        spec_densities = [['ohmic-exp', lamda, omega_c]] * nbath
        kT = 0.2

        my_ham = ham.Hamiltonian(ham_sys, ham_sysbath, spec_densities, kT)

        for method in ['Redfield', 'TCL2', 'TC2']:
            if method == 'Redfield':
                is_secular = True
            else:
                is_secular = False
            my_redfield = redfield.Redfield(my_ham,
                                            method=method,
                                            is_secular=is_secular)
            times, rhos_site, rhos_eig = my_redfield.propagate(
                rho_0, 0.0, 14.0, 0.05)

            with open('pop_site_%s_alpha-%0.2f.dat' % (method, alpha),
                      'w') as f:
                for (time, rho_site, rho_eig) in zip(times, rhos_site,
                                                     rhos_eig):
                    f.write('%0.8f %0.8f %0.8f\n' %
                            (time, rho_site[0, 0].real, rho_site[1, 1].real))
Пример #3
0
def main():
    nsite = 1 + 2
    nbath = 2

    eps = 0.

    # System Hamiltonian
    # n = 0 is ground state
    ham_sys = np.array([[0., 0., 0.], [0., eps, -1.], [0., -1., eps]])

    # System part of the the system-bath interaction
    ham_sysbath = []
    for n in range(1, nsite):
        ham_sysbath_n = np.zeros((nsite, nsite))
        ham_sysbath_n[n, n] = 1.0
        ham_sysbath.append(ham_sysbath_n)

    rho_g = np.zeros((nsite, nsite))
    rho_g[0, 0] = 1.0

    # Dipole operator connecting the ground state to the excited states
    dipole = np.array([[0., 1., 1.], [1., 0., 0.], [1., 0., 0.]])

    lamda = 0.5
    omega_c = 1.0
    beta = 3.0
    kT = 1. / beta
    spec_densities = [['ohmic-lorentz', lamda, omega_c]] * nbath

    my_ham = ham.Hamiltonian(ham_sys, ham_sysbath, spec_densities, kT)

    my_redfield = redfield.Redfield(my_ham, method='Redfield', is_secular=True)
    dt = 0.05
    t_final = 50.0

    my_spec = spec.Spectroscopy(dipole, my_redfield)
    omegas, intensities = my_spec.absorption(-4. + eps, 4. + eps, 0.02, rho_g,
                                             0., t_final, dt)

    with open('abs_omegac-%0.1f_beta-%0.1f.dat' % (omega_c, beta), 'w') as f:
        for (omega, intensity) in zip(omegas, intensities):
            f.write('%0.8f %0.8f\n' % (omega - eps, intensity))
Пример #4
0
def main():
    nsite = 3
    nbath = 2

    eps = 0.
    ham_sys = np.array([[0., 0., 0.], [0., eps, -1.], [0., -1., eps]])

    ham_sysbath = []
    for n in range(1, nsite):
        ham_sysbath_n = np.zeros((nsite, nsite))
        ham_sysbath_n[n, n] = 1.0
        ham_sysbath.append(ham_sysbath_n)

    rho_g = np.zeros((nsite, nsite))
    rho_g[0, 0] = 1.0

    dipole = np.array([[0., 1., 1.], [1., 0., 0.], [1., 0., 0.]])

    lamda = 1. / 2
    for omega_c in [0.1, 0.3, 1.0]:
        for beta in [1.0, 3.0]:
            kT = 1. / beta
            spec_densities = [['ohmic-lorentz', lamda, omega_c]] * nbath
            my_ham = ham.Hamiltonian(ham_sys, ham_sysbath, spec_densities, kT)

            for method in ['HEOM', 'TL', 'TNL']:
                emin, emax, de = -4 + eps, 4 + eps, 0.02
                t_final = 50.0
                dt = 0.05
                if method == 'HEOM':
                    # These are a bit underconverged; they are TNL(N=8) in the paper.
                    for L in [4]:
                        for K in [1]:
                            my_method = heom.HEOM(my_ham, L=L, K=K)
                            my_spec = spec.Spectroscopy(dipole, my_method)
                            omegas, intensities = my_spec.absorption(
                                emin, emax, de, rho_g, t_final, dt)

                            with open(
                                    'abs_omegac-%0.1f_beta-%0.1f_HEOM_L-%d_K-%d.dat'
                                    % (omega_c, beta, L, K), 'w') as f:
                                for (omega,
                                     intensity) in zip(omegas, intensities):
                                    f.write('%0.8f %0.8f\n' %
                                            (omega - eps, intensity))
                else:
                    if method == 'TL':
                        my_method = redfield.Redfield(my_ham, method='TCL2')
                    else:
                        my_method = redfield.Redfield(my_ham, method='TC2')
                        t_final = 100.0

                    my_spec = spec.Spectroscopy(dipole, my_method)
                    omegas, intensities = my_spec.absorption(
                        emin, emax, de, rho_g, t_final, dt)

                    with open(
                            'abs_omegac-%0.1f_beta-%0.1f_%s.dat' %
                        (omega_c, beta, method), 'w') as f:
                        for (omega, intensity) in zip(omegas, intensities):
                            f.write('%0.8f %0.8f\n' % (omega - eps, intensity))
Пример #5
0
def main():
    nbath = 2

    kB = 0.69352  # in cm-1 / K
    kT = kB * 300.0
    hbar = 5308.8  # in cm-1 * fs

    # System Hamiltonian
    ham_sys = np.array([[100.0, 100.0], [100.0, 0.0]])

    # System part of the the system-bath interaction
    # - a list of length 'nbath'
    # - currently assumes that each term has uncorrelated bath operators
    ham_sysbath = []
    ham_sysbath.append(np.array([[1.0, 0.0], [0.0, 0.0]]))
    ham_sysbath.append(np.array([[0.0, 0.0], [0.0, 1.0]]))

    # Initial reduced density matrix of the system
    rho_0 = np.array([[1.0, 0.0], [0.0, 0.0]])

    for lamda in [100. / 50, 100. / 5, 100., 500.]:
        for tau_c in [100., 500.]:
            omega_c = 1.0 / tau_c  # in 1/fs

            # Spectral densities - a list of length 'nbath'
            spec_densities = [['ohmic-lorentz', lamda, omega_c]] * nbath

            #TODO(TCB): Make this cleaner. Write a Hamiltonian.copy() method?
            my_ham = ham.Hamiltonian(ham_sys,
                                     ham_sysbath,
                                     spec_densities,
                                     kT,
                                     hbar=hbar)
            my_ham_slow = ham.Hamiltonian(ham_sys,
                                          ham_sysbath,
                                          spec_densities,
                                          kT,
                                          hbar=hbar)
            my_ham_fast = ham.Hamiltonian(ham_sys,
                                          ham_sysbath,
                                          spec_densities,
                                          kT,
                                          hbar=hbar)

            ntraj = int(1e3)
            my_frozen = frozen.FrozenModes(my_ham_slow, nmode=300, ntraj=ntraj)
            times, rhos_site, rhos_eig = my_frozen.propagate(
                rho_0, 0.0, 1000.0, 1.0)
            my_redfield = redfield.Redfield(my_ham_fast, method='Redfield')

            my_hybrid = hybrid.Hybrid(my_ham,
                                      my_frozen,
                                      my_redfield,
                                      omega_split=None)
            times, rhos_site, rhos_eig = my_hybrid.propagate(
                rho_0, 0.0, 1000.0, 1.0)

            with open(
                    'pop_site_tau-%0.1f_lam-%0.2f_ntraj-%d.dat' %
                (tau_c, lamda, ntraj), 'w') as f:
                for (time, rho_site, rho_eig) in zip(times, rhos_site,
                                                     rhos_eig):
                    f.write('%0.8f %0.8f %0.8f\n' %
                            (time, rho_site[0, 0].real, rho_site[1, 1].real))
Пример #6
0
def main():
    nsite = 7
    nbath = 7

    kB = 0.69352  # in cm-1 / K
    hbar = 5308.8  # in cm-1 * fs

    # System Hamiltonian in cm-1
    ham_sys = np.array([[12410, -87.7, 5.5, -5.9, 6.7, -13.7, -9.9],
                        [-87.7, 12530, 30.8, 8.2, 0.7, 11.8, 4.3],
                        [5.5, 30.8, 12210, -53.5, -2.2, -9.6, 6.0],
                        [-5.9, 8.2, -53.5, 12320, -70.7, -17.0, -63.3],
                        [6.7, 0.7, -2.2, -70.7, 12480, 81.1, -1.3],
                        [-13.7, 11.8, -9.6, -17.0, 81.1, 12630, 39.7],
                        [-9.9, 4.3, 6.0, -63.3, -1.3, 39.7, 12440]])

    # System part of the the system-bath interaction
    # - a list of length 'nbath'
    # - currently assumes that each term has uncorrelated bath operators
    ham_sysbath = []
    for n in range(nbath):
        ham_sysbath_n = np.zeros((nsite, nsite))
        ham_sysbath_n[n, n] = 1.0
        ham_sysbath.append(ham_sysbath_n)

    for method in ['Redfield', 'TCL2', 'TC2']:
        # Spectral densities - a list of length 'nbath'
        lamda = 35.0
        for [tau, T] in [[50., 77.], [50., 300.], [166., 300.]]:
            omega_c = 1.0 / tau  # in 1/fs
            kT = kB * T
            spec_densities = [['ohmic-lorentz', lamda, omega_c]] * nbath

            my_ham = ham.Hamiltonian(ham_sys,
                                     ham_sysbath,
                                     spec_densities,
                                     kT,
                                     hbar=hbar)

            my_redfield = redfield.Redfield(my_ham, method=method)

            for init in [1, 6]:
                # Initial reduced density matrix of the system
                rho_0 = np.zeros((nsite, nsite))
                rho_0[init - 1, init - 1] = 1.0
                times, rhos_site, rhos_eig = my_redfield.propagate(
                    rho_0, 0.0, 1000.0, 1.0, markov_time=3 * tau)

                with open(
                        'pop_site_%s_tau-%.0f_T-%.0f_init-%d.dat' %
                    (method, tau, T, init), 'w') as f:
                    for (time, rho_site) in zip(times, rhos_site):
                        f.write('%0.8f ' % (time))
                        for i in range(nsite):
                            f.write('%0.8f ' % (rho_site[i, i].real))
                        f.write('\n')

                with open(
                        'pop_eig_%s_tau-%.0f_T-%.0f_init-%d.dat' %
                    (method, tau, T, init), 'w') as f:
                    for (time, rho_eig) in zip(times, rhos_eig):
                        f.write('%0.8f ' % (time))
                        for i in range(nsite):
                            f.write('%0.8f ' % (rho_eig[i, i].real))
                        f.write('\n')