httk.atomistic package

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
get_extensions()[source]
get_weight()[source]
symbol
classmethod use(old)[source]
httk.atomistic.assignment.main()[source]

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 list-style object with one entry per ‘atom type’. Any sensible type accepted, most notably,
integers (for atom number)
extended
ratios
ratioslist
symbollists
symbols
to_basis()[source]
classmethod use(old)[source]
httk.atomistic.assignments.main()[source]

httk.atomistic.cell module

class httk.atomistic.cell.Cell(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 non-periodic system)

basis
clean()[source]
coordgroups_cartesian_to_reduced(coordgroups)[source]
coordgroups_reduced_to_cartesian(coordgroups)[source]
coords_cartesian_to_reduced(coords)[source]
coords_reduced_to_cartesian(coords)[source]
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, scale=None, scaling=None, volume=None, periodicity=None, nonperiodic_vecs=None, orientation=1, lattice_system=None)[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 non-periodic 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 non-None to multiply all cell vectors with this factor

volume: set to non-None 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 non-periodic basis vectors
get_normalized()[source]
is_point_inside(cartesian_coord)[source]
normalization_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()

scaling()[source]
volume
httk.atomistic.cell.main()[source]

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 non-periodic system)

basis
clean()[source]
coordgroups_cartesian_to_reduced(coordgroups)[source]
coordgroups_reduced_to_cartesian(coordgroups)[source]
coords_cartesian_to_reduced(coords)[source]
coords_reduced_to_cartesian(coords)[source]
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 non-periodic 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 non-None to multiply all cell vectors with this factor

volume: set to non-None 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 non-periodic basis vectors
is_point_inside(cartesian_coord)[source]
scaling()[source]
httk.atomistic.cellshape.main()[source]

httk.atomistic.cellutils module

httk.atomistic.cellutils.basis_determinant(basis)[source]
httk.atomistic.cellutils.basis_to_niggli(basis)[source]
httk.atomistic.cellutils.cell_to_basis(cell)[source]
httk.atomistic.cellutils.lengths_angles_to_niggli(lengths, angles)[source]
httk.atomistic.cellutils.main()[source]
httk.atomistic.cellutils.metric_to_niggli(cell)[source]
httk.atomistic.cellutils.niggli_scale_to_vol(niggli_matrix, scale)[source]
httk.atomistic.cellutils.niggli_to_basis(niggli_matrix, orientation=1)[source]
httk.atomistic.cellutils.niggli_to_lengths_angles(niggli_matrix)[source]
httk.atomistic.cellutils.niggli_to_metric(niggli)[source]
httk.atomistic.cellutils.scale_to_vol(basis, scale)[source]
httk.atomistic.cellutils.scaling_to_volume(basis, scaling)[source]
httk.atomistic.cellutils.vol_to_scale(basis, vol)[source]

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

add_name(name)[source]
add_names(names)[source]
add_ref(ref)[source]
add_refs(refs)[source]
add_tag(tag, val)[source]
add_tags(tags)[source]
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
get_names()[source]
get_refs()[source]
get_tag(tag)[source]
get_tags()[source]
number_of_elements
wyckoff_sequence
class httk.atomistic.compound.CompoundName(compound, name)[source]

Bases: httk.core.httkobject.HttkObject

class httk.atomistic.compound.CompoundRef(compound, reference)[source]

Bases: httk.core.httkobject.HttkObject

class httk.atomistic.compound.CompoundStructure(compound, structure)[source]

Bases: httk.core.httkobject.HttkObject

classmethod create(compound, structure)[source]
class httk.atomistic.compound.CompoundTag(compound, tag, value)[source]

Bases: httk.core.httkobject.HttkObject

class httk.atomistic.compound.ComputationRelatedCompound(computation, compound)[source]

Bases: httk.core.httkobject.HttkObject

classmethod create(computation, compound)[source]
httk.atomistic.compound.main()[source]

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)[source]

Bases: httk.atomistic.sites.Sites

Represents any collection of sites in a unitcell

