Skip to content

Commit

Permalink
Merge pull request #11 from tanlin2013/main
Browse files Browse the repository at this point in the history
Test: add mocker & element-wise check on AutoMPO
  • Loading branch information
tanlin2013 authored Dec 20, 2022
2 parents 10563c1 + 6f5aeb4 commit e4f5039
Show file tree
Hide file tree
Showing 79 changed files with 6,288 additions and 6,694 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ CMakeCache.txt
CMakeFiles
CMakeScripts
Testing
Makefile
build/Makefile
cmake_install.cmake
install_manifest.txt
compile_commands.json
Expand Down
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,7 @@
path = ext/armadillo
url = https://gitlab.com/conradsnicta/armadillo-code.git
branch = 11.4.x
[submodule "ext/trompeloeil"]
path = ext/trompeloeil
url = /~https://github.com/rollbear/trompeloeil.git
branch = v43
6 changes: 6 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ RUN cd $PKGDIR/catch2 && \
cmake -Bbuild -H. -DBUILD_TESTING=OFF && \
cmake --build build/ --target install

# Install trompeloeil
RUN cd $PKGDIR/trompeloeil && \
mkdir build && cd build && \
cmake -G "Unix Makefiles" .. && \
cmake --build . --target install

RUN apt-get -y clean && \
rm -rf /var/lib/apt/lists/*

Expand Down
30 changes: 26 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Installation
```
* Run the container:
```
docker run --rm -it -v $(pwd)/tests:/home/tests ghcr.io/chiamin/hybridleads:latest
docker run --rm -it -v $(pwd):/home ghcr.io/chiamin/hybridleads:latest
```
**Note**: replace the image name `ghcr.io/chiamin/hybridleads:latest` by `hybridleads` if you're building the image by yourself.
* Package version:
Expand All @@ -27,6 +27,7 @@ Installation
* `ITensor v3.1.11`
* `armadillo 11.4.x`
* `Catch2 v3.2.0`
* `trompeloeil v43`
* Environment variables:
The compiling flags for ITensor,
* `CCCOM="g++ -m64 -std=c++17 -fconcepts -fPIC"`
Expand All @@ -53,8 +54,9 @@ cmake -B build
make -C build
```
The resulting executable is ```test.exe``` (in ```tests/build/```).
The resulting executables are ```test_*.exe``` (in ```tests/build/```).
If mocking is needed in the unit test, one may consider [trompeloeil](/~https://github.com/rollbear/trompeloeil).
Run other main executables
--------------------------
Expand All @@ -65,8 +67,28 @@ make -e
```
to use those flags.
Then, for instance, one can run the executable ```itdvp/itdvp.exe``` by
Then, for instance, one can run the executable ```hybridleads/itdvp/itdvp.exe``` by
```
./itdvp.exe input
```
with the parameters been assigned in ```itdvp/input```.
with the parameters been assigned in ```itdvp/input```,
see [here](https://www.itensor.org/docs.cgi?vers=cppv3&page=formulas/input) for the more detailed documentation on input files.
Dependency Management
---------------------
Apart from the known package managers, like [conan](https://conan.io/) or [vcpkg](https://vcpkg.io/), here we adopt git submodule to do the dependency management for few reasons, (i) `ITensor` is unavailable on both ecosystems, and (ii) `itensor.utility` is a personal project and is also unavailable on both ecosystems. Git submodule is a compromised solution.
1. To add a new submodule
```
git submodule add -b {branch_name} {git_repo_url} {folder_name}
```
The optional directory name should be placed under `ext/`, i.e. `{folder_name}` should be something like `ext/{repo_name}`.
If the above command fails, one could also try the manual checkout to specify the branch or tag afterwards.
2. To update an existig submodule to its newest version
```
git submodule update --remote {repo_name}
```
or manually checkout to newer tag or version within the directory where the submodule seats in.
219 changes: 0 additions & 219 deletions check/Corr.h

This file was deleted.

82 changes: 0 additions & 82 deletions check/MyObserver.h

This file was deleted.

Loading

0 comments on commit e4f5039

Please sign in to comment.