Error trying to acess 'simulon_gausian' in pennylane

Hello

I am trying to run a Circuit on Xanadu’s " simulon_gaussian" backend via the strawberry fields pennylane plugin. Unfortunately, when trying to initialise the device with
dev = qml.device('strawberryfields.remote', backend='simulon_gaussian', wires=['0','1','2'], cutoff_dim=10)

I receive in return the error message
ValueError: Device has a fixed number of {'pnr_max': 20, 'homodyne_max': 1000, 'heterodyne_max': 1000} modes and cannot be created with 3 wires.

When I leave out the wires keyword argument I instead receive the error message
`TypeError: ‘dict’ object cannot be interpreted as an integer.

When I look at the source code

    self.backend = backend
    self.cutoff = cutoff_dim
    eng = sf.RemoteEngine(self.backend)

    self.num_wires = eng.device.modes

    if wires is None:
        # infer the number of modes from the device specs
        # and use consecutive integer wire labels
        wires = range(self.num_wires)

    if isinstance(wires, int):
        raise ValueError(
            f"Device has a fixed number of {self.num_wires} modes. The wires argument can "
            f"only be used to specify an iterable of wire labels."
        )

    if self.num_wires != len(wires):
        raise ValueError(
            f"Device has a fixed number of {self.num_wires} modes and "
            f"cannot be created with {len(wires)} wires."
        )

the problem seems to me that
sf.RemoteEngine( 'simulon_gaussian').device.modes

returns the dictionary
{'pnr_max': 20, 'homodyne_max': 1000, 'heterodyne_max': 1000}
while pennylane expects an integer.

Is this a bug or did I do something wrong in my setup?


Note:
I am using pennylane 0.24.0, pennylane-sf 0.20.1 and strawberryfields 0.23.0

Hi @PhilippHS,

This does look like a bug. Thank you for creating an issue for it.

We will look at fixing this. In the meantime you can try using our default.gaussian simulator.

Eg:
dev = qml.device('default.gaussian', wires=3)

Please let me know if this solves your immediate problem and we will let you know when we have a fix.

Hi @CatalinaAlbornoz,

thank you very much for your answer. I mainly wanted to use the simulon_gaussian to test running algorithms on devices in the and cloud so the default.gaussian does not really help. But I can work on something else mean while.

Hey @PhilippHS! From what I understand, we never purposefully supported simulon_gaussian in the pennylane-sf plugin. This feature would have to be added! I see that you’ve already created a GitHub issue, so thank you!

Hi @isaacdevlugt ,
thank you very much for your answer. If it is just for me there is no urgency in implementing this feature. As I said I wanted to use it mainly for testing. But I can also send stuff straight to the X8_01 device if this works better.

Definitely! We encourage you to use the hardware whenever it’s available :slight_smile: