httk.atomistic package¶
Subpackages¶
Submodules¶
httk.atomistic.assignment module¶

class
httk.atomistic.assignment.
Assignment
(atomic_number, weight, ratio, magnetic_moment)[source]¶ Bases:
httk.core.httkobject.HttkObject
Represents a possible vector of assignments

classmethod
create
(siteassignment=None, atom=None, weight=None, ratio=None, magnetic_moment=[None, None, None])[source]¶  Create a new siteassignment object
 site: integer for the site number that this atom is assigned to atomic number or symbol

symbol
¶

classmethod
httk.atomistic.assignments module¶

class
httk.atomistic.assignments.
Assignments
(siteassignments, extensions=[])[source]¶ Bases:
httk.core.httkobject.HttkObject
Represents a possible vector of assignments

atomic_numbers
¶

classmethod
create
(assignments=None)[source]¶  Create a new assignment object,
 assignments: a liststyle object with one entry per ‘atom type’. Any sensible type accepted, most notably,
 integers (for atom number)

extended
¶

ratios
¶

ratioslist
¶

symbollists
¶

symbols
¶

httk.atomistic.cell module¶

class
httk.atomistic.cell.
Cell
(basis, lattice_system, orientation=1)[source]¶ Bases:
httk.core.httkobject.HttkObject
Represents a cell (e.g., a unitcell, but also possibly just the basis vectors of a nonperiodic system)
(The ability to represent the cell for a nonperiodic system is also the reason this class is not called Lattice.)

classmethod
create
(cell=None, basis=None, metric=None, niggli_matrix=None, a=None, b=None, c=None, alpha=None, beta=None, gamma=None, lengths=None, angles=None, cosangles=None, scale=None, scaling=None, volume=None, periodicity=None, nonperiodic_vecs=None, orientation=1, hall=None, lattice_system=None, eps=0)[source]¶ Create a new cell object,
cell: any one of the following:
 a 3x3 array with (in rows) the three basis vectors of the cell (a nonperiodic system should conventionally use an identity matrix)
 a dict with a single key ‘niggli_matrix’ with a 3x2 array with the Niggli Matrix representation of the cell
 a dict with 6 keys, ‘a’, ‘b’, ‘c’, ‘alpha’, ‘beta’, ‘gamma’ giving the cell parameters as floats
 scaling: free form input parsed for a scale.
 positive value = multiply basis vectors by this value negative value = rescale basis vectors so that cell volume becomes abs(value).
scale: set to nonNone to multiply all cell vectors with this factor
volume: set to nonNone if the basis vectors only give directions, and the volume of the cell should be this value (overrides scale)
 periodicity: free form input parsed for periodicity
 sequence: True/False for each basis vector being periodic integer: number of nonperiodic basis vectors
hall: giving the hall symbol makes it possible to determine the lattice system without numerical inaccuracy
lattice_system: any one of: ‘cubic’, ‘hexagonal’, ‘tetragonal’, ‘orthorhombic’, ‘trigonal’, ‘triclinic’, ‘monoclinic’, ‘unknown’

normalization_longestvec_scale
¶ Get the factor with which a normalized version of this cell needs to be multiplied to reproduce this cell.
I.e. self = (normalization_scale)*self.get_normalized()

normalization_scale
¶

volume
¶

classmethod
httk.atomistic.cellshape module¶

class
httk.atomistic.cellshape.
CellShape
(niggli_matrix, orientation=1, basis=None)[source]¶ Bases:
httk.core.httkobject.HttkObject
Represents a cell (e.g., a unitcell, but also possibly just the basis vectors of a nonperiodic system)

basis
¶

classmethod
create
(cellshape=None, basis=None, metric=None, niggli_matrix=None, a=None, b=None, c=None, alpha=None, beta=None, gamma=None, lengths=None, angles=None, scale=None, scaling=None, volume=None, periodicity=None, nonperiodic_vecs=None, orientation=1)[source]¶ Create a new cell object,
cell: any one of the following:
 a 3x3 array with (in rows) the three basis vectors of the cell (a nonperiodic system should conventionally use an identity matrix)
 a dict with a single key ‘niggli_matrix’ with a 3x2 array with the Niggli Matrix representation of the cell
 a dict with 6 keys, ‘a’, ‘b’, ‘c’, ‘alpha’, ‘beta’, ‘gamma’ giving the cell parameters as floats
 scaling: free form input parsed for a scale.
 positive value = multiply basis vectors by this value negative value = rescale basis vectors so that cell volume becomes abs(value).
scale: set to nonNone to multiply all cell vectors with this factor
volume: set to nonNone if the basis vectors only give directions, and the volume of the cell should be this value (overrides scale)
 periodicity: free form input parsed for periodicity
 sequence: True/False for each basis vector being periodic integer: number of nonperiodic basis vectors

httk.atomistic.cellutils module¶

httk.atomistic.cellutils.
get_primitive_to_conventional_basis_transform
(basis, eps=0.0001)[source]¶ Figures out how the ‘likley’ transform of a primitive cell for getting to the conventional basis
This may not be foolproof, and mostly works for reinverting cells generated by lengths_and_cosangles_to_conventional_basis. (It should only be used when getting something that isn’t really the conventional cell does not equal catastrophic failure, just, e.g., a nonoptimal representation.)

httk.atomistic.cellutils.
lattice_system_from_lengths_and_cosangles
(lengths, cosangles, eps=0)[source]¶ Identifies lattice system from a list of cell axis lengths and cosine of angles between them Returns string: ‘cubic’, ‘tetragonal’, ‘orthorombic’, ‘hexagonal’, ‘monoclinic’, ‘rhombohedral’ or ‘triclinic’
Note: if axis order is not the standard one (e.g., gamma=120 for hexagonal), the lattice system will come out as triclinic. This way the outcome matches corresponding standard hall symbols, otherwise hall symbol and generated cells not technically match.
If you seek to reorder axes to the standard order, use standard_order_axes_transform on your basis matrix first.

httk.atomistic.cellutils.
lattice_system_from_niggli
(niggli_matrix, eps=0)[source]¶ Identifies lattice system from niggli matrix. Returns string: ‘cubic’, ‘tetragonal’, ‘orthorombic’, ‘hexagonal’, ‘monoclinic’, ‘rhombohedral’ or ‘triclinic’
Note: if axis order is not the standard one (e.g., gamma=120 for hexagonal), the lattice system will come out as triclinic. This way the outcome matches corresponding standard hall symbols, otherwise hall symbol and generated cells not technically match.
If you seek to reorder axes to the standard order, use standard_order_axes_transform on your basis matrix first.

httk.atomistic.cellutils.
lengths_and_cosangles_to_conventional_basis
(lengths, cosangles, lattice_system=None, orientation=1, eps=0)[source]¶ Returns the conventional cell basis given a list of lengths and cosine of angles
Note: if your basis vector order does not follow the conventions for hexagonal and monoclinic cells, you get the triclinic conventional cell.
Conventions: in hexagonal cell gamma=120 degrees, i.e, cosangles[2]=1/2, in monoclinic cells beta =/= 90 degrees.

httk.atomistic.cellutils.
niggli_to_conventional_basis
(niggli_matrix, lattice_system=None, orientation=1, eps=0.0001)[source]¶ Returns the conventional cell given a niggli_matrix
Note: if your basis vector order does not follow the conventions for hexagonal and monoclinic cells, you get the triclinic conventional cell.
Conventions: in hexagonal cell gamma=120 degrees., in monoclinic cells beta =/= 90 degrees.

