Skip to content

Commit

Permalink
Merge pull request #2 from fkfest/auto/from-devel-repo
Browse files Browse the repository at this point in the history
Merge changes from development repository
  • Loading branch information
dnkats authored Jan 22, 2024
2 parents 0dd419b + 1a0f534 commit 195bcde
Show file tree
Hide file tree
Showing 96 changed files with 428,406 additions and 1,201 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/clean_docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Doc Preview Cleanup

on:
pull_request:
types: [closed]

jobs:
doc-preview-cleanup:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout gh-pages branch
uses: actions/checkout@v4
with:
ref: gh-pages
- name: Delete preview and history + push changes
run: |
if [ -d "previews/PR$PRNUM" ]; then
git config user.name "Documenter.jl"
git config user.email "[email protected]"
git rm -rf "previews/PR$PRNUM"
git commit -m "delete preview"
git branch gh-pages-new $(echo "delete history" | git commit-tree HEAD^{tree})
git push --force origin gh-pages-new:gh-pages
fi
env:
PRNUM: ${{ github.event.number }}
36 changes: 36 additions & 0 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Documentation

on:
push:
branches:
- main # update to match your development branch (master, main, dev, trunk, ...)
tags: '*'
pull_request:

jobs:
build:
permissions:
contents: write
statuses: write
runs-on: ubuntu-latest
strategy:
matrix:
julia-version: ['1.9']
julia-arch: [x64]
os: [ubuntu-latest]

steps:
- uses: actions/checkout@v3
- uses: julia-actions/setup-julia@latest
with:
version: ${{ matrix.julia-version }}
arch: ${{ matrix.julia-arch }}
#- name: Install dependencies
#run: julia --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()'
#- name: Build and deploy
- uses: julia-actions/julia-buildpkg@latest
- uses: julia-actions/julia-docdeploy@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # If authenticating with GitHub Actions token
#DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} # If authenticating with SSH deploy key
#run: julia --project=docs/ docs/make.jl
15 changes: 8 additions & 7 deletions .github/workflows/push-to-stable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,32 +11,33 @@ on:
# (this job does not run unless build_and_test is successful)
env:
BOT_TOKEN: ${{ secrets.PRIVATE_TO_PUBLIC_PAT }} # PAT for jph-bot
TARGET_REPO: e-cojl
ORGA_NAME: fkfest
TARGET_REPO: ElemCo.jl
TARGET_BRANCH: main
SOURCE_REPO: e-cojl-devel
SOURCE_REPO: ElemCo.jl-devel
SOURCE_BRANCH: stable

jobs:
push-changes:
runs-on: ubuntu-latest
steps:
- name: checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
ref: stable # unfortunately, cannot use env here, must change manually as well
ref: ${{ env.SOURCE_BRANCH }}
fetch-depth: 0

