add_product_rule_tool
Generate all combinations of specified circuits with observables in quantum computing workflows, similar to Python's itertools.product function.
Instructions
Add product (Cartesian product) rule to CircuitObservableBinding.
This generates all combinations of the specified circuits with the specified observables. This is analogous to Python's itertools.product function.
For example, if circuit_indices=[0,1,2] and observable_indices=[0,1], it generates combinations: (0,0), (0,1), (1,0), (1,1), (2,0), (2,1).
Args: binding_id: The ID returned by create_circuit_observable_binding_tool. circuit_indices: List of circuit indices to include in the product. observable_indices: List of observable indices to include in the product.
Returns: Dictionary containing: - status: "success" or "error" - binding_id: The binding ID - combinations_added: Number of combinations added - message: Status description
Example: # Add all combinations of 3 circuits with 2 observables (6 total) result = add_product_rule_tool( binding_id="your_binding_id", circuit_indices=[0, 1, 2], observable_indices=[0, 1] ) # This adds combinations: (0,0), (0,1), (1,0), (1,1), (2,0), (2,1)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| binding_id | Yes | ||
| circuit_indices | Yes | ||
| observable_indices | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||