@@ -81,7 +81,7 @@ def coloring_copied_nodes(
81
81
node .id = getattr (n0 , "id" , id (n0 ))
82
82
83
83
@staticmethod
84
- def copy (
84
+ def copy_nodes (
85
85
nodes : Sequence [tn .Node ],
86
86
dangling : Optional [Sequence [tn .Edge ]] = None ,
87
87
conj : Optional [bool ] = False ,
@@ -111,7 +111,7 @@ def copy(
111
111
def _copy (
112
112
self , conj : Optional [bool ] = False
113
113
) -> Tuple [List [tn .Node ], List [tn .Edge ]]:
114
- return self .copy (self ._nodes , self ._front , conj )
114
+ return self .copy_nodes (self ._nodes , self ._front , conj )
115
115
116
116
def apply_general_gate (
117
117
self ,
@@ -171,7 +171,7 @@ def apply_general_gate(
171
171
self ._front [index [0 ]] = n1 [0 ]
172
172
self ._front [index [1 ]] = n2 [1 ]
173
173
if self .is_dm :
174
- [n1l , n2l ], _ = self .copy ([n1 , n2 ], conj = True )
174
+ [n1l , n2l ], _ = self .copy_nodes ([n1 , n2 ], conj = True )
175
175
n1l [1 ] ^ self ._front [index [0 ] + nq ]
176
176
n2l [2 ] ^ self ._front [index [1 ] + nq ]
177
177
self ._nodes .append (n1l )
@@ -186,7 +186,7 @@ def apply_general_gate(
186
186
self ._front [index [0 ]] = n1 [0 ]
187
187
self ._front [index [1 ]] = n2 [1 ]
188
188
if self .is_dm :
189
- [n1l , n2l ], _ = self .copy ([n1 , n2 ], conj = True )
189
+ [n1l , n2l ], _ = self .copy_nodes ([n1 , n2 ], conj = True )
190
190
n2l [1 ] ^ self ._front [index [0 ] + nq ]
191
191
n1l [2 ] ^ self ._front [index [1 ] + nq ]
192
192
self ._nodes .append (n1l )
@@ -203,7 +203,7 @@ def apply_general_gate(
203
203
# gate.id = id(gate)
204
204
self ._nodes .append (gate )
205
205
if self .is_dm :
206
- lgates , _ = self .copy ([gate ], conj = True )
206
+ lgates , _ = self .copy_nodes ([gate ], conj = True )
207
207
lgate = lgates [0 ]
208
208
self ._nodes .append (lgate )
209
209
for i , ind in enumerate (index ):
0 commit comments