Switch engine to light cone basis

This commit is contained in:
Aaron Fenyes 2024-07-17 14:30:43 -07:00
parent e6cf08a9b3
commit bde42ebac0
5 changed files with 19 additions and 7 deletions

View file

@ -39,11 +39,16 @@ rand_on_shell(shells::Array{<:Number}) = rand_on_shell(Random.default_rng(), she
# === elements ===
## [temp] in light cone coordinates
point(pos) = [pos; 1; dot(pos, pos)]
## [temp] in standard coordinates
plane(normal, offset) = [normal; offset; offset]
## [temp] in standard coordinates
function sphere(center, radius)
dist_sq = dot(center, center)
return [
[
center / radius;
0.5 * ((dist_sq - 1) / radius - radius);
0.5 * ((dist_sq + 1) / radius - radius)
@ -52,8 +57,13 @@ end
# === Gram matrix realization ===
# basis changes
nullmix = [Matrix{Int64}(I, 3, 3) zeros(Int64, 3, 2); zeros(Int64, 2, 3) [1 -1; 1 1]//2]
unmix = [Matrix{Int64}(I, 3, 3) zeros(Int64, 3, 2); zeros(Int64, 2, 3) [1 1; -1 1]]
# the Lorentz form
Q = diagm([1, 1, 1, 1, -1])
## [old] Q = diagm([1, 1, 1, 1, -1])
Q = [Matrix{Int64}(I, 3, 3) zeros(Int64, 3, 2); zeros(Int64, 2, 3) [0 2; 2 0]]
# project a matrix onto the subspace of matrices whose entries vanish at the
# given indices