Quera
CustomSubmissionRoutine ¶
Bases: RoutineBase
submit ¶
submit(
shots,
url,
json_body_template,
method="POST",
args=(),
request_options={},
use_experimental=False,
sleep_time=0.1,
)
Compile to QuEraTaskSpecification and submit to a custom service.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
shots | int | number of shots | required |
url | str | url of the custom service | required |
json_body_template | str | json body template, must contain '{task_ir}' | required |
method | str | http method to be used. Defaults to "POST". | '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 | Enable experimental hardware capabilities | False |
sleep_time | float | time to sleep between each request. Defaults to 0.1. | 0.1 |
Returns:
Type | Description |
---|---|
List[Tuple[NamedTuple, Response]] | List[Tuple[NamedTuple, Response]]: List of parameters for each batch in |
List[Tuple[NamedTuple, Response]] | 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.
>>> body_template = "{{"token": "my_token", "task": {task_ir}}}"
>>> responses = (
program.quera.custom.submit(
100,
"http://my_custom_service.com",
body_template
)
)
Source code in src/bloqade/ir/routine/quera.py
QuEraHardwareRoutine ¶
Bases: RoutineBase
run_async ¶
Compile to a RemoteBatch, which contain QuEra backend specific tasks, and run_async through QuEra service.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
shots | int | number of shots | required |
args | Tuple | additional arguments | () |
name | str | custom name of the batch | None |
shuffle | bool | shuffle the order of jobs | False |
Return
RemoteBatch