Nonlinear Schrodinger equation/quantumoptics.jl

I saw in the documentation of quantumoptics.jl that it can simulate Spin F=1 spinor BEC which is basically three nonlinear coupled partial differential equations. I am wondering whether there is a way to solve GP equation(non-linear Schrodinger equation) for higher spins?

@narayan Sure you can. You just need to add the necessary terms in the Hamiltonian using a directsum. Also, your components will be spin-N/2 rather than spin-1/2 as in the example, but you can just use SpinBasis(N//2) for that.

1 Like

And if I have integer spin, like F=2 or 3. Can I use imaginary time evolution in this kind of approach?

If I’m not mistaken imaginary time evolution should work regardless of the specific system you have. So yeah, you should just be able to adopt the example from the documentation to do what you need.

Imaginary time evolution is gradient descent, don’t do that. Instead, use a solver supporting manifold type constraints (Optim or Manopt) and a better algorithm, like CG or LBFGS.