PermutationMatrix.from_qudit_location

static PermutationMatrix.from_qudit_location(num_qudits, radix, location)[source]

Creates the permutation matrix specified by arguments.

The resulting matrix will move the location’s qudits into positions defined by their index in location. For example:

P = Permutationmatrix.from_qudit_location(3, 2, (1, 2, 0))

.—–.

0 -| |- 1 1 -| P |- 2 2 -| |- 0

‘—–’

Parameters:
  • num_qudits (int) – Total number of qudits.

  • radix (int) – The base of all qudits.

  • location (Sequence[int]) – The desired qudits to swap to their index.

Returns:

A permutation matrix that moves the

location’s qudits into positions defined by their index in location.

Return type:

(PermutationMatrix)