You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, Cytnx does not allow for BlockUniTensors with only incoming or outgoing legs:
bond = cytnx.Bond(cytnx.BD_IN, [cytnx.Qs(1)>>1],[cytnx.Symmetry.U1()])
uT = cytnx.UniTensor([bond,bond])
gives the error
[ERROR][BlockUniTensor] must have at least one ket-bond and one bra-bond.
On the other hand, a DenseUniTensor with only incoming/outgoing legs can be created. Also linear algebra functions like Qr lead to such BlockUniTensors:
bond = cytnx.Bond(cytnx.BD_IN, [cytnx.Qs(0)>>1,cytnx.Qs(1)>>1],[cytnx.Symmetry.U1()])
uT = cytnx.UniTensor([bond.redirect(),bond])
[Q,R]=cytnx.linalg.Qr(uT)
Q.print_diagram()
-----------------------
tensor Name :
tensor Rank : 2
contiguous : True
valid blocks : 2
is diag : False
on device : cytnx device: CPU
row col
-----------
| |
0 *<--| 2 2 |--> _aux_
| |
-----------
Shall we drop the restriction that a tensor needs to have at least one incoming and one outgoing leg? It would also allow the user more flexibility.
I already did this in the branch fermions since it was easier to remove the unnecessary restriction for BlockUniTensor rather than implementing it for BlockFermionicUniTensor. Everything works fine, but might need more testing of specific cases.
When tensors have only incoming or outgoing bonds, then the rule "incoming quantum number = outgoing quantum number" cannot be applied anymore. Instead, a neutral element needs to be defined, such that "incoming + reverse_rule(outgoing) = neutral element", which also works for no incoming or no outgoing bonds.
Currently, 0 is assumed to be the neutral element for all symmetries. But we could also have a neutral element defined for each symmetry explicitly (as other libraries do).
The text was updated successfully, but these errors were encountered:
Currently, Cytnx does not allow for
BlockUniTensor
s with only incoming or outgoing legs:gives the error
On the other hand, a
DenseUniTensor
with only incoming/outgoing legs can be created. Also linear algebra functions likeQr
lead to suchBlockUniTensor
s:Shall we drop the restriction that a tensor needs to have at least one incoming and one outgoing leg? It would also allow the user more flexibility.
I already did this in the branch
fermions
since it was easier to remove the unnecessary restriction forBlockUniTensor
rather than implementing it forBlockFermionicUniTensor
. Everything works fine, but might need more testing of specific cases.When tensors have only incoming or outgoing bonds, then the rule "incoming quantum number = outgoing quantum number" cannot be applied anymore. Instead, a neutral element needs to be defined, such that "incoming + reverse_rule(outgoing) = neutral element", which also works for no incoming or no outgoing bonds.
Currently,
0
is assumed to be the neutral element for all symmetries. But we could also have a neutral element defined for each symmetry explicitly (as other libraries do).The text was updated successfully, but these errors were encountered: