Provide information around the nonlinear Schrödinger equations.

class pynosh.modelevaluator_nls.NlsModelEvaluator(mesh, V=None, A=None, preconditioner_type='none', num_amg_cycles=inf)

Bases: object

Nonlinear Schrödinger model evaluator class. Incorporates

  • Nonlinear Schrödinger: \(g=1.0, V=0.0, A=0.0\).
  • Gross–Pitaevskii: \(g=1.0\), \(V\) given, \(A=0.0\).
  • Ginzburg–Landau: \(g=1.0, V=-1.0\), and some magnetic potential \(A\).
compute_f(x, mu, g)

Computes the nonlinear Schrödinger residual

\[GP(\psi) = K\psi + (V + g |\psi|^2) \psi\]

Compute the Gibbs free energy. Not really a norm, but a good measure for our purposes here.

get_jacobian(x, mu, g)

Returns a LinearOperator object that defines the matrix-vector multiplication scheme for the Jacobian operator as in

\[A \phi + B \phi^*\]


\[\begin{split}A &= K + I (V + g \cdot 2|\psi|^2),\\ B &= g \cdot diag( \psi^2 ).\end{split}\]
get_jacobian_blocks(x, mu, g)


\[\begin{split}A &= K + I (V + g \cdot 2|\psi|^2),\\ B &= g \cdot diag( \psi^2 ).\end{split}\]
get_preconditioner(x, mu, g)

Return the preconditioner.

get_preconditioner_inverse(x, mu, g)

Use AMG to invert M approximately.

inner_product(phi0, phi1)

The natural inner product of the problem.