'device-error' in implementation of Tutorial

I am trying to implement the tutorial on the X8 machine but it is giving me a device-error code.

import numpy as np

import strawberryfields as sf
from strawberryfields import ops
from strawberryfields import RemoteEngine

from strawberryfields.utils import random_interferometer
U = random_interferometer(4)

prog = sf.Program(8, name="remote_job1")

with prog.context as q:
    # Initial squeezed states
    # Allowed values are r=1.0 or r=0.0
    ops.S2gate(1.0) | (q[0], q[4])
    ops.S2gate(1.0) | (q[1], q[5])
    ops.S2gate(1.0) | (q[3], q[7])

    # Interferometer on the signal modes (0-3)
    ops.Interferometer(U) | (q[0], q[1], q[2], q[3])
    ops.BSgate(0.543, 0.123) | (q[2], q[0])
    ops.Rgate(0.453) | q[1]
    ops.MZgate(0.65, -0.54) | (q[2], q[3])

    # *Same* interferometer on the idler modes (4-7)
    ops.Interferometer(U) | (q[4], q[5], q[6], q[7])
    ops.BSgate(0.543, 0.123) | (q[6], q[4])
    ops.Rgate(0.453) | q[5]
    ops.MZgate(0.65, -0.54) | (q[6], q[7])

    ops.MeasureFock() | q
eng = RemoteEngine("X8")
results = eng.run(prog, shots=20)

The full error message below:

raise FailedJobError(message)
strawberryfields.engine.FailedJobError: The remote job fde5275e-6be1-48a3-ad9b-28378a4ef0aa failed due to an internal server error: {'error-code': 'device-error', 'error-detail': 'The hardware device was unable to process your job request. The error was forwarded to technical support. If this error occurs repeatedly and you would like to follow up on a bugfix, please contact technical support with a copy of this error message, including the job-id.'}. Please try again.

The versions of my packages-

numpy 1.23.5
StrawberryFields 0.23.0

Hello @Aditya_Ranjan,

With your code and !pip install pennylane-sf I receive these results, but a Xanadu Cloud API key is needed.

-0.236997009908951 -0.3221738080676012j
0.686619222752453 -0.2538584035519544j]
[ 0.4821502144015314+0.1645902608085209j
0.047045813315011 -0.0413230220243907j]

'Installation — PennyLane-StrawberryFields 0.29.1 documentation

Hi there,

I have the Cloud API setup. I can also access it as “xcc ping” command tells me that it is successfully connected to “Successfully connected to the Xanadu Cloud.”

I have installed strawberryfield rather than pennylane-sf. Does that make a difference?

Thank you for the reply.


I tried using pennylane-sf as well. I am getting the same error as before. Any information regarding this would be helpful.

Hi @Aditya_Ranjan and @kevinkawchak ,

The pennylane-sf plugin is only if you want to use PennyLane. I would recommend using Strawberry Fields directly, as you were doing in the beginning. The best is to create a new virtual environment and pip install xanadu-cloud-client strawberryfields.

I’m being able to run your code with no issues.

After you create the new virtual environment could you please post the output of sf.about() and please post the full error message?