Failed to submit the job to the Azure Quantum workspace??

p martin 136 Reputation points
2021-05-05T02:47:37.593+00:00

Howdy Quantum folks

So I can get a very simple test code (randonum gen) to run on IONQ with no problem using VS and the dotnet run command. Just like in the tutorials and workshop demos. Life is good. Next, I can get a Python code to login to my Quantum Workspace and run the shipping container optimization example on Azure. Life is even better. And then I can even get a Python code to run the simple randonum generator code from before, while using a .simulate() command. In fact I can run q# codes all kinds of ways as long as I stick to the simulate() command. Life is almost as good as it can get!! But we are after Nirvana. And that would require the Python code to be able to run the q# operations directly FOR REAL on the IONQ Q...P...U.... --- This is where the troublesome trumpet sounds its fading death wail. wahhh wahhhh waaaaaaah......

Connected to Azure Quantum workspace ####### in location #####us.
Loading package Microsoft.Quantum.Providers.IonQ and dependencies...
Active target is now ionq.qpu
Submitting TestIONQ.GetRandomResult to target ionq.qpu...
Failed to submit Q# operation TestIONQ.GetRandomResult for execution.
Could not load file or assembly 'System.Text.Json, Version=5.0.0.0, Culture=neutral, PublicKeyToken=####token#####'. The system cannot find the file specified.

There is something messed up with <TargetFramework>netcoreapp3.1</TargetFramework> maybe not getting loaded by Python?
Per the User manual for q# I am following the work flow of getting something working in q# in VS with dotnet run , and then just simply calling that from Python - including the .csproj file.

here is the code:

Python code:

import qsharp
import qsharp.azure
qsharp.projects.add("****path to *******/TestIONQ.csproj")
from TestIONQ import GetRandomResult
print(f"Simulated Result: {GetRandomResult.simulate()}")
print("------------------------------------------------")

qsharp.azure.connect(
  subscription = "****************************",
  resourceGroup = "**************",
  workspace = "j************",
  location = "******* US")
qsharp.azure.target("ionq.qpu")
result = qsharp.azure.execute(GetRandomResult, jobName="Generate random bit")
print(f" Final result from IONQ - QPU:   {result}")

csproj file:

<Project Sdk="Microsoft.Quantum.Sdk/0.16.2104138035">

  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>netcoreapp3.1</TargetFramework>
    <ExecutionTarget>ionq.qpu</ExecutionTarget>
    <IQSharpLoadAutomatically>true</IQSharpLoadAutomatically>
  </PropertyGroup>

</Project>

q# code:

    namespace TestIONQ {

        open Microsoft.Quantum.Canon;
        open Microsoft.Quantum.Intrinsic;

        //@EntryPoint()
        operation GetRandomResult() : Result {
            use q = Qubit();
            H(q);
            return M(q);
        }

}

I humbly thank you for any help or advice.

Azure Quantum
Azure Quantum
An Azure service that provides quantum computing and optimization solutions.
60 questions
{count} votes

Accepted answer
  1. kobulloc-MSFT 23,496 Reputation points Microsoft Employee
    2021-05-06T23:51:57.493+00:00

    @p martin An Azure Quantum program manager was able to reproduce the error you are seeing and has asked us to escalate the issue which is being looked at by the product team. We'll get those pesky trumpets resolved!

    Edit: A hotfix has been released:
    https://learn.microsoft.com/en-us/azure/quantum/qdk-relnotes#version-0162105140472

    0 comments No comments

0 additional answers

Sort by: Most helpful