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

Kibble-Zurek Mechanism with Noise Mitigation #31

Open
wants to merge 178 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
178 commits
Select commit Hold shift + click to select a range
e32b8b2
Add simulated annealing solver (dev code)
JoelPasvolsky Nov 21, 2024
ae4c0e2
Added MockKZSampler along with the changes to mock annealing time
Nov 22, 2024
53854c7
Changed SA Sampler to MockKZSampler
Nov 22, 2024
e22841a
Added a new radio button for coupling plot
Nov 22, 2024
eb64aa5
Added plots for couplig strength
Nov 22, 2024
f1077eb
Added plots for coupling points
Nov 22, 2024
6366ee8
Saved changes to MockKZSampler
Nov 22, 2024
a0723dd
implement unembed bugfix for samplesets
jackraymond Nov 22, 2024
16812cb
Merge branch 'andy' of github.com:AndyZzzZzzZzz/kibble-zurek into andy
Nov 22, 2024
a9d3631
Added global variable for a constant J value
Nov 22, 2024
3b773a1
Change the plot kink density function to use baseline J for backgroun…
Nov 22, 2024
7aaf17c
Correct bug in setting of num_sweeps
jackraymond Nov 22, 2024
668f6b0
Remove redundant kwargs update
jackraymond Nov 22, 2024
beb71a6
Updated readme document for environment variable config
Nov 22, 2024
b232d22
Refactor MockKibbleZurekSampler, add kwargs.copy()
jackraymond Nov 22, 2024
21535c2
Correct substitute_sampler errors
jackraymond Nov 23, 2024
8ba97f2
Remove num_sweeps from substitute_kwargs so that sample() responds to…
jackraymond Nov 23, 2024
31a9937
Incomplete testing scripts for MockKZSampler
Nov 25, 2024
40a30a2
Merge branch 'andy' of github.com:AndyZzzZzzZzz/kibble-zurek into andy
Nov 25, 2024
d01cd39
Changed coupling ranges
Nov 25, 2024
1290970
Update plot label to Noise level lambda
Nov 25, 2024
23d1fd7
Adjust coupling plot background and added kappa calculation
Nov 25, 2024
2adfb46
Update plot label
Nov 25, 2024
79d4101
Added dcc storage for kappa and polynomial regression calculation
Nov 26, 2024
28e97e3
Added plots for linear regression calculations
Nov 26, 2024
5c293a3
Removed redundant plotting functions
Nov 26, 2024
47c0632
Added storage for zne_estimation and kink_density_data along with zne…
Nov 26, 2024
69ce89d
Modified MockKibbleZurekSampler to be sensitive to temperature at |J|…
jackraymond Nov 26, 2024
897c3c5
Changed quench time input box to drop down menue
Nov 26, 2024
b71e54f
Adjust plotting function to work with new quenchtime dropdown menue
Nov 26, 2024
4d4165a
Attempted to default qpu dropdown to mock_dwave_sampler, encountered …
Nov 26, 2024
d010e09
Merge branch 'andy' of github.com:AndyZzzZzzZzz/kibble-zurek into andy
Nov 26, 2024
6014611
Removed previous zero noise point when generating new ones
Nov 26, 2024
f8812bc
Fixed the bug of changing anneal duration produce same plot
Nov 26, 2024
738c00b
Retrieve previously stored coupling strength data point along with ZN…
Nov 26, 2024
0771a66
Added consistent loading data between kink_density and coupling stren…
Nov 26, 2024
96e1bdb
Changed dropdown menue to nanoseconds
Nov 27, 2024
78bc36d
Defined global color theme, refactored ploting data code into backgro…
Nov 28, 2024
5a2f29d
Removed unused comment
Nov 28, 2024
59ac362
refactord add zne code
Nov 28, 2024
fe666e7
minor fix to kink density plots
Nov 28, 2024
eea7bc3
dynamically update point color when plotting
Nov 28, 2024
3199bb3
Changed anneal_time from state to input on plotting function for imme…
Nov 28, 2024
30d7b7c
Revert "Changed anneal_time from state to input on plotting function …
Nov 28, 2024
3a2ef86
save changes in tests
Nov 28, 2024
2f78c95
minor fixes to state and input along with parameter adjustments
Nov 28, 2024
6316334
Plots different color for different coupling strength on kink vs anne…
Nov 28, 2024
d726cc5
Add suitable fitting functions for ZNE on QPU and in the Mocking regime
jackraymond Nov 28, 2024
9e6bee6
Improve non-polynomial function of mock fit
jackraymond Nov 28, 2024
d7de5dc
Add 4-parameter function; requires testing/debugging
jackraymond Nov 28, 2024
eccab02
Added lambda function and exported to global scope
Nov 28, 2024
eb6d08d
Changed anneal time in sample bqm to lambda(couping_strength)*anneal …
Nov 28, 2024
8509e9e
removed unused import
Nov 28, 2024
0c5fb97
minor fixes on kappa
Nov 28, 2024
1df819f
Save data point to dictionary for all plots
Nov 28, 2024
6e673b6
Changed the color points on main plot back to black
Nov 28, 2024
f9c0dab
refactored fitting function to qa script
Nov 28, 2024
e4ac451
Fixed the branches for polynomial calculation between client and mock…
Nov 28, 2024
67c9523
Plot stored data in main display's background
Nov 28, 2024
86a8126
Update coupling plot to a linear axis
Nov 28, 2024
5a4983e
Added reset button in layout cards
Nov 28, 2024
5ef5548
Implemented the corresponding call backs for reset button
Nov 29, 2024
c6bd17e
Refactored the color dictionary to plots.py and removed them from plo…
Nov 29, 2024
c29a9d5
Added documentation for ZNE demo
Nov 29, 2024
7339c7c
Added labels in the coupling plot
Nov 29, 2024
a18480a
Correct to imports and t_a scaling
jackraymond Nov 29, 2024
30a1432
Correct quadratic fit: working well with QPU samplers
jackraymond Nov 29, 2024
df36e53
Used black to reformat code
Dec 1, 2024
757d87d
Used black to reformat code
Dec 1, 2024
2187886
Merge branch 'andy' of github.com:AndyZzzZzzZzz/kibble-zurek into andy
Dec 1, 2024
28508e3
Used black to auto format files
Dec 1, 2024
57ea824
Added plot from ZNE paper
Dec 2, 2024
7dc57d7
Change default for coupling strength and quench duration
Dec 2, 2024
1ecd6ba
Added color labels for coupling strength in background plotting func
Dec 3, 2024
636a956
Plot coupling strength label when user run simulation
Dec 3, 2024
6abda7b
Change the name for remaining two plots
Dec 3, 2024
1878b25
removed unused imports
Dec 3, 2024
5bf3748
Removed unnecessary plots and default kink density vs noise level to …
Dec 3, 2024
2119528
Update title and description of the demo
Dec 3, 2024
e5513a8
Updated tooltips
Dec 3, 2024
da2954e
Fixed the issue of MockSampler unable to grab Advantage embeddings. H…
Dec 3, 2024
9292eac
Reformat code and removed previously commented out code
Dec 3, 2024
0678e7c
Removed unused import
Dec 3, 2024
7641a00
Changed the position of legends on both plots
Dec 4, 2024
99a86a8
Added anneal time option for 680ns and 1280ns
Dec 4, 2024
547bed7
Fixed the issure of x-axis label disappearing
Dec 4, 2024
14c656b
Give a more reasonable bound to y-axis value on coupling plot
Dec 4, 2024
2c6adab
Black reformat
Dec 4, 2024
72db74d
Change spins or qpu selection triggers the reset functionality
Dec 4, 2024
fa15ed3
Black reformat
Dec 4, 2024
0437ff5
Refactor the fitted line and ZNE plotting to plots.py
Dec 4, 2024
38f110c
Added function plot_zne_fitted_line. Should display zne point on both…
Dec 4, 2024
12f110b
Add consistent display of previously calculated ane points
Dec 4, 2024
3164312
Black reformat
Dec 4, 2024
23ccbea
Change label on x-axis
Dec 6, 2024
033aa5d
Add explanation for fitting line and -1.8 in description
Dec 6, 2024
3b044dd
Add J to coupling strength widget
Dec 6, 2024
c567e82
Added hyperlink with reference to the paper
Dec 6, 2024
9612ec1
Minor reformat
Dec 6, 2024
69f397f
Modify the fitting_function to return None is fitting fails
Dec 6, 2024
fe35730
Catch the error of fitting failed and do not displya fitting line or …
Dec 6, 2024
63700ad
minor reformat
Dec 6, 2024
4e22922
Add modal to warn user of fitting failure
Dec 6, 2024
255f7c7
Minor fix
Dec 6, 2024
40af557
Add documentation for fitted_function
Dec 6, 2024
e30e501
Updated documentation
Dec 6, 2024
0d488bd
Added navbar to app.py and separated corresponding title and descript…
Dec 10, 2024
cdda359
Removed reset button and separated plot display for both demos
Dec 11, 2024
106b2bd
Changed anneal time and graph display config into functions
Dec 11, 2024
71239c7
Major fix to let both demo share the same id and callbacks
Dec 11, 2024
54b7411
remove plotting zne history in background plots
Dec 13, 2024
8caef9f
Change mock sampler name
Dec 13, 2024
190834f
Improved branching on kink density background plots
Dec 13, 2024
620bdf0
Change demo tab name
Dec 13, 2024
ccf5379
Adjust the styling of coupling strength slider
Dec 13, 2024
fde444d
Added branching in coupling strength slider for demos
Dec 13, 2024
017f448
Call coupling strength function with demo type
Dec 13, 2024
e4f4216
Final adjustment to coupling strength slider
Dec 13, 2024
741b12b
Added persistent storage on kz_data to be displayed on background plot
Dec 13, 2024
1e1f79b
Persistent plotting background data in demo1, only refresh when user …
Dec 13, 2024
fdd4a3c
Added persistent data point plotting in kin_density background plot f…
Dec 13, 2024
9858d8b
Minor fix on kz_data dictionary
Dec 13, 2024
5ba9253
Branch tooltips based on the different demo used, default to Kibble-Z…
Dec 13, 2024
5f610f4
Kibble-Zurek demo change J refresh plots and new theoretical predicti…
Dec 13, 2024
b8f7e7b
correct lambda definition
jackraymond Dec 15, 2024
523095f
Move ta_rescaling to relevant conditional branch
jackraymond Dec 15, 2024
f4c5b9f
Move simulator curve upwards by changing sweep per ta ratio
jackraymond Dec 16, 2024
6f26054
Correct error division versus multiplication error in use of b
jackraymond Dec 16, 2024
ee901ad
Merge pull request #1 from AndyZzzZzzZzz/jack
AndyZzzZzzZzz Dec 16, 2024
d95ce19
Added branching for schedule file inside submit_job. Changed environm…
Dec 16, 2024
44d9e8e
Added config file for mock sampler
Dec 16, 2024
37162b5
Added a warning modal when user submit job with classical sampler for…
Dec 17, 2024
aefabd8
Fixed schedule file branching, only pass in filename
Dec 17, 2024
f1f197c
Fix another division instead of multiplication error
jackraymond Dec 17, 2024
a668318
Update maxmimum anneal time for demo2 plot' y-axis
Dec 18, 2024
c5a88b6
Minor fix
Dec 18, 2024
77a5d02
Quick fix to duplicate zne points
Dec 18, 2024
efc7b29
Minimize delay by adding an extra call to plot background function
Dec 18, 2024
47f38eb
Minor fix for zne and fitting function display on demo2
Dec 18, 2024
03e789a
Changed kappa to lambda globally (use calc kappa only inside kz_calc …
Dec 18, 2024
dba6e51
Minor adjustment to axixes
Dec 18, 2024
9d3d0f5
Added persistent display of fitting curve for zero-noise demo plot2
Dec 18, 2024
19f608f
Added branching inside lambda function for classical sampler
Dec 18, 2024
2a0c2f0
Slight modification to config file
Dec 18, 2024
0cafff0
Applied black format
Dec 18, 2024
113d495
Update yaml
jackraymond Dec 18, 2024
933dffa
Minor fix on theoretical calc parameter
Dec 18, 2024
0e3aef6
Removed unused code
Dec 20, 2024
d637422
Minor bugfix and variable name adjustments
Dec 20, 2024
c511dac
Remove debugging print statement
jackraymond Dec 21, 2024
d972161
Minor code refactor and clean up
k8culver Jan 9, 2025
746ef1c
Fix tests
k8culver Jan 9, 2025
3d7dedb
Replace test_mock_kz_sampler with placeholder tests
k8culver Jan 9, 2025
1ef7189
Fix race condition, clean up Dash structure and UI
k8culver Jan 11, 2025
14cb97f
Fix tests
k8culver Jan 14, 2025
a235b77
Bound and upgrade requirements
k8culver Jan 14, 2025
2b0f4a2
Remove embeddings_found, clean up logic
k8culver Jan 15, 2025
a6e9554
Run black and isort
k8culver Jan 15, 2025
736f50c
Pull main
k8culver Jan 15, 2025
84c75ae
Update date type
k8culver Jan 17, 2025
22a690e
Fix anneal duration tooltip
k8culver Jan 17, 2025
2d82ad1
Merge branch 'feature/noise-mitigation' of github.com:k8culver/kibble…
k8culver Jan 17, 2025
8a88a84
Update README, remove navbar Container
k8culver Jan 17, 2025
7423be0
Fix plot bugs
k8culver Jan 17, 2025
024e290
Fix typos, code clean up
k8culver Jan 17, 2025
b990c25
Add QPU default
k8culver Jan 20, 2025
5c005c9
Update find_one_to_one_embedding to use find_subgraph
k8culver Jan 20, 2025
a3fd6f4
Add fit line for 2 points, start x axis at 0
k8culver Jan 21, 2025
4e75a40
Pull main
k8culver Jan 21, 2025
3b1c836
Refactor graphing functions, separate noise mitigation graphs
k8culver Jan 24, 2025
b02fe22
Update colors and legend order, fix coupling strength legend bug
k8culver Jan 28, 2025
8b61930
Remove classical mock sampler
k8culver Jan 29, 2025
5647e35
Update NM description
k8culver Jan 29, 2025
d18c318
Update titles and README cite
k8culver Feb 5, 2025
6a3a94e
Add SHOW_TOOLTIPS config, update anneal to quench
k8culver Feb 11, 2025
d9c9374
Update copy
k8culver Feb 14, 2025
833b08f
Apply suggestions from code review
k8culver Feb 14, 2025
a8e6d14
Remove TODOs
k8culver Feb 14, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 36 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,41 +98,45 @@ average length increases as a function of the square root of the anneal time.

## <a name="Installation"></a> Installation

You can run this example without installation in cloud-based IDEs that support
the [Development Containers specification](https://containers.dev/supporting)
(aka "devcontainers").
You can run this example without installation in cloud-based IDEs that support the
[Development Containers specification](https://containers.dev/supporting) (aka "devcontainers")
such as GitHub Codespaces.

For development environments that do not support ``devcontainers``, install
requirements:
For development environments that do not support `devcontainers`, install requirements:

pip install -r requirements.txt
```bash
pip install -r requirements.txt
```

If you are cloning the repo to your local system, working in a
[virtual environment](https://docs.python.org/3/library/venv.html) is
recommended.
If you are cloning the repo to your local system, working in a
[virtual environment](https://docs.python.org/3/library/venv.html) is recommended.

## <a name="Usage"></a> Usage

Your development environment should be configured to
[access Leap’s Solvers](https://docs.ocean.dwavesys.com/en/stable/overview/sapi.html).
You can see information about supported IDEs and authorizing access to your
Leap account [here](https://docs.dwavesys.com/docs/latest/doc_leap_dev_env.html).
Your development environment should be configured to access the
[Leap&trade; quantum cloud service](https://docs.ocean.dwavesys.com/en/stable/overview/sapi.html).
You can see information about supported IDEs and authorizing access to your Leap account
[here](https://docs.dwavesys.com/docs/latest/doc_leap_dev_env.html).

To run the demo:
Run the following terminal command to start the Dash application:

```bash
python app.py
```

Access the user interface with your browser at http://127.0.0.1:8050/.

The demo program opens an interface where you can configure
problems, submit these problems to a quantum computer, and compare the results
to the Kibble-Zurek predictions.
The demo program opens an interface where you can configure problems and submit these problems to
a solver.

Configuration options can be found in the [demo_configs.py](demo_configs.py) file.

*Hover over an input field to see a description of the input and its range of*
*supported values.*

<!-- TODO: Add a note about: You can download schedules from
https://docs.dwavesys.com/docs/latest/doc_physical_properties.html -->

## <a name="Model-Overview"></a> Model Overview

Quantum simulation is valuable for demonstrating and understanding the
Expand Down Expand Up @@ -190,6 +194,17 @@ Note that as you increase the anneal time, you move from the coherent regime
and the returned samples are increasingly affected by thermalization, pushing
the kink density away from the predicted value.

## <a name="ZNE"></a> Zero-Noise Extrapolation

Zero-Noise Extrapolation (ZNE) is a quantum error mitigation method used for quantum
annealing, as described in [[3]](#3).

k8culver marked this conversation as resolved.
Show resolved Hide resolved
A fitting function—quadratic for the Advantage solver can be used to calculate the theoretical
zero-noise point for various coupling strengths at the same annealing time.

<img src='assets/ZNE_fig2.png' alt='Experimental results' width='400'/>


Copy link
Collaborator

Choose a reason for hiding this comment

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

Consider adding the explanation currently in the left-panel intro ("Owing to thermal noise, ... to larger quench durations") here and using that space to tell users how to run an experiment in three-ish steps

## <a name="Code"></a> Code

Most the code related to configuring and analyzing the Ising problem is in the
Expand Down Expand Up @@ -258,6 +273,10 @@ Nat. Phys. 18, 1324–1328 (2022). https://doi.org/10.1038/s41567-022-01741-6
Computational supremacy in quantum simulation.
https://arxiv.org/abs/2403.00910

<a name="3">[3]</a> Amin, M.H., King, A.D., Raymond, J. et al.
Quantum error mitigation in quantum annealing.
https://arxiv.org/abs/2311.01306

## License

Released under the Apache License 2.0. See [LICENSE](LICENSE) file.
Loading