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

Deprecate builder ctrl gates that are not specification compliant #935

Merged
merged 1 commit into from
Nov 16, 2023

Conversation

anthony-santana
Copy link
Collaborator

Description

With (PR #876), we are now enforcing the use of cudaq::ctrl when a programmer intends to run a control gate. This behavior must be matched in the kernel builder to remain specification compliant.

As is, this deprecates the old functions with a stern warning, and replaces them with new templated versions. Depending on when this PR is merged, the deprecated functions should be removed for the following release cycle.

Note: this has no impact on the Python API, only the C++ kernel builder.

Old behavior that will now show a deprecation notice:

auto [kernel, value] = cudaq::make_kernel<float>();
std::vector<cudaq::QuakeValue> ctrls{kernel.qalloc(), kernel.qalloc()};
auto target = kernel.qalloc();

// Now deprecated:
kernel.x(ctrls, target);
kernel.x(value, ctrls, target);
kernel.rx(3.14, ctrls, target);

The preferred method moving forward is

kernel.x<cudaq::ctrl>(ctrls, target);
kernel.x<cudaq::ctrl>(value, ctrls, target);
kernel.rx<cudaq::ctrl>(3.14, ctrls, target);

Copy link

copy-pr-bot bot commented Nov 15, 2023

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@anthony-santana
Copy link
Collaborator Author

anthony-santana commented Nov 15, 2023

/ok to test

Command Bot: Processing...

Copy link
Collaborator

@schweitzpgi schweitzpgi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🙌

Signed-off-by: A.M. Santana <anthonys@nvidia.com>
@anthony-santana
Copy link
Collaborator Author

anthony-santana commented Nov 16, 2023

/ok to test

Command Bot: Processing...

@anthony-santana anthony-santana enabled auto-merge (squash) November 16, 2023 16:55
@anthony-santana anthony-santana merged commit a323245 into NVIDIA:main Nov 16, 2023
104 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Nov 16, 2023
@bettinaheim bettinaheim added this to the release 0.6.0 milestone Jan 22, 2024
@bettinaheim bettinaheim added the release notes Changes need to be captured in the release notes label Jan 22, 2024
@anthony-santana anthony-santana deleted the ctrl_gates branch March 18, 2024 15:55
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release notes Changes need to be captured in the release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants