Acessing rigetti.qpu.ankaa-3 using AzureQuantum

kannan george 5 Reputation points
2025-01-20T12:10:02.5666667+00:00

I am trying to get [Quil-T][1] working on rigetti.qpu.ankaa-3, using [AzureQuantum][2].

I have the following which works perfectly:

	import os
    ID =  "...."
     
    os.environ["AZURE_QUANTUM_SUBSCRIPTION_ID"] = "ID"
    os.environ["AZURE_QUANTUM_WORKSPACE_RG"] = "AzureQuantum"
    os.environ["AZURE_QUANTUM_WORKSPACE_NAME"] = "Try100"
    os.environ["AZURE_QUANTUM_WORKSPACE_LOCATION"] = "UK South"
    
    from azure.quantum import Workspace
    
    workspace = Workspace(
                resource_id = "/subscriptions/ID/resourceGroups/AzureQuantum/providers/Microsoft.Quantum/Workspaces/Try100",
                location = "uksouth")
    
    print("This workspace's targets:")
    for target in workspace.get_targets():
        print("-", target.name)
    
    from pyquil_for_azure_quantum import get_qpu, get_qvm
    from pyquil.gates import CNOT, MEASURE, H
    from pyquil.quil import Program
    from pyquil.quilbase import Declare
    
    program = Program(
        Declare("ro", "BIT", 2),
        H(0),
        CNOT(0, 1),
        MEASURE(0, ("ro", 0)),
        MEASURE(1, ("ro", 1)),
    ).wrap_in_numshots_loop(10)
    
    qpu = get_qpu("Ankaa-9Q-3")
    qvm = get_qvm()
    
    exe = qpu.compile(program)  # This does not run quilc yet.
    results = qpu.run(exe)  # Quilc will run in the cloud before executing the program.
    qvm_results = qvm.run(exe)  # This runs the program on QVM in the cloud, not locally.

However when i try the following (https://pyquil-docs.rigetti.com/en/stable/quilt_getting_started.html) :

	from pyquil.gates import CNOT, MEASURE, H
    from pyquil.quil import Program
    from pyquil.quilbase import Declare
    from pyquil_for_azure_quantum import get_qpu, get_qvm
    
    qc = get_qpu("Ankaa-9Q-3")
    
    qc.compiler.get_version_info()

I get the following error:

{
    	"name": "GetISAError",
    	"message": "Call failed during http request: error in refresh_qcs_token: Requested an access token for a configuration without credentials.",
    	"stack": "---------------------------------------------------------------------------
    GetISAError                               Traceback (most recent call last)
    Cell In[28], line 8
          4 from pyquil_for_azure_quantum import get_qpu, get_qvm
          6 qc = get_qpu(\"Ankaa-9Q-3\")
    ----> 8 qc.compiler.get_version_info()
    
    File /opt/anaconda3/envs/Quil/lib/python3.11/site-packages/pyquil_for_azure_quantum/__init__.py:78, in AzureQuantumComputer.__init__.
Azure Quantum
Azure Quantum
An Azure service that provides quantum computing and optimization solutions.
74 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Prrudram-MSFT 27,786 Reputation points
    2025-01-23T18:22:50.9433333+00:00

    Hi @kannan george

    After a thorough review with our quantum team, we see all of the packages used in the code below are from Rigetti, not from Microsoft, and it looks like the underlying issue is authentication.

    It would appear if the first sample is working correctly that they can authenticate and submit jobs to Azure Quantum.

    The error in the second sample states “Call failed during http request: error in refresh_qcs_token”. I’m not familiar with a ‘qcs_token’, and it seems from a brief search that QCS is a Rigetti thing, not an Azure Quantum thing (see https://docs.rigetti.com/qcs). If they are trying to use Rigetti packages and hitting Rigetti auth errors, then they should probably reach out to Rigetti to understand the root cause.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.