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

Add M and R aliases for cirq.measure and cirq.reset #5993

Merged
merged 2 commits into from
Jan 31, 2023
Merged

Conversation

maffoo
Copy link
Contributor

@maffoo maffoo commented Jan 31, 2023

Fixes #5992

@maffoo maffoo requested review from a team, vtomole and cduck as code owners January 31, 2023 18:41
@maffoo maffoo requested a review from dabacon January 31, 2023 18:41
@@ -779,6 +780,10 @@ def reset(qubit: 'cirq.Qid') -> raw_types.Operation:
return ResetChannel(qubit.dimension).on(qubit)


R = reset
document(R, """Alias for cirq.reset""")
Copy link
Collaborator

Choose a reason for hiding this comment

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

This overwrites the reset docstring here.

Perhaps we should just add a note about the R alias to the reset docstring?

Copy link
Collaborator

Choose a reason for hiding this comment

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

If we want references to cirq.M in the generated docs, we might need to create a wrapper function so it is a different object.

Copy link
Collaborator

@pavoljuhas pavoljuhas left a comment

Choose a reason for hiding this comment

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

We need to keep the actual docstrings for measure and reset.

@maffoo
Copy link
Contributor Author

maffoo commented Jan 31, 2023

Thanks, @pavoljuhas. I fixed the docstrings and added notes there about the new aliases.

@maffoo maffoo requested a review from pavoljuhas January 31, 2023 22:03
Copy link
Collaborator

@pavoljuhas pavoljuhas left a comment

Choose a reason for hiding this comment

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

LGTM

@maffoo maffoo merged commit 0c523d4 into master Jan 31, 2023
@maffoo maffoo deleted the u/maffoo/mr branch January 31, 2023 22:30
harry-phasecraft pushed a commit to PhaseCraft/Cirq that referenced this pull request Oct 31, 2024
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.

cirq.M and cirq.R as aliases for measure and reset
2 participants