2

I am implementing a VQE algorithm where I need controlled phase gate as part of ansatz circuit. I am using Amazon Braket service. Ionq processor however does not support c-phase gate or phase gate. How can I implement it?

The error message is as follows

AlgorithmError: ValidationException: An error occurred (ValidationException) when calling the CreateQuantumTask operation: [line 55] uses a gate: phaseshift which is not supported by the device or defined via a defcal, exit code: 1

Ryan Shaffer
  • 548
  • 3
  • 8
F1_light
  • 35
  • 3

1 Answers1

3

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']
Ryan Shaffer
  • 548
  • 3
  • 8