Define + for LocalOperators#63
Conversation
I defined additional for Localoperators
lkdvos
left a comment
There was a problem hiding this comment.
Maybe in the meantime it might be convenient to also add -, and scalar multiplication?
Sure, I didn't need those so I didn't think of it. |
1) Overloaded checklattice for two LocalOperators 2)Changed LocalOperator+LocalOperator such that its more efficient when duplicate indices appear 3)Defined Number*LocalOperator 4)Defined - using + and *
|
It might be useful to also check when H1 - H2 contains operators that are 0 that can therefore be thrown away. Any suggestions/preferences ? Or do we just ignore this subtlety ? |
|
Honestly, maybe we just add a default tolerance for that? something like |
|
Okay. I'll implement it like that. |
1) Extended LocalOperator constructor so that it eliminates operators with norm < tolerance. 2) Used this to make + - * implementations more streamlined
|
I made some slight changes and added a very basic docstring, thanks for getting this started! |
This all looks great for me. And you're welcome ! :) |
Codecov ReportAttention: Patch coverage is
|
I defined addition for Localoperators