Skip to content

Allow for multiple controls and targets in rotation gates - #835

Merged
anthony-santana merged 14 commits into
NVIDIA:mainfrom
anthony-santana:control_list
Nov 7, 2023
Merged

anthony-santana merged 14 commits into
NVIDIA:mainfrom
anthony-santana:control_list

Conversation

@anthony-santana

@anthony-santana anthony-santana commented Oct 27, 2023 •

Copy link
Copy Markdown
Collaborator

Description

  • Allows for a list of individual controls to rotation gates in C++ and python builders

  • New C++ unit tests for controlled rotations

  • New python unit tests for controlled rotations

  • New python compiler test for controlled rotations

  • Handles the qreg -> qubit broadcasting for rotation gates

  • Above allows someone to call rx(value, qreg) as they would with other gates -- kernel builder only

  • New C++ and python unit tests

  • New python compiler test

@copy-pr-bot

copy-pr-bot Bot commented Oct 27, 2023

Copy link
Copy Markdown

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

anthony-santana commented Oct 27, 2023 •

Copy link
Copy Markdown
Collaborator Author

/ok to test

Command Bot: Processing...

@anthony-santana
anthony-santana enabled auto-merge (squash) October 27, 2023 20:26
@github-actions

Copy link
Copy Markdown

CUDA Quantum Docs Bot: A preview of the documentation can be found here.

github-actions Bot pushed a commit that referenced this pull request Oct 27, 2023
Comment thread python/tests/unittests/test_kernel_builder.py
Comment thread lib/Optimizer/CodeGen/LowerToQIR.cpp
@anthony-santana

anthony-santana commented Oct 30, 2023 •

Copy link
Copy Markdown
Collaborator Author

/ok to test

Command Bot: Processing...

1 similar comment
@anthony-santana

anthony-santana commented Oct 30, 2023 •

Copy link
Copy Markdown
Collaborator Author

/ok to test

Command Bot: Processing...

@github-actions

Copy link
Copy Markdown

CUDA Quantum Docs Bot: A preview of the documentation can be found here.

github-actions Bot pushed a commit that referenced this pull request Oct 30, 2023
@anthony-santana anthony-santana changed the title Pass a list of controls to builder rotation gates Allow for multiple controls and targets in rotation gates Nov 1, 2023
@anthony-santana
anthony-santana force-pushed the control_list branch 2 times, most recently from 41b6054 to 95698cb Compare November 2, 2023 22:45
Comment thread lib/Optimizer/CodeGen/LowerToQIR.cpp Outdated
Comment thread runtime/nvqir/NVQIR.cpp Outdated
@anthony-santana

anthony-santana commented Nov 3, 2023 •

Copy link
Copy Markdown
Collaborator Author

/ok to test

Command Bot: Processing...

1 similar comment
@anthony-santana

anthony-santana commented Nov 3, 2023 •

Copy link
Copy Markdown
Collaborator Author

/ok to test

Command Bot: Processing...

@anthony-santana

anthony-santana commented Nov 3, 2023 •

Copy link
Copy Markdown
Collaborator Author

/ok to test

Command Bot: Processing...

@github-actions

github-actions Bot commented Nov 3, 2023

Copy link
Copy Markdown

CUDA Quantum Docs Bot: A preview of the documentation can be found here.

github-actions Bot pushed a commit that referenced this pull request Nov 3, 2023
Signed-off-by: A.M. Santana <anthonys@nvidia.com>
Signed-off-by: A.M. Santana <anthonys@nvidia.com>
Signed-off-by: A.M. Santana <anthonys@nvidia.com>
Signed-off-by: A.M. Santana <anthonys@nvidia.com>
Signed-off-by: A.M. Santana <anthonys@nvidia.com>
Signed-off-by: A.M. Santana <anthonys@nvidia.com>
Signed-off-by: A.M. Santana <anthonys@nvidia.com>
Signed-off-by: A.M. Santana <anthonys@nvidia.com>
Signed-off-by: A.M. Santana <anthonys@nvidia.com>
Signed-off-by: A.M. Santana <anthonys@nvidia.com>
Signed-off-by: A.M. Santana <anthonys@nvidia.com>
Signed-off-by: A.M. Santana <anthonys@nvidia.com>
Signed-off-by: A.M. Santana <anthonys@nvidia.com>
Signed-off-by: A.M. Santana <anthonys@nvidia.com>
@anthony-santana

anthony-santana commented Nov 7, 2023 •

Copy link
Copy Markdown
Collaborator Author

/ok to test

Command Bot: Processing...

@github-actions

github-actions Bot commented Nov 7, 2023

Copy link
Copy Markdown

CUDA Quantum Docs Bot: A preview of the documentation can be found here.

github-actions Bot pushed a commit that referenced this pull request Nov 7, 2023

@schweitzpgi schweitzpgi left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

+1 with the understanding there are a few open issues that need more attention. Thanks for the walk through.

@anthony-santana
anthony-santana merged commit 339fefe into NVIDIA:main Nov 7, 2023
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 7, 2023

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Future note: once pr #876 is merged, these tests may be moved to builder_tester.cpp where they will be run through QPP state/dm, and custatevec

counts.dump();

// Target qubit should've been rotated to |1>.
EXPECT_EQ(counts.count("0000111111"), 1000);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@anthony-santana why do these checks have more bits than qubits allocated?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Oh nevermind, this is because of the ancilla bits being added by the multi-control-decomp

@bettinaheim bettinaheim added the release notes Changes need to be captured in the release notes label Nov 15, 2023
@anthony-santana
anthony-santana deleted the control_list 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.

6 participants