2 Here shall be defined some types that are needed across the individual
3 modules of the qpms package and they do not belong logically to a single
10 class NormalizationT(enum
.IntEnum
):
11 """ Corresponding to the c type qpms_normalization_t from translations.h """
12 KRISTENSSON
=2 # power-normalised, this should be the default in the future
16 class BesselT(enum
.IntEnum
):
17 """ Corresponding to the c type qpms_bessel_t from translations.h """
26 The namedtuples below might become classes or other objects in later versions.
29 TMatrixOp
= collections
.namedtuple('TMatrixOp',
30 ['optype', 'content'])
32 TMatrixSpec
= collections
.namedtuple('TMatrixSpec',
33 ['lMax_override', 'tmatrix_path', 'ops'])
34 TMatrixSpec
.__doc
__ = """\
35 Specification of a to-be-created TMatrix object.
37 lMax_override: int or None. If int and lower than the cutoff degree of the
38 T-Matrix file located at tmatrix_path, lMax_override shall be used instead.
40 tmatrix_path: str. Location of the .TMatrix file to be loaded.
42 ops: sequence of TMatrixOp instances. The operations to be performed on
43 top of the loaded .TMatrix files.
46 ParticleSpec
= collections
.namedtuple('ParticleSpec', ['label', 'position', 'tmatrix_spec'])
47 ParticleSpec
.__doc
___ = """\
48 Specification of an individual scatterer, or a component scatterer
49 of a lattice unit cell.
51 label: immutable (usually a string or None). Unique label of a unit cell
52 component (and the corresponding sublattice).
54 position: tuple of floats (or similar, such as numpy array).
56 tmatrix_spec: TMatrixSpec or TMatrix instance.
59 LatticeSpec
= collections
.namedtuple('LatticeSpec', ['basis', 'particle_set_specs'])
60 LatticeSpec
.__doc
__ = """\
61 Specification of a lattice, finite or infinite.
63 basis: tuple of basic vectors (tuples of floats or similar) (or similar,
64 such as 2d numpy array), preferably of reduced basis.
66 particle_set_specs: sequence of tuples (particle_spec, selection) where
67 particle_spec is a ParticleSpec and selection is a sequence of 2d integer
68 coordinates/indices indicating which particles (TODO describe better)
69 of that type shall be included in a finite lattice. Alternatively,
70 selection can be None for an infinite lattice.