Commit Graph

32 Commits

Author SHA1 Message Date
Francois Coppens
6cd9fb1072 - Moved transposing of Slater_inv to HDF5 conversion tool and removed it from the test program.
- Let Maponi A3 continue, even after the algorithm breaks down.
2021-03-18 14:06:06 +01:00
Pablo Oliveira
a95304225d Fix Makefile 2021-03-15 15:31:42 +01:00
Pablo Oliveira
f096db6411 New implementations for Sherman Morisson
- SM2: Slagel splitting implementation
    (http://hdl.handle.net/10919/52966)

  - SM3: Keep close to zero denominators for later

  - Update tests to show the squared residual
2021-03-15 14:01:38 +01:00
François Coppens
ef97b40196 Changed code to treat the dataset as replacement updates, instead of additive updates. Before the updates are used to compute the inverse they are transformed accordingly.
However, this breaks the 4x4 example in update cycle 8169.
2021-03-12 12:38:50 +01:00
François Coppens
081fbfc1d8 Loop merge successful.
Next step: reduce the number of indices of ylk by not keeping
all the previous solutions.
2021-03-10 16:56:22 +01:00
François Coppens
3b3567040b Added more debug output. 2021-03-10 11:41:34 +01:00
François Coppens
983f87d504 Rewrote matMul function so it doesn't declare memory inside. 2021-03-09 10:39:58 +01:00
Pablo Oliveira
4bd61dd76c Add a standard Sherman-Morisson implementation
- It can serve as a baseline reference

- It can serve as a starting point for including the pivot
  and splitting techniques from Maponi and Slaggel without the full
  complexity of the MaponiA3 algorithm
2021-03-05 17:00:48 +01:00
François Coppens
f5a2e635cf Added environment variables source script. Added test script that loops over update cycles. Added test program that loops internally over test cycles. 2021-02-28 09:28:42 +01:00
François Coppens
8e0aef7717 Restructuring complete. Updated makefile. 2021-02-27 12:25:55 +01:00
François Coppens
5d4a7af01a File tree restructured. Written build script build.sh. TODO: convert buld script into Makefile. 2021-02-26 17:28:52 +01:00
François Coppens
225c841a88 * Fixed the 3x3 MaponiA3 C++ example. Update_index vector cannot have values that are smaller than 1 because the first colums in Fortran is stored at 1 and not 0.
* Started debugging reading from HDF5 formatted datasets. Slater_inv needs to be transposed before sent to Maponi. Algo fails at the last step. Correct Slater and Inverse fail to produce the identity matrix. Suspect that the matMul function is not working correctly eventhough it looks like it does.
2021-02-24 18:41:48 +01:00
François Coppens
28f6de48ee TO BE AMENDED 2021-02-23 08:28:09 +01:00
François Coppens
386f29ffa9 Slightly cleaner 2021-02-22 15:53:23 +01:00
François Coppens
c29276cb7a Added tests/test to distclean in Makefile 2021-02-22 15:45:18 +01:00
François Coppens
b4787e6803 Test infrastructure for hdf5 datasets and python hdf5 datasert conversion tool.
Made small corrections to compensate for changes made after branching-off from test_dataset.

Everything compilers
Everything works except for the HDF5 dataset test program that gives an I/O error.
2021-02-22 15:44:41 +01:00
François Coppens
b2b4756b53 Problem solved. Problems was caused by reading the inverse matrix S_inv the same way as the matrix S, but apparently what has been stored is transpose(S_inv) and not S_inv. Therefore it needs to be read transposed compared to S in order to for S*S_inv to give the Identity matrix.
TODO: Calls from C/C++ are still broken because inside the MaponiA3 algo there is compensation for the fact that Fortran sends it's arrays in column-major order. This must be resolved by  transposeing S_inv before it is passed to MaponiA3 and remove the compensations made there.
2021-02-22 15:43:27 +01:00
François Coppens
8d63dd1701 The algorithm now works for the following 4x4 example with 2 updates:
S = [1,0,1,-1; 0,1,1,0; -1,0,-1,0; 1,1,1,1]
S_inv = [1,-1,1,1; 1,0,2,1; -1,1,-2,-1; -1,0,-1,0]
u1 = [0,-2,0,0]
u2 = [0,-1,0,0]
upd_idx = [2,4]

To go from Maponi's examples where the number of updates is always equal
to the the dimension of the matrix, and the decomposition is always
diagonal, to cases with a non-diagonal decomposition and a number of
updates unequal to its size, the following changed needed to be made:

* in the calculation of the {y0k} an extra inner for-loop needs to be
  added to make it a full matrix-vector multiplication due to the fact
  that A0 is not a diagonal matrix

* in some places the use of the update-order vector p needs
  the be replaced with that of upd_idx to make sure the correct
  component of the ylk is selected and the proper rank-1 matrices are
  constructed

* when a matrix is passed from Fortran to C++ with 2D adressing, it is
  passed in colum-major order. The passed matrix needs to be transposed
  before passing to C++. Doing this inside the algorithm will break
  compatibility with called from C/C++.
2021-02-22 15:41:30 +01:00
François
48c27eb47e * Modified Maponi algo 3 so that it can be used with a number of updates
that is smaller than the size of the Slater-matrix
* Removed the Slater-matrix as an argument, since it is not used in the
  algo.
* Added a manual 4x4 example to debug MaponiA3 to work with a number of
  updates that is smaller than the size of the Slater-matrix
* Added a new Octave script to quickly check if the computes inverse is
  correct.
2021-02-22 15:34:34 +01:00
Pablo Oliveira
061c9b9f21 Add test infrastructure for datasets 2021-02-16 10:49:15 +01:00
François Coppens
90469df3c2 Put importing the dataset into a module. 2021-02-12 19:31:31 +01:00
François Coppens
1b3a1d9d22 Added QMCChem test dataset with 3 updates. Renamed files, added the Fortran program QMCChem_dataset_test.f90 to start testing the QMCChem dataset. Wrote and tested Fortran code to import the test dataset. 2021-02-12 12:04:21 +01:00
Pablo Oliveira
6f34f485d3 C++ redesign of data-structures
- Use flat arrays
- Use real type for all matrices
- Merge _f MaponiA3 files
2021-02-09 14:34:39 +01:00
François Coppens
3f6bca2b04 The Fortran interface to C++ fuction MaponiA3() works but the mechanism of passing the 2D arrays from Fortran to C++ must be improved. Now the passed 'linear' 2D arrays are copied and reshaped into usable 2D arrays. This needs to be replaced with some suitable casting mechanism. 2021-02-06 18:59:07 +01:00
François Coppens
7f7b23f7c4 Put more comments in Makefile. 2021-02-04 18:52:26 +01:00
François Coppens
f1641dd4e4 Solved linking problem by including C++ standard library '-lstdc++'. Also added a minimal working example of Fortran-C++ interfacing in dir 'mwe'. 2021-02-04 17:05:55 +01:00
François Coppens
84fffdb7fa Prepared the example matrix of Example 8 of the paper and its
decomposition in the Fortran code and made a basic call to the
subroutine MYSUBROUTINE, which is bound to the C++ void function
'Sherman-Morrison();. For now compilation fails with lots of undefined
references.'
2021-02-04 13:12:47 +01:00
François Coppens
090847247d Prepared the main Fortran infrastructure for the C++ calls. Updated the makefile. 2021-02-04 11:39:00 +01:00
François Coppens
7d55d7db77 Split the program in a header file and an implementation file and included them in main. Does not compile. Get the following error: ld: /tmp/icpcnmVxvw.o: in function void showMatrix<int>(int**, unsigned int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)' 2021-02-02 17:06:32 +01:00
François Coppens
d45df44e5e C++ implementation of algo 3 is working. Not optimised yet. 2021-01-27 17:19:41 +01:00
François Coppens
daadf44eee Maponi algorithm 4 works for the modified Example 18 in the paper but not for general non-singlual NxN matrices yet. 2021-01-26 11:32:17 +01:00
François Coppens
d286e0d45e Added some initial data likle Makefiles and .gitignore. 2021-01-26 07:26:54 +01:00