Open maliasadi opened 1 year ago
Possible implementation
def __call__(self, *args, **kwargs):
if isinstance(self, qml.QNode):
if self.device.short_name not in QFunc.RUNTIME_DEVICES:
raise CompileError(
f"The {self.device.short_name} device is not "
"supported for compilation at the moment."
)
...
# instead of generating the same QJITDevice with the same supported operations
# we can easily pass the list of supported operations from the QNode.
device = QJITDevice(
self.device.shots, self.device.wires, self.device.short_name, backend_kwargs
# we can easily access:
, self.device.operations
, self.device.observables
)
We currently serve all backend devices in a way that they all support an identical set of quantum gates. This design assumption would lead to the failure of decomposition rules for the OpenQasm3/Braket device. We may need to implement a device specific decomposition logic for every supported backend devices in the frontend to properly tackle this issue.
Check the
test_unsupported_gate_braket
test unit intest_aws_braket_devices.py
for an example.