'device-error' in implementation of Tutorial

Hi,
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)
np.set_printoptions(precision=16)
print(U)

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)
print(results.samples)

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.0210856391204191-0.5368303362146857j
-0.236997009908951 -0.3221738080676012j
-0.0981514394555408-0.0766895655068101j
0.686619222752453 -0.2538584035519544j]
[-0.1821533210322363-0.1231820475285705j
0.7755162823310933-0.1777750737384837j
-0.3851438329143497+0.3660680025158925j
-0.0022191761140666-0.1904478683516187j]
[ 0.4821502144015314+0.1645902608085209j
-0.3687081038662368+0.1033382255880174j
-0.4831880021601475+0.597013581038163j
0.047045813315011 -0.0413230220243907j]
[-0.3322383135907148-0.5413629619100713j
-0.2424604040677547-0.0399433526517151j
-0.3259732974829684+0.0773886227413599j
-0.3777990271377379+0.5302656249321172j]]

Reference:
'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.

Hi,

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?