Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ITensorGaussianMPS] Add time-dependent Green functions #884

Closed
wants to merge 4 commits into from

Conversation

emstoudenmire
Copy link
Collaborator

This PR adds three functions, G_R, G_G, and G_L, which compute the retarded, greater, and lesser Green functions as a function of time. By default they do the following:

  • return the Green function as a matrix G_ij over the whole system
  • compute the number of occupied orbitals by counting how many energies are negative
    but both of these defaults are overridable by keyword arguments. The sites keyword argument works similarly to the same keyword in the expect and correlation_matrix functions in ITensor. One can pass a keyword argument Npart to set the number of particles (occupied orbitals) manually.

I'm happy to change the names of any of these (functions or keyword arguments).

Also we could add the advanced Green function but I'm not sure if anyone uses it.

@github-actions
Copy link
Contributor

Benchmark result

Judge result

Benchmark Report for /home/runner/work/ITensors.jl/ITensors.jl

Job Properties

  • Time of benchmarks:
    • Target: 30 Mar 2022 - 03:42
    • Baseline: 30 Mar 2022 - 03:54
  • Package commits:
    • Target: 960f1a
    • Baseline: c6d425
  • Julia commits:
    • Target: bf5349
    • Baseline: bf5349
  • Julia command flags:
    • Target: None
    • Baseline: None
  • Environment variables:
    • Target: None
    • Baseline: None

Results

A ratio greater than 1.0 denotes a possible regression (marked with ❌), while a ratio less
than 1.0 denotes a possible improvement (marked with ✅). Only significant results - results
that indicate possible regressions or improvements - are shown below (thus, an empty table means that all
benchmark results remained invariant between builds).

ID time ratio memory ratio
["indexset", "constructor", "function"] 0.85 (5%) ✅ 1.00 (1%)
["indexset", "filter", "kwargs"] 0.87 (5%) ✅ 1.00 (1%)
["indexset", "set_functions", "prime, ITensor"] 0.91 (5%) ✅ 1.00 (1%)
["tagset", "tagset"] 1.12 (5%) ❌ 1.00 (1%)
["tagset", "tagset_unicode"] 1.07 (5%) ❌ 1.00 (1%)

Benchmark Group List

Here's a list of all the benchmark groups executed by this job:

  • ["autompo"]
  • ["contract"]
  • ["dmrg"]
  • ["getsetindex"]
  • ["indexset", "constructor"]
  • ["indexset", "filter"]
  • ["indexset", "set_functions"]
  • ["indexset", "set_functions", "uniqueinds"]
  • ["inplace"]
  • ["op"]
  • ["tagset"]

Julia versioninfo

Target

Julia Version 1.7.2
Commit bf53498635 (2022-02-06 15:21 UTC)
Platform Info:
  OS: Linux (x86_64-pc-linux-gnu)
      Ubuntu 20.04.4 LTS
  uname: Linux 5.11.0-1028-azure #31~20.04.2-Ubuntu SMP Tue Jan 18 08:46:15 UTC 2022 x86_64 x86_64
  CPU: Intel(R) Xeon(R) Platinum 8272CL CPU @ 2.60GHz: 
              speed         user         nice          sys         idle          irq
       #1  2593 MHz       6614 s          2 s        932 s       6023 s          0 s
       #2  2593 MHz       7344 s          1 s        945 s       5307 s          0 s
       
  Memory: 6.7845458984375 GB (964.89453125 MB free)
  Uptime: 1365.46 sec
  Load Avg:  1.0  1.07  0.93
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-12.0.1 (ORCJIT, skylake-avx512)

Baseline

Julia Version 1.7.2
Commit bf53498635 (2022-02-06 15:21 UTC)
Platform Info:
  OS: Linux (x86_64-pc-linux-gnu)
      Ubuntu 20.04.4 LTS
  uname: Linux 5.11.0-1028-azure #31~20.04.2-Ubuntu SMP Tue Jan 18 08:46:15 UTC 2022 x86_64 x86_64
  CPU: Intel(R) Xeon(R) Platinum 8272CL CPU @ 2.60GHz: 
              speed         user         nice          sys         idle          irq
       #1  2593 MHz       8797 s          2 s       1344 s      10506 s          0 s
       #2  2593 MHz      12253 s          1 s       1579 s       6855 s          0 s
       
  Memory: 6.7845458984375 GB (844.359375 MB free)
  Uptime: 2075.06 sec
  Load Avg:  1.01  1.1  1.05
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-12.0.1 (ORCJIT, skylake-avx512)

Target result

Benchmark Report for /home/runner/work/ITensors.jl/ITensors.jl

Job Properties

  • Time of benchmark: 30 Mar 2022 - 3:42
  • Package commit: 960f1a
  • Julia commit: bf5349
  • Julia command flags: None
  • Environment variables: None

Results

Below is a table of this job's results, obtained by running the benchmarks.
The values listed in the ID column have the structure [parent_group, child_group, ..., key], and can be used to
index into the BaseBenchmarks suite to retrieve the corresponding benchmarks.
The percentages accompanying time and memory values in the below table are noise tolerances. The "true"
time/memory value for a given benchmark is expected to fall within this percentage of the reported value.
An empty cell means that the value was zero.

ID time GC time memory allocations
["autompo", "Quartic Hamiltonian"] 23.885 s (5%) 2.775 s 7.32 GiB (1%) 100394948
["autompo", "Quartic QN Hamiltonian"] 35.796 s (5%) 5.290 s 13.40 GiB (1%) 157516647
["contract", "heff_2site"] 5.138 ms (5%) 19.41 MiB (1%) 305
["contract", "matmul_100"] 37.700 μs (5%) 79.77 KiB (1%) 15
["contract", "matmul_20"] 3.000 μs (5%) 4.84 KiB (1%) 14
["contract", "matmul_40"] 7.050 μs (5%) 14.22 KiB (1%) 14
["contract", "matmul_60"] 17.100 μs (5%) 29.77 KiB (1%) 15
["contract", "matmul_80"] 21.900 μs (5%) 51.64 KiB (1%) 15
["contract", "matmul_inplace_100"] 32.900 μs (5%) 992 bytes (1%) 10
["contract", "matmul_inplace_20"] 1.770 μs (5%) 992 bytes (1%) 10
["contract", "matmul_inplace_40"] 4.357 μs (5%) 992 bytes (1%) 10
["contract", "matmul_inplace_60"] 11.400 μs (5%) 992 bytes (1%) 10
["contract", "matmul_inplace_80"] 17.700 μs (5%) 992 bytes (1%) 10
["dmrg", "1d_S=1_heisenberg"] 19.232 s (5%) 817.995 ms 38.50 GiB (1%) 2103973
["dmrg", "1d_S=1_heisenberg_qn"] 18.401 s (5%) 1.370 s 12.76 GiB (1%) 96497258
["getsetindex", "getindex end"] 213.820 ns (5%) 512 bytes (1%) 5
["getsetindex", "getindex indval end"] 64.257 ns (5%) 256 bytes (1%) 3
["getsetindex", "getindex indval"] 63.174 ns (5%) 272 bytes (1%) 3
["getsetindex", "getindex"] 23.170 ns (5%) 16 bytes (1%) 1
["getsetindex", "setindex! end"] 279.195 ns (5%) 752 bytes (1%) 6
["getsetindex", "setindex! indval end"] 93.215 ns (5%) 464 bytes (1%) 3
["getsetindex", "setindex! indval"] 95.178 ns (5%) 480 bytes (1%) 3
["getsetindex", "setindex!"] 65.785 ns (5%) 224 bytes (1%) 1
["indexset", "constructor", "function"] 596.512 ns (5%) 1.48 KiB (1%) 11
["indexset", "constructor", "function, tuple"] 380.392 ns (5%) 1.31 KiB (1%) 7
["indexset", "filter", "function"] 140.117 ns (5%) 1.14 KiB (1%) 1
["indexset", "filter", "function, tuple"] 49.798 ns (5%) 224 bytes (1%) 1
["indexset", "filter", "kwargs"] 136.258 ns (5%) 1.14 KiB (1%) 1
["indexset", "set_functions", "commoninds, ITensor"] 419.372 ns (5%) 1.86 KiB (1%) 5
["indexset", "set_functions", "noncommoninds, ITensor"] 483.510 ns (5%) 1.86 KiB (1%) 5
["indexset", "set_functions", "prime, ITensor"] 127.541 ns (5%) 688 bytes (1%) 3
["indexset", "set_functions", "unioninds, ITensor"] 518.421 ns (5%) 2.73 KiB (1%) 6
["indexset", "set_functions", "uniqueinds", "3_inputs"] 510.204 ns (5%) 2.17 KiB (1%) 9
["indexset", "set_functions", "uniqueinds", "filter_not_tags"] 279.932 ns (5%) 864 bytes (1%) 6
["indexset", "set_functions", "uniqueinds", "filter_tags"] 171.448 ns (5%) 640 bytes (1%) 2
["indexset", "set_functions", "uniqueinds", "nofilter0"] 140.768 ns (5%) 336 bytes (1%) 2
["indexset", "set_functions", "uniqueinds", "nofilter2"] 145.675 ns (5%) 640 bytes (1%) 2
["indexset", "set_functions", "uniqueinds, ITensor"] 551.939 ns (5%) 1.84 KiB (1%) 7
["inplace", "axpy!"] 12.900 μs (5%) 1.67 KiB (1%) 22
["op", "op QN"] 8.000 μs (5%) 9.41 KiB (1%) 113
["op", "op"] 4.414 μs (5%) 3.70 KiB (1%) 46
["tagset", "tagset"] 294.443 ns (5%) 208 bytes (1%) 5
["tagset", "tagset_unicode"] 421.075 ns (5%) 208 bytes (1%) 5

Benchmark Group List

Here's a list of all the benchmark groups executed by this job:

  • ["autompo"]
  • ["contract"]
  • ["dmrg"]
  • ["getsetindex"]
  • ["indexset", "constructor"]
  • ["indexset", "filter"]
  • ["indexset", "set_functions"]
  • ["indexset", "set_functions", "uniqueinds"]
  • ["inplace"]
  • ["op"]
  • ["tagset"]

Julia versioninfo

Julia Version 1.7.2
Commit bf53498635 (2022-02-06 15:21 UTC)
Platform Info:
  OS: Linux (x86_64-pc-linux-gnu)
      Ubuntu 20.04.4 LTS
  uname: Linux 5.11.0-1028-azure #31~20.04.2-Ubuntu SMP Tue Jan 18 08:46:15 UTC 2022 x86_64 x86_64
  CPU: Intel(R) Xeon(R) Platinum 8272CL CPU @ 2.60GHz: 
              speed         user         nice          sys         idle          irq
       #1  2593 MHz       6614 s          2 s        932 s       6023 s          0 s
       #2  2593 MHz       7344 s          1 s        945 s       5307 s          0 s
       
  Memory: 6.7845458984375 GB (964.89453125 MB free)
  Uptime: 1365.46 sec
  Load Avg:  1.0  1.07  0.93
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-12.0.1 (ORCJIT, skylake-avx512)

Baseline result

Benchmark Report for /home/runner/work/ITensors.jl/ITensors.jl

Job Properties

  • Time of benchmark: 30 Mar 2022 - 3:54
  • Package commit: c6d425
  • Julia commit: bf5349
  • Julia command flags: None
  • Environment variables: None

Results

Below is a table of this job's results, obtained by running the benchmarks.
The values listed in the ID column have the structure [parent_group, child_group, ..., key], and can be used to
index into the BaseBenchmarks suite to retrieve the corresponding benchmarks.
The percentages accompanying time and memory values in the below table are noise tolerances. The "true"
time/memory value for a given benchmark is expected to fall within this percentage of the reported value.
An empty cell means that the value was zero.

ID time GC time memory allocations
["autompo", "Quartic Hamiltonian"] 23.877 s (5%) 2.705 s 7.32 GiB (1%) 100394994
["autompo", "Quartic QN Hamiltonian"] 35.665 s (5%) 5.133 s 13.40 GiB (1%) 157520978
["contract", "heff_2site"] 4.941 ms (5%) 19.41 MiB (1%) 305
["contract", "matmul_100"] 37.101 μs (5%) 79.77 KiB (1%) 15
["contract", "matmul_20"] 3.013 μs (5%) 4.84 KiB (1%) 14
["contract", "matmul_40"] 7.000 μs (5%) 14.22 KiB (1%) 14
["contract", "matmul_60"] 16.700 μs (5%) 29.77 KiB (1%) 15
["contract", "matmul_80"] 22.000 μs (5%) 51.64 KiB (1%) 15
["contract", "matmul_inplace_100"] 33.500 μs (5%) 992 bytes (1%) 10
["contract", "matmul_inplace_20"] 1.750 μs (5%) 992 bytes (1%) 10
["contract", "matmul_inplace_40"] 4.343 μs (5%) 992 bytes (1%) 10
["contract", "matmul_inplace_60"] 11.200 μs (5%) 992 bytes (1%) 10
["contract", "matmul_inplace_80"] 18.000 μs (5%) 992 bytes (1%) 10
["dmrg", "1d_S=1_heisenberg"] 19.864 s (5%) 899.768 ms 38.50 GiB (1%) 2103973
["dmrg", "1d_S=1_heisenberg_qn"] 18.146 s (5%) 1.389 s 12.76 GiB (1%) 96497258
["getsetindex", "getindex end"] 205.273 ns (5%) 512 bytes (1%) 5
["getsetindex", "getindex indval end"] 61.813 ns (5%) 256 bytes (1%) 3
["getsetindex", "getindex indval"] 63.480 ns (5%) 272 bytes (1%) 3
["getsetindex", "getindex"] 23.872 ns (5%) 16 bytes (1%) 1
["getsetindex", "setindex! end"] 289.262 ns (5%) 752 bytes (1%) 6
["getsetindex", "setindex! indval end"] 93.528 ns (5%) 464 bytes (1%) 3
["getsetindex", "setindex! indval"] 96.437 ns (5%) 480 bytes (1%) 3
["getsetindex", "setindex!"] 64.257 ns (5%) 224 bytes (1%) 1
["indexset", "constructor", "function"] 700.587 ns (5%) 1.48 KiB (1%) 11
["indexset", "constructor", "function, tuple"] 382.848 ns (5%) 1.31 KiB (1%) 7
["indexset", "filter", "function"] 144.796 ns (5%) 1.14 KiB (1%) 1
["indexset", "filter", "function, tuple"] 50.302 ns (5%) 224 bytes (1%) 1
["indexset", "filter", "kwargs"] 156.959 ns (5%) 1.14 KiB (1%) 1
["indexset", "set_functions", "commoninds, ITensor"] 426.702 ns (5%) 1.86 KiB (1%) 5
["indexset", "set_functions", "noncommoninds, ITensor"] 500.005 ns (5%) 1.86 KiB (1%) 5
["indexset", "set_functions", "prime, ITensor"] 139.616 ns (5%) 688 bytes (1%) 3
["indexset", "set_functions", "unioninds, ITensor"] 532.105 ns (5%) 2.73 KiB (1%) 6
["indexset", "set_functions", "uniqueinds", "3_inputs"] 515.311 ns (5%) 2.17 KiB (1%) 9
["indexset", "set_functions", "uniqueinds", "filter_not_tags"] 279.255 ns (5%) 864 bytes (1%) 6
["indexset", "set_functions", "uniqueinds", "filter_tags"] 174.800 ns (5%) 640 bytes (1%) 2
["indexset", "set_functions", "uniqueinds", "nofilter0"] 141.580 ns (5%) 336 bytes (1%) 2
["indexset", "set_functions", "uniqueinds", "nofilter2"] 147.405 ns (5%) 640 bytes (1%) 2
["indexset", "set_functions", "uniqueinds, ITensor"] 558.011 ns (5%) 1.84 KiB (1%) 7
["inplace", "axpy!"] 12.900 μs (5%) 1.67 KiB (1%) 22
["op", "op QN"] 7.867 μs (5%) 9.41 KiB (1%) 113
["op", "op"] 4.471 μs (5%) 3.70 KiB (1%) 46
["tagset", "tagset"] 261.993 ns (5%) 208 bytes (1%) 5
["tagset", "tagset_unicode"] 393.467 ns (5%) 208 bytes (1%) 5

Benchmark Group List

Here's a list of all the benchmark groups executed by this job:

  • ["autompo"]
  • ["contract"]
  • ["dmrg"]
  • ["getsetindex"]
  • ["indexset", "constructor"]
  • ["indexset", "filter"]
  • ["indexset", "set_functions"]
  • ["indexset", "set_functions", "uniqueinds"]
  • ["inplace"]
  • ["op"]
  • ["tagset"]

Julia versioninfo

Julia Version 1.7.2
Commit bf53498635 (2022-02-06 15:21 UTC)
Platform Info:
  OS: Linux (x86_64-pc-linux-gnu)
      Ubuntu 20.04.4 LTS
  uname: Linux 5.11.0-1028-azure #31~20.04.2-Ubuntu SMP Tue Jan 18 08:46:15 UTC 2022 x86_64 x86_64
  CPU: Intel(R) Xeon(R) Platinum 8272CL CPU @ 2.60GHz: 
              speed         user         nice          sys         idle          irq
       #1  2593 MHz       8797 s          2 s       1344 s      10506 s          0 s
       #2  2593 MHz      12253 s          1 s       1579 s       6855 s          0 s
       
  Memory: 6.7845458984375 GB (844.359375 MB free)
  Uptime: 2075.06 sec
  Load Avg:  1.01  1.1  1.05
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-12.0.1 (ORCJIT, skylake-avx512)

Runtime information

Runtime Info
BLAS #threads 2
BLAS.vendor() openblas64
Sys.CPU_THREADS 2

lscpu output:

Architecture:                    x86_64
CPU op-mode(s):                  32-bit, 64-bit
Byte Order:                      Little Endian
Address sizes:                   46 bits physical, 48 bits virtual
CPU(s):                          2
On-line CPU(s) list:             0,1
Thread(s) per core:              1
Core(s) per socket:              2
Socket(s):                       1
NUMA node(s):                    1
Vendor ID:                       GenuineIntel
CPU family:                      6
Model:                           85
Model name:                      Intel(R) Xeon(R) Platinum 8272CL CPU @ 2.60GHz
Stepping:                        7
CPU MHz:                         2593.905
BogoMIPS:                        5187.81
Hypervisor vendor:               Microsoft
Virtualization type:             full
L1d cache:                       64 KiB
L1i cache:                       64 KiB
L2 cache:                        2 MiB
L3 cache:                        35.8 MiB
NUMA node0 CPU(s):               0,1
Vulnerability Itlb multihit:     KVM: Mitigation: VMX unsupported
Vulnerability L1tf:              Mitigation; PTE Inversion
Vulnerability Mds:               Mitigation; Clear CPU buffers; SMT Host state unknown
Vulnerability Meltdown:          Mitigation; PTI
Vulnerability Spec store bypass: Vulnerable
Vulnerability Spectre v1:        Mitigation; usercopy/swapgs barriers and __user pointer sanitization
Vulnerability Spectre v2:        Mitigation; Full generic retpoline, STIBP disabled, RSB filling
Vulnerability Srbds:             Not affected
Vulnerability Tsx async abort:   Mitigation; Clear CPU buffers; SMT Host state unknown
Flags:                           fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx pdpe1gb rdtscp lm constant_tsc rep_good nopl xtopology cpuid pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 movbe popcnt aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch invpcid_single pti fsgsbase bmi1 hle avx2 smep bmi2 erms invpcid rtm mpx avx512f avx512dq rdseed adx smap clflushopt avx512cd avx512bw avx512vl xsaveopt xsavec xsaves md_clear
Cpu Property Value
Brand Intel(R) Xeon(R) Platinum 8272CL CPU @ 2.60GHz
Vendor :Intel
Architecture :Skylake
Model Family: 0x06, Model: 0x55, Stepping: 0x07, Type: 0x00
Cores 2 physical cores, 2 logical cores (on executing CPU)
No Hyperthreading hardware capability detected
Clock Frequencies Not supported by CPU
Data Cache Level 1:3 : (32, 1024, 36608) kbytes
64 byte cache line size
Address Size 48 bits virtual, 46 bits physical
SIMD 512 bit = 64 byte max. SIMD vector size
Time Stamp Counter TSC is accessible via rdtsc
TSC increased at every clock cycle (non-invariant TSC)
Perf. Monitoring Performance Monitoring Counters (PMC) are not supported
Hypervisor Yes, Microsoft

@codecov-commenter
Copy link

codecov-commenter commented Mar 30, 2022

Codecov Report

Merging #884 (bcc38b7) into main (9f12780) will not change coverage.
The diff coverage is n/a.

❗ Current head bcc38b7 differs from pull request most recent head 11f8506. Consider uploading reports for the commit 11f8506 to get more accurate results

@@           Coverage Diff           @@
##             main     #884   +/-   ##
=======================================
  Coverage   75.77%   75.77%           
=======================================
  Files          76       76           
  Lines        8011     8011           
=======================================
  Hits         6070     6070           
  Misses       1941     1941           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6053df9...11f8506. Read the comment docs.

@github-actions
Copy link
Contributor

Benchmark result

Judge result

Benchmark Report for /home/runner/work/ITensors.jl/ITensors.jl

Job Properties

  • Time of benchmarks:
    • Target: 30 Mar 2022 - 03:44
    • Baseline: 30 Mar 2022 - 03:59
  • Package commits:
    • Target: 9d27e8
    • Baseline: c6d425
  • Julia commits:
    • Target: bf5349
    • Baseline: bf5349
  • Julia command flags:
    • Target: None
    • Baseline: None
  • Environment variables:
    • Target: None
    • Baseline: None

Results

A ratio greater than 1.0 denotes a possible regression (marked with ❌), while a ratio less
than 1.0 denotes a possible improvement (marked with ✅). Only significant results - results
that indicate possible regressions or improvements - are shown below (thus, an empty table means that all
benchmark results remained invariant between builds).

ID time ratio memory ratio
["contract", "matmul_60"] 1.10 (5%) ❌ 1.00 (1%)
["contract", "matmul_80"] 1.13 (5%) ❌ 1.00 (1%)
["contract", "matmul_inplace_20"] 1.06 (5%) ❌ 1.00 (1%)
["contract", "matmul_inplace_60"] 0.89 (5%) ✅ 1.00 (1%)
["getsetindex", "getindex"] 0.78 (5%) ✅ 1.00 (1%)
["getsetindex", "setindex!"] 0.93 (5%) ✅ 1.00 (1%)
["indexset", "constructor", "function"] 0.87 (5%) ✅ 1.00 (1%)
["indexset", "constructor", "function, tuple"] 0.88 (5%) ✅ 1.00 (1%)
["indexset", "set_functions", "commoninds, ITensor"] 1.13 (5%) ❌ 1.00 (1%)
["indexset", "set_functions", "noncommoninds, ITensor"] 0.88 (5%) ✅ 1.00 (1%)
["indexset", "set_functions", "uniqueinds", "3_inputs"] 0.93 (5%) ✅ 1.00 (1%)
["indexset", "set_functions", "uniqueinds", "filter_not_tags"] 0.95 (5%) ✅ 1.00 (1%)
["indexset", "set_functions", "uniqueinds", "nofilter0"] 1.09 (5%) ❌ 1.00 (1%)
["indexset", "set_functions", "uniqueinds, ITensor"] 1.19 (5%) ❌ 1.00 (1%)
["op", "op QN"] 1.10 (5%) ❌ 1.00 (1%)
["tagset", "tagset"] 1.09 (5%) ❌ 1.00 (1%)

