-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvisualise_lambda_molecules.py
55 lines (40 loc) · 1.98 KB
/
visualise_lambda_molecules.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
import matplotlib.pyplot as plt
from causalset import CausalSet
from causalsetfunctions import compute_spacetimecuts_uniform_Rindler, compute_spacetimecuts_tube
def main():
fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')
# boundsArray, adjusted_rho, l, adjusted_l = compute_spacetimecuts_uniform_Rindler(d=3, rho=10000, N_max=8000, b=3)
# C = CausalSet(sprinkling_density=adjusted_rho, dimension=3, BHtype='Rindler', bounds = boundsArray)
# ax.axes.set_xlim3d(left=boundsArray[0][0], right=boundsArray[0][1])
# ax.axes.set_ylim3d(bottom=boundsArray[1][0], top=boundsArray[1][1])
# ax.axes.set_zlim3d(bottom=boundsArray[2][0], top=boundsArray[2][1])
boundsArray, rho = compute_spacetimecuts_tube(d=3, rho2=10, N_max=8000, b=3)
C = CausalSet(sprinkling_density=rho, dimension=3, BHtype='Dynamic', sprinkling='Tube', T=1, bounds=boundsArray)
ax.axes.set_xlim3d(left=boundsArray[2], right=boundsArray[3])
ax.axes.set_ylim3d(bottom=-boundsArray[1], top=boundsArray[1])
ax.axes.set_zlim3d(bottom=-boundsArray[1], top=boundsArray[1])
C.find_molecules()
# print(C.MoleculesList)
# print(C.VElementsLabelsList)
t = []
x = []
y = []
for i in C.MoleculesList:
t.append(C.ElementList[i].coordinates[0])
x.append(C.ElementList[i].coordinates[1])
y.append(C.ElementList[i].coordinates[2])
for i in range(len(C.MoleculesList) // 2):
ax.plot([t[2*i], t[2*i+1]], [x[2*i], x[2*i+1]], [y[2*i], y[2*i+1]], color='black')
ax.scatter([t[i] for i in range(len(t)) if i % 2 == 0],
[x[i] for i in range(len(x)) if i % 2 == 0],
[y[i] for i in range(len(y)) if i % 2 == 0])
ax.scatter([t[i] for i in range(len(t)) if i % 2 == 1],
[x[i] for i in range(len(x)) if i % 2 == 1],
[y[i] for i in range(len(y)) if i % 2 == 1])
ax.set_xlabel('t')
ax.set_ylabel('x')
ax.set_zlabel('y')
plt.show()
if __name__ == "__main__":
main()