API

class Symd(nparticles, ndims, cell=None, density=None, group=1, wyckoffs=None, images=None, steps=100, temperature=None, start_temperature=0.5, pressure=None, exeDir='', exePrefix='', thermostat='baoab', force='lj')

Symd Engine set-up and output parser

clean_files()

Remove output files

log_output(filename='md.log', period=0, frames=0)

Log simulation output

log_positions(filename='positions.xyz', period=0, frames=0)

enable logging of the xyz positions of the simulation. Default is to output 100 frames

number_density()

returns the packing fraction of the system

read_cell(bravais=False)

Return the output unit cell. :param bravais: if True, return the cell fit to be in Bravais (projected) for use in p1 or non-symmetric MD. If False, return a unit cell that will repeat the simulation.

read_positions()

Reads the positions from the positions log file

remove_overlap()

Attempt to remove overlapping particles

run()

Run the simulation

setup_masses(masses=1, masses_file=None)

Creates a masses file. The masses variable is expanded to be the same size as the number of particles

shrink()

Run a brief NPT simulation

class Group(lattice, genpos, specpos, name=None, asymm_unit=None)

A group with information on genpos, specpos, Bravais lattice

asymm_unit: Optional[str] = None

string indicating asymmetric unit (call asymm_constraints() to convert to lambda)

genpos: List[str]

general positions as affine matrix strings (call str2mat() to convert to matrix)

lattice: str

Bravais lattice name

name: Optional[str] = None

name of the group

specpos: List[object]

list of Group special positions

asymm_constraints(s)

Converts inequalities in xyz notation to lambda function. For example, 0≤x≤2/3;0≤y≤1/3;x≤(1+y)/2;y≤x/2 is converted to a lambda function that returns True if the given point satisfies the constraints. Works in 2D and 3D.

Parameters

s (str) – string in xyz notation

Return type

Union[Callable[[float, float, float], bool], Callable[[float, float], bool]]

Returns

lambda function that is True when the point is in the asymmetric unit

cell_nparticles(group, genpos, *specpos)

Get number of unit cell particles given genpos and specpos

Parameters
  • group (Group) – The Group

  • genpos (int) – The number of particles in the general positions in asymmetric unit

  • specpos (int) – The numbers of particles in the special positions

Return type

int

Returns

The number of particles in the unit cell

cell_volume(b)

Compute volume of given unit cell in arbitrary dimension

Parameters

b (ndarray) – lattice vectors as columns

Return type

float

Returns

volume of unit cell

get_cell(number_density, group, dim, n, w=None)

Compute unit cell given number density, group, and number of particles in asymmetric unit.

Parameters
  • number_density (float) – number density of particles

  • group (Union[int, Group]) – group number (Hall number) or Group

  • dim (int) – dimensionality of space

  • n (int) – number of particles in asymmetric unit general positions

  • w (Optional[List[int]]) – list of number of particles in special positions

Return type

List[float]

Returns

flattened unit cell (for use in symd MD engine)

