Controlled u3 operation. The controls parameter is expected to be a list of QuakeValue. ```python # Example: kernel = cudaq.make_kernel() qubits = kernel.qalloc(2) kernel.cu3(np.pi, np.pi, np.pi / 2, qubits[0], qubits[1]))
(self, theta, phi, delta, controls, target)
| 1028 | self.createInvariantForLoop(size, body) |
| 1029 | |
| 1030 | def cu3(self, theta, phi, delta, controls, target): |
| 1031 | """ |
| 1032 | Controlled u3 operation. The controls parameter is expected to be a |
| 1033 | list of QuakeValue. |
| 1034 | |
| 1035 | ```python |
| 1036 | # Example: |
| 1037 | kernel = cudaq.make_kernel() |
| 1038 | qubits = kernel.qalloc(2) |
| 1039 | kernel.cu3(np.pi, np.pi, np.pi / 2, qubits[0], qubits[1])) |
| 1040 | ``` |
| 1041 | """ |
| 1042 | with self.insertPoint, self.loc: |
| 1043 | fwdControls = None |
| 1044 | if isinstance(controls, list): |
| 1045 | fwdControls = [c.mlirValue for c in controls] |
| 1046 | elif quake.RefType.isinstance( |
| 1047 | controls.mlirValue.type) or quake.VeqType.isinstance( |
| 1048 | controls.mlirValue.type): |
| 1049 | fwdControls = [controls.mlirValue] |
| 1050 | else: |
| 1051 | emitFatalError(f"invalid controls type for cu3.") |
| 1052 | |
| 1053 | quake.U3Op( |
| 1054 | [], [get_parameter_value(self, p) for p in [theta, phi, delta]], |
| 1055 | fwdControls, [target.mlirValue]) |
| 1056 | |
| 1057 | def cswap(self, controls, qubitA, qubitB): |
| 1058 | """ |