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

Handle parametrized sequence, switching device and DMM, and serialize config_det_map as an operation #576

Merged
merged 10 commits into from
Sep 15, 2023

Conversation

a-corni
Copy link
Collaborator

@a-corni a-corni commented Sep 1, 2023

The last three commits take into account last review from #568:

  • Adds slug description
  • The dmm ids are switched when using 'switch_device' (useful when going from a virtual device to a real one). This is also performed for the dmm id used in config_slm_mask.
  • Parametrized sequences are now taken into account. The SLM Mask and config detuning map are seen as operations. They are stored to be performed at build. This has an impact on the way declared channels work since we now go into the to_build_calls to find the declared dmms.
  • Config_det_map is now stored as an operation in the schema, this makes deserialization easier.
  • Tests for compatibility between mappable register and detuning maps

@a-corni a-corni changed the base branch from develop to add_dmm_sequence September 1, 2023 09:45
@HGSilveri
Copy link
Collaborator

Great! We can close the other PR now

@a-corni a-corni marked this pull request as ready for review September 1, 2023 09:51
@a-corni a-corni requested a review from HGSilveri September 1, 2023 09:51
pulser-core/pulser/sequence/sequence.py Outdated Show resolved Hide resolved
pulser-core/pulser/sequence/sequence.py Outdated Show resolved Hide resolved
pulser-core/pulser/sequence/sequence.py Outdated Show resolved Hide resolved
pulser-core/pulser/sequence/sequence.py Outdated Show resolved Hide resolved
pulser-core/pulser/sequence/sequence.py Outdated Show resolved Hide resolved
pulser-core/pulser/sequence/sequence.py Show resolved Hide resolved
pulser-core/pulser/sequence/sequence.py Outdated Show resolved Hide resolved
pulser-core/pulser/sequence/sequence.py Outdated Show resolved Hide resolved
tests/test_sequence.py Outdated Show resolved Hide resolved
tests/test_sequence.py Outdated Show resolved Hide resolved
@a-corni
Copy link
Collaborator Author

a-corni commented Sep 6, 2023

About the if: They are needed, it is actually an issue that was not reported before (and it is independent of the dmm, I can solve it in another PR if your want). The issue is basically that the wrong error message is displayed, see below with a raman channel declared twice, what is actually failing is the matching of raman_1, not raman.
image

@a-corni
Copy link
Collaborator Author

a-corni commented Sep 15, 2023

@HGSilveri I think we are done with this PR, it does everything we wanted and beyond.

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.

Very nice!

assert len(records) == len(global_channels)
assert [
str(records[i].message) for i in range(len(global_channels))
] == warn_message_rydberg
Copy link
Collaborator

Choose a reason for hiding this comment

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

Very thorough 👍

@a-corni a-corni merged commit 47101d4 into add_dmm_sequence Sep 15, 2023
a-corni added a commit that referenced this pull request Sep 22, 2023
* Adding dmm config and modulation to sequence

* Reverting changes for _SLMMask

* Setting max_amp of dmm to zero

* Fixing detection of virtual channels in Device

* Reverting changes in serialization

* Reverting SLM, modifying available_channels

* deleting dmm of schedule if slm of xy, Fixing type

* Add insert_slm_mask

* fixing available_channels with slm

* Special handling of samples from a DMM channel (#565)

* Add `DetuningMap.get_qubit_weight_map()`

* Define `_DMMSchedule.get_samples()`

* Extract DMMSamples from a Sequence

* Creating the `Traps` class

* Eliminating the effects of the SLM mask

* Use COORD_PRECISION in comparison

* `Traps.coords` -> `Traps.sorted_coords`

* Subclass `Traps` in `WeightMap`

* Preserve effects of SLM mask in XY mode

* Explicitly ask for labels in DetuningMap.draw()

* Including slug in WeightMap

* UTs for DetuningMap

* Isort

* Specialize pulse validation in DMM

* Revamp test_dmm UTs

* Formatting

* Add support for legacy serializer

* add in_ising

* Add SLM pulse, ising, modif validate_channel

* Add waiting_for_first_pulse, fixing mask time

* Covering all code, modif after review

* Add descr sequence, _config_detuning_map

* Finishing UTs, fixing typos

* Abstract representation support for new DMM features (#568)

* Support for DMM channel serialization

* WIP: Prepare for incoming updates to JSON schema

* Add descr sequence, _config_detuning_map

* Finishing UTs, fixing typos

* de-/serializing det maps, adding schema, slug

* Dev tests

* Fixing doc

---------

Co-authored-by: a_corni <[email protected]>

* Testing detuning of unmasked qubits, del print

* Enabling use of add with slm

* Replacing Modulate_det_map by add_dmm_detuning

* Updating schema

* finalizing replacing of modulate_detp_map

* finalizing replacing of modulate_det_map

* Rephrasing doc, add OpAddDmmDet

* Handle parametrized sequence, switching device and DMM, and serialize config_det_map as an operation (#576)

* Add slug description

* Handle DMM & parametrized/switch_device/MapReg

* Modifying schema, fixing type

* Moving to a store decoration

* Storing config_det_map

* Taking into account review comments

* Delete seq_tools

* Testing MappableRegister, strict conversion

* Replace modulate_det_map by add_dmm_detuning

* Adding DMM notebook and Modifying SLM Mask (#569)

* adding dmm, draw to DetuningMap

* Testing avoiding circular import

* Refactoring to avoid circular imports

* Fix broken UTs

* Import sorting

* Fixing plot DetuningMap

* Serialization/Deserialization of DMM in device

* Fixing typos

* Testing DMM and DetuningMap

* Fixing typo

* adding xfails, fixing type

* Remove DMM from devices and finish UTs

* Take into account review comments

* Add annotations

* Error in Global and Local

* Defining _DMMSchedule

* Fixing nits

* Fixing typo

* Creating DMM notebook, modif SLM notebook

* Taking into account review comments

* Fixing type

* Fix labels in reg_drawer, draw det_maps in seq

* Fixing doc build, add draw_detuning_maps to docs

* Separating register/det_maps drawing from channels

* introducing get_qubit_data

* Add drawing of quantities per qubit

* Fixing for local pulses

* Adding bounds to label

* Drawing legend for local targetting

* FIX sampling rate, QutipEmulator

* Updating figures

* Updating SLM Mask & local addressability notebook

* Adding explanation text

* Fixing type

* Replace modulate_det_map by add_dmm_detuning

* Replace modulate_det_map for add_dmm_detuning

* Fixing tests

* Revert changes to Bayesian optimization notebook

* Fixing docs

* clearing outputs

* Deleting scaling in favor extending to draw reg

* Placing legend in lower part of drawing

* Updating figures

* Relaunching bayesian optimisation

* Taking into account review comments

* Printing sequence with DMM

* Adding subscript and indent

* Defining __str__ for DMM

---------

Co-authored-by: HGSilveri <[email protected]>

---------

Co-authored-by: Henrique Silvério <[email protected]>
@HGSilveri HGSilveri deleted the dmm_param_abstr_repr branch December 29, 2023 11:33
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