Skip to content
This repository was archived by the owner on Jan 16, 2026. It is now read-only.

How to use X8 device instead of "default.qubit" which works fine? #755

@IsmaelAbdulrahman

Description

@IsmaelAbdulrahman

Dear All,

I have a code written in Python using PennyLane for discrete qubits (device: default.qubit) and it works just fine. I am now trying to use the actual quantum hardware X8 device via strawberryfields.remote. I have installed Strawberry Fields (SF) and PennyLane. However, I have been trying to connect but without success, following the documentation provided by PennyLane. Any help would be greatly appreciated.

dev = qml.device("default.qubit", wires=n_wires)
def layer(x, theta):
    for wire in range(n_wires):
        qml.RY(theta[wire] * x, wires=wire)
    for wire1 in range(n_wires):
        for wire2 in range(wire1 + 1, n_wires):
            qml.CZ(wires=[wire1, wire2])
    for wire in range(n_wires):
        qml.RX(theta[wire + n_wires] * x, wires=wire)
        qml.RZ(theta[wire + 2 * n_wires] * x, wires=wire)
    for wire in range(n_wires):
        qml.Hadamard(wires=wire)
@qml.qnode(dev)
def quantum_neural_net(theta, x=None):
    layer(x, theta)
    return [qml.expval(qml.PauliZ(wire)) for wire in range(n_wires)]

System information
Strawberry Fields: a Python library for continuous-variable quantum circuits.
Copyright 2018-2020 Xanadu Quantum Technologies Inc.

Python version: 3.10.16
Platform info: Windows-10-10.0.26100-SP0
Installation path: C:\Users\ismae\anaconda3\envs\sf_env\lib\site-packages\strawberryfields
Strawberry Fields version: 0.23.0
Numpy version: 1.23.5
Scipy version: 1.13.1
SymPy version: 1.13.1
NetworkX version: 3.4.2
The Walrus version: 0.21.0
Blackbird version: 0.5.0
XCC version: 0.3.2
TensorFlow version: None

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions