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 custom unitary operations #1794

Merged
merged 60 commits into from
Jul 13, 2024

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

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.

include/cudaq/Optimizer/Dialect/Quake/QuakeOps.td Outdated Show resolved Hide resolved
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
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
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
Copy link

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

1 similar comment
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
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
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 enabled auto-merge (squash) July 12, 2024 19:04
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
Copy link

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

---------

Co-authored-by: Ben Howe <bhowe@nvidia.com>
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.

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
125 checks passed
@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