Skip to content

Add ability to substitute values for memory references#1385

Merged
notmgsk merged 4 commits intorcfrom
1383-substitute-memory-references
Oct 15, 2021
Merged

Add ability to substitute values for memory references#1385
notmgsk merged 4 commits intorcfrom
1383-substitute-memory-references

Conversation

@mhodson-rigetti
Copy link
Contributor

@mhodson-rigetti mhodson-rigetti commented Sep 22, 2021

Description

Resolves #1383 generally as suggested. However, because the identity of a memory reference (as a key- ie. its hash) includes the offset, and substitution is via a map using this key, it was easier to ask the user to address each offset to be substituted individually. Thus, conceptually, the substitution map is { x[0]: <number>, x[1]: <number>, x[2]: <number> } for some array x of length 3.

I'm assuming there are no large-scale performance expectations on this new ability where the array access would make a difference. There is no impact on previous code paths. The alternative would be to use the names (strings) only as the key, but that would technically be a breaking change, where as this PR is not (the key is covariant to the previous Parameter class, and now also MemoryReference).

Checklist

  • The PR targets the rc branch (not master).
  • Commit messages are prefixed with one of the prefixes outlined in the commit syntax checker (see pattern field).
  • The above description motivates these changes.
  • There is a unit test that covers these changes.
  • All new and existing tests pass locally and on the PR's checks.
  • Parameters and return values have type hints with PEP 484 syntax.
  • Functions and classes have useful Sphinx-style docstrings.
  • All code follows Black style and obeys flake8 conventions.
  • (New Feature) The docs have been updated accordingly.
  • (Bugfix) The associated issue is referenced above using auto-close keywords.
  • The changelog is updated, including author and PR number (@username, Test ignore #1234).

@mhodson-rigetti mhodson-rigetti requested a review from a team as a code owner September 22, 2021 12:52
@mhodson-rigetti mhodson-rigetti self-assigned this Sep 22, 2021
Copy link
Contributor

@notmgsk notmgsk left a comment

Choose a reason for hiding this comment

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

LGTM!

@notmgsk
Copy link
Contributor

notmgsk commented Oct 12, 2021

@mhodson-rigetti When you have a moment, could you finish the check list and rebase onto rc? Cheers!

@mhodson-rigetti mhodson-rigetti force-pushed the 1383-substitute-memory-references branch from adcf26b to 629a031 Compare October 14, 2021 00:37
@notmgsk notmgsk force-pushed the 1383-substitute-memory-references branch from 823097f to 3222392 Compare October 14, 2021 22:06
@notmgsk notmgsk force-pushed the 1383-substitute-memory-references branch from 3222392 to 32bba9f Compare October 15, 2021 19:44
@notmgsk notmgsk merged commit 3460708 into rc Oct 15, 2021
@rigetti-githubbot
Copy link

🎉 This PR is included in version 3.1.0-rc.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@dbanty dbanty deleted the 1383-substitute-memory-references branch February 14, 2022 17:03
@rigetti-githubbot
Copy link

🎉 This PR is included in version 3.2.0-rc.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@rigetti-githubbot
Copy link

🎉 This PR is included in version 3.2.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants