-
Notifications
You must be signed in to change notification settings - Fork 12
VQE example for the Toric Code Model #55
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
base: master
Are you sure you want to change the base?
Conversation
This module implements VQE optimization for finding ground states of the generalized 2D toric code Hamiltonian with open boundary conditions and provides comparison among different ansätze: FLDC, GLDC, and FDC.
|
In general looks good, but some changes are required as comments |
Codecov Report✅ All modified and coverable lines are covered by tests. 🚀 New features to boost your workflow:
|
* Standardize import order * Fix errors in code comments * Update docstrings to conform to reStructuredText (reST) style * Replace ansatz block gate sequence with a single SU(4) gate * Consolidate training functions for the three ansatzes * Fix inefficient structure where Hamiltonian (H) was rebuilt every iteration * H is now constructed only once per magnetic field strength
refraction-ray
left a comment
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 general looks good to me, only some minor changes required. BTW, are the results the same after replacing with the SU(4) gates?
examples/vqe_toric.py
Outdated
| The Hamiltonian is: H = - (1 - h) \sum A_v - (1 - h) \sum B_p - h \sum (hx * X_i + hz * Z_i) | ||
| where A_v are vertex operators (X products) and B_p are plaquette operators (Z products). | ||
| Plaquette Operators at Boundaries: |
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 about vertex operators? plaquette operator actually has no boundary terms?
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.
There are no boundary terms for plaquette operators. In this lattice definition, every plaquette, including those at the physical boundary, is surrounded by exactly four edges (top, bottom, left, right).
…tion for building Hamiltionian.
This module implements VQE optimization for finding ground states of the generalized 2D toric code Hamiltonian with open boundary conditions and provides comparison among different ansätze: FLDC, GLDC, and FDC. The new example demonstrates how to build the model, configure ansätze, run optimization, and compare energies and convergence behavior.