httk.atomistic.cellutils.
standard_order_axes_transform
(niggli_matrix, lattice_system, eps=0, return_identity_if_no_transform_needed=False)[source]¶ Returns the transform that reorders the axes to standard order for each possible lattice system.
Note: returns None if no transform is needed, to make it easy to skip the transform in that case. If you want the identity matrix instead, set parameter return_identity_if_no_transform_needed = True,
httk.atomistic.compound module¶

class
httk.atomistic.compound.
Compound
(element_wyckoff_sequence, formula, spacegroup_number, extended, extensions, wyckoff_sequence, anonymous_wyckoff_sequence, anonymous_formula, formula_symbols, formula_counts, pbc)[source]¶ Bases:
httk.core.httkobject.HttkObject

anonymous_formula
¶

anonymous_wyckoff_sequence
¶

classmethod
create
(base_on_structure=None, lift_tags=True, lift_refs=True)[source]¶ struct: Structure object which forms the basis of this object

formula_counts
¶

formula_symbols
¶

number_of_elements
¶

wyckoff_sequence
¶

httk.atomistic.formulautils module¶
httk.atomistic.representativesites module¶

class
httk.atomistic.representativesites.
RepresentativeSites
(reduced_coordgroups=None, cartesian_coordgroups=None, reduced_coords=None, cartesian_coords=None, counts=None, hall_symbol=None, pbc=None, wyckoff_symbols=None, multiplicities=None)[source]¶ Bases:
httk.atomistic.sites.Sites
Represents any collection of sites in a unitcell

anonymous_wyckoff_sequence
¶

classmethod
create
(sites=None, reduced_coordgroups=None, reduced_coords=None, counts=None, spacegroup=None, hall_symbol=None, spacegroupnumber=None, setting=None, periodicity=None, wyckoff_symbols=None, multiplicities=None, occupancies=None, pbc=None)[source]¶

crystal_system
¶

lattice_symbol
¶

lattice_system
¶

total_number_of_atoms
¶

wyckoff_sequence
¶

httk.atomistic.representativestructure module¶

class
httk.atomistic.representativestructure.
RepresentativeStructure
(assignments, rc_sites=None, rc_cell=None)[source]¶ Bases:
httk.core.httkobject.HttkObject
A RepresentativeStructure represents N sites of, e.g., atoms or ions, in any periodic or nonperiodic arrangement. It keeps track of a set of representative atoms in a unit cell (the conventional cell) and the symmetry group / operations that are to be applied to them to get all atoms.
This is meant to be a lightweight Structure object. For a heavyweight with more functionality, use Structure.
The RepresentativeStructure object is meant to be immutable and assumes that no internal variables are changed after its creation. All methods that ‘changes’ the object creates and returns a new, updated, structure object.

classmethod
create
(structure=None, rc_cell=None, rc_basis=None, rc_lengths=None, rc_angles=None, rc_niggli_matrix=None, rc_metric=None, rc_a=None, rc_b=None, rc_c=None, rc_alpha=None, rc_beta=None, rc_gamma=None, rc_sites=None, rc_reduced_coordgroups=None, rc_cartesian_coordgroups=None, rc_reduced_coords=None, rc_cartesian_coords=None, rc_reduced_occupationscoords=None, rc_cartesian_occupationscoords=None, rc_occupancies=None, rc_counts=None, wyckoff_symbols=None, multiplicities=None, spacegroup=None, hall_symbol=None, spacegroupnumber=None, setting=None, rc_scale=None, rc_scaling=None, rc_volume=None, vol_per_atom=None, assignments=None, periodicity=None, nonperiodic_vecs=None, refs=None, tags=None)[source]¶ A Structure represents N sites of, e.g., atoms or ions, in any periodic or nonperiodic arrangement.
This is a swissarmytype constructor that allows a selection between a large number of optional arguments.
 To create a new structure, three primary components are:
 cell: defines the basis vectors in which reduced coordinates are expressed, and the
 unit of repetition (if the structure has any periodicity  see the ‘periodicity’ parameter)
 assignments: a list of ‘things’ (atoms, ions, etc.) that goes on the sites in the structure
 sites: a sensible representation of location / coordinates of the sites.
Note: rc_prefixes are consistently enforced for any quantity that would be different in a UnitcellStructure. This is to allow for painless change between the various structuretype objects without worrying about accidently using the wrong type of sites object.
Input parameters:
ONE OF: ‘cell’; ‘basis’, ‘length_and_angles’; ‘niggli_matrix’; ‘metric’; all of: a,b,c, alpha, beta, gamma. (cell requires a Cell object or a very specific format, so unless you know what you are doing, use one of the others.)
ONE OF: ‘assignments’, ‘atomic_numbers’, ‘occupancies’ (assignments requires an Assignments object or a sequence.), occupations repeats similar site assignments as needed
ONE OF: ‘rc_sites’, ‘rc_coords’ (IF rc_occupations OR rc_counts are also given), ‘uc_coords’ (IF uc_occupations OR uc_counts are also given) ‘rc_B_C’, where B=reduced or cartesian, C=coordgroups, coords, or occupationscoords
Notes:
 occupationscoords may differ from coords by order, since giving occupations as, e.g., [‘H’,’O’,’H’] does not necessarily have the same order of the coordinates as the format of counts+coords as (2,1), [‘H’,’O’].
 rc_sites and uc_sites requires a Sites object or a very specific format, so unless you know what you are doing, use one of the others.)
 ONE OF: scale or volume:
scale = multiply the basis vectors with this scaling factor, volume = the representative (conventional) cell volume (overrides ‘scale’ if both are given) volume_per_atom = cell volume / number of atoms
ONE OF periodicity or nonperiodic_vecs
See help(Structure) for more information on the data format of all these data representations.

formula_builder
¶

pbc
¶

rc_a
¶

rc_alpha
¶

rc_b
¶

rc_basis
¶

rc_beta
¶

rc_c
¶

rc_cartesian_coordgroups
¶

rc_cartesian_coords
¶

rc_cartesian_occupationscoords
¶

rc_cell_orientation
¶

rc_gamma
¶

rc_lengths_and_angles
¶

rc_volume
¶

uc_volume_per_atom
¶

classmethod
httk.atomistic.siteassignment module¶

class
httk.atomistic.siteassignment.
SiteAssignment
(assignments)[source]¶ Bases:
httk.core.httkobject.HttkObject
Represents a possible vector of assignments

atomic_number
¶

atomic_numbers
¶

classmethod
create
(assignments=None)[source]¶  Create a new assignment object,
 assignments: a liststyle object with one entry per ‘atom type’. Any sensible type accepted, most notably,
 integers (for atom number)

ratio
¶

ratios
¶

symbol
¶

symbols
¶

httk.atomistic.sites module¶

class
httk.atomistic.sites.
Sites
(reduced_coordgroups=None, reduced_coords=None, counts=None, hall_symbol=None, pbc=None)[source]¶ Bases:
httk.core.httkobject.HttkObject
Represents any collection of sites in a unitcell

anonymous_formula
¶

coords_groupnumber
¶

counts
¶

classmethod
create
(sites=None, reduced_coordgroups=None, reduced_coords=None, counts=None, occupancies=None, spacegroup=None, hall_symbol=None, spacegroupnumber=None, setting=None, pbc=None, periodicity=None)[source]¶ Create a new sites object

reduced_coordgroups
¶

reduced_coords
¶

total_number_of_atoms
¶

httk.atomistic.sitesutils module¶

httk.atomistic.sitesutils.
coordgroups_reduced_to_unitcell
(coordgroups, hall_symbol, eps=Fraction(1, 1000))[source]¶
httk.atomistic.spacegroup module¶