Benchmark Group List

Here's a list of all the benchmark groups executed by this job:

  • ["autompo"]
  • ["contract"]
  • ["dmrg"]
  • ["getsetindex"]
  • ["indexset", "constructor"]
  • ["indexset", "filter"]
  • ["indexset", "set_functions"]
  • ["indexset", "set_functions", "uniqueinds"]
  • ["inplace"]
  • ["op"]
  • ["tagset"]

Julia versioninfo

Target

Julia Version 1.7.2
Commit bf53498635 (2022-02-06 15:21 UTC)
Platform Info:
  OS: Linux (x86_64-pc-linux-gnu)
      Ubuntu 20.04.4 LTS
  uname: Linux 5.11.0-1028-azure #31~20.04.2-Ubuntu SMP Tue Jan 18 08:46:15 UTC 2022 x86_64 x86_64
  CPU: Intel(R) Xeon(R) CPU E5-2673 v4 @ 2.30GHz: 
              speed         user         nice          sys         idle          irq
       #1  2294 MHz      11081 s          1 s       1390 s       4633 s          0 s
       #2  2294 MHz       7100 s          1 s        962 s       9056 s          0 s
       
  Memory: 6.7845458984375 GB (699.76953125 MB free)
  Uptime: 1719.66 sec
  Load Avg:  1.0  1.1  1.0
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-12.0.1 (ORCJIT, broadwell)

Baseline

Julia Version 1.7.2
Commit bf53498635 (2022-02-06 15:21 UTC)
Platform Info:
  OS: Linux (x86_64-pc-linux-gnu)
      Ubuntu 20.04.4 LTS
  uname: Linux 5.11.0-1028-azure #31~20.04.2-Ubuntu SMP Tue Jan 18 08:46:15 UTC 2022 x86_64 x86_64
  CPU: Intel(R) Xeon(R) CPU E5-2673 v4 @ 2.30GHz: 
              speed         user         nice          sys         idle          irq
       #1  2294 MHz      12114 s          1 s       1906 s      12228 s          0 s
       #2  2294 MHz      15472 s          1 s       1678 s       9134 s          0 s
       
  Memory: 6.7845458984375 GB (541.75 MB free)
  Uptime: 2636.68 sec
  Load Avg:  1.0  1.09  1.08
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-12.0.1 (ORCJIT, broadwell)

Target result

Benchmark Report for /home/runner/work/ITensors.jl/ITensors.jl

Job Properties

  • Time of benchmark: 30 Mar 2022 - 3:44
  • Package commit: 9d27e8
  • Julia commit: bf5349
  • Julia command flags: None
  • Environment variables: None

Results

Below is a table of this job's results, obtained by running the benchmarks.
The values listed in the ID column have the structure [parent_group, child_group, ..., key], and can be used to
index into the BaseBenchmarks suite to retrieve the corresponding benchmarks.
The percentages accompanying time and memory values in the below table are noise tolerances. The "true"
time/memory value for a given benchmark is expected to fall within this percentage of the reported value.
An empty cell means that the value was zero.

ID time GC time memory allocations
["autompo", "Quartic Hamiltonian"] 31.426 s (5%) 3.214 s 7.32 GiB (1%) 100394531
["autompo", "Quartic QN Hamiltonian"] 46.035 s (5%) 5.919 s 13.43 GiB (1%) 157723058
["contract", "heff_2site"] 7.391 ms (5%) 19.41 MiB (1%) 305
["contract", "matmul_100"] 60.704 μs (5%) 79.77 KiB (1%) 15
["contract", "matmul_20"] 4.115 μs (5%) 4.84 KiB (1%) 14
["contract", "matmul_40"] 10.900 μs (5%) 14.22 KiB (1%) 14
["contract", "matmul_60"] 28.802 μs (5%) 29.77 KiB (1%) 15
["contract", "matmul_80"] 39.402 μs (5%) 51.64 KiB (1%) 15
["contract", "matmul_inplace_100"] 51.703 μs (5%) 992 bytes (1%) 10
["contract", "matmul_inplace_20"] 2.445 μs (5%) 992 bytes (1%) 10
["contract", "matmul_inplace_40"] 7.334 μs (5%) 992 bytes (1%) 10
["contract", "matmul_inplace_60"] 20.001 μs (5%) 992 bytes (1%) 10
["contract", "matmul_inplace_80"] 34.302 μs (5%) 992 bytes (1%) 10
["dmrg", "1d_S=1_heisenberg"] 28.943 s (5%) 1.676 s 38.50 GiB (1%) 2103973
["dmrg", "1d_S=1_heisenberg_qn"] 27.030 s (5%) 1.983 s 12.76 GiB (1%) 96497258
["getsetindex", "getindex end"] 254.582 ns (5%) 512 bytes (1%) 5
["getsetindex", "getindex indval end"] 66.807 ns (5%) 256 bytes (1%) 3
["getsetindex", "getindex indval"] 72.005 ns (5%) 272 bytes (1%) 3
["getsetindex", "getindex"] 19.780 ns (5%) 16 bytes (1%) 1
["getsetindex", "setindex! end"] 284.031 ns (5%) 752 bytes (1%) 6
["getsetindex", "setindex! indval end"] 98.311 ns (5%) 464 bytes (1%) 3
["getsetindex", "setindex! indval"] 108.652 ns (5%) 480 bytes (1%) 3
["getsetindex", "setindex!"] 76.548 ns (5%) 224 bytes (1%) 1
["indexset", "constructor", "function"] 618.064 ns (5%) 1.48 KiB (1%) 11
["indexset", "constructor", "function, tuple"] 445.159 ns (5%) 1.31 KiB (1%) 7
["indexset", "filter", "function"] 220.626 ns (5%) 1.14 KiB (1%) 1
["indexset", "filter", "function, tuple"] 56.031 ns (5%) 224 bytes (1%) 1
["indexset", "filter", "kwargs"] 198.922 ns (5%) 1.14 KiB (1%) 1
["indexset", "set_functions", "commoninds, ITensor"] 597.276 ns (5%) 1.86 KiB (1%) 5
["indexset", "set_functions", "noncommoninds, ITensor"] 556.016 ns (5%) 1.86 KiB (1%) 5
["indexset", "set_functions", "prime, ITensor"] 141.911 ns (5%) 688 bytes (1%) 3
["indexset", "set_functions", "unioninds, ITensor"] 596.854 ns (5%) 2.73 KiB (1%) 6
["indexset", "set_functions", "uniqueinds", "3_inputs"] 603.863 ns (5%) 2.17 KiB (1%) 9
["indexset", "set_functions", "uniqueinds", "filter_not_tags"] 319.387 ns (5%) 864 bytes (1%) 6
["indexset", "set_functions", "uniqueinds", "filter_tags"] 179.322 ns (5%) 640 bytes (1%) 2
["indexset", "set_functions", "uniqueinds", "nofilter0"] 172.056 ns (5%) 336 bytes (1%) 2
["indexset", "set_functions", "uniqueinds", "nofilter2"] 175.422 ns (5%) 640 bytes (1%) 2
["indexset", "set_functions", "uniqueinds, ITensor"] 684.076 ns (5%) 1.84 KiB (1%) 7
["inplace", "axpy!"] 14.801 μs (5%) 1.67 KiB (1%) 22
["op", "op QN"] 12.901 μs (5%) 9.41 KiB (1%) 113
["op", "op"] 5.984 μs (5%) 3.70 KiB (1%) 46
["tagset", "tagset"] 254.642 ns (5%) 208 bytes (1%) 5
["tagset", "tagset_unicode"] 332.081 ns (5%) 208 bytes (1%) 5

Benchmark Group List

Here's a list of all the benchmark groups executed by this job:

  • ["autompo"]
  • ["contract"]
  • ["dmrg"]
  • ["getsetindex"]
  • ["indexset", "constructor"]
  • ["indexset", "filter"]
  • ["indexset", "set_functions"]
  • ["indexset", "set_functions", "uniqueinds"]
  • ["inplace"]
  • ["op"]
  • ["tagset"]

Julia versioninfo

Julia Version 1.7.2
Commit bf53498635 (2022-02-06 15:21 UTC)
Platform Info:
  OS: Linux (x86_64-pc-linux-gnu)
      Ubuntu 20.04.4 LTS
  uname: Linux 5.11.0-1028-azure #31~20.04.2-Ubuntu SMP Tue Jan 18 08:46:15 UTC 2022 x86_64 x86_64
  CPU: Intel(R) Xeon(R) CPU E5-2673 v4 @ 2.30GHz: 
              speed         user         nice          sys         idle          irq
       #1  2294 MHz      11081 s          1 s       1390 s       4633 s          0 s
       #2  2294 MHz       7100 s          1 s        962 s       9056 s          0 s
       
  Memory: 6.7845458984375 GB (699.76953125 MB free)
  Uptime: 1719.66 sec
  Load Avg:  1.0  1.1  1.0
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-12.0.1 (ORCJIT, broadwell)

Baseline result

Benchmark Report for /home/runner/work/ITensors.jl/ITensors.jl

Job Properties

  • Time of benchmark: 30 Mar 2022 - 3:59
  • Package commit: c6d425
  • Julia commit: bf5349
  • Julia command flags: None
  • Environment variables: None

Results

Below is a table of this job's results, obtained by running the benchmarks.
The values listed in the ID column have the structure [parent_group, child_group, ..., key], and can be used to
index into the BaseBenchmarks suite to retrieve the corresponding benchmarks.
The percentages accompanying time and memory values in the below table are noise tolerances. The "true"
time/memory value for a given benchmark is expected to fall within this percentage of the reported value.
An empty cell means that the value was zero.

ID time GC time memory allocations
["autompo", "Quartic Hamiltonian"] 31.144 s (5%) 3.103 s 7.32 GiB (1%) 100394577
["autompo", "Quartic QN Hamiltonian"] 46.007 s (5%) 5.991 s 13.43 GiB (1%) 157723058
["contract", "heff_2site"] 7.325 ms (5%) 19.41 MiB (1%) 305
["contract", "matmul_100"] 58.504 μs (5%) 79.77 KiB (1%) 15
["contract", "matmul_20"] 4.086 μs (5%) 4.84 KiB (1%) 14
["contract", "matmul_40"] 11.201 μs (5%) 14.22 KiB (1%) 14
["contract", "matmul_60"] 26.201 μs (5%) 29.77 KiB (1%) 15
["contract", "matmul_80"] 35.003 μs (5%) 51.64 KiB (1%) 15
["contract", "matmul_inplace_100"] 51.003 μs (5%) 992 bytes (1%) 10
["contract", "matmul_inplace_20"] 2.311 μs (5%) 992 bytes (1%) 10
["contract", "matmul_inplace_40"] 7.534 μs (5%) 992 bytes (1%) 10
["contract", "matmul_inplace_60"] 22.502 μs (5%) 992 bytes (1%) 10
["contract", "matmul_inplace_80"] 34.402 μs (5%) 992 bytes (1%) 10
["dmrg", "1d_S=1_heisenberg"] 28.807 s (5%) 1.708 s 38.50 GiB (1%) 2103973
["dmrg", "1d_S=1_heisenberg_qn"] 26.703 s (5%) 1.949 s 12.76 GiB (1%) 96497258
["getsetindex", "getindex end"] 262.347 ns (5%) 512 bytes (1%) 5
["getsetindex", "getindex indval end"] 67.934 ns (5%) 256 bytes (1%) 3
["getsetindex", "getindex indval"] 73.544 ns (5%) 272 bytes (1%) 3
["getsetindex", "getindex"] 25.404 ns (5%) 16 bytes (1%) 1
["getsetindex", "setindex! end"] 287.095 ns (5%) 752 bytes (1%) 6
["getsetindex", "setindex! indval end"] 102.019 ns (5%) 464 bytes (1%) 3
["getsetindex", "setindex! indval"] 109.613 ns (5%) 480 bytes (1%) 3
["getsetindex", "setindex!"] 82.722 ns (5%) 224 bytes (1%) 1
["indexset", "constructor", "function"] 707.605 ns (5%) 1.48 KiB (1%) 11
["indexset", "constructor", "function, tuple"] 505.164 ns (5%) 1.31 KiB (1%) 7
["indexset", "filter", "function"] 216.116 ns (5%) 1.14 KiB (1%) 1
["indexset", "filter", "function, tuple"] 57.349 ns (5%) 224 bytes (1%) 1
["indexset", "filter", "kwargs"] 197.467 ns (5%) 1.14 KiB (1%) 1
["indexset", "set_functions", "commoninds, ITensor"] 528.762 ns (5%) 1.86 KiB (1%) 5
["indexset", "set_functions", "noncommoninds, ITensor"] 633.734 ns (5%) 1.86 KiB (1%) 5
["indexset", "set_functions", "prime, ITensor"] 137.451 ns (5%) 688 bytes (1%) 3
["indexset", "set_functions", "unioninds, ITensor"] 596.854 ns (5%) 2.73 KiB (1%) 6
["indexset", "set_functions", "uniqueinds", "3_inputs"] 647.585 ns (5%) 2.17 KiB (1%) 9
["indexset", "set_functions", "uniqueinds", "filter_not_tags"] 337.860 ns (5%) 864 bytes (1%) 6
["indexset", "set_functions", "uniqueinds", "filter_tags"] 179.322 ns (5%) 640 bytes (1%) 2
["indexset", "set_functions", "uniqueinds", "nofilter0"] 158.563 ns (5%) 336 bytes (1%) 2
["indexset", "set_functions", "uniqueinds", "nofilter2"] 173.484 ns (5%) 640 bytes (1%) 2
["indexset", "set_functions", "uniqueinds, ITensor"] 576.424 ns (5%) 1.84 KiB (1%) 7
["inplace", "axpy!"] 14.401 μs (5%) 1.67 KiB (1%) 22
["op", "op QN"] 11.700 μs (5%) 9.41 KiB (1%) 113
["op", "op"] 5.934 μs (5%) 3.70 KiB (1%) 46
["tagset", "tagset"] 234.408 ns (5%) 208 bytes (1%) 5
["tagset", "tagset_unicode"] 342.129 ns (5%) 208 bytes (1%) 5

Benchmark Group List

Here's a list of all the benchmark groups executed by this job:

  • ["autompo"]
  • ["contract"]
  • ["dmrg"]
  • ["getsetindex"]
  • ["indexset", "constructor"]
  • ["indexset", "filter"]
  • ["indexset", "set_functions"]
  • ["indexset", "set_functions", "uniqueinds"]
  • ["inplace"]
  • ["op"]
  • ["tagset"]

Julia versioninfo

Julia Version 1.7.2
Commit bf53498635 (2022-02-06 15:21 UTC)
Platform Info:
  OS: Linux (x86_64-pc-linux-gnu)
      Ubuntu 20.04.4 LTS
  uname: Linux 5.11.0-1028-azure #31~20.04.2-Ubuntu SMP Tue Jan 18 08:46:15 UTC 2022 x86_64 x86_64
  CPU: Intel(R) Xeon(R) CPU E5-2673 v4 @ 2.30GHz: 
              speed         user         nice          sys         idle          irq
       #1  2294 MHz      12114 s          1 s       1906 s      12228 s          0 s
       #2  2294 MHz      15472 s          1 s       1678 s       9134 s          0 s
       
  Memory: 6.7845458984375 GB (541.75 MB free)
  Uptime: 2636.68 sec
  Load Avg:  1.0  1.09  1.08
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-12.0.1 (ORCJIT, broadwell)

Runtime information

Runtime Info
BLAS #threads 2
BLAS.vendor() openblas64
Sys.CPU_THREADS 2

lscpu output:

Architecture:                    x86_64
CPU op-mode(s):                  32-bit, 64-bit
Byte Order:                      Little Endian
Address sizes:                   46 bits physical, 48 bits virtual
CPU(s):                          2
On-line CPU(s) list:             0,1
Thread(s) per core:              1
Core(s) per socket:              2
Socket(s):                       1
NUMA node(s):                    1
Vendor ID:                       GenuineIntel
CPU family:                      6
Model:                           79
Model name:                      Intel(R) Xeon(R) CPU E5-2673 v4 @ 2.30GHz
Stepping:                        1
CPU MHz:                         2294.828
BogoMIPS:                        4589.65
Hypervisor vendor:               Microsoft
Virtualization type:             full
L1d cache:                       64 KiB
L1i cache:                       64 KiB
L2 cache:                        512 KiB
L3 cache:                        50 MiB
NUMA node0 CPU(s):               0,1
Vulnerability Itlb multihit:     KVM: Mitigation: VMX unsupported
Vulnerability L1tf:              Mitigation; PTE Inversion
Vulnerability Mds:               Mitigation; Clear CPU buffers; SMT Host state unknown
Vulnerability Meltdown:          Mitigation; PTI
Vulnerability Spec store bypass: Vulnerable
Vulnerability Spectre v1:        Mitigation; usercopy/swapgs barriers and __user pointer sanitization
Vulnerability Spectre v2:        Mitigation; Full generic retpoline, STIBP disabled, RSB filling
Vulnerability Srbds:             Not affected
Vulnerability Tsx async abort:   Mitigation; Clear CPU buffers; SMT Host state unknown
Flags:                           fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx pdpe1gb rdtscp lm constant_tsc rep_good nopl xtopology cpuid pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 movbe popcnt aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch invpcid_single pti fsgsbase bmi1 hle avx2 smep bmi2 erms invpcid rtm rdseed adx smap xsaveopt md_clear
Cpu Property Value
Brand Intel(R) Xeon(R) CPU E5-2673 v4 @ 2.30GHz
Vendor :Intel
Architecture :Broadwell
Model Family: 0x06, Model: 0x4f, Stepping: 0x01, Type: 0x00
Cores 2 physical cores, 2 logical cores (on executing CPU)
No Hyperthreading hardware capability detected
Clock Frequencies Not supported by CPU
Data Cache Level 1:3 : (32, 256, 51200) kbytes
64 byte cache line size
Address Size 48 bits virtual, 46 bits physical
SIMD 256 bit = 32 byte max. SIMD vector size
Time Stamp Counter TSC is accessible via rdtsc
TSC increased at every clock cycle (non-invariant TSC)
Perf. Monitoring Performance Monitoring Counters (PMC) are not supported
Hypervisor Yes, Microsoft

@mtfishman
Copy link
Member

mtfishman commented Mar 31, 2022

Nice and simple, thanks!

Just to clarify, is ϕ a matrix where the columns are single-particle states? So for N sites/orbitals and Nf particles it is an N x Nf matrix?

I've been trying to think of a good name for that matrix and stick to a convention. In ITensorGaussianMPS I've been referring to that matrix as a "Slater determinant" but that doesn't seem quite right, since in actuality the Slater determinant is the determinant of that matrix. Anyway, kind of an aside, but I wanted to pick your brain about that.

Maybe we could be more explicit with the names, like:

G_R -> retarded_greens_function
G_G -> greater_greens_function
G_L -> lesser_greens_function

I think I would forget what G_R was, etc.

@emstoudenmire
Copy link
Collaborator Author

Yes, I was talking with Angkun about the name of ϕ too since he was pointing out it's not really a Slater determinant. I think a good way to refer to it is calling the columns of ϕ orbitals. So we could say its the orbitals, or orbital matrix. That's somewhat a chemistry-oriented term but I think it's good. Actually, I guess the ϕ columns are also called the natural orbitals so maybe that's really the standard name.

Sure thing about changing the function names. More descriptive names are good.

You raise an interesting point about the number of particles I was meaning to mention. The way I wrote the code, you can specify the number of particles (I called it Npart - maybe it should be Nf). But you can also leave it unspecified in which case it's determined by counting how many of the single-particle energies are negative. So that's like working in the grand canonical ensemble with a zero chemical potential. Maybe that would be a nice convention to use throughout this package? (Meaning making particle number optional.)

Lastly, something I'm still wrapping my head around is that the formula for GR doesn't depend on the number of particles (however that is determined). I see how it comes through in the derivation, but it's just counterintuitive when you think of how its computed say from an MPS. The greater and lesser Green functions definitely do depend on the number of particles. (Better names for them, but which aren't standard, would be particle and hole Green functions.)

@github-actions
Copy link
Contributor

Benchmark result

Judge result

Benchmark Report for /home/runner/work/ITensors.jl/ITensors.jl

Job Properties

  • Time of benchmarks:
    • Target: 31 Mar 2022 - 03:05
    • Baseline: 31 Mar 2022 - 03:17
  • Package commits:
    • Target: 3ead40
    • Baseline: c6d425
  • Julia commits:
    • Target: bf5349
    • Baseline: bf5349
  • Julia command flags:
    • Target: None
    • Baseline: None
  • Environment variables:
    • Target: None
    • Baseline: None

Results

A ratio greater than 1.0 denotes a possible regression (marked with ❌), while a ratio less
than 1.0 denotes a possible improvement (marked with ✅). Only significant results - results
that indicate possible regressions or improvements - are shown below (thus, an empty table means that all
benchmark results remained invariant between builds).

ID time ratio memory ratio
["getsetindex", "getindex"] 1.08 (5%) ❌ 1.00 (1%)
["indexset", "filter", "kwargs"] 0.84 (5%) ✅ 1.00 (1%)
["indexset", "set_functions", "uniqueinds", "nofilter0"] 1.06 (5%) ❌ 1.00 (1%)
["tagset", "tagset"] 0.92 (5%) ✅ 1.00 (1%)

Benchmark Group List

Here's a list of all the benchmark groups executed by this job:

  • ["autompo"]
  • ["contract"]
  • ["dmrg"]
  • ["getsetindex"]
  • ["indexset", "constructor"]
  • ["indexset", "filter"]
  • ["indexset", "set_functions"]
  • ["indexset", "set_functions", "uniqueinds"]
  • ["inplace"]
  • ["op"]
  • ["tagset"]

Julia versioninfo

Target

Julia Version 1.7.2
Commit bf53498635 (2022-02-06 15:21 UTC)
Platform Info:
  OS: Linux (x86_64-pc-linux-gnu)
      Ubuntu 20.04.4 LTS
  uname: Linux 5.11.0-1028-azure #31~20.04.2-Ubuntu SMP Tue Jan 18 08:46:15 UTC 2022 x86_64 x86_64
  CPU: Intel(R) Xeon(R) Platinum 8272CL CPU @ 2.60GHz: 
              speed         user         nice          sys         idle          irq
       #1  2593 MHz       3034 s          0 s        904 s       9942 s          0 s
       #2  2593 MHz      10834 s          2 s        968 s       2121 s          0 s
       
  Memory: 6.7845458984375 GB (1235.83984375 MB free)
  Uptime: 1395.9 sec
  Load Avg:  1.0  1.08  0.93
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-12.0.1 (ORCJIT, skylake-avx512)

Baseline

Julia Version 1.7.2
Commit bf53498635 (2022-02-06 15:21 UTC)
Platform Info:
  OS: Linux (x86_64-pc-linux-gnu)
      Ubuntu 20.04.4 LTS
  uname: Linux 5.11.0-1028-azure #31~20.04.2-Ubuntu SMP Tue Jan 18 08:46:15 UTC 2022 x86_64 x86_64
  CPU: Intel(R) Xeon(R) Platinum 8272CL CPU @ 2.60GHz: 
              speed         user         nice          sys         idle          irq
       #1  2593 MHz       5967 s          0 s       1704 s      13359 s          0 s
       #2  2593 MHz      15025 s          2 s       1191 s       4857 s          0 s
       
  Memory: 6.7845458984375 GB (1133.61328125 MB free)
  Uptime: 2112.16 sec
  Load Avg:  1.0  1.08  1.02
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-12.0.1 (ORCJIT, skylake-avx512)

Target result

Benchmark Report for /home/runner/work/ITensors.jl/ITensors.jl

Job Properties

  • Time of benchmark: 31 Mar 2022 - 3:5
  • Package commit: 3ead40
  • Julia commit: bf5349
  • Julia command flags: None
  • Environment variables: None

Results

Below is a table of this job's results, obtained by running the benchmarks.
The values listed in the ID column have the structure [parent_group, child_group, ..., key], and can be used to
index into the BaseBenchmarks suite to retrieve the corresponding benchmarks.
The percentages accompanying time and memory values in the below table are noise tolerances. The "true"
time/memory value for a given benchmark is expected to fall within this percentage of the reported value.
An empty cell means that the value was zero.

ID time GC time memory allocations
["autompo", "Quartic Hamiltonian"] 24.549 s (5%) 2.721 s 7.32 GiB (1%) 100394267
["autompo", "Quartic QN Hamiltonian"] 36.204 s (5%) 5.231 s 13.43 GiB (1%) 157703969
["contract", "heff_2site"] 4.631 ms (5%) 19.41 MiB (1%) 305
["contract", "matmul_100"] 34.600 μs (5%) 79.77 KiB (1%) 15
["contract", "matmul_20"] 2.711 μs (5%) 4.84 KiB (1%) 14
["contract", "matmul_40"] 6.440 μs (5%) 14.22 KiB (1%) 14
["contract", "matmul_60"] 15.700 μs (5%) 29.77 KiB (1%) 15
["contract", "matmul_80"] 19.800 μs (5%) 51.64 KiB (1%) 15
["contract", "matmul_inplace_100"] 30.100 μs (5%) 992 bytes (1%) 10
["contract", "matmul_inplace_20"] 1.510 μs (5%) 992 bytes (1%) 10
["contract", "matmul_inplace_40"] 4.000 μs (5%) 992 bytes (1%) 10
["contract", "matmul_inplace_60"] 10.400 μs (5%) 992 bytes (1%) 10
["contract", "matmul_inplace_80"] 16.400 μs (5%) 992 bytes (1%) 10
["dmrg", "1d_S=1_heisenberg"] 18.880 s (5%) 870.529 ms 38.50 GiB (1%) 2103973
["dmrg", "1d_S=1_heisenberg_qn"] 16.727 s (5%) 1.408 s 12.76 GiB (1%) 96497450
["getsetindex", "getindex end"] 214.056 ns (5%) 512 bytes (1%) 5
["getsetindex", "getindex indval end"] 64.258 ns (5%) 256 bytes (1%) 3
["getsetindex", "getindex indval"] 63.989 ns (5%) 272 bytes (1%) 3
["getsetindex", "getindex"] 24.976 ns (5%) 16 bytes (1%) 1
["getsetindex", "setindex! end"] 276.194 ns (5%) 752 bytes (1%) 6
["getsetindex", "setindex! indval end"] 93.147 ns (5%) 464 bytes (1%) 3
["getsetindex", "setindex! indval"] 99.169 ns (5%) 480 bytes (1%) 3
["getsetindex", "setindex!"] 65.479 ns (5%) 224 bytes (1%) 1
["indexset", "constructor", "function"] 623.121 ns (5%) 1.48 KiB (1%) 11
["indexset", "constructor", "function, tuple"] 374.882 ns (5%) 1.31 KiB (1%) 7
["indexset", "filter", "function"] 152.170 ns (5%) 1.14 KiB (1%) 1
["indexset", "filter", "function, tuple"] 50.455 ns (5%) 224 bytes (1%) 1
["indexset", "filter", "kwargs"] 153.922 ns (5%) 1.14 KiB (1%) 1
["indexset", "set_functions", "commoninds, ITensor"] 422.618 ns (5%) 1.86 KiB (1%) 5
["indexset", "set_functions", "noncommoninds, ITensor"] 496.896 ns (5%) 1.86 KiB (1%) 5
["indexset", "set_functions", "prime, ITensor"] 131.849 ns (5%) 688 bytes (1%) 3
["indexset", "set_functions", "unioninds, ITensor"] 530.005 ns (5%) 2.73 KiB (1%) 6
["indexset", "set_functions", "uniqueinds", "3_inputs"] 500.005 ns (5%) 2.17 KiB (1%) 9
["indexset", "set_functions", "uniqueinds", "filter_not_tags"] 280.321 ns (5%) 864 bytes (1%) 6
["indexset", "set_functions", "uniqueinds", "filter_tags"] 175.336 ns (5%) 640 bytes (1%) 2
["indexset", "set_functions", "uniqueinds", "nofilter0"] 151.709 ns (5%) 336 bytes (1%) 2
["indexset", "set_functions", "uniqueinds", "nofilter2"] 149.886 ns (5%) 640 bytes (1%) 2
["indexset", "set_functions", "uniqueinds, ITensor"] 547.541 ns (5%) 1.84 KiB (1%) 7
["inplace", "axpy!"] 11.400 μs (5%) 1.67 KiB (1%) 22
["op", "op QN"] 8.100 μs (5%) 9.41 KiB (1%) 113
["op", "op"] 4.514 μs (5%) 3.70 KiB (1%) 46
["tagset", "tagset"] 261.724 ns (5%) 208 bytes (1%) 5
["tagset", "tagset_unicode"] 395.025 ns (5%) 208 bytes (1%) 5

Benchmark Group List

Here's a list of all the benchmark groups executed by this job:

  • ["autompo"]
  • ["contract"]
  • ["dmrg"]
  • ["getsetindex"]
  • ["indexset", "constructor"]
  • ["indexset", "filter"]
  • ["indexset", "set_functions"]
  • ["indexset", "set_functions", "uniqueinds"]
  • ["inplace"]
  • ["op"]
  • ["tagset"]

Julia versioninfo

Julia Version 1.7.2
Commit bf53498635 (2022-02-06 15:21 UTC)
Platform Info:
  OS: Linux (x86_64-pc-linux-gnu)
      Ubuntu 20.04.4 LTS
  uname: Linux 5.11.0-1028-azure #31~20.04.2-Ubuntu SMP Tue Jan 18 08:46:15 UTC 2022 x86_64 x86_64
  CPU: Intel(R) Xeon(R) Platinum 8272CL CPU @ 2.60GHz: 
              speed         user         nice          sys         idle          irq
       #1  2593 MHz       3034 s          0 s        904 s       9942 s          0 s
       #2  2593 MHz      10834 s          2 s        968 s       2121 s          0 s
       
  Memory: 6.7845458984375 GB (1235.83984375 MB free)
  Uptime: 1395.9 sec
  Load Avg:  1.0  1.08  0.93
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-12.0.1 (ORCJIT, skylake-avx512)

Baseline result

Benchmark Report for /home/runner/work/ITensors.jl/ITensors.jl

Job Properties

  • Time of benchmark: 31 Mar 2022 - 3:17
  • Package commit: c6d425
  • Julia commit: bf5349
  • Julia command flags: None
  • Environment variables: None

Results

Below is a table of this job's results, obtained by running the benchmarks.
The values listed in the ID column have the structure [parent_group, child_group, ..., key], and can be used to
index into the BaseBenchmarks suite to retrieve the corresponding benchmarks.
The percentages accompanying time and memory values in the below table are noise tolerances. The "true"
time/memory value for a given benchmark is expected to fall within this percentage of the reported value.
An empty cell means that the value was zero.

ID time GC time memory allocations
["autompo", "Quartic Hamiltonian"] 24.005 s (5%) 2.733 s 7.32 GiB (1%) 100394313
["autompo", "Quartic QN Hamiltonian"] 36.384 s (5%) 5.268 s 13.43 GiB (1%) 157703969
["contract", "heff_2site"] 4.558 ms (5%) 19.41 MiB (1%) 305
["contract", "matmul_100"] 34.400 μs (5%) 79.77 KiB (1%) 15
["contract", "matmul_20"] 2.744 μs (5%) 4.84 KiB (1%) 14
["contract", "matmul_40"] 6.520 μs (5%) 14.22 KiB (1%) 14
["contract", "matmul_60"] 15.700 μs (5%) 29.77 KiB (1%) 15
["contract", "matmul_80"] 19.802 μs (5%) 51.64 KiB (1%) 15
["contract", "matmul_inplace_100"] 30.200 μs (5%) 992 bytes (1%) 10
["contract", "matmul_inplace_20"] 1.510 μs (5%) 992 bytes (1%) 10
["contract", "matmul_inplace_40"] 3.986 μs (5%) 992 bytes (1%) 10
["contract", "matmul_inplace_60"] 10.400 μs (5%) 992 bytes (1%) 10
["contract", "matmul_inplace_80"] 16.100 μs (5%) 992 bytes (1%) 10
["dmrg", "1d_S=1_heisenberg"] 18.199 s (5%) 864.041 ms 38.50 GiB (1%) 2103973
["dmrg", "1d_S=1_heisenberg_qn"] 16.886 s (5%) 1.431 s 12.76 GiB (1%) 96497450
["getsetindex", "getindex end"] 209.011 ns (5%) 512 bytes (1%) 5
["getsetindex", "getindex indval end"] 63.952 ns (5%) 256 bytes (1%) 3
["getsetindex", "getindex indval"] 64.192 ns (5%) 272 bytes (1%) 3
["getsetindex", "getindex"] 23.069 ns (5%) 16 bytes (1%) 1
["getsetindex", "setindex! end"] 267.687 ns (5%) 752 bytes (1%) 6
["getsetindex", "setindex! indval end"] 92.731 ns (5%) 464 bytes (1%) 3
["getsetindex", "setindex! indval"] 96.779 ns (5%) 480 bytes (1%) 3
["getsetindex", "setindex!"] 64.969 ns (5%) 224 bytes (1%) 1
["indexset", "constructor", "function"] 605.786 ns (5%) 1.48 KiB (1%) 11
["indexset", "constructor", "function, tuple"] 377.340 ns (5%) 1.31 KiB (1%) 7
["indexset", "filter", "function"] 154.772 ns (5%) 1.14 KiB (1%) 1
["indexset", "filter", "function, tuple"] 51.867 ns (5%) 224 bytes (1%) 1
["indexset", "filter", "kwargs"] 182.872 ns (5%) 1.14 KiB (1%) 1
["indexset", "set_functions", "commoninds, ITensor"] 417.090 ns (5%) 1.86 KiB (1%) 5
["indexset", "set_functions", "noncommoninds, ITensor"] 496.378 ns (5%) 1.86 KiB (1%) 5
["indexset", "set_functions", "prime, ITensor"] 135.190 ns (5%) 688 bytes (1%) 3
["indexset", "set_functions", "unioninds, ITensor"] 524.742 ns (5%) 2.73 KiB (1%) 6
["indexset", "set_functions", "uniqueinds", "3_inputs"] 512.953 ns (5%) 2.17 KiB (1%) 9
["indexset", "set_functions", "uniqueinds", "filter_not_tags"] 287.622 ns (5%) 864 bytes (1%) 6
["indexset", "set_functions", "uniqueinds", "filter_tags"] 176.811 ns (5%) 640 bytes (1%) 2
["indexset", "set_functions", "uniqueinds", "nofilter0"] 142.757 ns (5%) 336 bytes (1%) 2
["indexset", "set_functions", "uniqueinds", "nofilter2"] 148.391 ns (5%) 640 bytes (1%) 2
["indexset", "set_functions", "uniqueinds, ITensor"] 543.175 ns (5%) 1.84 KiB (1%) 7
["inplace", "axpy!"] 11.400 μs (5%) 1.67 KiB (1%) 22
["op", "op QN"] 8.067 μs (5%) 9.41 KiB (1%) 113
["op", "op"] 4.371 μs (5%) 3.70 KiB (1%) 46
["tagset", "tagset"] 285.463 ns (5%) 208 bytes (1%) 5
["tagset", "tagset_unicode"] 410.940 ns (5%) 208 bytes (1%) 5

Benchmark Group List

Here's a list of all the benchmark groups executed by this job:

  • ["autompo"]
  • ["contract"]
  • ["dmrg"]
  • ["getsetindex"]
  • ["indexset", "constructor"]
  • ["indexset", "filter"]
  • ["indexset", "set_functions"]
  • ["indexset", "set_functions", "uniqueinds"]
  • ["inplace"]
  • ["op"]
  • ["tagset"]

Julia versioninfo

Julia Version 1.7.2
Commit bf53498635 (2022-02-06 15:21 UTC)
Platform Info:
  OS: Linux (x86_64-pc-linux-gnu)
      Ubuntu 20.04.4 LTS
  uname: Linux 5.11.0-1028-azure #31~20.04.2-Ubuntu SMP Tue Jan 18 08:46:15 UTC 2022 x86_64 x86_64
  CPU: Intel(R) Xeon(R) Platinum 8272CL CPU @ 2.60GHz: 
              speed         user         nice          sys         idle          irq
       #1  2593 MHz       5967 s          0 s       1704 s      13359 s          0 s
       #2  2593 MHz      15025 s          2 s       1191 s       4857 s          0 s
       
  Memory: 6.7845458984375 GB (1133.61328125 MB free)
  Uptime: 2112.16 sec
  Load Avg:  1.0  1.08  1.02
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-12.0.1 (ORCJIT, skylake-avx512)

Runtime information

Runtime Info
BLAS #threads 2
BLAS.vendor() openblas64
Sys.CPU_THREADS 2

lscpu output:

Architecture:                    x86_64
CPU op-mode(s):                  32-bit, 64-bit
Byte Order:                      Little Endian
Address sizes:                   46 bits physical, 48 bits virtual
CPU(s):                          2
On-line CPU(s) list:             0,1
Thread(s) per core:              1
Core(s) per socket:              2
Socket(s):                       1
NUMA node(s):                    1
Vendor ID:                       GenuineIntel
CPU family:                      6
Model:                           85
Model name:                      Intel(R) Xeon(R) Platinum 8272CL CPU @ 2.60GHz
Stepping:                        7
CPU MHz:                         2593.907
BogoMIPS:                        5187.81
Hypervisor vendor:               Microsoft
Virtualization type:             full
L1d cache:                       64 KiB
L1i cache:                       64 KiB
L2 cache:                        2 MiB
L3 cache:                        35.8 MiB
NUMA node0 CPU(s):               0,1
Vulnerability Itlb multihit:     KVM: Mitigation: VMX unsupported
Vulnerability L1tf:              Mitigation; PTE Inversion
Vulnerability Mds:               Mitigation; Clear CPU buffers; SMT Host state unknown
Vulnerability Meltdown:          Mitigation; PTI
Vulnerability Spec store bypass: Vulnerable
Vulnerability Spectre v1:        Mitigation; usercopy/swapgs barriers and __user pointer sanitization
Vulnerability Spectre v2:        Mitigation; Full generic retpoline, STIBP disabled, RSB filling
Vulnerability Srbds:             Not affected
Vulnerability Tsx async abort:   Mitigation; Clear CPU buffers; SMT Host state unknown
Flags:                           fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx pdpe1gb rdtscp lm constant_tsc rep_good nopl xtopology cpuid pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 movbe popcnt aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch invpcid_single pti fsgsbase bmi1 hle avx2 smep bmi2 erms invpcid rtm mpx avx512f avx512dq rdseed adx smap clflushopt avx512cd avx512bw avx512vl xsaveopt xsavec xsaves md_clear
Cpu Property Value
Brand Intel(R) Xeon(R) Platinum 8272CL CPU @ 2.60GHz
Vendor :Intel
Architecture :Skylake
Model Family: 0x06, Model: 0x55, Stepping: 0x07, Type: 0x00
Cores 2 physical cores, 2 logical cores (on executing CPU)
No Hyperthreading hardware capability detected
Clock Frequencies Not supported by CPU
Data Cache Level 1:3 : (32, 1024, 36608) kbytes
64 byte cache line size
Address Size 48 bits virtual, 46 bits physical
SIMD 512 bit = 64 byte max. SIMD vector size
Time Stamp Counter TSC is accessible via rdtsc
TSC increased at every clock cycle (non-invariant TSC)
Perf. Monitoring Performance Monitoring Counters (PMC) are not supported
Hypervisor Yes, Microsoft

@mtfishman
Copy link
Member

I think my main issue with using "orbitals" or "natural orbitals" is not just that it is chemistry oriented, but that it seems to imply something about where they came from (like they were the result of a Hartree-Fock calculation, are somehow related to atoms or molecules, etc. whereas they could just be any set of single-particle states).

I guess "orbital" (as opposed to "natural orbital") is a more general term but it still feels very loaded to me. However, the only alternative I can think of is something like "single particle states", which is a mouthful.

So for example the options I can think of are:

slater_determinant_to_mps(s, Φ; blocksize=4) # Current interface
orbitals_to_mps(s, Φ; blocksize=4)
orbital_matrix_to_mps(s, Φ; blocksize=4)
single_particle_states_to_mps(s, Φ; blocksize=4)

Even though single_particle_states_to_mps is longer personally I like it better since I often have to remind myself of what "orbitals" are, and to find out you get hit with articles like this: https://en.wikipedia.org/wiki/Atomic_orbital or https://www.britannica.com/science/orbital which immediately invokes 3D atomic systems and doesn't seem to ever really tell you what they are in a general sense (i.e. the math definition that they are just a set of single-particle states).

Also, what about:

retarded_green_function -> retarded_greens_function
greater_green_function -> greater_greens_function
lesser_green_function -> lesser_greens_function

since they are called "Green's functions" (I changed my post above to reflect that).

I was going to suggest nparticles or nfermions as the name of the keyword argument instead of Npart, to keep with the lower-case convention and be more explicit (Npart could be interpreted as "N parts", like you are splitting up the system into N different parts in a real-space sense). I guess it would be nice to anticipate in the interface that we will want to handle Bosons in the future and consider where we use the term "particles" or "fermions", but for now we could just use either one.

I had also gone back and forth about passing around:

  1. Just the occupied single particle states (obviously not sufficient in many cases).
  2. All of the single particle states and the number of particles.
  3. All of the single particle states and the occupations of each state.
  4. All of single particle states and using the energy as a way to determine the occupation.

However, you don't always have the Hamiltonian, so you wouldn't always know the energies. Also, there may be cases where the single-particle states aren't ordered by occupation (for example a GMPS, where they generally alternate between occupied and unoccupied). So maybe it needs to be handled by context. Really the most general format is option 3., an N x N matrix of occupied and unoccupied single particle states along with a vector of length N of the occupations (which could also cover the case when they are partially occupied). We could consider making a type:

struct SingleParticleStates{T}
  states::Matrix{T}
  occupations::Vector{T}
end

Before I was putting things together piece by piece, but I think it's good to hash out these design choices as we start adding more functionality. One thing I definitely like is being able to use OpSum as a common Hamiltonian format!
which would be a common format to use internally (and maybe exposed externally in places?).

@emstoudenmire
Copy link
Collaborator Author

Good points.

My thought about the term "orbitals" is that while it does originate from chemistry, I think it's an example where that field has come up with a nice term, while condensed matter has not. (E.g. "single-particle eigenstates" is too long.) We could call the columns of Φ "states" perhaps.

A small point is that I'm fairly sure the natural orbitals are not tied to Hartree-Fock per se. Rather, they are the orbitals that diagonalize the correlation matrix <cdag_i c_j>. So the connection to Hartree-Fock is only if one gets a Slater det that way, and then one can talk about that Slater det's natural orbitals.

In short, I personally like "orbitals" and think people would get used to it. But I'm ok with "single-particle states" as a backup since it would definitely be clear to everyone what is meant. Maybe there's a third option.

Yes to something like nparticles or npart (maybe nparticles is best) and not being specific about fermions or bosons.

The question about what to pass around is kind of tricky. I would advocate being as flexible about it as makes sense. One point is that sometimes we know the energies have to be passed: this is the case for any time-dependent quantity. Also the unoccupied states are sometimes essential, such as for the retarded and greater Green functions.

Left to my own devices, I probably would have done this:

  1. if only the orbitals are passed, then assume they are all occupied (i.e. that the user already sliced the columns down to what they wanted)
  2. if only the orbitals and number of particles is passed, then it's clear what to do
  3. if the orbitals and energy is passed, then determine number of particles from counting negative energies unless the number of particles is specified

One thing I like about the above is that the user could always keep all the orbitals around if they wish, and not have to mess with slicing columns, and can control things automatically through the energy or manually with nparticles. I guess the down sides of it are that it could be a little too "magical" and hidden and error prone. But I do think the setting of assuming negative energies are filled is really common in single-particle physics.

Your idea of a struct with occupations is really good though because it makes it explicit to the user that they are making a choice, versus having some implicit thing. Also it allows the occupancies to be fractional which could become important!

The most minor point for me is the Green's versus Green function naming question. More and more I like calling them Green functions (similar to how we say Bessel functions, not Bessel's functions) and I think the 's comes just from the fact that Green sounds like an adjective by itself. But I do think Green's is the more common usage that I hear.

@mtfishman
Copy link
Member

Agreed that "orbitals" and "natural orbitals" have more general definitions, my main gripe with them is that they seem to be very closely tied to algorithms like Hartree-Fock whenever they are presented, and in those contexts are often not well defined (I really wish chemists would just use second quantization and define things more carefully...).

Anyway, griping aside, let's go with "orbital" as the terminology but just make sure to define it well, and in the docs say things like "the input is a matrix of orbitals (single particle states) [...]".

Agreed with your general proposal for having flexible inputs (i.e. allow people to pass the minimal information needed).

If we go with the "orbitals" terminology, then the type could be:

struct Orbitals{T,R}
  states::Matrix{T}
  occupations::Vector{R}
end

This struct could act as a common internal data structure, and an optional external interface. For example we might have a function that can accept a variety of inputs as you propose (orbitals and a Hamiltonian, orbitals and number of particles, just occupied orbitals, an Orbitals object, etc.) but to keep the code sane we can make wrapper functions that all convert to the Orbitals type internally, and the core function is implemented in terms of a function with an Orbitals input.

Similarly, I have been considering defining a type:

struct CorrelationMatrix{T}
  correlation_matrix::Matrix{T}
end

which again would be mostly for internal use to help with code organization, so we could define things like CorrelationMatrix(::Orbitals) since oftentimes inside the package functions can accept orbitals as an input but then the driver code is written in terms of a correlation matrix. Again, this could be hidden from the user and could mostly be for internal use.

In general I prefer not to have a proliferation of types and/or expose users to too many different types, but in this case there are many objects which are all matrices that can be converted to each other in one way or another so I think types can be used to help distinguish them and avoid a proliferation of function names.

As for *_green_function vs. *_greens_function, that is an interesting analogy to "Bessel functions" which I hadn't thought of... Even so, I would prefer to stick to the more common terminology (I don't think this package will be the one to change the hearts and minds of the community, so better off making it feel more familiar to people).

