Target Class

Initializes a new target.

Inheritance
Target
azure.quantum.job.session.SessionHost
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 = '')

Parameters

Name Description
workspace
Required

Associated workspace

name
Required
str

Target name

input_data_format
Required
str

Format of input data (ex. "qir.v1")

output_data_format
Required
str

Format of output data (ex. "microsoft.resource-estimates.v1")

capability
Required
str

QIR capability

provider_id
Required
str

Id of provider (ex. "microsoft-qc")

content_type

"Content-Type" attribute value to set on input blob (ex. "application/json")

Default value: ContentType.json
encoding
Required
str

"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
str

Set current availability (for internal use)

Methods

estimate_cost

Estimate the cost for a given circuit.

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.

estimate_cost

Estimate the cost for a given circuit.

estimate_cost(input_data: Any, input_params: Dict[str, Any] | None = None)

Parameters

Name Description
input_data
Required
input_params
Default value: None

from_target_status

Create a Target instance from a given workspace and target status.

from_target_status(workspace: Workspace, status: TargetStatus, **kwargs)

Parameters

Name Description
workspace
Required

Associated workspace

status
Required
<xref:TargetStatus>

Target status with availability and current queue time

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, **kwargs) -> Job

Parameters

Name Description
input_data
Required
Any

Input data

name
str

Job name

Default value: azure-quantum-job
shots
int

Number of shots, defaults to None

Default value: None
input_params

Input parameters

Default value: None

Returns

Type Description
Job

Azure Quantum job

Attributes

average_queue_time

Average queue time.

current_availability

Current availability.

target_names

Tuple of target names.

target_names = ()