コード例 #1
0
ファイル: test_self_energy.py プロジェクト: fyalcin/sisl
def test_real_space_H(setup, k_axis, semi_axis, trs, bz, unfold):
    if k_axis == semi_axis:
        return
    RSE = RealSpaceSE(setup.H, (unfold, unfold, 1))
    RSE.update_option(semi_axis=semi_axis, k_axis=k_axis, dk=100, trs=trs, bz=bz)
    # Initialize and print
    with warnings.catch_warnings():
        warnings.simplefilter('ignore')
        RSE.initialize()

    RSE.green(0.1)
    RSE.self_energy(0.1)
コード例 #2
0
ファイル: test_self_energy.py プロジェクト: fyalcin/sisl
def test_real_space_H_dtype(setup):
    RSE = RealSpaceSE(setup.H, (2, 2, 1))
    RSE.update_option(semi_axis=0, k_axis=1, dk=100)

    with warnings.catch_warnings():
        warnings.simplefilter('ignore')
        RSE.initialize()

    g64 = RSE.green(0.1, dtype=np.complex64)
    g128 = RSE.green(0.1, dtype=np.complex128)
    assert g64.dtype == np.complex64
    assert g128.dtype == np.complex128
    assert np.allclose(g64, g128, atol=1.e-4)

    s64 = RSE.self_energy(0.1, dtype=np.complex64)
    s128 = RSE.self_energy(0.1, dtype=np.complex128)
    assert s64.dtype == np.complex64
    assert s128.dtype == np.complex128
    assert np.allclose(s64, s128, atol=1e-2)