pad

  • full name: tenpy.tools.misc.pad

  • parent module: tenpy.tools.misc

  • type: function

tenpy.tools.misc.pad(a, w_l=0, v_l=0, w_r=0, v_r=0, axis=0)[source]

Pad an array along a given axis.

Parameters
andarray

the array to be padded

w_lint

the width to be padded in the front

v_ldtype

the value to be inserted before a

w_rint

the width to be padded after the last index

v_ldtype

the value to be inserted after a

axisint

the axis along which to pad

Returns
paddedndarray

a copy of a with enlarged axis, padded with the given values.