CollectTemplateValues

class samplomatic.samplex.nodes.CollectTemplateValues(template_params_name: str, template_idxs: ndarray[tuple[int, int], dtype[int64]], register_name: str, register_type: VirtualType, subsystem_idxs: ndarray[tuple[int], dtype[int64]], synth: Synth)[source]

Bases: CollectionNode

Collects a register slice and writes corresponding template values to output.

Parameters:
  • template_params_name – The name of the output to write template parameters to.

  • template_idxs – An array of shape (num_subsystems, num_params_per_subsystem) specifying which entries of the entire template parameter value array to write to.

  • register_name – The name of the register to collect.

  • register_type – What kind of register type to collect.

  • subsystem_idxs – The slice of the register to collect.

  • synth – A synth to take the product of register values and generate template parameter values.

Raises:

Attributes Summary

num_subsystems

The number of subsystems being collected.

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.

Attributes Documentation

num_subsystems

The number of subsystems being collected.

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.