class
httk.atomistic.spacegroup.
Spacegroup
(hall_symbol)[source]¶ Bases:
httk.core.httkobject.HttkObject
Represents a spacegroup

classmethod
create
(spacegroup=None, hall_symbol=None, hm_symbol=None, spacegroupnumber=None, setting=None, symops=None)[source]¶ Create a new spacegroup object,
Give ONE OF hall_symbol or spacegroup.
hall_symbol = a string giving the hall symbol of the spacegroup
 spacegroup = a spacegroup on any reasonable format that can be parsed, e.g.,
 an integer (spacegroup number)
setting = if only a spacegroup number is given, this allows also specifying a setting.

number
¶

number_and_setting
¶

classmethod
httk.atomistic.spacegrouputils module¶

httk.atomistic.spacegrouputils.
spacegroup_filter_specific
(hall=None, hm=None, itcnbr=None, setting=None, symops=None, halls=None)[source]¶

httk.atomistic.spacegrouputils.
trivial_symmetry_reduce
(coordgroups)[source]¶ Looks for ‘trivial’ ways to reduce the coordinates in the given coordgroups by a standard set of symmetry operations. This is not a symmetry finder (and it is not intended to be), but for a standard primitive cell taken from a standard conventional cell, it reverses the primitive unit cell coordgroups into the symmetry reduced coordgroups.
httk.atomistic.structure module¶

class
httk.atomistic.structure.
Structure
(assignments, rc_sites=None, rc_cell=None, other_reps=None)[source]¶ Bases:
httk.core.httkobject.HttkObject
A Structure represents N sites of, e.g., atoms or ions, in any periodic or nonperiodic arrangement. The structure object is meant to be immutable and assumes that no internal variables are changed after its creation. All methods that ‘changes’ the object creates and returns a new, updated, structure object.
This is the general heavy weight structure object. For lightweight structure objects, use UnitcellStructure or RepresentativeStructure.
Naming conventions in httk.atomistic:
 Structure cell type abbreviations:
 rc = Representative cell: only representative atoms are given inside the conventional cell.
 they need to be replicated by the symmetry elements.
 uc = Unit cell: any (imprecisely defined) unit cell (usually the unit cell used to define the structure
 if it was not done via a representative cell.) with all atoms inside.
pc = Primitive unit cell: a smallest possible unit cell (the standard one) with all atoms inside.
cc = Conventional unit cell: the high symmetry unit cell (rc) with all atoms inside.
 For cells:
 cell = an abstract name for any reasonable representation of a ‘cell’ that defines
 the basis vectors used for representing the structure. When a ‘cell’ is returned, it is an object of type Cell
basis = a 3x3 sequencetype with (in rows) the three basis vectors (for a periodic system, defining the unit cell, and defines the unit of repetition for the periodic dimensions)
lengths_and_angles = (a,b,c,alpha,beta,gamma): the basis vector lengths and angles
niggli_matrix = ((v1*v1, v2*v2, v3*v3),(2*v2*v3, 2*v1*v3, 2*v2*v3)) where v1, v2, v3 are the vectors forming the basis
metric = ((v1*v1,v1*v2,v1*v3),(v2*v1,v2*v2,v2*v3),(v3*v1,v3*v2,v3*v3))
 For sites:
 These following prefixes are used to describe types of site specifications:
representative cell/rc = only representative atoms are given, which are then to be repeated by structure symmetry group to give all sites
unit cell/uc = all atoms in unitcell
reduced = coordinates given in cell vectors
cartesian = coordinates given as direct cartesian coordinates
 sites = used as an abstract name for any sensible representation of a list of coordinates and a cell,
 when a ‘sites’ is returned, it is an object of type Sites
counts = number of atoms of each type (one per entry in assignments)
coordgroups = coordinates represented as a 3levellist of coordinates, e.g. [[[0,0,0],[0.5,0.5,0.5]],[[0.25,0.25,0.25]]] where level1 list = groups: one group for each equivalent atom
counts and coords = one list with the number of atoms of each type (one per entry in assignments) and a 2level list of coordinates.
 For assignments of atoms, etc. to sites:
assignments = abstract name for any representation of assignment of atoms. When returned, will be object of type Assignment.
atomic_numbers = a sequence of integers for the atomic number of each species
occupations = a sequence where the assignments are repeated for each coordinate as needed (prefixed with uc or rc depending on which coordinates)
 For cell scaling:
scaling = abstract name for any representation of cell scaling
scale = multiply all basis vectors with this number
volume = rescaling the cell such that it takes this volume
 For periodicity:
periodicity = abstract name of a representation of periodicity
pbc = ‘periodic boundary conditions’ = sequence of True and False for which basis vectors are periodic / nonperiodic
nonperiodic_vecs = integer, number of basis vectors, counted from the first, which are nonperiodic
 For spacegroup:
spacegroup = abstract name for any spacegroup representation. When returned, is of type Spacegroup.
hall_symbol = specifically the hall_symbol string representation of the spacegroup

anonymous_formula
¶

anonymous_wyckoff_sequence
¶

cc
¶

cc_formula_parts
¶

classmethod
create
(structure=None, assignments=None, rc_cell=None, rc_basis=None, rc_lengths=None, rc_angles=None, rc_cosangles=None, rc_niggli_matrix=None, rc_metric=None, rc_a=None, rc_b=None, rc_c=None, rc_alpha=None, rc_beta=None, rc_gamma=None, rc_sites=None, rc_reduced_coordgroups=None, rc_cartesian_coordgroups=None, rc_reduced_coords=None, rc_cartesian_coords=None, rc_reduced_occupationscoords=None, rc_cartesian_occupationscoords=None, rc_occupancies=None, rc_counts=None, wyckoff_symbols=None, multiplicities=None, spacegroup=None, hall_symbol=None, spacegroupnumber=None, setting=None, rc_scale=None, rc_scaling=None, rc_volume=None, uc_cell=None, uc_basis=None, uc_lengths=None, uc_angles=None, uc_cosangles=None, uc_niggli_matrix=None, uc_metric=None, uc_a=None, uc_b=None, uc_c=None, uc_alpha=None, uc_beta=None, uc_gamma=None, uc_sites=None, uc_reduced_coordgroups=None, uc_cartesian_coordgroups=None, uc_reduced_coords=None, uc_cartesian_coords=None, uc_reduced_occupationscoords=None, uc_cartesian_occupationscoords=None, uc_occupancies=None, uc_counts=None, uc_scale=None, uc_scaling=None, uc_volume=None, uc_is_primitive_cell=False, uc_is_conventional_cell=False, volume_per_atom=None, periodicity=None, nonperiodic_vecs=None, refs=None, tags=None)[source]¶ A Structure represents N sites of, e.g., atoms or ions, in any periodic or nonperiodic arrangement.
This is a swissarmytype constructor that allows a selection between a large number of optional arguments.
Note: if redundant and noncompatible information is given, the behavior is undefined. E.g., don’t try to call this with a structure + a volume in hopes to get a copy with rescaled volume.
 To create a new structure, three primary components are:
 cell: defines the basis vectors in which reduced coordinates are expressed, and the
 unit of repetition (if the structure has any periodicity  see the ‘periodicity’ parameter)
 assignments: a list of ‘things’ (atoms, ions, etc.) that goes on the sites in the structure
 sites: a sensible representation of location / coordinates of the sites.
