Skip to content
This repository has been archived by the owner on Nov 16, 2023. It is now read-only.

Adaptive (n, 1, p)-QRACs #31

Closed

Conversation

areeq-hasan
Copy link
Contributor

Summary

Details and comments

garrison added a commit that referenced this pull request Jun 2, 2022
Partially addresses #16

Currently, the only files that are lacking such docstrings
are those dealing with magic rounding.  I did not want to create
conflicts with #31.)
@garrison garrison added needs: changelog Should be (but has not yet been) noted in the release notes rounding Related to QRAO rounding schemes labels Jun 2, 2022
@areeq-hasan areeq-hasan marked this pull request as ready for review June 7, 2022 20:17
@garrison
Copy link
Member

garrison commented Jun 8, 2022

There are (a lot of) changes in this pull request that are unrelated to its stated goal (and provided without justification). A good pull request should make a single logical change, ideally the minimal changes required to meet its goal, as smaller pull requests are much easier to review than longer ones.

That said, some of the suggested spelling substitutions might be improvements and should be considered separately, perhaps discussed in an issue first. I think it's worth saving this branch aside as is to keep a record. Any changes to interfaces, though, will break existing users of the code, so should be carefully considered, and if possible, the old names should be made to continue to work, keeping with the deprecation policy.

@garrison
Copy link
Member

I'm going to close this, since it is being superseded by other PRs. There's a lot of good stuff in here, but we're going to make each change one at a time instead. It will nonetheless be useful to reference this from time to time.

@garrison garrison closed this Jun 18, 2022
@garrison garrison removed the needs: changelog Should be (but has not yet been) noted in the release notes label Jun 18, 2022
Copy link
Member

@garrison garrison left a comment

Choose a reason for hiding this comment

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

I added a few comments on the changes to encoding.py. It would be nice to have a small PR that does a similar refactor, in preparation for adaptive QRACs.

Comment on lines +127 to +128
has_even_parity = sum(dvar_values) % 2
has_even_count = num_dvars % 2
Copy link
Member

@garrison garrison Jun 24, 2022

Choose a reason for hiding this comment

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

I believe these should actually be called has_odd_parity (or simply parity) and has_odd_count.

for i in range(num_dvars - 1)
]
)
state = One if (has_even_parity if has_even_count else dvar_values[0]) else Zero
Copy link
Member

Choose a reason for hiding this comment

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

The double inline if makes this line a bit obscure. I wonder if there's a more clear way to phrase this.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
rounding Related to QRAO rounding schemes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants