diff --git a/quimb/tensor/tensor_arbgeom.py b/quimb/tensor/tensor_arbgeom.py index 0e61f70c..9ed9b1fc 100644 --- a/quimb/tensor/tensor_arbgeom.py +++ b/quimb/tensor/tensor_arbgeom.py @@ -1022,7 +1022,16 @@ def gate( gate_ = functools.partialmethod(gate, inplace=True) - def gate_simple_(self, G, where, gauges, renorm=True, **gate_opts): + def gate_simple_( + self, + G, + where, + gauges, + renorm=True, + smudge=1e-12, + power=1.0, + **gate_opts + ): """Apply a gate to this vector tensor network at sites ``where``, using simple update style gauging of the tensors first, as supplied in ``gauges``. The new singular values for the bond are reinserted into @@ -1041,6 +1050,15 @@ def gate_simple_(self, G, where, gauges, renorm=True, **gate_opts): renorm : bool, optional Whether to renormalise the singular after the gate is applied, before reinserting them into ``gauges``. + smudge : float, optional + A small value to add to the gauges before multiplying them in and + inverting them to avoid numerical issues. + power : float, optional + The power to raise the singular values to before multiplying them + in and inverting them. + gate_opts + Supplied to + :meth:`~quimb.tensor.tensor_core.TensorNetwork.gate_inds`. """ if isinstance(where, int): where = (where,) @@ -1055,7 +1073,12 @@ def gate_simple_(self, G, where, gauges, renorm=True, **gate_opts): site_tags = tuple(map(self.site_tag, where)) tn_where = self.select_any(site_tags) - with tn_where.gauge_simple_temp(gauges, ungauge_inner=False): + with tn_where.gauge_simple_temp( + gauges, + smudge=smudge, + power=power, + ungauge_inner=False, + ): info = {} tn_where.gate_(G, where, info=info, **gate_opts) diff --git a/quimb/tensor/tensor_arbgeom_tebd.py b/quimb/tensor/tensor_arbgeom_tebd.py index ff9d4b8b..3af52811 100644 --- a/quimb/tensor/tensor_arbgeom_tebd.py +++ b/quimb/tensor/tensor_arbgeom_tebd.py @@ -743,6 +743,11 @@ def gate(self, U, where): U, where, gauges=self.gauges, **self.gate_opts ) + def normalize(self): + """Normalize the state and simple gauges. + """ + self._psi.normalize_simple(self.gauges) + def compute_energy(self): return self._psi.compute_local_expectation_cluster( terms=self.ham.terms,