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

Impose qubit order in MappableRegister #507

Merged
merged 10 commits into from
May 2, 2023
Merged

Impose qubit order in MappableRegister #507

merged 10 commits into from
May 2, 2023

Conversation

a-corni
Copy link
Collaborator

@a-corni a-corni commented Apr 20, 2023

  • I propose to do it by defining a default Sequence._register if the provided register is a MappableRegister, mapping each qubit id from the qubit_ids of the mappable register with the trap of same index in the layout of the mappable register.
  • _register is used as a dummy register during all the operations prior to the build operation.
  • layout of the mappable register is given as an optional parameter of _register, such that it can be used in build to perform the same operation as before.
    Closes Impose qubit order in MappableRegister #502

@a-corni a-corni requested a review from HGSilveri April 20, 2023 08:25
@a-corni a-corni marked this pull request as ready for review April 20, 2023 09:31
@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

pulser-core/pulser/register/mappable_reg.py Outdated Show resolved Hide resolved
tests/test_sequence.py Show resolved Hide resolved
pulser-core/pulser/sequence/sequence.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@HGSilveri HGSilveri left a comment

Choose a reason for hiding this comment

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

LGTM!

Comment on lines +192 to +196
@overload
def get_register(
self, include_mappable: Literal[True]
) -> BaseRegister | MappableRegister:
pass
Copy link
Collaborator

Choose a reason for hiding this comment

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

Mypy complains without this one?

@HGSilveri HGSilveri merged commit b4e7fe4 into develop May 2, 2023
@HGSilveri HGSilveri deleted the map_reg_order branch May 2, 2023 10:20
@HGSilveri HGSilveri mentioned this pull request May 2, 2023
HGSilveri added a commit that referenced this pull request May 2, 2023
Main changes:
- Switching from pasqal-sdk to pasqal-cloud (#510)
- Impose qubit order in MappableRegister (#507) 
- FIX: Serialization of parametrized pulses with constant parameters (#514)
- Drop support for Python 3.7 (#513)
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.

Impose qubit order in MappableRegister
2 participants