Former-commit-id: 877c2c71178212397cdb72e18f54b9a884fb2951
This commit is contained in:
Marek Nečada 2017-07-25 17:10:58 +03:00
parent 0fe13cecc2
commit 22b5cfdd49
3 changed files with 16 additions and 7 deletions

View File

@ -183,6 +183,10 @@ class Scattering(object):
_time_e(btime, verbose)
return ab
class LatticeScattering(Scattering):
def __init__(self, lattice_spec, k_0, zSym = False):
"""
class Scattering_2D_lattice_rectcells(Scattering):
def __init__(self, rectcell_dims, rectcell_elem_positions, cellspec, k_0, rectcell_TMatrices = None, TMatrices = None, lMax = None, verbose=False, J_scat=3):

View File

@ -367,3 +367,9 @@ class TMatrix(TMatrixSpec):
__getitem__ = atfreq # might be changed later, use atfreq to be sure
def perform_tmspecs(tmspecs):
"""Takes a sequence of TMatrixSpec or TMatrix instances and returns
a list of corresponding TMatrix instances"""
return [(tmspec if hasattr(tmspec, "tmdata") else TMatrix(tmspec))
for tmspec in tmspecs]

View File

@ -55,18 +55,17 @@ position: tuple of floats (or similar, such as numpy array).
tmatrix_spec: TMatrixSpec or TMatrix instance.
"""
LatticeSpec = collections.namedtuple('LatticeSpec', ['basis', 'particle_specs', 'subset'])
LatticeSpec = collections.namedtuple('LatticeSpec', ['basis', 'particle_set_specs'])
LatticeSpec.__doc__ = """\
Specification of a lattice, finite or infinite.
basis: tuple of basic vectors (tuples of floats or similar) (or similar,
such as 2d numpy array), preferably of reduced basis.
particle_specs: sequence of ParticleSpecs
subset: For infinite lattices, None. For finite lattices, dictionary whose
keys are the sublattice labels from particle_specs and values are sequences
of (integer) coordinate tuples indicating which scatterers are to be included
to the finite sublattice.
particle_set_specs: sequence of tuples (particle_spec, selection) where
particle_spec is a ParticleSpec and selection is a sequence of 2d integer
coordinates/indices indicating which particles (TODO describe better)
of that type shall be included in a finite lattice. Alternatively,
selection can be None for an infinite lattice.
"""