Skip to content

Instantly share code, notes, and snippets.

@PMKielstra
PMKielstra / TensorQuadtreeTest.py
Last active June 6, 2023 21:54
Tensor quadtree rank analysis
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."""