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": realjnp.sign(jnp.cos(phase))(±1, or0at a node);"phase": complexjnp.exp(1j * phase);"cos": realjnp.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:
phasetransformed according to the specified output type.