reverse.kronecker function

Reverses the matrices in a Kronecker product

Reverses the matrices in a Kronecker product

This function takes a matrix that is Kronecker product ABA \otimes B

(Definition 3.5), where AA is PxQP x Q and BB is NxMN x M, and outputs the matrix BAB \otimes A.

reverse.kronecker(ab, p, qq)

Arguments

  • ab: The (NP)x(QM)(NP) x (QM) matrix ABA \otimes B.
  • p: The number of rows of AA.
  • qq: The number of columns of AA.

Returns

The (NP)x(QM)(NP) x (QM) matrix BAB \otimes A.

Examples

# Create matrices (A <- diag(1, 3)) (B <- matrix(1:6, ncol = 2)) # Perform kronecker (kron <- kronecker(A, B)) # Perform reverse kronecker product (reverse.kronecker(kron, 3, 3)) # Perform kronecker again (kron2 <- kronecker(B, A))

See Also

kronecker

  • Maintainer: James Balamuta
  • License: MIT + file LICENSE
  • Last published: 2020-10-31