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 | |
from matplotlib import pyplot as plt | |
from tqdm import tqdm | |
def K(r1, r2, k): | |
"""e^{k pi i |r1 - r2|} / |r1 - r2|""" | |
return np.exp(1j * k * np.pi * np.linalg.norm(r1 - r2)) / np.linalg.norm(r1 - r2) | |
def interaction_tensor_matrix(N, C, l): | |
"""C is the width of the lowest element of the quadtree; N is the width of the overall tensor.""" |