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

152 basic implementation mapper #160

Merged
merged 17 commits into from
Apr 30, 2024
Merged

Conversation

S-Linde
Copy link
Collaborator

@S-Linde S-Linde commented Apr 25, 2024

This Pull Request includes:

  • Abstract Base Class for the mapping part of the Mapper pass
  • An IdentityMapper. Mapping the first virtual qubit to the first physical qubit, etc.
  • An HardcodedMapper. Map using a predefined (hardcoded) mapping.
  • Standardized tests for the Mapper class. Checks barebones of what we require of a Mapper.
  • Use the output of the Mapper class in a mapper pass on the Circuit object.

This also includes the following bugfix:

  • __eq__ of Measure no longer returns an array of bools.

Closes #152

@S-Linde S-Linde self-assigned this Apr 25, 2024
@S-Linde S-Linde added the enhancement New feature or request label Apr 25, 2024
@S-Linde S-Linde requested a review from elenbaasc April 25, 2024 13:41
Copy link
Collaborator

@elenbaasc elenbaasc left a comment

Choose a reason for hiding this comment

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

Really nice work!

Mostly comments on phrasing things in the docstrings.

The _QubitReIndexer in the general_composer module seems to do something similar to the relabel methods you added in the squirrel_ir module. Do you think we should refactor either one of those? I.e. recycle the QubitReIndexer for the relabel methods or remove the _QubitReIndexer and rely also apply the relabel methods there?

opensquirrel/circuit.py Show resolved Hide resolved
opensquirrel/mapper/general_mapper.py Outdated Show resolved Hide resolved
opensquirrel/mapper/general_mapper.py Outdated Show resolved Hide resolved
opensquirrel/mapper/general_mapper.py Outdated Show resolved Hide resolved
opensquirrel/mapper/general_mapper.py Outdated Show resolved Hide resolved
opensquirrel/utils/check_passes/check_mapper.py Outdated Show resolved Hide resolved
opensquirrel/utils/check_passes/check_mapper.py Outdated Show resolved Hide resolved
opensquirrel/utils/check_passes/check_mapper.py Outdated Show resolved Hide resolved
opensquirrel/utils/check_passes/check_mapper.py Outdated Show resolved Hide resolved
test/test_squirrel_ir.py Show resolved Hide resolved
S-Linde and others added 2 commits April 29, 2024 08:49
Co-authored-by: Chris Elenbaas <67630508+elenbaasc@users.noreply.github.com>
@S-Linde
Copy link
Collaborator Author

S-Linde commented Apr 29, 2024

How do I activate the github actions. When I made this pull-request the github actions started and some of them failed. Then (I think) I fixed the problem, but now the github actions are not running. What do I need to do to let them run?

@elenbaasc
Copy link
Collaborator

A new commit to this branch should initiate the GitHub actions. Otherwise something is not configured correctly....

elenbaasc
elenbaasc previously approved these changes Apr 29, 2024
@elenbaasc elenbaasc merged commit 0924c76 into develop Apr 30, 2024
11 of 17 checks passed
@rturrado rturrado deleted the 152-basic-implementation-mapper branch June 4, 2024 12:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create a basic implementation of a Mapper Pass
2 participants