Load API Code to run programs on Xanadu Hardware

Dear Xanadu Team,

I just got my Xanadu Token to access the hardware and I’m eager to try it. :slight_smile:

I wanted to follow this blog entry: Using PennyLane and Strawberry Fields to run programs on Xanadu hardware but this (here with a token replacement):

import strawberryfields as sf
import pennylane as qml

sf.store_account("e1x2a3m4p5l6e7")

tells me :

AttributeError: module 'strawberryfields' has no attribute 'store_account'

I secondly tried to follow the xcc -steps, described here : Hardware and cloud — Strawberry Fields 0.21.0 documentation but when using (here with a token replacement)

xcc config set REFRESH_TOKEN "e1x2a3m4p5l6e7"

I get

SyntaxError: invalid syntax

I just copied my token one-to-one (alo tried with a regenerated one) into the " ".

My versions are:
pennylane = 0.20.0
strawberryfields =0.21.0
xanadu-cloud-client = 0.1.2

Any suggestions what might be my problem?

Thanks a lot and best regards,
Pia

Hi @Pia!

Can you try the following?

On your terminal run

pip install xanadu-cloud-client

On a jupyter notebook run

import xcc
xcc.Settings(REFRESH_TOKEN="Xanadu Cloud API key goes here").save()

Then run

import xcc.commands
xcc.commands.ping()

You should get a message that says “'Successfully connected to the Xanadu Cloud.”

If it doesn’t work then you can go to https://cloud.xanadu.ai/, login and copy your key again. This key needs to be regenerated every few months so if you find that your key stops working sometime in the future, you can try regenerating it here.

Please let me know if this works for you!

Dear @CatalinaAlbornoz,

thanks for your help! Whit this command

xcc.Settings(REFRESH_TOKEN="Xanadu Cloud API key goes here").save()

it works! :smiley:

Best regards,
Pia

I’m glad that this worked for you @Pia!

Enjoy using PennyLane and Strawberry Fields!