fplore package

Subpackages

Submodules

fplore.arpes module

class fplore.arpes.ARPESGeometry(photon_direction: _SupportsArray[dtype] | _NestedSequence[_SupportsArray[dtype]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes], slit_direction: _SupportsArray[dtype] | _NestedSequence[_SupportsArray[dtype]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes], analyzer_direction: _SupportsArray[dtype] | _NestedSequence[_SupportsArray[dtype]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes])[source]

Bases: object

analyzer_direction: _SupportsArray[dtype] | _NestedSequence[_SupportsArray[dtype]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes] = array([  0.        ,  38.88888889, 136.98611111])
property analyzer_frame

Returns the inverse analyzer frame (in lab frame coordinates).

lab_coord(3,) @ analyzer_frame(3,3) -> analyzer_coord(3,) analyzer_frame(3,3) @ analyzer_coord(3,) -> lab_coord(3,)

classmethod from_angles(photon_direction: SphereCoordinate, slit_direction: SphereCoordinate, analyzer_direction: SphereCoordinate, degrees: bool = True)[source]
get_inv_sample_frame(sample_normal_direction: _SupportsArray[dtype] | _NestedSequence[_SupportsArray[dtype]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes] | None = None)[source]

Returns the inverse sample frame (in lab frame coordinates).

sample_coord(3,) @ inv_sample_frame(3,3) -> lab_coord(3,) inv_sample_frame(3,3) @ lab_coord(3,) -> sample_coord(3,)

get_sample_frame(sample_normal_direction: _SupportsArray[dtype] | _NestedSequence[_SupportsArray[dtype]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes] | None = None)[source]

Returns the sample frame (in lab frame coordinates).

lab_coord(3,) @ sample_frame(3,3) -> sample_coord(3,) sample_frame(3,3) @ sample_coord(3,) -> lab_coord(3,)

get_sample_frame_analyzer_coords(sample_normal_direction: _SupportsArray[dtype] | _NestedSequence[_SupportsArray[dtype]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes] | None = None)[source]

Returns the sample frame (in analyzer frame coordinates).

analyzer_coord(3,) @ sample_frame_analyzer_coords(3,3) -> sample_coord(3,) sample_frame_analyzer_coords(3,3) @ sample_coord(3,) -> analyzer_coord(3,)

property inv_analyzer_frame

Returns the analyzer frame (in lab frame coordinates).

analyzer_coord(3,) @ inv_analyzer_frame(3,3) -> lab_coord(3,) inv_analyzer_frame(3,3) @ lab_coord(3,) -> analyzer_coord(3,)

photon_direction: _SupportsArray[dtype] | _NestedSequence[_SupportsArray[dtype]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes] = array([3.5e-323, 4.0e-323, 4.4e-323])
photon_momentum(e_photon: float)[source]

Returns the photon momentum in the lab frame in reciprocal angstroms.

photon_momentum_sample_coords(e_photon: float, sample_normal_direction: _SupportsArray[dtype] | _NestedSequence[_SupportsArray[dtype]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes] | None = None)[source]

Returns the photon momentum in sample frame coordinates. Defaults to perfect normal emission.

plot(ax: Axes | None = None)[source]
slit_direction: _SupportsArray[dtype] | _NestedSequence[_SupportsArray[dtype]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes] = array([  0.        ,  38.88888889, 175.875     ])
class fplore.arpes.SphereCoordinate(phi, theta)

Bases: tuple

phi: float

Alias for field number 0

theta: float

Alias for field number 1

fplore.arpes.k_arpes(theta: _SupportsArray[dtype] | _NestedSequence[_SupportsArray[dtype]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes], e_photon: _SupportsArray[dtype] | _NestedSequence[_SupportsArray[dtype]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes], phi_det: float, v0: float, e_bind: _SupportsArray[dtype] | _NestedSequence[_SupportsArray[dtype]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes] = 0.0, theta2: _SupportsArray[dtype] | _NestedSequence[_SupportsArray[dtype]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes] = 0.0, geometry: ARPESGeometry | None = None, sample_normal_direction: _SupportsArray[dtype] | _NestedSequence[_SupportsArray[dtype]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes] | None = None)[source]

Returns the parallel and perpendicular components of electronic plane wave exiting a crystal with inner potential v0 at angle theta with an energy of e_electron

