You'll want to write the cphaseshift
gate in terms of gates that are supported by the IonQ device through Amazon Braket. For example, the circuit
circuit = Circuit().cphaseshift(0, 1, theta)
is equivalent to either of the following circuits, which contain only supported gates:
circuit = Circuit().x(0).x(1).rz(1, -theta/2).zz(0, 1, -theta/2).rz(0, -theta/2).x(0).x(1)
circuit = Circuit().rz(1, theta/2).cnot(0, 1).rz(1, theta/2).cnot(0, 1).rz(0, theta/2)
So if you replace your usage of cphaseshift
with one of the equivalent sequences of gates shown above, it should work. Note that the first example contains only a single 2-qubit gate (zz
), which should make it preferable.
Note that you can see the full list of operations supported by any Amazon Braket device by looking at the device properties. For example, to see the supported gates on the IonQ Aria-1 device, you can run:
from braket.devices import Devices
from braket.aws import AwsDevice
device = AwsDevice(Devices.IonQ.Aria1)
device.properties.action['braket.ir.openqasm.program'].supportedOperations
which will return:
['x', 'y', 'z', 'rx', 'ry', 'rz', 'h', 'cnot', 's', 'si', 't', 'ti', 'v', 'vi', 'xx', 'yy', 'zz', 'swap']