MCPcopy Create free account
hub / github.com/NVIDIA/cuda-quantum / make_kernel

Function make_kernel

python/cudaq/kernel/kernel_builder.py:1904–1928  ·  view source on GitHub ↗

Create a :class:`Kernel`: An empty kernel function to be used for quantum program construction. This kernel is non-parameterized if it accepts no arguments, else takes the provided types as arguments. Returns a kernel if it is non-parameterized, else a tuple containing the

(*args)

Source from the content-addressed store, hash-verified

1902
1903
1904def make_kernel(*args):
1905 """
1906 Create a :class:`Kernel`: An empty kernel function to be used for quantum
1907 program construction. This kernel is non-parameterized if it accepts no
1908 arguments, else takes the provided types as arguments.
1909
1910 Returns a kernel if it is non-parameterized, else a tuple containing the
1911 kernel and a :class:`QuakeValue` for each kernel argument.
1912
1913.. code-block:: python
1914
1915 # Example:
1916 # Non-parameterized kernel.
1917 kernel = cudaq.make_kernel()
1918
1919 # Example:
1920 # Parameterized kernel that accepts an `int` and `float` as arguments.
1921 kernel, int_value, float_value = cudaq.make_kernel(int, float)
1922 """
1923
1924 kernel = PyKernel([*args])
1925 if len([*args]) == 0:
1926 return kernel
1927
1928 return kernel, *kernel.arguments
1929
1930
1931def isa_dynamic_kernel(object):

Callers 15

_evolution_kernelFunction · 0.90
from_qiskitFunction · 0.50
CUDAQ_TESTFunction · 0.50
TESTFunction · 0.50
CUDAQ_TESTFunction · 0.50
CUDAQ_TESTFunction · 0.50
CUDAQ_TESTFunction · 0.50
CUDAQ_TESTFunction · 0.50
CUDAQ_TESTFunction · 0.50
CUDAQ_TESTFunction · 0.50
CUDAQ_TESTFunction · 0.50
CUDAQ_TESTFunction · 0.50

Calls 1

PyKernelClass · 0.85

Tested by 15

CUDAQ_TESTFunction · 0.40
TESTFunction · 0.40
CUDAQ_TESTFunction · 0.40
CUDAQ_TESTFunction · 0.40
CUDAQ_TESTFunction · 0.40
CUDAQ_TESTFunction · 0.40
CUDAQ_TESTFunction · 0.40
CUDAQ_TESTFunction · 0.40
CUDAQ_TESTFunction · 0.40
CUDAQ_TESTFunction · 0.40
CUDAQ_TESTFunction · 0.40
CUDAQ_TESTFunction · 0.40