bloqade.analog.ir.routine.quera.CustomSubmissionRoutine
← Module overview
class
method
classCustomSubmissionRoutine¶source
bloqade.analog.ir.routine.quera.CustomSubmissionRoutine
Bases: RoutineBase
class CustomSubmissionRoutinemethodsubmit¶source
bloqade.analog.ir.routine.quera.CustomSubmissionRoutine.submit
Signature
def submit(shots: int, url: str, json_body_template: str, method: str = 'POST', args: Tuple[LiteralType] = (), request_options: Dict[str, Any] = {}, use_experimental: bool = False, sleep_time: float = 0.1) -> List[Tuple[NamedTuple, Response]]Compile to QuEraTaskSpecification and submit to a custom service.
>>> body_template = "{{"token": "my_token", "task": {task_ir}}}">>> responses = ( program.quera.custom.submit( 100, "http://my_custom_service.com", body_template ))Parameters
| Name | Type | Default | Description |
|---|---|---|---|
shots | int | required | number of shots |
url | str | required | url of the custom service |
json_body_template | str | required | json body template, must contain '{task_ir}' |
method | str | 'POST' | http method to be used. Defaults to "POST". |
args | Tuple[LiteralType] | () | additional arguments to be passed into the |
request_options | Dict[str, Any] | {} | additional options to be passed into the request method, |
use_experimental | bool | False | Enable experimental hardware capabilities |
sleep_time | float | 0.1 | time to sleep between each request. Defaults to 0.1. |
Returns
(List[Tuple[NamedTuple, Response]], List[Tuple[NamedTuple, Response]])List of parameters for each batch in the task and the response from the post request.
Examples
Here is a simple example of how to use this method. Note the body_template has double curly braces on the outside to escape the string formatting.
source