precisionqutip

Is there a way to increase number precision in qutip functions?


I have a problem where the difference of two relative entropies is finite, but they individually diverge. The function that calculates relative entropies in qutip is qt.entropy_relative(state1, state2), however there is no option where I can increase the precision of the operation.

The problem boils down to differentiating very small eigenvalues from 0 when calculating the logarithm of an operator, such that I need to increase the floating-point-precision of my calculation. I have looked into the documentation of qutip, and there is nothing there that solves my issue, as well as trying to massage the calculations to get rid of the problem in the calculation, which I also didn't manage.

Has anyone an idea of how to deal with this, be it an obscure function of qutip I did not find or an external work around?


Solution

  • In QuTiP's documentation for the function, there is tol, a parameter specifically meant for that task. Also, it's worth noticing that you can change the base from e to 2. Since smaller log bases will be more precise, it might have a good effect on your calculations.