def factory(v1, v2, energy=np.linspace(0, 0.1, 10)): model = pb.Model(graphene.monolayer(), graphene.hexagon_ac(side_width=15), pb.constant_potential(v1), pb.constant_potential(v2)) kpm = pb.greens.kpm(model) return kpm.deferred_ldos(energy, broadening=0.15, position=[0, 0])
def factory(v1, v2, energy=np.linspace(0, 0.1, 10)): model = pb.Model( graphene.monolayer(), graphene.hexagon_ac(side_width=15), pb.constant_potential(v1), pb.constant_potential(v2) ) kpm = pb.greens.kpm(model) return kpm.deferred_ldos(energy, broadening=0.15, position=[0, 0])
def factory(v, energy=np.linspace(0, 0.1, 10)): model = pb.Model(graphene.monolayer(), graphene.hexagon_ac(side_width=15), pb.constant_potential(v)) kpm = pb.kpm(model, kernel=pb.lorentz_kernel()) return kpm.deferred_ldos(energy, broadening=0.15, position=[0, 0], sublattice="B")
import pytest import numpy as np import pybinding as pb from pybinding.repository import graphene models = { 'graphene-pristine': [graphene.monolayer(), pb.rectangle(15)], 'graphene-pristine-oversized': [graphene.monolayer(), pb.rectangle(20)], 'graphene-const_potential': [graphene.monolayer(), pb.rectangle(15), pb.constant_potential(0.5)], 'graphene-magnetic_field': [graphene.monolayer(), pb.rectangle(15), graphene.constant_magnetic_field(1e3)], } @pytest.fixture(scope='module', ids=list(models.keys()), params=models.values()) def model(request): return pb.Model(*request.param) @pytest.fixture(scope='module') def kpm(model): return [pb.greens.kpm(model, optimization_level=i) for i in range(4)] def test_ldos(kpm, baseline, plot_if_fails): energy = np.linspace(0, 2, 25) results = [k.calc_ldos(energy, broadening=0.15, position=(0, 0)) for k in kpm] expected = pb.results.LDOS(energy, baseline(results[0].ldos.astype(np.float32)))
import pytest import numpy as np import pybinding as pb from pybinding.repository import graphene models = { 'graphene-pristine': [graphene.monolayer(), pb.rectangle(15)], 'graphene-pristine-oversized': [graphene.monolayer(), pb.rectangle(20)], 'graphene-const_potential': [graphene.monolayer(), pb.rectangle(15), pb.constant_potential(0.5)], 'graphene-magnetic_field': [ graphene.monolayer(), pb.rectangle(15), graphene.constant_magnetic_field(1e3) ], } @pytest.fixture(scope='module', ids=list(models.keys()), params=models.values()) def model(request): return pb.Model(*request.param) @pytest.fixture(scope='module')