In detail
Value ranges. R ≥ 1, u ≥ 1, 1 ≤ v ≤ T with T = 10¹⁰⁰. R = 0, u = 0, v = 0 and v > T are rejected. T is a fixed constant of every database and cannot be configured.
Forward and back.
V = (R − 1) · T + v
R = ⌊(V − 1) / T⌋ + 1
v = ((V − 1) mod T) + 1
The mapping V ↔ (R, v) is unique for every V ≥ 1. Realm R covers the global coordinates
V_min(R) = (R − 1) · T + 1 V_max(R) = R · T
Example: realm 2 runs from T + 1 to 2T.
Group and N in every realm. With the global coordinate, the same formulas apply as in realm 1:
G = u + V
N = G² − u (NL) N = G² + V (NR)
Worked examples at the realm boundary.
| Cell |
V |
G |
N |
| (1, 1, T, NL) |
T |
T + 1 |
(T + 1)² − 1 = T² + 2T |
| (2, 1, 1, NL) |
T + 1 |
T + 2 |
(T + 2)² − 1 = T² + 4T + 3 |
| (23, 14, 744, NL) |
22T + 744 |
22T + 758 |
(22T + 758)² − 14, 203 decimal digits |
In Python (without a database):
import nhydb
T = nhydb.REALM_SPAN
print(T == 10**100)
print(nhydb.split_global_v(T) == (1, T), nhydb.split_global_v(T + 1))
print(nhydb.global_v(2, 1) == T + 1)
n = nhydb.dynadron_n(23, 14, 744, "NL")
print(len(str(n)), n == (22 * T + 758) ** 2 - 14)
a = nhydb.n_to_dynadron_address(n)
print(a["realm"], a["u"], a["v_local"], a["lane_name"])
Output:
True
True (2, 1)
True
203 True
23 14 744 NL
Logical, not physical. A realm takes up no storage as long as nothing is stored in it. The coordinates are stored structurally and block by block – neither complete (R, u, v, lane) tuples per cell nor the number N.
Limits in practice. Mathematically, R, u and N are unbounded; the only limits are memory, disk and computing time. The NumPy batch interface expects coordinates as uint64; single and list calls are unbounded. Python displays integers with more than 4,300 decimal digits only after sys.set_int_max_str_digits(0) – this affects only the display, not the calculation.
Logical realms with MATH_MAP. A MATH_MAP layout can compute very large logical realm numbers; the data is stored in physical realms that are assigned sequentially. See MATH_MAP.
Read more: Technical documentation, section 2 · Python Cookbook, chapter 9
# In detail **Value ranges.** R ≥ 1, u ≥ 1, 1 ≤ v ≤ T with T = 10¹⁰⁰. R = 0, u = 0, v = 0 and v > T are rejected. T is a fixed constant of every database and cannot be configured. **Forward and back.** ```V = (R − 1) · T + v R = ⌊(V − 1) / T⌋ + 1v = ((V − 1) mod T) + 1``` The mapping V ↔ (R, v) is unique for every V ≥ 1. Realm R covers the global coordinates ```V_min(R) = (R − 1) · T + 1 V_max(R) = R · T``` Example: realm 2 runs from T + 1 to 2T. **Group and N in every realm.** With the global coordinate, the same formulas apply as in realm 1: ```G = u + VN = G² − u (NL) N = G² + V (NR)``` **Worked examples at the realm boundary.** | Cell | V | G | N ||---|---|---|---|| (1, 1, T, NL) | T | T + 1 | (T + 1)² − 1 = T² + 2T || (2, 1, 1, NL) | T + 1 | T + 2 | (T + 2)² − 1 = T² + 4T + 3 || (23, 14, 744, NL) | 22T + 744 | 22T + 758 | (22T + 758)² − 14, 203 decimal digits | **In Python** (without a database): ```pythonimport nhydb T = nhydb.REALM_SPANprint(T == 10**100)print(nhydb.split_global_v(T) == (1, T), nhydb.split_global_v(T + 1))print(nhydb.global_v(2, 1) == T + 1) n = nhydb.dynadron_n(23, 14, 744, "NL")print(len(str(n)), n == (22 * T + 758) ** 2 - 14)a = nhydb.n_to_dynadron_address(n)print(a["realm"], a["u"], a["v_local"], a["lane_name"])``` Output: ```textTrueTrue (2, 1)True203 True23 14 744 NL``` **Logical, not physical.** A realm takes up no storage as long as nothing is stored in it. The coordinates are stored structurally and block by block – neither complete (R, u, v, lane) tuples per cell nor the number N. **Limits in practice.** Mathematically, R, u and N are unbounded; the only limits are memory, disk and computing time. The NumPy batch interface expects coordinates as `uint64`; single and list calls are unbounded. Python displays integers with more than 4,300 decimal digits only after `sys.set_int_max_str_digits(0)` – this affects only the display, not the calculation. **Logical realms with MATH_MAP.** A MATH_MAP layout can compute very large logical realm numbers; the data is stored in physical realms that are assigned sequentially. See [MATH_MAP](/en/math-map/). **Read more:** Technical documentation, [section 2](https://github.com/nhydb-run4/NHyDB/blob/main/docs/en/NHyDB_Technical_Documentation.md#2-mathematical-foundations-of-addressing) · Python Cookbook, [chapter 9](https://github.com/nhydb-run4/NHyDB/blob/main/docs/cookbook/PYTHON_COOKBOOK.md#9-addresses-and-the-number-n)