neuralqx.nn.projectors.vacuum.novacuum_projector module

class NoVacuumProjector(base, vacuum_value=-1e+30, enabled=True, parent=<flax.linen.module._Sentinel object>, name=None)

Bases: Module

Wrapper that enforces zero amplitude on the vacuum (all-zero) basis state.

Assumes:
  • input sigma has shape (B, N)

  • base network returns shape (B,)

Behaviour:
  • For any row sigma[b, :] that is all zeros, the output is replaced by vacuum_value.

  • Default vacuum_value=0.

vacuum_value: Any = -1e+30

The value the all-zero basis element amplitude will be replaced with

enabled: bool = True

If False, no replacement of the all-zero basis element amplitude occurs.

name: str | None = None
parent: Module | Scope | _Sentinel | None = None
scope: Scope | None = None
wrap_model(base_model, *, vacuum_value=-1e+30, enabled=True)

Convenience wrapper to wrap any Flax module.

Return type:

NoVacuumProjector

projector(*, vacuum_value=-1e+30, enabled=True)

Decorator factory to wrap a Module class into a NoVacuumProjector.

Usage:

@projector() class MyAnsatz(nn.Module):

model = MyAnsatz(…)