pad

qugradlab.pulses.composition.pad(x: ndarray[complex], value: complex = 0, left: bool = True, right: bool = True) Any[source]

Adds padding to a tensor.

Parameters:
  • x (NDArray[Shape[s := Any_Shape]]) – The tensor to pad

  • value (number) – The value to pad the tensor with, by default 0

  • left (bool) – Whether to prepend padding, by default True

  • right (bool) – Whether to append padding, by default True

Returns:

Padded tensor

Return type:

NDArray[Shape[s[0]+left+right, s[1:]]]