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

Create getting started notebook #776

Merged
merged 38 commits into from
Jan 15, 2025
Merged

Create getting started notebook #776

merged 38 commits into from
Jan 15, 2025

Conversation

a-corni
Copy link
Collaborator

@a-corni a-corni commented Dec 9, 2024

A getting started notebook is created:

  • Only tackles AnalogDevice operations.
  • Introduces and redirects to the various components of the documentation.
  • Introduces the further notebooks.

Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@HGSilveri
Copy link
Collaborator

There seem to be some formatting issues, the ReviewNB rendering looked weird and the RTD build failed with some warnings

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.

A first review of the tutorial

@a-corni
Copy link
Collaborator Author

a-corni commented Jan 6, 2025

@ferulli1pasqal

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.

This is looking quite nice! Now it would be good to fix the RTD build so we can check what it will look like in the docs

@HGSilveri HGSilveri changed the base branch from develop to docs-v2 January 8, 2025 15:52
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, let's go 🚀

Comment on lines 282 to 306
"To reach the desired antiferromagentic state, we can take advantage of the [adiabatic theorem](https://en.wikipedia.org/wiki/Adiabatic_theorem). The idea is to use a time-dependent Hamiltonian that changes slowly so that the system stays in its ground state. Therefore, we must choose a final Hamiltonian that has the antiferromagnetic state as its ground state.\n",
"\n",
"This final Hamiltonian should simultaneously favor having the largest number of atoms in the $\\left|r\\right>$ state (by having $\\delta > 0$) and discourage nearest neighbors from being both in $\\left|r\\right>$ (via the [interaction Hamiltonian](../programming.md#ising-hamiltonian)). When these contributions are appropriately balanced, we get an Hamiltonian with $\\left|rgrgrgrgr\\right>$ as its ground state.\n",
"\n",
"Let's follow the protocol from [this paper](https://journals.aps.org/prx/abstract/10.1103/PhysRevX.8.021070), where we define the parameters with respect to the interaction strength between nearest neighbours, $U$ (see Table 1 of the paper):\n",
"\n",
"$$\n",
"U = 2\\pi\\ rad/\\mu s\\\\\n",
"\\Omega_{max} = 2 U\\\\\n",
"\\delta_0 = -6 U\\\\\n",
"\\delta_f = 2U\\\\\n",
"t_{rise} = 252\\ ns,\\ t_{fall} = 500\\ ns\\\\\n",
"t_{sweep} = \\frac{\\delta_f - \\delta_0 [rad\\cdot\\mu s^{-1}]}{2 \\pi \\cdot 10\\ [rad\\cdot\\mu s^{-2}]}\n",
"$$\n",
"\n",
"and define $\\Omega(t)$ and $\\delta(t)$ over time as (see Figure 1 (b)): \n",
"<center>\n",
"<img src=\"../files/AF_Ising_program.png\" alt=\"AF Pulse Sequence\" width=\"300\">\n",
"</center>\n",
"\n",
"The [Hamiltonian](../programming.md#hamiltonian-evolves-state) we are implementing is (the phase is constant and equal to $0$ over time):\n",
"\n",
"$$H = \\hbar \\sum_i \\left (\\frac{\\Omega(t)}{2} \\left(|g\\rangle\\langle r| + |r\\rangle\\langle g|\\right) - \\delta(t) |r\\rangle\\langle r| + \\sum_{j<i}U_{ij}\\hat{n}_i \\hat{n}_j \\right)$$\n",
"\n",
"where $U_{ij} = \\frac{C_6}{\\hbar R_{ij}^6}$."
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@ferrulli1pasqal you don't think that's enough then ? My problem is that it's not explained much in the article itself why they took these pulses, except "we wanted to do adiabatic state preparation, finish in an hamiltonian having as a ground state an antiferromagnetic state, pure adiabatic pulses were not implementable because the duration would have been too long, so we adapted the receipe, it still works there your go". That's why we decided to just redirect to the article saying "We do this because these guys developed the receipe and it worked".
image
If let you comment with your suggestion, or I ask for Louis-Paul to provide a brief explanation

