Skip to main content
IBM Quantum Platform

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)

GitHub

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

Column 1
Column 2
num_subsystemsThe number of subsystems being collected.
template_idxsSpecification of which entries of the template parameter value array to write to.

Methods Summary

Column 1
Column 2
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.

template_idxs

Specification of which entries of the template parameter value array to write to.

Methods Documentation

collect

collect(registers, outputs, rng)

GitHub

Collect.

Parameters

  • registers – Registers to collect from.
  • outputs – Where to output.
  • rng – A randomness generator.

get_style

get_style()

GitHub

Return the style of this node when plotted.

outputs_to

outputs_to()

GitHub

Return the set of names of outputs this node mutates.

reads_from

reads_from()

GitHub

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

validate_and_update

validate_and_update(register_descriptions)

GitHub

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.

Was this page helpful?
Report a bug, typo, or request content on GitHub.