quantax.nn.compute_sign#

quantax.nn.compute_sign(kernel: Array, s: Array, output: str, neg: bool = False, bias: Array | float = 0.0) Array#

Compute a sign, phase, or cosine structure from a linear form of the spin configuration, phase = jnp.dot(kernel.flatten(), s.flatten()) + bias.

Parameters:
  • kernel – The kernel array used for computation.

  • s – The spin configuration array.

  • output –

    The type of output to compute:

    • "sign": real jnp.sign(jnp.cos(phase)) (±1, or 0 at a node);

    • "phase": complex jnp.exp(1j * phase);

    • "cos": real jnp.cos(phase).

  • neg – Whether to negate the output.

  • bias – A constant added to the exponent before the transform, used to encode a configuration-independent offset (e.g. the constant in a Marshall sign).

Returns:

phase transformed according to the specified output type.