Trace formulas for the quantum nonlinear Schrödinger equation