-
-
Notifications
You must be signed in to change notification settings - Fork 162
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
Added a tutorial for simulating Ising 1-D chain using mitiq with cirq… #2002
Added a tutorial for simulating Ising 1-D chain using mitiq with cirq… #2002
Conversation
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.
Hello @farzadkianvash, thank you for submitting a PR to Mitiq! We will respond as soon as possible, and if you have any questions in the meantime, you can ask us on the Unitary Fund Discord.
Codecov ReportAll modified lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #2002 +/- ##
=======================================
Coverage 98.30% 98.30%
=======================================
Files 87 87
Lines 4118 4118
=======================================
Hits 4048 4048
Misses 70 70 ☔ View full report in Codecov by Sentry. |
@farzadkianvash You might need to add this file to Something like https://github.com/unitaryfund/mitiq/blob/master/docs/source/examples/examples.md |
@purva-thakre Thank you for the comment, I changed the examples.md file as you suggested. |
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.
Off to a good start, @farzadkianvash! Seems like the major pieces are in place.
My main comment is that the notebook appears not to have run successfully on Read the Docs, and I see errors in the docs build in CI.
I'm happy to help with troubleshooting. I recommend you begin by attempting to build the docs locally and checking the error messages.
docs/source/examples/examples.md
Outdated
@@ -20,6 +20,7 @@ ZNE with Cirq: Solving MaxCut with QAOA <maxcut-demo.md> | |||
ZNE with Cirq: Hamiltonian simulation with Pauli gates<hamiltonians.md> | |||
ZNE with Cirq: Energy of molecular Hydrogen <molecular_hydrogen.md> | |||
ZNE with Cirq: Noise scaling methods <scaling.md> | |||
ZNE with Cirq: 1D Ising Simulation <quantum_simulatio_1D_ising.md> |
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.
ZNE with Cirq: 1D Ising Simulation <quantum_simulatio_1D_ising.md> | |
ZNE with Cirq: 1D Ising Simulation <quantum_simulation_1d_ising.md> |
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.
Thank you for the comment, I just realized that the correct name of the file is <quantum_simulation_1D_ising.md> with the capital "D", while in your suggestion you the name of the file is written as <quantum_simulation_1d_ising.md>.
I don't know if python is case sensitive. In case it is, could you please add another comment suggesting an edit with the correct name, so I don't need to update the pull request from my computer and don't mess up with other changes?
corrected a mistake in the example.md file Co-authored-by: Misty Wahl <82074193+Misty-W@users.noreply.github.com>
removed the part for installing Mitiq Co-authored-by: Misty Wahl <82074193+Misty-W@users.noreply.github.com>
updating some comments. Co-authored-by: Misty Wahl <82074193+Misty-W@users.noreply.github.com>
Could suppress the warnings with a code snippet like:
|
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.
In these lines, and elsewhere, can you please remove the metadata (related to "colab" information) from the code blocks? E.g., :id:
.
The error seems to be just linkchecks, reebuilding just to make sure.
Please add yourself to the AUTHORS
file and tick the License agree here.
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.
More comments.
|
||
|
||
|
||
+++ {"id": "81aa4c72"} |
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.
+++ {"id": "81aa4c72"} |
\end{equation} | ||
which is a product of different unitary operators. Finally, one can express each of these unitary operators as a gate sequence of single-qubit gates or two-qubit gates that are subsequently applied. | ||
|
||
+++ {"id": "Z4U83K3WjCMv"} |
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.
+++ {"id": "Z4U83K3WjCMv"} |
warnings.filterwarnings('ignore') | ||
``` | ||
|
||
+++ {"id": "478f5fc8"} |
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.
+++ {"id": "478f5fc8"} |
To start with coding, we define function "trotter_evolution_H" which is $U(\Delta t)$ | ||
|
||
```{code-cell} | ||
:id: a6d68546 |
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.
:id: a6d68546 |
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.
These are just examples, there are more in the file.
|
||
+++ {"id": "81aa4c72"} | ||
|
||
In this tutorial, we employ ZNE, CDR, and VNCDR mitigation techniques to address errors in the simulation of the 1-D Transverse-Longitudinal Ising model using Mitiq. It is important to note that the results presented here are not original, but rather an attempt to reproduce some of the findings outlined in the paper available at https://arxiv.org/pdf/2103.12680.pdf. |
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 you please add this reference to the refs.bib
file (e.g., saving it as Sopena_2023_Quantum
) and reference to it using:
{cite}`Sopena_2023_Quantum`
# Generate the fitted curve | ||
x_fit = np.linspace(0, n_dt*Jdt, 300) | ||
y_fit = sigma_z_t(x_fit, *popt) |
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.
It would be great to have the ideal value plotted, with a line showing it. It could be done running the simulation on an ideal simulator.
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.
do you mean to do exact trotterized results? since I do not know how to simulate that Hamiltonian other than trattorization. I used two different names "exact" and "trotterized", I should use the same name for them, something like "exact trotterization".
let me know if this is what you are suggesting.
…onflict in the refs.bib file
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.
Thanks @farzadkianvash, looks good to me!
Thanks @farzadkianvash! I think you forgot to add the thumbnail in the example gallery. Thanks for addressing all the rest. |
tests passed! |
This pull request Added a tutorial for simulating Ising 1-D chain using mitiq with cirq interface base on https://arxiv.org/pdf/2103.12680.pdf
This pull request solves Issue #1799
Description
License
Before opening the PR, please ensure you have completed the following where appropriate.