- name: clone $SOURCE_BRANCH repo
run: |
git clone https://fkfest:[email protected]/fkfest/$TARGET_REPO.git
git clone https://$ORGA_NAME:[email protected]/$ORGA_NAME/$TARGET_REPO.git
cd $TARGET_REPO
git checkout -b auto/from-devel-repo
git config user.name "actions-user"
git config user.email "[email protected]"
- name: pull changes into local copy of public repo from private repo
run: |
cd $TARGET_REPO
git remote add source https://fkfest:[email protected]/fkfest/$SOURCE_REPO
git remote add source https://$ORGA_NAME:[email protected]/$ORGA_NAME/$SOURCE_REPO
git fetch source $SOURCE_BRANCH
- name: merge changes in public repo
run: |
Expand All @@ -53,7 +54,7 @@ jobs:
PR_BODY="This pull request merges changes from the private development repository and was automatically generated by GitHub Actions."
PR_HEAD="auto/from-devel-repo" # branch with changes
PR_BASE="$TARGET_BRANCH"
PR_API_URL=$(curl --silent --request POST --url https://api.github.com/repos/fkfest/$TARGET_REPO/pulls \
PR_API_URL=$(curl --silent --request POST --url https://api.github.com/repos/$ORGA_NAME/$TARGET_REPO/pulls \
--header "authorization: Bearer $BOT_TOKEN" \
--header "content-type: application/json" \
--data "{\"title\":\"$PR_TITLE\",\"body\":\"$PR_BODY\",\"head\":\"$PR_HEAD\",\"base\":\"$PR_BASE\"}" \
Expand Down
29 changes: 29 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Run tests

on:
#push:
#branches:
#- main
pull_request:
branches:
- main

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
julia-version: ['1.9']
julia-arch: [x64]
os: [ubuntu-latest]

steps:
- uses: actions/checkout@v3
- uses: julia-actions/setup-julia@latest
with:
version: ${{ matrix.julia-version }}
arch: ${{ matrix.julia-arch }}
- uses: julia-actions/julia-buildpkg@latest
- uses: julia-actions/julia-runtest@latest
with:
annotate: true
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Manifest.toml
docs/build
examples/*.out
examples/ElemCo.jl-devel
docs/equations/*.bbl
docs/equations/*.blg
docs/equations/*.log
docs/equations/*.out
docs/equations/*.toc
28 changes: 28 additions & 0 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name = "ElemCo"
uuid = "094d408e-8508-40f4-9646-a254980d91ac"
authors = ["Daniel Kats <[email protected]> and contributors"]
version = "1.0.0-DEV"

[deps]
ArgParse = "c7e460c6-2fb9-53a9-8c5b-16f535851c63"
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
DocStringExtensions = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae"
GaussianBasis = "9bb1a3dc-0d1c-467e-84f5-0c4ef701360a"
IterativeSolvers = "42fd0dbc-a981-5370-80f2-aaf504508153"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
MKL = "33e6dc65-8f57-5167-99aa-e5a354878fb2"
Mmap = "a63ad114-7e13-5084-954f-fe012c677804"
NPZ = "15e1cf62-19b3-5cfa-8e77-841668bca605"
Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"
TensorOperations = "6aa20fa7-93e2-5fca-9bc0-fbd0db3c71a2"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[compat]
TensorOperations = ">=3.2.5"
julia = "1.8.5"

[extras]
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["Test"]
76 changes: 66 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,86 @@
# e-Co.jl <img style="float: right;" src="e-coil.png"> <br/><br/>
# ElemCo.jl <img align="right" src="files/coil.png" height=74> <br/><br/>

Julia implementation of various electron-correlation methods (main focus on coupled cluster methods).
The integrals are obtained from a FCIDUMP file or calculated using the `GaussianBasis` package.

## Capabilities

| | Canonical | DF | Only closed-shell |
|:----------|:--------------------:|:------------------:|:-----------------------:|
| RHF | :x: |:heavy_check_mark:|:heavy_exclamation_mark:|
| UHF | :x: |:heavy_check_mark:| |
| BO-HF |:heavy_check_mark: | | |
| MCSCF | :x: |:wrench: | |
| MP2 |:heavy_check_mark: | | |
| CCSD | :heavy_check_mark: | |:heavy_check_mark: |
| RCCSD | :heavy_check_mark: | | |
| UCCSD | :heavy_check_mark: | | |
| ΛCCSD | :heavy_check_mark: | |:heavy_exclamation_mark:|
| CCSD(T) | :heavy_check_mark: | |:heavy_exclamation_mark:|
| ΛCCSD(T) | :heavy_check_mark: | |:heavy_exclamation_mark:|
| FR-CCSD | :heavy_check_mark: | | |
| 2D-CCSD | :heavy_check_mark: | | |
| DCSD | :heavy_check_mark: | |:heavy_check_mark: |
| RDCSD | :heavy_check_mark: | | |
| UDCSD | :heavy_check_mark: | | |
| ΛDCSD | :heavy_check_mark: | |:heavy_exclamation_mark:|
| FR-DCSD | :heavy_check_mark: | | |
| 2D-DCSD | :heavy_check_mark: | | |
| SVD-DCSD | :heavy_check_mark: |:heavy_check_mark:|:heavy_exclamation_mark:|
| SVD-DC-CCSDT|:heavy_check_mark:|:heavy_check_mark:|:heavy_exclamation_mark:|

Julia implementation of various electron-correlation methods (main focus on coupled cluster)
using fcidump/npy interface.

## Getting started

Requirements: julia (>1.8)

Packages: LinearAlgebra, NPZ, Mmap, TensorOperations, Printf, ArgParse, Parameters, MKL(optional)
Packages: LinearAlgebra, NPZ, Mmap, TensorOperations, Printf, IterativeSolvers, GaussianBasis, DocStringExtensions, MKL(optional)

## Usage

For a development version of `ElemCo.jl`, clone the repository and create a symbolic link in the working directory to the `ElemCo.jl-devel` directory:
```
cd <working dir>
ln -s <path_to_e-cojl>/e-co.sh .
ln -s <path_to_ElemCo.jl-devel> .
```

`julia` has to be in the PATH (or modify `e-co.sh`).
Default scratch directory path on Windows is the first environment variable found in the ordered list `TMP`, `TEMP`, `USERPROFILE`.
On all other operating systems `TMPDIR`, `TMP`, `TEMP`, and `TEMPDIR`. If none of these are found, the path `/tmp` is used.
Default scratch folder name is `elemcojlscr`.

Various options are available (use `-h` option for a list of `e-co.jl` options):
Variable names `fcidump`, `geometry` and `basis` are reserved for the file name of FCIDUMP, geometry specification and basis sets, respectively.

### Example
#### DCSD calculation using integrals from a FCIDUMP file
The ground state energy can be calculated using the DCSD method with the following script:
```julia
include("ElemCo.jl-devel/src/ElemCo.jl")
using .ElemCo

fcidump = "../test/H2O.FCIDUMP"
@cc dcsd
```
./e-co.sh [@j "<options to send to julia>"] [-s <scratch dir>] [-m <method name>] [<fcidump file>]
#### DCSD calculation of the water molecule using density-fitted integrals
In order to calculate the ground state energy of the water molecule using the DCSD method, the following script can be used:
```julia
include("ElemCo.jl-devel/src/ElemCo.jl")
using .ElemCo
geometry="bohr
O 0.000000000 0.000000000 -0.130186067
H1 0.000000000 1.489124508 1.033245507
H2 0.000000000 -1.489124508 1.033245507"

basis = Dict("ao"=>"cc-pVDZ",
"jkfit"=>"cc-pvtz-jkfit",
"mp2fit"=>"cc-pvdz-rifit")
@dfhf
@cc dcsd
```
The `@dfhf` macro calculates the density-fitted Hartree-Fock energy and orbitals
and then DCSD calculation is performed using density-fitted integrals.

Further example scripts are provided in the `examples` directory.

Default scratch dir is `./ecojlscr` and default fcidump file is `FCIDUMP`.
Documentation is available at https://elem.co.il.

```
Electron coil
Expand Down
8 changes: 8 additions & 0 deletions docs/Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[deps]
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
ElemCo = "094d408e-8508-40f4-9646-a254980d91ac"
MKL = "33e6dc65-8f57-5167-99aa-e5a354878fb2"

[compat]
Documenter = "1.1"
Binary file added docs/equations/equations.pdf
Binary file not shown.
Loading

0 comments on commit 195bcde

Please sign in to comment.