Skip to content

Commit

Permalink
Merge pull request #1 from QMCSoftware/combine_dnet_dnetup
Browse files Browse the repository at this point in the history
Remove dnetup format and add Magic Point Shop files
  • Loading branch information
pierrelecuyer authored Feb 5, 2024
2 parents 73e07b4 + 287f8bd commit 75722ee
Show file tree
Hide file tree
Showing 61 changed files with 105,668 additions and 21,219 deletions.
13 changes: 4 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ Joe and Kuo (2008) provide a file for up to 21201 dimensions for Sobol' points,
A lattice rule: give the modulus and the generating vector.
- `dnet`
A digital net: give the generating matrices, one per line.
- `dnetup`
Same as `dnet`, but with the digits read from bottom up in each column.
- `plattice`
A polynomial lattice rule: give the polynomial modulus and the generating vector.
- `sobol`
Expand Down Expand Up @@ -85,7 +83,7 @@ One example of a parameter file for an ordinary lattice rule, in `lattice` forma
26671
```

### Parameters for digital nets: `dnet` and `dnetup`
### Parameters for digital nets: `dnet`

A *digital net in base* $b$ with $n=b^k$ points is defined by selecting integers $s \geq 1$, $r \geq k \geq 1$, and $s$ matrices $\boldsymbol{C}_1,\dots,\boldsymbol{C}_s$ of size $r \times k$ with entries in $\mathbb{Z}_b$, called the generating matrices. For $i=0,\dots,n-1$, let $i = \sum_{\ell=0}^{k-1} a_{i,\ell} b^\ell$ be the expansion of $i$ in base $b$, and for $j=1,\dots s$, let

Expand All @@ -97,7 +95,7 @@ $$u_{i, j} = \sum_{\ell=1}^{r} y_{i, j, \ell} b^{-\ell}.$$

The points $\boldsymbol{u}_i$ are defined by $\boldsymbol{u}_i = (u_{i,1},\dots,u_{i,s})$. Digital nets are usually in base $b=2$, but we allow a general (typically prime) base $b \ge 2$.

The proposed format to specify digital nets is as follows. The first line must start with `# dnet`. Then the first four non-comment lines give $b$ (the base), $s$ (the number of dimensions), $k$ (the number of columns), and $r$ (the number of rows in the generating matrices in base $b$). Thus, the output values will have "precision" $b^{-r}$ (they will be integer multiples of $b^{-r}$). For $b=2$, a common value in the past has been $r=31$ when using 32 bit integers, but going forward we should use 64 bit integers and $r=63$ or 64, or perhaps $r=53$ to exploit the full accuracy of a `double`.By looking at $r$, one can see right away whether this file is good for 64 bit computers only or for 32 bit computers as well.
The proposed format to specify digital nets is as follows. The first line must start with `# dnet`. Then the first four non-comment lines give $b$ (the base), $s$ (the number of dimensions), $k$ (the number of columns), and $r$ (the number of rows in the generating matrices in base $b$). Thus, the output values will have "precision" $b^{-r}$ (they will be integer multiples of $b^{-r}$). For $b=2$, a common value in the past has been $r=31$ when using 32 bit integers, but going forward we should use 64 bit integers and $r=63$ or 64, or perhaps $r=53$ to exploit the full accuracy of a `double`. By looking at $r$, one can see right away whether this file is good for 64 bit computers only or for 32 bit computers as well.

