Skip to content

Introduce wrapper structs for Trotter NN gates and MPOs#339

Draft
Yue-Zhengyuan wants to merge 10 commits intoQuantumKitHub:masterfrom
Yue-Zhengyuan:trotter-struct
Draft

Introduce wrapper structs for Trotter NN gates and MPOs#339
Yue-Zhengyuan wants to merge 10 commits intoQuantumKitHub:masterfrom
Yue-Zhengyuan:trotter-struct

Conversation

@Yue-Zhengyuan
Copy link
Member

This PR introduces two wrapper structs, TrotterNNGates and TrotterMPOs2ndNeighbor <: TrotterMPOs to store the Trotter evolution gates (so they are no longer stored as a LocalOperator) and the MPOs (so they are not just a plain array). They are designed to work with su_iter internally, and not intended to be accessed by users.

I also make some improvements on how the gates and NNN MPOs are constructed from the Hamiltonian, so Hamiltonians with 1-site terms can also be used for simple update (previously I restricted them to only contain 2-site terms).

Suggestions on the design of TrotterMPOs are welcome, as there are potentials to generalize time evolution to deal with 3-site terms, 3rd neighbor terms, or even more. But I prefer to write specific code for each case, as I don't think it's worthwhile to write a universal way to handle arbitrary Hamiltonians with Trotter decomposition.

@codecov
Copy link

codecov bot commented Mar 4, 2026

Codecov Report

❌ Patch coverage is 98.96907% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/algorithms/time_evolution/apply_gate.jl 91.66% 1 Missing ⚠️
Files with missing lines Coverage Δ
src/algorithms/time_evolution/gaugefix_su.jl 84.21% <100.00%> (-6.12%) ⬇️
src/algorithms/time_evolution/simpleupdate.jl 97.60% <100.00%> (-0.11%) ⬇️
src/algorithms/time_evolution/simpleupdate3site.jl 100.00% <ø> (ø)
src/algorithms/time_evolution/time_evolve.jl 94.54% <100.00%> (+2.44%) ⬆️
src/algorithms/time_evolution/trotter_gate.jl 100.00% <100.00%> (+3.57%) ⬆️
src/algorithms/time_evolution/trotter_mpo.jl 100.00% <100.00%> (ø)
src/algorithms/time_evolution/apply_gate.jl 95.91% <91.66%> (-4.09%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Yue-Zhengyuan Yue-Zhengyuan marked this pull request as draft March 4, 2026 08:12
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.

1 participant