-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTest.py
More file actions
executable file
·197 lines (115 loc) · 3.53 KB
/
Test.py
File metadata and controls
executable file
·197 lines (115 loc) · 3.53 KB
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
# -*- coding: utf-8 -*-
"""
Created on Wed Mar 15 11:37:10 2023
@author: ala111
"""
# Packages
from classes import aromatic_forest, aromatic_form
import functions as fun
import sys
original_stdout = sys.stdout # Save a reference to the original standard output
# Make sure that tau has its root in position 1!!!
def list_Lie_derivative(N,n,p,tau):
print("List of the Lie derivatives")
L_forests=fun.List_forests(N,n,p)
for x in L_forests.alist:
print(x[0].dic)
g = aromatic_forest(x[0].dic).wedge()
res1=g.Lie(tau)
res1.aro_print()
print()
def total_list_Lie_derivative(N,n,p,M):
print("List of the Lie derivatives - (N,M)=",N,M)
L_forests=fun.List_forests(N,n,p)
L_tau=fun.List_forests(M,1,0)
for y in L_tau.alist:
print("tau=",end='')
y[0].draw()
for x in L_forests.alist:
print("gamma=",end='')
x[0].draw()
print()
g = x[0].wedge()
res=g.Lie(y[0].wedge()).delta_V()
# res.draw()
res.aro_print()
print()
def search_conservation_law(N,n,p,M):
print("List of the Lie derivatives - (N,M)=",N,M)
L_forests=fun.List_forests(N,n,p)
L_tau=fun.List_forests(M,1,0)
for x in L_forests.alist:
print("gamma=",end='')
x[0].draw()
for y in L_tau.alist:
print("tau=",end='')
y[0].draw()
print()
g = x[0].wedge()
res=g.Lie(y[0].wedge())
# res.simplify_1_loop()
res.draw()
print()
with open('results.txt', 'w') as f:
sys.stdout = f
# L_tau=fun.List_forests_div_free(4,1,0)
# for y in L_tau.alist:
# print("tau=",end='')
# y[0].draw()
# print()
# g = aromatic_forest({1: ['r', 1], 2: ['r',2], 3: ['v',2]}).wedge().d_H()
# g.ext_mult(2)
# res=g.Lie(y[0].wedge())
# res.ext_mult(-1)
# res.add(y[0].Lie(g))
# # res.d_H().draw()
# # print()
# res.d_H_div_free().draw()
# print()
for M in [1,2,3]:
total_list_Lie_derivative(2,0,0,M)
print()
total_list_Lie_derivative(3,0,0,M)
print()
sys.stdout = original_stdout
# total_list_Lie_derivative(2,0,0,3)
def list_H_Lie(g,M):
print("List of the Lie homotopy")
L_tau=fun.List_forests(M,1,0)
for y in L_tau.alist:
print("tau=",end='')
y[0].draw()
print()
res=g.h_H_Lie(y[0].wedge())
res.draw()
print()
# g = aromatic_forest({1: ['r', 1], 2: ['r',2], 3: ['v',2]}).wedge().d_H()
# g.ext_mult(2)
# list_H_Lie(g,4)
def list_H_Lie_test(N,M):
L_forests=fun.List_forests(N,2,0)
L_tau=fun.List_forests(M,1,0)
for x in L_forests.alist:
print("gamma=",end='')
x[0].draw()
g = x[0].wedge()
dg=g.d_H()
for y in L_tau.alist:
print("tau=",end='')
y[0].draw()
print()
res=dg.h_H_Lie(y[0].wedge())
res_aux=g.Lie(y[0].wedge())
res_aux.ext_mult(-1)
res.add(res_aux)
res.draw()
print()
# list_H_Lie_test(5,3)
# L_forests=fun.List_forests(6,2,0)
# for x in L_forests.alist:
# print("gamma=",end='')
# x[0].draw()
# print()
# g = x[0].wedge()
# g.h_H().d_H().draw()
# print()