Tests `Kernel::control()` with another kernel that's parameterized by an int. Test for both a single qubit and a register of qubits as the controls.
(qubit_count)
| 147 | |
| 148 | @pytest.mark.parametrize("qubit_count", [1, 5]) |
| 149 | def test_kernel_control_int_args(qubit_count): |
| 150 | """ |
| 151 | Tests `Kernel::control()` with another kernel that's |
| 152 | parameterized by an int. Test for both a single qubit |
| 153 | and a register of qubits as the controls. |
| 154 | """ |
| 155 | other_kernel, other_int = cudaq.make_kernel(int) |
| 156 | other_qubit = other_kernel.qalloc(qubit_count) |
| 157 | # TODO: |
| 158 | # Would like to be able to test kernel operations that |
| 159 | # can accept an int. |
| 160 | |
| 161 | kernel, _int = cudaq.make_kernel(int) |
| 162 | control_qubit = kernel.qalloc(qubit_count) |
| 163 | kernel.control(other_kernel, control_qubit, _int) |
| 164 | print(kernel) |
| 165 | |
| 166 | |
| 167 | # CHECK-LABEL: func.func @__nvqpp__mlirgen__PythonKernelBuilderInstance |