LeftU2ParametricMultiplicationNode

class samplomatic.samplex.nodes.LeftU2ParametricMultiplicationNode(operand: Literal['rz', 'rx'], register_name: str, param_idxs: list[int])[source]

Bases: U2ParametricMultiplicationNode

Perform parametric left multiplication on a U2Register.

The node stores a parametric representation \(g\) of a one-qubit gate or gates from the original circuit and performs a \(g*reg\) multiplication, where \(reg\) is the existing U2Register.

\(g\) is limited to the gates rz or rx, and all gates within the node are of the same type:math:.

Parameters:
  • operand – The gate type, given as a string.

  • register_name – The name of the register the operation is applied to.

  • param_idxs – List of ParamIndex for the parameter expressions specifying the gate arguments. List order must match the order subsystems in the register.

Raises:

SamplexConstructionError – if param_idxs is empty.

Methods Summary

evaluate(registers, parameter_values)

Evaluate this node.

Methods Documentation

evaluate(registers: dict[str, VirtualRegister], parameter_values: ndarray)[source]

Evaluate this node.

Parameters:
  • registers – At least those registers needed by this node to read from or write to.

  • parameter_values – The evaluated values of the parameter expressions in indices self.parameter_idxs, at the same order.

Raises:

SamplexRuntimeError – If the number of parameter values doesn’t match the number of parameter expressions in self.parameter_idxs.