question

pmartin-5416 avatar image
0 Votes"
pmartin-5416 asked kobulloc-MSFT edited

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

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
· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi, @pmartin-5416

Let's see if we can help you with those pesky trumpets! I'm doing some investigation on my end and will get back to you soon (likely a day, I have a bit of setup to do on my end).

0 Votes 0 ·

Thank you kindly!! I appreciate the help and will stand by. For more information here is a link with more detail.


0 Votes 0 ·

Thank you for the link! That will be very helpful.

0 Votes 0 ·

1 Answer

kobulloc-MSFT avatar image
0 Votes"
kobulloc-MSFT answered kobulloc-MSFT edited

@pmartin-5416 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://docs.microsoft.com/en-us/azure/quantum/qdk-relnotes#version-0162105140472

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.