dudom
Former-commit-id: 877c2c71178212397cdb72e18f54b9a884fb2951
This commit is contained in:
parent
0fe13cecc2
commit
22b5cfdd49
|
@ -183,6 +183,10 @@ class Scattering(object):
|
||||||
_time_e(btime, verbose)
|
_time_e(btime, verbose)
|
||||||
return ab
|
return ab
|
||||||
|
|
||||||
|
class LatticeScattering(Scattering):
|
||||||
|
def __init__(self, lattice_spec, k_0, zSym = False):
|
||||||
|
|
||||||
|
|
||||||
"""
|
"""
|
||||||
class Scattering_2D_lattice_rectcells(Scattering):
|
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):
|
def __init__(self, rectcell_dims, rectcell_elem_positions, cellspec, k_0, rectcell_TMatrices = None, TMatrices = None, lMax = None, verbose=False, J_scat=3):
|
||||||
|
|
|
@ -367,3 +367,9 @@ class TMatrix(TMatrixSpec):
|
||||||
|
|
||||||
__getitem__ = atfreq # might be changed later, use atfreq to be sure
|
__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]
|
||||||
|
|
||||||
|
|
|
@ -55,18 +55,17 @@ position: tuple of floats (or similar, such as numpy array).
|
||||||
tmatrix_spec: TMatrixSpec or TMatrix instance.
|
tmatrix_spec: TMatrixSpec or TMatrix instance.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
LatticeSpec = collections.namedtuple('LatticeSpec', ['basis', 'particle_specs', 'subset'])
|
LatticeSpec = collections.namedtuple('LatticeSpec', ['basis', 'particle_set_specs'])
|
||||||
LatticeSpec.__doc__ = """\
|
LatticeSpec.__doc__ = """\
|
||||||
Specification of a lattice, finite or infinite.
|
Specification of a lattice, finite or infinite.
|
||||||
|
|
||||||
basis: tuple of basic vectors (tuples of floats or similar) (or similar,
|
basis: tuple of basic vectors (tuples of floats or similar) (or similar,
|
||||||
such as 2d numpy array), preferably of reduced basis.
|
such as 2d numpy array), preferably of reduced basis.
|
||||||
|
|
||||||
particle_specs: sequence of ParticleSpecs
|
particle_set_specs: sequence of tuples (particle_spec, selection) where
|
||||||
|
particle_spec is a ParticleSpec and selection is a sequence of 2d integer
|
||||||
subset: For infinite lattices, None. For finite lattices, dictionary whose
|
coordinates/indices indicating which particles (TODO describe better)
|
||||||
keys are the sublattice labels from particle_specs and values are sequences
|
of that type shall be included in a finite lattice. Alternatively,
|
||||||
of (integer) coordinate tuples indicating which scatterers are to be included
|
selection can be None for an infinite lattice.
|
||||||
to the finite sublattice.
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue