diff --git a/ITensorUnicodePlots/test/references/R.txt b/ITensorUnicodePlots/test/references/R.txt index 2b664c5e23..8f0d350d8a 100644 --- a/ITensorUnicodePlots/test/references/R.txt +++ b/ITensorUnicodePlots/test/references/R.txt @@ -3,18 +3,18 @@ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ERn2⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ - ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⠔⠁⡇⠑⠢⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ + ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⠕⠀⡇⠑⠢⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡠⠊(20)'⠀⠑⠢⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀20⠊⠀⠀⠀⠀⡇⠀⠀⠀⠀⠀10⠢⢄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡠⠊⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠉⠢⢄⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡠⠊⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⣉hn2⠀⠀⠀⠀ - ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⠜⠀⣀⣀⣀⣀⣀⡠⠤⠤⠤⠤2⠒⠒⠒⠒⠒⠉⠉⠉⠉⠉⠀⢀⠔⢹⠀⠀⠀⠀⠀ + ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⠜⠀⣀⣀⣀⣀⣀⡠⠤⠤⠠⠤2⠒⠒⠒⠒⠒⠉⠉⠉⠉⠉⠀⢀⠔⢹⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ψn1n2⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⠔(2)'⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡠⠊⠁⠀⠀⠀⠀⠉⠢⢄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀10⠔⠁⠀⠀⠀⢸⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⡠⠊⠀⠀⠀⠀⠀⠀⠀⠀⠀2⊗2⊗2⠀⠀⠀⠀⠀⠀⠀⠀⠀⡠⠒⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ - ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀20⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠒⢄⡀⠀⠀⠀⠀⡠⠊⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ + ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀20⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠖⢀⡀⠀⠀⠀⠀⡠⠊⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⡠⠔⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢈⣑hn1⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ - ⠀⠀⠀⠀⠀⠀⡠⠊⠀⠀⢀⣀⣀⣀⣀⡠⠤⠤10⠤⠒⠒⠒⠒⠒⠉⠉⠉⠉⠉⠁⠀⠀⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ + ⠀⠀⠀⠀⠀⠀⡠⠊⠀⠀⢀⣀⣀⣀⣀⡠⠤⠤10⠤⠒⠒⠒⠒⠒⠉⠉⠉⠉⠈⠁⠀⠀⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀ELn0⠉⠉⠉⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀(2)'⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀(20)'⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ diff --git a/ITensorUnicodePlots/test/references/R1.txt b/ITensorUnicodePlots/test/references/R1.txt index ab04532e4f..dd88b4a1db 100644 --- a/ITensorUnicodePlots/test/references/R1.txt +++ b/ITensorUnicodePlots/test/references/R1.txt @@ -5,7 +5,7 @@ ⠀⠀⠀ELn0⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⣷⠀⠀⠉⠉⠑⠒⠒⠤⠤⢄⣀⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⡇⢇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠉⠉⠑⠒⠒⠤⠤10⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ - ⠀⠀⠀(20)'⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠉⠉⠉⠒⠒⠢⠤⠤⣀⣀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ + ⠀⠀⠀(20)'⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠉⠉⠈⠒⠒⠢⠤⠤⣀⣀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⡇⠀⢱⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠉⠉⠒⠒⠢⠤hn1⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⡇⠀⠀⢇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⠤⠒⠉⢸⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠁⠀⠀⠘⡄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⡠⠒⠉⠀⠀⠀⠀⢸⠀⠀⠀⠀⠀ diff --git a/ITensorUnicodePlots/test/references/R2.txt b/ITensorUnicodePlots/test/references/R2.txt index c3873b3b32..698bc913ec 100644 --- a/ITensorUnicodePlots/test/references/R2.txt +++ b/ITensorUnicodePlots/test/references/R2.txt @@ -5,7 +5,7 @@ ⠀⠀⠀⠀T1⣀⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⣷⠀⠀⠉⠉⠑⠒⠒⠤⠤⢄⣀⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⡇⢇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠉⠉⠑⠒⠒⠤⠤20⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ - ⠀20)'⊗(2)'⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠉⠉⠉⠒⠒⠢⠤⠤⣀⣀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ + ⠀20)'⊗(2)'⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠉⠉⠈⠒⠒⠢⠤⠤⣀⣀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⡇⠀⢱⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠉⠉⠒⠒⠢⠤T3⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⡇⠀⠀⢇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⠤⠒⠉⢸⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠁⠀⠀⠘⡄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⡠⠒⠉⠀⠀⠀⠀⢸⠀⠀⠀⠀⠀ diff --git a/ITensorUnicodePlots/test/references/R_tags.txt b/ITensorUnicodePlots/test/references/R_tags.txt index 9c93146dab..cd8b09f8ff 100644 --- a/ITensorUnicodePlots/test/references/R_tags.txt +++ b/ITensorUnicodePlots/test/references/R_tags.txt @@ -3,7 +3,7 @@ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ERn2⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ - ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⠔⠁⡇⠑⠢⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ + ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⠕⠀⡇⠑⠢⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀(20|"Link,l=3")'⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀(20|"Link,l(10|"Link,ham,l=3")⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡠⠊⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠉⠢⢄⠀⠀⠀⠀⠀⠀⠀⠀ @@ -12,9 +12,9 @@ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ψn1n2⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀(2|"S=1/2,Site,⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡠⠊⠁⠀⠀⠀⠀⠉⠢⢄⠀⠀⠀⠀⠀⠀(10|"Link,ham,l=2")⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀(2|"S=1/2,Site,n=2")⊗(2|"X")⊗(2|"Y")⠀⠀⠀⠀⠀⠀⠀⠀ - ⠀⠀⠀⠀⠀(20|"Link,l=1")⠀⠀⠀⠀⠀⠀⠀⠀⠈⠒⢄⡀⠀⠀⠀⠀⡠⠊⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ + ⠀⠀⠀⠀⠀(20|"Link,l=1")⠀⠀⠀⠀⠀⠀⠀⠀⠈⠖⢀⡀⠀⠀⠀⠀⡠⠊⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⡠⠔⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢈⣑hn1⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ - ⠀⠀⠀⠀⠀⠀⡠⠊⠀⠀(10|"Link,ham,l=1")⠉⠉⠁⠀⠀⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ + ⠀⠀⠀⠀⠀⠀⡠⠊⠀⠀(10|"Link,ham,l=1")⠉⠈⠁⠀⠀⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀ELn0⠉⠉⠉⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀(2|"S=1/2,Site,n=2")'⠀⠀⠀⠀⠀⠀⠀ ⠀"Link,l=1")'⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ diff --git a/ITensorUnicodePlots/test/references/tn.txt b/ITensorUnicodePlots/test/references/tn.txt index 5878503094..6ce2dcca5c 100644 --- a/ITensorUnicodePlots/test/references/tn.txt +++ b/ITensorUnicodePlots/test/references/tn.txt @@ -3,18 +3,18 @@ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀tn₅⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ - ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⠔⠁⡇⠑⠢⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ + ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⠕⠀⡇⠑⠢⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡠⠊(20)'⠀⠑⠢⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀20⠊⠀⠀⠀⠀⡇⠀⠀⠀⠀⠀10⠢⢄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡠⠊⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠉⠢⢄⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡠⠊⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⣉tn₄⠀⠀⠀⠀ - ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⠜⠀⣀⣀⣀⣀⣀⡠⠤⠤⠤⠤2⠒⠒⠒⠒⠒⠉⠉⠉⠉⠉⠀⢀⠔⢹⠀⠀⠀⠀⠀ + ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⠜⠀⣀⣀⣀⣀⣀⡠⠤⠤⠠⠤2⠒⠒⠒⠒⠒⠉⠉⠉⠉⠉⠀⢀⠔⢹⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀tn₂⣉⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⠔(2)'⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡠⠊⠁⠀⠀⠀⠀⠉⠢⢄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀10⠔⠁⠀⠀⠀⢸⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⡠⠊⠀⠀⠀⠀⠀⠀⠀⠀⠀2⊗2⊗2⠀⠀⠀⠀⠀⠀⠀⠀⠀⡠⠒⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ - ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀20⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠒⢄⡀⠀⠀⠀⠀⡠⠊⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ + ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀20⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠖⢀⡀⠀⠀⠀⠀⡠⠊⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⡠⠔⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢈⣑tn₃⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ - ⠀⠀⠀⠀⠀⠀⡠⠊⠀⠀⢀⣀⣀⣀⣀⡠⠤⠤10⠤⠒⠒⠒⠒⠒⠉⠉⠉⠉⠉⠁⠀⠀⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ + ⠀⠀⠀⠀⠀⠀⡠⠊⠀⠀⢀⣀⣀⣀⣀⡠⠤⠤10⠤⠒⠒⠒⠒⠒⠉⠉⠉⠉⠈⠁⠀⠀⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀tn₁⠉⠉⠉⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀(2)'⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀(20)'⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ diff --git a/src/exports.jl b/src/exports.jl index d859f3fbe9..74d40ee14f 100644 --- a/src/exports.jl +++ b/src/exports.jl @@ -117,6 +117,7 @@ export ITensor, # Methods ⊙, + ⊕, addtags!, apply, Apply, @@ -136,6 +137,7 @@ export δ, diagitensor, diagITensor, + directsum, dot, eachnzblock, firstind, diff --git a/src/itensor.jl b/src/itensor.jl index e17ee9c99a..378499f3c3 100644 --- a/src/itensor.jl +++ b/src/itensor.jl @@ -2270,16 +2270,79 @@ function directsum_itensors(i::Index, j::Index, ij::Index) return D1, D2 end +function check_directsum_inds(A::ITensor, I, B::ITensor, J) + a = uniqueinds(A, I) + b = uniqueinds(B, J) + if !hassameinds(a, b) + error("""In directsum, attemptying to direct sum ITensors A and B with indices: + + $(inds(A)) + + and + + $(inds(B)) + + over the indices + + $(I) + + and + + $(J) + + The indices not being direct summed must match, however they are + + $a + + and + + $b + """) + end +end + +function _directsum(A::ITensor, I, B::ITensor, J; tags=["sum$i" for i in 1:length(I)]) + N = length(I) + (N != length(J)) && + error("In directsum(::ITensor, ::ITensor, ...), must sum equal number of indices") + check_directsum_inds(A, I, B, J) + IJ = Vector{Base.promote_eltype(I, J)}(undef, N) + for n in 1:N + In = I[n] + Jn = J[n] + In = dir(A, In) != dir(In) ? dag(In) : In + Jn = dir(B, Jn) != dir(Jn) ? dag(Jn) : Jn + IJn = directsum(In, Jn; tags=tags[n]) + D1, D2 = directsum_itensors(In, Jn, IJn) + IJ[n] = IJn + A *= D1 + B *= D2 + end + C = A + B + return C => IJ +end + +function _directsum(A::ITensor, i::Index, B::ITensor, j::Index; tags="sum") + C, (ij,) = _directsum(A, (i,), B, (j,); tags=[tags]) + return C => ij +end + function directsum(A_and_I::Pair{ITensor}, B_and_J::Pair{ITensor}; kwargs...) - A, I = A_and_I - B, J = B_and_J - return directsum(A, B, I, J; kwargs...) + return _directsum(A_and_I..., B_and_J...; kwargs...) +end + +function default_directsum_tags(A_and_I::Pair{ITensor}) + return ["sum$i" for i in 1:length(last(A_and_I))] +end + +function default_directsum_tags(A_and_I::Pair{ITensor,<:Index}) + return "sum" end """ directsum(A::Pair{ITensor}, B::Pair{ITensor}, ...; tags) -Given a list of pairs of ITensors and collections of indices, perform a partial +Given a list of pairs of ITensors and indices, perform a partial direct sum of the tensors over the specified indices. Indices that are not specified to be summed must match between the tensors. @@ -2301,9 +2364,21 @@ j1 = Index(4, "j1") i2 = Index(5, "i2") j2 = Index(6, "j2") +A1 = randomITensor(x, i1) +A2 = randomITensor(x, i2) +S, s = directsum(A1 => i1, A2 => i2) +dim(s) == dim(i1) + dim(i2) + +A3 = randomITensor(x, j1) +S, s = directsum(A1 => i1, A2 => i2, A3 => j1) +dim(s) == dim(i1) + dim(i2) + dim(j1) + A1 = randomITensor(i1, x, j1) A2 = randomITensor(x, j2, i2) -S, s = ITensors.directsum(A1 => (i1, j1), A2 => (i2, j2); tags = ["sum_i", "sum_j"]) +S, s = directsum(A1 => (i1, j1), A2 => (i2, j2); tags = ["sum_i", "sum_j"]) +length(s) == 2 +dim(s[1]) == dim(i1) + dim(i2) +dim(s[2]) == dim(j1) + dim(j2) ``` """ function directsum( @@ -2311,32 +2386,12 @@ function directsum( B_and_J::Pair{ITensor}, C_and_K::Pair{ITensor}, itensor_and_inds...; - tags=["sum$i" for i in 1:length(last(A_and_I))], + tags=default_directsum_tags(A_and_I), ) - return directsum( - Pair(directsum(A_and_I, B_and_J; tags)...), C_and_K, itensor_and_inds...; tags - ) + return directsum(directsum(A_and_I, B_and_J; tags), C_and_K, itensor_and_inds...; tags) end -function directsum(A::ITensor, B::ITensor, I, J; tags) - N = length(I) - (N != length(J)) && - error("In directsum(::ITensor, ::ITensor, ...), must sum equal number of indices") - IJ = Vector{Base.promote_eltype(I, J)}(undef, N) - for n in 1:N - In = I[n] - Jn = J[n] - In = dir(A, In) != dir(In) ? dag(In) : In - Jn = dir(B, Jn) != dir(Jn) ? dag(Jn) : Jn - IJn = directsum(In, Jn; tags=tags[n]) - D1, D2 = directsum_itensors(In, Jn, IJn) - IJ[n] = IJn - A *= D1 - B *= D2 - end - C = A + B - return C, IJ -end +const ⊕ = directsum """ apply(A::ITensor, B::ITensor) diff --git a/src/physics/fermions.jl b/src/physics/fermions.jl index ef7e0d749b..574b830200 100644 --- a/src/physics/fermions.jl +++ b/src/physics/fermions.jl @@ -79,7 +79,9 @@ according to p, then return -1. Otherwise return +1. function compute_permfactor(p, iv_or_qn...; range=1:length(iv_or_qn))::Int using_auto_fermion() || return 1 N = length(iv_or_qn) - oddp = @MVector zeros(Int, N) + # XXX: Bug https://github.com/ITensor/ITensors.jl/issues/931 + # oddp = @MVector zeros(Int, N) + oddp = MVector((ntuple(Returns(0), Val(N)))) n = 0 @inbounds for j in range if fparity(iv_or_qn[p[j]]) == 1 diff --git a/test/itensor.jl b/test/itensor.jl index de07e047a0..e09da45793 100644 --- a/test/itensor.jl +++ b/test/itensor.jl @@ -1627,6 +1627,49 @@ end end end end + + i1, i2, j, k, l = Index.((2, 3, 4, 5, 6), ("i1", "i2", "j", "k", "l")) + + A = randomITensor(i1, i2, j) + B = randomITensor(i1, i2, k) + C = randomITensor(i1, i2, l) + + S, s = directsum(A => j, B => k) + @test dim(s) == dim(j) + dim(k) + @test hassameinds(S, (i1, i2, s)) + + S, s = (A => j) ⊕ (B => k) + @test dim(s) == dim(j) + dim(k) + @test hassameinds(S, (i1, i2, s)) + + S, s = directsum(A => j, B => k, C => l) + @test dim(s) == dim(j) + dim(k) + dim(l) + @test hassameinds(S, (i1, i2, s)) + + @test_throws ErrorException directsum(A => i2, B => i2) + + S, (s,) = directsum(A => (j,), B => (k,)) + @test s == uniqueind(S, A) + @test dim(s) == dim(j) + dim(k) + @test hassameinds(S, (i1, i2, s)) + + S, ss = directsum(A => (i2, j), B => (i2, k)) + @test length(ss) == 2 + @test dim(ss[1]) == dim(i2) + dim(i2) + @test hassameinds(S, (i1, ss...)) + + S, ss = directsum(A => (j,), B => (k,), C => (l,)) + s = only(ss) + @test s == uniqueind(S, A) + @test dim(s) == dim(j) + dim(k) + dim(l) + @test hassameinds(S, (i1, i2, s)) + + S, ss = directsum(A => (i2, i1, j), B => (i1, i2, k), C => (i1, i2, l)) + @test length(ss) == 3 + @test dim(ss[1]) == dim(i2) + dim(i1) + dim(i1) + @test dim(ss[2]) == dim(i1) + dim(i2) + dim(i2) + @test dim(ss[3]) == dim(j) + dim(k) + dim(l) + @test hassameinds(S, ss) end @testset "ishermitian" begin