channels.realignment

Generates the realignment channel of a matrix.

Functions

realignment(input_mat[, dim])

Compute the realignment of a bipartite operator [1].

Module Contents

channels.realignment.realignment(input_mat, dim=None)

Compute the realignment of a bipartite operator [1].

Gives the realignment of the matrix input_mat, where it is assumed that the number of rows and columns of input_mat are both perfect squares and both subsystems have equal dimension. The realignment is defined by mapping the operator \(|ij \rangle \langle kl |\) to \(|ik \rangle \langle jl |\) and extending linearly.

If input_mat is non-square, different row and column dimensions can be specified by putting the row dimensions in the first row of dim and the column dimensions in the second row of dim.

Examples

The standard realignment map

Using |toqito⟩, we can generate the standard realignment map as follows. When viewed as a map on block matrices, the realignment map takes each block of the original matrix and makes its vectorization the rows of the realignment matrix. This is illustrated by the following small example:

import numpy as np
from toqito.channels import realignment

test_input_mat = np.arange(1, 17).reshape(4, 4)

realignment(test_input_mat)
array([[ 1,  2,  5,  6],
       [ 3,  4,  7,  8],
       [ 9, 10, 13, 14],
       [11, 12, 15, 16]])

References

Parameters:
  • input_mat (numpy.ndarray) – The input matrix.

  • dim (int | list[int]) – Default has all equal dimensions.

Raises:

ValueError – If dimension of matrix is invalid.

Returns:

The realignment map matrix.

Return type:

numpy.ndarray