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

Allow np.array in DefPermutationGate #1248

Merged
merged 1 commit into from
Sep 9, 2020
Merged

Conversation

notmgsk
Copy link
Contributor

@notmgsk notmgsk commented Sep 7, 2020

Description

Closes #1223. DefPermutationGate supported a permutation of type list or np.ndarray of shape (N, 1). Alas, something like np.array([0, 1]) wasn't supported because its shape looks like (N,). C'est la vie. Cast to np.ndarray early.

Checklist

  • The above description motivates these changes.
  • There is a unit test that covers these changes.
  • All new and existing tests pass locally and on Travis CI.
  • 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, gh-xxx).

@notmgsk notmgsk requested a review from a team as a code owner September 7, 2020 14:59
@notmgsk notmgsk requested a review from kalzoo September 7, 2020 14:59
@notmgsk notmgsk merged commit 7b8fef6 into master Sep 9, 2020
@notmgsk notmgsk mentioned this pull request Sep 9, 2020
@ameyer-rigetti ameyer-rigetti deleted the 1223-allow-1d-nparray branch July 12, 2021 18:57
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.

DefPermutationGate should accept one-dimensional NumPy array
1 participant