-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcomplex.py
47 lines (45 loc) · 1.98 KB
/
complex.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
import form
class Complex:
"""This class represent a Complex, which is needed to define a form.
For the moment a complex has only a dimension attribute, we will then add the spaces that define the complex"""
def __init__(self, dimension=0):
"""This constructor needs a dimension(default value is 0), which is the dimension of our complex"""
self.dimension = dimension
self.basis = [form.Basis(self, i) for i in range(dimension)]
#~ self.basis2=[]
#~ for i in range(dimension):
#~ if i+1<dimension:
#~ for j in range(i+1,dimension):
#~ self.basis2.append((self.basis[i]).wedge(self.basis[j]))
#~
#~ self.basis3 = []
#~ for i in range(len(self.basis2)):
#~ for j in range(i+2,dimension):
#~ self.basis3.append(self.basis2[i].wedge(self.basis[j]))
#~
#~ self.basis4 = []
#~ for i in range(len(self.basis3)):
#~ for j in range(i+3,dimension):
#~ self.basis4.append(self.basis3[i].wedge(self.basis[j]))
#~
#~ self.basis2 = []
#~ for a in self.basis:
#~ for b in self.basis:
#~ if b!=a:
#~ self.basis2.append(a.wedge(b))
#~ self.basis3 = []
#~ for a in self.basis2:
#~ for b in self.basis:
#~ if b not in a.forms:
#~ self.basis3.append(a.wedge(b))
#~ if self.dimension>3:
#~ self.basis4 = []
#~ for a in self.basis4:
#~ for b in self.basis:
#~ for c in a.forms:
#~ if b not in c.forms:
#~ self.basis4.append(a.wedge(b))
def __repr__(self):
return "This a complex of dimension: {}".format(self.dimension)
def __str__(self):
return "This a complex of dimension: {}".format(self.dimension)