Note: rc_prefixes are consistently enforced for any quantity that would be different in a UnitcellStructure. This is to allow for painless change between the various structuretype objects without worrying about accidently using the wrong type of sites object.
Input parameters:
ONE OF: ‘cell’; ‘basis’, ‘length_and_angles’; ‘niggli_matrix’; ‘metric’; all of: a,b,c, alpha, beta, gamma. (cell requires a Cell object or a very specific format, so unless you know what you are doing, use one of the others.)
ONE OF: ‘assignments’, ‘atomic_numbers’, ‘occupancies’ (assignments requires an Assignments object or a sequence.), occupations repeats similar site assignments as needed
ONE OF: ‘rc_sites’, ‘rc_coords’ (IF rc_occupations OR rc_counts are also given), ‘uc_coords’ (IF uc_occupations OR uc_counts are also given) ‘rc_B_C’, where B=reduced or cartesian, C=coordgroups, coords, or occupationscoords
Notes:
 occupationscoords may differ from coords by order, since giving occupations as, e.g., [‘H’,’O’,’H’] does not necessarily have the same order of the coordinates as the format of counts+coords as (2,1), [‘H’,’O’].
 rc_sites and uc_sites requires a Sites object or a very specific format, so unless you know what you are doing, use one of the others.)
 ONE OF: scale or volume:
scale = multiply the basis vectors with this scaling factor, volume = the representative (conventional) cell volume (overrides ‘scale’ if both are given) volume_per_atom = cell volume / number of atoms
ONE OF periodicity or nonperiodic_vecs
See help(Structure) for more information on the data format of all these data representations.

element_wyckoff_sequence
¶

extended
¶

extensions
¶

formula
¶

formula_counts
¶

formula_spaceseparated
¶

formula_symbols
¶

hall_symbol
¶

has_rc_repr
¶ Returns True if the structure already contains the representative coordinates + spacegroup, and thus can be queried for this data without launching an expensive symmetry finder operation.

has_uc_repr
¶ Returns True if the structure contains any unit celltype coordinate representation, and thus can be queried for this data without launching a somewhat expensive cell filling operation.

io
¶

number_of_elements
¶

pbc
¶

pc
¶

pc_a
¶

pc_alpha
¶

pc_b
¶

pc_beta
¶

pc_c
¶

pc_counts
¶

pc_formula_parts
¶

pc_gamma
¶

pc_nbr_atoms
¶

pc_volume
¶

rc
¶

rc_a
¶

rc_alpha
¶

rc_b
¶

rc_basis
¶

rc_beta
¶

rc_c
¶

rc_cartesian_coordgroups
¶

rc_cartesian_coords
¶

rc_cartesian_occupationscoords
¶

rc_cell_orientation
¶

rc_counts
¶

rc_gamma
¶

rc_lengths_and_angles
¶

rc_nbr_atoms
¶

rc_occupancies
¶

rc_occupationssymbols
¶

rc_reduced_coordgroups
¶

rc_reduced_coords
¶

rc_volume
¶

spacegroup
¶

spacegroup_number
¶

spacegroup_number_and_setting
¶

supercell
¶

symbols
¶

uc
¶

uc_a
¶

uc_alpha
¶

uc_b
¶

uc_basis
¶

uc_beta
¶

uc_c
¶

uc_cartesian_coordgroups
¶

uc_cartesian_coords
¶

uc_cartesian_occupationscoords
¶

uc_cell
¶

uc_cell_orientation
¶

uc_counts
¶

uc_formula_counts
¶

uc_formula_parts
¶

uc_formula_symbols
¶

uc_gamma
¶

uc_lengths_and_angles
¶

uc_nbr_atoms
¶

uc_occupancies
¶

uc_occupationssymbols
¶

uc_reduced_coordgroups
¶

uc_reduced_coords
¶

uc_reduced_occupationscoords
¶

uc_sites
¶

uc_volume
¶

volume_per_atom
¶

wyckoff_sequence
¶
httk.atomistic.structurephasediagram module¶

class
httk.atomistic.structurephasediagram.
StructurePhaseDiagram
(structures, energies, hull_indices, competing_indices, hull_competing_indices, hull_distances, coord_system, phase_lines)[source]¶ Bases:
httk.core.httkobject.HttkObject
Represents a phase diagram of structures
httk.atomistic.structureutils module¶

httk.atomistic.structureutils.
coordgroups_and_assignments_to_coords_and_occupancies
(coordgroups, assignments)[source]¶

httk.atomistic.structureutils.
coordgroups_and_assignments_to_symbols
(coordgroups, assignmentobj)[source]¶ Return a list of atomic symbols, repeated as needed

httk.atomistic.structureutils.
coordgroups_reduced_rc_to_unitcellsites
(coordgroups, basis, hall_symbol, backends=['cif2cell', 'internal', 'ase'])[source]¶

httk.atomistic.structureutils.
coordgroups_reduced_uc_to_representative
(coordgroups, basis, backends=['isotropy'])[source]¶

httk.atomistic.structureutils.
coords_and_occupancies_to_coordgroups_and_assignments
(coords, occupancies)[source]¶

httk.atomistic.structureutils.
get_primitive_basis_transform
(hall_symbol)[source]¶ Transform to be applied to conventional unit cell to give the primitive unit cell

httk.atomistic.structureutils.
internal_coordgroups_reduced_rc_to_unitcellsites
(coordgroups, basis, hall_symbol, eps=0.001)[source]¶

httk.atomistic.structureutils.
occupations_and_coords_to_assignments_and_coordgroups
(occupationscoords, occupations)[source]¶
httk.atomistic.supercellutils module¶

httk.atomistic.supercellutils.
build_cubic_supercell
(structure, tolerance=None, max_search_cells=1000)[source]¶

httk.atomistic.supercellutils.
build_orthogonal_supercell
(structure, tolerance=None, max_search_cells=1000, ortho=[True, True, True])[source]¶
httk.atomistic.unitcellsites module¶

class
httk.atomistic.unitcellsites.
UnitcellSites
(reduced_coordgroups=None, reduced_coords=None, counts=None, hall_symbol='P 1', pbc=None)[source]¶ Bases:
httk.atomistic.sites.Sites
Represents any collection of sites in a unitcell

total_number_of_atoms
¶

httk.atomistic.unitcellstructure module¶

class
httk.atomistic.unitcellstructure.
UnitcellStructure
(assignments=None, uc_sites=None, uc_cell=None)[source]¶ Bases:
httk.core.httkobject.HttkObject
A UnitcellStructure represents N sites of, e.g., atoms or ions, in any periodic or nonperiodic arrangement. It keeps track of all the copies of the atoms within a unitcell.
The structure object is meant to be immutable and assumes that no internal variables are changed after its creation. All methods that ‘changes’ the object creates and returns a new, updated, structure object.
Naming conventions in httk.atomistic:
 For cells:
 cell = an abstract name for any reasonable representation of a ‘cell’ that defines
 the basis vectors used for representing the structure. When a ‘cell’ is returned, it is an object of type Cell
basis = a 3x3 sequencetype with (in rows) the three basis vectors (for a periodic system, defining the unit cell, and defines the unit of repetition for the periodic dimensions)
lengths_and_angles = (a,b,c,alpha,beta,gamma): the basis vector lengths and angles
niggli_matrix = ((v1*v1, v2*v2, v3*v3),(2*v2*v3, 2*v1*v3, 2*v2*v3)) where v1, v2, v3 are the vectors forming the basis
metric = ((v1*v1,v1*v2,v1*v3),(v2*v1,v2*v2,v2*v3),(v3*v1,v3*v2,v3*v3))
 For sites:
 These following prefixes are used to describe types of site specifications:
representative cell/rc = only representative atoms are given, which are then to be repeated by structure symmetry group to give all sites
unit cell/uc = all atoms in unitcell
reduced = coordinates given in cell vectors
cartesian = coordinates given as direct cartesian coordinates
 sites = used as an abstract name for any sensible representation of a list of coordinates and a cell,
 when a ‘sites’ is returned, it is an object of type Sites