@github-actions
Copy link
Contributor

github-actions bot commented Apr 6, 2022

Benchmark result

Judge result

Benchmark Report for /home/runner/work/ITensors.jl/ITensors.jl

Job Properties

  • Time of benchmarks:
    • Target: 6 Apr 2022 - 20:10
    • Baseline: 6 Apr 2022 - 20:23
  • Package commits:
    • Target: bcc38b
    • Baseline: 6053df
  • Julia commits:
    • Target: bf5349
    • Baseline: bf5349
  • Julia command flags:
    • Target: None
    • Baseline: None
  • Environment variables:
    • Target: None
    • Baseline: None

Results

A ratio greater than 1.0 denotes a possible regression (marked with ❌), while a ratio less
than 1.0 denotes a possible improvement (marked with ✅). Only significant results - results
that indicate possible regressions or improvements - are shown below (thus, an empty table means that all
benchmark results remained invariant between builds).

ID time ratio memory ratio
["dmrg", "1d_S=1_heisenberg"] 0.94 (5%) ✅ 1.00 (1%)
["indexset", "constructor", "function"] 1.14 (5%) ❌ 1.00 (1%)
["indexset", "filter", "function"] 1.08 (5%) ❌ 1.00 (1%)
["indexset", "set_functions", "uniqueinds", "3_inputs"] 1.06 (5%) ❌ 1.00 (1%)

Benchmark Group List

Here's a list of all the benchmark groups executed by this job:

  • ["autompo"]
  • ["contract"]
  • ["dmrg"]
  • ["getsetindex"]
  • ["indexset", "constructor"]
  • ["indexset", "filter"]
  • ["indexset", "set_functions"]
  • ["indexset", "set_functions", "uniqueinds"]
  • ["inplace"]
  • ["op"]
  • ["tagset"]

Julia versioninfo

Target

Julia Version 1.7.2
Commit bf53498635 (2022-02-06 15:21 UTC)
Platform Info:
  OS: Linux (x86_64-pc-linux-gnu)
      Ubuntu 20.04.4 LTS
  uname: Linux 5.13.0-1017-azure #19~20.04.1-Ubuntu SMP Mon Mar 7 11:34:26 UTC 2022 x86_64 x86_64
  CPU: Intel(R) Xeon(R) Platinum 8272CL CPU @ 2.60GHz: 
              speed         user         nice          sys         idle          irq
       #1  2593 MHz       3478 s          2 s        913 s      11401 s          0 s
       #2  2593 MHz      11011 s          0 s        968 s       3852 s          0 s
       
  Memory: 6.7836151123046875 GB (1674.69140625 MB free)
  Uptime: 1586.79 sec
  Load Avg:  1.0  1.05  0.93
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-12.0.1 (ORCJIT, skylake-avx512)

Baseline

Julia Version 1.7.2
Commit bf53498635 (2022-02-06 15:21 UTC)
Platform Info:
  OS: Linux (x86_64-pc-linux-gnu)
      Ubuntu 20.04.4 LTS
  uname: Linux 5.13.0-1017-azure #19~20.04.1-Ubuntu SMP Mon Mar 7 11:34:26 UTC 2022 x86_64 x86_64
  CPU: Intel(R) Xeon(R) Platinum 8272CL CPU @ 2.60GHz: 
              speed         user         nice          sys         idle          irq
       #1  2593 MHz       4313 s          2 s       1281 s      17859 s          0 s
       #2  2593 MHz      17912 s          0 s       1575 s       4021 s          0 s
       
  Memory: 6.7836151123046875 GB (952.92578125 MB free)
  Uptime: 2354.6 sec
  Load Avg:  1.06  1.08  1.02
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-12.0.1 (ORCJIT, skylake-avx512)

Target result

Benchmark Report for /home/runner/work/ITensors.jl/ITensors.jl

Job Properties

  • Time of benchmark: 6 Apr 2022 - 20:10
  • Package commit: bcc38b
  • Julia commit: bf5349
  • Julia command flags: None
  • Environment variables: None

Results

Below is a table of this job's results, obtained by running the benchmarks.
The values listed in the ID column have the structure [parent_group, child_group, ..., key], and can be used to
index into the BaseBenchmarks suite to retrieve the corresponding benchmarks.
The percentages accompanying time and memory values in the below table are noise tolerances. The "true"
time/memory value for a given benchmark is expected to fall within this percentage of the reported value.
An empty cell means that the value was zero.

ID time GC time memory allocations
["autompo", "Quartic Hamiltonian"] 25.378 s (5%) 3.192 s 7.32 GiB (1%) 100394456
["autompo", "Quartic QN Hamiltonian"] 37.208 s (5%) 5.836 s 13.42 GiB (1%) 157626756
["contract", "heff_2site"] 5.267 ms (5%) 19.41 MiB (1%) 305
["contract", "matmul_100"] 35.201 μs (5%) 79.77 KiB (1%) 15
["contract", "matmul_20"] 2.778 μs (5%) 4.84 KiB (1%) 14
["contract", "matmul_40"] 6.560 μs (5%) 14.22 KiB (1%) 14
["contract", "matmul_60"] 15.500 μs (5%) 29.77 KiB (1%) 15
["contract", "matmul_80"] 20.401 μs (5%) 51.64 KiB (1%) 15
["contract", "matmul_inplace_100"] 30.300 μs (5%) 992 bytes (1%) 10
["contract", "matmul_inplace_20"] 1.460 μs (5%) 992 bytes (1%) 10
["contract", "matmul_inplace_40"] 3.938 μs (5%) 992 bytes (1%) 10
["contract", "matmul_inplace_60"] 10.300 μs (5%) 992 bytes (1%) 10
["contract", "matmul_inplace_80"] 16.600 μs (5%) 992 bytes (1%) 10
["dmrg", "1d_S=1_heisenberg"] 19.200 s (5%) 988.925 ms 38.50 GiB (1%) 2103973
["dmrg", "1d_S=1_heisenberg_qn"] 17.073 s (5%) 1.621 s 12.76 GiB (1%) 96497258
["getsetindex", "getindex end"] 212.503 ns (5%) 512 bytes (1%) 5
["getsetindex", "getindex indval end"] 64.119 ns (5%) 256 bytes (1%) 3
["getsetindex", "getindex indval"] 69.145 ns (5%) 272 bytes (1%) 3
["getsetindex", "getindex"] 23.470 ns (5%) 16 bytes (1%) 1
["getsetindex", "setindex! end"] 289.756 ns (5%) 752 bytes (1%) 6
["getsetindex", "setindex! indval end"] 98.752 ns (5%) 464 bytes (1%) 3
["getsetindex", "setindex! indval"] 105.848 ns (5%) 480 bytes (1%) 3
["getsetindex", "setindex!"] 71.080 ns (5%) 224 bytes (1%) 1
["indexset", "constructor", "function"] 690.148 ns (5%) 1.48 KiB (1%) 11
["indexset", "constructor", "function, tuple"] 389.609 ns (5%) 1.31 KiB (1%) 7
["indexset", "filter", "function"] 177.999 ns (5%) 1.14 KiB (1%) 1
["indexset", "filter", "function, tuple"] 56.610 ns (5%) 224 bytes (1%) 1
["indexset", "filter", "kwargs"] 163.106 ns (5%) 1.14 KiB (1%) 1
["indexset", "set_functions", "commoninds, ITensor"] 431.823 ns (5%) 1.86 KiB (1%) 5
["indexset", "set_functions", "noncommoninds, ITensor"] 514.141 ns (5%) 1.86 KiB (1%) 5
["indexset", "set_functions", "prime, ITensor"] 153.802 ns (5%) 688 bytes (1%) 3
["indexset", "set_functions", "unioninds, ITensor"] 556.762 ns (5%) 2.73 KiB (1%) 6
["indexset", "set_functions", "uniqueinds", "3_inputs"] 526.809 ns (5%) 2.17 KiB (1%) 9
["indexset", "set_functions", "uniqueinds", "filter_not_tags"] 279.738 ns (5%) 864 bytes (1%) 6
["indexset", "set_functions", "uniqueinds", "filter_tags"] 179.004 ns (5%) 640 bytes (1%) 2
["indexset", "set_functions", "uniqueinds", "nofilter0"] 144.859 ns (5%) 336 bytes (1%) 2
["indexset", "set_functions", "uniqueinds", "nofilter2"] 156.444 ns (5%) 640 bytes (1%) 2
["indexset", "set_functions", "uniqueinds, ITensor"] 588.770 ns (5%) 1.84 KiB (1%) 7
["inplace", "axpy!"] 13.000 μs (5%) 1.67 KiB (1%) 22
["op", "op QN"] 7.800 μs (5%) 9.41 KiB (1%) 113
["op", "op"] 4.443 μs (5%) 3.70 KiB (1%) 46
["tagset", "tagset"] 264.353 ns (5%) 208 bytes (1%) 5
["tagset", "tagset_unicode"] 397.517 ns (5%) 208 bytes (1%) 5

Benchmark Group List

Here's a list of all the benchmark groups executed by this job:

  • ["autompo"]
  • ["contract"]
  • ["dmrg"]
  • ["getsetindex"]
  • ["indexset", "constructor"]
  • ["indexset", "filter"]
  • ["indexset", "set_functions"]
  • ["indexset", "set_functions", "uniqueinds"]
  • ["inplace"]
  • ["op"]
  • ["tagset"]

Julia versioninfo

Julia Version 1.7.2
Commit bf53498635 (2022-02-06 15:21 UTC)
Platform Info:
  OS: Linux (x86_64-pc-linux-gnu)
      Ubuntu 20.04.4 LTS
  uname: Linux 5.13.0-1017-azure #19~20.04.1-Ubuntu SMP Mon Mar 7 11:34:26 UTC 2022 x86_64 x86_64
  CPU: Intel(R) Xeon(R) Platinum 8272CL CPU @ 2.60GHz: 
              speed         user         nice          sys         idle          irq
       #1  2593 MHz       3478 s          2 s        913 s      11401 s          0 s
       #2  2593 MHz      11011 s          0 s        968 s       3852 s          0 s
       
  Memory: 6.7836151123046875 GB (1674.69140625 MB free)
  Uptime: 1586.79 sec
  Load Avg:  1.0  1.05  0.93
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-12.0.1 (ORCJIT, skylake-avx512)

Baseline result

Benchmark Report for /home/runner/work/ITensors.jl/ITensors.jl

Job Properties

  • Time of benchmark: 6 Apr 2022 - 20:23
  • Package commit: 6053df
  • Julia commit: bf5349
  • Julia command flags: None
  • Environment variables: None

Results

Below is a table of this job's results, obtained by running the benchmarks.
The values listed in the ID column have the structure [parent_group, child_group, ..., key], and can be used to
index into the BaseBenchmarks suite to retrieve the corresponding benchmarks.
The percentages accompanying time and memory values in the below table are noise tolerances. The "true"
time/memory value for a given benchmark is expected to fall within this percentage of the reported value.
An empty cell means that the value was zero.

