Open khalatepradnya opened 1 month ago
For vis, @Omar-ORCA
For vis, @Omar-ORCA
LGTM
Updated the decorator as per inputs from @amccaskey
Let's have a quick sync on implementation to make sure we are not missing anything that will lead to some technical pain across the different scenarios in the future. We'll set something up for a larger group and once we have confirmation that works across the board, we can approve and move forward with it. Acknowledged that the API looks good - not we need to talk implementation. :)
Required prerequisites
Describe the feature
Add support to use the
photonics
target from Python frontend of CUDA-QProposed API
Gates (same as those supported on C++ frontend):
plus(q: qudit) -> None
,phase_shift(q: qudit, phi: float) -> None
,beam_splitter(q: qudit, r: qudit, theta: float) -> None
,mz(q: qudit) -> int
andmz(q: list[qudit]) -> list[int]
* A decorator for photonics kernel which defines the qudit level for all qudits within the kernel (Defaults to level = 2, i.e., qubit):@cudaq.photonics_kernel(level=N)
* A photonics kernel is defined with@cudaq.kernel(handler="orca")
qudit
of level = N, for example,qudit(3)
cudaq.sample(kernel)
Example
cudaq.set_target("photonics")
@cudaq.kernel def photonicsKernel():
qutrits = [qudit(3) for i in range(2)] plus(qutrits[0]) plus(qutrits[1]) plus(qutrits[1]) mz(qutrits)
counts = cudaq.sample(photonicsKernel) print(counts)