LeftU2ParametricMultiplicationNode
class samplomatic.samplex.nodes.LeftU2ParametricMultiplicationNode(operand: Literal['rz', 'rx'], register_name: str, param_idxs: list[int])
Bases: U2ParametricMultiplicationNode
Perform parametric left multiplication on a U2Register.
The node stores a parametric representation of a one-qubit gate or gates from the original circuit and performs a multiplication, where is the existing U2Register.
is limited to the gates rz or rx, and all gates within the node are of the same type.
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
ParamIndexfor 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
Column 1 | Column 2 |
|---|---|
evaluate(registers, parameter_values) | Evaluate this node. |
Methods Documentation
evaluate
evaluate(registers: dict[str, VirtualRegister], parameter_values: ndarray)
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.