-
Notifications
You must be signed in to change notification settings - Fork 188
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
Spin lattice demo with Aquila #808
base: master
Are you sure you want to change the base?
Conversation
|
||
coordinates = [(i * 6, 0) for i in range(9)] | ||
|
||
H_interaction = qml.pulse.rydberg_interaction(coordinates, wires=rydberg_simulator.wires, **settings) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Traceback (most recent call last):
File "/home/qottmann/Qottmann/Xanadu/qml/demonstrations/rydberg_simulation_spin_lattice.py", line 118, in <module>
H_interaction = qml.pulse.rydberg_interaction(coordinates, wires=rydberg_simulator.wires, **settings)
^^^^^^^^
NameError: name 'settings' is not defined
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really cool stuff @lillian542 !
I think some of the intro is missing because the demo was split in two, would be good to link that but also repeat the essentials like the rydberg Hamiltonian. I didnt go into detail here for the review and focussed on the physics parts for now 🙂
specifically, the transition from ferromagnetic to anti-ferromagnetic order in a 1D Ising chain. An | ||
Ising chain has the Hamiltonian: | ||
|
||
.. math:: - \sum_{ij} J_{ij} \sigma_i \sigma_j - \mu \sum_j h_j \sigma_j |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.. math:: - \sum_{ij} J_{ij} \sigma_i \sigma_j - \mu \sum_j h_j \sigma_j | |
.. math:: H_\text{Ising} = - \sum_{ij} J_{ij} \sigma_i \sigma_j - \mu \sum_j h_j \sigma_j |
Missing x, y, z superscripts, or is this a classical Hamiltonian?
|
||
- use an atom to represent a single spin in the chain, with spin-up and spin-down encoded as the | ||
Rydberg and ground states respectively | ||
- the van der Waals interaction term between the atoms, :math:`\sum_j \sum_k V_{jk} n_j n_k`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should first introduce those terms somewhere 🙃 (and link to your previous demo 🙂 !)
this analogy, this corresponds to applying an external magnetic moment that encourages the spins | ||
to align | ||
|
||
Adiabatic phase change etc. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So the algorithm here is supposed to be something like adiabatic quantum computing, starting in a well controlled ground state of a known Hamiltonian and then adiabatically changing the parameters to slowly drive it to a different phase? Sounds cool! Would be good to explicitly show the original Ising Hamiltonian and rydberg Hamiltonian quenches :)
# We’ll upload and run the full duration (:math:`4 \mu s`) program to the Aquila hardware. As | ||
# discussed above, to run on hardware we will need to slightly modify our amplitude function, to | ||
# ensure it is 0 at the beginning and end of the pulse program, and that we respect the maximum |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would actually be easier to read by not mentioning the point of the amplitude having to be 0 at start and end above but start making that point here
# Let’s define a piecewise constant function that sets the values of an array based on the maximum | ||
# value and maximum rate of change, assuming a 4 microsecond pulse program. This will be sampled and converted | ||
# to a piecewise linear function that approximates it for hardware upload, but in this case a | ||
# piecewise constant function is an easy way to define our pulse. Since we can’t go to maximum | ||
# amplitude faster than 60ns, and we have a bin size of 50ns (so it will match the function sampling | ||
# rate when converting from PennyLane to hardware instructions), let’s increase amplitude over two bins: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could be nice to show how to access the maximum rate of change in amplitude here (and use that value?)
# :target: javascript:void(0); | ||
# | ||
|
||
# hardware set-points after conversion and discretization |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is this here? Is this a relic or intentional? (the part of a constant detuning)
expect to observe blockade. | ||
|
||
""" | ||
import pennylane as qml |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing some imports (numpy, matplotlib)
ax1.plot(input_times, input_detuning) | ||
ax1.set_xlabel('Time [$\mu s$]') | ||
ax1.set_ylabel('MHz') | ||
ax1.set_title('detuning_fn') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
amp_fn
Thank you for opening this pull request. You can find the built site at this link. Deployment Info:
Note: It may take several minutes for updates to this pull request to be reflected on the deployed site. |
Co-authored-by: Korbinian Kottmann <43949391+Qottmann@users.noreply.github.com>
…o spin_lattice_aquila
…o spin_lattice_aquila
Before submitting
Please complete the following checklist when submitting a PR:
Ensure that your tutorial executes correctly, and conforms to the
guidelines specified in the README.
Remember to do a grammar check of the content you include.
All tutorials conform to
PEP8 standards.
To auto format files, simply
pip install black
, and thenrun
black -l 100 path/to/file.py
.When all the above are checked, delete everything above the dashed
line and fill in the pull request template.
Title:
Summary:
Relevant references:
Possible Drawbacks:
Related GitHub Issues: