Support the submission of Q# projects with `azure.quantum` API
I want to propose an enhancement to the azure.quantum python API: support Q# Jobs submission to Azure Quantum.
Currently, the official ways to submit Q# jobs to Azure Quantum are:
-
Python: use the
qsharppython package -
Jupyter Notebook:
%azure.executemagic command -
CLI:
az quantum
1 and 2 use the same technology (IQ#), while 3 is written in Python: https://github.com/Azure/azure-cli-extensions/tree/main/src/quantum
The proposal is to take the relevant parts from az quantum Python code and add them to azure.quantum (qdk-python).
https://github.com/Azure/azure-cli-extensions/blob/3b632bb2e04244d662ca724c88da0b8034d5ef60/src/quantum/azext_quantum/operations/job.py#L85-L86
https://github.com/Azure/azure-cli-extensions/blob/3b632bb2e04244d662ca724c88da0b8034d5ef60/src/quantum/azext_quantum/operations/job.py#L162-L163
The azure.quantum Python API is more natural in Python code (does not require Jupyter server with an IQ# kernel) and can manage multiple accounts simultaneously (unlike az CLI).
Naively, all needed is to change the submit method of the QsharpJob class (which will inherit from Job class).
@jond01, thanks for the suggestion. This would require azure-quantum to depend on qsharp which currently needs to be installed either via conda or manually using pip and dotnet. We could take it as an optional dependency, though.
@jond01, I think the context that you're missing here is that we don't send the Q# code to the service but it actually needs to be compiled into QIR or other binary formats, which is why we have the dependency on the qsharp (and indirectly iq# and .Net).
Users would still need to create an external Q# project and be able to compile it from the command line (notice the az quantum basically just starts an external process to do this) so not sure if a lot of value on it.