counts = number of atoms of each type (one per entry in assignments)
coordgroups = coordinates represented as a 3levellist of coordinates, e.g. [[[0,0,0],[0.5,0.5,0.5]],[[0.25,0.25,0.25]]] where level1 list = groups: one group for each equivalent atom
counts and coords = one list with the number of atoms of each type (one per entry in assignments) and a 2level list of coordinates.
 For assignments of atoms, etc. to sites:
assignments = abstract name for any representation of assignment of atoms. When returned, will be object of type Assignment.
atomic_numbers = a sequence of integers for the atomic number of each species
occupations = a sequence where the assignments are repeated for each coordinate as needed (prefixed with uc or rc depending on which coordinates)
 For cell scaling:
scaling = abstract name for any representation of cell scaling
scale = multiply all basis vectors with this number
volume = rescaling the cell such that it takes this volume
 For periodicity:
periodicity = abstract name of a representation of periodicity
pbc = ‘periodic boundary conditions’ = sequence of True and False for which basis vectors are periodic / nonperiodic
nonperiodic_vecs = integer, number of basis vectors, counted from the first, which are nonperiodic
 For spacegroup:
spacegroup = abstract name for any spacegroup representation. When returned, is of type Spacegroup.
hall_symbol = specifically the hall_symbol string representation of the spacegroup

classmethod
create
(structure=None, uc_cell=None, uc_basis=None, uc_lengths=None, uc_angles=None, uc_niggli_matrix=None, uc_metric=None, uc_a=None, uc_b=None, uc_c=None, uc_alpha=None, uc_beta=None, uc_gamma=None, uc_sites=None, uc_reduced_coordgroups=None, uc_cartesian_coordgroups=None, uc_reduced_coords=None, uc_cartesian_coords=None, uc_reduced_occupationscoords=None, uc_cartesian_occupationscoords=None, uc_occupancies=None, uc_counts=None, uc_scale=None, uc_scaling=None, uc_volume=None, volume_per_atom=None, assignments=None, periodicity=None, nonperiodic_vecs=None, other_reps=None, refs=None, tags=None)[source]¶ A FullStructure represents N sites of, e.g., atoms or ions, in any periodic or nonperiodic arrangement, where the positions of all cites are given (as opposed to a set of unique sites + symmetry operations).
This is a swissarmytype constructor that allows several different ways to create a FullStructure object.
To create a new structure, three primary components are:
 cell: defines the basis vectors in which reduced coordinates are expressed, and the unit of repetition (if the structure has any periodicity  see the ‘periodicity’ parameter)
 assignments: a list of ‘things’ (atoms, ions, etc.) that goes on the sites in the structure
 sites: a sensible representation of location / coordinates of the sites.
Note: uc_prefixes are consistently enforced for any quantity that would be different in a UniqueSitesStructure. This is to allow for painless change between the various structuretype objects without worrying about accidently using the wrong type of sites object.
Note: see help(Structure) for parameter naming conventions, i.e., what type of object is expected given a parameter name.
Input parameters:
ONE OF: ‘uc_cell’; ‘uc_basis’, ‘uc_length_and_angles’; ‘uc_niggli_matrix’; ‘uc_metric’; all of: uc_a,uc_b,uc_c, uc_alpha, uc_beta, uc_gamma. (cell requires a Cell object or a very specific format, so unless you know what you are doing, use one of the others.)
ONE OF: ‘uc_assignments’, ‘uc_atomic_numbers’, ‘uc_occupations’ (uc_assignments requires an Assignments object or a sequence.), uc_occupations repeats similar site assignments as needed
ONE OF: ‘uc_sites’, ‘uc_coords’ (IF uc_occupations OR uc_counts are also given), or ‘uc_B_C’, where B=reduced or cartesian, C=coordgroups, coords, or occupationscoords
Notes:
 occupationscoords may differ from coords by order, since giving occupations as, e.g., [‘H’,’O’,’H’] does not necessarily have the same order of the coordinates as the format of counts+coords as (2,1), [‘H’,’O’].
 uc_sites requires a Sites object or a python list on a very specific format, (so unless you know what you are doing, use one of the others.)
 ONE OF: uc_scale, uc_volume, or volume_per_atom:
scale = multiply the basis vectors with this scaling factor, volume = the unit cell volume (overrides ‘scale’ if both are given) volume_per_atom = cell volume / number of atoms
ONE OF periodicity or nonperiodic_vecs

formula_builder
¶

pbc
¶

supercell
¶

uc_a
¶

uc_alpha
¶

uc_b
¶

uc_basis
¶

uc_beta
¶

uc_c
¶

uc_cartesian_coordgroups
¶

uc_cartesian_coords
¶

uc_cartesian_occupationscoords
¶

uc_cell_orientation
¶

uc_counts
¶

uc_gamma
¶

uc_lengths_and_angles
¶

uc_reduced_coordgroups
¶

uc_reduced_coords
¶

uc_volume
¶

uc_volume_per_atom
¶
Module contents¶
The httk.atomistic package
Classes and utilities for dealing with highthroughput calculations of atomistic systems.

class
httk.atomistic.
Structure
(assignments, rc_sites=None, rc_cell=None, other_reps=None)[source]¶ Bases:
httk.core.httkobject.HttkObject
A Structure represents N sites of, e.g., atoms or ions, in any periodic or nonperiodic arrangement. The structure object is meant to be immutable and assumes that no internal variables are changed after its creation. All methods that ‘changes’ the object creates and returns a new, updated, structure object.
This is the general heavy weight structure object. For lightweight structure objects, use UnitcellStructure or RepresentativeStructure.
Naming conventions in httk.atomistic:
 Structure cell type abbreviations:
 rc = Representative cell: only representative atoms are given inside the conventional cell.
 they need to be replicated by the symmetry elements.
 uc = Unit cell: any (imprecisely defined) unit cell (usually the unit cell used to define the structure
 if it was not done via a representative cell.) with all atoms inside.
pc = Primitive unit cell: a smallest possible unit cell (the standard one) with all atoms inside.
cc = Conventional unit cell: the high symmetry unit cell (rc) with all atoms inside.
 For cells:
 cell = an abstract name for any reasonable representation of a ‘cell’ that defines
 the basis vectors used for representing the structure. When a ‘cell’ is returned, it is an object of type Cell
basis = a 3x3 sequencetype with (in rows) the three basis vectors (for a periodic system, defining the unit cell, and defines the unit of repetition for the periodic dimensions)
lengths_and_angles = (a,b,c,alpha,beta,gamma): the basis vector lengths and angles
niggli_matrix = ((v1*v1, v2*v2, v3*v3),(2*v2*v3, 2*v1*v3, 2*v2*v3)) where v1, v2, v3 are the vectors forming the basis
metric = ((v1*v1,v1*v2,v1*v3),(v2*v1,v2*v2,v2*v3),(v3*v1,v3*v2,v3*v3))
 For sites:
 These following prefixes are used to describe types of site specifications:
representative cell/rc = only representative atoms are given, which are then to be repeated by structure symmetry group to give all sites
unit cell/uc = all atoms in unitcell
reduced = coordinates given in cell vectors
cartesian = coordinates given as direct cartesian coordinates
 sites = used as an abstract name for any sensible representation of a list of coordinates and a cell,
 when a ‘sites’ is returned, it is an object of type Sites