fplore.arpes.k_arpes_old(theta: _SupportsArray[dtype] | _NestedSequence[_SupportsArray[dtype]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes], e_photon: _SupportsArray[dtype] | _NestedSequence[_SupportsArray[dtype]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes], phi_det: float, v0: float, e_bind: float = 0.0, theta2: _SupportsArray[dtype] | _NestedSequence[_SupportsArray[dtype]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes] = 0.0, geometry: ARPESGeometry | None = None)[source]

fplore.logging module

class fplore.logging.StreamHandler(stream, level=0, format_string=None, encoding=None, filter=None, bubble=False)[source]

Bases: ColorizingStreamHandlerMixin, StreamHandler

fplore.plot module

class fplore.plot.Arrow3D(xs, ys, zs, *args, **kwargs)[source]

Bases: FancyArrowPatch

do_3d_projection(renderer=None)[source]
draw(renderer=None)

Draw the Artist (and its children) using the given renderer.

This has no effect if the artist is not visible (.Artist.get_visible returns False).

Parameters

renderer : .RendererBase subclass.

Notes

This method is overridden in the Artist subclasses.

set(*, agg_filter=<UNSET>, alpha=<UNSET>, animated=<UNSET>, antialiased=<UNSET>, arrowstyle=<UNSET>, capstyle=<UNSET>, clip_box=<UNSET>, clip_on=<UNSET>, clip_path=<UNSET>, color=<UNSET>, connectionstyle=<UNSET>, edgecolor=<UNSET>, facecolor=<UNSET>, fill=<UNSET>, gid=<UNSET>, hatch=<UNSET>, in_layout=<UNSET>, joinstyle=<UNSET>, label=<UNSET>, linestyle=<UNSET>, linewidth=<UNSET>, mouseover=<UNSET>, mutation_aspect=<UNSET>, mutation_scale=<UNSET>, patchA=<UNSET>, patchB=<UNSET>, path_effects=<UNSET>, picker=<UNSET>, positions=<UNSET>, rasterized=<UNSET>, sketch_params=<UNSET>, snap=<UNSET>, transform=<UNSET>, url=<UNSET>, visible=<UNSET>, zorder=<UNSET>)

Set multiple properties at once.

Supported properties are

Properties:

agg_filter: a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image alpha: scalar or None animated: bool antialiased or aa: bool or None arrowstyle: str or ~matplotlib.patches.ArrowStyle capstyle: .CapStyle or {‘butt’, ‘projecting’, ‘round’} clip_box: .Bbox clip_on: bool clip_path: Patch or (Path, Transform) or None color: color connectionstyle: [ ‘arc3’ | ‘angle3’ | ‘angle’ | ‘arc’ | ‘bar’ ] edgecolor or ec: color or None facecolor or fc: color or None figure: .Figure fill: bool gid: str hatch: {‘/’, ‘\’, ‘|’, ‘-’, ‘+’, ‘x’, ‘o’, ‘O’, ‘.’, ‘*’} in_layout: bool joinstyle: .JoinStyle or {‘miter’, ‘round’, ‘bevel’} label: object linestyle or ls: {‘-’, ‘–’, ‘-.’, ‘:’, ‘’, (offset, on-off-seq), …} linewidth or lw: float or None mouseover: bool mutation_aspect: float mutation_scale: float patchA: .patches.Patch patchB: .patches.Patch path_effects: .AbstractPathEffect picker: None or bool or float or callable positions: unknown rasterized: bool sketch_params: (scale: float, length: float, randomness: float) snap: bool or None transform: .Transform url: str visible: bool zorder: float

fplore.plot.make_quadrilaterals(x, y, z)[source]
fplore.plot.orthogonal_proj(zfront, zback)[source]
fplore.plot.plot_bz(run, ax, vectors='primitive', k_points=False, use_symmetry=False, high_symm_points=True, rot=None, offset=(0, 0, 0))[source]
fplore.plot.plot_bz_proj(run, ax, neighbours=False, rot=None, axis=-1, vectors=True, **kwargs)[source]

Projects along given axis (default: last axis) after applying rotation matrix rot

fplore.plot.plot_structure(run, ax)[source]
fplore.plot.plot_wigner_seitz(ax, lattice, **kwargs)[source]
fplore.plot.project(x, y, z, axis=1, color=(0.0, 0.0, 0.0, 1.0))[source]

Projects z(x,y) along an axis. Useful for example for showing bulk states in slab calculations. x, y: MxN (meshgrid with ‘ij’ indexing) z: MxN axis: int (axis along which to project)

Returns: polycollection

fplore.plot.projected_area(xyz, axis)[source]

fplore.run module

class fplore.run.FPLORun(directory)[source]

Bases: object

