Which system to try photonic Tutorials?

I’m working through https://strawberryfields.ai/photonics/demos/tutorial_X8.html … is the “offline” status a temporary condition or should I somehow be using some other device?

(xanadu_venv) $ xcc job submit --name "remote_job1" --target "X8_01" --circuit "$(cat program.xbb)"
ERROR: The target specified for this job (X8_01) is not online.
(xanadu_venv) $ xcc device list
[
    {
        "target": "simulon_gaussian",
        "status": "online"
    },
    {
        "target": "X8_01",
        "status": "offline"
    }
]

Now the device is up but it apparently can’t run the code example in the tutorial.

$ xcc job get "e73e2f95-1b89-4048-8d7c-2b872013a1ba"
    {
    "id": "e73e2f95-1b89-4048-8d7c-2b872013a1ba",
    "name": "remote_job1",
    "status": "failed",
    "target": "X8_01",
    "language": "blackbird:1.0",
    "created_at": "2022-04-05 17:11:22.733245+00:00",
    "finished_at": null,
    "running_time": null,
    "metadata": {
        "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."
    }
}

Hi @Jack_W, thank you for posting this question. The “offline” status usually means that the system is down for maintenance or other reasons. Regarding the error message you’re getting, have you got the same message several times?

Well, I just tried it again and got the same message.

Tried it a few times. I can give you the job id’s if that helps.

Hi @Jack_W. The issue here is that the Blackbird script in the demo isn’t compiled to the hardware device, meaning that, in it’s current form, the hardware cannot run it. Compiling the same circuit would yield:

name remote_job1
version 1.0
target X8_01 (shots=20)

S2gate(1.0000000000000837, 0.0) | [0, 4]
S2gate(1.0000000000000837, 0.0) | [1, 5]
S2gate(1.0000000000000837, 0.0) | [2, 6]
S2gate(0.0, 0.0) | [3, 7]

MZgate(1.2408451700466991, 2.556007574087654) | [0, 1]
MZgate(1.972949389807099, 4.2087890906170555) | [2, 3]
MZgate(0.22839762078996698, 2.081623741005019) | [1, 2]
MZgate(0.7772935740442868, 1.73255603857762) | [0, 1]
MZgate(0.6321441017641966, 5.060264735175897) | [2, 3]
MZgate(0.9775726389626069, 0.7616793023755224) | [1, 2]

MZgate(1.2408451700466991, 2.556007574087654) | [4, 5]
MZgate(1.972949389807099, 4.2087890906170555) | [6, 7]
MZgate(0.22839762078996698, 2.081623741005019) | [5, 6]
MZgate(0.7772935740442868, 1.73255603857762) | [4, 5]
MZgate(0.6321441017641966, 5.060264735175897) | [6, 7]
MZgate(0.9775726389626069, 0.7616793023755224) | [5, 6]

Rgate(1.3182532077679654) | 0
Rgate(5.089138967412175) | 1
Rgate(2.6910865747406314) | 2
Rgate(1.047599076881538) | 3
Rgate(1.3182532077679654) | 4
Rgate(5.089138967412175) | 5
Rgate(2.6910865747406314) | 6
Rgate(1.047599076881538) | 7

MeasureFock() | [0, 1, 2, 3, 4, 5, 6, 7]

Submitting this should work (let us know if it still doesn’t).

Alternatively, you can compile it yourself using Strawberry Fields:

import strawberryfields as sf

eng = sf.RemoteEngine("X8")
program = sf.load("program1.xbb")
program_compiled = program.compile(device=eng.device)
sf.save("compiled_script.xbb", program_compiled)

and you will get the same script as the one posted above.

1 Like

Okay, thanks, @theodor … works for me.
It appears the tutorial “Working with Blackbird scripts” needs an edit as the exercise omits the compile step.

Thanks for pointing us to this issue @Jack_W! We will update the tutorial.

1 Like

@CatalinaAlbornoz, while you’re at it, you can fix your forum software :slight_smile:
I tried to post the URL of the problem tutorial and the forum flagged it as spam!

Oh, thank you for pointing this out too @Jack_W! We will look into it.

1 Like