anonymous_wyckoff_sequence
clean()[source]
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, occupancies=None)[source]
tidy()[source]
wyckoff_sequence
httk.atomistic.representativesites.main()[source]

httk.atomistic.scalelessstructure module

class httk.atomistic.scalelessstructure.ScalelessStructure(assignments, rc_sites=None, uc_sites=None)[source]

Bases: httk.core.httkobject.HttkObject

A ScalelessStructure is the same as a Structre object, only that it does NOT carry information about the cell (no rc_cell or uc_cell).

add_rc_cell(cell)[source]
add_rc_cells(cells)[source]
add_ref(ref)[source]
add_refs(refs)[source]
add_tag(tag, val)[source]
add_tags(tags)[source]
anonymous_formula
anonymous_wyckoff_sequence
clean()[source]
classmethod create(structure=None, uc_cellshape=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_reduced_coords=None, uc_reduced_occupationscoords=None, uc_occupancies=None, uc_counts=None, rc_cellshape=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_reduced_coords=None, rc_reduced_occupationscoords=None, rc_occupancies=None, rc_counts=None, wyckoff_symbols=None, spacegroup=None, hall_symbol=None, spacegroupnumber=None, setting=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 non-periodic arrangement.

This is a swiss-army-type 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.

However, two options exists for representing the sites; either as only giving the representative sites, which when the symmetry operations of the spacegroup are applied generates all sites, or, simply giving the primcell set of sites. Since conversion between these are computationally expensive and only strictly ‘approximate’. Hence, sites is divided accordingly into rc_sites and uc_sites keeping track of the two representations.

Input:

  • 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’, ‘uc_sites’, ‘rc_coords’ (IF rc_occupations OR rc_counts are also given), ‘uc_coords’ (IF uc_occupations OR uc_counts are also given) ‘A_B_C’, where A=representative or primcell, B=reduced or cartesian, C=coordgroups, coords, or occupationscoords

    Notes:

    • occupationscoords may differ to coords by order, since giving occupations as, e.g., [‘H’,’O’,’H’] requires a re-ordering of coordinates to 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: ‘spacegroup’ or ‘hall_symbol’, or neither (in which case spacegroup is regarded as unknown)

  • ONE OF: scale or volume: scale = multiply the basis vectors with this scaling factor, volume = rescale the cell into this volume (overrides ‘scale’ if both are given)

  • 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
fill_cell()[source]

Make sure this structure has a unitcell representation. I.e., run an algorithm to copy the representative atoms throughout the unitcell.

(This method exists as a user friendly name for simply asking for the property self.uc_sites, which does the same; i.e. fills the cell if this representation is not yet known.)

find_symetry()[source]

Make sure this structure has a representative cell representation. I.e., run an algorithm to find symmetries.

(This method exists as a user friendly name for simply asking for the property self.rc_sites, which does the same. i.e. finds the crystal symmetries if this representation is not yet known.)

formula
formula_counts
formula_symbols
get_rc_cells()[source]
get_refs()[source]
get_tag(tag)[source]
get_tags()[source]
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 the primcell coordinate representation, and thus can be queried for this data without launching a somewhat expensive cell filling operation.

io
number_of_elements
rc_counts
rc_formula
rc_nbr_atoms
rc_occupancies
rc_occupationssymbols
rc_reduced_coordgroups
rc_reduced_coords
rc_sites
spacegroup_number
spacegroup_number_and_setting
spacegroupobj
symbols
tidy()[source]
uc_counts
uc_formula
uc_formula_counts
uc_formula_parts
uc_formula_symbols
uc_nbr_atoms
uc_occupancies
uc_occupationssymbols
uc_reduced_coordgroups
uc_reduced_coords
uc_reduced_occupationscoords
uc_sites
vis
wyckoff_sequence
class httk.atomistic.scalelessstructure.SlStructureCell(structure, cell)[source]

Bases: httk.core.httkobject.HttkObject

classmethod create(cell, structure=None)[source]
class httk.atomistic.scalelessstructure.SlStructureRef(structure, reference)[source]

Bases: httk.core.httkobject.HttkObject

class httk.atomistic.scalelessstructure.SlStructureTag(structure, tag, value)[source]

Bases: httk.core.httkobject.HttkObject

httk.atomistic.scalelessstructure.main()[source]

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 list-style object with one entry per ‘atom type’. Any sensible type accepted, most notably,
integers (for atom number)
get_extensions()[source]
ratio
ratios
symbol
symbols
to_basis()[source]
classmethod use(old)[source]
httk.atomistic.siteassignment.main()[source]

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
clean()[source]
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, periodicity=None)[source]

