interplane.Get Omega
Read in your language

yang

This project has not described itself yet.

Brought by drakestapleton

branch main Branches Tags History

yang / scripts / check_block_covariance.om

116 lines · 2034 bytes Raw Blame History
1note Directly exercise the production blocking routine on noncommuting periodic links.
2global fixtureLinks f32 4096
3global fixtureFrames f32 1024
4global fixtureCoarse f32 256
5text tBlockCov "blocked-link covariance and zero-projection fallback PASS\n"
6
7fn rngUnit u edit f32 4 to void
8n2 = f64 0.0f64
9for c ulong 4
10z = uRngNorm64
11put u c f32 z
12n2 = add n2 mul z z
13end
14for c ulong 4
15put u c f32 div f64 get u c uSqrt64 n2
16end
17end
18
19fn frame s ulong u edit f32 4 to void
20for c ulong 4
21put u c get fixtureFrames add mul s 4 c
22end
23end
24
25fn transformFixtureLink s ulong mu ulong to void
26g = new f32 4 0.0f32
27h = new f32 4 0.0f32
28u = new f32 4 0.0f32
29p = new f32 4 0.0f32
30v = new f32 4 0.0f32
31frame s g
32frame stepCoord s 4 mu 1 h
33hQConj h
34loadLvl 0 s mu u
35hQMul g u p
36hQMul p h v
37storeLvl 0 s mu v
38end
39
40fn compareHostLink v view f32 4 base ulong to void
41for c ulong 4
42if gt uAbs64 f64 sub get v c get hL2 add base c 0.00002f64
43exit 68
44end
45end
46end
47
48fn compareFixtureLink X ulong mu ulong to void
49x = coarseToFine X 4
50g = new f32 4 0.0f32
51h = new f32 4 0.0f32
52u = new f32 4 0.0f32
53p = new f32 4 0.0f32
54v = new f32 4 0.0f32
55frame x g
56frame stepCoord x 4 mu 2 h
57hQConj h
58base = mul add mul X 4 mu 4
59for c ulong 4
60put u c get fixtureCoarse add base c
61end
62hQMul g u p
63hQMul p h v
64compareHostLink v base
65end
66
67fn checkBlocked clos ulong to void
68put kernelWeight 0 div f32 clos 4.0f32
69for i ulong 4096
70put hL1 i get fixtureLinks i
71end
72blockBox 0 1 4 0 2
73for i ulong 256
74put fixtureCoarse i get hL2 i
75end
76for s ulong 256
77for mu ulong 4
78transformFixtureLink s mu
79end
80end
81blockBox 0 1 4 0 2
82for X ulong 16
83for mu ulong 4
84compareFixtureLink X mu
85end
86end
87end
88
89fn main to int
90uRngSeed 78321
91v = new f32 4 0.0f32
92for s ulong 256
93rngUnit v
94for c ulong 4
95put fixtureFrames add mul s 4 c get v c
96end
97for mu ulong 4
98rngUnit v
99for c ulong 4
100put fixtureLinks add mul add mul s 4 mu 4 c get v c
101end
102end
103end
104for clos ulong 5
105checkBlocked clos
106end
107zero = new f32 4 0.0f32
108hQNorm zero v
109for c ulong 4
110if ne get zero c get v c
111ret 69
112end
113end
114uPrint tBlockCov
115ret 0
116end