neuralqx.nn.projectors.vacuum package

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.

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(…)

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

Convenience wrapper to wrap any Flax module.

Return type:

NoVacuumProjector

Submodules