unpackage_complex

qugradlab.pulses.invertible_functions.packaging.unpackage_complex(z: ndarray[complex]) Any[source]

Takes a complex tensor and splits it into the real and imaginary parts as the final axis.

Parameters:

z (NDArray[Shape[s := Any_Shape], complex]) – The tensor to reshape.

Returns:

The reshaped tensor.

Return type:

NDArray[Shape[s, 2], float]

unpackage_complex.inverse()

Takes the last axis of a real tensor and takes the first entry as the real part and the second as the imaginary.

PARAMETERS:
  • x (NDArray[Shape[s := Any_Shape, 2], float]) — The tensor to reshape.

RETURNS:

The reshaped tensor.

RETURN TYPE:

NDArray[Shape[s], complex]

unpackage_complex.compose()

Composes the unpackage_complex() with another InvertibleFunction to create a new InvertibleFunction along with the composed inverse. That is the following assertions should hold:

assert package_complex.compose(g)(z, *g_args, **g_kwargs)                 == package_complex(g(z, *g_args, **g_kwargs))

for all inputs z.

PARAMETERS:
RETURNS:

A new InvertibleFunction that is the composition of the two functions.

RETURN TYPE:

InvertibleFunction