Create a new sites object

get_cartesian_coordgroups(cell)[source]
get_cartesian_coords(scale)[source]
reduced_coordgroups
reduced_coords
classmethod use(old, cell=None, hall_symbol=None, periodicity=None)[source]
httk.atomistic.sites.main()[source]

httk.atomistic.sitesutils module

httk.atomistic.sitesutils.abstract_symbol(count)[source]
httk.atomistic.sitesutils.anonymous_formula(filled_counts)[source]
httk.atomistic.sitesutils.clean_coordgroups_and_assignments(coordgroups, assignments)[source]
httk.atomistic.sitesutils.coordgroups_cartesian_to_reduced(coordgroups, basis)[source]
httk.atomistic.sitesutils.coordgroups_reduced_to_cartesian(cell, coordgroups)[source]
httk.atomistic.sitesutils.coordgroups_to_coords(coordgroups)[source]
httk.atomistic.sitesutils.coords_and_counts_to_coordgroups(coords, counts)[source]
httk.atomistic.sitesutils.coords_and_occupancies_to_coordgroups_and_assignments(coords, occupancies)[source]
httk.atomistic.sitesutils.coords_reduced_to_cartesian(cell, coords)[source]
httk.atomistic.sitesutils.coords_to_coordgroups(coords, counts)[source]
httk.atomistic.sitesutils.coordswap(fromidx, toidx, cell, coordgroups)[source]
httk.atomistic.sitesutils.main()[source]
httk.atomistic.sitesutils.normalized_formula_parts(assignments, ratios, counts)[source]
httk.atomistic.sitesutils.pbc_to_nonperiodic_vecs(pbc)[source]
httk.atomistic.sitesutils.periodicity_to_pbc(periodicity)[source]
httk.atomistic.sitesutils.sites_tidy(sites, backends=['platon'])[source]
httk.atomistic.sitesutils.sort_coordgroups(coordgroups, individual_data)[source]
httk.atomistic.sitesutils.structure_reduced_coordgroups_to_representative(coordgroups, cell, spacegroup, backends=['isotropy'])[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, spacegroupnumber=None, setting=1)[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.

spacegroup_number_and_setting
httk.atomistic.spacegroup.main()[source]

httk.atomistic.spacegrouputils module

httk.atomistic.spacegrouputils.any_to_hall_symbol(spacegroup, setting=1)[source]
httk.atomistic.spacegrouputils.find_index(parse)[source]
httk.atomistic.spacegrouputils.hall_rotation_term(code, prev_order, prev_axis_type, nbr_rotations, vector)[source]
httk.atomistic.spacegrouputils.main()[source]
httk.atomistic.spacegrouputils.parse_hall_symbol(hall_symbol)[source]
httk.atomistic.spacegrouputils.spacegroup_get_hall(parse)[source]
httk.atomistic.spacegrouputils.spacegroup_get_hm(parse)[source]
httk.atomistic.spacegrouputils.spacegroup_get_number(parse)[source]
httk.atomistic.spacegrouputils.spacegroup_get_number_and_setting(parse)[source]
httk.atomistic.spacegrouputils.spacegroup_get_schoenflies(parse)[source]

httk.atomistic.structure module

class httk.atomistic.structure.Structure(assignments, rc_sites=None, uc_sites=None, rc_cell=None, uc_cell=None)[source]

Bases: httk.atomistic.scalelessstructure.ScalelessStructure

A Structure represents N sites of, e.g., atoms or ions, in any periodic or non-periodic 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.

Naming conventions in this class (and elsewhere 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 sequence-type 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 3-level-list of coordinates, e.g. [[[0,0,0],[0.5,0.5,0.5]],[[0.25,0.25,0.25]]] where level-1 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 2-level 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 / non-periodic

nonperiodic_vecs = integer, number of basis vectors, counted from the first, which are non-periodic

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

add_ref(ref)[source]
add_refs(refs)[source]
add_tag(tag, val)[source]
add_tags(tags)[source]
build_cubic_supercell(tolerance=None, max_search_cells=1000)[source]
build_orthogonal_supercell(tolerance=None, max_search_cells=1000, ortho=[True, True, True])[source]
build_supercell(transformation, max_search_cells=20, max_atoms=1000)[source]
build_supercell_old(transformation, max_search_cells=1000)[source]
clean()[source]
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, 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, spacegroup=None, hall_symbol=None, spacegroupnumber=None, setting=None, rc_scale=None, rc_scaling=None, rc_volume=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 non-periodic arrangement.

This is a swiss-army-type 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.

However, two options exists for representing the sites; either as only giving the representative sites, which when the symmetry operations of the spacegroup are applied generates all sites, or, simply giving the primcell set of sites. Since conversion between these are computationally expensive and only strictly ‘approximate’. Hence, sites is divided accordingly into rc_sites and uc_sites keeping track of the two representations.

Input:

  • 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’, ‘uc_sites’, ‘rc_coords’ (IF rc_occupations OR rc_counts are also given), ‘uc_coords’ (IF uc_occupations OR uc_counts are also given) ‘A_B_C’, where A=representative or primcell, B=reduced or cartesian, C=coordgroups, coords, or occupationscoords

    Notes:

    • occupationscoords may differ to coords by order, since giving occupations as, e.g., [‘H’,’O’,’H’] requires a re-ordering of coordinates to 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: ‘spacegroup’ or ‘hall_symbol’, or neither (in which case spacegroup is regarded as unknown)

  • ONE OF: scale or volume: scale = multiply the basis vectors with this scaling factor, volume = rescale the cell into this volume (overrides ‘scale’ if both are given)

  • ONE OF periodicity or nonperiodic_vecs

See help(Structure) for more information on the data format of all these data representations.

get_refs()[source]
get_tag(tag)[source]
get_tags()[source]
io
orthogonal_supercell_transformation(tolerance=None, max_search_cells=1000, ortho=[True, True, True])[source]
pbc
rc_a
rc_alpha
rc_b
rc_basis
rc_beta
rc_c
rc_cartesian_coordgroups
rc_cartesian_coords
rc_cell
rc_cell_orientation
rc_gamma
rc_lengths_and_angles
rc_sites
rc_volume
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_gamma
uc_lengths_and_angles
uc_sites
uc_volume
class httk.atomistic.structure.StructureRef(structure, reference)[source]

Bases: httk.core.httkobject.HttkObject

class httk.atomistic.structure.StructureTag(structure, tag, value)[source]

Bases: httk.core.httkobject.HttkObject

httk.atomistic.structure.main()[source]

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

classmethod create(structures, energies)[source]
get_phasediagram()[source]
class httk.atomistic.structurephasediagram.StructurePhaseDiagramCompetingIndicies(indices)[source]

Bases: httk.core.httkobject.HttkObject

classmethod create(indices)[source]
httk.atomistic.structurephasediagram.main()[source]
httk.atomistic.structurephasediagram.setup_phasediagram(structures, energies)[source]

httk.atomistic.structureutils module

httk.atomistic.structureutils.abstract_formula(filled_counts)[source]
httk.atomistic.structureutils.abstract_symbol(count)[source]
httk.atomistic.structureutils.basis_determinant(basis)[source]
httk.atomistic.structureutils.basis_scale_to_vol(basis, scale)[source]
httk.atomistic.structureutils.basis_to_niggli(basis)[source]
httk.atomistic.structureutils.basis_vol_to_scale(basis, vol)[source]
httk.atomistic.structureutils.cartesian_to_reduced(cell, coordgroups)[source]
httk.atomistic.structureutils.clean_coordgroups_and_assignments(coordgroups, assignments)[source]
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_cartesian_to_reduced(coordgroups, basis)[source]
httk.atomistic.structureutils.coordgroups_reduced_rc_to_unitcellsites(coordgroups, basis, hall_symbol, backends=['cif2cell', 'ase'])[source]
httk.atomistic.structureutils.coordgroups_reduced_uc_to_representative(coordgroups, basis, backends=['isotropy'])[source]
httk.atomistic.structureutils.coordgroups_to_coords(coordgroups)[source]
httk.atomistic.structureutils.coords_and_counts_to_coordgroups(coords, counts)[source]
httk.atomistic.structureutils.coords_and_occupancies_to_coordgroups_and_assignments(coords, occupancies)[source]
httk.atomistic.structureutils.coords_to_coordgroups(coords, counts)[source]
httk.atomistic.structureutils.coordswap(fromidx, toidx, cell, coordgroups)[source]
httk.atomistic.structureutils.lengths_angles_to_niggli(lengths, angles)[source]
httk.atomistic.structureutils.main()[source]
httk.atomistic.structureutils.metric_to_niggli(cell)[source]
httk.atomistic.structureutils.niggli_scale_to_vol(niggli_matrix, scale)[source]
httk.atomistic.structureutils.niggli_to_basis(niggli_matrix, orientation=1)[source]
httk.atomistic.structureutils.niggli_to_cell_old(niggli_matrix, orientation=1)[source]
httk.atomistic.structureutils.niggli_to_lengths_angles(niggli_matrix)[source]
httk.atomistic.structureutils.niggli_to_metric(niggli)[source]
httk.atomistic.structureutils.niggli_vol_to_scale(niggli_matrix, vol)[source]
httk.atomistic.structureutils.normalized_formula(assignments, ratios, counts)[source]
httk.atomistic.structureutils.normalized_formula_parts(assignments, ratios, counts)[source]
httk.atomistic.structureutils.occupations_and_coords_to_assignments_and_coordgroups(occupationscoords, occupations)[source]
httk.atomistic.structureutils.prototype_formula(proto)[source]
httk.atomistic.structureutils.reduced_to_cartesian(cell, coordgroups)[source]
httk.atomistic.structureutils.sort_coordgroups(coordgroups, individual_data)[source]
httk.atomistic.structureutils.structure_reduced_uc_to_representative(struct, backends=['isotropy', 'fake'])[source]
httk.atomistic.structureutils.structure_tidy(struct, backends=['platon'])[source]
httk.atomistic.structureutils.structure_to_p1structure(struct, backends=['ase'])[source]
httk.atomistic.structureutils.structure_to_sgstructure(struct, backends=['platon'])[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

httk.atomistic.unitcellsites.main()[source]

httk.atomistic.unitcellstructure module

class httk.atomistic.unitcellstructure.UCStructureRef(structure, reference)[source]

Bases: httk.core.httkobject.HttkObject

class httk.atomistic.unitcellstructure.UCStructureTag(structure, tag, value)[source]

Bases: httk.core.httkobject.HttkObject

class httk.atomistic.unitcellstructure.UnitcellStructure(cell=None, assignments=None, rc_sites=None, uc_sites=None, struct=None, uc_cell=None)[source]

Bases: httk.core.httkobject.HttkObject

FullSitesStructure essentially just wraps Structure, and provides a strict subset of the functionality therein. This is needed, because in interaction with, e.g., databases, we sometimes need to restrict the available fields to those properties accessible via this object.

add_ref(ref)[source]
add_refs(refs)[source]
add_tag(tag, val)[source]
add_tags(tags)[source]
anonymous_formula
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, assignments=None, periodicity=None, nonperiodic_vecs=None, refs=None, tags=None)[source]

A FullStructure represents N sites of, e.g., atoms or ions, in any periodic or non-periodic arrangement, where the positions of all cites are given (as opposed to a set of unique sites + symmetry operations).

This is a swiss-army-type 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 structure-type objects.

Note: see help(Structure) for parameter naming conventions, i.e., what type of object is expected given a parameter name.

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’, ‘occupations’ (assignments requires an Assignments object or a sequence.), 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 by 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’], and we cannot just re-order the coordinates at creation time (since presevation of the order is sometimes important.)
    • 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: ‘spacegroup’ or ‘hall_symbol’, OR NEITHER (in which case the spacegroup is regarded as unknown)

  • ONE OF: scale or volume:

    scale = multiply the basis vectors with this scaling factor, volume = rescale the cell into this volume (overrides ‘scale’ if both are given)

  • ONE OF periodicity or nonperiodic_vecs

extended
extensions
formula
formula_symbols
get_normalized()[source]
get_refs()[source]
get_tag(tag)[source]
get_tags()[source]
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 the primcell coordinate representation, and thus can be queried for this data without launching a somewhat expensive cell filling operation.

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
uc_formula_counts
uc_formula_symbols
uc_gamma
uc_nbr_atoms
uc_occupancies
uc_reduced_coordgroups
uc_reduced_coords
uc_reduced_occupationscoords
uc_sites
uc_symbols
uc_volume

Module contents

The httk.atomistic package

Classes and utilities for dealing with high-throughput calculations of atomistic systems.

class httk.atomistic.Structure(assignments, rc_sites=None, uc_sites=None, rc_cell=None, uc_cell=None)[source]

Bases: httk.atomistic.scalelessstructure.ScalelessStructure

A Structure represents N sites of, e.g., atoms or ions, in any periodic or non-periodic 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.

Naming conventions in this class (and elsewhere 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 sequence-type 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 3-level-list of coordinates, e.g. [[[0,0,0],[0.5,0.5,0.5]],[[0.25,0.25,0.25]]] where level-1 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 2-level 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 / non-periodic

nonperiodic_vecs = integer, number of basis vectors, counted from the first, which are non-periodic

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

add_ref(ref)[source]
add_refs(refs)[source]
add_tag(tag, val)[source]
add_tags(tags)[source]
build_cubic_supercell(tolerance=None, max_search_cells=1000)[source]
build_orthogonal_supercell(tolerance=None, max_search_cells=1000, ortho=[True, True, True])[source]
build_supercell(transformation, max_search_cells=20, max_atoms=1000)[source]
build_supercell_old(transformation, max_search_cells=1000)[source]
clean()[source]
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, 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, spacegroup=None, hall_symbol=None, spacegroupnumber=None, setting=None, rc_scale=None, rc_scaling=None, rc_volume=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 non-periodic arrangement.

This is a swiss-army-type 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.

However, two options exists for representing the sites; either as only giving the representative sites, which when the symmetry operations of the spacegroup are applied generates all sites, or, simply giving the primcell set of sites. Since conversion between these are computationally expensive and only strictly ‘approximate’. Hence, sites is divided accordingly into rc_sites and uc_sites keeping track of the two representations.

Input:

  • 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’, ‘uc_sites’, ‘rc_coords’ (IF rc_occupations OR rc_counts are also given), ‘uc_coords’ (IF uc_occupations OR uc_counts are also given) ‘A_B_C’, where A=representative or primcell, B=reduced or cartesian, C=coordgroups, coords, or occupationscoords

    Notes:

    • occupationscoords may differ to coords by order, since giving occupations as, e.g., [‘H’,’O’,’H’] requires a re-ordering of coordinates to 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: ‘spacegroup’ or ‘hall_symbol’, or neither (in which case spacegroup is regarded as unknown)

  • ONE OF: scale or volume: scale = multiply the basis vectors with this scaling factor, volume = rescale the cell into this volume (overrides ‘scale’ if both are given)

  • ONE OF periodicity or nonperiodic_vecs

See help(Structure) for more information on the data format of all these data representations.

get_refs()[source]
get_tag(tag)[source]
get_tags()[source]
io
orthogonal_supercell_transformation(tolerance=None, max_search_cells=1000, ortho=[True, True, True])[source]
pbc
rc_a
rc_alpha
rc_b
rc_basis
rc_beta
rc_c
rc_cartesian_coordgroups
rc_cartesian_coords
rc_cell
rc_cell_orientation
rc_gamma
rc_lengths_and_angles
rc_sites
rc_volume
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_gamma
uc_lengths_and_angles
uc_sites
uc_volume
class httk.atomistic.ScalelessStructure(assignments, rc_sites=None, uc_sites=None)[source]

Bases: httk.core.httkobject.HttkObject

A ScalelessStructure is the same as a Structre object, only that it does NOT carry information about the cell (no rc_cell or uc_cell).

add_rc_cell(cell)[source]
add_rc_cells(cells)[source]
add_ref(ref)[source]
add_refs(refs)[source]
add_tag(tag, val)[source]
add_tags(tags)[source]
anonymous_formula
anonymous_wyckoff_sequence
clean()[source]
classmethod create(structure=None, uc_cellshape=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_reduced_coords=None, uc_reduced_occupationscoords=None, uc_occupancies=None, uc_counts=None, rc_cellshape=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_reduced_coords=None, rc_reduced_occupationscoords=None, rc_occupancies=None, rc_counts=None, wyckoff_symbols=None, spacegroup=None, hall_symbol=None, spacegroupnumber=None, setting=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 non-periodic arrangement.

This is a swiss-army-type 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.

However, two options exists for representing the sites; either as only giving the representative sites, which when the symmetry operations of the spacegroup are applied generates all sites, or, simply giving the primcell set of sites. Since conversion between these are computationally expensive and only strictly ‘approximate’. Hence, sites is divided accordingly into rc_sites and uc_sites keeping track of the two representations.

Input:

  • 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’, ‘uc_sites’, ‘rc_coords’ (IF rc_occupations OR rc_counts are also given), ‘uc_coords’ (IF uc_occupations OR uc_counts are also given) ‘A_B_C’, where A=representative or primcell, B=reduced or cartesian, C=coordgroups, coords, or occupationscoords

    Notes:

    • occupationscoords may differ to coords by order, since giving occupations as, e.g., [‘H’,’O’,’H’] requires a re-ordering of coordinates to 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: ‘spacegroup’ or ‘hall_symbol’, or neither (in which case spacegroup is regarded as unknown)

  • ONE OF: scale or volume: scale = multiply the basis vectors with this scaling factor, volume = rescale the cell into this volume (overrides ‘scale’ if both are given)

  • 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
fill_cell()[source]

Make sure this structure has a unitcell representation. I.e., run an algorithm to copy the representative atoms throughout the unitcell.

(This method exists as a user friendly name for simply asking for the property self.uc_sites, which does the same; i.e. fills the cell if this representation is not yet known.)

find_symetry()[source]

Make sure this structure has a representative cell representation. I.e., run an algorithm to find symmetries.

(This method exists as a user friendly name for simply asking for the property self.rc_sites, which does the same. i.e. finds the crystal symmetries if this representation is not yet known.)

formula
formula_counts
formula_symbols
get_rc_cells()[source]
get_refs()[source]
get_tag(tag)[source]
get_tags()[source]
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 the primcell coordinate representation, and thus can be queried for this data without launching a somewhat expensive cell filling operation.

io
number_of_elements
rc_counts
rc_formula
rc_nbr_atoms
rc_occupancies
rc_occupationssymbols
rc_reduced_coordgroups
rc_reduced_coords
rc_sites
spacegroup_number
spacegroup_number_and_setting
spacegroupobj
symbols
tidy()[source]
uc_counts
uc_formula
uc_formula_counts
uc_formula_parts
uc_formula_symbols
uc_nbr_atoms
uc_occupancies
uc_occupationssymbols
uc_reduced_coordgroups
uc_reduced_coords
uc_reduced_occupationscoords
uc_sites
vis
wyckoff_sequence
class httk.atomistic.Cell(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 non-periodic system)

basis
clean()[source]
coordgroups_cartesian_to_reduced(coordgroups)[source]
coordgroups_reduced_to_cartesian(coordgroups)[source]
coords_cartesian_to_reduced(coords)[source]
coords_reduced_to_cartesian(coords)[source]
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, scale=None, scaling=None, volume=None, periodicity=None, nonperiodic_vecs=None, orientation=1, lattice_system=None)[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 non-periodic 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 non-None to multiply all cell vectors with this factor

volume: set to non-None 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 non-periodic basis vectors
get_normalized()[source]
is_point_inside(cartesian_coord)[source]
normalization_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()

scaling()[source]
volume
class httk.atomistic.UnitcellStructure(cell=None, assignments=None, rc_sites=None, uc_sites=None, struct=None, uc_cell=None)[source]

Bases: httk.core.httkobject.HttkObject

FullSitesStructure essentially just wraps Structure, and provides a strict subset of the functionality therein. This is needed, because in interaction with, e.g., databases, we sometimes need to restrict the available fields to those properties accessible via this object.

add_ref(ref)[source]
add_refs(refs)[source]
add_tag(tag, val)[source]
add_tags(tags)[source]
anonymous_formula
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, assignments=None, periodicity=None, nonperiodic_vecs=None, refs=None, tags=None)[source]

A FullStructure represents N sites of, e.g., atoms or ions, in any periodic or non-periodic arrangement, where the positions of all cites are given (as opposed to a set of unique sites + symmetry operations).

This is a swiss-army-type 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 structure-type objects.

Note: see help(Structure) for parameter naming conventions, i.e., what type of object is expected given a parameter name.

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’, ‘occupations’ (assignments requires an Assignments object or a sequence.), 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 by 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’], and we cannot just re-order the coordinates at creation time (since presevation of the order is sometimes important.)
    • 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: ‘spacegroup’ or ‘hall_symbol’, OR NEITHER (in which case the spacegroup is regarded as unknown)

  • ONE OF: scale or volume:

    scale = multiply the basis vectors with this scaling factor, volume = rescale the cell into this volume (overrides ‘scale’ if both are given)

  • ONE OF periodicity or nonperiodic_vecs

extended
extensions
formula
formula_symbols
get_normalized()[source]
get_refs()[source]
get_tag(tag)[source]
get_tags()[source]
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 the primcell coordinate representation, and thus can be queried for this data without launching a somewhat expensive cell filling operation.

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
uc_formula_counts
uc_formula_symbols
uc_gamma
uc_nbr_atoms
uc_occupancies
uc_reduced_coordgroups
uc_reduced_coords
uc_reduced_occupationscoords
uc_sites
uc_symbols
uc_volume
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)[source]