counts = number of atoms of each type (one per entry in assignments)
coordgroups = coordinates represented as a 3levellist of coordinates, e.g. [[[0,0,0],[0.5,0.5,0.5]],[[0.25,0.25,0.25]]] where level1 list = groups: one group for each equivalent atom
counts and coords = one list with the number of atoms of each type (one per entry in assignments) and a 2level list of coordinates.
 For assignments of atoms, etc. to sites:
assignments = abstract name for any representation of assignment of atoms. When returned, will be object of type Assignment.
atomic_numbers = a sequence of integers for the atomic number of each species
occupations = a sequence where the assignments are repeated for each coordinate as needed (prefixed with uc or rc depending on which coordinates)
 For cell scaling:
scaling = abstract name for any representation of cell scaling
scale = multiply all basis vectors with this number
volume = rescaling the cell such that it takes this volume
 For periodicity:
periodicity = abstract name of a representation of periodicity
pbc = ‘periodic boundary conditions’ = sequence of True and False for which basis vectors are periodic / nonperiodic
nonperiodic_vecs = integer, number of basis vectors, counted from the first, which are nonperiodic
 For spacegroup:
spacegroup = abstract name for any spacegroup representation. When returned, is of type Spacegroup.
hall_symbol = specifically the hall_symbol string representation of the spacegroup

anonymous_formula
¶

anonymous_wyckoff_sequence
¶

cc
¶

cc_formula_parts
¶

classmethod
create
(structure=None, assignments=None, rc_cell=None, rc_basis=None, rc_lengths=None, rc_angles=None, rc_cosangles=None, rc_niggli_matrix=None, rc_metric=None, rc_a=None, rc_b=None, rc_c=None, rc_alpha=None, rc_beta=None, rc_gamma=None, rc_sites=None, rc_reduced_coordgroups=None, rc_cartesian_coordgroups=None, rc_reduced_coords=None, rc_cartesian_coords=None, rc_reduced_occupationscoords=None, rc_cartesian_occupationscoords=None, rc_occupancies=None, rc_counts=None, wyckoff_symbols=None, multiplicities=None, spacegroup=None, hall_symbol=None, spacegroupnumber=None, setting=None, rc_scale=None, rc_scaling=None, rc_volume=None, uc_cell=None, uc_basis=None, uc_lengths=None, uc_angles=None, uc_cosangles=None, uc_niggli_matrix=None, uc_metric=None, uc_a=None, uc_b=None, uc_c=None, uc_alpha=None, uc_beta=None, uc_gamma=None, uc_sites=None, uc_reduced_coordgroups=None, uc_cartesian_coordgroups=None, uc_reduced_coords=None, uc_cartesian_coords=None, uc_reduced_occupationscoords=None, uc_cartesian_occupationscoords=None, uc_occupancies=None, uc_counts=None, uc_scale=None, uc_scaling=None, uc_volume=None, uc_is_primitive_cell=False, uc_is_conventional_cell=False, volume_per_atom=None, periodicity=None, nonperiodic_vecs=None, refs=None, tags=None)[source]¶ A Structure represents N sites of, e.g., atoms or ions, in any periodic or nonperiodic arrangement.
This is a swissarmytype constructor that allows a selection between a large number of optional arguments.
Note: if redundant and noncompatible information is given, the behavior is undefined. E.g., don’t try to call this with a structure + a volume in hopes to get a copy with rescaled volume.
 To create a new structure, three primary components are:
 cell: defines the basis vectors in which reduced coordinates are expressed, and the
 unit of repetition (if the structure has any periodicity  see the ‘periodicity’ parameter)
 assignments: a list of ‘things’ (atoms, ions, etc.) that goes on the sites in the structure
 sites: a sensible representation of location / coordinates of the sites.
Note: rc_prefixes are consistently enforced for any quantity that would be different in a UnitcellStructure. This is to allow for painless change between the various structuretype objects without worrying about accidently using the wrong type of sites object.
Input parameters:
ONE OF: ‘cell’; ‘basis’, ‘length_and_angles’; ‘niggli_matrix’; ‘metric’; all of: a,b,c, alpha, beta, gamma. (cell requires a Cell object or a very specific format, so unless you know what you are doing, use one of the others.)
ONE OF: ‘assignments’, ‘atomic_numbers’, ‘occupancies’ (assignments requires an Assignments object or a sequence.), occupations repeats similar site assignments as needed
ONE OF: ‘rc_sites’, ‘rc_coords’ (IF rc_occupations OR rc_counts are also given), ‘uc_coords’ (IF uc_occupations OR uc_counts are also given) ‘rc_B_C’, where B=reduced or cartesian, C=coordgroups, coords, or occupationscoords
Notes:
 occupationscoords may differ from coords by order, since giving occupations as, e.g., [‘H’,’O’,’H’] does not necessarily have the same order of the coordinates as the format of counts+coords as (2,1), [‘H’,’O’].
 rc_sites and uc_sites requires a Sites object or a very specific format, so unless you know what you are doing, use one of the others.)
 ONE OF: scale or volume:
scale = multiply the basis vectors with this scaling factor, volume = the representative (conventional) cell volume (overrides ‘scale’ if both are given) volume_per_atom = cell volume / number of atoms
ONE OF periodicity or nonperiodic_vecs
See help(Structure) for more information on the data format of all these data representations.

element_wyckoff_sequence
¶

extended
¶

extensions
¶

formula
¶

formula_counts
¶

formula_spaceseparated
¶

formula_symbols
¶

hall_symbol
¶

has_rc_repr
¶ Returns True if the structure already contains the representative coordinates + spacegroup, and thus can be queried for this data without launching an expensive symmetry finder operation.

has_uc_repr
¶ Returns True if the structure contains any unit celltype coordinate representation, and thus can be queried for this data without launching a somewhat expensive cell filling operation.

io
¶

number_of_elements
¶

pbc
¶

pc
¶

pc_a
¶

pc_alpha
¶

pc_b
¶

pc_beta
¶

pc_c
¶

pc_counts
¶

pc_formula_parts
¶

pc_gamma
¶

pc_nbr_atoms
¶

pc_volume
¶

rc
¶

rc_a
¶

rc_alpha
¶

rc_b
¶

rc_basis
¶

rc_beta
¶

rc_c
¶

rc_cartesian_coordgroups
¶

rc_cartesian_coords
¶

rc_cartesian_occupationscoords
¶

rc_cell_orientation
¶

rc_counts
¶

rc_gamma
¶

rc_lengths_and_angles
¶

rc_nbr_atoms
¶

rc_occupancies
¶

rc_occupationssymbols
¶

rc_reduced_coordgroups
¶

rc_reduced_coords
¶

rc_volume
¶

spacegroup
¶

spacegroup_number
¶

spacegroup_number_and_setting
¶

supercell
¶

symbols
¶

uc
¶

uc_a
¶

uc_alpha
¶

uc_b
¶

uc_basis
¶

uc_beta
¶

uc_c
¶

uc_cartesian_coordgroups
¶

uc_cartesian_coords
¶

uc_cartesian_occupationscoords
¶

uc_cell
¶

uc_cell_orientation
¶

uc_counts
¶

uc_formula_counts
¶

uc_formula_parts
¶

uc_formula_symbols
¶

uc_gamma
¶

uc_lengths_and_angles
¶

uc_nbr_atoms
¶

uc_occupancies
¶

uc_occupationssymbols
¶

uc_reduced_coordgroups
¶

uc_reduced_coords
¶

uc_reduced_occupationscoords
¶

uc_sites
¶

uc_volume
¶

volume_per_atom
¶

wyckoff_sequence
¶

class
httk.atomistic.
Cell
(basis, lattice_system, orientation=1)[source]¶ Bases:
httk.core.httkobject.HttkObject
Represents a cell (e.g., a unitcell, but also possibly just the basis vectors of a nonperiodic system)
(The ability to represent the cell for a nonperiodic system is also the reason this class is not called Lattice.)

