soprano.collection.generate.molneigh#
Generator producing molecular neighbourhoods
Functions
|
Generator function to create a spherical molecular neighbourhood. |
- soprano.collection.generate.molneigh.molecularNeighbourhoodGen(struct, mols, central_mol=0, max_R=10, method='com', use_supercell=False)[source]#
Generator function to create a spherical molecular neighbourhood. Given a structure and its molecules as returned by the Molecules property, produce supercell structures that contain one molecule each, progressively further away from the one indicated as central.
Args:struct (ase.Atoms): original structuremols ([ase.AtomsSelection]): list of molecules, as returned by thesoprano.properties.linkage.Moleculesclass.central_mol (int): index of the molecule whose centre of mass isconsidered central. Default is 0.max_R (float): maximum radius of the neighbourhood sphere. Default is10 Ang.method (str): method to compute distance between molecules. ‘com’means using the center of mass. ‘nearest’ means usingthe closest atom. Default is ‘com’.use_supercell (bool): if True, all returned structures will have acell large enough to contain the entireneighbourhood. Default is False.Returns:molecularNeighbourhoodGen (generator): an iterator object that yieldsstructures within the givenspherical neighbourhood.