pyextal.potentialMap.structureFactors ===================================== .. py:module:: pyextal.potentialMap.structureFactors .. autoapi-nested-parse:: Refined structure factors, extended over a beam set by symmetry. A refinement run stores structure factors only for the reflections it refined. A map needs a value for every beam it sums, so each beam is resolved, in order: 1. ``refined``: the beam is symmetry-equivalent to a refined reflection. Its value is the refined one times the translation phase between the two (a glide or screw axis shifts the phase of equivalent beams, Waser, Acta Cryst. 1955; the same convention as `pyextal.symmetry.GroupSymmetry`). 2. ``friedel``: the beam's Friedel mate -g is case 1, so F(g) = conj(F(-g)). 3. ``model``: anything else takes the model value -- by default the ``.dat``'s own structure factor (`pyextal.callBloch.lookupSF`). With ``symmetry_constraint='Friedel'`` there is no space-group grouping: a refined value applies to its own hkl and, conjugated, to -hkl. Classes ------- .. autoapisummary:: pyextal.potentialMap.structureFactors.LayerSF pyextal.potentialMap.structureFactors.MapContext Functions --------- .. autoapisummary:: pyextal.potentialMap.structureFactors.lattice_vectors pyextal.potentialMap.structureFactors._translation_phase pyextal.potentialMap.structureFactors.setup Module Contents --------------- .. py:function:: lattice_vectors(cell) Cartesian direct-lattice vectors (rows a, b, c) in Angstrom. a along x, b in the xy plane -- the convention VESTA and VASP use. :param cell: a, b, c (Angstrom), alpha, beta, gamma (degrees). :type cell: sequence :returns: (3, 3), one lattice vector per row. :rtype: np.ndarray .. py:function:: _translation_phase(sym, hkl) Phase of F(hkl) relative to its symmetry group's first member. ``F(hkl) = F(group[0]) * exp(1j * phase)``. Computed from the symmetry operations rather than read from ``sym.phaseDict``, which only holds beams that occur in the Ugh table. .. py:class:: LayerSF One layer's refined structure factors, resolvable for any beam. :ivar gvectors: (n, 3) refined reflections. :vartype gvectors: np.ndarray :ivar sf: (n, 4) ``[xfre, xfim, afre, afim]``, physical units. :vartype sf: np.ndarray :ivar sym: Space-group grouping; None for Friedel only. :vartype sym: GroupSymmetry or None :ivar layer: Layer index in the run. :vartype layer: int .. py:attribute:: gvectors :type: numpy.ndarray .. py:attribute:: sf :type: numpy.ndarray .. py:attribute:: sym :type: object :value: None .. py:attribute:: layer :type: int :value: 0 .. py:attribute:: _lookup :type: dict :value: None .. py:method:: __post_init__() .. py:method:: _refined(g) F(g) from the refined set, or None. .. py:method:: resolve(beams, model_sf=None) Electron structure factor (elastic part) for each beam. :param beams: (n, 3) Miller indices. :type beams: array-like :param model_sf: (n, 4) ``lookupSF`` format (amplitude, phase in degrees, ...) for the beams that are neither refined nor Friedel mates of refined ones. Defaults to ``lookupSF(beams)``. :type model_sf: np.ndarray, optional :returns: ``(F, source)`` -- complex (n,) and a str array (n,) of 'refined', 'friedel' or 'model'. :rtype: tuple .. py:class:: MapContext The crystal a run was refined against, loaded into the Bloch engine. :ivar run: The refinement run. :vartype run: RefinedRun :ivar dat: The ``.dat`` that was parsed. :vartype dat: Path :ivar beams: (n, 3) the ``.dat``'s beams, (0,0,0) excluded. :vartype beams: np.ndarray :ivar sym: Grouping of those beams, or None for a Friedel-only run. :vartype sym: GroupSymmetry or None :ivar cell: a, b, c, alpha, beta, gamma. :vartype cell: np.ndarray :ivar lattice: (3, 3) Cartesian lattice vectors (rows). :vartype lattice: np.ndarray :ivar metric: (3, 3) direct metric tensor, Angstrom^2. :vartype metric: np.ndarray :ivar volume: Cell volume, Angstrom^3. :vartype volume: float :ivar kv: Accelerating voltage in volts, from the ``.dat``. :vartype kv: float .. py:attribute:: run :type: object .. py:attribute:: dat :type: pathlib.Path .. py:attribute:: beams :type: numpy.ndarray .. py:attribute:: sym :type: object .. py:attribute:: cell :type: numpy.ndarray .. py:attribute:: lattice :type: numpy.ndarray .. py:attribute:: metric :type: numpy.ndarray .. py:attribute:: volume :type: float .. py:attribute:: kv :type: float .. py:method:: layer(i=0) The `LayerSF` of layer ``i``. .. py:function:: setup(run, dat=None, symmetry=None) Parses the run's ``.dat`` and groups its beams by symmetry. :param run: From `pyextal.hdf5io.load_refinement_run`. :type run: RefinedRun :param dat: The ``.dat`` to use. Defaults to the one embedded in the run (`pyextal.hdf5io.dat_for`). :type dat: path-like, optional :param symmetry: 'SpaceGroup' or 'Friedel'. Defaults to the run's ``symmetry_constraint``. :type symmetry: str, optional :returns: MapContext