From 78d6a3df17a1fe22323017c738be4a5ffbc55b02 Mon Sep 17 00:00:00 2001 From: Anouar Moustaj Date: Fri, 13 Nov 2026 14:42:49 +0200 Subject: [PATCH 1/2] Check the L = 40 bond elements to 1e-6, not 1e-8 At L = 40 the chain MPO has norm ~1.5e6, and the kept middle bond carries rounding noise of 4.6e-9 / 5.3e-9 on Windows (Julia 1.12) and 1.7e-8 on GitHub's Linux runner with Julia 1.10, which failed the 1e-8 bound of the two L = 40 chain checks (CI of PR #82). The noise is ~1e-14 at L = 26 and ~1e-12 at L = 34, so only the L = 40 checks (chain and p-wave pairing) change. A cut bond is off by 0.5 or more, so 1e-6 still catches what the test is for. Test-only change; no code or result moves. Co-Authored-By: Claude Opus 5.5 --- test/bugfix_large_L_cutoffs.jl | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/test/bugfix_large_L_cutoffs.jl b/test/bugfix_large_L_cutoffs.jl index 6996c24..e8e1d43 100644 --- a/test/bugfix_large_L_cutoffs.jl +++ b/test/bugfix_large_L_cutoffs.jl @@ -56,11 +56,13 @@ _wrap(H) = _el(H, 0, 2^H.L - 1) # zero on an open chain @test_logs min_level=Logging.Warn get_Hamiltonian("square_2d", 1.0; L, Lx=13, tol=1e-8) @test TensorBinding._cutoff_dim(get_Hamiltonian("square_2d", 1.0; L=8, Lx=3)) == 2.0^5 - # kinetic_1d_nn's own sum: 1e-12 cut one direction of the bond at L = 39, both at 40 + # kinetic_1d_nn's own sum: 1e-12 cut one direction of the bond at L = 39, both at 40. + # At L = 40 (‖H‖ ≈ 1.5e6) the kept bond carries rounding noise of ~5e-9 here and + # 1.7e-8 on Linux with Julia 1.10, so these checks use 1e-6; a cut bond is off by ≥ 0.5. H40 = get_Hamiltonian("chain_1d", 1.0; L=40) m40 = 2^39 - @test _el(H40, m40 - 1, m40) ≈ 1.0 atol=1e-8 - @test _el(H40, m40, m40 - 1) ≈ 1.0 atol=1e-8 + @test _el(H40, m40 - 1, m40) ≈ 1.0 atol=1e-6 + @test _el(H40, m40, m40 - 1) ≈ 1.0 atol=1e-6 # a weak T-junction, a single-site term, is no longer truncated away (t_j = 0.02 at L = 16) Ht = TensorBinding.tjunction_hamiltonian(16, 1.0, 0.02) @@ -80,5 +82,5 @@ _wrap(H) = _el(H, 0, 2^H.L - 1) # zero on an open chain # pairingNNN summed at a fixed 1e-12, like kinetic_1d_nn s40 = H40.sites P40 = TensorBinding.pairingNNN(40, s40, 0.2 * MPO(s40, "Id"), 1) - @test _el(TensorBinding.TBHamiltonian(H40; mpo = P40), m40 - 1, m40) ≈ 0.2 atol=1e-8 + @test _el(TensorBinding.TBHamiltonian(H40; mpo = P40), m40 - 1, m40) ≈ 0.2 atol=1e-6 end From b9bdec9e4f674bafa819031fe771400179281b19 Mon Sep 17 00:00:00 2001 From: Anouar Moustaj Date: Fri, 13 Nov 2026 14:50:07 +0200 Subject: [PATCH 2/2] README: one bullet for the quasicrystal builders The Hamiltonian-construction features gave the quasicrystals four of seven bullets (Aubry-Andre-Harper inside the 1D bullet, then Fibonacci, metallic-mean and k-bonacci with their substitution rules and numeration details). They now share one bullet; the details stay on the position-spaces API page. Co-Authored-By: Claude Opus 5.5 --- README.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index f960738..63c4675 100644 --- a/README.md +++ b/README.md @@ -32,10 +32,8 @@ See the [`examples/`](examples/) folder for notebooks covering the main workflow ### Key Features **Hamiltonian construction** -- 1D: nearest-neighbour chain, SSH (uniform and sublattice-explicit), Aubry–André–Harper quasicrystal, uniform with on-site potential -- Fibonacci onsite and hopping quasicrystals in a projected Zeckendorf basis, with open or physical-periodic boundaries and conumber ordering -- Metallic-mean quasicrystals (`A → AᵐB`, `B → A`: silver mean, bronze mean, …) in a projected `(m+1)`-ary numeration basis on Qudit registers; `m = 1` reproduces the Fibonacci chain -- k-bonacci quasicrystals (`aᵢ → a₁aᵢ₊₁`, `aₖ → a₁`: Tribonacci, Tetranacci, …) in a projected binary basis with no `k` consecutive ones; `k = 2` reproduces the Fibonacci chain +- 1D: nearest-neighbour chain, SSH (uniform and sublattice-explicit), uniform with on-site potential +- 1D quasicrystals: Aubry–André–Harper, and Fibonacci, metallic-mean and k-bonacci chains in projected position spaces - 2D: square, triangular, honeycomb, kagomé, Lieb, and dice lattices — including sublattice-explicit models with an explicit unit-cell index - Generic *n*th-nearest-neighbour hopping on any 2D geometry (`add_hopping_2D!`): uniform, direction-dependent, site-dependent, or fully position+direction-dependent amplitude functions - Arbitrary hopping matrix `f(i,j)` compressed via QTCI (`hopping2MPO`)