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

Adding DetuningMap, DMM #539

Merged
merged 23 commits into from
Jul 24, 2023
Merged

Adding DetuningMap, DMM #539

merged 23 commits into from
Jul 24, 2023

Conversation

a-corni
Copy link
Collaborator

@a-corni a-corni commented Jun 23, 2023

In this draft, I have tried to define a DetuningMap, a DMM and the way to define them via Register, Register3D, MappableRegister, RegisterLayout for the DetuningMap, and in Device for the DMM.
I think the easiest way to draw a DetuningMap is via RegDrawer. The fact that I defined DetuningMap in the module dmm, separately from RegDrawer and Register creates a circular import: To define a Register you need a DetuningMap that needs a RegDrawer that needs the register module to finish intializing.
Conclusion: with the current draft, the next step would be to move the DetuningMap to the register module, and -I guess- DMM to the channel module.

@HGSilveri
Copy link
Collaborator

I refactored as you suggested. I also made DetuningMap and subclass of WeightMap and made some changes to fix broken UTs.
Since this changes BaseDevice, we will need to update the JSON schema accordingly...

@a-corni a-corni marked this pull request as ready for review July 17, 2023 13:46
@a-corni
Copy link
Collaborator Author

a-corni commented Jul 17, 2023

Here is the rendering of a DetuningMap built from a RegisterLayout:

layout = RegisterLayout([[0, 0], [1, 0], [0, 1], [1, 1]])
det_map_1 = layout.define_detuning_map({0:0.09, 1:0.8, 2:0.11, 3:0})

image
The rendering is the same for :

layout = RegisterLayout([[0, 0], [1, 0], [0, 1], [1, 1]])
det_map_1 = layout.define_detuning_map({0:0.089, 1:0.8, 2:0.111, 3:0})

If the detuning map represents the one of a SLM Mask (all weights are the same), the representation is the same as before:
image

Here is the representation when two points are too close:

layout = RegisterLayout([[0, 0], [1, 0], [0, 1e-2], [1, 1]])
det_map_1 = layout.define_detuning_map({0:0.8, 1:0.0, 2:0.2, 3:0})

image

pulser-core/pulser/channels/base_channel.py Show resolved Hide resolved
pulser-core/pulser/channels/base_channel.py Outdated Show resolved Hide resolved
pulser-core/pulser/channels/base_channel.py Outdated Show resolved Hide resolved
pulser-core/pulser/devices/_device_datacls.py Outdated Show resolved Hide resolved
pulser-core/pulser/devices/_device_datacls.py Outdated Show resolved Hide resolved
tests/test_abstract_repr.py Outdated Show resolved Hide resolved
tests/test_dmm.py Outdated Show resolved Hide resolved
tests/test_dmm.py Outdated Show resolved Hide resolved
tests/test_dmm.py Outdated Show resolved Hide resolved
@HGSilveri
Copy link
Collaborator

I realized that we don't need the DMMs to be added to the pre-defined devices yet and it actually causes issues, so I just removed it from IroiseMVP and added some TODOs instead.

pulser-core/pulser/channels/base_channel.py Outdated Show resolved Hide resolved
pulser-core/pulser/channels/base_channel.py Outdated Show resolved Hide resolved
pulser-core/pulser/channels/base_channel.py Outdated Show resolved Hide resolved
pulser-core/pulser/devices/_device_datacls.py Show resolved Hide resolved
pulser-core/pulser/channels/base_channel.py Outdated Show resolved Hide resolved
tests/test_abstract_repr.py Outdated Show resolved Hide resolved
Copy link
Collaborator Author

@a-corni a-corni left a comment

Choose a reason for hiding this comment

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

Perfeito !

pulser-core/pulser/channels/base_channel.py Outdated Show resolved Hide resolved
@a-corni a-corni merged commit d5ac020 into develop Jul 24, 2023
@HGSilveri HGSilveri deleted the add_dmm branch September 15, 2023 09:31
@HGSilveri HGSilveri mentioned this pull request Sep 27, 2023
HGSilveri added a commit that referenced this pull request Sep 27, 2023
Main changes:

e0943d9 Override `optimal_detuning_off` on stored calls (#588)
3e40319 Deprecate legacy serializer + Improve error messages (#585)
9e05982 Adding register_is_from_calibrated_layout and is_calibrated_layout to Device (#586)
c08dfa8 Adding dmm config and modulation to sequence (#564)
5270944 Clarify the Conventions in Pulser (#573)
2315989 Give access to all EOM block parameters and allow for phase drift correction (#566)
d5ac020 Adding  DetuningMap, DMM (#539)
f56a19f Remove expired deprecations in pulser-pasqal
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.

2 participants