ID time GC time memory allocations
["autompo", "Quartic Hamiltonian"] 25.707 s (5%) 3.213 s 7.32 GiB (1%) 100394502
["autompo", "Quartic QN Hamiltonian"] 38.050 s (5%) 5.823 s 13.42 GiB (1%) 157626756
["contract", "heff_2site"] 5.481 ms (5%) 19.41 MiB (1%) 305
["contract", "matmul_100"] 34.300 μs (5%) 79.77 KiB (1%) 15
["contract", "matmul_20"] 2.756 μs (5%) 4.84 KiB (1%) 14
["contract", "matmul_40"] 6.520 μs (5%) 14.22 KiB (1%) 14
["contract", "matmul_60"] 15.301 μs (5%) 29.77 KiB (1%) 15
["contract", "matmul_80"] 20.000 μs (5%) 51.64 KiB (1%) 15
["contract", "matmul_inplace_100"] 30.500 μs (5%) 992 bytes (1%) 10
["contract", "matmul_inplace_20"] 1.400 μs (5%) 992 bytes (1%) 10
["contract", "matmul_inplace_40"] 3.900 μs (5%) 992 bytes (1%) 10
["contract", "matmul_inplace_60"] 10.300 μs (5%) 992 bytes (1%) 10
["contract", "matmul_inplace_80"] 16.600 μs (5%) 992 bytes (1%) 10
["dmrg", "1d_S=1_heisenberg"] 20.334 s (5%) 1.180 s 38.50 GiB (1%) 2103973
["dmrg", "1d_S=1_heisenberg_qn"] 17.116 s (5%) 1.640 s 12.76 GiB (1%) 96497258
["getsetindex", "getindex end"] 216.668 ns (5%) 512 bytes (1%) 5
["getsetindex", "getindex indval end"] 67.483 ns (5%) 256 bytes (1%) 3
["getsetindex", "getindex indval"] 69.146 ns (5%) 272 bytes (1%) 3
["getsetindex", "getindex"] 23.671 ns (5%) 16 bytes (1%) 1
["getsetindex", "setindex! end"] 287.989 ns (5%) 752 bytes (1%) 6
["getsetindex", "setindex! indval end"] 97.296 ns (5%) 464 bytes (1%) 3
["getsetindex", "setindex! indval"] 102.402 ns (5%) 480 bytes (1%) 3
["getsetindex", "setindex!"] 70.469 ns (5%) 224 bytes (1%) 1
["indexset", "constructor", "function"] 602.824 ns (5%) 1.48 KiB (1%) 11
["indexset", "constructor", "function, tuple"] 387.629 ns (5%) 1.31 KiB (1%) 7
["indexset", "filter", "function"] 165.164 ns (5%) 1.14 KiB (1%) 1
["indexset", "filter", "function, tuple"] 55.399 ns (5%) 224 bytes (1%) 1
["indexset", "filter", "kwargs"] 160.889 ns (5%) 1.14 KiB (1%) 1
["indexset", "set_functions", "commoninds, ITensor"] 431.823 ns (5%) 1.86 KiB (1%) 5
["indexset", "set_functions", "noncommoninds, ITensor"] 511.524 ns (5%) 1.86 KiB (1%) 5
["indexset", "set_functions", "prime, ITensor"] 148.220 ns (5%) 688 bytes (1%) 3
["indexset", "set_functions", "unioninds, ITensor"] 561.086 ns (5%) 2.73 KiB (1%) 6
["indexset", "set_functions", "uniqueinds", "3_inputs"] 498.979 ns (5%) 2.17 KiB (1%) 9
["indexset", "set_functions", "uniqueinds", "filter_not_tags"] 279.738 ns (5%) 864 bytes (1%) 6
["indexset", "set_functions", "uniqueinds", "filter_tags"] 177.681 ns (5%) 640 bytes (1%) 2
["indexset", "set_functions", "uniqueinds", "nofilter0"] 145.934 ns (5%) 336 bytes (1%) 2
["indexset", "set_functions", "uniqueinds", "nofilter2"] 156.320 ns (5%) 640 bytes (1%) 2
["indexset", "set_functions", "uniqueinds, ITensor"] 588.208 ns (5%) 1.84 KiB (1%) 7
["inplace", "axpy!"] 12.900 μs (5%) 1.67 KiB (1%) 22
["op", "op QN"] 8.067 μs (5%) 9.41 KiB (1%) 113
["op", "op"] 4.429 μs (5%) 3.70 KiB (1%) 46
["tagset", "tagset"] 262.239 ns (5%) 208 bytes (1%) 5
["tagset", "tagset_unicode"] 394.532 ns (5%) 208 bytes (1%) 5

Benchmark Group List

Here's a list of all the benchmark groups executed by this job:

  • ["autompo"]
  • ["contract"]
  • ["dmrg"]
  • ["getsetindex"]
  • ["indexset", "constructor"]
  • ["indexset", "filter"]
  • ["indexset", "set_functions"]
  • ["indexset", "set_functions", "uniqueinds"]
  • ["inplace"]
  • ["op"]
  • ["tagset"]

Julia versioninfo

Julia Version 1.7.2
Commit bf53498635 (2022-02-06 15:21 UTC)
Platform Info:
  OS: Linux (x86_64-pc-linux-gnu)
      Ubuntu 20.04.4 LTS
  uname: Linux 5.13.0-1017-azure #19~20.04.1-Ubuntu SMP Mon Mar 7 11:34:26 UTC 2022 x86_64 x86_64
  CPU: Intel(R) Xeon(R) Platinum 8272CL CPU @ 2.60GHz: 
              speed         user         nice          sys         idle          irq
       #1  2593 MHz       4313 s          2 s       1281 s      17859 s          0 s
       #2  2593 MHz      17912 s          0 s       1575 s       4021 s          0 s
       
  Memory: 6.7836151123046875 GB (952.92578125 MB free)
  Uptime: 2354.6 sec
  Load Avg:  1.06  1.08  1.02
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-12.0.1 (ORCJIT, skylake-avx512)

Runtime information

Runtime Info
BLAS #threads 2
BLAS.vendor() openblas64
Sys.CPU_THREADS 2

lscpu output:

Architecture:                    x86_64
CPU op-mode(s):                  32-bit, 64-bit
Byte Order:                      Little Endian
Address sizes:                   46 bits physical, 48 bits virtual
CPU(s):                          2
On-line CPU(s) list:             0,1
Thread(s) per core:              1
Core(s) per socket:              2
Socket(s):                       1
NUMA node(s):                    1
Vendor ID:                       GenuineIntel
CPU family:                      6
Model:                           85
Model name:                      Intel(R) Xeon(R) Platinum 8272CL CPU @ 2.60GHz
Stepping:                        7
CPU MHz:                         2593.905
BogoMIPS:                        5187.81
Hypervisor vendor:               Microsoft
Virtualization type:             full
L1d cache:                       64 KiB
L1i cache:                       64 KiB
L2 cache:                        2 MiB
L3 cache:                        35.8 MiB
NUMA node0 CPU(s):               0,1
Vulnerability Itlb multihit:     KVM: Mitigation: VMX unsupported
Vulnerability L1tf:              Mitigation; PTE Inversion
Vulnerability Mds:               Mitigation; Clear CPU buffers; SMT Host state unknown
Vulnerability Meltdown:          Mitigation; PTI
Vulnerability Spec store bypass: Vulnerable
Vulnerability Spectre v1:        Mitigation; usercopy/swapgs barriers and __user pointer sanitization
Vulnerability Spectre v2:        Mitigation; Retpolines, STIBP disabled, RSB filling
Vulnerability Srbds:             Not affected
Vulnerability Tsx async abort:   Mitigation; Clear CPU buffers; SMT Host state unknown
Flags:                           fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx pdpe1gb rdtscp lm constant_tsc rep_good nopl xtopology cpuid pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 movbe popcnt aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch invpcid_single pti fsgsbase bmi1 hle avx2 smep bmi2 erms invpcid rtm mpx avx512f avx512dq rdseed adx smap clflushopt avx512cd avx512bw avx512vl xsaveopt xsavec xsaves md_clear
Cpu Property Value
Brand Intel(R) Xeon(R) Platinum 8272CL CPU @ 2.60GHz
Vendor :Intel
Architecture :Skylake
Model Family: 0x06, Model: 0x55, Stepping: 0x07, Type: 0x00
Cores 2 physical cores, 2 logical cores (on executing CPU)
No Hyperthreading hardware capability detected
Clock Frequencies Not supported by CPU
Data Cache Level 1:3 : (32, 1024, 36608) kbytes
64 byte cache line size
Address Size 48 bits virtual, 46 bits physical
SIMD 512 bit = 64 byte max. SIMD vector size
Time Stamp Counter TSC is accessible via rdtsc
TSC increased at every clock cycle (non-invariant TSC)
Perf. Monitoring Performance Monitoring Counters (PMC) are not supported
Hypervisor Yes, Microsoft

@emstoudenmire
Copy link
Collaborator Author

These types are a good idea here because I've had trouble too with different matrices floating around in non-interacting calculations and getting worried that I'm mixing them up, or mixing up the meaning of rows and columns etc. The Orbitals type here, bundling the occupations, is especially nice because it lets some of those automatic features happen while being explicit about it. But even better it allows things like using only the occupied orbitals while still keeping the unoccupied ones around, which are necessary for certain dynamical properties. Lastly, it lets us have fractional occupations which is neat.

I also just took a look at the Fermi.jl and PySCF documentation. Fermi uses the term orbitals in the context of Hartree-Fock and doesn't mention the term elsewhere, but also has very minimal docs. PySCF does seem to use the term orbitals very liberally, referring also to "correlated orbitals" and "localized orbitals" in the context of various algorithms like coupled cluster and so on. So I think it's a pretty safe term to use in a general sense.

I'm totally ok with *_greens_function, just fighting my losing battle for Green function :^) I see the usage "Green's function" a lot more often. Maybe I can get back at people by saying "Bessel's function" and similar ha.

@mtfishman
Copy link
Member

mtfishman commented Apr 20, 2022

After discussing with Miles, the conclusion was to define a type SlaterDeterminant:

struct SlaterDeterminant{S,T}
  orbitals::Matrix{S}
  occupations::Vector{T}
end

The occupied and unoccupied orbitals (single-particle basis states) of the Slater determinant (free fermion state) are stored as columns of the square orbitals matrix.

Then, the interface for making an MPS from a Slater determinant would change from:

N = 20
Nf = N÷2
t = 1.0
h = Hermitian(diagm(1 => fill(-t, N-1), -1 => fill(-t, N-1)))
_, u = eigen(h)
Φ = u[:, 1:Nf]

ψ0 = slater_determinant_to_mps(s, Φ; blocksize = 4)

to:

MPS(SlaterDeterminant(Φ), s; blocksize = 4)

The SlaterDeterminant type would have a few different constructors, such as:

SlaterDeterminant::Matrix) # (N, Nf) = size(Φ), fills in the unoccupied orbitals with a full QR decomposition
SlaterDeterminant::Matrix, Nf::Int) # (N, N) = size(Φ)
SlaterDeterminant::Matrix, occupations::Vector{Int}) # Nf = count(isone, occupations)

@mtfishman mtfishman changed the title Add time-dependent Green functions [ITensorGaussianMPS] Add time-dependent Green functions Feb 10, 2023
@mtfishman mtfishman added mps Issues related to MPS/MPO functionality ITensorGaussianMPS Issues related to the ITensorGaussianMPS package labels May 6, 2024
@mtfishman
Copy link
Member

I'm trying to clear out old PRs and issues. ITensorGaussianMPS.jl is now in the repository https://github.com/ITensor/ITensorGaussianMPS.jl so this should get moved over there once we are ready, I'll close this for now but we can keep the branch as a reference.

@emstoudenmire
Copy link
Collaborator Author

Not a problem. In hindsight, since these functions don't do anything specific to MPS it might even be better for them to live in a separate package. They can be super useful for e.g. benchmarking time-dependent codes though and have nice clean formulas. So it would be a good thing to come back to sometime.

@mtfishman
Copy link
Member

Yes, that's a good point. Ideally there would be a separate Gaussian state package that is independent of ITensor entirely, which could use OpSum as a nice interface for symbolic representions of quadratic Hamiltonians. Splitting off ITensorMPS and eventually ITensors.LazyApply and ITensors.Ops all help move things in that direction.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ITensorGaussianMPS Issues related to the ITensorGaussianMPS package mps Issues related to MPS/MPO functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants