Closed Watayo closed 2 weeks ago
Hi @Watayo, you should be able to simply supply:
circ = qtn.CircuitMPS(..., gate_opts=dict(renorm=True))
to set renormalization to default on. Let me know if that doesn't work!
Whether you renormalize on the go or at the end has no effect on compounding errors etc - its just a floating scalar. It defaulting to off is intentional - I prefer not renormalizating as 1) the norm contains useful information 2) you can always re-normalize at the end but its not so easy to 'un-normalize'. 3) It's not so clear that one should normalize the attained state by simply boosting the remaining part, as opposed to mixing it with the maximally mixed state.
Thank you for early reply, @jcmgray ! I appreciated it to let me know why you set the defaulting to off intentionally.
I had considered again and I guess that it is preferable to mention about it on the documentation. This is because after the norm reaches 0.0 in such as long time dynamics simulation, we cannot handle the calculation at all. Furthermore, I would like to recommend implementing a function that returns the exact norm while renormalizing at each application of a gate. Adding this setting could enhance convenience, and I hope you will consider it.
What is your issue?
While experimenting with applying a two-qubit gate to
quimb.tensor.CircuitMPS()
, I noticed that it could not preserve the norm of states as 1.0 when entanglement possessed by the circuit surpasses the ability of TN states, which represents the circuit. When calculating the unitary dynamics with MPS states, it may be expected to renormalize the sum of the squares of the remaining singular values as 1.0 after truncating the small singular values. Accumulation of errors may cause further numerical troubles due to the operation of restoring the norm at the end of evolution. I naively modified it as follows:However, I have not investigated the effect of this change on other parts of the code. I would appreciate it if you could consider this fix.