Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kwarg on process_circuits to cutomise job_name_prefix #5

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
5 changes: 4 additions & 1 deletion pytket/extensions/azure/backends/azure.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,11 @@ def process_circuits(
- option_params: a dictionary with string keys and arbitrary values;
key-value pairs in the dictionary are passed as input parameters to
the backend. Their semantics are backend-dependent.
- job_name_prefix: A custom prefix to add to all job_names. The default is
to use the prefix `azure-quantum-job`.
"""
option_params = kwargs.get("option_params")
job_name_prefix = kwargs.get("job_name_prefix", "job")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The default value doesn't match what is stated in the docstring. Did you want to change this to "azure-quantum-job"? (The "azure-quantum" part seems redundant to me, but happy to go with that if you think it's helpful.)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. I can add back. I changed to azure-quantum-job, but then changed back to job but forgot to update the string.

circuits = list(circuits)
n_shots_list = Backend._get_n_shots_as_list(
n_shots,
Expand All @@ -156,7 +159,7 @@ def process_circuits(
input_data=module.bitcode,
input_data_format="qir.v1",
output_data_format="microsoft.quantum-results.v1",
name=f"job_{i}",
name=f"{job_name_prefix}-{i}",
input_params=input_params,
)
jobid: str = job.id
Expand Down
Loading