Copy link
Collaborator

Choose a reason for hiding this comment

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

What I had in mind was a more practical/simple explanation. Something along the line: first third (constant) is to make entanglement, second third is to drive the adiabatic transformation and third (constant) is for .
Please consider this comment just in its qualitative shape :) Do you see my point?
(I'm trying to reply fast to not block you but I am in the process of writing two more document, so I might be quite clumsy in what I say here)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The issue is that I don't have the background to explain it. This can also be programmed with one smooth pulse https://pulser--776.org.readthedocs.build/en/776/tutorials/optimization.html

Copy link
Collaborator

Choose a reason for hiding this comment

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

I understand. Maybe asking the application team can be the best way. Do you want me to ask in the channel or you do it yourself (latter option would be way easier for me tbh <3 )

Copy link
Collaborator

Choose a reason for hiding this comment

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

In the meantime, if there are not other changes to be done we can close and merge and then modify later once someone will bless us with some insight :)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@Louis-PaulHenry I could need your input here. TL,DR: We are writing a notebook aiming at presenting very simply two examples of quantum programs that can be written with Pulser to run on a QPU. First one is a simple excitation of an atom from its ground to the Rydberg state. Second is the preparation of an anti-ferromagnetic state using the protocol that was presented in your paper: https://journals.aps.org/prx/abstract/10.1103/PhysRevX.8.021070, as an example of "Adiabatic Quantum Programming".

We have so far not provided much information about the shape of the pulses in the protocol, because we don't know how to provide a simple explanation. We have only redirected people to the paper. Would you be able to explain in simple terms the role of each pulse in the protocol (if I try to summarize @ferrulli1pasqal 's question) or at least the shape of the pulse. Remember: this is going to be one of the first document a Pulser user will see, so we don't want to scare them 😅

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We are merging for our needs, but we can discuss it here anyway