classmethod
create
(cell=None, basis=None, metric=None, niggli_matrix=None, a=None, b=None, c=None, alpha=None, beta=None, gamma=None, lengths=None, angles=None, cosangles=None, scale=None, scaling=None, volume=None, periodicity=None, nonperiodic_vecs=None, orientation=1, hall=None, lattice_system=None, eps=0)[source]¶ Create a new cell object,
cell: any one of the following:
 a 3x3 array with (in rows) the three basis vectors of the cell (a nonperiodic system should conventionally use an identity matrix)
 a dict with a single key ‘niggli_matrix’ with a 3x2 array with the Niggli Matrix representation of the cell
 a dict with 6 keys, ‘a’, ‘b’, ‘c’, ‘alpha’, ‘beta’, ‘gamma’ giving the cell parameters as floats
 scaling: free form input parsed for a scale.
 positive value = multiply basis vectors by this value negative value = rescale basis vectors so that cell volume becomes abs(value).
scale: set to nonNone to multiply all cell vectors with this factor
volume: set to nonNone if the basis vectors only give directions, and the volume of the cell should be this value (overrides scale)
 periodicity: free form input parsed for periodicity
 sequence: True/False for each basis vector being periodic integer: number of nonperiodic basis vectors
hall: giving the hall symbol makes it possible to determine the lattice system without numerical inaccuracy
lattice_system: any one of: ‘cubic’, ‘hexagonal’, ‘tetragonal’, ‘orthorhombic’, ‘trigonal’, ‘triclinic’, ‘monoclinic’, ‘unknown’

normalization_longestvec_scale
¶ Get the factor with which a normalized version of this cell needs to be multiplied to reproduce this cell.
I.e. self = (normalization_scale)*self.get_normalized()

normalization_scale
¶

volume
¶

classmethod

class
httk.atomistic.
RepresentativeSites
(reduced_coordgroups=None, cartesian_coordgroups=None, reduced_coords=None, cartesian_coords=None, counts=None, hall_symbol=None, pbc=None, wyckoff_symbols=None, multiplicities=None)[source]¶ Bases:
httk.atomistic.sites.Sites
Represents any collection of sites in a unitcell

anonymous_wyckoff_sequence
¶

classmethod
create
(sites=None, reduced_coordgroups=None, reduced_coords=None, counts=None, spacegroup=None, hall_symbol=None, spacegroupnumber=None, setting=None, periodicity=None, wyckoff_symbols=None, multiplicities=None, occupancies=None, pbc=None)[source]¶

crystal_system
¶

lattice_symbol
¶

lattice_system
¶

total_number_of_atoms
¶

wyckoff_sequence
¶


class
httk.atomistic.
UnitcellSites
(reduced_coordgroups=None, reduced_coords=None, counts=None, hall_symbol='P 1', pbc=None)[source]¶ Bases:
httk.atomistic.sites.Sites
Represents any collection of sites in a unitcell

total_number_of_atoms
¶


class
httk.atomistic.
Assignments
(siteassignments, extensions=[])[source]¶ Bases:
httk.core.httkobject.HttkObject
Represents a possible vector of assignments

atomic_numbers
¶

classmethod
create
(assignments=None)[source]¶  Create a new assignment object,
 assignments: a liststyle object with one entry per ‘atom type’. Any sensible type accepted, most notably,
 integers (for atom number)

extended
¶

ratios
¶

ratioslist
¶

symbollists
¶

symbols
¶


class
httk.atomistic.
Compound
(element_wyckoff_sequence, formula, spacegroup_number, extended, extensions, wyckoff_sequence, anonymous_wyckoff_sequence, anonymous_formula, formula_symbols, formula_counts, pbc)[source]¶ Bases:
httk.core.httkobject.HttkObject

anonymous_formula
¶

anonymous_wyckoff_sequence
¶

classmethod
create
(base_on_structure=None, lift_tags=True, lift_refs=True)[source]¶ struct: Structure object which forms the basis of this object

formula_counts
¶

formula_symbols
¶

number_of_elements
¶

wyckoff_sequence
¶


class
httk.atomistic.
StructurePhaseDiagram
(structures, energies, hull_indices, competing_indices, hull_competing_indices, hull_distances, coord_system, phase_lines)[source]¶ Bases:
httk.core.httkobject.HttkObject
Represents a phase diagram of structures

class
httk.atomistic.
UnitcellStructure
(assignments=None, uc_sites=None, uc_cell=None)[source]¶ Bases:
httk.core.httkobject.HttkObject
A UnitcellStructure represents N sites of, e.g., atoms or ions, in any periodic or nonperiodic arrangement. It keeps track of all the copies of the atoms within a unitcell.
The structure object is meant to be immutable and assumes that no internal variables are changed after its creation. All methods that ‘changes’ the object creates and returns a new, updated, structure object.
Naming conventions in httk.atomistic:
 For cells:
 cell = an abstract name for any reasonable representation of a ‘cell’ that defines
 the basis vectors used for representing the structure. When a ‘cell’ is returned, it is an object of type Cell
basis = a 3x3 sequencetype with (in rows) the three basis vectors (for a periodic system, defining the unit cell, and defines the unit of repetition for the periodic dimensions)
lengths_and_angles = (a,b,c,alpha,beta,gamma): the basis vector lengths and angles
niggli_matrix = ((v1*v1, v2*v2, v3*v3),(2*v2*v3, 2*v1*v3, 2*v2*v3)) where v1, v2, v3 are the vectors forming the basis
metric = ((v1*v1,v1*v2,v1*v3),(v2*v1,v2*v2,v2*v3),(v3*v1,v3*v2,v3*v3))
 For sites:
 These following prefixes are used to describe types of site specifications:
representative cell/rc = only representative atoms are given, which are then to be repeated by structure symmetry group to give all sites
unit cell/uc = all atoms in unitcell
reduced = coordinates given in cell vectors
cartesian = coordinates given as direct cartesian coordinates
 sites = used as an abstract name for any sensible representation of a list of coordinates and a cell,
 when a ‘sites’ is returned, it is an object of type Sites
counts = number of atoms of each type (one per entry in assignments)
coordgroups = coordinates represented as a 3levellist of coordinates, e.g. [[[0,0,0],[0.5,0.5,0.5]],[[0.25,0.25,0.25]]] where level1 list = groups: one group for each equivalent atom
counts and coords = one list with the number of atoms of each type (one per entry in assignments) and a 2level list of coordinates.
 For assignments of atoms, etc. to sites:
assignments = abstract name for any representation of assignment of atoms. When returned, will be object of type Assignment.
atomic_numbers = a sequence of integers for the atomic number of each species
occupations = a sequence where the assignments are repeated for each coordinate as needed (prefixed with uc or rc depending on which coordinates)
 For cell scaling:
scaling = abstract name for any representation of cell scaling
scale = multiply all basis vectors with this number
volume = rescaling the cell such that it takes this volume
 For periodicity:
periodicity = abstract name of a representation of periodicity
pbc = ‘periodic boundary conditions’ = sequence of True and False for which basis vectors are periodic / nonperiodic
nonperiodic_vecs = integer, number of basis vectors, counted from the first, which are nonperiodic
 For spacegroup:
spacegroup = abstract name for any spacegroup representation. When returned, is of type Spacegroup.
hall_symbol = specifically the hall_symbol string representation of the spacegroup

