schrodinger.application.matsci.pbcutils module

Utility functions and classes for pbcs

Copyright Schrodinger, LLC. All rights reserved.

schrodinger.application.matsci.pbcutils.get_disorder_groups(struct)

Get atoms that have s_cif_disorder_group set and occupancies are not 0 or 1.

Parameters

structure.Structure – Input structure

Return type

dict or None

Returns

Dict with keys disorder group labels, values list of atom indices or None if nothing is present in the structure

schrodinger.application.matsci.pbcutils.remove_pbc_props(struct)

Remove the pbc properties of the given structure.

Parameters

struct (schrodinger.structure.Structure) – crystal structure from which all the pbc properties are to be removed

schrodinger.application.matsci.pbcutils.translate_to_hb_cell(pos, vecs)

Translate atoms to the cell around origin (between -0.5 and 0.5) using copied input structure.

Parameters
  • pos (numpy.array) – List of atomic positions

  • vecs (numpy.array) – List of lattice vectors

Return type

numpy.array

Returns

Updated atomic positions

schrodinger.application.matsci.pbcutils.get_nearest_image(reference_pos, pos, pbc)

Get the nearest image of the passed positional coordinates to reference_pos using pbc

Parameters
  • reference_pos (list) – The reference position

  • pos (list) – The position to get the nearest image of

  • pbc (schrodinger.structutils.pbc.PBC) – The PBC object for the structure

Return type

tuple

Returns

The nearest image position to the reference

schrodinger.application.matsci.pbcutils.get_dimensionality_from_st(struct)

Get dimensionality from structure property.

Parameters

struct (structure.Structure) – Input structure

Return type

msconst.DIMENSIONALITY or None

Returns

msconst.DIMENSIONALITY member or None if not set

schrodinger.application.matsci.pbcutils.set_dimensionality_to_st(struct, dim)

Set dimensionality to structure property.

Parameters
schrodinger.application.matsci.pbcutils.is_hexagonal(pbc, hex_angle_tol=5, hex_length_tol=0.01)

Check if lattice is hexagonal.

Parameters
  • pbc (infrastructure.PBC) – PBC object

  • hex_angle_tol (float) – Angle tolerance (degrees)

  • hex_length_tol (float) – Length tolerance (Angstrom)

Return type

bool

Returns

Whether lattice corresponds to hexagonal lattice.