Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ tensor4all-itensorlike = { git = "https://github.com/tensor4all/tensor4all-rs",
tensor4all-partitionedtt = { git = "https://github.com/tensor4all/tensor4all-rs", rev = "9e9aedaebe0d3918b34dd399ff0981e337f3835b", package = "tensor4all-partitionedtt" }
tensor4all-partitionedtreetn = { git = "https://github.com/tensor4all/tensor4all-rs", rev = "9e9aedaebe0d3918b34dd399ff0981e337f3835b", package = "tensor4all-partitionedtreetn" }
tensor4all-quanticstci = { git = "https://github.com/tensor4all/tensor4all-rs", rev = "9e9aedaebe0d3918b34dd399ff0981e337f3835b", package = "tensor4all-quanticstci" }
tensor4all-interpolativeqtt = { git = "https://github.com/tensor4all/tensor4all-rs", rev = "9e9aedaebe0d3918b34dd399ff0981e337f3835b", package = "tensor4all-interpolativeqtt" }
tensor4all-hdf5 = { git = "https://github.com/tensor4all/tensor4all-rs", rev = "9e9aedaebe0d3918b34dd399ff0981e337f3835b", package = "tensor4all-hdf5" }
tensor4all-core = { git = "https://github.com/tensor4all/tensor4all-rs", rev = "9e9aedaebe0d3918b34dd399ff0981e337f3835b", package = "tensor4all-core" }
num-complex = "0.4"
Expand Down
19 changes: 17 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ revision that produced it. The pinned `tensor4all-rs` revision lives in `Cargo.t
| 3. `elementwise_gauss2d` | Elementwise product of two 2D quantics Gaussian mixtures at a fixed output budget, swept over bits per variable `R`, against the exact pointwise product | [description](#case-3-elementwise-product-of-2d-quantics-gaussian-mixtures) | [`src/bin/elementwise_gauss2d.rs`](src/bin/elementwise_gauss2d.rs) | [`result/mac-cpu/elementwise_gauss2d.md`](result/mac-cpu/elementwise_gauss2d.md) | [time](result/mac-cpu/elementwise_gauss2d-time.svg), [error](result/mac-cpu/elementwise_gauss2d-error.svg) |
| 4. `elementwise_gauss2d_scaling` | Density-constant scaling study of case 3: how the quantics input rank `chi_in` grows with the number of Gaussians `N` when the box area grows proportionally to `N` | [description](#case-4-density-constant-scaling-of-the-quantics-rank) | [`src/bin/elementwise_gauss2d_scaling.rs`](src/bin/elementwise_gauss2d_scaling.rs) | [`result/mac-cpu/elementwise_gauss2d_scaling.md`](result/mac-cpu/elementwise_gauss2d_scaling.md) | [chi](result/mac-cpu/elementwise_gauss2d_scaling-chi.svg), [time](result/mac-cpu/elementwise_gauss2d_scaling-time.svg), [error](result/mac-cpu/elementwise_gauss2d_scaling-error.svg) |
| 5. `elementwise_gauss2d_patched` | Patched (domain decomposed) elementwise product, controlled by a global relative tolerance instead of a fixed output budget, comparing patched and global representations at equal accuracy on size and time, over two instance families: anisotropic narrow spikes by default and case 4's smooth Gaussians on request | [description](#case-5-patched-elementwise-product-at-equal-accuracy) | [`src/bin/elementwise_gauss2d_patched.rs`](src/bin/elementwise_gauss2d_patched.rs) | [`result/mac-cpu/elementwise_gauss2d_patched.md`](result/mac-cpu/elementwise_gauss2d_patched.md) | [time](result/mac-cpu/elementwise_gauss2d_patched-time.svg), [error](result/mac-cpu/elementwise_gauss2d_patched-error.svg), [parameters](result/mac-cpu/elementwise_gauss2d_patched-params-aniso.svg) |
| 6. `mpo_mpo_aniso_patched` | Fit contraction of anisotropic Gaussian MPOs, comparing the global baseline with patched chain TreeTN | [description](#case-6-patched-mpo-mpo-fit-contraction) | [`src/bin/mpo_mpo_aniso_patched.rs`](src/bin/mpo_mpo_aniso_patched.rs) | [`result/linux-epyc-7713p/mpo_mpo_aniso_patched.md`](result/linux-epyc-7713p/mpo_mpo_aniso_patched.md) | [results table](result/linux-epyc-7713p/mpo_mpo_aniso_patched.md#results) |
| 6. `mpo_mpo_aniso_patched` | Fit contraction of anisotropic Gaussian MPOs, comparing the global baseline with patched chain TreeTN | [description](#case-6-patched-mpo-mpo-fit-contraction) | [`src/bin/mpo_mpo_aniso_patched.rs`](src/bin/mpo_mpo_aniso_patched.rs) | [contraction](result/linux-epyc-7713p/mpo_mpo_aniso_patched.md), [input scaling](result/linux-epyc-7713p/mpo_mpo_aniso_input_scaling.md) | [crossover](result/linux-epyc-7713p/mpo_mpo_aniso_patched.md#results), [patch scaling](result/linux-epyc-7713p/mpo_mpo_aniso_input_scaling.md#results) |

## Benchmark cases

Expand Down Expand Up @@ -531,7 +531,13 @@ comparison that established numerical equivalence.

The default `N = 512` instance targets the practical global-rank range discussed
for case 5. The default per-patch cap is 128; cap 64 is intentionally excluded
from future case-6 measurements. The committed `N = 2048` crossover sweep is
from future case-6 measurements. The separate [input-scaling report](result/linux-epyc-7713p/mpo_mpo_aniso_input_scaling.md)
records the established TCI `1e-8` → global relative-L2/SVD `1e-6` → adaptive
cap-128 pipeline through compressed input χ 900, where each input has 120
patches. For large TCI inputs the runner uses a spatially indexed evaluator with
a recorded rigorous absolute tail bound; sampled errors are checked against the
unmodified full mixture. Regenerate that report from its committed raw records
with `python3 scripts/report_mpo_input_scaling.py result/linux-epyc-7713p`. The committed `N = 2048` crossover sweep is
linked in the [top-level case table](#cases-at-a-glance): patched fit is slower
at input χ 192, faster at χ 224, and 1.60× faster at χ 256 on the recorded
single-core profile. The global output cap is the measured pre-patching
Expand Down Expand Up @@ -779,6 +785,15 @@ Environment knobs:
| `BENCH_NGAUSS` | cases 2, 3 and 6 | `8` (cases 2 and 3), `512` (case 6) | number of Gaussians or anisotropic spikes per mixture |
| `BENCH_INPUT_CACHE_DIR` | case 6 | `.cache/inputs` | directory for deterministic global input MPS cache entries |
| `BENCH_INPUT_CACHE_REFRESH` | case 6 | unset | when set, rebuild and atomically replace the selected input cache entry |
| `BENCH_INPUT_GENERATOR` | case 6 | `tci` | input constructor: global fused `tci`, or per-Gaussian `multiscale` using principal-axis unsafe points |
| `BENCH_INPUT_TCI_RTOL` | case 6 | `1e-8` | relative TCI tolerance; also the interpolation tolerance supplied to the multiscale constructor |
| `BENCH_TCI_LOCAL_ABS_TOL` | case 6 | `1e-12` | rigorous pointwise absolute bound for tails omitted by the spatially indexed TCI callback |
| `BENCH_TCI_INITIAL_PIVOTS` | case 6 | `8` | deterministic mixture-center grid pivots used by TCI; random initial pivots are disabled |
| `BENCH_INPUT_POLY_DEGREE` | case 6 | `28` | polynomial degree for the multiscale single-Gaussian constructor |
| `BENCH_INPUT_ADD_RTOL` | case 6 | `1e-10` | per-bond SVD tolerance used while adding multiscale single-Gaussian QTTs |
| `BENCH_INPUT_SVD_RTOL` | case 6 | `1e-6` | global relative-L2 SVD tolerance applied before adaptive patching |
| `BENCH_INPUT_ONLY` | case 6 | unset | when set, write the input/patch record and skip contraction |
| `BENCH_INPUT_SANITY` | case 6 | `1e-4` | maximum sampled relative error accepted for each compressed input MPO |
| `BENCH_BOX_L` | cases 2 and 3 | `6.0` | half-width `L` of the box `[-L, L]` |
| `BENCH_NS` | cases 4 and 5 | `8,16,32,64` (case 4, and case 5 on the `smooth` family), `8,16,32,64,128,256,512` (case 5 on the default `aniso` family) | comma-separated Gaussian or spike counts `N` to sweep. Both cases derive `L` and `R` from `N`, so they ignore `BENCH_NGAUSS`, `BENCH_BOX_L` and `BENCH_RS` |
| `BENCH_FAMILY` | case 5 | `aniso` | which instance family to sweep. `aniso` is `N` anisotropic narrow spikes at a fixed spacing-to-width ratio, the family the case is written for; `smooth` is case 4's isotropic Gaussians at constant density, unchanged, and it also switches `BENCH_NS` to case 4's four points. Recorded in the params of every record as `family`, and part of every record's filename, so one profile can hold both |
Expand Down
51 changes: 51 additions & 0 deletions result/linux-epyc-7713p/mpo_mpo_aniso_input_scaling.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Anisotropic Gaussian MPO input and patch scaling

This focused case-6 input study measures adaptive patching through compressed input bond dimension `chi_in ≈ 1000`. It uses the unchanged constant-density random anisotropic family (`sigma_minor = 0.05`, log-uniform aspect ratio in `[1, 8]`, independent angle, center, and positive weight per Gaussian).

## Construction and accuracy

The input pipeline is:

1. fused two-variable TCI at relative tolerance `1e-8`;
2. global relative-L2 SVD truncation at `1e-6`;
3. adaptive input truncation with per-patch cap 128.

TCI evaluates the same random mixture through a spatial index. A component is omitted only outside a radius where its individual Gaussian is below a common exponent threshold. Since all weights are positive, the sum of all omitted tails is bounded pointwise by `1e-12`. The committed sampled input errors include this bound and remain below `1e-5` after global SVD truncation.

The alternative multiscale constructor builds one randomly rotated Gaussian directly. It marks points every half minor-axis standard deviation along the major-axis ridge as unsafe. The focused test covers `rho = 8`, a 45-degree rotation, and `R = 10`, and requires maximum sampled absolute error below `5e-8` at polynomial degree 28. Mixtures can be formed by adding these single-Gaussian QTTs with intermediate SVD compression. This path preserves the instance family but is not used for the large sweep because its per-Gaussian construction cost scales linearly with `N`; spatially indexed TCI reaches the requested rank regime efficiently.

## Reproducible settings

These input-only records were collected separately from the profile's earlier contraction sweep. The settings below, including core 0, are authoritative for these records rather than the contraction affinity in `run.yaml`.

- Machine: AMD EPYC 7713P 64-Core Processor
- CPU affinity: core 0 (`taskset -c 0`)
- `RAYON_NUM_THREADS=1`, `OPENBLAS_NUM_THREADS=1`, `OMP_NUM_THREADS=1`
- `BENCH_INPUT_GENERATOR=tci`
- `BENCH_INPUT_TCI_RTOL=1e-8`
- `BENCH_TCI_LOCAL_ABS_TOL=1e-12`
- `BENCH_TCI_INITIAL_PIVOTS=8` (deterministic center-derived pivots)
- `BENCH_INPUT_SVD_RTOL=1e-6`
- `BENCH_PATCH_MAX_BOND=128`
- `BENCH_MAX_INPUT_CHI=1400`
- `BENCH_MAX_BOND=512, 512, 1280, 3072, 3584` for `N=512, 4096, 20480, 100000, 125000`
- one deterministic seed (`BENCH_SEED=0`)
- `BENCH_ERROR_SAMPLES=256` at every size

Input generation, global SVD truncation, sampled validation, and adaptive patch preparation are all included in `preparation time`; no contraction is run (`BENCH_INPUT_ONLY=1`).

## Results

Each pair is `(left, right)` for the two independently drawn mixtures.

| N | R | raw chi | compressed chi | global parameters | patches | max patch chi | patch parameters | sampled relative error | preparation time |
|---:|---:|---:|---:|---:|---:|---:|---:|---:|---:|
| 512 | 9 | 181 | 89 | (48,060, 47,608) | (1, 1) | (84, 84) | (45,056, 45,056) | (3.36e-06, 2.56e-06) | 5.08 s |
| 4,096 | 10 | 280 | 256 | (254,476, 255,736) | (6, 6) | (124, 124) | (352,704, 352,088) | (1.78e-06, 3.38e-06) | 46.36 s |
| 20,480 | 11 | 889 | 458 | (888,076, 886,408) | (30, 30) | (121, 121) | (1,775,032, 1,772,136) | (2.75e-06, 6.95e-06) | 263.99 s |
| 100,000 | 12 | 1,074 | 900 | (3,450,320, 3,454,660) | (120, 120) | (120, 121) | (9,866,732, 9,982,956) | (3.06e-06, 3.74e-06) | 1,568.20 s |
| 125,000 | 13 | 1,342 | 900 | (4,120,944, 4,113,404) | (120, 120) | (121, 123) | (11,553,076, 11,596,696) | (5.51e-06, 9.14e-06) | 2,539.63 s |

The compressed-rank plateau reaches `chi_in = 900`, within 10% of the requested `chi_in ≈ 1000` regime. Patch count grows stepwise from 1 to 6, 30, and 120 while every patch remains below cap 128. The `N = 125,000`, `R = 13` point increases raw rank and parameter count but remains on the same compressed-rank and patch-count plateau, so increasing `N` alone does not produce a smooth patch-count curve.

Raw JSON records are in [`raw/`](raw/) with filenames `mpo_mpo_aniso_input-tci-n*-chi*.json`.
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
{
"box_l": 23.71708245126285,
"box_padding": 1.0,
"case": "mpo_mpo_aniso_input",
"input_add_rtol": 1e-10,
"input_build_secs": 1568.202631011,
"input_cache_hit": false,
"input_cache_key": "aniso-v5-tci-n100000-r12-e0-s4008000000000000-p3ff0000000000000-sig3fa999999999999a-rho4020000000000000-tol3e45798ee2308c3a-loc3d719799812dea11-piv8-cap3072-seed0",
"input_cache_load_secs": 0.0,
"input_chi": 900,
"input_compression_secs": 9.464503739,
"input_error_samples": 256,
"input_generator": "tci",
"input_params": [
3450320,
3454660
],
"input_patch_counts": [
120,
120
],
"input_patch_max_bonds": [
120,
121
],
"input_patch_params": [
9866732,
9982956
],
"input_poly_degree": 28,
"input_sampled_relative_errors": [
3.0555493578220235e-6,
3.7404138963447223e-6
],
"input_sanity": 0.0001,
"input_svd_l2_rtol": 1e-6,
"input_tci_cap": 3072,
"input_tci_initial_pivots": 8,
"input_tci_local_abs_tol": 1e-12,
"input_tci_rtol": 1e-8,
"max_input_chi": 1400,
"n_gauss": 100000,
"np_over_chi_squared": [
4.2596543209876545,
4.265012345679012
],
"patch_cap": 128,
"r": 12,
"r_extra": 0,
"raw_input_chi": 1074,
"raw_input_params": [
7305760,
7308792
],
"rho_max": 8.0,
"seed": 0,
"sigma": 0.05,
"spacing": 3.0
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
{
"box_l": 26.516504294495537,
"box_padding": 1.0,
"case": "mpo_mpo_aniso_input",
"input_add_rtol": 1e-10,
"input_build_secs": 2539.628990155,
"input_cache_hit": false,
"input_cache_key": "aniso-v5-tci-n125000-r13-e0-s4008000000000000-p3ff0000000000000-sig3fa999999999999a-rho4020000000000000-tol3e45798ee2308c3a-loc3d719799812dea11-piv8-cap3584-seed0",
"input_cache_load_secs": 0.0,
"input_chi": 900,
"input_compression_secs": 13.723229085,
"input_error_samples": 256,
"input_generator": "tci",
"input_params": [
4120944,
4113404
],
"input_patch_counts": [
120,
120
],
"input_patch_max_bonds": [
121,
123
],
"input_patch_params": [
11553076,
11596696
],
"input_poly_degree": 28,
"input_sampled_relative_errors": [
5.5092801319520735e-6,
9.140267928712483e-6
],
"input_sanity": 0.0001,
"input_svd_l2_rtol": 1e-6,
"input_tci_cap": 3584,
"input_tci_initial_pivots": 8,
"input_tci_local_abs_tol": 1e-12,
"input_tci_rtol": 1e-8,
"max_input_chi": 1400,
"n_gauss": 125000,
"np_over_chi_squared": [
5.087585185185185,
5.078276543209877
],
"patch_cap": 128,
"r": 13,
"r_extra": 0,
"raw_input_chi": 1342,
"raw_input_params": [
9424632,
9396972
],
"rho_max": 8.0,
"seed": 0,
"sigma": 0.05,
"spacing": 3.0
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
{
"box_l": 10.733126291998992,
"box_padding": 1.0,
"case": "mpo_mpo_aniso_input",
"input_add_rtol": 1e-10,
"input_build_secs": 263.992662118,
"input_cache_hit": false,
"input_cache_key": "aniso-v5-tci-n20480-r11-e0-s4008000000000000-p3ff0000000000000-sig3fa999999999999a-rho4020000000000000-tol3e45798ee2308c3a-loc3d719799812dea11-piv8-cap1280-seed0",
"input_cache_load_secs": 0.0,
"input_chi": 458,
"input_compression_secs": 1.802141383,
"input_error_samples": 256,
"input_generator": "tci",
"input_params": [
888076,
886408
],
"input_patch_counts": [
30,
30
],
"input_patch_max_bonds": [
121,
121
],
"input_patch_params": [
1775032,
1772136
],
"input_poly_degree": 28,
"input_sampled_relative_errors": [
2.7528033675655293e-6,
6.954288054456006e-6
],
"input_sanity": 0.0001,
"input_svd_l2_rtol": 1e-6,
"input_tci_cap": 1280,
"input_tci_initial_pivots": 8,
"input_tci_local_abs_tol": 1e-12,
"input_tci_rtol": 1e-8,
"max_input_chi": 1400,
"n_gauss": 20480,
"np_over_chi_squared": [
4.2336911958200645,
4.2257394023760035
],
"patch_cap": 128,
"r": 11,
"r_extra": 0,
"raw_input_chi": 889,
"raw_input_params": [
2315988,
2322644
],
"rho_max": 8.0,
"seed": 0,
"sigma": 0.05,
"spacing": 3.0
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
{
"box_l": 4.800000000000001,
"box_padding": 1.0,
"case": "mpo_mpo_aniso_input",
"input_add_rtol": 1e-10,
"input_build_secs": 46.359608388,
"input_cache_hit": false,
"input_cache_key": "aniso-v5-tci-n4096-r10-e0-s4008000000000000-p3ff0000000000000-sig3fa999999999999a-rho4020000000000000-tol3e45798ee2308c3a-loc3d719799812dea11-piv8-cap512-seed0",
"input_cache_load_secs": 0.0,
"input_chi": 256,
"input_compression_secs": 0.288869464,
"input_error_samples": 256,
"input_generator": "tci",
"input_params": [
254476,
255736
],
"input_patch_counts": [
6,
6
],
"input_patch_max_bonds": [
124,
124
],
"input_patch_params": [
352704,
352088
],
"input_poly_degree": 28,
"input_sampled_relative_errors": [
1.781935608908162e-6,
3.3819348731372854e-6
],
"input_sanity": 0.0001,
"input_svd_l2_rtol": 1e-6,
"input_tci_cap": 512,
"input_tci_initial_pivots": 8,
"input_tci_local_abs_tol": 1e-12,
"input_tci_rtol": 1e-8,
"max_input_chi": 1400,
"n_gauss": 4096,
"np_over_chi_squared": [
3.88299560546875,
3.9022216796875
],
"patch_cap": 128,
"r": 10,
"r_extra": 0,
"raw_input_chi": 280,
"raw_input_params": [
510520,
522008
],
"rho_max": 8.0,
"seed": 0,
"sigma": 0.05,
"spacing": 3.0
}
Loading
Loading