Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion azure-quantum/azure/quantum/cirq/targets/ionq.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ def submit(
azure_job = super().submit(
circuit=serialized_program.body,
name=name,
num_shots=repetitions,
shots=repetitions,
metadata=metadata,
**kwargs
)
Expand Down
2 changes: 1 addition & 1 deletion azure-quantum/azure/quantum/cirq/targets/quantinuum.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def submit(
azure_job = super().submit(
circuit=serialized_program,
name=name,
num_shots=repetitions,
shots=repetitions,
metadata=metadata,
**kwargs
)
Expand Down
13 changes: 1 addition & 12 deletions azure-quantum/azure/quantum/target/ionq.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,9 @@
from typing import Any, Dict, List
from warnings import warn

from azure.quantum.target.target import (
Target,
_determine_shots_or_deprecated_num_shots,
)
from azure.quantum.job.job import Job
from azure.quantum.target.target import Target
from azure.quantum.workspace import Workspace
from azure.quantum._client.models import CostEstimate, UsageEvent
from typing import Union


Expand Down Expand Up @@ -91,13 +87,6 @@ def submit(
)
if input_params is None:
input_params = {}

num_shots = kwargs.pop("num_shots", None)

shots = _determine_shots_or_deprecated_num_shots(
shots=shots,
num_shots=num_shots,
)

return super().submit(
input_data=input_data,
Expand Down
13 changes: 1 addition & 12 deletions azure-quantum/azure/quantum/target/quantinuum.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,9 @@
from typing import Any, Dict, Union
from warnings import warn

from azure.quantum.target.target import (
Target,
_determine_shots_or_deprecated_num_shots,
)
from azure.quantum.job.job import Job
from azure.quantum.target.target import Target
from azure.quantum.workspace import Workspace
from azure.quantum._client.models import CostEstimate, UsageEvent


class Quantinuum(Target):
Expand Down Expand Up @@ -86,13 +82,6 @@ def submit(
if input_params is None:
input_params = {}

num_shots = kwargs.pop("num_shots", None)

shots = _determine_shots_or_deprecated_num_shots(
shots=shots,
num_shots=num_shots,
)

return super().submit(
input_data=input_data,
name=name,
Expand Down
30 changes: 0 additions & 30 deletions azure-quantum/azure/quantum/target/target.py
Original file line number Diff line number Diff line change
Expand Up @@ -390,33 +390,3 @@ def _calculate_qir_module_gate_stats(self, qir_module) -> GateStats:
multi_qubit_gates,
measurement_gates
)


def _determine_shots_or_deprecated_num_shots(
shots: int = None,
num_shots: int = None,
) -> int:
"""
This helper function checks if the deprecated 'num_shots' parameter is specified.
In earlier versions it was possible to pass this parameter to specify shots number for a job,
but now we only check for it for compatibility reasons.
"""
final_shots = None
if shots is not None and num_shots is not None:
warnings.warn(
"Both 'shots' and 'num_shots' parameters were specified. Defaulting to 'shots' parameter. "
"Please, use 'shots' since 'num_shots' will be deprecated.",
category=DeprecationWarning,
)
final_shots = shots

elif shots is not None:
final_shots = shots
elif num_shots is not None:
warnings.warn(
"The 'num_shots' parameter will be deprecated. Please, use 'shots' parameter instead.",
category=DeprecationWarning,
)
final_shots = num_shots

return final_shots
Loading
Loading