Skip to content

Commit

Permalink
Add comments on project method
Browse files Browse the repository at this point in the history
  • Loading branch information
antoine311200 committed Feb 1, 2022
1 parent 40bced1 commit 477f28b
Showing 1 changed file with 50 additions and 0 deletions.
50 changes: 50 additions & 0 deletions tensor/differential_matrix_product_operator.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,56 @@ def crumble_site(self, index: int) -> Any:

return crumbled_site


"""project method of DifferentialMatrixProductOperator
Project the wings based on a specified merged site
Mathematically, we aim at differentiating Y = WX with W a MatrixProductOperator and X an MatrixProductState
with respect to a merge site M at index k:
Y = WX = M(b_k, i_k, i_k+1, o_k, o_k+1, b_k+1) Z(_, _, o_1, b_k, b_k+1, o_2, _, _)
dY/dM = Z
| | | | | | | | | |
---O---O---O---O--- ---O---O--- ---O---O---O---O---
| | | | | | | | | |
---O---O---O---O--- ---O---O--- ---O---O---O---O---
=>
| |
---[ ]--- | | ---[ ]---
---[ ]--------O---O--------[ ]---
+
| |
---[ ]--- (6 dimensions)
| |
=>
|| | | ||
---O---O---O---O--- (8 dimensions)
=> (merge output and bond on wings)
| | | |
---O---O---O---O--- (8 dimensions)
(Generalized Product State (not implemented yet!) of shape :
[1, (o_1, b_k), bi_1]
[bi_1, o_k, bi_k]
[bi_k, o_k, bi_k+1]
[bi_k+1, (o_2, b_k+1), 1]
)
@type index: int
@param index: the index of the site n°index to merge with n°index+1
@type state: MatrixProductState
@param state: an input matrix product state to project with the sites
@rtype: Mapping[str, np.ndarray]
@returns: a dictionary containing the left/right wings, left/right centers and the merged sites
"""
def project(self, index, state):

if not isinstance(state, MatrixProductState):
Expand Down

0 comments on commit 477f28b

Please sign in to comment.