KEMBAR78
Support custom unitary operations by khalatepradnya · Pull Request #1794 · NVIDIA/cuda-quantum · GitHub
Skip to content

Conversation

@khalatepradnya
Copy link
Collaborator

@khalatepradnya khalatepradnya commented Jun 10, 2024

Towards issue #1475.


This PR covers the support custom operations in simulation for Python & C++
It builds on the work previously merged #1708


Not covered in this PR:

  • Decomposition of the custom operation into discrete gates (synthesis)
  • Full support of parameterized custom operations

@khalatepradnya khalatepradnya requested a review from amccaskey June 10, 2024 23:02
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.

Need a roundtrip test added for new op, of course.

@github-actions
Copy link

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

github-actions bot pushed a commit that referenced this pull request Jun 10, 2024
@khalatepradnya khalatepradnya force-pushed the cpp_mlir_custom_2 branch 2 times, most recently from a250cc8 to 232a843 Compare June 10, 2024 23:57
@khalatepradnya khalatepradnya self-assigned this Jun 11, 2024
@github-actions
Copy link

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

github-actions bot pushed a commit that referenced this pull request Jun 11, 2024
@khalatepradnya khalatepradnya force-pushed the cpp_mlir_custom_2 branch 2 times, most recently from 0f884eb to e315589 Compare June 11, 2024 04:32
@khalatepradnya
Copy link
Collaborator Author

Need a roundtrip test added for new op, of course.

Addressed in e315589

@khalatepradnya khalatepradnya linked an issue Jun 11, 2024 that may be closed by this pull request
12 tasks
@github-actions
Copy link

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

github-actions bot pushed a commit that referenced this pull request Jun 11, 2024
github-actions bot pushed a commit that referenced this pull request Jun 11, 2024
@github-actions
Copy link

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

1 similar comment
@github-actions
Copy link

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

github-actions bot pushed a commit that referenced this pull request Jun 12, 2024
@github-actions
Copy link

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

github-actions bot pushed a commit that referenced this pull request Jun 12, 2024
@github-actions
Copy link

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

github-actions bot pushed a commit that referenced this pull request Jun 12, 2024
@khalatepradnya khalatepradnya enabled auto-merge (squash) June 12, 2024 18:24
  -- No braces for single statements in if/else/for as per LLVM
standards.
  -- Additional test for remote execution of Python code
  -- Check to emit error if custom operation is encountered in QIR
@khalatepradnya
Copy link
Collaborator Author

Just to confirm - it looks like the unitary operation is always stored in double precision. And I assume that if we're running with single precision simulator, there must be a conversion step occurring during simulation. Is that right?

Yes, it is implicit. Tried to check that with this test - https://github.com/khalatepradnya/cuda-quantum/blob/cpp_mlir_custom_2/python/tests/synthesis/test_custom_operations.py#L112, running same application on different simulators.
Is that sufficient?

@khalatepradnya khalatepradnya disabled auto-merge July 12, 2024 19:00
@khalatepradnya khalatepradnya enabled auto-merge (squash) July 12, 2024 19:04
@github-actions
Copy link

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

github-actions bot pushed a commit that referenced this pull request Jul 12, 2024
github-actions bot pushed a commit that referenced this pull request Jul 12, 2024
@github-actions
Copy link

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

---------

Co-authored-by: Ben Howe <bhowe@nvidia.com>
@khalatepradnya khalatepradnya disabled auto-merge July 12, 2024 21:55
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.

This is looking good, Pradnya. Thanks for doing all the heavy lifting.

I'm good with the C++ side. I understand there are some outstanding issues. I know some/all of them are logged as issues.

I did not look too closely at the python language frontend. So if someone else takes a look at that, go ahead and approve this.

@github-actions
Copy link

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

github-actions bot pushed a commit that referenced this pull request Jul 12, 2024
@khalatepradnya
Copy link
Collaborator Author

This is looking good, Pradnya. Thanks for doing all the heavy lifting.

I'm good with the C++ side. I understand there are some outstanding issues. I know some/all of them are logged as issues.

I did not look too closely at the python language frontend. So if someone else takes a look at that, go ahead and approve this.

Thanks, Eric!
I think @amccaskey did that... or perhaps @bmhowe23 ?

@khalatepradnya khalatepradnya enabled auto-merge (squash) July 12, 2024 23:09
Copy link
Collaborator

@bmhowe23 bmhowe23 left a comment

Choose a reason for hiding this comment

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

👍

@khalatepradnya khalatepradnya merged commit 77b1430 into NVIDIA:main Jul 13, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Jul 13, 2024
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.

Approval on C++ changes

@khalatepradnya khalatepradnya deleted the cpp_mlir_custom_2 branch July 14, 2024 18:52
@khalatepradnya khalatepradnya added enhancement New feature or request language Anything related to the CUDA Quantum language specification labels Jul 19, 2024
@bettinaheim bettinaheim added this to the release 0.8.0 milestone Jul 29, 2024
@bettinaheim bettinaheim changed the title Enable custom unitary operations in MLIR mode Enable custom unitary operations Jul 29, 2024
@bettinaheim bettinaheim changed the title Enable custom unitary operations Support custom unitary operations Jul 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

enhancement New feature or request language Anything related to the CUDA Quantum language specification

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[RFC] Unitary Synthesis

5 participants