Esempio n. 1
0
def test_energy_window_4(simple_eigenvals):  # pylint: disable=redefined-outer-name
    assert np.isclose(
        diff.calculate(
            *simple_eigenvals,
            symmetric_eigenval_weights=False,
            weight_eigenval=diff.energy_window(2.9, 4.1)
        ), 1 / 2
    )
Esempio n. 2
0
def test_energy_window_3(simple_eigenvals):  # pylint: disable=redefined-outer-name
    assert np.isclose(
        diff.calculate(*simple_eigenvals,
                       weight_eigenval=diff.energy_window(2.9, 4.1)), 1 / 3)
Esempio n. 3
0
def test_nonzero_diff(simple_eigenvals):  # pylint: disable=redefined-outer-name
    assert np.isclose(diff.calculate(*simple_eigenvals), 1 / 4)
Esempio n. 4
0
def test_zero_diff(sample):
    eigenvals = bi.io.load(sample('silicon_bands.hdf5'))
    assert np.isclose(diff.calculate(eigenvals, eigenvals), 0)