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

Spin lattice demo with Aquila #808

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
Open

Spin lattice demo with Aquila #808

wants to merge 13 commits into from

Conversation

lillian542
Copy link
Contributor

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 then
    run 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:

@lillian542 lillian542 marked this pull request as ready for review May 29, 2023 19:52
@lillian542 lillian542 requested a review from Qottmann May 29, 2023 19:52

coordinates = [(i * 6, 0) for i in range(9)]

H_interaction = qml.pulse.rydberg_interaction(coordinates, wires=rydberg_simulator.wires, **settings)
Copy link
Collaborator

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

Copy link
Collaborator

@Qottmann Qottmann left a 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 🙂

demonstrations/rydberg_simulation_spin_lattice.py Outdated Show resolved Hide resolved
demonstrations/rydberg_simulation_spin_lattice.py Outdated Show resolved Hide resolved
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
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
.. 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`,
Copy link
Collaborator

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 🙂 !)

demonstrations/rydberg_simulation_spin_lattice.py Outdated Show resolved Hide resolved
this analogy, this corresponds to applying an external magnetic moment that encourages the spins
to align

Adiabatic phase change etc.
Copy link
Collaborator

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 :)

Comment on lines +287 to +289
# 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
Copy link
Collaborator

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

Comment on lines +309 to +314
# 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:
Copy link
Collaborator

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
Copy link
Collaborator

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
Copy link
Collaborator

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')
Copy link
Collaborator

Choose a reason for hiding this comment

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

amp_fn

@github-actions
Copy link

github-actions bot commented Jun 22, 2023

Thank you for opening this pull request.

You can find the built site at this link.

Deployment Info:

  • Pull Request ID: 808
  • Deployment SHA: 6fe363a696d6926c70754e4192415ce775c394d8
    (The Deployment SHA refers to the latest commit hash the docs were built from)

Note: It may take several minutes for updates to this pull request to be reflected on the deployed site.

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.

None yet

2 participants