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__.