Skip to content

Reorganize trotter and apply_gate code#338

Open
Yue-Zhengyuan wants to merge 2 commits intoQuantumKitHub:masterfrom
Yue-Zhengyuan:timeevol-refactor
Open

Reorganize trotter and apply_gate code#338
Yue-Zhengyuan wants to merge 2 commits intoQuantumKitHub:masterfrom
Yue-Zhengyuan:timeevol-refactor

Conversation

@Yue-Zhengyuan
Copy link
Member

This PR reorganizes simple update code in order to get ready for the addition of the feature to decompose next-nearest-neighbor (NNN) gates into nearest-neighbor (NN) gates (briefly described here), without turning evoltools.jl into a big mess. The ultimate goal is to reuse the NN code of Trotter time evolution for NNN Hamiltonians.

As this PR does not change any code logic, it can be safely merged once the tests pass.

@codecov
Copy link

codecov bot commented Feb 27, 2026

Codecov Report

❌ Patch coverage is 98.67257% with 3 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/algorithms/time_evolution/time_evolve.jl 87.50% 2 Missing ⚠️
src/algorithms/time_evolution/trotter_gate.jl 96.42% 1 Missing ⚠️
Files with missing lines Coverage Δ
src/PEPSKit.jl 100.00% <ø> (ø)
src/algorithms/time_evolution/apply_gate.jl 100.00% <100.00%> (ø)
src/algorithms/time_evolution/apply_mpo.jl 100.00% <100.00%> (ø)
src/algorithms/time_evolution/simpleupdate3site.jl 100.00% <ø> (ø)
src/algorithms/time_evolution/trotter_mpo.jl 100.00% <100.00%> (ø)
src/algorithms/time_evolution/trotter_gate.jl 96.42% <96.42%> (ø)
src/algorithms/time_evolution/time_evolve.jl 92.10% <87.50%> (-3.35%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Yue-Zhengyuan Yue-Zhengyuan requested a review from lkdvos February 27, 2026 09:29
@@ -0,0 +1,395 @@
#=
Copy link
Member

Choose a reason for hiding this comment

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

What on earth is happening with this docstring, haha, why is it commented out?

Copy link
Member Author

Choose a reason for hiding this comment

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

I wrote this mostly as a personal pedagogic note on how the (crude) truncation in an MPO is done and didn't intend to make it appear in the docstring. Anyway, it can be used as the docstring of _cluster_truncate!, but I feel it is too long and over-detailed for the purpose. 😅

@kshyatt
Copy link
Member

kshyatt commented Feb 27, 2026

Looks great! Left some small nits to improve things while they are being touched

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