Conversation
|
I suppose this is exact contraction with CTMRG/BPEnv ? |
Codecov Report❌ Patch coverage is
🚀 New features to boost your workflow:
|
Yes, precisely that. The idea was to add support for alternative operator forms for situations that are very badly suited to our current dense-tensor-operator approach, while still being compatible with AD to use them in variational optimizations. In particular, the motivating cases are multi-site interactions that factor into a plain tensor product across sites (e.g. plaquette terms in gauge theories), and short-range two-site interactions for systems with a large physical dimension. Both of these are extremely expensive for our current approach, while simply storing the tensor product factors separately or storing the operator as a 2-site MPO of low bond dimension greatly reduces the cost. This is still very much a draft, but I already filed the PR to demonstrate how #423 allows to easily add support for exact evaluation of different operator types. In particular, the |
2e35ed7 to
f851709
Compare
| function Base.:+(O1::LocalOperator, O2::LocalOperator) | ||
| checklattice(O1, O2) | ||
| return LocalOperator(physicalspace(O1), mergewith(VI.add, O1.terms, O2.terms)) | ||
| end |
There was a problem hiding this comment.
This will bypass the check in add_terms! and add two MPOs incorrectly. The issue can be detected by
Hₓ = LocalOperator(lattice, sites => gate_to_mpo(X ⊗ X))
Hᶻ = LocalOperator(lattice, sites => gate_to_mpo(Z ⊗ Z))
H = Hₓ + Hᶻ
@test dense_operator(only(values(H.terms))) ≈ X ⊗ X + Z ⊗ Zwhere dense_operator is a function that converts the MPO back to a dense TensorMap.
23097ff to
2af2bb8
Compare
Adapt the draft MPO representation with ordered factors, physical-space and bond validation, scalar promotion, and safe scaling. Guard unsupported accumulation and real/imaginary operations, and add focused bookkeeping tests.
Built on top of #423.
Adds support for alternative operator forms for situations that are very badly suited to our current dense-tensor-operator approach, while still being compatible with AD to use them in variational optimizations. For now this is mostly a demonstration of how #423 allows to easily add support for the evaluation of different operator types by only overloading
operator_contraction_expr. The concrete design will be revisited later.