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

Stop using _wire setter and use map_wires instead. #3186

Merged
merged 57 commits into from
Oct 28, 2022

Conversation

AlbertMitjans
Copy link
Contributor

@AlbertMitjans AlbertMitjans commented Oct 19, 2022

  1. Remove all the _wires properties.
  2. Stop using op._wires = new_wires, use qml.map_wires(op, wire_map=dict(zip(op.wires, new_wires))) instead.
  3. Deprecate remap_tape_wires

@AlbertMitjans AlbertMitjans added this to the v0.27.0 milestone Oct 27, 2022
@AlbertMitjans AlbertMitjans removed the do not merge ⚠️ Do not merge the pull request until this label is removed label Oct 27, 2022
@AlbertMitjans AlbertMitjans added the review-ready 👌 PRs which are ready for review by someone from the core team. label Oct 27, 2022
Copy link
Contributor

@albi3ro albi3ro left a comment

Choose a reason for hiding this comment

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

  1. Changelog
  2. Think there might be some merge artifacts
  3. Little confused by the different locations of wire mapping in the pattern matching PR
  4. Should test that the warning is emitted by remap_tape_wires with pytest.warns

@AlbertMitjans
Copy link
Contributor Author

AlbertMitjans commented Oct 28, 2022

  1. Changelog

Done

  1. Think there might be some merge artifacts

Fixed

  1. Little confused by the different locations of wire mapping in the pattern matching PR

Some of the changes were wrong, so thank you for catching this! Now I fixed the commutation_dag.py file and the changes will make more sense. I also added some comments to clarify the final changes.

  1. Should test that the warning is emitted by remap_tape_wires with pytest.warns

Done

@AlbertMitjans AlbertMitjans requested a review from albi3ro October 28, 2022 10:25
Co-authored-by: Christina Lee <christina@xanadu.ai>
Copy link
Contributor

@albi3ro albi3ro left a comment

Choose a reason for hiding this comment

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

Always love removing TODO's :)

@AlbertMitjans AlbertMitjans merged commit f206330 into master Oct 28, 2022
@AlbertMitjans AlbertMitjans deleted the remove-wire-setter branch October 28, 2022 15:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
review-ready 👌 PRs which are ready for review by someone from the core team.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants