Reorganize trotter and apply_gate code#338
Reorganize trotter and apply_gate code#338Yue-Zhengyuan merged 3 commits intoQuantumKitHub:masterfrom
Conversation
Codecov Report❌ Patch coverage is
🚀 New features to boost your workflow:
|
| @@ -0,0 +1,395 @@ | |||
| #= | |||
There was a problem hiding this comment.
What on earth is happening with this docstring, haha, why is it commented out?
There was a problem hiding this comment.
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. 😅
|
Looks great! Left some small nits to improve things while they are being touched |
lkdvos
left a comment
There was a problem hiding this comment.
Left some small comments but otherwise definitely looks good to me!
| """ | ||
| function _qr_bond(A::PT, B::PT; gate_ax::Int = 1) where {PT <: Union{PEPSTensor, PEPOTensor}} | ||
| @assert 1 <= gate_ax <= numout(A) | ||
| permA, permB, permX, permY = if A isa PEPSTensor |
There was a problem hiding this comment.
I am not a huge fan of this style of defining all of the permutations for all of the different cases beforehand, I find it is a bit hard to read and check because I need to tie back which permutation is going where and for which case, so I would have actually preferred to just write out the different cases and duplicate some of the code there.
(I know this is how it was before, also fine with leaving it like it is now)
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.jlinto 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.