Created
April 7, 2025 07:08
-
-
Save kumanna/eb8a226bad9be8e8a5915b9fb5857d4d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
M = 4 | |
N = 4 | |
GAMMA = np.diag(np.exp(-1j * np.arange(M) * 2 * np.pi / M)) | |
DELTA = np.diag(np.exp(1j * np.arange(N) * 2 * np.pi / N)) | |
def gamma_deriv(GAMMA, n): | |
return np.diag((-np.arange(M) * 1j * 2 * np.pi / M))**n @ GAMMA | |
def delta_deriv(DELTA, n): | |
return np.diag((np.arange(N) * 1j * 2 * np.pi / N))**n @ DELTA | |
def frobenius_inner_product(A, B): | |
return np.trace(A.T.conj() @ B) | |
print(frobenius_inner_product(GAMMA**3, gamma_deriv(GAMMA, 3))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment