Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
IsmaelAbdulrahman opened this issue Mar 11, 2025 · 1 comment

Comments

@IsmaelAbdulrahman
Copy link

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

@IsmaelAbdulrahman IsmaelAbdulrahman changed the title How to use use X8 device? How to use X8 device instead of default.qubit (which works fine)? Mar 11, 2025
@IsmaelAbdulrahman IsmaelAbdulrahman changed the title How to use X8 device instead of default.qubit (which works fine)? How to use X8 device instead of "default.qubit" which works fine? Mar 11, 2025
@CatalinaAlbornoz
Copy link

Hi @IsmaelAbdulrahman,

X8 is only designed to work with specific photonic gates, not the gates you're using in your circuit.

On the other hand, access to X8 is very limited at the moment. It's not accessible for general use, only for very specific research in photonics.

If you're interested in running PennyLane circuits on quantum hardware I recommend that you use our PennyLane-Qiskit plugin or the PennyLane-Braket plugin.

I'm sorry I don't have better news but I hope these alternatives help!

If you're interested in simulations of Gaussian states and Fock states I can recommend another library (note this is only for simulation and not running on hardware).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants