예제 #1
0
def test_band_limit_finite_t(
    mol_num,
    j_constant_value,
    elocalex_value,
    ph_info,
    ph_phys_dim,
    evolve_dt,
    nsteps,
    scheme,
):
    ph_list = [
        Phonon.simple_phonon(Quantity(omega, "cm^{-1}"),
                             Quantity(displacement, "a.u."), ph_phys_dim)
        for omega, displacement in ph_info
    ]
    mol_list = MolList(
        [Mol(Quantity(elocalex_value, "a.u."), ph_list)] * mol_num,
        Quantity(j_constant_value, "eV"),
        scheme=scheme,
    )
    ct1 = ChargeTransport(mol_list, stop_at_edge=False)
    ct1.evolve(evolve_dt, nsteps)
    ct2 = ChargeTransport(mol_list, temperature=low_t, stop_at_edge=False)
    ct2.evolve(evolve_dt, nsteps)
    assert ct1.is_similar(ct2)
예제 #2
0
def test_evolve(mol_num, j_constant_value, elocalex_value, ph_info,
                ph_phys_dim, evolve_dt, nsteps):
    ph_list = [
        Phonon.simple_phonon(Quantity(omega, "cm^{-1}"),
                             Quantity(displacement, "a.u."), ph_phys_dim)
        for omega, displacement in ph_info
    ]
    mol_list = MolList(
        [Mol(Quantity(elocalex_value, "a.u."), ph_list)] * mol_num,
        Quantity(j_constant_value, "eV"),
        scheme=3,
    )
    ct1 = ChargeTransport(mol_list, stop_at_edge=False)
    half_nsteps = nsteps // 2
    ct1.evolve(evolve_dt, half_nsteps)
    ct1.evolve(evolve_dt, nsteps - half_nsteps)
    ct2 = ChargeTransport(mol_list, stop_at_edge=False)
    ct2.evolve(evolve_dt, nsteps)
    assert ct1.is_similar(ct2)
    assert_iterable_equal(ct1.get_dump_dict(), ct2.get_dump_dict())

    # test dump
    ct2.dump_dir = "."
    ct2.job_name = "test"
    ct2.dump_dict()
    os.remove("test.npz")
예제 #3
0
def test_similar(mol_num, j_constant_value, elocalex_value, ph_info,
                 ph_phys_dim, evolve_dt, nsteps):
    ph_list = [
        Phonon.simple_phonon(Quantity(omega, "cm^{-1}"),
                             Quantity(displacement, "a.u."), ph_phys_dim)
        for omega, displacement in ph_info
    ]
    mol_list = MolList([Mol(Quantity(elocalex_value, "a.u."), ph_list)] *
                       mol_num,
                       Quantity(j_constant_value, "eV"),
                       scheme=3)
    ct1 = ChargeTransport(mol_list)
    ct1.evolve(evolve_dt, nsteps)
    ct2 = ChargeTransport(mol_list)
    ct2.evolve(evolve_dt + 1e-5, nsteps)
    assert ct1.is_similar(ct2)
예제 #4
0
def test_scheme4_finite_t(mol_num, j_constant_value, elocalex_value, ph_info,
                          ph_phys_dim, evolve_dt, nsteps):
    temperature = Quantity(1, "a.u.")
    ph_list = [
        Phonon.simple_phonon(Quantity(omega, "cm^{-1}"),
                             Quantity(displacement, "a.u."), ph_phys_dim)
        for omega, displacement in ph_info
    ]
    mol_list = MolList([Mol(Quantity(elocalex_value, "a.u."), ph_list)] *
                       mol_num, Quantity(j_constant_value, "eV"))
    ct1 = ChargeTransport(mol_list.switch_scheme(3),
                          temperature=temperature,
                          stop_at_edge=False)
    ct1.evolve(evolve_dt, nsteps)
    ct2 = ChargeTransport(mol_list.switch_scheme(4),
                          temperature=temperature,
                          stop_at_edge=False)
    ct2.evolve(evolve_dt, nsteps)
    assert ct1.is_similar(ct2, rtol=1e-2)
예제 #5
0
def test_compress_add(mol_num, j_constant_value, elocalex_value, ph_info,
                      ph_phys_dim, evolve_dt, nsteps):
    ph_list = [
        Phonon.simple_phonon(Quantity(omega, "cm^{-1}"),
                             Quantity(displacement, "a.u."), ph_phys_dim)
        for omega, displacement in ph_info
    ]
    mol_list = MolList([Mol(Quantity(elocalex_value, "a.u."), ph_list)] *
                       mol_num,
                       Quantity(j_constant_value, "eV"),
                       scheme=3)
    ct1 = ChargeTransport(mol_list, temperature=Quantity(298, "K"))
    ct1.reduced_density_matrices = None
    ct1.evolve(evolve_dt, nsteps)
    ct2 = ChargeTransport(mol_list, temperature=Quantity(298, "K"))
    ct2.reduced_density_matrices = None
    ct2.latest_mps.compress_add = True
    ct2.evolve(evolve_dt, nsteps)
    assert ct1.is_similar(ct2, rtol=1e-2)