classmethod
create
(structure=None, uc_cell=None, uc_basis=None, uc_lengths=None, uc_angles=None, uc_niggli_matrix=None, uc_metric=None, uc_a=None, uc_b=None, uc_c=None, uc_alpha=None, uc_beta=None, uc_gamma=None, uc_sites=None, uc_reduced_coordgroups=None, uc_cartesian_coordgroups=None, uc_reduced_coords=None, uc_cartesian_coords=None, uc_reduced_occupationscoords=None, uc_cartesian_occupationscoords=None, uc_occupancies=None, uc_counts=None, uc_scale=None, uc_scaling=None, uc_volume=None, volume_per_atom=None, assignments=None, periodicity=None, nonperiodic_vecs=None, other_reps=None, refs=None, tags=None)[source]¶ A FullStructure represents N sites of, e.g., atoms or ions, in any periodic or nonperiodic arrangement, where the positions of all cites are given (as opposed to a set of unique sites + symmetry operations).
This is a swissarmytype constructor that allows several different ways to create a FullStructure object.
To create a new structure, three primary components are:
 cell: defines the basis vectors in which reduced coordinates are expressed, and the unit of repetition (if the structure has any periodicity  see the ‘periodicity’ parameter)
 assignments: a list of ‘things’ (atoms, ions, etc.) that goes on the sites in the structure
 sites: a sensible representation of location / coordinates of the sites.
Note: uc_prefixes are consistently enforced for any quantity that would be different in a UniqueSitesStructure. This is to allow for painless change between the various structuretype objects without worrying about accidently using the wrong type of sites object.
Note: see help(Structure) for parameter naming conventions, i.e., what type of object is expected given a parameter name.
Input parameters:
ONE OF: ‘uc_cell’; ‘uc_basis’, ‘uc_length_and_angles’; ‘uc_niggli_matrix’; ‘uc_metric’; all of: uc_a,uc_b,uc_c, uc_alpha, uc_beta, uc_gamma. (cell requires a Cell object or a very specific format, so unless you know what you are doing, use one of the others.)
ONE OF: ‘uc_assignments’, ‘uc_atomic_numbers’, ‘uc_occupations’ (uc_assignments requires an Assignments object or a sequence.), uc_occupations repeats similar site assignments as needed
ONE OF: ‘uc_sites’, ‘uc_coords’ (IF uc_occupations OR uc_counts are also given), or ‘uc_B_C’, where B=reduced or cartesian, C=coordgroups, coords, or occupationscoords
Notes:
 occupationscoords may differ from coords by order, since giving occupations as, e.g., [‘H’,’O’,’H’] does not necessarily have the same order of the coordinates as the format of counts+coords as (2,1), [‘H’,’O’].
 uc_sites requires a Sites object or a python list on a very specific format, (so unless you know what you are doing, use one of the others.)
 ONE OF: uc_scale, uc_volume, or volume_per_atom:
scale = multiply the basis vectors with this scaling factor, volume = the unit cell volume (overrides ‘scale’ if both are given) volume_per_atom = cell volume / number of atoms
ONE OF periodicity or nonperiodic_vecs

formula_builder
¶

pbc
¶

supercell
¶

uc_a
¶

uc_alpha
¶

uc_b
¶

uc_basis
¶

uc_beta
¶

uc_c
¶

uc_cartesian_coordgroups
¶

uc_cartesian_coords
¶

uc_cartesian_occupationscoords
¶

uc_cell_orientation
¶

uc_counts
¶

uc_gamma
¶

uc_lengths_and_angles
¶

uc_reduced_coordgroups
¶

uc_reduced_coords
¶

uc_volume
¶

uc_volume_per_atom
¶

class
httk.atomistic.
RepresentativeStructure
(assignments, rc_sites=None, rc_cell=None)[source]¶ Bases:
httk.core.httkobject.HttkObject
A RepresentativeStructure represents N sites of, e.g., atoms or ions, in any periodic or nonperiodic arrangement. It keeps track of a set of representative atoms in a unit cell (the conventional cell) and the symmetry group / operations that are to be applied to them to get all atoms.
This is meant to be a lightweight Structure object. For a heavyweight with more functionality, use Structure.
The RepresentativeStructure object is meant to be immutable and assumes that no internal variables are changed after its creation. All methods that ‘changes’ the object creates and returns a new, updated, structure object.

classmethod
create
(structure=None, rc_cell=None, rc_basis=None, rc_lengths=None, rc_angles=None, rc_niggli_matrix=None, rc_metric=None, rc_a=None, rc_b=None, rc_c=None, rc_alpha=None, rc_beta=None, rc_gamma=None, rc_sites=None, rc_reduced_coordgroups=None, rc_cartesian_coordgroups=None, rc_reduced_coords=None, rc_cartesian_coords=None, rc_reduced_occupationscoords=None, rc_cartesian_occupationscoords=None, rc_occupancies=None, rc_counts=None, wyckoff_symbols=None, multiplicities=None, spacegroup=None, hall_symbol=None, spacegroupnumber=None, setting=None, rc_scale=None, rc_scaling=None, rc_volume=None, vol_per_atom=None, assignments=None, periodicity=None, nonperiodic_vecs=None, refs=None, tags=None)[source]¶ A Structure represents N sites of, e.g., atoms or ions, in any periodic or nonperiodic arrangement.
This is a swissarmytype constructor that allows a selection between a large number of optional arguments.
 To create a new structure, three primary components are:
 cell: defines the basis vectors in which reduced coordinates are expressed, and the
 unit of repetition (if the structure has any periodicity  see the ‘periodicity’ parameter)
 assignments: a list of ‘things’ (atoms, ions, etc.) that goes on the sites in the structure
 sites: a sensible representation of location / coordinates of the sites.
Note: rc_prefixes are consistently enforced for any quantity that would be different in a UnitcellStructure. This is to allow for painless change between the various structuretype objects without worrying about accidently using the wrong type of sites object.
Input parameters:
ONE OF: ‘cell’; ‘basis’, ‘length_and_angles’; ‘niggli_matrix’; ‘metric’; all of: a,b,c, alpha, beta, gamma. (cell requires a Cell object or a very specific format, so unless you know what you are doing, use one of the others.)
ONE OF: ‘assignments’, ‘atomic_numbers’, ‘occupancies’ (assignments requires an Assignments object or a sequence.), occupations repeats similar site assignments as needed
ONE OF: ‘rc_sites’, ‘rc_coords’ (IF rc_occupations OR rc_counts are also given), ‘uc_coords’ (IF uc_occupations OR uc_counts are also given) ‘rc_B_C’, where B=reduced or cartesian, C=coordgroups, coords, or occupationscoords
Notes:
 occupationscoords may differ from coords by order, since giving occupations as, e.g., [‘H’,’O’,’H’] does not necessarily have the same order of the coordinates as the format of counts+coords as (2,1), [‘H’,’O’].
 rc_sites and uc_sites requires a Sites object or a very specific format, so unless you know what you are doing, use one of the others.)
 ONE OF: scale or volume:
scale = multiply the basis vectors with this scaling factor, volume = the representative (conventional) cell volume (overrides ‘scale’ if both are given) volume_per_atom = cell volume / number of atoms
ONE OF periodicity or nonperiodic_vecs
See help(Structure) for more information on the data format of all these data representations.

formula_builder
¶

pbc
¶

rc_a
¶

rc_alpha
¶

rc_b
¶

rc_basis
¶

rc_beta
¶

rc_c
¶

rc_cartesian_coordgroups
¶

rc_cartesian_coords
¶

rc_cartesian_occupationscoords
¶

rc_cell_orientation
¶

rc_gamma
¶

rc_lengths_and_angles
¶

rc_volume
¶

uc_volume_per_atom
¶

classmethod