-
Notifications
You must be signed in to change notification settings - Fork 3
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
feat: Add missing tket2 quantum gates, generalise RotationCompile #510
Merged
ss2165
merged 6 commits into
main
from
484-add-missing-tket2quantum-operations-to-quantum-module
Sep 23, 2024
Merged
Changes from 1 commit
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
2dd52df
Generalised RotationCompiler to N qubit inputs, added missing tket2 g…
jake-arkinstall 53c040d
Update guppylang/prelude/_internal/compiler/quantum.py
jake-arkinstall d1171ea
Apply mark's suggestion on unpacking qubits and args in RotationCompiler
jake-arkinstall f2e971b
Added tk2ops to quantum_functional + formatted
jake-arkinstall 9ef9ae8
Removed unused import
jake-arkinstall 6bd9cf1
Added additional tk2ops to integration test, fixed RotationCompiler
jake-arkinstall File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,7 @@ | |
from guppylang.decorator import guppy | ||
from guppylang.prelude._internal.compiler.quantum import ( | ||
HSERIES_EXTENSION, | ||
QUANTUM_EXTENSION, | ||
MeasureReturnCompiler, | ||
RotationCompiler, | ||
) | ||
|
@@ -35,6 +36,10 @@ def h(q: qubit) -> None: ... | |
def cz(control: qubit, target: qubit) -> None: ... | ||
|
||
|
||
@guppy.hugr_op(quantum_op("CY")) | ||
def cy(control: qubit, target: qubit) -> None: ... | ||
Comment on lines
+38
to
+39
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you also add these functions to the |
||
|
||
|
||
@guppy.hugr_op(quantum_op("CX")) | ||
def cx(control: qubit, target: qubit) -> None: ... | ||
|
||
|
@@ -79,6 +84,18 @@ def rz(q: qubit, angle: angle) -> None: ... | |
def rx(q: qubit, angle: angle) -> None: ... | ||
|
||
|
||
@guppy.custom(RotationCompiler("Ry")) | ||
def ry(q: qubit, angle: angle) -> None: ... | ||
|
||
|
||
@guppy.custom(RotationCompiler("CRz")) | ||
def crz(control: qubit, target: qubit, angle: angle) -> None: ... | ||
|
||
|
||
@guppy.hugr_op(quantum_op("Toffoli")) | ||
def toffoli(control1: qubit, control2: qubit, target: qubit) -> None: ... | ||
|
||
|
||
@guppy.hugr_op(quantum_op("QAlloc")) | ||
def dirty_qubit() -> qubit: ... | ||
|
||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.