Skip to content

Conversation

@QuiXamii
Copy link

@QuiXamii QuiXamii commented Nov 5, 2025

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.

image image

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.
@refraction-ray
Copy link
Member

In general looks good, but some changes are required as comments

@codecov
Copy link

codecov bot commented Nov 6, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

* 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
Copy link
Member

@refraction-ray refraction-ray left a 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?

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:
Copy link
Member

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?

Copy link
Author

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

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.

2 participants