gate CNOT not supported
sassan72 opened this issue · comments
i am using Pennylane_aqt for my simulation. i got this error:
File "/home/anaconda3/lib/python3.7/site-packages/pennylane/_device.py", line 673, in check_validity
"Gate {} not supported on device {}".format(operation_name, self.short_name)
pennylane._device.DeviceError: Gate CNOT not supported on device pennylane_aqt.Simulator
Thanks for bringing this to our attention. We will start looking into a fix.
thanks. i realized the problem. The ion trap computers supports two-qubit gate operation Mølmer-Sørenson not CNOT directly. each CNOT must be decomposed into Mølmer-Sørenson and some single qubit rotation gate. This paper https://doi.org/10.1088/1367-2630/ab3372 has mentioned the decomposition of CNOT into Mølmer-Sørenson.
@sassan72 nice catch! It sounds like we should add a decomposition to the CNOT gate down into Mølmer-Sørenson gates :)
yes. Thanks for your quick response.
@josh146 is this device-specific decompositoin something that would be in the plugin, or in PL-core?
It's a good question. We have two options:
-
Add a decomposition to
qml.CNOT
directly in core. Possible because CNOT has no existing decompositions defined, and likely to work well since (as far as I know) no other qubit devices do not support CNOT. Currently, ops can only have one decomposition defined, although this might change with the operation refactor. -
Alternatively, once the expansion is moved to the device, we could have a custom CNOT->Mølmer-Sørenson decomposition occurring here in the AQT device.
I think I favour (1); only complication is if we expect there to be other devices that do not support CNOT nor Mølmer-Sørenson.
as far as i know, IONQ and Honeywell can't also support CNOT directly. because their system are ION TRAP based.
Honeywell should support CNOTs, they do a compilation step for submitted programs. But I don't believe AQT does this.
@josh146 option number 2 will be the best option, since the Molmer-Sorenson gate is only native to the AQT device.
@sassan72 it should be possible to auto-decompose CNOTs into Molmer-Sorenson gates hopefully by the next release of PennyLane