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

feat!: Add remaining tket2 ops #107

Merged
merged 5 commits into from
Jan 17, 2024
Merged

feat!: Add remaining tket2 ops #107

merged 5 commits into from
Jan 17, 2024

Conversation

mark-koch
Copy link
Collaborator

Also change the signature of measure to Qubit -> bool.

Fixes #104 and fixes #106

Comment on lines 83 to 85
@guppy.hugr_op(quantum, quantum_op("Measure"))
def measure_q(q: Qubit) -> tuple[Qubit, bool]:
...
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Any ideas for a better name?

Copy link
Collaborator

Choose a reason for hiding this comment

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

restless_measure or nondestructive_measure ?

Copy link
Collaborator Author

@mark-koch mark-koch Jan 16, 2024

Choose a reason for hiding this comment

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

Seyon suggested measure_return?

Comment on lines 128 to 130
@guppy.custom(quantum, MeasureCompiler())
def measure(q: Qubit) -> bool:
...
Copy link
Collaborator Author

@mark-koch mark-koch Jan 16, 2024

Choose a reason for hiding this comment

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

Ideally, we would directly write

@guppy(quantum)
def measure(q: Qubit) -> bool:
   q, res = measure_q(q)
   discrad(q)
   return res

However, linking doesn't work yet, so we have to use a CustomCallCompiler

@mark-koch mark-koch requested a review from aborgna-q January 16, 2024 15:33
Copy link
Collaborator

@aborgna-q aborgna-q left a comment

Choose a reason for hiding this comment

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

I'd say this is a feat!: rather than a chore:, but LGTM.

Comment on lines 83 to 85
@guppy.hugr_op(quantum, quantum_op("Measure"))
def measure_q(q: Qubit) -> tuple[Qubit, bool]:
...
Copy link
Collaborator

Choose a reason for hiding this comment

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

restless_measure or nondestructive_measure ?

@mark-koch mark-koch changed the title chore: Add remaining tket2 ops feat!: Add remaining tket2 ops Jan 16, 2024
@mark-koch mark-koch merged commit e0761ff into main Jan 17, 2024
1 check passed
@mark-koch mark-koch deleted the chore/quantum-ops branch January 17, 2024 16:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add remaining tket2 ops Qubit allocation / discard.
2 participants