symmetrize

mdtools.numpy_helper_functions.symmetrize(a, lower=True, debug=False)[source]

Create a symmetrized copy of a 2-dimensional array.

Parameters
  • a (array_like) – 2-dimensional array to symmetrize.

  • lower (bool, optional) – If True, mirror the lower triangle of a to the upper one. If False, mirror the upper triangle to the lower one. The diagonal of a is unchanged.

  • debug (bool, optional) – If True, check the input arguments.

Returns

a_sym – A symmetrized copy of a.

Return type

numpy.ndarray