[짧은 개념] Kronecker product / Kronecker delta

kiteday·2024년 3월 8일

baseline

목록 보기
7/7

Kronecker product

Kronecker product는 scalar에 matrix를 곱할 때를 상상하면 쉽게 이해할 수 있다.

먼저 scalar와 matrix 곱을 생각해보자. 만약 scalar aa와 matrix BB를 곱한다면 다음처럼 쓸 수 있다.

aB=a[b11b1nbm1bmn]=[ab11ab1nabm1abmn]a \cdot B = a \cdot \begin{bmatrix} b_{11} & \cdots & b_{1n} \\ \vdots & \ddots & \vdots \\ b_{m1} & \cdots & b_{mn} \end{bmatrix} = \begin{bmatrix} ab_{11} & \cdots & ab_{1n} \\ \vdots & \ddots & \vdots \\ ab_{m1} & \cdots & ab_{mn} \end{bmatrix}

여기서 만약 aa가 scalar가 아니고 matrix A라면? 그게 바로 Kronecker product가 된다. 두 matrix A와 B의 Kronecker product ABA \otimes B는 다음과 같다.

AB=[a11Ba1nBam1BamnB]A \otimes B = \begin{bmatrix} a_{11}B & \cdots & a_{1n}B \\ \vdots & \ddots & \vdots \\ a_{m1}B & \cdots & a_{mn}B \end{bmatrix}

그렇다면 이 곱은 왜 사용하는가?

Kronecker product \otimes과 vectorization operator vec()vec(\cdot )간의 연관성에 따라서 하나의 긴 vector로 풀 수 있기 때문이다. 이는 잘 모르는 matrix가 풀어야 하거나 optimize해야하는 function에 있을 때 유용하다. 식으로 보자.

vec(AXB)=(BTA)vec(X)vec(AXB) = (B^T \otimes A)vec(X)

위 식에서 AXBAXB는 matricies, BTAB^T \otimes A는 matrix, vec(X)vec(X)는 vector를 의미한다.

만약 AXB+X=CAXB+X=C라는 matrix equation을 풀어야한다고 하자.
그럼 Kronecker product 공식에 따라서 다음처럼 바꿔 쓸 수 있다.

(BTA)vec(X)=vec(C)(B^T \otimes A)vec(X) = vec(C)

약간의 수식 과정을 보면

AXB+X=C(AB+I)X=CAXB + X = C \\ (AB+I)X = C

이처럼 X로 묶어주고 \otimes를 실행한 것이다!

Kronecker delta

tensor에서 등장하는 개념

쉽게 말해서 두 값이 같으면 1 다르면 0을 출력하는 함수이다. 두 변수는 보통 음수가 아닌 정수 값을 가진다.

δij={0ij,1i=j.\delta_{ij} = \begin{cases} 0 & i\ne j, \\ 1 & i=j. \end{cases}혹은 δij=[i=j]\delta_{ij} =[i=j] 이렇게 간략하게 표기하기도 한다.

inner product를 kronecker delta로 표현할 수 있다.

ab=i,j=1naiδi,jbja \cdot b = \sum_{i,j=1}^{n} a_i \delta_{i,j}b_j

Ref.

profile
공부

0개의 댓글