SamplexItem¶
- class samplomatic.quantum_program.SamplexItem(circuit: QuantumCircuit, samplex: Samplex, *, samplex_arguments: dict[str, Any] | None = None, shape: tuple[int, ...] | None = None, chunk_size: int | None = None)[source]¶
Bases:
QuantumProgramItemAn item of a
QuantumProgramcontaining a circuit and samplex to feed it arguments.- Parameters:
circuit – The circuit to be executed.
samplex – A samplex to draw random parameters for the circuit.
samplex_arguments – A map from argument names to argument values for the samplex. Each argument array has intrinsic axes determined by its type (e.g.,
parameter_valueshas intrinsic shape(n,)fornparameters, while scalar inputs likenoise_scalehave intrinsic shape()). The extrinsic shapes of all arguments are broadcasted together following NumPy conventions.shape – A shape that the item’s extrinsic shape must be broadcastable to. Axes where
shapeexceeds the shape implicit insamplex_argumentsenumerate independent randomizations.chunk_size – The maximum number of bound circuits in each shot loop execution, or
Noneto use a server-side heuristic to optimize speed. When not executing in a session, the server-side heuristic is always used and this value is ignored.
Attributes Summary
The extrinsic shape of this item, i.e. the broadcasted extrinsic shapes of all inputs.
Attributes Documentation
- shape¶
The extrinsic shape of this item, i.e. the broadcasted extrinsic shapes of all inputs.