Bases: httk.atomistic.sites.Sites

Represents any collection of sites in a unitcell

anonymous_wyckoff_sequence
clean()[source]
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, occupancies=None)[source]
tidy()[source]
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

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 list-style object with one entry per ‘atom type’. Any sensible type accepted, most notably,
integers (for atom number)
extended
ratios
ratioslist
symbollists
symbols
to_basis()[source]
classmethod use(old)[source]
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

add_name(name)[source]
add_names(names)[source]
add_ref(ref)[source]
add_refs(refs)[source]
add_tag(tag, val)[source]
add_tags(tags)[source]
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
get_names()[source]
get_refs()[source]
get_tag(tag)[source]
get_tags()[source]
number_of_elements
wyckoff_sequence
class httk.atomistic.CompoundStructure(compound, structure)[source]

Bases: httk.core.httkobject.HttkObject

classmethod create(compound, structure)[source]
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

classmethod create(structures, energies)[source]
get_phasediagram()[source]
class httk.atomistic.StructureRef(structure, reference)[source]

Bases: httk.core.httkobject.HttkObject

class httk.atomistic.StructureTag(structure, tag, value)[source]

Bases: httk.core.httkobject.HttkObject

class httk.atomistic.CompoundTag(compound, tag, value)[source]

Bases: httk.core.httkobject.HttkObject

class httk.atomistic.CompoundRef(compound, reference)[source]

Bases: httk.core.httkobject.HttkObject