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 DMM notebook and Modifying SLM Mask #569

Merged
merged 64 commits into from
Sep 20, 2023
Merged

Conversation

a-corni
Copy link
Collaborator

@a-corni a-corni commented Aug 11, 2023

  • Fixes on DMM:
    • Display the DetuningMaps as traps (like a RegisterLayout, because it is not enforced to have an atom at the coordinates at which there is a weight). Label 'traps' is added to plot (label "atoms" added for general registers)
    • labels could only take integers, now it can handle QubitId.
  • Addition to Sequence:
    • Add possibility to draw detuning maps (2D or 3D). Can be drawn with/without register.
    • Add possibility to draw local amplitude and detuning per group of qubits, that are represented on the register.
  • Tutorials:
    • Creates a tutorial explaining how to create a DetuningMap, a DMM channel, and how to modulate a detuning map in a Schedule.
    • Modifies the tutorial on state preparation with the SLM Mask to show difference between XY and Ising mode.
    • Updates "Bayesan Optimisation for AFM state preparation" and "Building 1D Rydberg Crystals" to take into account changes on Register (and make fix since "Simulation" is deprecated in favour of QutipEmulator)

@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@a-corni a-corni changed the base branch from develop to add_dmm_sequence August 11, 2023 17:26
@a-corni
Copy link
Collaborator Author

a-corni commented Sep 18, 2023

Everything looks good from an aesthetic point of view, I let you have a look. However, there seems to be an error in the simulation. I start looking into it.

@a-corni a-corni self-assigned this Sep 19, 2023
@a-corni
Copy link
Collaborator Author

a-corni commented Sep 19, 2023

There was no issue with the code in the end, just the optimization had to be relaunched. It's now ready for review @HGSilveri

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.

Looks like it's almost there :)

One question: how is print(seq) looking with DMMs?

pulser-core/pulser/register/_reg_drawer.py Outdated Show resolved Hide resolved
pulser-core/pulser/register/_reg_drawer.py Show resolved Hide resolved
pulser-core/pulser/register/_reg_drawer.py Outdated Show resolved Hide resolved
pulser-core/pulser/register/_reg_drawer.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/_seq_drawer.py Show resolved Hide resolved
@a-corni
Copy link
Collaborator Author

a-corni commented Sep 20, 2023

Looks like it's almost there :)

One question: how is print(seq) looking with DMMs?

Aah I was thinking of tackling it in a new issue afterwards, but I guess it's good to see it now ;)

@HGSilveri
Copy link
Collaborator

Aah I was thinking of tackling it in a new issue afterwards, but I guess it's good to see it now ;)

As you wish, as long as we don't forget about it it's okay

@a-corni
Copy link
Collaborator Author

a-corni commented Sep 20, 2023

Aah I was thinking of tackling it in a new issue afterwards, but I guess it's good to see it now ;)

As you wish, as long as we don't forget about it it's okay

Here is how it is shown:
image

@HGSilveri
Copy link
Collaborator

Here is how it is shown: image

Ok, not so bad. What about when the detuning is not constant? I think it won't show as a detuned delay in that case

@a-corni
Copy link
Collaborator Author

a-corni commented Sep 20, 2023

Here is how it is shown: image

Ok, not so bad. What about when the detuning is not constant? I think it won't show as a detuned delay in that case

As from 100->300 for dmm_0, it shows as a Pulse with 0 amplitude and Ramp from -10 to 0

@HGSilveri
Copy link
Collaborator

HGSilveri commented Sep 20, 2023

As from 100->300 for dmm_0, it shows as a Pulse with 0 amplitude and Ramp from -10 to 0

Of course, don't know how I missed that, sorry...
Ok, I think we can modify it a bit to always show something like:
t: {start} -> {end} | Detuning: {detuning_waveform} | Targets: ...
What do you think?

@a-corni
Copy link
Collaborator Author

a-corni commented Sep 20, 2023

As from 100->300 for dmm_0, it shows as a Pulse with 0 amplitude and Ramp from -10 to 0

Of course, don't know how I missed that, sorry... Ok, I think we can modify it a bit to always show something like: t: {start} -> {end} | Detuning: {detuning_waveform} | Targets: ... What do you think?

Sounds cool !

@a-corni
Copy link
Collaborator Author

a-corni commented Sep 20, 2023

As from 100->300 for dmm_0, it shows as a Pulse with 0 amplitude and Ramp from -10 to 0

Of course, don't know how I missed that, sorry... Ok, I think we can modify it a bit to always show something like: t: {start} -> {end} | Detuning: {detuning_waveform} | Targets: ... What do you think?

Here is where I am at. I am wondering if I should not delete Detuned Delays for DMM channels (Have t: 100->300 | Detuning: -10 rad/µs | Targets: q0, q1, q2, q3)

image

@HGSilveri
Copy link
Collaborator

As from 100->300 for dmm_0, it shows as a Pulse with 0 amplitude and Ramp from -10 to 0

Of course, don't know how I missed that, sorry... Ok, I think we can modify it a bit to always show something like: t: {start} -> {end} | Detuning: {detuning_waveform} | Targets: ... What do you think?

Here is where I am at. I am wondering if I should not delete Detuned Delays for DMM channels (Have t: 100->300 | Detuning: -10 rad/µs | Targets: q0, q1, q2, q3)

image

I was going to suggest that, I think that would be better indeed

@a-corni
Copy link
Collaborator Author

a-corni commented Sep 20, 2023

image
I think that's good ?

@HGSilveri
Copy link
Collaborator

I think that's good ?

Yes, looks great :)

@a-corni
Copy link
Collaborator Author

a-corni commented Sep 20, 2023

All comments should be fixed now :)

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.

Great job!

@a-corni a-corni merged commit 082aa81 into add_dmm_sequence Sep 20, 2023
6 checks passed
@a-corni a-corni deleted the add_dmm_tuto branch September 20, 2023 16:03
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]>
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