Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support applying controlled parametrized gates in kernel_builder with double #723

Closed
1 task done
oryarnitzky-classiq opened this issue Oct 1, 2023 · 0 comments · Fixed by #784
Closed
1 task done
Assignees
Milestone

Comments

@oryarnitzky-classiq
Copy link

oryarnitzky-classiq commented Oct 1, 2023

Required prerequisites

  • Search the issue tracker to check if your feature has already been mentioned or rejected in other issues.

Describe the feature

The r1, rx, ry and rz methods allow to apply a parameterized gate to the current kernel.
There is an overload for this functions that accept a double parameter and a single qubit:

void NAME(double param, QuakeValue qubit) { \
std::vector<QuakeValue> empty; \

and there is an overload that accept a QuakeValue for the parameter, a vector of qubits for control operation and a single qubit for the target:

void NAME(QuakeValue parameter, std::vector<QuakeValue> &ctrls, \
QuakeValue &target) { \

I was wondering if it's possible to add an overload that accept a double parameter, a vector of qubits for control and a single qubit of target. It seems like convert a double to a QuakeValue requires access to the opBuilder member but it is private so I can't do that externally.

@oryarnitzky-classiq oryarnitzky-classiq added the enhancement New feature or request label Oct 1, 2023
anthony-santana added a commit that referenced this issue Oct 18, 2023
Closes #723
Closes #751

Binds the controlled versions of: r1, rx, ry, rz to python
New python unit tests for existing: cx, cy, cz, ch, cs, ct
New python compiler tests for existing: cx, cy, cz, ch, cs, ct
New python unit tests for r1, rx, ry, rz
New python compiler tests for r1, rx, ry, rz
Update existing python documentation and tests to reflect that we can now pass a register of controls to our c-gates
What this PR doesn't address:

A follow-up PR will handle the controlled SWAP implementation in the C++/python builder

* everything except controlled swaps

Signed-off-by: A.M. Santana <[email protected]>

* forgot the parameter annotations

Signed-off-by: A.M. Santana <[email protected]>

* add keywords back to compiler test

Signed-off-by: A.M. Santana <[email protected]>

* swap implementation

Signed-off-by: A.M. Santana <[email protected]>

* remove swap work for separate pr

Signed-off-by: A.M. Santana <[email protected]>

* format compiler test

Signed-off-by: A.M. Santana <[email protected]>

* incorrect filecheck string

Signed-off-by: A.M. Santana <[email protected]>

* hard coded kernel names in filecheck

Signed-off-by: A.M. Santana <[email protected]>

* forgot to add new gates to api docs

Signed-off-by: A.M. Santana <[email protected]>

* replace references to doubles with floats in python docs

Signed-off-by: A.M. Santana <[email protected]>

---------

Signed-off-by: A.M. Santana <[email protected]>
@bettinaheim bettinaheim added ecosystem and removed enhancement New feature or request labels Oct 26, 2023
@bettinaheim bettinaheim added this to the release 0.5.0 milestone Oct 26, 2023
MarkusPfundstein pushed a commit to fermioniq/cuda-quantum that referenced this issue Sep 23, 2024
Closes NVIDIA#723
Closes NVIDIA#751

Binds the controlled versions of: r1, rx, ry, rz to python
New python unit tests for existing: cx, cy, cz, ch, cs, ct
New python compiler tests for existing: cx, cy, cz, ch, cs, ct
New python unit tests for r1, rx, ry, rz
New python compiler tests for r1, rx, ry, rz
Update existing python documentation and tests to reflect that we can now pass a register of controls to our c-gates
What this PR doesn't address:

A follow-up PR will handle the controlled SWAP implementation in the C++/python builder

* everything except controlled swaps

Signed-off-by: A.M. Santana <[email protected]>

* forgot the parameter annotations

Signed-off-by: A.M. Santana <[email protected]>

* add keywords back to compiler test

Signed-off-by: A.M. Santana <[email protected]>

* swap implementation

Signed-off-by: A.M. Santana <[email protected]>

* remove swap work for separate pr

Signed-off-by: A.M. Santana <[email protected]>

* format compiler test

Signed-off-by: A.M. Santana <[email protected]>

* incorrect filecheck string

Signed-off-by: A.M. Santana <[email protected]>

* hard coded kernel names in filecheck

Signed-off-by: A.M. Santana <[email protected]>

* forgot to add new gates to api docs

Signed-off-by: A.M. Santana <[email protected]>

* replace references to doubles with floats in python docs

Signed-off-by: A.M. Santana <[email protected]>

---------

Signed-off-by: A.M. Santana <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants