Commit e5daf0b3 authored by Joseph Weston's avatar Joseph Weston
Browse files

prefer 'tosympy=False' rather than constructing explicit Model

This is more idiomatic.
parent c0112080
......@@ -138,8 +138,8 @@ def test_graphene_to_kwant():
syst_from_family = model_to_builder(family, norbs, lat_vecs, atom_coords, coeffs=None)
# Generate using a single Model object
g = sympy.Symbol('g', real=True)
ham = hamiltonian_from_family(family, coeffs=[g])
ham = Model(hamiltonian=ham, momenta=family[0].momenta)
# tosympy=False to return a BlochModel
ham = hamiltonian_from_family(family, coeffs=[g], tosympy=False)
syst_from_model = model_to_builder(ham, norbs, lat_vecs, atom_coords)
# Make the graphene Hamiltonian using kwant only
......@@ -186,8 +186,8 @@ def test_graphene_to_kwant():
family = family + onsites
syst_from_family = model_to_builder(family, norbs, lat_vecs, atom_coords, coeffs=None)
gs = list(sympy.symbols('g0:%d'%3, real=True))
ham = hamiltonian_from_family(family, coeffs=gs)
ham = Model(hamiltonian=ham, momenta=family[0].momenta)
# tosympy=False to return a BlochModel
ham = hamiltonian_from_family(family, coeffs=gs, tosympy=False)
syst_from_model = model_to_builder(ham, norbs, lat_vecs, atom_coords)
def onsite_A(site, c1):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment