CollectZ2ToOutputNode

class samplomatic.samplex.nodes.CollectZ2ToOutputNode(register_name: str, subsystem_idxs: Sequence[int], output_name: str, output_idxs: Sequence[str])[source]

Bases: CollectionNode

Reads from Z2Registers and writes to SamplexOutput.

Parameters:
  • register_name – The name of the register to read from.

  • subsystem_idxs – The subsystems to read from.

  • output_name – The name of the output to write to.

  • output_idxs – The indices of the output to write to.

Methods Summary

collect(registers, outputs, rng)

Collect.

get_style()

Return the style of this node when plotted.

outputs_to()

Return the set of names of outputs this node mutates.

reads_from()

Return a manifest of which virtual register values this node needs to read from.

validate_and_update(register_descriptions)

Validate provided register descriptions are compatible, update with changes.

Methods Documentation

collect(registers, outputs, rng)[source]

Collect.

Parameters:
  • registers – Registers to collect from.

  • outputs – Where to output.

  • rng – A randomness generator.

get_style()[source]

Return the style of this node when plotted.

outputs_to()[source]

Return the set of names of outputs this node mutates.

reads_from()[source]

Return a manifest of which virtual register values this node needs to read from.

validate_and_update(register_descriptions)[source]

Validate provided register descriptions are compatible, update with changes.

This method can be used by a samplex to determine when a node execution order has well-defined dependencies before sampling begins.

Parameters:

register_descriptions – A map from existing register names to their size and type.