property attrs
backfold_k(points)[source]
property band

Returns the band data file

property band_weights
property brillouin_zone

Returns the Brillouin zone of the primitive lattice

property cellrotation

Reproduces the normalized cell rotation matrix as present in XFPLO structure dialog.

dos(**kwargs)[source]
fplo_to_k(fplo_coords)[source]

Transforms fplo coordinates (fractional cartesian, units 2pi/a) to k-space coordinates.

Parameters:

fplo_coords – Nx3

Returns:

k_points: Nx3

property high_symm_kpaths

Returns the high symmetry k-path in fractional reciprocal coordinates of primitive structure & lattice

property high_symm_kpoints

Returns the high symmetry k-points in cartesian coordinates.

property high_symm_kpoints_fractional

Returns the high symmetry k-points in fractional reciprocal coordinates of primitive structure & lattice

property lattice
property point_group_operations

Returns the point group operations in cartesian coordinates. Identity (E) is guaranteed to be first.

property point_group_operations_frac

Returns the point group operations in real space lattice fractional coordinates. Identity (E) is guaranteed to be first.

property primitive_lattice
property primitive_structure

Returns the primitive structure. Note that while run.structure and its lattice should be equivalent to the definition as per FPLO, the primitive lattice is not necessarily the same as the one generated by FPLO, although they are equivalent.

property spacegroup
property spacegroup_number
property spacegroup_setting
property spacegroup_symbol

Returns Hermann-Mauguin symbol including setting.

property structure

fplore.util module

fplore.util.backfold_k(lattice, b)[source]

Folds an array of k-points b (shape (…, 3)) back to the first Brillouin zone given a reciprocal lattice matrix A.

Guarantees that translationally equivalent points will be mapped to the same output point.

Note: Assumes that the lattice vectors contained in A correspond to the shortest lattice vectors, i.e. that pairwise combinations of reciprocal lattice vectors in A and their negatives cover all the nearest neighbours of the BZ.

fplore.util.backfold_k_old(lattice, b)[source]
fplore.util.backfold_k_parallelepiped(lattice, b, atol=0.0001)[source]

Fold an array of k-points b (shape (…, 3)) back to the parallelepiped spanned by the lattice vectors.

fplore.util.cartesian_product(*xs)[source]

Iterates over primary axis first, then second, etc.

fplore.util.detect_grid(coordinates)[source]

Check if sample points form regular, rectangular grid

Parameters:

coordinates

Returns:

(xs, ys, zs) axes of grid

fplore.util.fill_bz(k, reciprocal_lattice, ksamp_lattice=None, pad=False)[source]

fills the first BZ with k-points of a given sampling lattice

fplore.util.find_basis(lattice_points)[source]

Given lattice points of shape (N, 3), this function attempts to find a basis

fplore.util.find_lattice(lattice_points)[source]
fplore.util.generate_irreducible_wedge(lattice)[source]

Partitions BZ into irreducible wedges. :return: List of irreducible wedges with matrix to transform coordinates to the ‘primary’ wedge.

fplore.util.get_perp_vector(v)[source]

Returns an arbitrary normalized vector perpendicular to v

fplore.util.in_first_bz(p, reciprocal_lattice)[source]

Test if points p are in the first Brillouin zone

fplore.util.in_hull(p, hull, **kwargs)[source]

Test if points in p are within hull

fplore.util.linspace_ng(start, *stops, **kwargs)[source]

Return evenly spaced coordinates between n arbitrary 3d points

A single stop will return a line between start and stop, two stops make a plane segment, three stops will span a parallelepiped.

fplore.util.normalized(v)[source]

Returns normalized v

fplore.util.project(v, t)[source]

Project vector v onto target vector t

fplore.util.project_plane(v, n)[source]

Project vector v onto plane with normal n

fplore.util.remove_duplicates(data)[source]

Remove non-unique k-points from data. Order is not preserved.

fplore.util.rot_v1_v2(v1, v2)[source]

Returns rotation matrix which rotates v1 onto v2

fplore.util.sample_e(axes, reshaped_data, coords, order=1, energy_levels=None)[source]

Sample a given ndimage (axes, reshaped_data) at coords

fplore.util.snap_to_grid(points, *grid_axes)[source]
fplore.util.unique(coords, tol=1e-05)[source]
fplore.util.wigner_seitz_neighbours(lattice)[source]

fplore.fast_util module

fplore.fast_util.backfold_k_inplace(double[:, ::1] neighbours_k, double[:, ::1] k_points) None

Module contents