group_names = [None, [None, 'p1', 'p1m'], [None, 'p1', 'p2', 'pm', 'pg', 'cm', 'pmm', 'pmg', 'pgg', 'cmm', 'p4', 'p4m', 'p4g', 'p3', 'p3m1', 'p31m', 'p6', 'p6m'], [None, 'P1', 'P-1', 'P2', 'P21', 'C2', 'Pm', 'Pc', 'Cm', 'Cc', 'P2/m', 'P21/m', 'C2/m', 'P2/c', 'P21/c', 'C2/c', 'P222', 'P2221', 'P21212', 'P212121', 'C2221', 'C222', 'F222', 'I222', 'I212121', 'Pmm2', 'Pmc21', 'Pcc2', 'Pma2', 'Pca21', 'Pnc2', 'Pmn21', 'Pba2', 'Pna21', 'Pnn2', 'Cmm2', 'Cmc21', 'Ccc2', 'Amm2', 'Aem2', 'Ama2', 'Aea2', 'Fmm2', 'Fdd2', 'Imm2', 'Iba2', 'Ima2', 'Pmmm', 'Pnnn', 'Pccm', 'Pban', 'Pmma', 'Pnna', 'Pmna', 'Pcca', 'Pbam', 'Pccn', 'Pbcm', 'Pnnm', 'Pmmn', 'Pbcn', 'Pbca', 'Pnma', 'Cmcm', 'Cmce', 'Cmmm', 'Cccm', 'Cmme', 'Ccce', 'Fmmm', 'Fddd', 'Immm', 'Ibam', 'Ibca', 'Imma', 'P4', 'P41', 'P42', 'P43', 'I4', 'I41', 'P-4', 'I-4', 'P4/m', 'P42/m', 'P4/n', 'P42/n', 'I4/m', 'I41/a', 'P422', 'P4212', 'P4122', 'P41212', 'P4222', 'P42212', 'P4322', 'P43212', 'I422', 'I4122', 'P4mm', 'P4bm', 'P42cm', 'P42nm', 'P4cc', 'P4nc', 'P42mc', 'P42bc', 'I4mm', 'I4cm', 'I41md', 'I41cd', 'P-42m', 'P-42c', 'P-421m', 'P-421c', 'P-4m2', 'P-4c2', 'P-4b2', 'P-4n2', 'I-4m2', 'I-4c2', 'I-42m', 'I-42d', 'P4/mmm', 'P4/mcc', 'P4/nbm', 'P4/nnc', 'P4/mbm', 'P4/mnc', 'P4/nmm', 'P4/ncc', 'P42/mmc', 'P42/mcm', 'P42/nbc', 'P42/nnm', 'P42/mbc', 'P42/mnm', 'P42/nmc', 'P42/ncm', 'I4/mmm', 'I4/mcm', 'I41/amd', 'I41/acd', 'P3', 'P31', 'P32', 'R3', 'P-3', 'R-3', 'P312', 'P321', 'P3112', 'P3121', 'P3212', 'P3221', 'R32', 'P3m1', 'P31m', 'P3c1', 'P31c', 'R3m', 'R3c', 'P-31m', 'P-31c', 'P-3m1', 'P-3c1', 'R-3m', 'R-3c', 'P6', 'P61', 'P65', 'P62', 'P64', 'P63', 'P-6', 'P6/m', 'P63/m', 'P622', 'P6122', 'P6522', 'P6222', 'P6422', 'P6322', 'P6mm', 'P6cc', 'P63cm', 'P63mc', 'P-6m2', 'P-6c2', 'P-62m', 'P-62c', 'P6/mmm', 'P6/mcc', 'P63/mcm', 'P63/mmc', 'P23', 'F23', 'I23', 'P213', 'I213', 'Pm-3', 'Pn-3', 'Fm-3', 'Fd-3', 'Im-3', 'Pa-3', 'Ia-3', 'P432', 'P4232', 'F432', 'F4132', 'I432', 'P4332', 'P4132', 'I4132', 'P-43m', 'F-43m', 'I-43m', 'P-43n', 'F-43c', 'I-43d', 'Pm-3m', 'Pn-3n', 'Pm-3n', 'Pn-3m', 'Fm-3m', 'Fm-3c', 'Fd-3m', 'Fd-3c', 'Im-3m', 'Ia-3d']]

Name of space groups

load_group(gnum, dim)

Load one of the 2D planar groups or 3D space groups that tile space. The Group contains the name of the Bravais lattice, the general positions, and a list of special positions.

Parameters
  • gnum (int) – group number (Hall number)

  • dim (int) – dimensionality of space

Return type

Group

Returns

The Group

prepare_input(group, dim, N, name, dir='.')

Prepare input files for running symmetry MD.

Parameters
  • group (Union[Group, int]) – group number (Hall number) or Group

  • dim (int) – dimensionality of space

  • N (int) – number of atoms

  • name (str) – name of the group (used to name output files)

  • dir – directory to write files to

Return type

List[str]

Returns

list of input files

project_cell(cell, projector)

Project unit cell to constraints of Bravais lattice.

Parameters
  • cell (ndarray) – unit cell as columns

  • projector (Union[str, ndarray]) – projector tensor or str of Bravais lattice

Return type

ndarray

str2mat(s)

Convert affine matrix specified in xyz notation to matrix. For example, -x, y - x, z. Can be 2D or 3D.

Parameters

s (str) – string in xyz notation

Return type

ndarray

Returns

np.ndarray: matrix