HaeffnerLab / IonSim.jl

a simple tool for simulating trapped ion systems
https://ionsim.org
MIT License
71 stars 17 forks source link

Thermal mode rounding error #24

Open kdbarajas opened 2 years ago

kdbarajas commented 2 years ago

When setting thermalmode(n,mode), the Hilbert space of the mode is usually truncated when it no longer meaningfully contributes.

However, since the function is defined to have tr(thermalmode(mode,\bar{n})) = 1 for any Hilbert space dimension, rounding error that runs against machine precision begins to occur for large N Hilbert space. There should be a built-in mechanism that catches this and removes rounding error and sets higher mode number to zero.

The following plot represents the RMSE of the solution to timeevolution.schrodinger_dynamic between iterations for a density matrix with thermal mode n = 0.5 and increasing Hilbert space dimension. output

kdbarajas commented 2 years ago

I should note that convergence for say n = 5 under the same setup (only a different thermal mode) had a clear convergence pattern. It is possible that the code isn't properly handling specifically non-integer values.

jbroz11 commented 1 year ago

@kdbarajas Can you provide the specific code that you are using to run the simulation? As is, this is not reproducible.