Target Class
Initializes a new target.
Constructor
Target(workspace: Workspace, name: str, input_data_format: str = '', output_data_format: str = '', capability: str = '', provider_id: str = '', content_type: ContentType = ContentType.json, encoding: str = '', average_queue_time: float | None = None, current_availability: str = '', target_profile: str | TargetProfile = 'Base')
Parameters
| Name | Description |
|---|---|
|
workspace
Required
|
Associated workspace |
|
name
Required
|
Target name |
|
input_data_format
Required
|
Format of input data (ex. "qir.v1") |
|
output_data_format
Required
|
Format of output data (ex. "microsoft.quantum-log.v1") |
|
capability
Required
|
QIR capability. Deprecated, use target_profile |
|
provider_id
Required
|
Id of provider |
|
content_type
|
"Content-Type" attribute value to set on input blob (ex. "application/json") Default value: ContentType.json
|
|
encoding
Required
|
"Content-Encoding" attribute value to set on input blob (ex. "gzip") |
|
average_queue_time
|
Set average queue time (for internal use) Default value: None
|
|
current_availability
Required
|
Set current availability (for internal use) |
|
target_profile
|
str | <xref:TargetProfile>
Target QIR profile. Default value: Base
|
Methods
| from_target_status |
Create a Target instance from a given workspace and target status. |
| make_params |
Returns an input parameter object for convenient creation of input parameters. |
| refresh |
Update the target availability and queue time |
| submit |
Submit input data and return Job. Provide input_data_format, output_data_format and content_type keyword arguments to override default values. |
from_target_status
Create a Target instance from a given workspace and target status.
from_target_status(workspace: Workspace, provider_id: str, status: TargetStatus, **kwargs)
Parameters
| Name | Description |
|---|---|
|
workspace
Required
|
Associated workspace |
|
status
Required
|
<xref:TargetStatus>
Target status with availability and current queue time |
|
provider_id
Required
|
|
Returns
| Type | Description |
|---|---|
|
Target instance |
make_params
Returns an input parameter object for convenient creation of input parameters.
make_params()
refresh
Update the target availability and queue time
refresh()
submit
Submit input data and return Job.
Provide input_data_format, output_data_format and content_type keyword arguments to override default values.
submit(input_data: Any, name: str = 'azure-quantum-job', shots: int = None, input_params: Dict[str, Any] | InputParams | None = None, priority: str | None = None, tags: list[str] | None = None, **kwargs) -> Job
Parameters
| Name | Description |
|---|---|
|
input_data
Required
|
Input data |
|
name
|
Job name Default value: azure-quantum-job
|
|
shots
|
Number of shots, defaults to None Default value: None
|
|
input_params
|
Input parameters Default value: None
|
|
priority
|
Priority of job. Default value: None
|
|
tags
|
Tags for the job. Default value: None
|
Returns
| Type | Description |
|---|---|
|
Azure Quantum job |
Attributes
average_queue_time
Average queue time.
current_availability
Current availability.
target_names
Tuple of target names.
target_names = ()