Skip to content

Commit

Permalink
small fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jinluchang committed Dec 25, 2024
1 parent 18a197b commit 575ad0c
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 5 deletions.
14 changes: 14 additions & 0 deletions qlat/auto_contractor/compile.py
Original file line number Diff line number Diff line change
Expand Up @@ -791,6 +791,20 @@ def collect_op(self):
# collect common prod into variables
self.variables_prod = collect_subexpr_in_cexpr(self.variables_tr)

def list(self):
return [
self.diagram_types,
self.positions,
self.variables_factor_intermediate,
self.variables_factor,
self.variables_prop,
self.variables_color_matrix,
self.variables_prod,
self.variables_tr,
self.named_terms,
self.named_exprs,
]

### ----

def increase_type_dict_count(type_dict, key):
Expand Down
10 changes: 5 additions & 5 deletions qlat/auto_contractor/wick.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def __repr__(self) -> str:
return f"{self.otype}({self.f!r},{self.p!r},{self.s!r},{self.c!r})"

def list(self):
return [self.otype, self.f, self.p, self.s, self.c]
return [ self.otype, self.f, self.p, self.s, self.c, ]

def __eq__(self, other) -> bool:
return self.list() == other.list()
Expand Down Expand Up @@ -203,7 +203,7 @@ def __repr__(self) -> str:
return f"{self.otype}({self.f!r},{self.p1!r},{self.p2!r},{self.s1!r},{self.s2!r},{self.c1!r},{self.c2!r})"

def list(self):
return [self.otype, self.f, self.p1, self.p2, self.s1, self.s2, self.c1, self.c2]
return [ self.otype, self.f, self.p1, self.p2, self.s1, self.s2, self.c1, self.c2, ]

def __eq__(self, other) -> bool:
return self.list() == other.list()
Expand Down Expand Up @@ -246,7 +246,7 @@ def __repr__(self) -> str:
return f"{self.otype}({self.tag!r},{self.s1!r},{self.s2!r})"

def list(self):
return [self.otype, self.tag, self.s1, self.s2]
return [ self.otype, self.tag, self.s1, self.s2, ]

def __eq__(self, other) -> bool:
return self.list() == other.list()
Expand Down Expand Up @@ -280,7 +280,7 @@ def __repr__(self) -> str:
return f"{self.otype}({self.tag!r},{self.p!r},{self.mu!r},{self.c1!r},{self.c2!r})"

def list(self):
return [self.otype, self.tag, self.p, self.mu, self.c1, self.c2]
return [ self.otype, self.tag, self.p, self.mu, self.c1, self.c2, ]

def __eq__(self, other) -> bool:
return self.list() == other.list()
Expand Down Expand Up @@ -340,7 +340,7 @@ def __repr__(self) -> str:
return f"{self.otype}({self.ops!r},{self.tag!r})"

def list(self):
return [self.otype, self.tag, self.ops]
return [ self.otype, self.tag, self.ops, ]

def __eq__(self, other) -> bool:
return self.list() == other.list()
Expand Down

0 comments on commit 575ad0c

Please sign in to comment.