Structure Module#
The structure module provides support for atomic structure I/O,
generation, and manipulation.
List of module contents#
Read cif file functions:
Operations on logical conditions:
Create a Monkhorst-Pack k-point mesh function
Tile matrix malipulation functions
tile_magnetization
Rotate plane function
Trivial filter function
Base class for Structure class:
Base class for DefectStructure, Crystal, and Jellium classes:
SeeK-path functions
_getseekpath
Interpolate structures functions
Animate structures functions
Concrete Structure classes:
Structure generation functions:
Read structure functions
Module contents#
- nexus.structure.read_cif(filepath, block=None, grammar='1.1', cell='prim', args_only=False)[source]#
- nexus.structure.recenter_points(pos, center, axes)[source]#
Center a given set of points in a cell around a provided center.
- Parameters:
- Returns:
- pos
NDArray Array of positions centered around the given center
- pos
Notes
This function also ensures that points close (within 1e-12) to the minimum edge (-0.5) of the cell are placed exactly on that edge. The intent here is to make sure that atoms close to or on the leading edge (+0.5) are wrapped around to retain periodicity.
- class nexus.structure.MaskFilter(*vars, **kwargs)[source]#
Bases:
DevBaseMethods
__call__(T)Call self as a function.
append(value)class_error(message[, header, exit, trace, ...])Report an error relating to a class.
error(message[, header, exit, trace])Report an error inside a class.
first()keys()list(*keys)open_log(filepath)save([fpath])sorted_keys()warn(msg[, indent])Warning from inside a Nexus class.
add
add_optional
check_required
check_types
check_types_optional
class_get
class_has
class_items
class_keys
class_log
class_set
class_set_optional
class_set_single
class_warn
clear
close_log
copy
copy_from
copy_to
data_repr
delete
delete_optional
delete_required
dict
extract
extract_optional
get
get_optional
get_path
get_required
inverse
items
last
list_optional
load
log
move_from
move_from_optional
move_to
move_to_optional
not_implemented
obj
path_exists
random_key
select_random
serial
set
set_optional
set_path
shallow_copy
to_dict
to_obj
transfer_from
transfer_to
tree
tuple
values
write
- nexus.structure.optimal_tilematrix(axes, volfac, dn=1, tol=0.001, filter=<function trivial_filter>, mask=None, nc=5, Tref=None)[source]#
- class nexus.structure.Sobj(*vars, **kwargs)[source]#
Bases:
DevBaseMethods
append(value)class_error(message[, header, exit, trace, ...])Report an error relating to a class.
error(message[, header, exit, trace])Report an error inside a class.
first()keys()list(*keys)open_log(filepath)save([fpath])sorted_keys()warn(msg[, indent])Warning from inside a Nexus class.
add
add_optional
check_required
check_types
check_types_optional
class_get
class_has
class_items
class_keys
class_log
class_set
class_set_optional
class_set_single
class_warn
clear
close_log
copy
copy_from
copy_to
data_repr
delete
delete_optional
delete_required
dict
extract
extract_optional
get
get_optional
get_path
get_required
inverse
items
last
list_optional
load
log
move_from
move_from_optional
move_to
move_to_optional
not_implemented
obj
path_exists
random_key
select_random
serial
set
set_optional
set_path
shallow_copy
to_dict
to_obj
transfer_from
transfer_to
tree
tuple
values
write
- class nexus.structure.Structure(axes=None, scale=1.0, elem=None, pos=None, elem_pos=None, mag=None, center=None, kpoints=None, kweights=None, kgrid=None, kshift=None, permute=None, units=None, tiling=None, rescale=True, dim=3, operations=None, background_charge=0, frozen=None, bconds=None, posu=None, use_prim=None, add_kpath=False, symm_kgrid=False)[source]#
Bases:
SobjGeneral class for all physical structures
- Parameters:
- axes
ArrayLike, optional Lattice vectors of the cell
- scale
intorfloat, default=1. Scaling for all other physical values. See
rescalefor more information.- elem
ArrayLike, optional Array of atomic symbols.
- pos
ArrayLike, optional Positions of the atoms.
- elem_pos
str, optional Multiline string with each line containing an atom where an atom is an element and its position. Overrides
elemandpos.- mag
ArrayLike, optional Magnetic moments of each atom.
- center
ArrayLike, optional Defined center of the cell, defaults to the
[0.5, 0.5, 0.5]point of the cell.- kpoints
ArrayLike, optional Array containing the positions of k-points.
- kweights
ArrayLike, optional Weight of individual k-points, must be as long as the number of k-points.
- kgrid
int, optional Number of subdivisions to create a Monkhorst-Pack k-point mesh. See
kmeshfor a more in-depth explanation. Overrideskpointsif specified.- kshift
ArrayLike, optional Vector to translate k-points if k-grid is specified.
- permute
ArrayLike, optional Vector to permute the structure. See
permutefor more information.- units
str, optional Units of the positions. See
unit_converter.pyfor a full list of supported units.- tiling
ArrayLikeofint, optional A vector of ints for tiling the cell in each dimension. See
tilefor more information.- rescalebool, default=True
Truewill rescale the supplied structural information with the scaling factor provided (seescale),Falsesets thescalewithout altering the provided structural information.- dim
int, default=3 Dimensionality of the Structure. See Notes for more information.
- operationsiterable
ofstr, optional Operations to perform on the structure. See
set_operationsfor more information.- background_charge
int, default=0 The total background charge of the system. Positive for cations, negative for anions, and zero for neutral systems.
- frozen
ArrayLikeofbool, optional Mask array of booleans with the same length as the number of atoms and width of
dim. Seeset_frozenfor more information.- bconds
strortupleofstr, optional Boundary conditions either in all directions or specified for each dimension. Defaults to periodic in all directions.
- posu
ArrayLike, optional The positions of the atoms in units of the lattice parameter. Overrides
pos.- use_primbool, optional
Option to convert the unit cell to a primitive cell. Requires that the
seekpathpackage is installed [0].- add_kpathbool, default=False
Optionally add k-points to the primitive cell. Only used if
use_primisTrue.- symm_kgridbool, default=False
Option for generating a Monkhorst-Pack k-point grid with only symmetric k-points. Requires the
spglibpackage [1]. Seeadd_symmetrized_meshfor more information.
- axes
- Attributes:
- axes
NDArray Lattice vectors of the cell as a square matrix of dimension
dim x dim.- scale
intorfloat Scaling for all other physical values.
- elem
NDArrayofstr Array of atomic symbols.
- pos
NDArrayoffloat Positions of the atoms.
- center
NDArrayoffloat Defined center of the cell.
- kpoints
NDArrayoffloat Array containing the positions of k-points.
- kweights
NDArrayoffloat Weight of individual k-points.
- units
str Units of the atom positions.
- dim
int, default=3 Dimensionality of the Structure.
- operations
Mappingofstrtofunction Operations to perform on the structure. See
set_operationsfor more information.- background_charge
int, default=0 The total background charge of the system. Positive for cations, negative for anions, and zero for neutral systems.
- bconds
NDArrayofstr Boundary conditions either in all directions or specified for each dimension
- mag
NDArrayoffloatorNone Magnetic moments of each atom, or
Noneif system is not magnetized.- tmatrix
NDArrayofintorNone A vector of ints for tiling the cell in each dimension. See
tilefor more information.- frozen
NDArrayofbool orNone, default=None Mask array of booleans with the same length as the number of atoms and width of
dim, whereTrueindicates the atoms are locked in place andFalseindicates they are free to move.
- axes
Methods
add_atoms(elem, pos)adjust_axes(axes)append(value)bond_compression(reference, neighbors)bonds(neighbors[, vectors])boundary([dims, dtol])carve(identifiers)cell_image(p[, center])center_distances(points[, center])center_molecule([rmin_edge])Center a molecule in a unit cell, ensuring equal padding on all sides.
change_units(units[, folded])chemical_coordination([indices, nmax, rmax, ...])class_error(message[, header, exit, trace, ...])Report an error relating to a class.
cleave(axis, loc[, sep, remove, tol])clone_from(other)corners()Calculate vectors corresponding to the 8 corners of the unit cell.
displacement(reference[, map])distances([pos1, pos2])distortion(reference, neighbors)error(message[, header, exit, trace])Report an error inside a class.
face_vectors([axes, distances])first()fold(small, *requests)fold_pos(large[, tol])get_cell()group_atoms([folded])Group the atoms by their element type, sorting in alphabetical order.
incorporate(other)inside(pos[, axes, center, tol, separate])inversion_symmetrize_kpoints([tol, folded])keys()kfold(tiling, kpoints, kweights)layer_composition(layers)layers([axis, dtol, dbin, plot, composition])list(*keys)locate(identifiers[, radii, exterior])locate_simple(pos)madelung([axes, tol])Arbitrary transformation matrix (column-major).
miller_direction(h, k, l[, normalize])miller_normal(h, k, l[, normalize])min_image_centroid([points, indices])min_image_centroids([points, indices])min_image_norms(points, norms)nearest_neighbors([indices, rmax, nmax, ...])open_log(filepath)order_by_species([folded])ordered_species([symbol])permute(permutation)point_defect([identifiers, elem, dr])pos_to_str([units, with_elem])Write the positions of a structure to a string, optionally with atomic symbols.
project_plane(a1, a2[, points])rcore_max([units])read_fhi_aims(filepath)recenter([center])Center atoms around a new provided center of the unit cell, or if a new center is not provided then use the (0.5 0.5 0.5) point of the unit cell.
recenter_k([kpoints, kaxes, kcenter, ...])Center k-points around the provided center of k-space.
recorner([center])Center atoms around the origin of the cell.
remove(identifiers)rename([folded])Rename element names in a structure.
reorder(order)replace(identifiers[, elem, pos, radii, ...])replace_nearest(elem[, pos])rescale(scale)reset_axes([axes])Reset the structure's axes, k-space axes, and center.
reshape_axes(reshaping)ring_graphs(order, **kwargs)rinscribe_cube(*args, **kwargs)rotate(r[, rp, passive, units, check])Arbitrary rotation of the structure.
rotate_plane(plane, angle[, units])rwigner_cube(*args, **kwargs)save([fpath])scalar_displacement(reference)select_twist([selector, tol])shell(cell, neighbors[, direction])shells(identifiers[, radii, exterior, ...])skew(skew)Arbitrary transformation matrix (row-major).
slide(v[, recenter])sorted_keys()space_group_operations([tol, unit])species([symbol])stretch(s1, s2, s3)translate(v)unique_kpoints([tol, folded])unique_points(points, axes[, weights, tol])unique_points_fast(points, axes[, weights, tol])unique_positions([tol, folded])unsheared_axes([axes, distances])upcast(DerivedStructure)voronoi_neighbors([indices, restrict, ...])warn(msg[, indent])Warning from inside a Nexus class.
Write the unit cell axes as a string.
write_fhi_aims([filepath])write_xyz([filepath])Write a
Structureobject to an XYZ fileadd
add_kmesh
add_kpoints
add_optional
add_symmetrized_kmesh
all_periodic
any_periodic
become_primitive
bounding_box
bravais_lattice_name
check_consistent
check_point_group_operations
check_required
check_tiling
check_types
check_types_optional
class_get
class_has
class_items
class_keys
class_log
class_set
class_set_optional
class_set_single
class_warn
clear
close_log
connected_graphs
copy
copy_from
copy_to
count_kshells
data_repr
delete
delete_optional
delete_required
dict
distance_table
embed
equivalent_atoms
extract
extract_optional
freeze
get
get_atomic_numbers
get_magnetic_moments
get_number_of_atoms
get_optional
get_path
get_required
get_scaled_positions
get_smallest
get_symmetry
get_symmetry_dataset
has_axes
has_folded
has_folded_structure
has_tmatrix
interpolate
inverse
is_frozen
is_magnetic
is_open
is_periodic
is_tiled
items
kgrid_from_kspacing
kmap
kpoints_qmcpack
kpoints_reduced
kpoints_unit
last
list_optional
load
log
makov_payne
min_image_distances
min_image_vectors
move_from
move_from_optional
move_to
move_to_optional
neighbor_table
not_implemented
obj
operate
opt_tilematrix
path_exists
plot2d
plot2d_ax
plot2d_kax
plot2d_kp
plot2d_points
plot2d_pos
point_group_operations
pos_to_cartesian
pos_unit
primitive
random_key
rcell
read
read_cif
read_poscar
read_xsf
read_xyz
remove_folded
remove_folded_structure
rinscribe
rmg_lattice
rmg_transform
rmin
rwigner
select_random
serial
set
set_axes
set_bconds
set_elem
set_folded
set_folded_structure
set_frozen
set_mag
set_operations
set_optional
set_path
set_pos
shallow_copy
show
size
symmetry_data
tile
tile_opt
tile_points
tile_points_brute
tile_points_simple
tilematrix
to_dict
to_obj
transfer_from
transfer_to
tree
tuple
values
vector_table
volume
voronoi_distances
voronoi_radii
voronoi_species_radii
voronoi_vectors
write
write_poscar
write_xsf
Notes
Currently the
Structureclass only partially supports 2-dimensional structures.References
- operations = recenter function remove_folded_structure function #
- group_atoms(folded=True) None[source]#
Group the atoms by their element type, sorting in alphabetical order.
- Parameters:
- foldedbool, default=True
Optionally sort the folded structure, if it exists.
Examples
>>> structure = Structure( ... elem = ["Be", "N", "C", "Be", "C", "O"], ... pos = np.array([ ... [0, 0, 0], ... [0, 0, 0], ... [0, 0, 0], ... [0, 0, 0], ... [0, 0, 0], ... [0, 0, 0], ... ], dtype=np.float64), ... ) >>> print(structure.elem) ['Be' 'N' 'C' 'Be' 'C' 'O'] >>> structure.group_atoms() >>> print(structure.elem) ['Be' 'Be' 'C' 'C' 'N' 'O']
- rename(folded=True, **name_pairs) None[source]#
Rename element names in a structure.
- Parameters:
Examples
>>> structure = Structure( ... elem = ["N", "C", "O", "H"], ... pos = np.array([ ... [0, 0, 0], ... [0, 0, 0], ... [0, 0, 0], ... [0, 0, 0], ... ], dtype=np.float64), ... ) >>> print(structure.elem) ['N' 'C' 'O' 'H'] >>> structure.rename(N="Dy", C="Er") >>> print(structure.elem) ['Dy' 'Er' 'O' 'H']
- reset_axes(axes: ArrayLike | None = None) None[source]#
Reset the structure’s axes, k-space axes, and center.
Notes
If
axesis given, this function will remove the previous folded structure (as new axes could invalidate the tiling) and then setself.axesto the new axes, update the k-space axes, and set the center of the cell to be the (0.5, 0.5, 0.5) point.If
axesare not given (e.g.axes=None, the default), then this function will reuse the same axes as the current structure, reset the k-space axes, and set the cell center at the (0.5, 0.5, 0.5) point.Examples
Providing axes will also make sure
kaxesandcenterare consistent.>>> structure = Structure( ... axes = np.array([ ... [6.0, 0.0, 0.0], ... [0.0, 6.0, 0.0], ... [0.0, 0.0, 6.0], ... ]), ... ) >>> print(structure.axes) [[6. 0. 0.] [0. 6. 0.] [0. 0. 6.]] >>> print(structure.kaxes) [[1.04719755 0. 0. ] [0. 1.04719755 0. ] [0. 0. 1.04719755]] >>> print(structure.center) [3. 3. 3.]
>>> structure.reset_axes(np.array([ ... [12.0, 0.0, 0.0], ... [ 0.0, 12.0, 0.0], ... [ 0.0, 0.0, 12.0], ... ])) >>> print(structure.axes) [[12. 0. 0.] [ 0. 12. 0.] [ 0. 0. 12.]] >>> print(structure.kaxes) [[0.52359878 0. 0. ] [0. 0.52359878 0. ] [0. 0. 0.52359878]] >>> print(structure.center) [6. 6. 6.]
Alternatively, if you don’t provide
axesyou can ensure that thekaxesandcenterof the structure are correct. Here we setcenterto be at the origin, then usereset_axesto correct it.>>> structure = Structure( ... axes = np.array([ ... [6.0, 0.0, 0.0], ... [0.0, 6.0, 0.0], ... [0.0, 0.0, 6.0], ... ]), ... center = np.array([0.0, 0.0, 0.0]), ... ) >>> print(structure.center) [0. 0. 0.]
>>> structure.reset_axes() >>> print(structure.center) [3. 3. 3.]
- corners() NDArray[float64][source]#
Calculate vectors corresponding to the 8 corners of the unit cell.
Only implemented for
self.dim=3.
- center_molecule(rmin_edge=1e-08)[source]#
Center a molecule in a unit cell, ensuring equal padding on all sides.
- Parameters:
- rmin_edgefloat-like or array_like, default=1e-8
Minimum acceptable distance from the cell edges to any atom in the molecule, potentially specified per-axis.
Notes
The default rmin_edge of 1e-8 is designed to just barely contain the molecule. It is important to ensure that for larger, non-periodic molecular systems or atoms that the unit cell size is sufficiently large to contain the charge density otherwise the molecular system will interact with the neighboring periodic replica, resulting in unphysical electrostatic interactions
For reference, 5 Bohr contains >99.3% of the charge density around a Hydrogen atom.
- rotate(r, rp=None, passive=False, units='radians', check=True)[source]#
Arbitrary rotation of the structure.
- Parameters:
- r
array_likeoffloatwithshape(3,3)orarray_likeoffloatshape(3,)orstr If a 3x3 matrix, then code executes rotation consistent with this matrix – it is assumed that the matrix acts on a column-major vector (eg, v’=Rv). If a three-dimensional array, then the operation of the function depends on the input type of
rpin the following ways:If
rpis a scalar, thenrpis assumed to be an angle and a rotation ofrpis made about the axis defined byr.If
rpis a vector, thenrpis assumed to be an axis and a rotation is made such thatraligns withrp.If
rpis astr, then the rotation is such thatraligns with the axis given by the str('x', 'y', 'z', 'a0', 'a1', or 'a2').
If a
strthen the axis,r, is defined by the input label (e.g. ‘x’, ‘y’, ‘z’, ‘a1’, ‘a2’, or ‘a3’) and the operation of the function depends on the input type ofrpin the same ways as above.- rp
array_likeoffloatwithshape(3)orstr, optional If a 3-dimensional vector is given, then
rpis assumed to be an axis and a rotation is made such that the axisris aligned withrp. If a str, thenrpis assumed to be an angle and a rotation about the axis defined byris made by an anglerp. If a str is given, thenrpis assumed to be an axis defined by the given label (e.g. ‘x’, ‘y’, ‘z’, ‘a1’, ‘a2’, or ‘a3’) and a rotation is made such that the axisris aligned withrp.- passivebool, default=False
If
True, perform a passive rotation. IfFalse, perform an active rotation.- units{“radians”, “rad”, “degrees”, “deg”}, default=”radians”
Units of
rp, ifrpis given as an angle (scalar).- checkbool, default=True
Perform a check to verify rotation matrix is orthogonal.
- r
- matrix_transform(A)[source]#
Arbitrary transformation matrix (column-major).
- Parameters:
- Aarray_like, float, shape (3,3)
Transform the structure using the matrix A. It is assumed that A is in column-major form, i.e., it transforms a vector v as v’ = Av
- skew(skew)[source]#
Arbitrary transformation matrix (row-major).
- Parameters:
- skewarray_like, float, shape (3,3)
Transform the structure using the matrix skew. It is assumed that skew is in row-major form, i.e., it transforms a vector v as v’ = vT
- shells(identifiers, radii=None, exterior=False, cumshells=False, distances=False, dtol=1e-06)[source]#
- connected_graphs(order, indices=None, rmax=None, nmax=None, voronoi=False, degree=False, site_maps=False, **spec_max)[source]#
- nearest_neighbors(indices=None, rmax=None, nmax=None, restrict=False, voronoi=False, distances=False, **spec_max)[source]#
- chemical_coordination(indices=None, nmax=None, rmax=None, restrict=False, voronoi=False, neighbors=False, distances=False, **spec_max)[source]#
- recenter(center=None)[source]#
Center atoms around a new provided center of the unit cell, or if a new center is not provided then use the (0.5 0.5 0.5) point of the unit cell.
- recenter_k(kpoints=None, kaxes=None, kcenter=None, remove_duplicates=False)[source]#
Center k-points around the provided center of k-space.
- Parameters:
- kpoints
NDArray|None,default=None Array of N k-points to center with shape (N,3)
- kaxes
NDArray|None,default=None Array of axes describing the k-space cell with shape (3,3)
- kcenter
NDArray|None,default=None Array containing a custom center of k-space with shape (3,3)
- remove_duplicatesbool,
default=False Remove k-points that have a distance less than 1e-8
- kpoints
- recorner(center=None)[source]#
Center atoms around the origin of the cell.
- Parameters:
- center
NDArray,default=self.center Position of the center of the cell.
- center
Notes
If the user supplies
center, then this will modifyself.centerto reflect that change.
- read(filepath, format=None, elem=None, block=None, grammar='1.1', cell='prim', contents=False)[source]#
- pos_to_str(units: str = 'A', with_elem: bool = False)[source]#
Write the positions of a structure to a string, optionally with atomic symbols.
- Parameters:
Notes
This function will write the positions in the format (in this case using
with_elem=True) .. code-block:: python“{element:2} {dim1:12.8f} {dim2:12.8f} … {dimN:12.8f}n”
- write_xyz(filepath=None)[source]#
Write a
Structureobject to an XYZ file- Parameters:
- filepath
PathLikeorNone, default=None Path to where the XYZ file should be written. If this is
None, then this function just returns what would have been written to the XYZ file.
- filepath
- Returns:
- xyz
str The text that was or would have been written to the XYZ file.
- xyz
Notes
To get a string of only the atomic positions, use
pos_to_str()instead.
- check_point_group_operations(rotations=None, tol=1e-05, unit=False, dtol=1e-05, ncheck=1, exit=False)[source]#
- rmg_lattices = cubic_F str cubic_I str cubic_P str hexagonal_P str orthorhombic_P str tetragonal_P str #
- nexus.structure.get_conventional_cell(structure=None, symprec=1e-05, angle_tolerance=1.0, seekpathout=None)[source]#
- nexus.structure.get_primitive_cell(structure=None, symprec=1e-05, angle_tolerance=1.0, seekpathout=None)[source]#
- nexus.structure.get_kpath(structure=None, check_standard=True, with_time_reversal=False, recipe='hpkot', reference_distance=0.025, threshold=1e-07, symprec=1e-05, angle_tolerance=1.0, seekpathout=None)[source]#
- nexus.structure.get_symmetry(structure=None, symprec=1e-05, angle_tolerance=1.0, seekpathout=None)[source]#
- nexus.structure.get_structure_with_bands(cell=0, structure=None, with_time_reversal=False, reference_distance=0.025, threshold=1e-07, symprec=1e-05, angle_tolerance=1.0)[source]#
- nexus.structure.get_band_tiling(structure=None, check_standard=True, use_ktol=True, kpoints_label=None, kpoints_rel=None, max_volfac=20, min_volfac=0, target_volfac=None)[source]#
- nexus.structure.get_seekpath_full(structure=None, seekpathout=None, conventional=False, primitive=False, **kwargs)[source]#
- nexus.structure.interpolate_structures(struct1, struct2=None, images=None, min_image=True, recenter=True, match_com=False, repackage=False, chained=False)[source]#
- class nexus.structure.DefectStructure(*args, **kwargs)[source]#
Bases:
StructureMethods
add_atoms(elem, pos)adjust_axes(axes)append(value)at_Gpoint()at_Lpoint()at_real_kpoint()bond_compression(reference, neighbors)bonds(neighbors[, vectors])boundary([dims, dtol])carve(identifiers)cell_image(p[, center])center_distances(points[, center])center_molecule([rmin_edge])Center a molecule in a unit cell, ensuring equal padding on all sides.
center_solid()change_units(units[, folded])chemical_coordination([indices, nmax, rmax, ...])class_error(message[, header, exit, trace, ...])Report an error relating to a class.
clear_kpoints()cleave(axis, loc[, sep, remove, tol])clone_from(other)corners()Calculate vectors corresponding to the 8 corners of the unit cell.
cube_deviation()displacement(reference[, map])distances([pos1, pos2])distortion(reference, neighbors)error(message[, header, exit, trace])Report an error inside a class.
face_distances()face_vectors([axes, distances])first()fold(small, *requests)fold_pos(large[, tol])get_cell()group_atoms([folded])Group the atoms by their element type, sorting in alphabetical order.
incorporate(other)inside(pos[, axes, center, tol, separate])inversion_symmetrize_kpoints([tol, folded])keys()kfold(tiling, kpoints, kweights)layer_composition(layers)layers([axis, dtol, dbin, plot, composition])list(*keys)locate(identifiers[, radii, exterior])locate_simple(pos)madelung([axes, tol])matrix_transform(A)Arbitrary transformation matrix (column-major).
miller_direction(h, k, l[, normalize])miller_normal(h, k, l[, normalize])min_image_centroid([points, indices])min_image_centroids([points, indices])min_image_norms(points, norms)nearest_neighbors([indices, rmax, nmax, ...])open_log(filepath)order_by_species([folded])ordered_species([symbol])permute(permutation)point_defect([identifiers, elem, dr])pos_to_str([units, with_elem])Write the positions of a structure to a string, optionally with atomic symbols.
project_plane(a1, a2[, points])rcore_max([units])read_fhi_aims(filepath)recenter([center])Center atoms around a new provided center of the unit cell, or if a new center is not provided then use the (0.5 0.5 0.5) point of the unit cell.
recenter_k([kpoints, kaxes, kcenter, ...])Center k-points around the provided center of k-space.
recorner([center])Center atoms around the origin of the cell.
remove(identifiers)rename([folded])Rename element names in a structure.
reorder(order)replace(identifiers[, elem, pos, radii, ...])replace_nearest(elem[, pos])rescale(scale)reset_axes([axes])Reset the structure's axes, k-space axes, and center.
reshape_axes(reshaping)ring_graphs(order, **kwargs)rinscribe_cube(*args, **kwargs)rotate(r[, rp, passive, units, check])Arbitrary rotation of the structure.
rotate_plane(plane, angle[, units])rwigner_cube(*args, **kwargs)save([fpath])scalar_displacement(reference)select_twist([selector, tol])shell(cell, neighbors[, direction])shells(identifiers[, radii, exterior, ...])skew(skew)Arbitrary transformation matrix (row-major).
slide(v[, recenter])sorted_keys()space_group_operations([tol, unit])species([symbol])spglib_cell()stretch(s1, s2, s3)translate(v)unique_kpoints([tol, folded])unique_points(points, axes[, weights, tol])unique_points_fast(points, axes[, weights, tol])unique_positions([tol, folded])unsheared_axes([axes, distances])upcast(DerivedStructure)voronoi_neighbors([indices, restrict, ...])warn(msg[, indent])Warning from inside a Nexus class.
write_axes()Write the unit cell axes as a string.
write_fhi_aims([filepath])write_xyz([filepath])Write a
Structureobject to an XYZ filezero_corner()add
add_kmesh
add_kpoints
add_optional
add_symmetrized_kmesh
all_periodic
any_periodic
become_primitive
bounding_box
bravais_lattice_name
check_consistent
check_point_group_operations
check_required
check_tiling
check_types
check_types_optional
class_get
class_has
class_items
class_keys
class_log
class_set
class_set_optional
class_set_single
class_warn
clear
close_log
compare
connected_graphs
copy
copy_from
copy_to
count_kshells
data_repr
defect_from_bond_compression
defect_from_displacement
delete
delete_optional
delete_required
dict
distance_table
embed
equivalent_atoms
extract
extract_optional
freeze
get
get_atomic_numbers
get_magnetic_moments
get_number_of_atoms
get_optional
get_path
get_required
get_scaled_positions
get_smallest
get_symmetry
get_symmetry_dataset
has_axes
has_folded
has_folded_structure
has_tmatrix
interpolate
inverse
is_frozen
is_magnetic
is_open
is_periodic
is_tiled
items
kgrid_from_kspacing
kmap
kpoints_qmcpack
kpoints_reduced
kpoints_unit
last
list_optional
load
log
makov_payne
min_image_distances
min_image_vectors
move_from
move_from_optional
move_to
move_to_optional
neighbor_table
not_implemented
obj
operate
opt_tilematrix
path_exists
plot2d
plot2d_ax
plot2d_kax
plot2d_kp
plot2d_points
plot2d_pos
point_group_operations
pos_to_cartesian
pos_unit
primitive
random_key
rcell
read
read_cif
read_poscar
read_xsf
read_xyz
remove_folded
remove_folded_structure
rinscribe
rmg_lattice
rmg_transform
rmin
rwigner
select_random
serial
set
set_axes
set_bconds
set_elem
set_folded
set_folded_structure
set_frozen
set_mag
set_operations
set_optional
set_path
set_pos
shallow_copy
show
size
symmetry_data
tile
tile_opt
tile_points
tile_points_brute
tile_points_simple
tilematrix
to_dict
to_obj
transfer_from
transfer_to
tree
tuple
values
vector_table
volume
voronoi_distances
voronoi_radii
voronoi_species_radii
voronoi_vectors
write
write_poscar
write_xsf
- class nexus.structure.Crystal(lattice=None, cell=None, centering=None, constants=None, atoms=None, basis=None, basis_vectors=None, tiling=None, cscale=None, axes=None, units=None, angular_units='degrees', kpoints=None, kgrid=None, mag=None, frozen=None, kshift=(0, 0, 0), permute=None, operations=None, elem=None, pos=None, use_prim=None, add_kpath=False, symm_kgrid=False)[source]#
Bases:
StructureGenerate a crystal structure.
- Parameters:
- lattice
str, optional - cell
str, optional - centering{“P”, “A”, “B”, “C”, “F”, “I”, “R”}, optional
- constants
floatortupleoffloat, optional Lattice constants required for the specified lattice. The order for these is
(a, b, c, α, β, γ). If the specified lattice does not require some constant, you can omit it, but retain the overall order of the constants.- atoms
strortupleofstr, optional The atomic symbol(s) of the atoms in the lattice.
- basis
listoflistsoffloats, optional A list of vectors that define the atom positions with respect to the
basis_vectors. If there are multipleatoms, this should have the sample length asatoms.- basis_vectors
ArrayLikeoffloator{“prim”, “conv”}, optional A set of 3 vectors that define the basis used to transform
basis.- cscale
listoffloat, optional Scaling values for the provided constants. Must have the same length as
constants.
- lattice
- Attributes:
- lattice_constants
- lattices
- centering_types
- lattice_centerings
- centerings
- cell_types
- cell_aliases
- cell_classes
- constants
NDArrayoffloat The lattice constants (
a,b,c) for the crystal.- angles
NDArrayoffloat The angles (
α,β,γ) for the crystal.- generation_info
objofstr:str The supplied inputs to the class constructor.
Methods
add_atoms(elem, pos)adjust_axes(axes)append(value)at_Gpoint()at_Lpoint()at_real_kpoint()bond_compression(reference, neighbors)bonds(neighbors[, vectors])boundary([dims, dtol])carve(identifiers)cell_image(p[, center])center_distances(points[, center])center_molecule([rmin_edge])Center a molecule in a unit cell, ensuring equal padding on all sides.
center_solid()change_units(units[, folded])chemical_coordination([indices, nmax, rmax, ...])class_error(message[, header, exit, trace, ...])Report an error relating to a class.
clear_kpoints()cleave(axis, loc[, sep, remove, tol])clone_from(other)corners()Calculate vectors corresponding to the 8 corners of the unit cell.
cube_deviation()displacement(reference[, map])distances([pos1, pos2])distortion(reference, neighbors)error(message[, header, exit, trace])Report an error inside a class.
face_distances()face_vectors([axes, distances])first()fold(small, *requests)fold_pos(large[, tol])get_cell()group_atoms([folded])Group the atoms by their element type, sorting in alphabetical order.
incorporate(other)inside(pos[, axes, center, tol, separate])inversion_symmetrize_kpoints([tol, folded])keys()kfold(tiling, kpoints, kweights)layer_composition(layers)layers([axis, dtol, dbin, plot, composition])list(*keys)locate(identifiers[, radii, exterior])locate_simple(pos)madelung([axes, tol])matrix_transform(A)Arbitrary transformation matrix (column-major).
miller_direction(h, k, l[, normalize])miller_normal(h, k, l[, normalize])min_image_centroid([points, indices])min_image_centroids([points, indices])min_image_norms(points, norms)nearest_neighbors([indices, rmax, nmax, ...])open_log(filepath)order_by_species([folded])ordered_species([symbol])permute(permutation)point_defect([identifiers, elem, dr])pos_to_str([units, with_elem])Write the positions of a structure to a string, optionally with atomic symbols.
project_plane(a1, a2[, points])rcore_max([units])read_fhi_aims(filepath)recenter([center])Center atoms around a new provided center of the unit cell, or if a new center is not provided then use the (0.5 0.5 0.5) point of the unit cell.
recenter_k([kpoints, kaxes, kcenter, ...])Center k-points around the provided center of k-space.
recorner([center])Center atoms around the origin of the cell.
remove(identifiers)rename([folded])Rename element names in a structure.
reorder(order)replace(identifiers[, elem, pos, radii, ...])replace_nearest(elem[, pos])rescale(scale)reset_axes([axes])Reset the structure's axes, k-space axes, and center.
reshape_axes(reshaping)ring_graphs(order, **kwargs)rinscribe_cube(*args, **kwargs)rotate(r[, rp, passive, units, check])Arbitrary rotation of the structure.
rotate_plane(plane, angle[, units])rwigner_cube(*args, **kwargs)save([fpath])scalar_displacement(reference)select_twist([selector, tol])shell(cell, neighbors[, direction])shells(identifiers[, radii, exterior, ...])skew(skew)Arbitrary transformation matrix (row-major).
slide(v[, recenter])sorted_keys()space_group_operations([tol, unit])species([symbol])spglib_cell()stretch(s1, s2, s3)translate(v)unique_kpoints([tol, folded])unique_points(points, axes[, weights, tol])unique_points_fast(points, axes[, weights, tol])unique_positions([tol, folded])unsheared_axes([axes, distances])upcast(DerivedStructure)voronoi_neighbors([indices, restrict, ...])warn(msg[, indent])Warning from inside a Nexus class.
write_axes()Write the unit cell axes as a string.
write_fhi_aims([filepath])write_xyz([filepath])Write a
Structureobject to an XYZ filezero_corner()add
add_kmesh
add_kpoints
add_optional
add_symmetrized_kmesh
all_periodic
any_periodic
become_primitive
bounding_box
bravais_lattice_name
check_consistent
check_point_group_operations
check_required
check_tiling
check_types
check_types_optional
class_get
class_has
class_items
class_keys
class_log
class_set
class_set_optional
class_set_single
class_warn
clear
close_log
connected_graphs
copy
copy_from
copy_to
count_kshells
data_repr
delete
delete_optional
delete_required
dict
distance_table
embed
equivalent_atoms
extract
extract_optional
freeze
get
get_atomic_numbers
get_magnetic_moments
get_number_of_atoms
get_optional
get_path
get_required
get_scaled_positions
get_smallest
get_symmetry
get_symmetry_dataset
has_axes
has_folded
has_folded_structure
has_tmatrix
interpolate
inverse
is_frozen
is_magnetic
is_open
is_periodic
is_tiled
items
kgrid_from_kspacing
kmap
kpoints_qmcpack
kpoints_reduced
kpoints_unit
last
list_optional
load
log
makov_payne
min_image_distances
min_image_vectors
move_from
move_from_optional
move_to
move_to_optional
neighbor_table
not_implemented
obj
operate
opt_tilematrix
path_exists
plot2d
plot2d_ax
plot2d_kax
plot2d_kp
plot2d_points
plot2d_pos
point_group_operations
pos_to_cartesian
pos_unit
primitive
random_key
rcell
read
read_cif
read_poscar
read_xsf
read_xyz
remove_folded
remove_folded_structure
rinscribe
rmg_lattice
rmg_transform
rmin
rwigner
select_random
serial
set
set_axes
set_bconds
set_elem
set_folded
set_folded_structure
set_frozen
set_mag
set_operations
set_optional
set_path
set_pos
shallow_copy
show
size
symmetry_data
tile
tile_opt
tile_points
tile_points_brute
tile_points_simple
tilematrix
to_dict
to_obj
transfer_from
transfer_to
tree
tuple
values
vector_table
volume
voronoi_distances
voronoi_radii
voronoi_species_radii
voronoi_vectors
write
write_poscar
write_xsf
See also
StructureAll remaining parameters are passed to this class’s constructor. See its docstring for more details.
- lattice_constants = cubic list hexagonal list monoclinic list orthorhombic list rhombohedral list tetragonal list triclinic list #
Mapping from a lattice type to the required values to create the cell.
- lattices = ['triclinic', 'monoclinic', 'orthorhombic', 'tetragonal', 'hexagonal', 'cubic', 'rhombohedral']#
List of lattice systems.
- centering_types = base_centered tuple body_centered str face_centered str primitive str rhombohedral_centered str #
Mapping from centering types to their Pearson symbol.
- lattice_centerings = cubic list hexagonal list monoclinic list orthorhombic list rhombohedral list tetragonal list triclinic list #
Mapping of lattice systems to allowed centering types.
- centerings = A list B list C list F list I list P list R list #
- cell_types = {'conventional', 'primitive'}#
Types of cells, currently only
primitiveandconventional.
- cell_aliases = conv str prim str #
Mapping from shortened aliases
primandconvto their cell type.
- cell_classes = bcc str cubic str fcc str hex str hexagonal str monoclinic str orthorhombic str rhombohedral str sc str tetragonal str triclinic str #
Mapping from common lattice names to their lattices.
- known_crystals = {('Ca2CuO3', 'conv'): atoms tuple basis list basis_vectors str cell str centering str constants tuple lattice str units str , ('Ca2CuO3', 'prim'): atoms tuple basis list basis_vectors str cell str centering str constants tuple lattice str units str , ('CaO', 'conv'): atoms tuple cell str constants float lattice str , ('CaO', 'prim'): atoms tuple cell str constants float lattice str , ('Cl2Ca2CuO2', 'afm'): atoms list axes list basis list basis_vectors str cell str centering str constants tuple lattice str units str , ('Cl2Ca2CuO2', 'conv'): atoms tuple basis list basis_vectors str cell str centering str constants tuple lattice str units str , ('Cl2Ca2CuO2', 'prim'): atoms tuple basis list basis_vectors str cell str centering str constants tuple lattice str units str , ('CuO', 'conv'): angular_units str atoms tuple basis list basis_vectors str cell str centering str constants tuple lattice str units str , ('CuO', 'prim'): angular_units str atoms tuple basis list basis_vectors str cell str centering str constants tuple lattice str units str , ('CuO2_plane', 'conv'): atoms tuple basis list cell str centering str constants tuple lattice str units str , ('CuO2_plane', 'prim'): atoms tuple basis list cell str centering str constants tuple lattice str units str , ('La2CuO4', 'conv'): atoms tuple basis list cell str centering str constants tuple lattice str units str , ('La2CuO4', 'prim'): atoms tuple basis list cell str centering str constants tuple lattice str units str , ('NaCl', 'conv'): atoms tuple basis list basis_vectors str cell str centering str constants float lattice str units str , ('NaCl', 'prim'): atoms tuple basis list basis_vectors str cell str centering str constants float lattice str units str , ('ZnO', 'conv'): atoms tuple cell str constants tuple lattice str units str , ('ZnO', 'prim'): atoms tuple cell str constants tuple lattice str units str , ('calcium', 'conv'): atoms str cell str centering str constants float lattice str units str , ('calcium', 'prim'): atoms str cell str centering str constants float lattice str units str , ('copper', 'conv'): atoms str cell str centering str constants float lattice str units str , ('copper', 'prim'): atoms str cell str centering str constants float lattice str units str , ('diamond', 'conv'): atoms str basis list cell str centering str constants float lattice str units str , ('diamond', 'fcc'): atoms str basis list cell str centering str constants float lattice str units str , ('diamond', 'prim'): atoms str basis list cell str centering str constants float lattice str units str , ('diamond', 'sc'): atoms str basis list cell str centering str constants float lattice str units str , ('graphene', 'conv'): atoms tuple basis list cell str centering str constants tuple lattice str units str , ('graphene', 'prim'): atoms tuple basis list cell str centering str constants tuple lattice str units str , ('graphene', 'rect'): atoms tuple basis list cell str centering str constants tuple lattice str units str , ('graphite_aa', 'hex'): atoms tuple axes list basis list constants tuple units str , ('graphite_ab', 'hex'): atoms tuple axes list basis list constants tuple cscale tuple units str , ('oxygen', 'conv'): angular_units str atoms tuple basis list basis_vectors ndarray cell str centering str constants tuple lattice str units str , ('oxygen', 'prim'): angular_units str atoms tuple basis list basis_vectors ndarray cell str centering str constants tuple lattice str units str , ('rocksalt', 'conv'): atoms tuple basis list basis_vectors str cell str centering str constants float lattice str units str , ('rocksalt', 'prim'): atoms tuple basis list basis_vectors str cell str centering str constants float lattice str units str , ('wurtzite', 'conv'): atoms tuple basis list cell str centering str constants tuple lattice str units str , ('wurtzite', 'prim'): atoms tuple basis list cell str centering str constants tuple lattice str units str }#
Mapping from material names and their cell types to their crystal information.
- desc = atoms tuple basis list cell str centering str constants tuple lattice str units str #
- cdesc = atoms tuple basis list cell str centering str constants tuple lattice str units str #
- cell = 'rect'#
- lattice = 'rhombohedral'#
- name = 'graphene'#
- class nexus.structure.Jellium(charge=None, background_charge=None, cell=None, volume=None, density=None, rs=None, dim=3, axes=None, kpoints=None, kweights=None, kgrid=None, kshift=None, units=None, tiling=None)[source]#
Bases:
StructureMethods
add_atoms(elem, pos)adjust_axes(axes)append(value)at_Gpoint()at_Lpoint()at_real_kpoint()bond_compression(reference, neighbors)bonds(neighbors[, vectors])boundary([dims, dtol])carve(identifiers)cell_image(p[, center])center_distances(points[, center])center_molecule([rmin_edge])Center a molecule in a unit cell, ensuring equal padding on all sides.
center_solid()change_units(units[, folded])chemical_coordination([indices, nmax, rmax, ...])class_error(message[, header, exit, trace, ...])Report an error relating to a class.
clear_kpoints()cleave(axis, loc[, sep, remove, tol])clone_from(other)corners()Calculate vectors corresponding to the 8 corners of the unit cell.
cube_deviation()displacement(reference[, map])distances([pos1, pos2])distortion(reference, neighbors)error(message[, header, exit, trace])Report an error inside a class.
face_distances()face_vectors([axes, distances])first()fold(small, *requests)fold_pos(large[, tol])get_cell()group_atoms([folded])Group the atoms by their element type, sorting in alphabetical order.
incorporate(other)inside(pos[, axes, center, tol, separate])inversion_symmetrize_kpoints([tol, folded])keys()kfold(tiling, kpoints, kweights)layer_composition(layers)layers([axis, dtol, dbin, plot, composition])list(*keys)locate(identifiers[, radii, exterior])locate_simple(pos)madelung([axes, tol])matrix_transform(A)Arbitrary transformation matrix (column-major).
miller_direction(h, k, l[, normalize])miller_normal(h, k, l[, normalize])min_image_centroid([points, indices])min_image_centroids([points, indices])min_image_norms(points, norms)nearest_neighbors([indices, rmax, nmax, ...])open_log(filepath)order_by_species([folded])ordered_species([symbol])permute(permutation)point_defect([identifiers, elem, dr])pos_to_str([units, with_elem])Write the positions of a structure to a string, optionally with atomic symbols.
project_plane(a1, a2[, points])rcore_max([units])read_fhi_aims(filepath)recenter([center])Center atoms around a new provided center of the unit cell, or if a new center is not provided then use the (0.5 0.5 0.5) point of the unit cell.
recenter_k([kpoints, kaxes, kcenter, ...])Center k-points around the provided center of k-space.
recorner([center])Center atoms around the origin of the cell.
remove(identifiers)rename([folded])Rename element names in a structure.
reorder(order)replace(identifiers[, elem, pos, radii, ...])replace_nearest(elem[, pos])rescale(scale)reset_axes([axes])Reset the structure's axes, k-space axes, and center.
reshape_axes(reshaping)ring_graphs(order, **kwargs)rinscribe_cube(*args, **kwargs)rotate(r[, rp, passive, units, check])Arbitrary rotation of the structure.
rotate_plane(plane, angle[, units])rwigner_cube(*args, **kwargs)save([fpath])scalar_displacement(reference)select_twist([selector, tol])shell(cell, neighbors[, direction])shells(identifiers[, radii, exterior, ...])skew(skew)Arbitrary transformation matrix (row-major).
slide(v[, recenter])sorted_keys()space_group_operations([tol, unit])species([symbol])spglib_cell()stretch(s1, s2, s3)translate(v)unique_kpoints([tol, folded])unique_points(points, axes[, weights, tol])unique_points_fast(points, axes[, weights, tol])unique_positions([tol, folded])unsheared_axes([axes, distances])upcast(DerivedStructure)voronoi_neighbors([indices, restrict, ...])warn(msg[, indent])Warning from inside a Nexus class.
write_axes()Write the unit cell axes as a string.
write_fhi_aims([filepath])write_xyz([filepath])Write a
Structureobject to an XYZ filezero_corner()add
add_kmesh
add_kpoints
add_optional
add_symmetrized_kmesh
all_periodic
any_periodic
become_primitive
bounding_box
bravais_lattice_name
check_consistent
check_point_group_operations
check_required
check_tiling
check_types
check_types_optional
class_get
class_has
class_items
class_keys
class_log
class_set
class_set_optional
class_set_single
class_warn
clear
close_log
connected_graphs
copy
copy_from
copy_to
count_kshells
data_repr
delete
delete_optional
delete_required
density
dict
distance_table
embed
equivalent_atoms
extract
extract_optional
freeze
get
get_atomic_numbers
get_magnetic_moments
get_number_of_atoms
get_optional
get_path
get_required
get_scaled_positions
get_smallest
get_symmetry
get_symmetry_dataset
has_axes
has_folded
has_folded_structure
has_tmatrix
interpolate
inverse
is_frozen
is_magnetic
is_open
is_periodic
is_tiled
items
kgrid_from_kspacing
kmap
kpoints_qmcpack
kpoints_reduced
kpoints_unit
last
list_optional
load
log
makov_payne
min_image_distances
min_image_vectors
move_from
move_from_optional
move_to
move_to_optional
neighbor_table
not_implemented
obj
operate
opt_tilematrix
path_exists
plot2d
plot2d_ax
plot2d_kax
plot2d_kp
plot2d_points
plot2d_pos
point_group_operations
pos_to_cartesian
pos_unit
primitive
random_key
rcell
read
read_cif
read_poscar
read_xsf
read_xyz
remove_folded
remove_folded_structure
rinscribe
rmg_lattice
rmg_transform
rmin
rs
rwigner
select_random
serial
set
set_axes
set_bconds
set_elem
set_folded
set_folded_structure
set_frozen
set_mag
set_operations
set_optional
set_path
set_pos
shallow_copy
show
size
symmetry_data
tile
tile_opt
tile_points
tile_points_brute
tile_points_simple
tilematrix
to_dict
to_obj
transfer_from
transfer_to
tree
tuple
values
vector_table
volume
voronoi_distances
voronoi_radii
voronoi_species_radii
voronoi_vectors
write
write_poscar
write_xsf
- prefactors = 1 float 2 float 3 float #
- nexus.structure.generate_cell(shape, tiling=None, scale=1.0, units=None, struct_type=<class 'nexus.structure.Structure'>)[source]#
- nexus.structure.generate_atom_structure(atom=None, units='A', Lbox=None, skew=0, axes=None, kgrid=(1, 1, 1), kshift=(0, 0, 0), bconds=('n', 'n', 'n'), struct_type=<class 'nexus.structure.Structure'>)[source]#
Create a structure with a single atom in the center of a unit cell.
- Parameters:
- atom
str The atomic symbol of the atom.
- units
str, default=”A” The units of the structure, defaults to Angstroms.
- Lbox
intorfloat, optional Length of the simulation box. Overrides
axes.- skew
intorfloatlessthan1, default=0 …
- axes
ArrayLikeoffloat, optional The unit cell axes.
- kgrid
tupleofint, default=(1,1,1) Number of k-points in each direction. Used to create a Monkhorst-Pack k-point mesh.
- kshift
tupleofint, default=(0,0,0) Vector to use to translate the k-points in the mesh.
- bconds
tupleofstr, default=(“n”,”n”,”n”) Boundary conditions for the resulting structure.
- atom
- nexus.structure.generate_dimer_structure(dimer=None, units='A', separation=None, Lbox=None, skew=0, axes=None, kgrid=(1, 1, 1), kshift=(0, 0, 0), bconds=('n', 'n', 'n'), struct_type=<class 'nexus.structure.Structure'>, axis='x')[source]#
Create a structure with a dimer in the center of a unit cell.
- Parameters:
- dimer
listofstr The atomic symbols of the atoms in the dimer.
- units
str, default=”A” The units of the structure, defaults to Angstroms.
- separation
intorfloat The separation between the atoms in the dimer.
- Lbox
intorfloat, optional Length of the simulation box. Overrides
axes.- skew
intorfloatlessthan1, default=0 …
- axes
ArrayLikeoffloat, optional The unit cell axes.
- kgrid
tupleofint, default=(1,1,1) Number of k-points in each direction. Used to create a Monkhorst-Pack k-point mesh.
- kshift
tupleofint, default=(0,0,0) Vector to use to translate the k-points in the mesh.
- bconds
tupleofstr, default=(“n”,”n”,”n”) Boundary conditions for the resulting structure.
- axis{“x”, “y”, “z”}, optional
The axis that the dimer is aligned on.
- dimer
- nexus.structure.generate_trimer_structure(trimer=None, units='A', separation=None, angle=None, Lbox=None, skew=0, axes=None, kgrid=(1, 1, 1), kshift=(0, 0, 0), struct_type=<class 'nexus.structure.Structure'>, axis='x', axis2='y', angular_units='degrees', plane_rot=None)[source]#
Create a structure with a dimer in the center of a unit cell.
- Parameters:
- trimer
listofstr The atomic symbols of the atoms in the trimer.
- units
str, default=”A” The units of the structure, defaults to Angstroms.
- separation
listofintsorfloats The separation between the atoms in the trimer. The first value is the distance between atom 1 and atom 2, and the second value is the distance between atom 1 and atom 3.
- angle
intorfloat The angle formed by the three atoms in the trimer.
- Lbox
intorfloat, optional Length of the simulation box. Overrides
axes.- skew
intorfloatlessthan1, default=0 …
- axes
ArrayLikeoffloat, optional The unit cell axes.
- kgrid
tupleofint, default=(1,1,1) Number of k-points in each direction. Used to create a Monkhorst-Pack k-point mesh.
- kshift
tupleofint, default=(0,0,0) Vector to use to translate the k-points in the mesh.
- axis{“x”, “y”, “z”}, optional
The axis that atom 1 and atom 2 of the trimer is aligned on.
- axis2{“x”, “y”, “z”}, optional
The axis that atom 1 and atom 3 of the trimer is aligned on.
- angular_units{“degrees”, “rad”, “radians”}, optional
The units of the supplied angle.
- trimer
- nexus.structure.generate_crystal_structure(lattice=None, cell=None, centering=None, constants=None, atoms=None, basis=None, basis_vectors=None, tiling=None, cscale=None, axes=None, units=None, angular_units='degrees', mag=None, kpoints=None, kweights=None, kgrid=None, kshift=(0, 0, 0), permute=None, operations=None, struct_type=<class 'nexus.structure.Crystal'>, elem=None, pos=None, frozen=None, posu=None, elem_pos=None, folded_elem=None, folded_pos=None, folded_units=None, use_prim=None, add_kpath=False, symm_kgrid=False, structure=None, shape=None, element=None, scale=None)[source]#
Generate a crystal structure.
See
CrystalandStructurefor a description of the available parameters.