StructureMap

class StructureMap(data, sites, hoppings, boundaries=())

A subclass of SpatialMap that also includes hoppings between sites

Attributes

boundaries Boundary hoppings between different translation units (only for infinite systems)
data 1D array of values for each site, i.e. maps directly to x, y, z site coordinates
hoppings Sparse matrix of hopping IDs
num_sites Total number of lattice sites
positions Lattice site positions.
spatial_map Just the SpatialMap subset without hoppings
sub 1D array of sublattices IDs, short for .sublattices
sublattices 1D array of sublattices IDs
x 1D array of coordinates, short for .positions.x
xyz Return a new array with shape=(N, 3).
y 1D array of coordinates, short for .positions.y
z 1D array of coordinates, short for .positions.z

Methods

__getitem__(idx) Same rules as numpy indexing
clipped(v_min, v_max) Clip (limit) the values in the data array, see clip()
cropped(**limits) Return a copy which retains only the sites within the given limits
plot([cmap, site_radius, num_periods]) Plot the spatial structure with a colormap of data at the lattice sites
plot_contour(**kwargs) Contour plot of the xy plane
plot_contourf([num_levels]) Filled contour plot of the xy plane
plot_pcolor(**kwargs) Color plot of the xy plane
with_data(...) Return a copy of this object with different data mapped to the sites
__getitem__(idx)

Same rules as numpy indexing

clipped(v_min, v_max)

Clip (limit) the values in the data array, see clip()

cropped(**limits)

Return a copy which retains only the sites within the given limits

Parameters:

**limits

Attribute names and corresponding limits. See example.

Examples

Leave only the data where -10 <= x < 10 and 2 <= y < 4:

new = original.cropped(x=[-10, 10], y=[2, 4])
plot(cmap='YlGnBu', site_radius=(0.03, 0.05), num_periods=1, **kwargs)

Plot the spatial structure with a colormap of data at the lattice sites

Both the site size and color are used to display the data.

Parameters:

cmap : str

Matplotlib colormap to be used for the data.

site_radius : Tuple[float, float]

Min and max radius of lattice sites. This range will be used to visually represent the magnitude of the data.

num_periods : int

Number of times to repeat periodic boundaries.

**kwargs

Additional plot arguments as specified in structure_plot_properties().

plot_contour(**kwargs)

Contour plot of the xy plane

Parameters:

**kwargs

Forwarded to tricontour().

plot_contourf(num_levels=50, **kwargs)

Filled contour plot of the xy plane

Parameters:

num_levels : int

Number of contour levels.

**kwargs

Forwarded to tricontourf().

plot_pcolor(**kwargs)

Color plot of the xy plane

Parameters:

**kwargs

Forwarded to tripcolor().

with_data(data) → pybinding.results.StructureMap

Return a copy of this object with different data mapped to the sites

boundaries

Boundary hoppings between different translation units (only for infinite systems)

data

1D array of values for each site, i.e. maps directly to x, y, z site coordinates

hoppings

Sparse matrix of hopping IDs

num_sites

Total number of lattice sites

positions

Lattice site positions. Named tuple with x, y, z fields, each a 1D array.

spatial_map

Just the SpatialMap subset without hoppings

sub

1D array of sublattices IDs, short for .sublattices

sublattices

1D array of sublattices IDs

x

1D array of coordinates, short for .positions.x

xyz

Return a new array with shape=(N, 3). Convenient, but slow for big systems.

y

1D array of coordinates, short for .positions.y

z

1D array of coordinates, short for .positions.z