Skip to content

bloqade.analog.ir.routine.quera.CustomSubmissionRoutine

← Module overview

classCustomSubmissionRoutinesource

bloqade.analog.ir.routine.quera.CustomSubmissionRoutine

Bases: RoutineBase

class CustomSubmissionRoutine

methodsubmitsource

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

NameTypeDefaultDescription
shotsintrequirednumber of shots
urlstrrequiredurl of the custom service
json_body_templatestrrequiredjson body template, must contain '{task_ir}'
methodstr'POST'http method to be used. Defaults to "POST".
argsTuple[LiteralType]()additional arguments to be passed into the
request_optionsDict[str, Any]{}additional options to be passed into the request method,
use_experimentalboolFalseEnable experimental hardware capabilities
sleep_timefloat0.1time 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