@a-corni a-corni merged commit bc4ac65 into docs-v2 Jan 15, 2025
9 checks passed
@a-corni a-corni deleted the ac/rebuild_doc branch January 15, 2025 11:44
HGSilveri added a commit that referenced this pull request Jan 15, 2025
HGSilveri added a commit that referenced this pull request Jan 27, 2025
…old tutorials (#790)

* Deleting tutorials

* Adding the Register user manual

* Adding links

* Undo deleting the tutorials for the repo

* Retire tutorials instead

* Do the same for the tutorials deleted in #776

* Address review comments

* Fix notebook reference

* Clear all outputs

* Adressing review comments

* Address review comments

* Add section in conventions on indexed operator notation

* Small fixes

* Improve formula rendering
HGSilveri added a commit that referenced this pull request Feb 14, 2025
* Setting up Markdown support

* Convert Conventions page to markdown

* Attempt to use auto-generated labels

* Introduce section about hardware

* Redirect api core

* Add pulse section

* Direct to API core instead of pulse

* Add some elements about pulser.devices

* Create getting started notebook (#776)

* Create initial notebook

* Add temporary links

* Add programming section

* Fix installation of mermaid

* Fix figure caption

* Taking into account review comments

* Fix doc

* Try mermaid with mkdown

* Address review comments

* Fix doc

* Add picture

* Addressing review comments

* Add figure, vector on the bloch sphere, complement to the Device

* Make introduction

* Add programming.md in ref

* Add label

* delete ref

* Fix programming

* Create tutorial Excitation to rydberg state

* Address review comments

* Add AFM state prep

* Fix programming.md

* Address review

* Delete docs, add hbar

* Fix picture

* Fixing programming

* Transfer cell as raw

* Fix sequence

* 4-hand fixing

* Final fixes

* Add paragraph along br

* Address review comment

* Fix referencing

* Fix the notebook

* Add note about neighbouring atoms

* Creating notebook for hardware section, reorganising specs display in Device, adding the presence of EOM in Channel display

* Fix typing

* Fix build

* fix typing

* Fix flake8

* Fix reference

* Fix ref

* Fix figure

* Re-reading myself

* Fix rendering

* Fix rendering

* Fix build

* Available devices

* Address review comments

* Add page on Register creation and Rydberg-Atom interactions + Retire old tutorials (#790)

* Deleting tutorials

* Adding the Register user manual

* Adding links

* Undo deleting the tutorials for the repo

* Retire tutorials instead

* Do the same for the tutorials deleted in #776

* Address review comments

* Fix notebook reference

* Clear all outputs

* Adressing review comments

* Address review comments

* Add section in conventions on indexed operator notation

* Small fixes

* Improve formula rendering

* Shuffle the description of the arguments

* Trying new raw cells

* Add remove-input tag to last cell

* Fix typing

* Add no-index

* Delete no-members

* Dlete no-index

* Reintroduce :noindex:

* Improve description of device

* Try fixing link to

* Fix device and channel description, try hidding the input

* Try fixing build

* Fix tags to hide_input

* Change device descr to "Args", stop trying to mask input

* Add link to backend

* Move Attributes to Args in Device

* Add mention to API doc

* Apply some Pasqal branding to the HTML documentation

* Use Pulser logo :)

* Remove obsolete file

* Add seealso sections in programming

* Deleting the-channels

* Tag The-Channels

* referencing to html instead

* Going for hardware.ipynb

* Add page on Pulses and Waveforms (#793)

* Add tutorial on Pulses and Waveforms

* Address review comments

* Reference fundamentals pages in Programming

* Remove signatures from autosummary

* API Reference Rework (#722)

* Improving autodoc typehints generation

* Improving the Register API doc

* WIP: New API reference for pulser-core

* Try to pass RTD build

* Adding `pulser-simulation` module to the API ref

* Adding pulser_pasqal ref

* Import sorting

* Fix UTs

* Fix links in new pages

* Adding the Sequence page (#802)

* WIP

* Getting links to work at top-level pulser API

* Writing Sequence page

* Address review comments

* Fix typo

* Merge remote-tracking branch 'origin' into docs-v2

* Modifications to the TOC tree (#806)

* Reorder pages in Extended Usage

* Retire tutorial on AFM state preparation

* Slight modifications to the Backend page

* Move and update the XY Hamiltonian page

* Fix broken links

* Fix typo

Co-authored-by: Antoine Cornillot <[email protected]>

---------

Co-authored-by: Antoine Cornillot <[email protected]>

* Create introduction to Extended Usage (#800)

* Add tanh function to ParamObj (#798)

* added tanh function to paramobj

* Update tests/test_parametrized.py

Co-authored-by: Henrique Silvério <[email protected]>

* fixed test

---------

Co-authored-by: Henrique Silvério <[email protected]>

* Create extended usage doc

* Fix doc

* Post-rereading correction

* Allow switch_device to work when Channel uses BaseEOM (#804)

* Allow switch_device to work when Channel uses BaseEOM

* Bump to v1.2.2

* Bump to v1.3dev2

* Addressing the confusion btw Weighted Analog and XY

* Add more specific links, descr of digital qc

* Address review comments

* Testing with :

* Try with #-

* Fix reference

* Fix links to sections

* Fix hamiltonian

* Fix apidoc ref

---------

Co-authored-by: Vytautas Abramavicius <[email protected]>
Co-authored-by: Henrique Silvério <[email protected]>
Co-authored-by: HGSilveri <[email protected]>

---------

Co-authored-by: a_corni <[email protected]>
Co-authored-by: Antoine Cornillot <[email protected]>
Co-authored-by: Benjamin Becquet <[email protected]>
Co-authored-by: Benjamin Becquet <[email protected]>
Co-authored-by: Vytautas Abramavicius <[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.

3 participants