@@ -213,6 +213,7 @@ def _swap(self, i, direction, exact=False):
213213 else :
214214 svd_options = self .svd_options .copy ()
215215 svd_options ['max_extent' ] = min (self .max_extents [a ], mid_extent )
216+
216217 self [a ], s , self [b ] = tensor_decompose (decompose_expr , tmp , method = 'svd' , ** svd_options )
217218 if s is not None :
218219 self .gauges [b ] = self .backend .asarray (s )
@@ -395,19 +396,18 @@ def _apply_gate_2q(self, i, j, operand):
395396 else :
396397 # insert swap gates recursively
397398 swaps = []
398- exact = self .is_exact_svd
399399 while (j != i + 1 ):
400- self ._swap (i , 'right' , exact )
400+ self ._swap (i , 'right' , False )
401401 swaps .append ([i , 'right' ])
402402 i += 1
403403 if (j == i + 1 ):
404404 break
405- self ._swap (j , 'left' , exact )
405+ self ._swap (j , 'left' , False )
406406 swaps .append ([j , 'left' ])
407407 j -= 1
408408 self ._apply_gate_2q (i , j , operand )
409409 for x , direction in swaps [::- 1 ]:
410- self ._swap (x , direction = direction , exact = exact )
410+ self ._swap (x , direction = direction )
411411
412412 def apply_gate (self , qudits , operand ):
413413 gauge_option = self .gauge_option
@@ -570,7 +570,6 @@ def from_factory(cls, factory, **kwargs):
570570 mps_tensors = None
571571 qudit_dims = factory .state_dims
572572 mps = cls (qudits , factory .backend , qudit_dims = qudit_dims , mps_tensors = mps_tensors , dtype = factory .dtype , ** kwargs )
573-
574573 for op , modes , gate_info in factory .sequence :
575574 if gate_info is None :
576575 if isinstance (op , (list , tuple )):
0 commit comments