molsysmt.pbc.wrap_to_mic#

molsysmt.pbc.wrap_to_mic(molecular_system, selection='all', structure_indices='all', mic_origin='[0,0,0] nanometers', center_of_selection=None, center_coordinates='[0,0,0] nanometers', weights=None, keep_covalent_bonds=False, syntax='MolSysMT', engine='MolSysMT', in_place=False, skip_digestion=False)[source]#

Wrap coordinates into the minimum image convention (MIC) box.

Parameters:
  • molecular_system (molecular system) – Input system.

  • selection (str, list, tuple or numpy.ndarray, default 'all') – Atoms to wrap.

  • structure_indices ('all' or array-like, default 'all') – Structures/frames to process.

  • mic_origin (quantity, default '[0,0,0] nanometers') – Origin of the MIC box.

  • center_of_selection (str or array-like, optional) – Selection to center before wrapping (uses center_coordinates).

  • center_coordinates (quantity, default '[0,0,0] nanometers') – Target coordinates for centering the center_of_selection.

  • weights (array-like, optional) – Weights for centering when center_of_selection is given.

  • keep_covalent_bonds (bool, default False) – Whether to reconstruct bonded atoms through minimum-image displacements and wrap each connected block as a unit. Requires topology with bonds.

  • syntax (str, default 'MolSysMT') – Selection syntax for string selections.

  • engine ({'MolSysMT'}, default 'MolSysMT') – Backend.

  • in_place (bool, default False) – If True, modify the input system; otherwise return a wrapped copy.

  • skip_digestion (bool, default False) – Whether to skip argument digestion.

Returns:

Wrapped system when in_place=False, otherwise None.

Return type:

molecular system or None

Raises:
  • NotImplementedMethodError – If an unsupported engine is requested.

  • StructuralInconsistencyError – If box vectors are invalid, or if keep_covalent_bonds=True and bonds are unavailable.

Notes

With keep_covalent_bonds=False, atoms are wrapped independently. With keep_covalent_bonds=True, bonded blocks are reconstructed with minimum-image bond displacements and translated as complete units.

Added in version 1.0.0.