The $s$ lines after this header will contain the $s$ generating matrices, one per line. Each of these lines contains $k$ integers smaller than $b^r$ giving the $k$ columns of $\boldsymbol{C}_j$, using by default the same encoding as in the class `DigitalNetBase2` in SSJ for $b=2$. That is, the base $b$ representation of the integer gives the $r$ digits in the corresponding column, with the digit on the first row of the matrix (row 0) being the most significant, and the one on the last row (row $r-1$) being the least significant. For example, if $b=2$, $r=31$, and the first column has a 1 in the first row and 0 in all other rows,
as is always the case for Sobol points, then the integer representation of this column will be $2^{30} = 1\,073\,741\,824$. If there is a 1 in the last row and 0 elsewhere, the representation will be $2^0 = 1$. If all 31 elements of the column are 1, the representation will be $2^{31}-1$.
Expand Down Expand Up @@ -129,8 +127,6 @@ for c in range(k):
u[i,j] = coord * normFactor
```

The `dnetup` format is similar to `dnet`, except that the representing integer of any given column is obtained by ordering the digits in the reverse way, from bottom up, so the one in the first row is the least significant one. This is the ordering used in the Magic Point Shop of Nuyens (2020). For example, in base 2 with $k=4$, the line "1 2 4 8" would represents the 4-by-4 diagonal matrix, and the line "1 3 7 15" would represents the 4-by-4 upper triangular matrix with all ones. The main advantage of this representation is that it does not depend on the parameter $r$ and the numbers in the columns tend to be smaller. On the other hand, it requires a reordering of the bits when computing the points $\boldsymbol{u}_i$ as in the code snippet above.


### Parameters for polynomial lattice rules: `plattice`

Expand All @@ -146,8 +142,7 @@ This point set has $n = b^k$ points.

We must specify the polynomial modulus $Q(z)$ and the polynomial generating vector $\boldsymbol{a}(z)$. The polynomial modulus will be represented as an integer that has $(k+1)$ digits in base $b$, and all the other polynomials will be represented as integers that have no more than $k$ digits in base $b$. All these integers will be given in base 10 in the file, one per line. In practice, we usually have $b=2$, so $k$ represents the number of bits. The integer that represents a polynomial is obtained simply by replacing the formal variable by $b$. For example, if the polynomial is $Q(z) = z^4 + z^3 + 1$ and $b=2$, its coefficients are "1 1 0 0 1" and its integer representation is $2^4 + 2^3 + 1 = 25$. This is the usual representation, as used in Goda and Dick (2015), for example. In the case of embedded point sets, the modulus should be $Q(z) = z^k$ for $n=b^k$ points, and its integer representation is $b^k$. In particular, $Q(z) = z$ is represented by the integer $b$.

As usual, the first line is a comment that tells the type of file. Then the first four non-comment lines give the base $b$, the number $s$ of dimensions, the degree $k$ of the polynomial modulus, and the integer representation of this polynomial.
Lines 5 to $s+4$ give the polynomials that form the generating vector, one per line, using the integer representation just explained. One example of a file for a polynomial lattice in the `plattice` format:
As usual, the first line is a comment that tells the type of file. Then the first four non-comment lines give the base $b$, the number $s$ of dimensions, the degree $k$ of the polynomial modulus, and the integer representation of this polynomial. Lines 5 to $s+4$ give the polynomials that form the generating vector, one per line, using the integer representation just explained. One example of a file for a polynomial lattice in the `plattice` format:

```
# plattice
Expand All @@ -167,7 +162,7 @@ Lines 5 to $s+4$ give the polynomials that form the generating vector, one per l
17213
```

A polynomial lattice rule in base $b$ can also be represented as a digital net in base $b$, so its parameters can also be provided in a file in the `dnet` or `dnetup` format, as for general digital net in base $b$. But the generating matrices have a special form and the above representation is much more compact (a single integer per row instead of $k$ integers per row). On the other hand, generating the points is faster with the generating matrices than with the polynomial representation, so the software that will use the `plattice` files and generate the points would usually first convert the polynomials into the corresponding generating matrices. LatNet Builder (L’Ecuyer et al., 2022) is also able to make the conversion and produce a file in the `dnet` format, for more convenience and better flexibility, so the user can select the format she/he prefers.
A polynomial lattice rule in base $b$ can also be represented as a digital net in base $b$, so its parameters can also be provided in a file in the `dnet` format, as for general digital net in base $b$. But the generating matrices have a special form and the above representation is much more compact (a single integer per row instead of $k$ integers per row). On the other hand, generating the points is faster with the generating matrices than with the polynomial representation, so the software that will use the `plattice` files and generate the points would usually first convert the polynomials into the corresponding generating matrices. LatNet Builder (L’Ecuyer et al., 2022) is also able to make the conversion and produce a file in the `dnet` format, for more convenience and better flexibility, so the user can select the format she/he prefers.

### Parameters for Sobol nets: `sobol` and `soboljk`

Expand Down
File renamed without changes.
17 changes: 17 additions & 0 deletions dnet/mps.nx_b2_m30_s10_Cs.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# dnetup
# From the Magic Point Shop https://people.cs.kuleuven.be/~dirk.nuyens/qmc-generators/
2 # base
10 # dimensions
1073741824 # supports 2^30 points
30 # maximum bits in an integer
# The columns of gen. matrices C_1, ..., C_s, one matrix per line:
696344576 177875968 198830848 332466784 765128780 786752711 700394490 710743797 80402060 582321570 531330516 600994053 250343324 166325309 469206004 127787017 350209407 959505056 402000190 101740930 58507941 533330381 53139563 235760460 927807685 1048967523 1039779877 893524859 774165468 417325468
912973312 273086528 1043348344 304024545 144844181 373870990 620509713 1032943564 953994563 579754739 988202473 136063485 174254401 979221296 243294609 210750988 191980114 384136855 119830278 960709408 152810196 87797445 725033016 935489600 513691672 375388711 601961381 646256774 844711761 782078212
1070658743 541351219 177168414 857506082 954298862 189990685 928237287 714563635 825097568 486326679 620190618 234665099 969800906 10921771 117651574 960455758 712481989 104218246 49191030 395016413 243053293 50889952 533282744 507581774 365648082 362117277 943766598 452105566 134382757 600036003
468149054 356323242 531691055 533479845 369430665 1050335897 855633172 121777424 926972951 861803436 633315042 147299592 44904118 716540604 848053812 161692489 18786120 175446231 329890245 289816975 992443882 144833905 280706725 393983156 1024471095 244194217 705811717 343438231 1010252774 369916015
47463531 688500491 156046897 840884700 909106686 269785563 239678700 930221356 503006993 979373410 786124814 22097096 585759744 310525712 75113259 233079227 876226168 352865085 796223239 120697769 233031239 848080728 960129683 786952936 709641922 119053788 66120245 256432093 854840906 1062655013
823931987 369032796 955029757 104856506 770334010 240341623 205772931 911259079 915206596 930217353 690026418 625901845 48782362 390178869 852575964 836019537 694715425 89906349 150902223 5834217 11009007 485593977 400623134 1069427788 691791464 405765657 1019838073 551252580 986644545 225903139
382091319 739313283 942124987 288243186 229802861 751574681 41151136 730405574 502619122 149340930 382496547 383277427 951451155 587583426 191540436 308805631 1064908987 81380314 127274604 62709513 46705551 1032153411 829062413 747188657 444648745 199504873 237992630 378356548 772791966 833105476
587078599 203960422 511194114 755679438 139542925 28367724 165315148 768111470 999912497 1027667728 638438543 359237201 196888839 463057534 268847481 214959631 431660447 480659247 337817622 224901951 151877581 263454068 928091576 989398959 722566738 924770779 629317449 713695576 181619785 564028034
453809691 380853116 899434263 666973159 182611982 1008223646 637955544 153759368 411114377 566828272 44056958 585359217 34385615 801789890 507572939 48458184 992087037 411762415 286362362 826271647 604665201 298685982 211695003 664079058 265179510 352453822 1031228380 533517717 914087299 668725875
931239939 828945438 363684192 95705596 248262652 526274471 61950506 542401026 593450089 139006496 220316088 1019960300 192398181 834630841 1072820851 474696622 1017601997 925673718 774313960 12886932 8871591 362158636 293953661 573034866 595008664 935547810 757597401 7383456 476631037 577177943
18 changes: 18 additions & 0 deletions dnet/mps.nx_b2_m30_s11_Cs.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# dnetup
# From the Magic Point Shop https://people.cs.kuleuven.be/~dirk.nuyens/qmc-generators/
2 # base
11 # dimensions
1073741824 # supports 2^30 points
30 # maximum bits in an integer
# The columns of gen. matrices C_1, ..., C_s, one matrix per line:
640076413 38619923 880276074 258462862 218061951 110875386 782095512 253820603 543879802 1050676528 655726172 1061996849 738961624 599680434 1010784250 414752449 180264169 676013088 361315153 950490779 626020133 142567564 521541876 618804908 178037201 362432873 391430156 528491869 1063457085 141830450
393823488 967702564 996414134 380720145 300495822 884499191 768736405 91406721 741603631 624224565 359456934 89283930 537918092 829699217 349844160 264781100 1031472974 300442722 219489904 623147931 359027908 503369389 414890524 46246130 734200851 550896721 990511752 756780245 917175879 319155042
606494016 917965809 1018376187 163092929 747799491 115078791 939997329 17414853 302426061 921867709 602154136 999186600 411725464 223769413 703344350 841532862 797735996 1020553390 1009041997 950379831 627636356 178720078 409380538 70557298 673255255 835970611 286203702 266426382 560101456 39390863
600866816 685960568 103280453 309088841 955194087 1044309885 605453218 957769029 348362389 812806796 302838834 313274906 300197590 275279179 332855626 37604359 698428890 206208084 238230667 367047777 4381534 735883523 1064951460 203911503 78225905 998688573 340732841 941500948 201590684 371703833
346200071 734643499 123089088 649304842 605054314 790301134 48561423 242319144 801905870 66727240 424813982 158270750 162634162 146649881 731766097 380723582 33118141 861489947 741323110 237146728 263233061 427681584 870037056 474509960 337598642 712260834 886629205 541733652 450393070 280197089
986274698 148131086 870716920 447282332 1026196869 472749574 32460871 272231963 410368694 178649215 888633116 1041483275 940674463 931538664 956736924 524225383 936411974 969547861 512648518 381104443 205372356 13905180 333072039 496115283 546594229 1065067452 179675074 227185735 993747182 39536207
261598117 611550090 211615492 100722117 634969513 368972092 686506470 533599043 530639277 873784702 575933634 411444686 102047956 816671590 1010229544 185842073 978642477 562673342 1003690264 941331870 814018105 637603710 143573597 1037408318 307920125 339901701 832688107 722546136 412159266 769219252
922063332 565134652 82071906 769088394 944402391 138740959 433429701 862296561 993983047 899835002 1037945714 417060381 752393547 88184049 966044098 680894913 514682970 719476347 886465807 486029512 62535029 555167353 307430836 709660495 1041707699 786398307 825953853 750169210 221302275 595424191
512467929 300113655 674083661 689445985 148105911 866522716 313630486 395717289 301814491 655585295 577555299 917231748 888920033 927718938 724360554 377554296 248732447 174080875 559178264 89877466 399554243 298097523 363683154 825448247 854096856 766321194 215392664 646036130 1892589 311854397
986027855 132090846 621223411 333974992 790598050 79387364 267995867 599454495 232907008 15913258 302191763 772790356 584503088 738046272 188438137 921819200 697430148 137752459 873342196 227078802 442976560 1034616614 172909972 40524786 747034583 462482257 28803124 462481449 885322935 182269347
648793944 607217858 974232141 283030681 2576790 535183650 157523670 496460795 334546972 8482709 896794205 786499822 228269069 998643015 607626918 151122715 717253132 1010802792 529041112 437142038 545850927 663932102 587251879 161482998 958459306 918804181 617570748 471288770 418354821 666780001
19 changes: 19 additions & 0 deletions dnet/mps.nx_b2_m30_s12_Cs.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# dnetup
# From the Magic Point Shop https://people.cs.kuleuven.be/~dirk.nuyens/qmc-generators/
2 # base
12 # dimensions
1073741824 # supports 2^30 points
30 # maximum bits in an integer
# The columns of gen. matrices C_1, ..., C_s, one matrix per line:
376009787 616649261 1038915818 449176030 680969485 844929903 469210199 515424615 955287332 441067371 672960609 10667578 518196311 909235475 829362448 606869120 1069286697 548650217 281564703 956233651 30374325 339266501 406232992 308994419 308329741 419071262 157656941 113798237 580526181 312086276
113325173 802884388 776006141 240665347 1067428575 237210076 433405280 542548953 206172120 892707582 938920668 268533774 427179081 64599497 584946987 850670289 1029168313 406383405 567739064 243337945 534671208 284667432 604603719 624171720 638094189 480469014 81680586 875930397 165521623 713379925
365589568 795832513 352548612 791353731 639030956 875424815 460322970 209202842 769072557 62593514 554917907 422257425 988433200 845378618 964807902 469755058 490235585 36511719 305707082 338554719 877932899 475033153 48231578 414880648 706291263 70011941 255603371 718605877 1049680271 203585716
435632494 172170459 1059343654 565249317 65081497 498668119 696359679 815656005 627318345 886975033 230810440 958457568 170678992 928599693 50537551 95312547 130331293 202074131 1045327915 1032883628 259200551 538263735 525010700 117358056 867099869 70373620 495094033 522626779 38232465 95758096
32678341 505635296 425856624 1054825470 1033723186 938870058 269291076 814524247 656722885 524631983 597477638 436880436 697998740 64815620 786707110 297283695 494619587 996221642 743211695 532501720 485366627 575598237 246747572 221087582 195011953 225867526 624744711 494497451 771083163 465002468
551397128 489766929 195538897 629476791 1006219829 921379579 836280603 978070866 1007507930 236561171 759639615 439796207 338293708 24298018 558561689 657466702 188516653 553216800 981177690 1010977003 791689962 158536313 388269785 487774813 224170145 624982216 529627459 530281195 133158627 81743442
768717957 184677116 591120478 258801695 981458210 434399026 697605612 787798639 845498401 27242131 198461923 975748095 873564500 808362448 829314929 599428700 553956900 646455049 715447491 990180123 901857731 341740714 518651244 433436011 393492963 156099629 1014527846 267932060 338771950 491714313
609470369 578981355 496170689 646129714 870096655 49561033 642998690 66791072 319166205 892427797 521637492 815247648 244676424 701940472 831147871 570779345 89071257 880115963 152451089 13233731 318042497 408461437 1007221712 775537592 174347183 811508503 942904086 319793289 566294292 956161085
690191426 28134813 207393949 406243981 500443338 244003934 327631593 692702121 76532237 120264433 305592447 23783510 936434940 129432986 891044703 133326731 759067238 805090750 393846010 895707158 773285066 682629395 68829201 219221301 116077786 1009888418 978576807 641438017 169610131 526023641
226253065 147381635 1009733192 730981142 441127473 1068685129 902159719 362034294 888137773 862283775 338017958 22628013 340658897 130197395 630654134 42912700 324565062 640826151 540055184 214577500 940181002 475921976 880471073 962578486 937098890 1035691007 496051649 546273064 104382506 758339435
980220447 391809923 926256294 896109598 310914840 979419742 492998431 917440954 1036679165 877461802 482469020 413101932 360109925 34299936 186285141 291647287 420363989 406330999 854416866 979161387 721088013 775806082 25986602 601668135 282692574 256034532 1047609668 427797668 402427615 284346209
805428583 869599887 1014763568 659252565 973942038 754651348 897847746 182137879 679510472 128246679 807357794 396531141 578604545 486979889 898367645 336668900 827682136 327305202 213888167 744078157 351257983 316843621 473816217 495813680 483886281 885162661 246466767 823380730 817597230 113843058
Loading

0 comments on commit 75722ee

Please sign in to comment.