qrisp.QuantumArray.transpose#
- QuantumArray.transpose(*axes)[source]#
Reverses the axes of the QuantumArray with similar semantics as numpy.ndarray.transpose.
Note
This method never allocates additional qubits and instead returns a “view”.
- Parameters:
- *axesNone, tuple of ints, or n ints
None or no argument: reverses the order of the axes.
tuple of ints: i in the j-th place in the tuple means that the array’s i-th axis becomes the transposed array’s j-th axis.
n ints: same as an n-tuple of the same ints (this form is intended simply as a “convenience” alternative to the tuple form).
- Returns:
- resQuantumArray
The transposed QuantumArray.