├── .conda
└── meta.yaml
├── .github
├── ISSUE_TEMPLATE
│ ├── bug_report.md
│ └── feature_request.md
└── workflows
│ ├── api_version_probe.py
│ ├── joss_paper.yml
│ ├── publish-pypi.yml
│ ├── publish_doc_pages.yml
│ ├── unit_test.yml
│ └── update_api.yml
├── .gitignore
├── .pre-commit-config.yaml
├── LICENSE
├── README.md
├── doc
├── Makefile
├── advanced_socket.md
├── advanced_topics.md
├── api_changes.md
├── basic_usage.md
├── conf.py
├── contribute.md
├── examples.md
├── examples
│ ├── external_mlff.md
│ ├── geopt_compare.md
│ ├── internal_mlff.md
│ └── simple_dft.md
├── img
│ ├── fig_sparc_api_overview.svg
│ ├── scheme-SPARC-socke-modes.svg
│ ├── scheme-SPARC-socket-modes.png
│ ├── scheme_api_architecture.png
│ ├── scheme_api_architecture.svg
│ ├── scheme_socket_hetero.png
│ ├── scheme_socket_hetero.svg
│ ├── scheme_sparc_protocol.png
│ ├── scheme_sparc_protocol.svg
│ └── screenshots
│ │ ├── api_update_pr_github.png
│ │ ├── coverage_example.png
│ │ ├── github_action_dispatch.png
│ │ ├── github_pages_setting.png
│ │ └── pypi_publisher_setup.png
├── index.md
├── installation.md
├── maintainers.md
├── maintainers
│ ├── github.md
│ ├── sparc-c-c++.md
│ └── sparc-x-api.md
├── make.bat
├── package_components.md
├── setup_environment.md
├── test_coverage.md
└── troubleshooting.md
├── examples
├── FileIO
│ ├── md
│ │ ├── ab-initio
│ │ │ └── run.py
│ │ └── mlff
│ │ │ └── run.py
│ └── relax
│ │ ├── relax_cell
│ │ └── ab-initio
│ │ │ └── run.py
│ │ └── relax_coords
│ │ ├── ab-initio
│ │ └── run.py
│ │ └── mlff
│ │ └── run.py
├── active_learning
│ ├── example_finetuna_minimal.py
│ └── ft_config_gemnet_gpu.yml
├── env.sh
├── simple_examples
│ ├── ex0-eos.py
│ └── ex1-ase-optimize.py
└── socket
│ ├── md
│ ├── ab-initio
│ │ ├── ase
│ │ │ └── run.py
│ │ └── plumed
│ │ │ └── run.py
│ └── mlff
│ │ └── plumed
│ │ └── run.py
│ ├── relax
│ ├── ab-initio
│ │ ├── cell
│ │ │ └── run.py
│ │ └── coords
│ │ │ └── run.py
│ └── mlff
│ │ └── coords
│ │ └── run.py
│ └── singlepoint
│ ├── spin-paired
│ └── run.py
│ └── spin-polarized
│ └── run.py
├── paper
├── README.md
├── fig
│ ├── fig_socket_hetero.svg
│ └── fig_sparc_api_overview.svg
├── paper.bib
└── paper.md
├── pyproject.toml
├── setup.py
├── sparc
├── __init__.py
├── api.py
├── calculator.py
├── cli.py
├── client.py
├── common.py
├── docparser.py
├── download_data.py
├── io.py
├── psp
│ └── README.md
├── quicktest.py
├── socketio.py
├── sparc_json_api
│ └── parameters.json
├── sparc_parsers
│ ├── __init__.py
│ ├── aimd.py
│ ├── atoms.py
│ ├── geopt.py
│ ├── inpt.py
│ ├── ion.py
│ ├── out.py
│ ├── pseudopotential.py
│ ├── static.py
│ └── utils.py
└── utils.py
└── tests
├── archive
├── read_input.inpt
├── read_input.ion
└── test.py
├── outputs
├── AlSi_primitive_quick_relax.sparc
│ ├── AlSi_primitive_quick_relax.geopt
│ ├── AlSi_primitive_quick_relax.inpt
│ ├── AlSi_primitive_quick_relax.ion
│ ├── AlSi_primitive_quick_relax.out
│ └── output.sparc
├── Al_multi_geopt.sparc
│ ├── 13_Al_3_1.9_1.9_pbe_n_v1.0.psp8
│ ├── SPARC.geopt
│ ├── SPARC.geopt_01
│ ├── SPARC.geopt_02
│ ├── SPARC.inpt
│ ├── SPARC.ion
│ ├── SPARC.out_01
│ ├── SPARC.out_02
│ └── SPARC.restart
├── Al_socket_bfgs.sparc
│ ├── 13_Al_3_1.9_1.9_pbe_n_v1.0.psp8
│ ├── SPARC.inpt
│ ├── SPARC.ion
│ ├── SPARC.out
│ ├── SPARC.static
│ ├── sparc-socket.traj
│ └── sparc.log
├── Al_socket_volchange.sparc
│ ├── 13_Al_3_1.9_1.9_pbe_n_v1.0.psp8
│ ├── SPARC.inpt
│ ├── SPARC.ion
│ ├── SPARC.out
│ ├── SPARC.static
│ ├── single-points
│ │ ├── sp_image00
│ │ │ ├── 13_Al_3_1.9_1.9_pbe_n_v1.0.psp8
│ │ │ ├── SPARC.inpt
│ │ │ ├── SPARC.ion
│ │ │ ├── SPARC.out
│ │ │ ├── SPARC.static
│ │ │ └── sparc.log
│ │ ├── sp_image01
│ │ │ ├── 13_Al_3_1.9_1.9_pbe_n_v1.0.psp8
│ │ │ ├── SPARC.inpt
│ │ │ ├── SPARC.ion
│ │ │ ├── SPARC.out
│ │ │ ├── SPARC.static
│ │ │ └── sparc.log
│ │ ├── sp_image02
│ │ │ ├── 13_Al_3_1.9_1.9_pbe_n_v1.0.psp8
│ │ │ ├── SPARC.inpt
│ │ │ ├── SPARC.ion
│ │ │ ├── SPARC.out
│ │ │ ├── SPARC.static
│ │ │ └── sparc.log
│ │ ├── sp_image03
│ │ │ ├── 13_Al_3_1.9_1.9_pbe_n_v1.0.psp8
│ │ │ ├── SPARC.inpt
│ │ │ ├── SPARC.ion
│ │ │ ├── SPARC.out
│ │ │ ├── SPARC.static
│ │ │ └── sparc.log
│ │ ├── sp_image04
│ │ │ ├── 13_Al_3_1.9_1.9_pbe_n_v1.0.psp8
│ │ │ ├── SPARC.inpt
│ │ │ ├── SPARC.ion
│ │ │ ├── SPARC.out
│ │ │ ├── SPARC.static
│ │ │ └── sparc.log
│ │ ├── sp_image05
│ │ │ ├── 13_Al_3_1.9_1.9_pbe_n_v1.0.psp8
│ │ │ ├── SPARC.inpt
│ │ │ ├── SPARC.ion
│ │ │ ├── SPARC.out
│ │ │ ├── SPARC.static
│ │ │ └── sparc.log
│ │ ├── sp_image06
│ │ │ ├── 13_Al_3_1.9_1.9_pbe_n_v1.0.psp8
│ │ │ ├── SPARC.inpt
│ │ │ ├── SPARC.ion
│ │ │ ├── SPARC.out
│ │ │ ├── SPARC.static
│ │ │ └── sparc.log
│ │ ├── sp_image07
│ │ │ ├── 13_Al_3_1.9_1.9_pbe_n_v1.0.psp8
│ │ │ ├── SPARC.inpt
│ │ │ ├── SPARC.ion
│ │ │ ├── SPARC.out
│ │ │ ├── SPARC.static
│ │ │ └── sparc.log
│ │ ├── sp_image08
│ │ │ ├── 13_Al_3_1.9_1.9_pbe_n_v1.0.psp8
│ │ │ ├── SPARC.inpt
│ │ │ ├── SPARC.ion
│ │ │ ├── SPARC.out
│ │ │ ├── SPARC.static
│ │ │ └── sparc.log
│ │ └── sp_image09
│ │ │ ├── 13_Al_3_1.9_1.9_pbe_n_v1.0.psp8
│ │ │ ├── SPARC.inpt
│ │ │ ├── SPARC.ion
│ │ │ ├── SPARC.out
│ │ │ ├── SPARC.static
│ │ │ └── sparc.log
│ └── sparc.log
├── Alloy_geopt_ppd_bc.sparc
│ ├── SPARC.geopt
│ ├── SPARC.inpt
│ ├── SPARC.ion
│ └── SPARC.out
├── Cu_FCC.sparc
│ ├── Cu_FCC.inpt
│ ├── Cu_FCC.ion
│ ├── Cu_FCC.out
│ └── Cu_FCC.static
├── Fe2_spin_scan_gamma.sparc
│ ├── Fe2_spin_scan_gamma.inpt
│ ├── Fe2_spin_scan_gamma.ion
│ ├── Fe2_spin_scan_gamma.out
│ └── Fe2_spin_scan_gamma.static
├── H2O_sheet_yz.sparc
│ ├── H2O_sheet.inpt
│ ├── H2O_sheet.ion
│ ├── H2O_sheet.out
│ ├── H2O_sheet.static
│ └── output.sparc
├── H2O_socket_incomplete.sparc
│ ├── 01_H_1_1.0_1.0_pbe_v1.0.psp8
│ ├── 08_O_6_1.2_1.4_pbe_n_v1.0.psp8
│ ├── SPARC.inpt
│ ├── SPARC.ion
│ ├── SPARC.out
│ ├── SPARC.static
│ └── sparc.log
├── H2O_wire_z.sparc
│ ├── H2O_wire.inpt
│ ├── H2O_wire.ion
│ ├── H2O_wire.out
│ ├── H2O_wire.static
│ └── output.sparc
├── MoO3_hubbard.sparc
│ ├── MoO3_hubbard.inpt
│ ├── MoO3_hubbard.ion
│ ├── MoO3_hubbard.out
│ └── MoO3_hubbard.static
├── NH3_sort_lbfgs_opt.sparc
│ ├── 01_H_1_1.0_1.0_pbe_v1.0.psp8
│ ├── 07_N_5_1.2_1.4_pbe_n_v1.0.psp8
│ ├── SPARC.geopt
│ ├── SPARC.inpt
│ ├── SPARC.ion
│ ├── SPARC.out
│ ├── SPARC.restart
│ └── sparc.log
├── Si8_cell_geopt_relax2.sparc
│ ├── Si8_cell_geopt.geopt
│ ├── Si8_cell_geopt.inpt
│ ├── Si8_cell_geopt.ion
│ └── Si8_cell_geopt.out
├── SiH4_quick.sparc
│ ├── SiH4_quick.inpt
│ ├── SiH4_quick.ion
│ ├── SiH4_quick.out
│ └── SiH4_quick.static
├── TiO2_orthogonal_quick_md.sparc
│ ├── TiO2_orthogonal_quick_md.aimd
│ ├── TiO2_orthogonal_quick_md.inpt
│ ├── TiO2_orthogonal_quick_md.ion
│ └── TiO2_orthogonal_quick_md.out
└── WSe2_helix_static.sparc
│ ├── WSe2_cyclix.inpt
│ ├── WSe2_cyclix.ion
│ ├── WSe2_cyclix.out
│ └── WSe2_cyclix.static
├── psps
├── 33_As_15_1.8_2.1_pbe_n_v1.0.psp8
├── 47_Ag_19_1.9_2.5_pbe_n_v1.0.psp8
├── Ag-LDA.pot
├── Ag-PBE.pot
└── As-pbe-bad.psp8
├── sparc-latex-doc-202302
├── Electrostatics.tex
├── Introduction.tex
├── MD.tex
├── Manual.tex
├── Optimization.tex
├── Paral.tex
├── Print.tex
├── SCF.tex
├── Stress.tex
├── System.tex
└── highT
│ ├── Introduction.tex
│ ├── Manual_highT.tex
│ └── SQ.tex
├── sparc-latex-socket-202401
├── BandStructure.tex
├── Electrostatics.tex
├── Introduction.tex
├── MD.tex
├── Manual.tex
├── Optimization.tex
├── Paral.tex
├── Print.tex
├── SCF.tex
├── Socket.tex
├── Stress.tex
├── System.tex
├── cyclix
│ ├── FAQs.tex
│ ├── Introduction.tex
│ ├── Manual_cyclix.tex
│ └── cyclix.tex
└── highT
│ ├── Introduction.tex
│ ├── Manual_highT.tex
│ └── SQ.tex
├── test_000_ase_io.py
├── test_aimd_parser.py
├── test_api_version.py
├── test_bundle_to_calc.py
├── test_calculator.py
├── test_docparser.py
├── test_downloader.py
├── test_geopt_parser.py
├── test_gui.py
├── test_hubbard.py
├── test_import.py
├── test_inpt_parser.py
├── test_ion_parser.py
├── test_output_parser.py
├── test_parse_atoms.py
├── test_parser_utils.py
├── test_psp.py
├── test_quicktest.py
├── test_read_all_examples.py
├── test_read_sparc.py
├── test_socket.py
├── test_sparc_bundle.py
├── test_sparc_input_api.py
└── test_static_parser.py
/.conda/meta.yaml:
--------------------------------------------------------------------------------
1 | {% set name = "SPARC-X-API" %}
2 | {% set version = "1.0.0" %}
3 | {% set file_ext = "tar.gz" %}
4 | {% set readme = load_file_regex(load_file="README.md", regex_pattern=".*")[0] %}
5 |
6 | package:
7 | name: '{{ name|lower }}'
8 | version: '{{ version }}'
9 |
10 | source:
11 | path: ../
12 |
13 | build:
14 | noarch: python
15 | # Install and include the psp files
16 | script: "{{ PYTHON }} -m pip install . --no-deps -vv && cd .. && {{ PYTHON }} -m sparc.download_data"
17 | entry_points:
18 | - "sparc-ase = sparc.cli:main"
19 |
20 |
21 | requirements:
22 | host:
23 | - "python>=3.8"
24 | - pip
25 | run:
26 | - "python>=3.8"
27 | - "ase>=3.22"
28 |
29 | about:
30 | home: https://github.com/SPARC-X/{{ name }}
31 | license: GNU General Public License v3.0
32 | license_family: GPL3
33 | license_file: LICENSE
34 | summary: A Python API for the SPARC DFT Code
35 | description: {{ readme }}
36 | doc_url: https://github.com/SPARC-X/{{ name }}/blob/master/README.md
37 | dev_url: https://github.com/SPARC-X/{{ name }}
38 |
39 | extra:
40 | recipe-maintainers: Tian Tian (alchem0x2a@gmail.com)
41 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/bug_report.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Bug report
3 | about: Create a report to help us improve
4 | title: ''
5 | labels: bug
6 | assignees: ''
7 |
8 | ---
9 |
10 | **Describe the bug**
11 | A concise description of the problem.
12 |
13 | **To Reproduce**
14 | Provide a minimal list of settings / codes to help us debug, such as
15 | - Python version
16 | - Version (git commit hash) of `SPARC-X-API`
17 | - `SPARC` C-code version (see the SPARC .out file header)
18 | - Your platform and architecture
19 |
20 | **Expected behavior**
21 | What is the code intended to achieve?
22 |
23 | **Actual output or error trace**
24 | Include the console output should be enough
25 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/feature_request.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Feature request
3 | about: Suggest an idea for this project
4 | title: ''
5 | labels: enhancement
6 | assignees: ''
7 |
8 | ---
9 |
10 | **Is your feature request related to a problem? Please describe.**
11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12 |
13 | **Describe the solution you'd like**
14 | A clear and concise description of what you want to happen.
15 |
16 | **Describe alternatives you've considered**
17 | A clear and concise description of any alternative solutions or features you've considered.
18 |
19 | **Additional context**
20 | Add any other context or screenshots about the feature request here.
21 |
--------------------------------------------------------------------------------
/.github/workflows/api_version_probe.py:
--------------------------------------------------------------------------------
1 | import sys
2 |
3 | from packaging import version
4 |
5 | from sparc.api import SparcAPI # Replace with your actual module import
6 |
7 |
8 | def compare_versions():
9 | default_version = SparcAPI().sparc_version
10 | new_version = SparcAPI(json_api="parameters.json").sparc_version
11 | print(f"Default api version: {default_version}, upstream version {new_version}")
12 |
13 | if version.parse(default_version) < version.parse(new_version):
14 | print(f"Version changed from {default_version} to {new_version}")
15 | sys.exit(1)
16 | else:
17 | print("No version change")
18 | sys.exit(0)
19 |
20 |
21 | if __name__ == "__main__":
22 | compare_versions()
23 |
--------------------------------------------------------------------------------
/.github/workflows/joss_paper.yml:
--------------------------------------------------------------------------------
1 | name: Draft Paper for JOSS
2 | on:
3 | push:
4 | paths:
5 | - paper/**
6 | - .github/workflows/joss_paper.yml
7 | pull_request:
8 | paths:
9 | - paper/**
10 | - .github/workflows/joss_paper.yml
11 | workflow_dispatch:
12 |
13 | jobs:
14 | paper:
15 | runs-on: ubuntu-latest
16 | name: Paper Draft
17 | steps:
18 | - name: Checkout
19 | uses: actions/checkout@v4
20 | - name: Build draft PDF
21 | uses: openjournals/openjournals-draft-action@master
22 | with:
23 | journal: joss
24 | paper-path: paper/paper.md
25 | - name: Upload
26 | uses: actions/upload-artifact@v4
27 | with:
28 | name: paper
29 | path: paper/paper.pdf
30 |
--------------------------------------------------------------------------------
/.github/workflows/publish-pypi.yml:
--------------------------------------------------------------------------------
1 | name: Publish PyPI package
2 |
3 | on:
4 | # The workflow runs on each push / PR but only allow upload
5 | # PyPI when tagged
6 | release:
7 | types:
8 | - created
9 | workflow_dispatch:
10 |
11 | jobs:
12 | publish-pypi:
13 | name: upload release to PyPI
14 | runs-on: ubuntu-latest
15 | # Specifying a GitHub environment is optional, but strongly encouraged
16 | environment: pypi
17 | permissions:
18 | # IMPORTANT: this permission is mandatory for trusted publishing
19 | id-token: write
20 |
21 | steps:
22 | - uses: actions/checkout@v4
23 | - uses: conda-incubator/setup-miniconda@v3
24 | with:
25 | python-version: "3.11"
26 | mamba-version: "*"
27 | channels: conda-forge,defaults
28 | channel-priority: true
29 | activate-environment: sparc-api-test
30 | - name: Install dependencies
31 | run: |
32 | pip install -U build
33 | - name: Download data
34 | run: |
35 | # Download the external psp data
36 | python -m sparc.download_data
37 | # Check if psp8 exists
38 | ls sparc/psp/*.psp8
39 | - name: Build wheel
40 | run: |
41 | # Wheels are inside dist/ folder
42 | python -m build
43 | # Check the contents, if psp exists
44 | TMP_DIR=$(mktemp -d)
45 | unzip dist/sparc_x_api-*.whl -d ${TMP_DIR}
46 | find $TMP_DIR/sparc/psp -name "*.psp8"
47 |
48 | - name: Publish package distributions to PyPI
49 | uses: pypa/gh-action-pypi-publish@release/v1
50 | with:
51 | packages-dir: dist/
52 | if: github.event.release.draft == false
53 |
--------------------------------------------------------------------------------
/.github/workflows/publish_doc_pages.yml:
--------------------------------------------------------------------------------
1 | name: Publish Document Pages for SPARC-X-API
2 |
3 | # SPARC source code components are also parsed at each submission
4 | on:
5 | push:
6 | branches:
7 | - master
8 | - badges
9 | paths:
10 | - 'doc/**'
11 | - 'sparc/**'
12 | - '.coverage'
13 | - '.github/workflows/publish_doc_pages.yml'
14 | pull_request:
15 | branches:
16 | - master
17 | - badges
18 | paths:
19 | - 'doc/**'
20 | - 'sparc/**'
21 | - '.coverage'
22 | - '.github/workflows/publish_doc_pages.yml'
23 |
24 | workflow_dispatch:
25 |
26 | jobs:
27 | sphinx-build:
28 | defaults:
29 | run:
30 | shell: bash -l {0}
31 | runs-on: ubuntu-latest
32 |
33 | steps:
34 | - uses: actions/checkout@v4
35 | - name: Checkout the latest .coverage file from badges branch
36 | uses: actions/checkout@v4
37 | with:
38 | ref: badges
39 | path: coverage
40 | - name: List current files
41 | run: |
42 | if [ -f coverage/.coverage ]; then
43 | cp coverage/.coverage .
44 | fi
45 | ls -al coverage/
46 | ls -al .
47 | - uses: conda-incubator/setup-miniconda@v3
48 | with:
49 | python-version: "3.11"
50 | mamba-version: "*"
51 | channels: conda-forge,defaults
52 | channel-priority: true
53 | activate-environment: sparc-api-build-doc
54 | - name: Install doc-build dependencies
55 | run: |
56 | pip install -e ".[doc]"
57 | - name: Generate coverage files
58 | run: |
59 | mkdir -p doc/_static
60 | if [ -f .coverage ]; then
61 | coverage html --omit="tests/*.py" -d doc/_static/htmlcov
62 | fi
63 | ls -al .
64 | ls -al doc/_static
65 | - name: Build sphix doc
66 | run: |
67 | cd doc
68 | make clean && make html
69 | - name: Deploy to github pages
70 | uses: peaceiris/actions-gh-pages@v4
71 | if: github.ref == 'refs/heads/master' && (github.event_name != 'pull_request')
72 | with:
73 | github_token: ${{ secrets.GITHUB_TOKEN }}
74 | publish_branch: gh_pages
75 | publish_dir: doc/_build/html
76 | - name: Upload preview when creating pull request
77 | if: github.event_name == 'pull_request'
78 | uses: actions/upload-artifact@v4
79 | with:
80 | name: docs_build_preview
81 | path: doc/_build/html
82 |
--------------------------------------------------------------------------------
/.github/workflows/update_api.yml:
--------------------------------------------------------------------------------
1 | name: Update JSON API (recurring job)
2 |
3 | on:
4 | push:
5 | branches:
6 | - master
7 | pull_request:
8 | branches:
9 | - master
10 | schedule:
11 | - cron: '0 0 * * *' # Runs every day at midnight
12 | workflow_dispatch:
13 |
14 | jobs:
15 | update-api:
16 | defaults:
17 | run:
18 | shell: bash -l {0}
19 | runs-on: ubuntu-latest
20 | # Only the upstream repo runs the automatic API update
21 | if: |
22 | !github.event.repository.fork || github.event_name == 'workflow_dispatch'
23 |
24 | steps:
25 | - uses: actions/checkout@v4
26 | - uses: conda-incubator/setup-miniconda@v2
27 | with:
28 | python-version: "3.11"
29 | mamba-version: "*"
30 | channels: conda-forge,alchem0x2a,defaults
31 | channel-priority: true
32 | activate-environment: sparc-api-test
33 | - name: Install package
34 | run: |
35 | pip install -e ".[test]"
36 | - name: Generate json api from github master
37 | run: |
38 | python -m sparc.docparser --git --include-subdirs
39 | - name: Env variable for api version
40 | run: |
41 | python -c "from sparc.api import SparcAPI; import os; ver=SparcAPI('parameters.json').sparc_version; os.system(f'echo API_VERSION={ver} >> $GITHUB_ENV')"
42 | - name: Test if json api is newer than current
43 | id: probe
44 | run: |
45 | # exit 0 --> no version change
46 | if python .github/workflows/api_version_probe.py; then
47 | echo "UPDATE_NEEDED=false" >> $GITHUB_ENV
48 | else
49 | echo "UPDATE_NEEDED=true" >> $GITHUB_ENV
50 | fi
51 | echo UPDATE_NEEDED is "${UPDATE_NEEDED}"
52 | echo API version is "${API_VERSION}"
53 | continue-on-error: true
54 | - name: Create or Update Pull Request
55 | # Manually disable to make sure it can rerun
56 | if: env.UPDATE_NEEDED == 'true'
57 | uses: peter-evans/create-pull-request@v7
58 | with:
59 | token: ${{ secrets.GITHUB_TOKEN }}
60 | commit-message: |
61 | Update JSON API to version ${{ env.API_VERSION }}
62 |
63 | The commit is created by a scheduled CI job.
64 | ""
65 | branch: update-api-${{ env.API_VERSION }}
66 | title: "[Automated] Update JSON API to version ${{ env.API_VERSION }}"
67 | body: |
68 | ## Automated JSON API Update
69 |
70 | Hello! This is an automatic pull request to merge the new JSON API to version **${{ env.API_VERSION }}**.
71 |
72 | ### Details
73 | - **Workflow Trigger:** Update JSON API (recurring job).
74 | - **Reason for Update:** A new JSON schema version was generated that differs from the existing one in the repository.
75 |
76 | ### Notes
77 | - If you notice any issues or have questions regarding this update, please reach out to the maintainers.
78 |
79 | # Eliminate unnecessary PRs if not closed
80 | delete-branch: true
81 | # Prevent PRs on forks
82 | base: master
83 | delete-branch: true
84 | base: master
85 |
--------------------------------------------------------------------------------
/.pre-commit-config.yaml:
--------------------------------------------------------------------------------
1 | # Pre-commit hooks for SPARC-X-API
2 | # Use pre-commit rn
3 | exclude: "^tests/outputs/|^tests/psps/|^tests/sparc-latex-.*/|^tests/archive/|^sparc/sparc_json_api/"
4 | repos:
5 | - repo: https://github.com/pre-commit/pre-commit-hooks
6 | rev: v2.3.0
7 | hooks:
8 | - id: check-yaml
9 | exclude: ".conda/meta.yaml"
10 | - id: end-of-file-fixer
11 | - id: trailing-whitespace
12 |
13 | - repo: https://github.com/pycqa/isort
14 | rev: 5.12.0
15 | hooks:
16 | - id: isort
17 | name: isort (python)
18 | args: ["--profile", "black"]
19 |
20 | - repo: https://github.com/psf/black
21 | rev: 22.10.0
22 | hooks:
23 | - id: black
24 |
--------------------------------------------------------------------------------
/doc/Makefile:
--------------------------------------------------------------------------------
1 | # Minimal makefile for Sphinx documentation
2 | #
3 |
4 | # You can set these variables from the command line, and also
5 | # from the environment for the first two.
6 | SPHINXOPTS ?=
7 | SPHINXBUILD ?= sphinx-build
8 | SPHINXDOC ?= sphinx-apidoc
9 | SOURCEDIR = .
10 | BUILDDIR = _build
11 |
12 | # Put it first so that "make" without argument is like "make help".
13 | help:
14 | @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
15 |
16 | # Build the api doc --> doc/api/modules.rst
17 | apidoc:
18 | @$(SPHINXDOC) -f -e -M -o "$(SOURCEDIR)"/api "$(SOURCEDIR)"/../sparc
19 |
20 |
21 | .PHONY: help Makefile apidoc coverage
22 |
23 | # Catch-all target: route all unknown targets to Sphinx using the new
24 | # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
25 | %: Makefile
26 | @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
27 |
28 | html: apidoc
29 |
30 | # Reuse the make clean rule from sphinx and remove api/
31 | clean:
32 | @$(SPHINXBUILD) -M clean "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
33 | @$(SPHINXBUILD) -M clean "$(SOURCEDIR)" "$(SOURCEDIR)"/api $(SPHINXOPTS) $(O)
34 |
--------------------------------------------------------------------------------
/doc/api_changes.md:
--------------------------------------------------------------------------------
1 | # Changes in API
2 | ## Major changes from [v1.0](https://github.com/SPARC-X/SPARC-X-API/tree/v1.0.0)
3 |
4 | - Support of socket communication layer
5 | - Migration to ASE 3.23 standard
6 | - Enhanced documents
7 |
8 | ## Major changes from [v0.1](https://github.com/SPARC-X/SPARC-X-API/tree/eac557f214b402122a506f88f38c7a8767283503)
9 |
10 | SPARC-X-API has been heavily refactored in v1.0. If you're using legacy Python codes
11 | that are written under v0.1 API, there are a few major changes that require your attention:
12 |
13 | 1. Support for single `.ion` file format is deprecated. Instead, v1.0 API treats the whole SPARC directory as a bundle format. Please use `read_sparc` and `write_sparc` methods for basic file I/O instead.
14 | Nevertheless, reading calculation results generated by a v0.1 API code will not be affected.
15 |
16 | 2. v1.0 API uses a different mapping scheme for the sorting of ASE atoms objects (similar to `Vasp`), add a comment section in `.ion` file similar to follows:
17 | ```python
18 | # ASE-SORT:
19 | # 3 2 1 0
20 | # END ASE-SORT
21 | ```
22 | which maps atoms 3, 2, 1, 0 from the SPARC .ion file order to
23 | atoms 0, 1, 2, 3 in ASE order. This is useful for systems that are
24 | constructed by ASE's `add_adsorbate` method.
25 |
26 | 3. v1.0 API accepts all SPARC internal parameters
27 | (i.e. **CAPITALIZED**) in *atomic units* for consistency reason.
28 | However, we also keep a list of "special input params" that are
29 | conventionally used in other ASE calculators, that use Å / eV / GPa /
30 | fs unit system.
31 |
32 | 4. Defining `LATVEC`, `LATVEC_SCALE`, or `CELL` via the calculator
33 | parameters is no longer encouraged. Instead, all structure changes
34 | should be made to the `Atoms` object.
35 |
36 | Below are a list of v0.1 method of the `SPARC` calculator and their current status in v1.0 API.
37 | `calc` is an instance of `sparc.SPARC`.
38 |
39 | | old methods | status in v1.0 API | alternatives |
40 | |------------------------|--------------------|------------------------------------|
41 | | `interpret_grid_input` | deprecated | `calc.set(fd_grid=[20, 20, 20])` |
42 | | `interpret_kpoint_input` | deprecated | `calc.set(kpts=[3, 3, 3])` |
43 | | `interpret_downsampling_input` | deprecated | Manual setting not recommended |
44 | | `interpret_kpoint_shift` | deprecated | `calc.set(kpoint_shift=[0, 0, 0])` |
45 | | `get_pseudopotential_directory` | deprecated | `calc.psp_dir` |
46 | | `get_nstates` | maintained | |
47 | | `setup_parallel_env` | deprecated | Manual set |
48 | | `generate_command` | deprecated | `calc._make_command()` |
49 | | `estimate_memory` | maintained | |
50 | | `get_scf_steps` | maintained | |
51 | | `get_geometric_steps` | deprecated | `calc.get_number_of_ionic_steps()`|
52 | | `get_runtime` | maintained | |
53 | | `get_fermi_level` | maintained | |
54 | | `concatinate_output` | deprecated | Use `sparc.SparcBundle` instead |
55 | | `read_line` | deprecated | Use `sparc.SparcBundle` instead |
56 | | `parse_output` | deprecated | `calc.read_results()` |
57 | | `parse_relax` | deprecated | `calc.read_results()` |
58 | | `parse_md` | deprecated | `calc.read_results()` |
59 | | `parse_input_args` | deprecated | `calc.set(**kwargs)` |
60 | | `recover_index_order_from_ion_file` | deprecated | Use `calc.sort` and `calc.resort` |
61 | | `atoms_dict` | deprecated | Use third party library like `bson` |
62 | | `dict_atoms` | deprecated | Use third party library like `bson` |
63 |
--------------------------------------------------------------------------------
/doc/conf.py:
--------------------------------------------------------------------------------
1 | # Configuration file for the Sphinx documentation builder.
2 | #
3 | # For the full list of built-in configuration values, see the documentation:
4 | # https://www.sphinx-doc.org/en/master/usage/configuration.html
5 |
6 | # -- Project information -----------------------------------------------------
7 | # https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
8 |
9 | project = "SPARC-X-API"
10 | copyright = "2024, SPARC-X Developmers"
11 | author = "Tian Tian, Lucas R Timmerman, Ben Comer"
12 |
13 |
14 | # -- General configuration ---------------------------------------------------
15 | # https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
16 |
17 | extensions = [
18 | "sphinx.ext.githubpages",
19 | "sphinx.ext.coverage",
20 | "sphinx.ext.autodoc",
21 | "sphinx.ext.napoleon", # For Google/NumPy style docstrings
22 | "sphinx.ext.autosummary",
23 | "sphinx.ext.viewcode", # Adds links to source code
24 | "myst_parser",
25 | ]
26 |
27 | source_suffix = {
28 | ".md": "markdown",
29 | ".txt": "markdown",
30 | ".rst": "restructuredtext",
31 | }
32 |
33 | templates_path = ["_templates"]
34 | exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
35 |
36 |
37 | # -- Options for HTML output -------------------------------------------------
38 | # https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
39 |
40 | html_theme = "sphinx_rtd_theme"
41 | html_static_path = ["_static"]
42 | html_context = {
43 | "display_github": True, # Integrate GitHub
44 | "github_user": "sparc-x", # Username
45 | "github_repo": "SPARC-X-API", # Repo name
46 | "github_version": "master", # Version
47 | "conf_py_path": "/doc/", # Path in the checkout to the docs root
48 | }
49 |
50 | myst_enable_extensions = [
51 | "html_admonition",
52 | ]
53 |
54 | coverage_Show_missing_items = True
55 | autosummary_generate = True
56 |
--------------------------------------------------------------------------------
/doc/examples.md:
--------------------------------------------------------------------------------
1 | # Examples
2 |
3 | For template scripts utilizing the API in socket mode and via FileIO mode, see the `examples/` directory in the [github repo](https://github.com/SPARC-X/SPARC-X-API/tree/master/examples).
4 |
5 | Please check the following topics for a brief overview of
6 | SPARC-X-API's capabilities and features.
7 |
8 |
9 | ```{toctree}
10 | :maxdepth: 2
11 | :caption: Topics
12 | examples/simple_dft.md
13 | examples/geopt_compare.md
14 | examples/internal_mlff.md
15 | examples/external_mlff.md
16 | ```
17 |
--------------------------------------------------------------------------------
/doc/examples/simple_dft.md:
--------------------------------------------------------------------------------
1 | # Simple DFT workflows with SPARC-X-API
2 |
3 | As documentation for [basic usage](../basic_usage.md) shows, replacing an
4 | existing DFT-based workflow using SPARC-X-API calculator interface can
5 | be as easy as simply swapping the calculator instance to `sparc.SPARC`
6 | from other codes like VASP, QE or GPAW.
7 |
8 | Here we show a simple example that calculates the equation of state
9 | (EOS) of bulk aluminum and determine its optimal lattice constant,
10 | adapted from GPAW's
11 | [tutorial](https://wiki.fysik.dtu.dk/gpaw/tutorialsexercises/structureoptimization/lattice_constants/lattice_constants.html). The full python script for this example can be downloaded [here](https://raw.githubusercontent.com/SPARC-X/SPARC-X-API/refs/heads/master/examples/simple_examples/ex0-eos.py).
12 |
13 | In
14 | the GPAW tutorial, a GPAW calculator in Planewave (PW) mode is created
15 | like follows:
16 |
17 | ```{code} python
18 | from gpaw import GPAW, PW
19 | calc = GPAW(mode=PW(ecut),
20 | xc='PBE',
21 | kpts=(8, 8, 8),
22 | basis='dzp',
23 | txt=f'Al-{ecut}.txt')
24 | ```
25 |
26 | We can create a SPARC-X-API calculator using similar parameters. Note
27 | that in real-space DFT, the parameter mesh spacing (`h`) controls the
28 | convergence. To avoid large "egg-box effect" due to large mesh
29 | spacing, we recommend to use a smaller `h` value. For demonstration
30 | purpose a rather rough mesh spacing `h=0.25` (in Angstrom) and a 3x3x3
31 | k-points are used.
32 |
33 | ```{code} python
34 | import numpy as np
35 | from ase.build import bulk
36 | from ase.eos import calculate_eos
37 |
38 | from sparc import SPARC
39 |
40 |
41 | def main():
42 | # Al in conventional cell
43 | atoms = bulk("Al", cubic=True)
44 | calc = SPARC(h=0.25, kpts=(3, 3, 3), xc="pbe", directory="ex0-eos")
45 | vol = atoms.get_volume()
46 | atoms.calc = calc
47 | eos = calculate_eos(atoms, npoints=5, eps=0.05, trajectory="al-eos-sparc.traj")
48 | print("Original volume: Ang^3", vol)
49 | v, e, B = eos.fit()
50 | print("Fitted volume (Ang^3), energy (eV), modulus (eV/Ang^3)")
51 | print(v, e, B)
52 | a0 = v ** (1 / 3)
53 | print(f"Optimal cell length (cubic): {a0} Ang")
54 | atoms.set_cell([a0, a0, a0], scale_atoms=True)
55 | e0_sparc = atoms.get_potential_energy()
56 | print(f"Energy calculated by SPARC: {e0_sparc} eV")
57 | print(f"Energy diff {abs(e0_sparc - e)} eV")
58 | return
59 |
60 |
61 | if __name__ == "__main__":
62 | main()
63 | ```
64 |
65 | The output from the above example may look like:
66 | ```
67 | Fitted volume (Ang^3), energy (eV), modulus (eV/Ang^3)
68 | 65.97840834969949 -253.07755156337953 2.9095110471623173
69 | Optimal cell length (cubic): 4.040799280428726 Ang
70 | Energy calculated by SPARC: -253.0552324051582 eV
71 | Energy diff 0.02231915822133601 eV
72 | ```
73 |
74 | ```{note}
75 | This example uses file I/O mode for demonstration purpose only. Consider choosing the [socket mode](../advanced_socket.md) if you need more flexibility.
76 | ```
77 |
--------------------------------------------------------------------------------
/doc/img/scheme-SPARC-socket-modes.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SPARC-X/SPARC-X-API/12422228c142965d7decf5b64db57d07e98a6a8c/doc/img/scheme-SPARC-socket-modes.png
--------------------------------------------------------------------------------
/doc/img/scheme_api_architecture.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SPARC-X/SPARC-X-API/12422228c142965d7decf5b64db57d07e98a6a8c/doc/img/scheme_api_architecture.png
--------------------------------------------------------------------------------
/doc/img/scheme_socket_hetero.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SPARC-X/SPARC-X-API/12422228c142965d7decf5b64db57d07e98a6a8c/doc/img/scheme_socket_hetero.png
--------------------------------------------------------------------------------
/doc/img/scheme_sparc_protocol.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SPARC-X/SPARC-X-API/12422228c142965d7decf5b64db57d07e98a6a8c/doc/img/scheme_sparc_protocol.png
--------------------------------------------------------------------------------
/doc/img/screenshots/api_update_pr_github.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SPARC-X/SPARC-X-API/12422228c142965d7decf5b64db57d07e98a6a8c/doc/img/screenshots/api_update_pr_github.png
--------------------------------------------------------------------------------
/doc/img/screenshots/coverage_example.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SPARC-X/SPARC-X-API/12422228c142965d7decf5b64db57d07e98a6a8c/doc/img/screenshots/coverage_example.png
--------------------------------------------------------------------------------
/doc/img/screenshots/github_action_dispatch.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SPARC-X/SPARC-X-API/12422228c142965d7decf5b64db57d07e98a6a8c/doc/img/screenshots/github_action_dispatch.png
--------------------------------------------------------------------------------
/doc/img/screenshots/github_pages_setting.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SPARC-X/SPARC-X-API/12422228c142965d7decf5b64db57d07e98a6a8c/doc/img/screenshots/github_pages_setting.png
--------------------------------------------------------------------------------
/doc/img/screenshots/pypi_publisher_setup.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SPARC-X/SPARC-X-API/12422228c142965d7decf5b64db57d07e98a6a8c/doc/img/screenshots/pypi_publisher_setup.png
--------------------------------------------------------------------------------
/doc/index.md:
--------------------------------------------------------------------------------
1 | ```{include} ../README.md
2 | :relative-docs: doc/
3 | :relative-images:
4 | ```
5 |
6 |
7 |
8 |
9 | ```{toctree}
10 | :maxdepth: 2
11 | :caption: Contents
12 | installation.md
13 | setup_environment.md
14 | basic_usage.md
15 | advanced_socket.md
16 | examples.md
17 | package_components.md
18 | advanced_topics.md
19 | api_changes.md
20 | contribute.md
21 | maintainers.md
22 | ```
23 |
--------------------------------------------------------------------------------
/doc/maintainers.md:
--------------------------------------------------------------------------------
1 | # Documentation for Maintainers
2 |
3 | This part contains maintenance guidelines for SPARC-X-API core
4 | developers. For general guidelines regarding how to contribute to this
5 | project please refer to the [how to contribute](contribute.md) page.
6 |
7 | Most of the tasks in this documentation require `maintain` or `admin`
8 | role for the repository. Please check the following topics for details:
9 |
10 | ```{toctree}
11 | :maxdepth: 2
12 | :caption: Topics
13 | maintainers/github.md
14 | maintainers/sparc-x-api.md
15 | maintainers/sparc-c-c++.md
16 | ```
17 |
--------------------------------------------------------------------------------
/doc/maintainers/github.md:
--------------------------------------------------------------------------------
1 | ## Github Settings
2 | ### Remote Branches
3 |
4 | There are multiple branches required for the CI/CD workflow in
5 | SPARC-X-API. Push / pull request to these branches should only be made by automatic github actions.
6 |
7 | - [`badges`](https://github.com/SPARC-X/SPARC-X-API/tree/badges):
8 | branch for maintaining the svg badges (package version, CI status,
9 | etc.)
10 |
11 | A list of svg badges can be found under `badges/` directory of this
12 | branch. See [the development guide](#doc-edit) for how to add /
13 | modify badges to be shown in the README.
14 |
15 | - [`gh_pages`](https://github.com/SPARC-X/SPARC-X-API/tree/gh_pages):
16 | branch to publish the documentation site.
17 |
18 |
19 | ### Github Pages
20 |
21 | To allow pushed to the `gh_pages` branches to be automatically
22 | deployed to the document pages, go to the [pages
23 | setting](https://github.com/SPARC-X/SPARC-X-API/settings/pages) and
24 | set the "Source" to "Deploy from a branch", as well as "Branch" to
25 | "gh_pages", as shown in the UI screenshot below:
26 |
27 | 
28 |
29 |
30 | ### Secrets
31 |
32 | Environment secrets (such as PyPI access key) can be configured in the
33 | [secrets
34 | setting](https://github.com/SPARC-X/SPARC-X-API/settings/secrets/actions)
35 | panel. Please check the [github
36 | documentation](https://docs.github.com/en/actions/security-for-github-actions/security-guides/using-secrets-in-github-actions)
37 | for more details.
38 |
39 | (cicd-sparc-x-api)=
40 | ## Managing CI/CD Pipelines
41 |
42 | CI/CD pipelines in the SPARC-X-API repo are managed by Github
43 | workflows, consisting of multiple "Actions". Workflow configuration
44 | YAML files are placed under `.github/workflows/` and the workflow
45 | status can be checked at the [Actions
46 | page](https://github.com/SPARC-X/SPARC-X-API/actions). Please take a
47 | look at the official [documentation for
48 | actions](https://docs.github.com/en/actions) to get familiar with the syntax.
49 |
50 | All workflows in the SPARC-X-API are designed to be able to run from
51 | manual dispatch (with the `workflow_dispatch` enabled in the YAML
52 | files) for debug purposes, from the "Run workflow" drop panel in the
53 | [actions
54 | page](https://github.com/SPARC-X/SPARC-X-API/actions/workflows), as
55 | shown in the screenshot below:
56 |
57 | 
58 |
59 | - [Unit-test
60 | workflow](https://github.com/SPARC-X/SPARC-X-API/blob/master/.github/workflows/unit_test.yml)
61 | includes several steps to run unit and coverage test.
62 |
63 | - The steps `Create badges` and ` Manually add git badges` defines how
64 | the status badges in `README.md` are created and pushed to the
65 | `badges` branch.
66 | - When adding unit test examples involving real SPARC calculations,
67 | do not use more than 4 MPI cores (may subject to changes) due to
68 | the [resource limitation](https://docs.github.com/en/actions/using-github-hosted-runners/using-github-hosted-runners/about-github-hosted-runners)
69 | of hosted runners.
70 |
71 | - [Publish doc pages
72 | workflow](https://github.com/SPARC-X/SPARC-X-API/blob/master/.github/workflows/publish_doc_pages.yml)
73 | uses Sphinx to convert `doc/` to doc html files.
74 |
75 | The rendered
76 | changes will only be pushed to the `gh_pages` branch with direct
77 | commit on the master branch or after one PR is merged.
78 |
79 | - [Update JSON schema
80 | workflow](https://github.com/SPARC-X/SPARC-X-API/blob/master/.github/workflows/update_api.yml)
81 | updates the JSON schema file after a new release in SPARC C/C++
82 | source code. The workflow is run both nightly and after normal
83 | push. You can change the behavior as needed.
84 |
85 | An example pull request created by the update workflow can be seen
86 | in the following screenshot:
87 |
88 | ```{figure} ../img/screenshots/api_update_pr_github.png
89 | :alt: PR on github
90 | ```
91 |
92 | Once the
93 |
94 | - [Publish PyPI
95 | workflow](https://github.com/SPARC-X/SPARC-X-API/blob/master/.github/workflows/publish-pypi.yml)
96 | package the source as `sparc-x-api` and publish on PyPI. Only
97 | activates on new releases.
98 |
--------------------------------------------------------------------------------
/doc/maintainers/sparc-x-api.md:
--------------------------------------------------------------------------------
1 | # SPARC-X-API package releases
2 | ## On conda-forge
3 |
4 | SPARC-X-API is packaged as
5 | [`sparc-x-api`](https://anaconda.org/conda-forge/sparc-x-api) in the
6 | conda-forge channel. The source code (feedstock) for the package is
7 | managed at
8 | [`sparc-x-api-feedstock`](https://github.com/conda-forge/sparc-x-api-feedstock).
9 | Please note that this repository is under the conda-forge
10 | organization. If you wish to become a maintainer, please ping
11 | [@alchem0x2a](https://github.com/alchem0x2A).
12 |
13 | The feedstock is set to track new releases in SPARC-X-API, and usually
14 | no major maintenance is required. The bot system will create a PR for
15 | a version bump, see [one
16 | example](https://github.com/conda-forge/sparc-x-api-feedstock/pull/2)
17 | for the maintainers to modify and merge. Please also ensure:
18 |
19 | - Only the `recipe/meta.yaml` needs to be changed.
20 | - Follow the conda-forge's own [recipe standard](https://conda-forge.org/docs/maintainer/guidelines/)
21 | - Do not directly use the [`.conda/meta.yaml`](https://github.com/SPARC-X/SPARC-X-API/blob/master/.conda/meta.yaml) for conda-forge (it is designed for local packaging test)
22 | - Bump the `build.number` if you need to change the recipe YAML on the same SPARC-X-API release.
23 |
24 | (conda-forge-build-locally-api)=
25 | ### Debug the recipe using local build
26 |
27 | The build toolchain in conda-forge is slightly different from the
28 | standard `conda-build` command. If the build workflow fails after
29 | submitting the PR, you may run the recipe locally to debug. You need
30 | both the [docker engine](https://docs.docker.com/engine/) and a [conda distribution](https://docs.conda.io/projects/conda/en/latest/user-guide/install/index.html) on your local
31 | machine. Run the following command at the root of the local clone of `sparc-x-api-feedstock`:
32 | ```{code} bash
33 | python build-locally.py
34 | ```
35 |
36 | ## Deploy on PyPI
37 |
38 | SPARC-X-API is deployed on PyPI under the name
39 | [`sparc-x-api`](https://pypi.org/project/sparc-x-api/). Please contact
40 | the current maintainer [@alchem0x2a](mailto:alchem0x2a@gmail.com) if
41 | you wish to become a co-contributor.
42 |
43 | Publishing on PyPI does not require setting an API token in the CI
44 | workflow. Instead, it uses the [OIDC
45 | protocol](https://docs.pypi.org/trusted-publishers/) for a trusted
46 | publisher. The current settings on PyPI are like follows:
47 |
48 | 
49 |
--------------------------------------------------------------------------------
/doc/make.bat:
--------------------------------------------------------------------------------
1 | @ECHO OFF
2 |
3 | pushd %~dp0
4 |
5 | REM Command file for Sphinx documentation
6 |
7 | if "%SPHINXBUILD%" == "" (
8 | set SPHINXBUILD=sphinx-build
9 | )
10 | set SOURCEDIR=.
11 | set BUILDDIR=_build
12 |
13 | %SPHINXBUILD% >NUL 2>NUL
14 | if errorlevel 9009 (
15 | echo.
16 | echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
17 | echo.installed, then set the SPHINXBUILD environment variable to point
18 | echo.to the full path of the 'sphinx-build' executable. Alternatively you
19 | echo.may add the Sphinx directory to PATH.
20 | echo.
21 | echo.If you don't have Sphinx installed, grab it from
22 | echo.https://www.sphinx-doc.org/
23 | exit /b 1
24 | )
25 |
26 | if "%1" == "" goto help
27 |
28 | %SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
29 | goto end
30 |
31 | :help
32 | %SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
33 |
34 | :end
35 | popd
36 |
--------------------------------------------------------------------------------
/doc/package_components.md:
--------------------------------------------------------------------------------
1 | # SPARC-X-API Package Components
2 |
3 |
4 | ```{toctree}
5 | :maxdepth: 4
6 |
7 | api/modules.rst
8 | ```
9 |
--------------------------------------------------------------------------------
/doc/test_coverage.md:
--------------------------------------------------------------------------------
1 | # Test Coverage Report
2 |
3 | The following coverage test was generated by the [`coverage` package](https://coverage.readthedocs.io/en/7.6.7/other.html):
4 |
5 | ```{raw} html
6 |
10 |
23 | ```
24 |
--------------------------------------------------------------------------------
/doc/troubleshooting.md:
--------------------------------------------------------------------------------
1 | # Troubleshooting
2 | ### Known issues
3 | *This is a list of known bugs with the current SPARC-X-API, remove them when PRs are contributed*
4 | - [ ] `sparc-ase` command currently does not support multi-image yet
5 | - [ ] `SPARC` calculator may occasionally require more DFT steps than needed during optimization
6 | - [ ] Raw result parsing from SPARC files may need to be re-factored in a generator form
7 |
--------------------------------------------------------------------------------
/examples/FileIO/md/ab-initio/run.py:
--------------------------------------------------------------------------------
1 | import numpy as np
2 | from ase import Atoms
3 |
4 | from sparc.calculator import SPARC
5 |
6 | Ag_cluster = Atoms(
7 | "Ag5",
8 | positions=[
9 | (0.0, 2.6579, 0.9366),
10 | (0.0, -1.3587, -1.4045),
11 | (0.0, 0.0, 0.9358),
12 | (0.0, -2.6579, 0.9366),
13 | (0.0, 1.3587, -1.4045),
14 | ],
15 | pbc=(0, 0, 0),
16 | )
17 | Ag_cluster.set_cell([20.0, 24.0, 24.0])
18 | Ag_cluster.center()
19 |
20 | calc_params = {
21 | "EXCHANGE_CORRELATION": "GGA_PBE",
22 | "KPOINT_GRID": [1, 1, 1],
23 | "MESH_SPACING": 0.35,
24 | "TOL_SCF": 0.0001,
25 | "MAXIT_SCF": 100,
26 | "PRINT_RESTART_FQ": 10,
27 | "PRINT_ATOMS": 1,
28 | "PRINT_FORCES": 1,
29 | "SPIN_TYP": 0,
30 | "MD_FLAG": 1,
31 | "MD_METHOD": "NVK_G",
32 | "ION_TEMP": 10,
33 | "MD_NSTEP": 10,
34 | "MD_TIMESTEP": 2,
35 | }
36 |
37 |
38 | def main():
39 | """Running a simple MD calculation using ab initio SPARC in FileIO mode"""
40 | Ag_cluster.calc = SPARC(label="Ag_cluster", **calc_params)
41 | energy = Ag_cluster.get_potential_energy()
42 | print("Energy: ", energy)
43 | forces = Ag_cluster.get_forces()
44 | print("Max Force: ", np.max(forces))
45 |
46 |
47 | if __name__ == "__main__":
48 | main()
49 |
--------------------------------------------------------------------------------
/examples/FileIO/md/mlff/run.py:
--------------------------------------------------------------------------------
1 | import numpy as np
2 | from ase import Atoms
3 |
4 | from sparc.calculator import SPARC
5 |
6 | Ag_cluster = Atoms(
7 | "Ag5",
8 | positions=[
9 | (0.0, 2.6579, 0.9366),
10 | (0.0, -1.3587, -1.4045),
11 | (0.0, 0.0, 0.9358),
12 | (0.0, -2.6579, 0.9366),
13 | (0.0, 1.3587, -1.4045),
14 | ],
15 | pbc=(0, 0, 0),
16 | )
17 | Ag_cluster.set_cell([20.0, 24.0, 24.0])
18 | Ag_cluster.center()
19 |
20 | calc_params = {
21 | "EXCHANGE_CORRELATION": "GGA_PBE",
22 | "KPOINT_GRID": [1, 1, 1],
23 | "MESH_SPACING": 0.35,
24 | "TOL_SCF": 0.0001,
25 | "MAXIT_SCF": 100,
26 | "PRINT_RESTART_FQ": 10,
27 | "PRINT_ATOMS": 1,
28 | "PRINT_FORCES": 1,
29 | "SPIN_TYP": 0,
30 | "MD_FLAG": 1,
31 | "MD_METHOD": "NVK_G",
32 | "ION_TEMP": 10,
33 | "MD_NSTEP": 10,
34 | "MD_TIMESTEP": 2,
35 | "MLFF_FLAG": 1,
36 | "MLFF_INITIAL_STEPS_TRAIN": 3,
37 | }
38 |
39 |
40 | def main():
41 | """Running a simple MD calculation using SPARC-MLFF in FileIO mode"""
42 | Ag_cluster.calc = SPARC(label="Ag_cluster", **calc_params)
43 | energy = Ag_cluster.get_potential_energy()
44 | print("Energy: ", energy)
45 | forces = Ag_cluster.get_forces()
46 | print("Max Force: ", np.max(forces))
47 |
48 |
49 | if __name__ == "__main__":
50 | main()
51 |
--------------------------------------------------------------------------------
/examples/FileIO/relax/relax_cell/ab-initio/run.py:
--------------------------------------------------------------------------------
1 | # Using SPARC
2 | from ase.build import bulk
3 |
4 | from sparc.calculator import SPARC
5 |
6 | calc_params = {
7 | "EXCHANGE_CORRELATION": "GGA_PBE",
8 | "KPOINT_GRID": [4, 4, 4],
9 | "MESH_SPACING": 0.35,
10 | "TOL_SCF": 0.0001,
11 | "MAXIT_SCF": 100,
12 | "CALC_STRESS": 1,
13 | "PRINT_RESTART_FQ": 10,
14 | "PRINT_ATOMS": 1,
15 | "PRINT_FORCES": 1,
16 | "SPIN_TYP": 0,
17 | "RELAX_FLAG": 2,
18 | }
19 |
20 |
21 | def main():
22 | atoms = bulk("Rh", crystalstructure="fcc", a=3.81)
23 | atoms.calc = SPARC(**calc_params)
24 | # Trigger the calculation by calling a property that will be available after the calculation
25 | stress = atoms.get_stress()
26 | # Get the final energy and volume from a single point calculation
27 | del calc_params["RELAX_FLAG"]
28 | if type(atoms) == list:
29 | atoms = atoms[-1]
30 | atoms.calc = SPARC(**calc_params)
31 | energy = atoms.get_potential_energy()
32 | volume = atoms.get_volume()
33 |
34 | print(
35 | "***********************************************************************************************"
36 | )
37 | print("v0 = {0} A^3\nE0 = {1} eV".format(volume, energy))
38 |
39 |
40 | if __name__ == "__main__":
41 | main()
42 |
--------------------------------------------------------------------------------
/examples/FileIO/relax/relax_coords/ab-initio/run.py:
--------------------------------------------------------------------------------
1 | # Using SPARC
2 | import numpy as np
3 | from ase.build import molecule
4 |
5 | from sparc.calculator import SPARC
6 |
7 | water = molecule("H2O", vacuum=7)
8 | water.pbc = [False, False, False]
9 |
10 | calc_params = {
11 | "EXCHANGE_CORRELATION": "GGA_PBE",
12 | "KPOINT_GRID": [1, 1, 1],
13 | "MESH_SPACING": 0.35,
14 | "TOL_SCF": 0.0001,
15 | "MAXIT_SCF": 100,
16 | "ELEC_TEMP_TYPE": "fermi-dirac",
17 | "ELEC_TEMP": 116,
18 | "PRINT_RESTART_FQ": 10,
19 | "PRINT_ATOMS": 1,
20 | "PRINT_FORCES": 1,
21 | "SPIN_TYP": 0,
22 | "RELAX_FLAG": 1,
23 | }
24 |
25 |
26 | def main():
27 | """Geometric optimization of a water molecule using
28 | ab initio SPARC in FileIO mode
29 | """
30 | water.calc = SPARC(**calc_params)
31 | energy = water.get_potential_energy()
32 | forces = water.get_forces()
33 |
34 | print("Energy:", energy)
35 | print("Max Force:", np.max(forces))
36 |
37 |
38 | if __name__ == "__main__":
39 | main()
40 |
--------------------------------------------------------------------------------
/examples/FileIO/relax/relax_coords/mlff/run.py:
--------------------------------------------------------------------------------
1 | # Using SPARC
2 | import numpy as np
3 | from ase.build import molecule
4 |
5 | from sparc.calculator import SPARC
6 |
7 | water = molecule("H2O", vacuum=7)
8 | water.pbc = [False, False, False]
9 |
10 | calc_params = {
11 | "EXCHANGE_CORRELATION": "GGA_PBE",
12 | "KPOINT_GRID": [1, 1, 1],
13 | "MESH_SPACING": 0.35,
14 | "TOL_SCF": 0.0001,
15 | "MAXIT_SCF": 100,
16 | "ELEC_TEMP_TYPE": "fermi-dirac",
17 | "ELEC_TEMP": 116,
18 | "PRINT_RESTART_FQ": 10,
19 | "PRINT_ATOMS": 1,
20 | "PRINT_FORCES": 1,
21 | "SPIN_TYP": 0,
22 | "RELAX_FLAG": 1,
23 | "MLFF_FLAG": 1,
24 | "MLFF_INITIAL_STEPS_TRAIN": 3,
25 | }
26 |
27 |
28 | def main():
29 | """Geometric optimization of a water molecule using
30 | SPARC-MLFF in FileIO mode
31 | """
32 | water.calc = SPARC(**calc_params)
33 | energy = water.get_potential_energy()
34 | forces = water.get_forces()
35 |
36 | print("Energy:", energy)
37 | print("Max Force:", np.max(forces))
38 |
39 |
40 | if __name__ == "__main__":
41 | main()
42 |
--------------------------------------------------------------------------------
/examples/active_learning/example_finetuna_minimal.py:
--------------------------------------------------------------------------------
1 | """A minimal example combining active learning library like Finetuna with SPARC
2 |
3 | usage
4 | First download the checkpoint from the url https://dl.fbaipublicfiles.com/opencatalystproject/models/2021_08/s2ef/gemnet_t_direct_h512_all.pt
5 |
6 | python example_finetuna_minimal.py
7 | """
8 | import argparse
9 | import os
10 | from pathlib import Path
11 |
12 | import ase
13 | import torch
14 | import yaml
15 | from ase.build import molecule
16 | from ase.cluster.cubic import FaceCenteredCubic
17 | from ase.constraints import FixAtoms
18 | from ase.io.trajectory import Trajectory
19 | from ase.optimize import BFGS
20 | from finetuna.ml_potentials.finetuner_ensemble_calc import FinetunerEnsembleCalc
21 | from finetuna.online_learner.online_learner import OnlineLearner
22 |
23 | from sparc.calculator import SPARC
24 |
25 | cpu = not torch.cuda.is_available()
26 | curdir = Path(__file__).parent
27 | config_file = curdir / "ft_config_gemnet_gpu.yml"
28 | with open(config_file, "r") as fd:
29 | configs = yaml.load(fd, Loader=yaml.FullLoader)
30 |
31 | checkpoint = os.environ.get("CHECKPOINT_PATH", None)
32 | if checkpoint is None:
33 | # Use default (relative path)
34 | checkpoint = curdir / configs["ocp"]["checkpoint_path_list"][0]
35 | checkpoint = Path(checkpoint)
36 |
37 | if not checkpoint.is_file():
38 | raise FileNotFoundError("Cannot found the model checkpoint file!")
39 |
40 | finetuner = configs["finetuner"]
41 | finetuner[0].update(cpu=cpu)
42 | learner = configs["learner"]
43 |
44 | ml_potential = FinetunerEnsembleCalc(
45 | checkpoint_paths=[checkpoint],
46 | mlp_params=finetuner,
47 | )
48 |
49 |
50 | # init_molecule = molecule("H2O", pbc=False, cell=[8, 8, 8])
51 | # init_molecule.center()
52 | # init_molecule.rattle()
53 |
54 |
55 | surfaces = [(1, 0, 0), (1, 1, 0), (1, 1, 1)]
56 | layers = [1, 2, 1]
57 | lc = 3.61000
58 |
59 | # init_atoms = molecule("CH4", pbc=True, cell=[8, 8, 8])
60 | # init_atoms.constraints = [FixAtoms([0])]
61 | # init_atoms.center()
62 | # init_atoms.rattle(0.05)
63 |
64 | init_atoms = FaceCenteredCubic("Cu", surfaces, layers, latticeconstant=lc)
65 | init_atoms.cell = [12, 12, 12]
66 | init_atoms.center()
67 | init_atoms.pbc = False
68 | init_atoms.rattle(0.05)
69 |
70 |
71 | sparc_params = {"xc": "pbe", "h": 0.13}
72 | # with SPARC(directory="pure_BFGS", **sparc_params) as calc:
73 | # atoms = init_atoms.copy()
74 | # atoms.calc = calc
75 | # dyn = BFGS(atoms, maxstep=0.2, trajectory="pure_bfgs.traj")
76 | # dyn.run(fmax=0.03)
77 |
78 |
79 | with SPARC(directory="online_coldstart", **sparc_params) as parent_calc:
80 | atoms = init_atoms.copy()
81 | onlinecalc = OnlineLearner(learner, [], ml_potential, parent_calc)
82 | atoms.calc = onlinecalc
83 | dyn = BFGS(atoms, maxstep=0.2)
84 | dyn.run(fmax=0.03)
85 |
--------------------------------------------------------------------------------
/examples/active_learning/ft_config_gemnet_gpu.yml:
--------------------------------------------------------------------------------
1 | finetuner:
2 | - cpu: false
3 | optim:
4 | batch_size: 1
5 | break_below_lr: 1.0e-07
6 | checkpoint_every: 100000
7 | eps: 1.0e-08
8 | eval_every: 1
9 | factor: 0.9
10 | force_coefficient: 100
11 | lr_initial: 0.0003
12 | max_epochs: 400
13 | num_workers: 0
14 | optimizer_params:
15 | eps: 1.0e-08
16 | weight_decay: 0
17 | patience: 3
18 | # print_loss_and_lr: true
19 | scheduler_loss: train
20 | weight_decay: 0
21 | task:
22 | primary_metric: loss
23 | tuner:
24 | num_threads: 8
25 | unfreeze_blocks:
26 | - out_blocks.3.seq_forces
27 | - out_blocks.3.scale_rbf_F
28 | - out_blocks.3.dense_rbf_F
29 | - out_blocks.3.out_forces
30 | - out_blocks.2.seq_forces
31 | - out_blocks.2.scale_rbf_F
32 | - out_blocks.2.dense_rbf_F
33 | - out_blocks.2.out_forces
34 | - out_blocks.1.seq_forces
35 | - out_blocks.1.scale_rbf_F
36 | - out_blocks.1.dense_rbf_F
37 | - out_blocks.1.out_forces
38 | learner:
39 | dyn_avg_steps: 15
40 | dyn_uncertain_tol: 1000000 # Dynamic uncertainty tolerance
41 | fmax_verify_threshold: 0.03 # Fmax threshold for calling VASP single point calculation
42 | initial_points_to_keep: []
43 | # logger:
44 | # pca_quantify: true # Log PCA on wandb
45 | # uncertainty_quantify: false
46 | num_initial_points: 1 # Number of VASP calls at the beginning of the relaxation
47 | partial_fit: true
48 | query_every_n_steps: 30 # K-steps querying strategy: query every 100 steps
49 | stat_uncertain_tol: 1000000 # Static uncertainty tolerance
50 | tolerance_selection: min
51 | # valset_system_id: '1498818'
52 | # wandb_init:
53 | # entity: ulissi-group
54 | # project: project
55 | # group: group
56 | # name: name
57 | # notes: notes
58 | # wandb_log: false # Wandb disabled
59 | # optional_config:
60 | # links:
61 | # traj: /path/to/vasp/reference/traj
62 | ocp:
63 | model_class_list:
64 | - gemnet
65 | checkpoint_path_list:
66 | - "gemnet_t_direct_h512_all.pt"
67 | # relaxation:
68 | # # fmax: 0.03
69 | # max_parent_calls: null
70 | # maxstep: 0.2
71 | # replay_method: parent_only
72 | # steps: null
73 | # trajname: oal_relaxation.traj
74 |
--------------------------------------------------------------------------------
/examples/env.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # set path to any shared libraries such as mkl, blas, scalapack etc.
3 | ml intel-oneapi-compilers intel-oneapi-mkl intel-oneapi-mpi
4 | source ~/p-amedford6-0/venvs/joss-sparc-x-api/bin/activate
5 |
6 | cd ~
7 | export HOME=$(pwd)
8 | cd -
9 | export SCRATCH=$HOME/scratch
10 | export DATA=$HOME/p-amedford6-0
11 |
12 | export PYTHONPATH=$DATA/active/JOSS-SPARC-X-API/SPARC-X-API:$PYTHONPATH
13 |
14 | # Check if Slurm is installed and running
15 | if command -v sinfo &> /dev/null; then
16 | export ASE_SPARC_COMMAND="srun ${DATA}/active/JOSS-SPARC-X-API/dev_SPARC/lib/sparc --export=ALL -K"
17 | else
18 | nprocs=$(nproc)
19 | export ASE_SPARC_COMMAND="mpirun -np $nprocs ${DATA}/SPARC/lib/sparc --export=ALL -K"
20 | fi
21 | # Set pseudopotential path is you did not download with python -m sparc.download_data
22 | export PLUMED_KERNEL=/storage/home/hcoda1/9/ltimmerman3/p-amedford6-0/active/JOSS-SPARC-X-API/plumed-2.9.2/src/lib/libplumedKernel.so
23 |
--------------------------------------------------------------------------------
/examples/simple_examples/ex0-eos.py:
--------------------------------------------------------------------------------
1 | """A simple example using SPARC-X-API to calculate the equation of state of bulk Al.
2 |
3 | Example taken from GPAW's tutorial:
4 | https://wiki.fysik.dtu.dk/gpaw/tutorialsexercises/structureoptimization/lattice_constants/lattice_constants.html
5 | """
6 | import numpy as np
7 | from ase.build import bulk
8 | from ase.eos import calculate_eos
9 |
10 | from sparc import SPARC
11 |
12 |
13 | def main():
14 | # Al in conventional cell
15 | atoms = bulk("Al", cubic=True)
16 | calc = SPARC(h=0.25, kpts=(3, 3, 3), xc="pbe", directory="ex0-eos")
17 | vol = atoms.get_volume()
18 | atoms.calc = calc
19 | eos = calculate_eos(atoms, npoints=5, eps=0.05, trajectory="al-eos-sparc.traj")
20 | print("Original volume: Ang^3", vol)
21 | v, e, B = eos.fit()
22 | print("Fitted volume (Ang^3), energy (eV), modulus (eV/Ang^3)")
23 | print(v, e, B)
24 | a0 = v ** (1 / 3)
25 | print(f"Optimal cell length (cubic): {a0} Ang")
26 | atoms.set_cell([a0, a0, a0], scale_atoms=True)
27 | e0_sparc = atoms.get_potential_energy()
28 | print(f"Energy calculated by SPARC: {e0_sparc} eV")
29 | print(f"Energy diff {abs(e0_sparc - e)} eV")
30 | return
31 |
32 |
33 | if __name__ == "__main__":
34 | main()
35 |
--------------------------------------------------------------------------------
/examples/simple_examples/ex1-ase-optimize.py:
--------------------------------------------------------------------------------
1 | """A simple example using SPARC to optimize a NH3 molecule using:
2 | 1) SPARC internal BFGS routine
3 | 2) SPARC single point + ASE BFGS
4 |
5 |
6 | """
7 | import numpy as np
8 | from ase.build import molecule
9 | from ase.constraints import FixAtoms
10 | from ase.optimize.lbfgs import LBFGS
11 |
12 | from sparc import SPARC
13 |
14 | nh3 = molecule("NH3", cell=(8, 8, 8), pbc=False)
15 | nh3.center()
16 | # Fix the N center
17 | nh3.constraints = [FixAtoms([0])]
18 | nh3.rattle()
19 |
20 |
21 | def optimize_sparc_internal():
22 | atoms = nh3.copy()
23 | calc = SPARC(
24 | h=0.18,
25 | kpts=(1, 1, 1),
26 | xc="pbe",
27 | convergence={"forces": 0.02},
28 | relax_flag=True,
29 | print_relaxout=True,
30 | relax_method="LBFGS",
31 | directory="ex1-sparc",
32 | )
33 | atoms.calc = calc
34 | e_fin = atoms.get_potential_energy()
35 | f_fin = atoms.get_forces()
36 | nsteps = len(calc.raw_results["geopt"])
37 | print("SPARC internal LBFGS:")
38 | print(f"Final energy: {e_fin} eV")
39 | print(f"Final fmax: {np.max(np.abs(f_fin))} eV/Ang")
40 | print(f"N steps: {nsteps}")
41 |
42 |
43 | def optimize_ase_bfgs():
44 | atoms = nh3.copy()
45 | calc = SPARC(h=0.18, kpts=(1, 1, 1), xc="pbe", directory="ex1-ase")
46 | atoms.calc = calc
47 | opt = LBFGS(atoms)
48 | opt.run(fmax=0.02)
49 | e_fin = atoms.get_potential_energy()
50 | f_fin = atoms.get_forces()
51 | nsteps = opt.nsteps
52 | print("ASE LBFGS (file I/O mode)")
53 | print(f"Final energy: {e_fin} eV")
54 | print(f"Final fmax: {np.max(np.abs(f_fin))} eV/Ang")
55 | print(f"N steps: {nsteps}")
56 |
57 |
58 | def optimize_ase_bfgs_socket():
59 | atoms = nh3.copy()
60 | calc = SPARC(
61 | h=0.18,
62 | kpts=(1, 1, 1),
63 | xc="pbe",
64 | print_forces=True,
65 | directory="ex1-ase-socket",
66 | use_socket=True,
67 | )
68 | atoms.calc = calc
69 | with calc:
70 | opt = LBFGS(atoms)
71 | opt.run(fmax=0.02)
72 | e_fin = atoms.get_potential_energy()
73 | f_fin = atoms.get_forces()
74 | nsteps = opt.nsteps
75 | print("ASE LBFGS (socket mode)")
76 | print(f"Final energy: {e_fin} eV")
77 | print(f"Final fmax: {np.max(np.abs(f_fin))} eV/Ang")
78 | print(f"N steps: {nsteps}")
79 |
80 |
81 | def main():
82 | # Comment out specific ones if the examples run too long
83 | optimize_sparc_internal()
84 | optimize_ase_bfgs()
85 | optimize_ase_bfgs_socket()
86 |
87 |
88 | if __name__ == "__main__":
89 | main()
90 |
--------------------------------------------------------------------------------
/examples/socket/md/ab-initio/ase/run.py:
--------------------------------------------------------------------------------
1 | from ase import Atoms
2 | from ase.constraints import FixedPlane
3 | from ase.md.nvtberendsen import NVTBerendsen
4 | from ase.md.verlet import VelocityVerlet
5 | from ase.units import fs
6 |
7 | from sparc.calculator import SPARC
8 |
9 | Ag_cluster = Atoms(
10 | "Ag5",
11 | positions=[
12 | (0.0, 2.6579, 0.9366),
13 | (0.0, -1.3587, -1.4045),
14 | (0.0, 0.0, 0.9358),
15 | (0.0, -2.6579, 0.9366),
16 | (0.0, 1.3587, -1.4045),
17 | ],
18 | pbc=(0, 0, 0),
19 | )
20 | Ag_cluster.set_cell([20.0, 24.0, 24.0])
21 | Ag_cluster.center()
22 | cons = [FixedPlane(i, [1, 0, 0]) for i in range(5)]
23 | Ag_cluster.set_constraint(cons)
24 |
25 | calc_params = {
26 | "EXCHANGE_CORRELATION": "GGA_PBE",
27 | "KPOINT_GRID": [1, 1, 1],
28 | "MESH_SPACING": 0.35,
29 | "TOL_SCF": 0.0001,
30 | "MAXIT_SCF": 100,
31 | "PRINT_RESTART_FQ": 10,
32 | "PRINT_ATOMS": 1,
33 | "PRINT_FORCES": 1,
34 | "SPIN_TYP": 0,
35 | }
36 |
37 | taut = 50 * fs
38 | timestep = 2 * fs
39 |
40 |
41 | def main():
42 | """MD simulation with implicit socket interface"""
43 | with SPARC(use_socket=True, **calc_params) as calc:
44 | Ag_cluster.calc = calc
45 | # dyn = NVTBerendsen(Ag_cluster, temperature_K=10, taut=taut, timestep=timestep, trajectory='Ag-cluster-md.traj')
46 | dyn = VelocityVerlet(
47 | Ag_cluster,
48 | dt=2.0 * fs,
49 | trajectory="Ag-cluster-verlet.traj",
50 | logfile="verlet-md.log",
51 | )
52 | dyn.run(10)
53 |
54 |
55 | if __name__ == "__main__":
56 | main()
57 |
--------------------------------------------------------------------------------
/examples/socket/md/ab-initio/plumed/run.py:
--------------------------------------------------------------------------------
1 | # Using SPARC
2 | from ase import Atoms, units
3 | from ase.calculators.plumed import Plumed
4 | from ase.md.nvtberendsen import NVTBerendsen
5 |
6 | from sparc.calculator import SPARC
7 |
8 | calc_params = {
9 | "EXCHANGE_CORRELATION": "GGA_PBE",
10 | "KPOINT_GRID": [1, 1, 1],
11 | "MESH_SPACING": 0.35,
12 | "TOL_SCF": 0.0001,
13 | "MAXIT_SCF": 100,
14 | "PRINT_RESTART_FQ": 10,
15 | "PRINT_ATOMS": 1,
16 | "PRINT_FORCES": 1,
17 | "SPIN_TYP": 0,
18 | }
19 |
20 | timestep = (
21 | 2 * units.fs
22 | ) # the units module contains the conversion factor to go from units. to ASE units via multiplication
23 | ps = 1000 * units.fs
24 |
25 | # Units conversion: everything will be in ASE units, so a time step is in ASE unit and needs to be interpreted as some multiple of sensical units
26 | # Likewise, energy is in eV which is ~98.6 kJ/mol, so a single unit of energy is 98.6 kJ/mol which are the internal units of PLUMED
27 | setup = [
28 | f"UNITS LENGTH=A TIME={1/ps} ENERGY={units.mol/units.kJ}", # Set units to match desired properties
29 | # Calculate the center of mass of atoms 1-5
30 | "com: COM ATOMS=1-5",
31 | # Define the coordination number (C)
32 | "c: COORDINATION GROUPA=1-5 SWITCH={RATIONAL R_0=3.0 NN=8 MM=16} NOPBC",
33 | # Define the radius of gyration (R)
34 | "r: GYRATION TYPE=RADIUS ATOMS=1-5 NOPBC",
35 | # Compute CV1 and CV2 as orthogonal linear combinations of C and R
36 | "cv1: COMBINE ARG=c,r COEFFICIENTS=0.99715,-0.07534 PERIODIC=NO",
37 | "cv2: COMBINE ARG=c,r COEFFICIENTS=0.07534,0.99715 PERIODIC=NO",
38 | # Apply lower wall on CV1 at 5.0 with harmonic constant 10 eV
39 | f"LOWER_WALLS ARG=cv1 AT=5.0 KAPPA=10.0",
40 | # Apply lower wall on CV2 at 3.0 with harmonic constant 50 eV
41 | f"UPPER_WALLS ARG=cv2 AT=3.0 KAPPA=50.0",
42 | # Perform well-tempered metadynamics on CV1 and CV2
43 | f"METAD ARG=cv1,cv2 HEIGHT=0.3 PACE=500 SIGMA=0.3,0.03 GRID_MIN=0.0,0.0 GRID_MAX=10.0,5.0 GRID_BIN=500,500 BIASFACTOR=100 FILE=HILLS",
44 | # Print out the collective variables for monitoring
45 | "PRINT ARG=cv1,cv2,c,r FILE=COLVAR STRIDE=1",
46 | ]
47 |
48 | Ag_cluster = Atoms(
49 | "Ag5",
50 | positions=[
51 | (0.0, 2.6579, 0.9366),
52 | (0.0, -1.3587, -1.4045),
53 | (0.0, 0.0, 0.9358),
54 | (0.0, -2.6579, 0.9366),
55 | (0.0, 1.3587, -1.4045),
56 | ],
57 | pbc=(0, 0, 0),
58 | )
59 | Ag_cluster.set_cell([20.0, 24.0, 24.0])
60 | Ag_cluster.center()
61 | # cons = [FixedPlane(i, [1, 0, 0]) for i in range(5)]
62 | # Ag_cluster.set_constraint(cons)
63 |
64 |
65 | def main():
66 | """Sampling via Plumed interface with SPARC's socket"""
67 | with SPARC(use_socket=True, **calc_params) as calc:
68 | Ag_cluster.calc = Plumed(
69 | calc=calc, input=setup, timestep=timestep, atoms=Ag_cluster, kT=0.00861733
70 | ) # 10 K in eV thermal energy units
71 | dyn = NVTBerendsen(
72 | Ag_cluster,
73 | timestep,
74 | temperature_K=0.00861733 / units.kB,
75 | taut=50 * units.fs,
76 | fixcm=False,
77 | trajectory="Ag-cluster-metadynamics.traj",
78 | )
79 | dyn.run(10)
80 |
81 | """
82 | # Restrain atoms 1-5 within 2.0 Å of the center of mass using upper walls
83 | "d1: DISTANCE ATOMS=1,com",
84 | "UPPER_WALLS ARG=d1 AT=2.0 KAPPA=100.0",
85 | "d2: DISTANCE ATOMS=2,com",
86 | "UPPER_WALLS ARG=d2 AT=2.0 KAPPA=100.0",
87 | "d3: DISTANCE ATOMS=3,com",
88 | "UPPER_WALLS ARG=d3 AT=2.0 KAPPA=100.0",
89 | "d4: DISTANCE ATOMS=4,com",
90 | "UPPER_WALLS ARG=d4 AT=2.0 KAPPA=100.0",
91 | "d5: DISTANCE ATOMS=5,com",
92 | "UPPER_WALLS ARG=d5 AT=2.0 KAPPA=100.0",
93 | """
94 |
95 |
96 | if __name__ == "__main__":
97 | main()
98 |
--------------------------------------------------------------------------------
/examples/socket/md/mlff/plumed/run.py:
--------------------------------------------------------------------------------
1 | # Using SPARC
2 | from ase import Atoms, units
3 | from ase.calculators.plumed import Plumed
4 | from ase.md.nvtberendsen import NVTBerendsen
5 |
6 | from sparc.calculator import SPARC
7 |
8 | calc_params = {
9 | "EXCHANGE_CORRELATION": "GGA_PBE",
10 | "KPOINT_GRID": [1, 1, 1],
11 | "MESH_SPACING": 0.35,
12 | "TOL_SCF": 0.0001,
13 | "MAXIT_SCF": 100,
14 | "PRINT_RESTART_FQ": 10,
15 | "PRINT_ATOMS": 1,
16 | "PRINT_FORCES": 1,
17 | "SPIN_TYP": 0,
18 | "MLFF_FLAG": 1,
19 | "MLFF_INITIAL_STEPS_TRAIN": 5,
20 | }
21 |
22 | timestep = (
23 | 2 * units.fs
24 | ) # the units module contains the conversion factor to go from units. to ASE units via multiplication
25 | ps = 1000 * units.fs
26 |
27 | # Units conversion: everything will be in ASE units, so a time step is in ASE unit and needs to be interpreted as some multiple of sensical units
28 | # Likewise, energy is in eV which is ~98.6 kJ/mol, so a single unit of energy is 98.6 kJ/mol which are the internal units of PLUMED
29 | setup = [
30 | f"UNITS LENGTH=A TIME={1/ps} ENERGY={units.mol/units.kJ}", # Set units to match desired properties
31 | # Calculate the center of mass of atoms 1-5
32 | "com: COM ATOMS=1-5",
33 | # Define the coordination number (C)
34 | "c: COORDINATION GROUPA=1-5 SWITCH={RATIONAL R_0=3.0 NN=8 MM=16} NOPBC",
35 | # Define the radius of gyration (R)
36 | "r: GYRATION TYPE=RADIUS ATOMS=1-5 NOPBC",
37 | # Compute CV1 and CV2 as orthogonal linear combinations of C and R
38 | "cv1: COMBINE ARG=c,r COEFFICIENTS=0.99715,-0.07534 PERIODIC=NO",
39 | "cv2: COMBINE ARG=c,r COEFFICIENTS=0.07534,0.99715 PERIODIC=NO",
40 | # Apply lower wall on CV1 at 5.0 with harmonic constant 10 eV
41 | f"LOWER_WALLS ARG=cv1 AT=5.0 KAPPA=10.0",
42 | # Apply lower wall on CV2 at 3.0 with harmonic constant 50 eV
43 | f"UPPER_WALLS ARG=cv2 AT=3.0 KAPPA=50.0",
44 | # Perform well-tempered metadynamics on CV1 and CV2
45 | f"METAD ARG=cv1,cv2 HEIGHT=0.3 PACE=500 SIGMA=0.3,0.03 GRID_MIN=0.0,0.0 GRID_MAX=10.0,5.0 GRID_BIN=500,500 BIASFACTOR=100 FILE=HILLS",
46 | # Print out the collective variables for monitoring
47 | "PRINT ARG=cv1,cv2,c,r FILE=COLVAR STRIDE=1",
48 | ]
49 |
50 | Ag_cluster = Atoms(
51 | "Ag5",
52 | positions=[
53 | (0.0, 2.6579, 0.9366),
54 | (0.0, -1.3587, -1.4045),
55 | (0.0, 0.0, 0.9358),
56 | (0.0, -2.6579, 0.9366),
57 | (0.0, 1.3587, -1.4045),
58 | ],
59 | pbc=(0, 0, 0),
60 | )
61 | Ag_cluster.set_cell([20.0, 24.0, 24.0])
62 | Ag_cluster.center()
63 | # cons = [FixedPlane(i, [1, 0, 0]) for i in range(5)]
64 | # Ag_cluster.set_constraint(cons)
65 |
66 |
67 | def main():
68 | with SPARC(use_socket=True, **calc_params) as calc:
69 | Ag_cluster.calc = Plumed(
70 | calc=calc, input=setup, timestep=timestep, atoms=Ag_cluster, kT=0.00861733
71 | ) # 10 K in eV thermal energy units
72 | dyn = NVTBerendsen(
73 | Ag_cluster,
74 | timestep,
75 | temperature_K=0.00861733 / units.kB,
76 | taut=50 * units.fs,
77 | fixcm=False,
78 | trajectory="Ag-cluster-metadynamics.traj",
79 | )
80 | dyn.run(10)
81 |
82 |
83 | """
84 | # Restrain atoms 1-5 within 2.0 Å of the center of mass using upper walls
85 | "d1: DISTANCE ATOMS=1,com",
86 | "UPPER_WALLS ARG=d1 AT=2.0 KAPPA=100.0",
87 | "d2: DISTANCE ATOMS=2,com",
88 | "UPPER_WALLS ARG=d2 AT=2.0 KAPPA=100.0",
89 | "d3: DISTANCE ATOMS=3,com",
90 | "UPPER_WALLS ARG=d3 AT=2.0 KAPPA=100.0",
91 | "d4: DISTANCE ATOMS=4,com",
92 | "UPPER_WALLS ARG=d4 AT=2.0 KAPPA=100.0",
93 | "d5: DISTANCE ATOMS=5,com",
94 | "UPPER_WALLS ARG=d5 AT=2.0 KAPPA=100.0",
95 | """
96 |
97 | if __name__ == "__main__":
98 | main()
99 |
--------------------------------------------------------------------------------
/examples/socket/relax/ab-initio/cell/run.py:
--------------------------------------------------------------------------------
1 | # Using SPARC
2 | from sparc.calculator import SPARC
3 | from ase.eos import EquationOfState
4 | from ase.build import bulk
5 |
6 | calc_params = {
7 | "EXCHANGE_CORRELATION": "GGA_PBE",
8 | "KPOINT_GRID": [4,4,4],
9 | "MESH_SPACING": 0.35,
10 | "TOL_SCF": 0.0001,
11 | "MAXIT_SCF": 100,
12 | "CALC_STRESS": 1,
13 | "PRINT_RESTART_FQ": 10,
14 | "PRINT_ATOMS": 1,
15 | "PRINT_FORCES": 1,
16 | "SPIN_TYP": 0,
17 | }
18 |
19 | LC = [3.7, 3.75, 3.8, 3.85, 3.9, 3.95, 4.0]
20 | energies = []
21 | volumes = []
22 | with SPARC(use_socket=True, **calc_params) as calc:
23 | for a in LC:
24 | atoms = bulk('Rh', crystalstructure='fcc', a = a)
25 | atoms.calc = calc
26 | volumes.append(atoms.get_volume())
27 | energies.append(atoms.get_potential_energy())
28 |
29 | eos = EquationOfState(volumes, energies)
30 | v0, e0, B = eos.fit()
31 |
32 | print('v0 = {0} A^3\nE0 = {1} eV\nB = {2} eV/A^3'.format(v0, e0, B))
33 |
34 | eos.plot('Rh-fcc-eos.png')
--------------------------------------------------------------------------------
/examples/socket/relax/ab-initio/coords/run.py:
--------------------------------------------------------------------------------
1 | # Using SPARC
2 | from sparc.calculator import SPARC
3 | from ase.optimize import BFGS
4 | from ase.build import molecule
5 |
6 | water = molecule('H2O', vacuum=7)
7 | water.pbc = [False,False,False]
8 |
9 | calc_params = {
10 | "EXCHANGE_CORRELATION": "GGA_PBE",
11 | "KPOINT_GRID": [1,1,1],
12 | "MESH_SPACING": 0.35,
13 | "TOL_SCF": 0.0001,
14 | "MAXIT_SCF": 100,
15 | "ELEC_TEMP_TYPE": "fermi-dirac",
16 | "ELEC_TEMP": 116,
17 | "PRINT_RESTART_FQ": 10,
18 | "PRINT_ATOMS": 1,
19 | "PRINT_FORCES": 1,
20 | "SPIN_TYP": 0,
21 | }
22 |
23 | with SPARC(use_socket=True, **calc_params) as calc:
24 | water.calc = calc
25 | dyn = BFGS(water, trajectory = 'water-bfgs-opt.traj', logfile= 'opt.log')
26 | dyn.run(fmax=0.05)
--------------------------------------------------------------------------------
/examples/socket/relax/mlff/coords/run.py:
--------------------------------------------------------------------------------
1 | # Using SPARC
2 | from sparc.calculator import SPARC
3 | from ase.build import molecule
4 | import numpy as np
5 | from ase.optimize import BFGS
6 |
7 | water = molecule('H2O', vacuum=7)
8 | water.pbc = [False,False,False]
9 |
10 | calc_params = {
11 | "EXCHANGE_CORRELATION": "GGA_PBE",
12 | "KPOINT_GRID": [1,1,1],
13 | "MESH_SPACING": 0.35,
14 | "TOL_SCF": 0.0001,
15 | "MAXIT_SCF": 100,
16 | "ELEC_TEMP_TYPE": "fermi-dirac",
17 | "ELEC_TEMP": 116,
18 | "PRINT_RESTART_FQ": 10,
19 | "PRINT_ATOMS": 1,
20 | "PRINT_FORCES": 1,
21 | "SPIN_TYP": 0,
22 | "MLFF_FLAG": 1,
23 | "MLFF_INITIAL_STEPS_TRAIN": 3,
24 | }
25 |
26 | with SPARC(use_socket=True, **calc_params) as calc:
27 | water.calc = calc
28 | dyn = BFGS(water, trajectory = 'water-bfgs-opt.traj')
29 | dyn.run(fmax=0.05)
--------------------------------------------------------------------------------
/examples/socket/singlepoint/spin-paired/run.py:
--------------------------------------------------------------------------------
1 | # Using SPARC
2 | from sparc.calculator import SPARC
3 | from ase.build import molecule
4 | import numpy as np
5 |
6 | water = molecule('H2O', vacuum=7)
7 | water.pbc = [False,False,False]
8 |
9 | calc_params = {
10 | "EXCHANGE_CORRELATION": "GGA_PBE",
11 | "KPOINT_GRID": [1,1,1],
12 | "MESH_SPACING": 0.35,
13 | "TOL_SCF": 0.0001,
14 | "MAXIT_SCF": 100,
15 | "ELEC_TEMP_TYPE": "fermi-dirac",
16 | "ELEC_TEMP": 116,
17 | "PRINT_RESTART_FQ": 10,
18 | "PRINT_ATOMS": 1,
19 | "PRINT_FORCES": 1,
20 | "SPIN_TYP": 0,
21 | }
22 |
23 | with SPARC(use_socket=True, **calc_params) as calc:
24 | water.calc = calc
25 | energy = water.get_potential_energy()
26 | forces = water.get_forces()
27 | print('***********************************************************************************************')
28 | print("Energy: {}\nMax Force: {}".format(energy, np.max(abs(forces)) ) )
--------------------------------------------------------------------------------
/examples/socket/singlepoint/spin-polarized/run.py:
--------------------------------------------------------------------------------
1 | # Using SPARC
2 | from sparc.calculator import SPARC
3 | from ase.build import molecule
4 | import numpy as np
5 |
6 | water = molecule('H2O', vacuum=7)
7 | water.pbc = [False,False,False]
8 | water.set_initial_magnetic_moments([0.1, 0.1, 0.1])
9 |
10 | calc_params = {
11 | "EXCHANGE_CORRELATION": "GGA_PBE",
12 | "KPOINT_GRID": [1,1,1],
13 | "MESH_SPACING": 0.35,
14 | "TOL_SCF": 0.0001,
15 | "MAXIT_SCF": 100,
16 | "ELEC_TEMP_TYPE": "fermi-dirac",
17 | "ELEC_TEMP": 116,
18 | "PRINT_RESTART_FQ": 10,
19 | "PRINT_ATOMS": 1,
20 | "PRINT_FORCES": 1,
21 | "SPIN_TYP": 1,
22 | }
23 |
24 | with SPARC(use_socket=True, **calc_params) as calc:
25 | water.calc = calc
26 | print("Initial magnetic moments before calculation call:\n", water.get_initial_magnetic_moments())
27 | # energy = water.get_potential_energy()
28 | # forces = water.get_forces()
29 | net_magmom = water.get_magnetic_moment()
30 | magmoms = water.get_magnetic_moments()
31 | # print('***********************************************************************************************')
32 | # print("Energy: {}\nMax Force: {}".format(energy, np.max(abs(forces)) ) )
33 | print('*'*100)
34 | print("Net magnetic moment: ", net_magmom)
35 | print("Atomic magnetic moments:\n", magmoms)
--------------------------------------------------------------------------------
/paper/README.md:
--------------------------------------------------------------------------------
1 | # Folder for JOSS submission
2 |
3 | This folder contains the `paper.md`, `paper.bib` and supporting
4 | figures for the JOSS submission of the SPARC-X-API. Please do not add
5 | SPARC doc in this directory. While most of the writings should be done
6 | in Markdown, please use either of the following methods for rendering
7 | the draft into pdf format.
8 |
9 | ## Building Locally
10 |
11 | Follow the instructions in the [JOSS
12 | manual](https://joss.readthedocs.io/en/latest/paper.html#docker), use
13 | docker (or equivalent) to build the paper locally:
14 |
15 | ```bash
16 | # At the paper/ subfolder of the SPARC-X-API repository
17 | docker run --rm \
18 | --volume $PWD:/data \
19 | --user $(id -u):$(id -g) \
20 | --env JOURNAL=joss \
21 | openjournals/inara
22 | ```
23 | This command will create the `paper.pdf` under the `paper/` subfolder.
24 |
25 | ## Use Github Actions
26 |
27 | The draft pdf will be rendered after any changes are pushed the
28 | `paper/` under the `joss_paper` branch. Please check the [status
29 | page](https://github.com/SPARC-X/SPARC-X-API/actions/workflows/joss_paper.yml)
30 | for the latest build action. Once the compilation is finished, the zip
31 | archive containing the rendered `paper.pdf` can be downloaded via the
32 | link in the "Artifacts" section of the action status.
33 |
--------------------------------------------------------------------------------
/pyproject.toml:
--------------------------------------------------------------------------------
1 | # A minimal pyproject.toml to make the pip installation
2 | # future-proof. The latest setuptools should be able to
3 | # suppress deprecation warnings for editable installation
4 | # https://github.com/pypa/pip/issues/11457
5 | #
6 | # Note: the actual installation is still handled by setup.py
7 | [build-system]
8 | requires = ["setuptools >= 64", "wheel", "setuptools-scm>=8"]
9 | build-backend = "setuptools.build_meta"
10 |
--------------------------------------------------------------------------------
/setup.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 |
3 | from distutils.core import setup
4 | from warnings import warn
5 |
6 | from setuptools import find_packages
7 | from setuptools.command.install import install
8 | from setuptools_scm import get_version
9 |
10 | print(f"Version from setuptools_scm is {get_version()}")
11 |
12 | test_requires = [
13 | "pytest",
14 | "pyfakefs",
15 | "pytest-cov",
16 | "black",
17 | "isort",
18 | "flake8",
19 | "anybadge",
20 | "pre-commit",
21 | ]
22 |
23 | doc_requires = [
24 | "sphinx_rtd_theme",
25 | "sphinx_tabs",
26 | "myst-parser",
27 | ]
28 |
29 | setup(
30 | name="sparc-x-api",
31 | # @TT 2025.06.07 we use setuptools_scm for future
32 | # releases before fully transition to pyproject.toml
33 | version=get_version(),
34 | python_requires=">=3.8",
35 | description="Python API for the SPARC DFT Code",
36 | long_description=open("README.md").read(),
37 | long_description_content_type="text/markdown",
38 | author="Tian Tian, Lucas R Timmerman, Ben Comer",
39 | author_email="alchem0x2a@gmail.com, ltimmerman3@gatech.edu, ben.comer@gatech.edu",
40 | url="https://github.com/SPARC-X/SPARC-X-API",
41 | packages=find_packages(),
42 | # ASE 3.22 dependency will be deprecated in 2.0+ release
43 | install_requires=["ase>=3.22.0", "numpy>=1.23", "packaging>=20.0", "psutil>=5.0.0"],
44 | entry_points={
45 | # The ioformats are only compatible with ase>=3.23
46 | "ase.ioformats": [
47 | "sparc = sparc.io:format_sparc",
48 | "sparc_ion = sparc.io:format_ion",
49 | "sparc_static = sparc.io:format_static",
50 | "sparc_geopt = sparc.io:format_geopt",
51 | "sparc_aimd = sparc.io:format_aimd",
52 | ],
53 | "console_scripts": ["sparc-ase=sparc.cli:main"],
54 | },
55 | extras_require={
56 | "test": test_requires,
57 | "doc": test_requires + doc_requires,
58 | },
59 | package_data={"sparc": ["psp/*", "sparc_json_api/*.json"]},
60 | include_package_data=True,
61 | )
62 |
--------------------------------------------------------------------------------
/sparc/__init__.py:
--------------------------------------------------------------------------------
1 | """Initialization of sparc-x-api
2 |
3 | For submodules like download_data and api, ase / numpy may be ignored,
4 | and run using standard python libaries. This may be useful for cases like
5 | conda build and CI where not all dependencies are present
6 | """
7 |
8 |
9 | def _missing_deps_func(*args, **kwargs):
10 | raise ImportError("Importing fails for ase / numpy!")
11 |
12 |
13 | class SPARCMissingDeps:
14 | def __init__(self, *args, **kwargs):
15 | raise ImportError(
16 | "Cannot initialize sparc.SPARC because the required dependencies (ase and numpy) are not available."
17 | )
18 |
19 | def __getattr__(self, name):
20 | raise ImportError(
21 | f"Cannot access '{name}' on sparc.SPARC because the required dependencies (ase and numpy) are not available."
22 | )
23 |
24 |
25 | try:
26 | import ase
27 | import numpy
28 |
29 | _import_complete = True
30 | except ImportError:
31 | _import_complete = False
32 |
33 | if _import_complete:
34 | from packaging import version
35 |
36 | from .calculator import SPARC
37 | from .io import read_sparc, register_ase_io_sparc, write_sparc
38 |
39 | # If ase version less than 3.23, use manual register function
40 | # Otherwise use the new entry point
41 | if version.parse(ase.__version__) < version.parse("3.23"):
42 | register_ase_io_sparc()
43 | else:
44 | # register calculator class
45 | from ase.calculators.calculator import register_calculator_class
46 |
47 | register_calculator_class("sparc", SPARC)
48 | else:
49 | # If importing is not complete, any code trying to directly import
50 | # the following attributes will raise ImportError
51 | read_sparc = _missing_deps_func
52 | write_sparc = _missing_deps_func
53 | SPARC = SPARCMissingDeps
54 |
--------------------------------------------------------------------------------
/sparc/cli.py:
--------------------------------------------------------------------------------
1 | # Temporary fix to recognize .sparc from commandline
2 | from .io import __register_new_filetype
3 |
4 | __register_new_filetype()
5 |
6 |
7 | # The cli part should be considered deprecated now.
8 | def main(
9 | prog="sparc-ase",
10 | description="ASE command line tool with SPARC support",
11 | hook=None,
12 | args=None,
13 | ):
14 | import sys
15 |
16 | from ase.cli.main import main as ase_main
17 |
18 | ase_main(prog=prog, description=description, hook=hook, args=args)
19 |
20 |
21 | if __name__ == "__main__":
22 | main()
23 |
--------------------------------------------------------------------------------
/sparc/client.py:
--------------------------------------------------------------------------------
1 | import argparse
2 | from pathlib import Path
3 |
4 | from ase.io import read
5 |
6 | import sparc
7 |
8 | from .calculator import SPARC
9 | from .io import read_sparc
10 |
11 |
12 | def split_socket_name(name):
13 | """Split the host:address
14 |
15 | Returns:
16 | (host, port, unixsocket) tuple
17 | """
18 | name = name.strip()
19 | assert ":" in name, "Socket name must be in the format of host:port"
20 | host, port = name.split(":")
21 | if port.lower() == "unix":
22 | unixsocket = host
23 | port = -1
24 | host = ""
25 | assert len(unixsocket) > 0, "Unix socket length must be non-zero!"
26 | else:
27 | port = int(port)
28 | unixsocket = None
29 | host = host if len(host) > 0 else "localhost"
30 |
31 | return host, port, unixsocket
32 |
33 |
34 | def main():
35 | """Running SPARC-X-API as a socket client from command line
36 |
37 | The client wraps a socket communication layer on top of the SPARC
38 | binary. The implementation is both compatible with
39 | `SocketIOCalculator` in ase (using standard i-PI protocol), or
40 | with SPARC-X-API in socket server mode (using SPARC's extended
41 | i-PI protocol).
42 |
43 | Usage:
44 | 1. Start the socket client and outputs to current directory:
45 | python -m sparc.client -s host:port --workdir .
46 |
47 | If the workdir is a SPARC calculation bundle, the initial atoms and parameters will be reloaded.
48 |
49 | 2. Start the socket client with initial atoms read from file
50 | python -m sparc.client -s host:port --atoms-from-file input.xyz
51 |
52 | If the client is communicating with the standard i-PI server, an
53 | initial atoms object is required (either read from SPARC input
54 | files or via --atoms-from-file). However, if the server uses the
55 | SPARC protocol, the client can be started without initial atoms.
56 | """
57 | parser = argparse.ArgumentParser(
58 | usage=main.__doc__,
59 | formatter_class=argparse.RawDescriptionHelpFormatter,
60 | )
61 | parser.add_argument(
62 | "-s",
63 | "--socket",
64 | help=(
65 | "Address of the socket server "
66 | "in the format of host:port. If host is not defined, localhost will be used."
67 | ),
68 | )
69 | parser.add_argument(
70 | "-w",
71 | "--workdir",
72 | help=("Workdir for performing the SPARC calculations"),
73 | default=".",
74 | )
75 | parser.add_argument(
76 | "--atoms-from-file",
77 | help=("File or directory to read the input atoms information"),
78 | default=None,
79 | )
80 | parser.add_argument(
81 | "--atoms-format",
82 | help="File format to read from external file.",
83 | default=None,
84 | )
85 | args = parser.parse_args()
86 | host, port, unixsocket = split_socket_name(args.socket)
87 | workdir = Path(args.workdir)
88 | # TODO: implement unixsocket
89 | # TODO: reuse init params
90 | try:
91 | init_atoms = read_sparc(workdir)
92 | except:
93 | init_atoms = None
94 | if (init_atoms is None) and args.atoms_from_file:
95 | atoms_file = Path(args.atoms_from_file)
96 | atoms_format = args.atoms_format
97 | init_atoms = read(atoms_file, format=atoms_format)
98 |
99 | client_calc = SPARC(
100 | directory=workdir,
101 | use_socket=True,
102 | socket_params=dict(host=host, port=port, server_only=False),
103 | )
104 | # We should always enable use_stress, since the
105 | # SPARC implementation ensures it will also be present
106 | client_calc.run_client(atoms=init_atoms, use_stress=True)
107 |
108 |
109 | if __name__ == "__main__":
110 | main()
111 |
--------------------------------------------------------------------------------
/sparc/common.py:
--------------------------------------------------------------------------------
1 | import importlib.resources
2 |
3 | repo_dir = importlib.resources.files("sparc")
4 | psp_dir = repo_dir / "psp"
5 |
--------------------------------------------------------------------------------
/sparc/download_data.py:
--------------------------------------------------------------------------------
1 | """Download the pseudopotential and other related files after sparc-x-api is installed
2 |
3 | Run:
4 |
5 | python -m sparc.download_data
6 | """
7 |
8 | import hashlib
9 | import shutil
10 | import tempfile
11 | import zipfile
12 | from io import BytesIO
13 | from pathlib import Path
14 |
15 | # import urllib.request
16 | from urllib.request import urlopen
17 |
18 | from .common import psp_dir
19 |
20 | sparc_tag = "b702c1061400a2d23c0e223e32182609d7958156"
21 | sparc_source_url = "https://github.com/SPARC-X/SPARC/archive/{sparc_tag}.zip"
22 | # This is a all_psp8_checksum
23 | all_psp8_checksum = "5ef42c4a81733a90b0e080b771c5a73a"
24 |
25 |
26 | def download_psp(sparc_tag=sparc_tag, psp_dir=psp_dir):
27 | """Download the external PSPs into the sparc/psp folder
28 |
29 | Arguments:
30 | sparc_tag (str): Commit hash or git tag for the psp files
31 | psp_dir (str or PosixPath): Directory to download the psp files
32 | """
33 | if is_psp_download_complete():
34 | print("PSPs have been successfully downloaded!")
35 | return
36 | download_url = sparc_source_url.format(sparc_tag=sparc_tag)
37 | print(f"Download link: {download_url}")
38 | with tempfile.TemporaryDirectory() as tmpdir:
39 | tmpdir = Path(tmpdir)
40 | with urlopen(download_url) as zipresp:
41 | with zipfile.ZipFile(BytesIO(zipresp.read())) as zfile:
42 | zfile.extractall(tmpdir)
43 | # print(list(os.walk(tmpdir)))
44 | source_dir = next(tmpdir.glob("SPARC-*/psps"))
45 | print(f"Found source_dir at {source_dir}")
46 | if not source_dir.is_dir():
47 | raise FileNotFoundError("Error downloading or extracting zip")
48 | print(f"Moving psp files to {psp_dir}")
49 | for ext in ("*.psp8", "*.psp", "*.pot"):
50 | for pspf in source_dir.glob(ext):
51 | print(f"Found {pspf} --> {psp_dir}")
52 | shutil.copy(pspf, psp_dir)
53 | if not is_psp_download_complete(psp_dir):
54 | raise RuntimeError(f"Files downloaded to {psp_dir} have different checksums!")
55 | return
56 |
57 |
58 | def checksum_all(psp_dir=psp_dir, extension="*.psp8"):
59 | """Checksum all the files under the psp_dir to make sure the psp8 files
60 | are the same as intended
61 |
62 | Arguments:
63 | psp_dir (str or PosixPath): Directory for the psp files
64 | extension (str): Search pattern for the psp files, either '.psp', '.psp8' or '.pot'
65 |
66 | Returns:
67 | str: Checksum for all the files concatenated
68 | """
69 | checker = hashlib.md5()
70 | psp_dir = Path(psp_dir)
71 | # Use sorted to make sure file order is correct
72 | for filename in sorted(psp_dir.glob(extension)):
73 | # Open the file in binary mode and update the group checksum
74 | print(f"Checking {filename}")
75 | with open(filename, "r") as f:
76 | f_checker = hashlib.md5()
77 | content = f.read().encode("utf8")
78 | f_checker.update(content)
79 | checker.update(f_checker.hexdigest().encode("ascii"))
80 | final_checksum = checker.hexdigest()
81 | print(f"Final checksum is {final_checksum}")
82 | return final_checksum
83 |
84 |
85 | def is_psp_download_complete(psp_dir=psp_dir):
86 | return checksum_all(psp_dir) == all_psp8_checksum
87 |
88 |
89 | if __name__ == "__main__":
90 | print("Running command-line psp downloader")
91 | download_psp()
92 |
--------------------------------------------------------------------------------
/sparc/psp/README.md:
--------------------------------------------------------------------------------
1 | This is the folder for storing the pseudo potential files with SPARC-X-API.
2 | During installation, this folder will be intentially kept empty.
3 |
4 | User `python -m sparc.download_data` to download the default pseudo potential files after installation.
5 |
--------------------------------------------------------------------------------
/sparc/sparc_parsers/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SPARC-X/SPARC-X-API/12422228c142965d7decf5b64db57d07e98a6a8c/sparc/sparc_parsers/__init__.py
--------------------------------------------------------------------------------
/sparc/sparc_parsers/inpt.py:
--------------------------------------------------------------------------------
1 | import numpy as np
2 | from ase.units import Bohr
3 |
4 | # Safe wrappers for both string and fd
5 | from ase.utils import reader, writer
6 |
7 | from ..api import SparcAPI
8 | from .utils import read_block_input, strip_comments
9 |
10 | defaultAPI = SparcAPI()
11 |
12 |
13 | @reader
14 | def _read_inpt(fileobj, validator=defaultAPI):
15 | contents = fileobj.read()
16 | # label = get_label(fileobj, ".ion")
17 | data, comments = strip_comments(contents)
18 | # We do not read the cell at this time!
19 |
20 | # find the index for all atom type lines. They should be at the
21 | # top of their block
22 | inpt_blocks = read_block_input(data, validator=validator)
23 | return {"inpt": {"params": inpt_blocks, "comments": comments}}
24 |
25 |
26 | @writer
27 | def _write_inpt(fileobj, data_dict, validator=defaultAPI):
28 | if "inpt" not in data_dict:
29 | raise ValueError("Your dict does not contain inpt section!")
30 |
31 | inpt_dict = data_dict["inpt"]
32 |
33 | if "params" not in inpt_dict:
34 | raise ValueError("Input dict for inpt file does not have `params` field!")
35 |
36 | comments = inpt_dict.get("comments", [])
37 | banner = "Input File Generated By SPARC ASE Calculator"
38 | if len(comments) == 0:
39 | comments = [banner]
40 | elif "ASE" not in comments[0]:
41 | comments = [banner] + comments
42 | for line in comments:
43 | fileobj.write(f"# {line}\n")
44 | fileobj.write("\n")
45 | params = inpt_dict["params"]
46 | for key, val in params.items():
47 | # TODO: can we add a multiline argument?
48 | val_string = validator.convert_value_to_string(key, val)
49 | if (val_string.count("\n") > 0) or (
50 | key
51 | in [
52 | "LATVEC",
53 | ]
54 | ):
55 | output = f"{key}:\n{val_string}\n"
56 | else:
57 | output = f"{key}: {val_string}\n"
58 | fileobj.write(output)
59 | return
60 |
61 |
62 | def _inpt_cell_to_ase_cell(data_dict):
63 | """Convert the inpt cell convention to a real cell (in ASE Angstrom unit)
64 |
65 | Arguments:
66 | inpt_blocks: an already validated inpt file blocks dict
67 | (i.e. parsed by _read_inpt)
68 |
69 | Returns:
70 | cell in ASE-unit
71 | """
72 | inpt_blocks = data_dict["inpt"]["params"]
73 | if ("CELL" in inpt_blocks) and ("LATVEC_SCALE" in inpt_blocks):
74 | # TODO: customize the exception class
75 | # TODO: how do we convert the rule from doc?
76 | raise ValueError("LATVEC_SCALE and CELL cannot be specified simultaneously!")
77 |
78 | # if "CELL" in inpt_blocks:
79 | # cell = np.eye(inpt_blocks["CELL"]) * Bohr
80 | if "LATVEC" not in inpt_blocks:
81 | if ("CELL" in inpt_blocks) or ("LATVEC_SCALE" in inpt_blocks):
82 | lat_array = np.eye(3) * Bohr
83 | else:
84 | raise KeyError(
85 | "LATVEC is missing in inpt file and no CELL / LATVEC_SCALE provided!"
86 | )
87 | else:
88 | lat_array = np.array(inpt_blocks["LATVEC"]) * Bohr
89 |
90 | # LATVEC_SCALE: just multiplies
91 | if "LATVEC_SCALE" in inpt_blocks:
92 | scale = np.array(inpt_blocks["LATVEC_SCALE"])
93 | cell = (lat_array.T * scale).T
94 |
95 | # CELL: the lengths are in the LATVEC directions
96 | # TODO: the documentation about CELL is a bit messy. Is CELL always orthogonal?
97 | # Anyway the lat_array when CELL is none should be ok
98 | elif "CELL" in inpt_blocks:
99 | scale = np.array(inpt_blocks["CELL"])
100 | unit_lat_array = (
101 | lat_array / np.linalg.norm(lat_array, axis=1, keepdims=True) * Bohr
102 | )
103 | cell = (unit_lat_array.T * scale).T
104 | else:
105 | cell = lat_array
106 | return cell
107 |
--------------------------------------------------------------------------------
/sparc/sparc_parsers/utils.py:
--------------------------------------------------------------------------------
1 | from warnings import warn
2 |
3 |
4 | def get_label(fileobj, ext):
5 | """Return the label of file by stripping the extension (e.g. .ion)"""
6 | return fileobj.name.rsplit(ext, 1)[0]
7 |
8 |
9 | def strip_comments(rawtext, symbol="#"):
10 | """Strip comments from the text, including trailing comments"""
11 | stripped = []
12 | comments = []
13 | for line in rawtext.splitlines():
14 | data, comment = bisect_and_strip(line, symbol)
15 | if data:
16 | stripped.append(data)
17 | if comment:
18 | comments.append(comment)
19 | return stripped, comments
20 |
21 |
22 | def bisect_and_strip(text, delimiter):
23 | """split string in 2 at first occurence of a character and remove whitespace
24 | useful for separating comments from data, keys from values, etc.
25 | """
26 | # wrap around to len(text) if not found (-1)
27 | index = text.find(delimiter) % (len(text) + 1)
28 | return text[:index].strip(), text[index + len(delimiter) :].strip()
29 |
30 |
31 | def read_block_input(block, validator=None):
32 | """Read blocks of inputs from ion or inpt file and convert with validator
33 |
34 | the following inputs are accepted:
35 | 1) single line input: KEY: VALUE
36 | 2) multiline input: KEY: VALUE1 \n VALUE2 --> (concanate the values)
37 | 3) multiline input w/ blank first line: KEY: \n VALUE1 \n VALUE2 --> (append the values)
38 | """
39 | # print(block)
40 | block_dict = {}
41 | multiline_key = ""
42 | concat = False
43 | use_validator = True if validator else False
44 | for line in block:
45 | if ":" not in line:
46 | # no key, assume multiline value.
47 | # be careful not to add blank lines
48 | if multiline_key:
49 | if concat:
50 | block_dict[multiline_key] = (
51 | block_dict[multiline_key] + f" {line.strip()}"
52 | )
53 | else:
54 | block_dict[multiline_key].append(line.strip())
55 | continue
56 | key, value = bisect_and_strip(line, ":")
57 | key = key.upper()
58 |
59 | if key and value:
60 | block_dict[key] = value
61 | multiline_key = key
62 | concat = True
63 | elif key:
64 | # no value, assume that this key has a list of values
65 | # in the following lines
66 | block_dict[key] = []
67 | multiline_key = key
68 | concat = False
69 | for key, val in block_dict.items():
70 | _use_validator_this_key = use_validator
71 | if _use_validator_this_key:
72 | if key not in validator.parameters.keys():
73 | warn(
74 | f"Key {key} not in validator's parameter list, ignore value conversion!"
75 | )
76 | _use_validator_this_key = False
77 | if _use_validator_this_key:
78 | val = validator.convert_string_to_value(key, val)
79 | block_dict[key] = val
80 | return block_dict
81 |
82 |
83 | def make_reverse_mapping(mapping):
84 | """Given a list of mapping, get its reverse mapping
85 |
86 | For example:
87 | mapping = [0, 2, 3, 1, 5, 4]
88 | reverse = [0, 3, 1, 2, 5, 4]
89 | """
90 | reverse = [0] * len(mapping)
91 | for i, j in enumerate(mapping):
92 | reverse[j] = i
93 | return reverse
94 |
--------------------------------------------------------------------------------
/tests/archive/read_input.inpt:
--------------------------------------------------------------------------------
1 | # Input File Generated By SPARC ASE Calculator #
2 | FD_GRID: 30 30 30
3 | CELL: 11.338356755021570 11.338356755021570 11.338356755021570
4 | LATVEC:
5 | 1.000000000000000 0.000000000000000 0.000000000000000
6 | 0.000000000000000 1.000000000000000 0.000000000000000
7 | 0.000000000000000 0.000000000000000 1.000000000000000
8 | BC: P P P
9 | KPOINT_GRID: 1 1 1
10 | EXCHANGE_CORRELATION: LDA_PZ
11 | PRINT_FORCES: 1
12 | PRINT_ATOMS: 1
13 | TOL_SCF: 0.0001
14 | MD_FLAG: 1
15 | ION_TEMP: 500
16 | MD_NSTEP: 50
17 |
--------------------------------------------------------------------------------
/tests/archive/read_input.ion:
--------------------------------------------------------------------------------
1 | # Input File Generated By SPARC ASE Calculator #
2 | #CELL: 11.338356755021570 11.338356755021570 11.338356755021570
3 | #LATVEC
4 | # 1.000000000000000 0.000000000000000 0.000000000000000
5 | # 0.000000000000000 1.000000000000000 0.000000000000000
6 | # 0.000000000000000 0.000000000000000 1.000000000000000
7 | #PBC: True True True
8 | #
9 |
10 |
11 | ATOM_TYPE: N
12 | N_TYPE_ATOM: 2
13 | PSEUDO_POT: N.pot
14 | ATOMIC_MASS: 14.007
15 | COORD_FRAC:
16 | 0.000000000000000 0.000000000000000 0.094165000000000 # index 0
17 | 0.000000000000000 0.000000000000000 -0.094165000000000 # index 1
18 | RELAX:
19 | 1 1 1
20 | 1 1 1
21 |
22 |
23 |
--------------------------------------------------------------------------------
/tests/archive/test.py:
--------------------------------------------------------------------------------
1 | import os
2 | from copy import deepcopy as dc
3 |
4 | import numpy as np
5 | from ase.build import bulk, molecule
6 | from ase.calculators.calculator import CalculatorSetupError, compare_atoms
7 | from ase.constraints import FixAtoms, FixedLine, FixedPlane
8 | from ase.visualize import view
9 |
10 | from sparc.ion import read_ion, write_ion
11 | from sparc.sparc_core import SPARC
12 |
13 | atoms = bulk("NaCl", crystalstructure="rocksalt", a=5) * (2, 1, 1)
14 | atoms.set_initial_magnetic_moments([1.1] * len(atoms))
15 | l = SPARC(atoms=atoms, h=0.1, label="in1", xc="GGA", spin_typ=1, pseudo_dir=".")
16 | l.write_input(atoms=atoms, h=0.1, spin_typ=1, pseudo_dir=".", SPIN_TYP=1)
17 |
18 | print("input writing functional")
19 | # check reading and writing .ion files
20 | atoms.set_constraint([FixAtoms([0]), FixedLine(1, [0, 1, 0]), FixedPlane(2, [1, 0, 0])])
21 | write_ion(open("in1.ion", "w"), atoms, pseudo_dir=".")
22 | recovered_atoms = read_ion(open("in1.ion", "r"))
23 | assert compare_atoms(atoms, recovered_atoms) == []
24 |
25 | calc = SPARC(atoms=atoms, pseudo_dir=".", SPIN_TYP=1)
26 | try: # check that `h` is required
27 | calc.write_input()
28 | raise Exception("test failed")
29 | except CalculatorSetupError:
30 | pass
31 |
32 | print(".ion reading test passed")
33 |
34 | calc = SPARC.read("read_input")
35 |
36 | print("reading test passed")
37 |
38 | d = calc.todict()
39 | print("to dict test passed")
40 |
--------------------------------------------------------------------------------
/tests/outputs/AlSi_primitive_quick_relax.sparc/AlSi_primitive_quick_relax.geopt:
--------------------------------------------------------------------------------
1 | :RELAXSTEP: 1
2 | :E(Ha): -5.774163825437492E+00
3 | :R(Bohr):
4 | 0.000000000000000 0.000000000000000 0.000000000000000
5 | 3.657724819665000 3.622889345192000 3.657724819665000
6 | :F(Ha/Bohr):
7 | 0.113139770628281 0.087368929971100 0.113139763970798
8 | -0.113139770628281 -0.087368929971100 -0.113139763970798
9 | :CELL: 4.9264800451E+00 4.9264800451E+00 4.9264800451E+00
10 | :VOLUME: 8.4546412886E+01
11 | :LATVEC:
12 | 0.0000000000E+00 5.0000000000E-01 5.0000000000E-01
13 | 5.0000000000E-01 0.0000000000E+00 5.0000000000E-01
14 | 5.0000000000E-01 5.0000000000E-01 0.0000000000E+00
15 | :STRESS:
16 | -6.5373541539E+02 1.5358155364E+00 5.1364935602E+00
17 | 1.5358155364E+00 -6.4458329707E+02 1.5364037537E+00
18 | 5.1364935602E+00 1.5364037537E+00 -6.5373541688E+02
19 | :RELAXSTEP: 2
20 | :E(Ha): -5.775437935275552E+00
21 | :R(Bohr):
22 | 0.002194196103526 0.001694404758356 0.002194195974413
23 | 3.655530623561474 3.621194940433644 3.655530623690587
24 | :F(Ha/Bohr):
25 | 0.110411027039840 0.085419023529961 0.110411024664740
26 | -0.110411027039840 -0.085419023529961 -0.110411024664740
27 | :CELL: 4.9264800451E+00 4.9264800451E+00 4.9264800451E+00
28 | :VOLUME: 8.4546412886E+01
29 | :LATVEC:
30 | 0.0000000000E+00 5.0000000000E-01 5.0000000000E-01
31 | 5.0000000000E-01 0.0000000000E+00 5.0000000000E-01
32 | 5.0000000000E-01 5.0000000000E-01 0.0000000000E+00
33 | :STRESS:
34 | -6.5313614259E+02 9.0682890659E-01 4.3139086021E+00
35 | 9.0682890659E-01 -6.4446221862E+02 9.0731929019E-01
36 | 4.3139086021E+00 9.0731929019E-01 -6.5313614220E+02
37 | :RELAXSTEP: 3
38 | :E(Ha): -5.794556768421822E+00
39 | :R(Bohr):
40 | 0.047359563668326 0.036636400120512 0.047359562567641
41 | 3.610365255996675 3.586252945071489 3.610365257097359
42 | :F(Ha/Bohr):
43 | 0.052498938225036 0.042849311571086 0.052498939943199
44 | -0.052498938225036 -0.042849311571086 -0.052498939943199
45 | :CELL: 4.9264800451E+00 4.9264800451E+00 4.9264800451E+00
46 | :VOLUME: 8.4546412886E+01
47 | :LATVEC:
48 | 0.0000000000E+00 5.0000000000E-01 5.0000000000E-01
49 | 5.0000000000E-01 0.0000000000E+00 5.0000000000E-01
50 | 5.0000000000E-01 5.0000000000E-01 0.0000000000E+00
51 | :STRESS:
52 | -6.4415620548E+02 -8.6396949567E+00 -8.0141975097E+00
53 | -8.6396949567E+00 -6.4250622311E+02 -8.6415211701E+00
54 | -8.0141975097E+00 -8.6415211701E+00 -6.4415620598E+02
55 | :RELAXSTEP: 4
56 | :E(Ha): -5.800046313085624E+00
57 | :R(Bohr):
58 | 0.088817234444247 0.070409417644916 0.088817234618174
59 | 3.568907585220755 3.552479927547084 3.568907585046826
60 | :F(Ha/Bohr):
61 | -0.002316182978578 -0.000896147882701 -0.002316181899298
62 | 0.002316182978578 0.000896147882701 0.002316181899298
63 | :CELL: 4.9264800451E+00 4.9264800451E+00 4.9264800451E+00
64 | :VOLUME: 8.4546412886E+01
65 | :LATVEC:
66 | 0.0000000000E+00 5.0000000000E-01 5.0000000000E-01
67 | 5.0000000000E-01 0.0000000000E+00 5.0000000000E-01
68 | 5.0000000000E-01 5.0000000000E-01 0.0000000000E+00
69 | :STRESS:
70 | -6.4167808183E+02 -1.1488628417E+01 -1.1484645019E+01
71 | -1.1488628417E+01 -6.4166849406E+02 -1.1490464116E+01
72 | -1.1484645019E+01 -1.1490464116E+01 -6.4167808184E+02
73 | :RELAXSTEP: 5
74 | :E(Ha): -5.800057594119798E+00
75 | :R(Bohr):
76 | 0.087177352609414 0.069437155473653 0.087177353155337
77 | 3.570547467055587 3.553452189718348 3.570547466509663
78 | :F(Ha/Bohr):
79 | -0.000124428376470 0.000340548405068 -0.000124428470943
80 | 0.000124428376470 -0.000340548405068 0.000124428470943
81 | :CELL: 4.9264800451E+00 4.9264800451E+00 4.9264800451E+00
82 | :VOLUME: 8.4546412886E+01
83 | :LATVEC:
84 | 0.0000000000E+00 5.0000000000E-01 5.0000000000E-01
85 | 5.0000000000E-01 0.0000000000E+00 5.0000000000E-01
86 | 5.0000000000E-01 5.0000000000E-01 0.0000000000E+00
87 | :STRESS:
88 | -6.4167181594E+02 -1.1491312956E+01 -1.1491173282E+01
89 | -1.1491312956E+01 -6.4167099339E+02 -1.1493172604E+01
90 | -1.1491173282E+01 -1.1493172604E+01 -6.4167181583E+02
91 |
--------------------------------------------------------------------------------
/tests/outputs/AlSi_primitive_quick_relax.sparc/AlSi_primitive_quick_relax.inpt:
--------------------------------------------------------------------------------
1 | # nprocs: 8
2 |
3 | # Test: CuSi7 #
4 | LATVEC_SCALE: 6.9670948946E+00 6.9670948946E+00 6.9670948946E+00
5 | LATVEC:
6 | 0.0 0.5 0.5
7 | 0.5 0.0 0.5
8 | 0.5 0.5 0.0
9 | MESH_SPACING: 0.3
10 | FD_ORDER: 12
11 | BC: P P P
12 | EXCHANGE_CORRELATION: GGA_PBE
13 | TOL_SCF: 1e-6
14 |
15 | KPOINT_GRID: 2 2 2
16 |
17 | PRINT_FORCES: 1
18 | PRINT_ATOMS: 1
19 | CALC_STRESS: 1
20 |
21 | RELAX_FLAG: 1
22 | RELAX_METHOD: LBFGS
23 |
24 | PRINT_RELAXOUT: 1
25 | RESTART_FLAG: 0
--------------------------------------------------------------------------------
/tests/outputs/AlSi_primitive_quick_relax.sparc/AlSi_primitive_quick_relax.ion:
--------------------------------------------------------------------------------
1 | #=========================
2 | # format of ion file
3 | #=========================
4 | # ATOM_TYPE:
5 | # PSEUDO_POT:
6 | # N_TYPE_ATOM:
7 | # ATOMIC_MASS: #(optional, for MD only)
8 | # COORD:
9 | #
10 | # ...
11 | # RELAX: #(optional)
12 | #
13 | # ...
14 |
15 | # this is a comment
16 |
17 | ATOM_TYPE: Al # atom type
18 | N_TYPE_ATOM: 1 # number of atoms of this type
19 | PSEUDO_POT: ../../../psps/13_Al_3_1.9_1.9_pbe_n_v1.0.psp8 # pseudopotential
20 | COORD_FRAC: # coordinates follows
21 | 0.00 0.00 0.00
22 |
23 | ATOM_TYPE: Si # atom type
24 | N_TYPE_ATOM: 1 # number of atoms of this type
25 | PSEUDO_POT: ../../../psps/14_Si_4_1.9_1.9_pbe_n_v1.0.psp8 # pseudopotential
26 | COORD_FRAC: # coordinates follows
27 | 0.52 0.53 0.52
28 |
29 |
30 |
--------------------------------------------------------------------------------
/tests/outputs/AlSi_primitive_quick_relax.sparc/output.sparc:
--------------------------------------------------------------------------------
1 | ---------------------------------------
2 | Begin PBS Prologue Wed Oct 27 17:50:31 EDT 2021
3 | Job ID: 7040477.sched-hive.pace.gatech.edu
4 | User ID: skumar416
5 | Job name: testing_suite
6 | Queue: hive-interact
7 | End PBS Prologue Wed Oct 27 17:50:31 EDT 2021
8 | ---------------------------------------
9 | /storage/hive/scratch/5/skumar416/00merge_dev_sparc_10272021/sparc_public/tests_LHQ/CuSi7/temp_run
10 | ---------------------------------------
11 | Begin PBS Epilogue Wed Oct 27 17:50:36 EDT 2021
12 | Job ID: 7040477.sched-hive.pace.gatech.edu
13 | User ID: skumar416
14 | Job name: testing_suite
15 | Resources: nodes=1:ppn=24,pmem=7gb,walltime=01:00:00,neednodes=1:ppn=24
16 | Rsrc Used: cput=00:00:36,vmem=0kb,walltime=00:00:05,mem=0kb,energy_used=0
17 | Queue: hive-interact
18 | Nodes:
19 | atl1-1-01-017-3-r.pace.gatech.edu
20 | End PBS Epilogue Wed Oct 27 17:50:36 EDT 2021
21 | ---------------------------------------
22 |
--------------------------------------------------------------------------------
/tests/outputs/Al_multi_geopt.sparc/SPARC.geopt:
--------------------------------------------------------------------------------
1 | :RELAXSTEP: 1
2 | :E(Ha): -9.052841822385940E+00
3 | :R(Bohr):
4 | 0.095865400000000 7.627261800000000 0.122395000000000
5 | 0.297811000000000 3.782450000000000 3.782450000000000
6 | 4.425120000000000 0.145024000000000 3.737980000000000
7 | 3.829220000000000 3.739120000000000 7.565379800000000
8 | :F(Ha/Bohr):
9 | 0.005147731065701 -0.001066890163457 -0.007141055737244
10 | 0.001478478247868 0.003140582165144 0.002025907597284
11 | -0.008903664572768 -0.006257553671765 0.004496591545909
12 | 0.002277455259199 0.004183861670078 0.000618556594051
13 | :RELAXSTEP: 2
14 | :E(Ha): -9.052891986175165E+00
15 | :R(Bohr):
16 | 0.097472462231678 7.626928729203341 0.120165644809692
17 | 0.298272563846709 3.783430453508287 3.783082464972026
18 | 4.422340378672506 0.143070463958540 3.739383783988029
19 | 3.829930995249107 3.740426153329833 7.565572906230253
20 | :F(Ha/Bohr):
21 | 0.004893268802518 -0.000861145998705 -0.006815426088504
22 | 0.001397638928025 0.002915857592138 0.001855709710195
23 | -0.008698885740238 -0.006035904506556 0.004187002987289
24 | 0.002407978009696 0.003981192913123 0.000772713391019
25 | :RELAXSTEP: 3
26 | :E(Ha): -9.053618936214750E+00
27 | :R(Bohr):
28 | 0.116904714853397 7.623508927989395 0.093100080496463
29 | 0.303822897135031 3.795009968884639 3.790451898644367
30 | 4.387795179531842 0.119100552248066 3.756011298858055
31 | 3.839493608479729 3.756236350877901 7.568641522001116
32 | :F(Ha/Bohr):
33 | 0.004260092312641 -0.000712966798020 -0.005322202416789
34 | 0.000818378748039 0.002374335637220 0.001439878885502
35 | -0.007812970482679 -0.005162285387695 0.003149513792273
36 | 0.002734499421999 0.003500916548495 0.000732809739014
37 | :RELAXSTEP: 4
38 | :E(Ha): -9.056169343609362E+00
39 | :R(Bohr):
40 | 0.181636647712387 7.612675425916400 0.012229426946717
41 | 0.316258129586240 3.831087904237633 3.812330800907779
42 | 4.269077404517124 0.040659831580192 3.803868035374048
43 | 3.881044218184246 3.809432638265775 7.579776536771456
44 | :F(Ha/Bohr):
45 | 0.001410750394171 0.000932746009291 -0.000815829712265
46 | -0.001476399127699 -0.000231680774296 -0.000497847129708
47 | -0.003895909831698 -0.001249819605180 -0.000160023078570
48 | 0.003961558565226 0.000548754370185 0.001473699920542
49 |
--------------------------------------------------------------------------------
/tests/outputs/Al_multi_geopt.sparc/SPARC.geopt_01:
--------------------------------------------------------------------------------
1 | :RELAXSTEP: 5
2 | :E(Ha): -9.056794565845324E+00
3 | :R(Bohr):
4 | 0.199289707274814 7.623689779165953 0.002230082069005
5 | 0.299391321476416 3.828405438300385 3.806897548787078
6 | 4.222993483627602 0.026280958941829 3.802603984345621
7 | 3.926341887621165 3.815479623591832 7.596473184798296
8 | :F(Ha/Bohr):
9 | 0.001348740747191 0.000519944983722 -0.000471254413325
10 | -0.001339080655298 0.000001510075108 -0.000427672494722
11 | -0.003379884185292 -0.000952168732683 -0.000199968816160
12 | 0.003370224093399 0.000430713673853 0.001098895724208
13 | :RELAXSTEP: 6
14 | :E(Ha): -9.057481297802305E+00
15 | :R(Bohr):
16 | 0.249030897156113 7.642865207962792 7.638240348191730
17 | 0.250006393142157 3.828461129457374 3.791125104148432
18 | 4.098344279258630 7.644555236494754 3.795229189096287
19 | 4.050634830443096 3.831364226085080 7.637000158563550
20 | :F(Ha/Bohr):
21 | -0.000102999211261 0.000449955498366 -0.000681311994338
22 | -0.000140822699749 -0.000359475275413 0.000657805345506
23 | -0.000490766483801 0.000369770497067 0.000636729632394
24 | 0.000734588394812 -0.000460250720020 -0.000613222983562
25 | :RELAXSTEP: 7
26 | :E(Ha): -9.057488887961474E+00
27 | :R(Bohr):
28 | 0.246907349432143 7.652141997199744 7.624193652909588
29 | 0.247103033787519 3.821049782384152 3.804687159888064
30 | 4.088226084789823 7.652178841450763 3.808356724201617
31 | 4.065779931990512 3.821875178965341 7.624357263000731
32 | :F(Ha/Bohr):
33 | -0.000009785880810 -0.000026214467282 0.000037130080207
34 | -0.000054257971358 0.000063956736419 -0.000013318129566
35 | -0.000295301734852 -0.000052365396741 -0.000057828154613
36 | 0.000359345587020 0.000014623127604 0.000034016203972
37 |
--------------------------------------------------------------------------------
/tests/outputs/Al_multi_geopt.sparc/SPARC.geopt_02:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SPARC-X/SPARC-X-API/12422228c142965d7decf5b64db57d07e98a6a8c/tests/outputs/Al_multi_geopt.sparc/SPARC.geopt_02
--------------------------------------------------------------------------------
/tests/outputs/Al_multi_geopt.sparc/SPARC.inpt:
--------------------------------------------------------------------------------
1 | # Input File Generated By SPARC ASE Calculator
2 |
3 | LATVEC:
4 | 7.65339 0 0
5 | 0 7.65339 0
6 | 0 0 7.65339
7 | LATVEC_SCALE: 1 1 1
8 | EXCHANGE_CORRELATION: GGA_PBE
9 | FD_GRID: 17 17 17
10 | KPOINT_GRID: 1 1 1
11 | RELAX_FLAG: 1
12 | RESTART_FLAG: 1
13 | RELAX_NITER: 4
14 |
15 |
--------------------------------------------------------------------------------
/tests/outputs/Al_multi_geopt.sparc/SPARC.ion:
--------------------------------------------------------------------------------
1 | # Ion File Generated by SPARC ASE Calculator
2 | #
3 | # ASE-SORT:
4 | # 0 1 2 3
5 | # END ASE-SORT
6 |
7 | ATOM_TYPE: Al
8 | N_TYPE_ATOM: 4
9 | PSEUDO_POT: 13_Al_3_1.9_1.9_pbe_n_v1.0.psp8
10 | COORD:
11 | 0.0958654 -0.0261282 0.122395
12 | 0.297811 3.78245 3.78245
13 | 4.42512 0.145024 3.73798
14 | 3.82922 3.73912 -0.0880102
15 |
16 |
--------------------------------------------------------------------------------
/tests/outputs/Al_socket_bfgs.sparc/SPARC.inpt:
--------------------------------------------------------------------------------
1 | # Input File Generated By SPARC ASE Calculator
2 |
3 | LATVEC:
4 | 7.65339080963956 0.00000000000000 0.00000000000000
5 | 0.00000000000000 7.65339080963956 0.00000000000000
6 | 0.00000000000000 0.00000000000000 7.65339080963956
7 | LATVEC_SCALE: 1.00000000000000 1.00000000000000 1.00000000000000
8 | BC: P P P
9 | EXCHANGE_CORRELATION: GGA_PBE
10 | FD_GRID: 15 15 15
11 | KPOINT_GRID: 1 1 1
12 | PRECOND_KERKER_THRESH: 0.00000000000000
13 | ELEC_TEMP_TYPE: Fermi-Dirac
14 | ELEC_TEMP: 300.00000000000000
15 | MIXING_PARAMETER: 1.00000000000000
16 | TOL_SCF: 0.00100000000000
17 | RELAX_FLAG: 1
18 | CALC_STRESS: 1
19 | PRINT_ATOMS: 1
20 | PRINT_FORCES: 1
21 |
--------------------------------------------------------------------------------
/tests/outputs/Al_socket_bfgs.sparc/SPARC.ion:
--------------------------------------------------------------------------------
1 | # Ion File Generated by SPARC ASE Calculator
2 | #
3 | # ASE-SORT:
4 | # 0 1 2 3
5 | # END ASE-SORT
6 |
7 | ATOM_TYPE: Al
8 | N_TYPE_ATOM: 4
9 | PSEUDO_POT: 13_Al_3_1.9_1.9_pbe_n_v1.0.psp8
10 | COORD:
11 | 0.18773074240366 -0.05225633243875 0.24479079037080
12 | 0.57562186201678 3.73819825488627 3.73820445990562
13 | 4.42355134796394 0.29004829151097 3.64925980231727
14 | 4.03175338265970 3.65154890056322 -0.17602033658026
15 |
16 |
--------------------------------------------------------------------------------
/tests/outputs/Al_socket_bfgs.sparc/sparc-socket.traj:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SPARC-X/SPARC-X-API/12422228c142965d7decf5b64db57d07e98a6a8c/tests/outputs/Al_socket_bfgs.sparc/sparc-socket.traj
--------------------------------------------------------------------------------
/tests/outputs/Al_socket_volchange.sparc/SPARC.inpt:
--------------------------------------------------------------------------------
1 | # Input File Generated By SPARC ASE Calculator
2 |
3 | LATVEC:
4 | 7.65339080963956 0.00000000000000 0.00000000000000
5 | 0.00000000000000 7.65339080963956 0.00000000000000
6 | 0.00000000000000 0.00000000000000 7.65339080963956
7 | LATVEC_SCALE: 1.00000000000000 1.00000000000000 1.00000000000000
8 | BC: P P P
9 | EXCHANGE_CORRELATION: GGA_PBE
10 | FD_GRID: 15 15 15
11 | KPOINT_GRID: 1 1 1
12 | PRECOND_KERKER_THRESH: 0.00000000000000
13 | ELEC_TEMP_TYPE: Fermi-Dirac
14 | ELEC_TEMP: 300.00000000000000
15 | MIXING_PARAMETER: 1.00000000000000
16 | TOL_SCF: 0.00100000000000
17 | RELAX_FLAG: 0
18 | CALC_STRESS: 1
19 | PRINT_ATOMS: 1
20 | PRINT_FORCES: 1
21 |
--------------------------------------------------------------------------------
/tests/outputs/Al_socket_volchange.sparc/SPARC.ion:
--------------------------------------------------------------------------------
1 | # Ion File Generated by SPARC ASE Calculator
2 | #
3 | # ASE-SORT:
4 | # 0 1 2 3
5 | # END ASE-SORT
6 |
7 | ATOM_TYPE: Al
8 | N_TYPE_ATOM: 4
9 | PSEUDO_POT: 13_Al_3_1.9_1.9_pbe_n_v1.0.psp8
10 | COORD:
11 | 0.33335758055190 0.07561875310935 0.18495467389136
12 | 0.42346744237413 4.17961271736997 3.64201665063928
13 | 4.00623609526510 -0.02860236708539 3.80718986872846
14 | 3.90428727645402 3.85391569478794 0.27481786402204
15 |
16 |
--------------------------------------------------------------------------------
/tests/outputs/Al_socket_volchange.sparc/single-points/sp_image00/SPARC.inpt:
--------------------------------------------------------------------------------
1 | # Input File Generated By SPARC ASE Calculator
2 |
3 | LATVEC:
4 | 7.65339080963956 0.00000000000000 0.00000000000000
5 | 0.00000000000000 7.65339080963956 0.00000000000000
6 | 0.00000000000000 0.00000000000000 7.65339080963956
7 | LATVEC_SCALE: 1.00000000000000 1.00000000000000 1.00000000000000
8 | BC: P P P
9 | EXCHANGE_CORRELATION: GGA_PBE
10 | FD_GRID: 15 15 15
11 | KPOINT_GRID: 1 1 1
12 | PRECOND_KERKER_THRESH: 0.00000000000000
13 | ELEC_TEMP_TYPE: Fermi-Dirac
14 | ELEC_TEMP: 300.00000000000000
15 | MIXING_PARAMETER: 1.00000000000000
16 | TOL_SCF: 0.00100000000000
17 | RELAX_FLAG: 0
18 | CALC_STRESS: 1
19 | PRINT_ATOMS: 1
20 | PRINT_FORCES: 1
21 |
--------------------------------------------------------------------------------
/tests/outputs/Al_socket_volchange.sparc/single-points/sp_image00/SPARC.ion:
--------------------------------------------------------------------------------
1 | # Ion File Generated by SPARC ASE Calculator
2 | #
3 | # ASE-SORT:
4 | # 0 1 2 3
5 | # END ASE-SORT
6 |
7 | ATOM_TYPE: Al
8 | N_TYPE_ATOM: 4
9 | PSEUDO_POT: 13_Al_3_1.9_1.9_pbe_n_v1.0.psp8
10 | COORD:
11 | 0.33335758055190 0.07561875310935 0.18495467389136
12 | 0.42346744237413 4.17961271736997 3.64201665063928
13 | 4.00623609526510 -0.02860236708539 3.80718986872846
14 | 3.90428727645402 3.85391569478794 0.27481786402204
15 |
16 |
--------------------------------------------------------------------------------
/tests/outputs/Al_socket_volchange.sparc/single-points/sp_image00/SPARC.static:
--------------------------------------------------------------------------------
1 | ***************************************************************************
2 | Atom positions
3 | ***************************************************************************
4 | Fractional coordinates of Al:
5 | 0.0435568480 0.0098804249 0.0241663700
6 | 0.0553306963 0.5461125430 0.4758696820
7 | 0.5234589733 0.9962627850 0.4974513864
8 | 0.5101382346 0.5035566314 0.0359079878
9 | Total free energy (Ha): -9.041897494954158E+00
10 | Atomic forces (Ha/Bohr):
11 | -6.3263660275E-03 4.1224438525E-03 -9.7573141360E-03
12 | -1.1198940824E-02 -9.4391851505E-03 1.3724648201E-02
13 | 7.1551844744E-03 6.8108725330E-03 8.1322757442E-03
14 | 1.0370122377E-02 -1.4941312349E-03 -1.2099609809E-02
15 | Stress (GPa):
16 | -1.2943266428E+01 -7.3004908329E-01 1.0042725753E+00
17 | -7.3004908329E-01 -1.3976465331E+01 5.9432478434E-01
18 | 1.0042725753E+00 5.9432478434E-01 -8.2525496306E+00
19 |
--------------------------------------------------------------------------------
/tests/outputs/Al_socket_volchange.sparc/single-points/sp_image01/SPARC.inpt:
--------------------------------------------------------------------------------
1 | # Input File Generated By SPARC ASE Calculator
2 |
3 | LATVEC:
4 | 7.72992471773595 0.00000000000000 0.00000000000000
5 | 0.00000000000000 7.72992471773595 0.00000000000000
6 | 0.00000000000000 0.00000000000000 7.72992471773595
7 | LATVEC_SCALE: 1.00000000000000 1.00000000000000 1.00000000000000
8 | BC: P P P
9 | EXCHANGE_CORRELATION: GGA_PBE
10 | FD_GRID: 15 15 15
11 | KPOINT_GRID: 1 1 1
12 | PRECOND_KERKER_THRESH: 0.00000000000000
13 | ELEC_TEMP_TYPE: Fermi-Dirac
14 | ELEC_TEMP: 300.00000000000000
15 | MIXING_PARAMETER: 1.00000000000000
16 | TOL_SCF: 0.00100000000000
17 | RELAX_FLAG: 0
18 | CALC_STRESS: 1
19 | PRINT_ATOMS: 1
20 | PRINT_FORCES: 1
21 |
--------------------------------------------------------------------------------
/tests/outputs/Al_socket_volchange.sparc/single-points/sp_image01/SPARC.ion:
--------------------------------------------------------------------------------
1 | # Ion File Generated by SPARC ASE Calculator
2 | #
3 | # ASE-SORT:
4 | # 0 1 2 3
5 | # END ASE-SORT
6 |
7 | ATOM_TYPE: Al
8 | N_TYPE_ATOM: 4
9 | PSEUDO_POT: 13_Al_3_1.9_1.9_pbe_n_v1.0.psp8
10 | COORD:
11 | 0.31002635498075 -0.11676125982981 -0.10080809587731
12 | -0.20478930058667 4.03013608293795 3.42568530055092
13 | 4.19798121279424 -0.14528572934667 3.92585490688121
14 | 3.81736694579949 4.14402369917815 -0.39320327388543
15 |
16 |
--------------------------------------------------------------------------------
/tests/outputs/Al_socket_volchange.sparc/single-points/sp_image01/SPARC.static:
--------------------------------------------------------------------------------
1 | ***************************************************************************
2 | Atom positions
3 | ***************************************************************************
4 | Fractional coordinates of Al:
5 | 0.0401072929 0.9848949034 0.9869587222
6 | 0.9735069476 0.5213680896 0.4431718840
7 | 0.5430817720 0.9812047679 0.5078775085
8 | 0.4938427068 0.5361014305 0.9491323282
9 | Total free energy (Ha): -9.043784594535243E+00
10 | Atomic forces (Ha/Bohr):
11 | -4.6545659010E-03 1.0910500836E-02 -2.1484091463E-03
12 | 7.9034706129E-03 -1.0332272794E-02 4.6320681206E-03
13 | -5.5312544787E-03 1.4037844226E-02 -9.0032967529E-03
14 | 2.2823497668E-03 -1.4616072269E-02 6.5196377787E-03
15 | Stress (GPa):
16 | -7.3370513709E+00 1.8635028645E+00 -7.2876683300E-01
17 | 1.8635028645E+00 -2.2951430546E+01 1.6496611617E+00
18 | -7.2876683300E-01 1.6496611617E+00 -9.4337661633E-01
19 |
--------------------------------------------------------------------------------
/tests/outputs/Al_socket_volchange.sparc/single-points/sp_image02/SPARC.inpt:
--------------------------------------------------------------------------------
1 | # Input File Generated By SPARC ASE Calculator
2 |
3 | LATVEC:
4 | 7.80645862583235 0.00000000000000 0.00000000000000
5 | 0.00000000000000 7.80645862583235 0.00000000000000
6 | 0.00000000000000 0.00000000000000 7.80645862583235
7 | LATVEC_SCALE: 1.00000000000000 1.00000000000000 1.00000000000000
8 | BC: P P P
9 | EXCHANGE_CORRELATION: GGA_PBE
10 | FD_GRID: 15 15 15
11 | KPOINT_GRID: 1 1 1
12 | PRECOND_KERKER_THRESH: 0.00000000000000
13 | ELEC_TEMP_TYPE: Fermi-Dirac
14 | ELEC_TEMP: 300.00000000000000
15 | MIXING_PARAMETER: 1.00000000000000
16 | TOL_SCF: 0.00100000000000
17 | RELAX_FLAG: 0
18 | CALC_STRESS: 1
19 | PRINT_ATOMS: 1
20 | PRINT_FORCES: 1
21 |
--------------------------------------------------------------------------------
/tests/outputs/Al_socket_volchange.sparc/single-points/sp_image02/SPARC.ion:
--------------------------------------------------------------------------------
1 | # Ion File Generated by SPARC ASE Calculator
2 | #
3 | # ASE-SORT:
4 | # 0 1 2 3
5 | # END ASE-SORT
6 |
7 | ATOM_TYPE: Al
8 | N_TYPE_ATOM: 4
9 | PSEUDO_POT: 13_Al_3_1.9_1.9_pbe_n_v1.0.psp8
10 | COORD:
11 | -0.08033093562375 -0.01084554712961 -0.41175620833334
12 | 0.31616558520924 3.55754090072064 3.74098077011621
13 | 4.00016074444072 -0.24003185000843 3.69930683823330
14 | 3.72801621818795 4.00952321866431 0.44182782750226
15 |
16 |
--------------------------------------------------------------------------------
/tests/outputs/Al_socket_volchange.sparc/single-points/sp_image02/SPARC.static:
--------------------------------------------------------------------------------
1 | ***************************************************************************
2 | Atom positions
3 | ***************************************************************************
4 | Fractional coordinates of Al:
5 | 0.9897096828 0.9986106956 0.9472544174
6 | 0.0405005138 0.4557176399 0.4792161144
7 | 0.5124168251 0.9692521460 0.4738777230
8 | 0.4775553675 0.5136161492 0.0565977287
9 | Total free energy (Ha): -9.049946219980990E+00
10 | Atomic forces (Ha/Bohr):
11 | 3.4983196881E-03 -2.5771700762E-03 -3.8304353125E-03
12 | -1.3648434921E-02 4.3201426170E-03 5.5532264248E-03
13 | 2.2414549146E-03 5.1274299183E-03 4.2342097525E-03
14 | 7.9086603180E-03 -6.8704024590E-03 -5.9570008648E-03
15 | Stress (GPa):
16 | 5.3310222375E+00 5.5148480239E-01 1.4621470847E+00
17 | 5.5148480239E-01 8.2658443311E-01 -8.1726042162E-01
18 | 1.4621470847E+00 -8.1726042162E-01 -3.3490689483E+01
19 |
--------------------------------------------------------------------------------
/tests/outputs/Al_socket_volchange.sparc/single-points/sp_image03/SPARC.inpt:
--------------------------------------------------------------------------------
1 | # Input File Generated By SPARC ASE Calculator
2 |
3 | LATVEC:
4 | 7.88299253392875 0.00000000000000 0.00000000000000
5 | 0.00000000000000 7.88299253392875 0.00000000000000
6 | 0.00000000000000 0.00000000000000 7.88299253392875
7 | LATVEC_SCALE: 1.00000000000000 1.00000000000000 1.00000000000000
8 | BC: P P P
9 | EXCHANGE_CORRELATION: GGA_PBE
10 | FD_GRID: 15 15 15
11 | KPOINT_GRID: 1 1 1
12 | PRECOND_KERKER_THRESH: 0.00000000000000
13 | ELEC_TEMP_TYPE: Fermi-Dirac
14 | ELEC_TEMP: 300.00000000000000
15 | MIXING_PARAMETER: 1.00000000000000
16 | TOL_SCF: 0.00100000000000
17 | RELAX_FLAG: 0
18 | CALC_STRESS: 1
19 | PRINT_ATOMS: 1
20 | PRINT_FORCES: 1
21 |
--------------------------------------------------------------------------------
/tests/outputs/Al_socket_volchange.sparc/single-points/sp_image03/SPARC.ion:
--------------------------------------------------------------------------------
1 | # Ion File Generated by SPARC ASE Calculator
2 | #
3 | # ASE-SORT:
4 | # 0 1 2 3
5 | # END ASE-SORT
6 |
7 | ATOM_TYPE: Al
8 | N_TYPE_ATOM: 4
9 | PSEUDO_POT: 13_Al_3_1.9_1.9_pbe_n_v1.0.psp8
10 | COORD:
11 | 0.34814184943268 0.08496305907586 0.01878244000876
12 | -0.36271355722600 3.88750493043546 3.87244534387989
13 | 3.92539131682184 -0.12204053467088 3.93296742007826
14 | 3.84860969485622 3.68576327828906 0.17218448446480
15 |
16 |
--------------------------------------------------------------------------------
/tests/outputs/Al_socket_volchange.sparc/single-points/sp_image03/SPARC.static:
--------------------------------------------------------------------------------
1 | ***************************************************************************
2 | Atom positions
3 | ***************************************************************************
4 | Fractional coordinates of Al:
5 | 0.0441636660 0.0107780210 0.0023826535
6 | 0.9539878345 0.4931509086 0.4912405190
7 | 0.4979570005 0.9845185018 0.4989180699
8 | 0.4882168388 0.4675588950 0.0218425279
9 | Total free energy (Ha): -9.055230019263519E+00
10 | Atomic forces (Ha/Bohr):
11 | 4.1781641350E-03 -3.8149257152E-03 -1.6645408146E-04
12 | -5.9870939391E-03 4.9750737355E-04 2.3869055006E-03
13 | 2.6554691309E-03 -1.5437864999E-03 3.2513858154E-03
14 | -8.4653932684E-04 4.8612048415E-03 -5.4718372345E-03
15 | Stress (GPa):
16 | -2.8951496890E+01 -4.1737032390E-01 -2.6525391877E-01
17 | -4.1737032390E-01 -1.2291874451E+00 1.7633488643E-01
18 | -2.6525391877E-01 1.7633488643E-01 1.5339643691E+01
19 |
--------------------------------------------------------------------------------
/tests/outputs/Al_socket_volchange.sparc/single-points/sp_image04/SPARC.inpt:
--------------------------------------------------------------------------------
1 | # Input File Generated By SPARC ASE Calculator
2 |
3 | LATVEC:
4 | 7.95952644202514 0.00000000000000 0.00000000000000
5 | 0.00000000000000 7.95952644202514 0.00000000000000
6 | 0.00000000000000 0.00000000000000 7.95952644202514
7 | LATVEC_SCALE: 1.00000000000000 1.00000000000000 1.00000000000000
8 | BC: P P P
9 | EXCHANGE_CORRELATION: GGA_PBE
10 | FD_GRID: 16 16 16
11 | KPOINT_GRID: 1 1 1
12 | PRECOND_KERKER_THRESH: 0.00000000000000
13 | ELEC_TEMP_TYPE: Fermi-Dirac
14 | ELEC_TEMP: 300.00000000000000
15 | MIXING_PARAMETER: 1.00000000000000
16 | TOL_SCF: 0.00100000000000
17 | RELAX_FLAG: 0
18 | CALC_STRESS: 1
19 | PRINT_ATOMS: 1
20 | PRINT_FORCES: 1
21 |
--------------------------------------------------------------------------------
/tests/outputs/Al_socket_volchange.sparc/single-points/sp_image04/SPARC.ion:
--------------------------------------------------------------------------------
1 | # Ion File Generated by SPARC ASE Calculator
2 | #
3 | # ASE-SORT:
4 | # 0 1 2 3
5 | # END ASE-SORT
6 |
7 | ATOM_TYPE: Al
8 | N_TYPE_ATOM: 4
9 | PSEUDO_POT: 13_Al_3_1.9_1.9_pbe_n_v1.0.psp8
10 | COORD:
11 | 0.00993696901131 0.09825619399092 -0.19572749311097
12 | 0.13631396708380 3.89755378868187 3.66834385305440
13 | 3.85246842744257 0.11763888703045 4.04506082397363
14 | 3.75424789751787 4.10135131357279 -0.01729220451054
15 |
16 |
--------------------------------------------------------------------------------
/tests/outputs/Al_socket_volchange.sparc/single-points/sp_image04/SPARC.static:
--------------------------------------------------------------------------------
1 | ***************************************************************************
2 | Atom positions
3 | ***************************************************************************
4 | Fractional coordinates of Al:
5 | 0.0012484372 0.0123444774 0.9754096560
6 | 0.0171258891 0.4896715674 0.4608746362
7 | 0.4840072403 0.0147796339 0.5082037045
8 | 0.4716672436 0.5152757948 0.9978274833
9 | Total free energy (Ha): -9.057145588265648E+00
10 | Atomic forces (Ha/Bohr):
11 | -4.2339372674E-03 -5.6593650263E-04 -1.2339977349E-03
12 | -3.6671313053E-03 2.3923983267E-03 -1.1977998972E-03
13 | 4.1355210899E-03 -1.8214502291E-03 1.8206741576E-03
14 | 3.7655474828E-03 -5.0115948835E-06 6.1112347455E-04
15 | Stress (GPa):
16 | -5.5026184590E+00 3.5780834926E-01 4.4240743901E-01
17 | 3.5780834926E-01 9.2471907584E+00 -2.1332362749E-01
18 | 4.4240743901E-01 -2.1332362749E-01 -1.1075645456E+01
19 |
--------------------------------------------------------------------------------
/tests/outputs/Al_socket_volchange.sparc/single-points/sp_image05/SPARC.inpt:
--------------------------------------------------------------------------------
1 | # Input File Generated By SPARC ASE Calculator
2 |
3 | LATVEC:
4 | 7.65339080963956 0.00000000000000 0.00000000000000
5 | 0.00000000000000 7.65339080963956 0.00000000000000
6 | 0.00000000000000 0.00000000000000 7.65339080963956
7 | LATVEC_SCALE: 1.00000000000000 1.00000000000000 1.00000000000000
8 | BC: P P P
9 | EXCHANGE_CORRELATION: GGA_PBE
10 | FD_GRID: 15 15 15
11 | KPOINT_GRID: 1 1 1
12 | PRECOND_KERKER_THRESH: 0.00000000000000
13 | ELEC_TEMP_TYPE: Fermi-Dirac
14 | ELEC_TEMP: 300.00000000000000
15 | MIXING_PARAMETER: 1.00000000000000
16 | TOL_SCF: 0.00100000000000
17 | RELAX_FLAG: 0
18 | CALC_STRESS: 1
19 | PRINT_ATOMS: 1
20 | PRINT_FORCES: 1
21 |
--------------------------------------------------------------------------------
/tests/outputs/Al_socket_volchange.sparc/single-points/sp_image05/SPARC.ion:
--------------------------------------------------------------------------------
1 | # Ion File Generated by SPARC ASE Calculator
2 | #
3 | # ASE-SORT:
4 | # 0 1 2 3
5 | # END ASE-SORT
6 |
7 | ATOM_TYPE: Al
8 | N_TYPE_ATOM: 4
9 | PSEUDO_POT: 13_Al_3_1.9_1.9_pbe_n_v1.0.psp8
10 | COORD:
11 | 0.08337991094040 -0.06252539702939 0.45934918180202
12 | -0.04763850834288 3.84740866294769 4.12574099587526
13 | 3.65487538182834 -0.11180312494937 3.86214727653533
14 | 3.76435901708534 3.60129555981306 -0.03871604946277
15 |
16 |
--------------------------------------------------------------------------------
/tests/outputs/Al_socket_volchange.sparc/single-points/sp_image05/SPARC.static:
--------------------------------------------------------------------------------
1 | ***************************************************************************
2 | Atom positions
3 | ***************************************************************************
4 | Fractional coordinates of Al:
5 | 0.0108945058 0.9918303666 0.0600190417
6 | 0.9937755030 0.5027064158 0.5390736078
7 | 0.4775498172 0.9853916875 0.5046321784
8 | 0.4918550628 0.4705490219 0.9949413207
9 | Total free energy (Ha): -9.044014572035739E+00
10 | Atomic forces (Ha/Bohr):
11 | -6.4383507156E-03 -1.7503934315E-03 -3.5140925546E-03
12 | -2.2271019282E-03 -5.5990101886E-03 4.4954429082E-04
13 | 5.9977955350E-03 1.9666995689E-03 2.2135453683E-03
14 | 2.6676571088E-03 5.3827040511E-03 8.5100289551E-04
15 | Stress (GPa):
16 | -1.3874286734E+01 -2.0542245214E-01 -6.5598722945E-01
17 | -2.0542245214E-01 1.0199279100E+01 -9.1615449397E-02
18 | -6.5598722945E-01 -9.1615449397E-02 -2.9918239595E+01
19 |
--------------------------------------------------------------------------------
/tests/outputs/Al_socket_volchange.sparc/single-points/sp_image06/SPARC.inpt:
--------------------------------------------------------------------------------
1 | # Input File Generated By SPARC ASE Calculator
2 |
3 | LATVEC:
4 | 7.57685690154316 0.00000000000000 0.00000000000000
5 | 0.00000000000000 7.57685690154316 0.00000000000000
6 | 0.00000000000000 0.00000000000000 7.57685690154316
7 | LATVEC_SCALE: 1.00000000000000 1.00000000000000 1.00000000000000
8 | BC: P P P
9 | EXCHANGE_CORRELATION: GGA_PBE
10 | FD_GRID: 15 15 15
11 | KPOINT_GRID: 1 1 1
12 | PRECOND_KERKER_THRESH: 0.00000000000000
13 | ELEC_TEMP_TYPE: Fermi-Dirac
14 | ELEC_TEMP: 300.00000000000000
15 | MIXING_PARAMETER: 1.00000000000000
16 | TOL_SCF: 0.00100000000000
17 | RELAX_FLAG: 0
18 | CALC_STRESS: 1
19 | PRINT_ATOMS: 1
20 | PRINT_FORCES: 1
21 |
--------------------------------------------------------------------------------
/tests/outputs/Al_socket_volchange.sparc/single-points/sp_image06/SPARC.ion:
--------------------------------------------------------------------------------
1 | # Ion File Generated by SPARC ASE Calculator
2 | #
3 | # ASE-SORT:
4 | # 0 1 2 3
5 | # END ASE-SORT
6 |
7 | ATOM_TYPE: Al
8 | N_TYPE_ATOM: 4
9 | PSEUDO_POT: 13_Al_3_1.9_1.9_pbe_n_v1.0.psp8
10 | COORD:
11 | -0.05832938958648 0.13638415826853 0.04075054176378
12 | -0.16820468848862 3.32319434847749 3.95928218142642
13 | 3.99928278584834 -0.28326093157844 4.09511175831219
14 | 3.70800271465139 4.28069601250493 0.11259064365630
15 |
16 |
--------------------------------------------------------------------------------
/tests/outputs/Al_socket_volchange.sparc/single-points/sp_image06/SPARC.static:
--------------------------------------------------------------------------------
1 | ***************************************************************************
2 | Atom positions
3 | ***************************************************************************
4 | Fractional coordinates of Al:
5 | 0.9923016377 0.0180000969 0.0053782911
6 | 0.9778002026 0.4385980086 0.5225494203
7 | 0.5278287340 0.9626149820 0.5404763230
8 | 0.4893853431 0.5649698903 0.0148598086
9 | Total free energy (Ha): -9.035924426688817E+00
10 | Atomic forces (Ha/Bohr):
11 | 5.5845432699E-03 2.7105682219E-03 1.0197450819E-02
12 | 8.5972146543E-03 5.2504361549E-03 -3.2509737736E-03
13 | -1.5552104596E-02 1.5480318661E-03 -1.3859174812E-02
14 | 1.3703466717E-03 -9.5090362429E-03 6.9126977664E-03
15 | Stress (GPa):
16 | 1.7759555830E+01 -4.6546546866E-01 -6.3891690648E-01
17 | -4.6546546866E-01 -4.4874740031E+01 1.8066076363E+00
18 | -6.3891690648E-01 1.8066076363E+00 -2.5353486003E+01
19 |
--------------------------------------------------------------------------------
/tests/outputs/Al_socket_volchange.sparc/single-points/sp_image07/SPARC.inpt:
--------------------------------------------------------------------------------
1 | # Input File Generated By SPARC ASE Calculator
2 |
3 | LATVEC:
4 | 7.50032299344677 0.00000000000000 0.00000000000000
5 | 0.00000000000000 7.50032299344677 0.00000000000000
6 | 0.00000000000000 0.00000000000000 7.50032299344677
7 | LATVEC_SCALE: 1.00000000000000 1.00000000000000 1.00000000000000
8 | BC: P P P
9 | EXCHANGE_CORRELATION: GGA_PBE
10 | FD_GRID: 15 15 15
11 | KPOINT_GRID: 1 1 1
12 | PRECOND_KERKER_THRESH: 0.00000000000000
13 | ELEC_TEMP_TYPE: Fermi-Dirac
14 | ELEC_TEMP: 300.00000000000000
15 | MIXING_PARAMETER: 1.00000000000000
16 | TOL_SCF: 0.00100000000000
17 | RELAX_FLAG: 0
18 | CALC_STRESS: 1
19 | PRINT_ATOMS: 1
20 | PRINT_FORCES: 1
21 |
--------------------------------------------------------------------------------
/tests/outputs/Al_socket_volchange.sparc/single-points/sp_image07/SPARC.ion:
--------------------------------------------------------------------------------
1 | # Ion File Generated by SPARC ASE Calculator
2 | #
3 | # ASE-SORT:
4 | # 0 1 2 3
5 | # END ASE-SORT
6 |
7 | ATOM_TYPE: Al
8 | N_TYPE_ATOM: 4
9 | PSEUDO_POT: 13_Al_3_1.9_1.9_pbe_n_v1.0.psp8
10 | COORD:
11 | 0.31307379770930 -0.08628841416725 0.00607806983425
12 | 0.07546922833488 3.60405834779348 3.75054402669773
13 | 3.74999660335244 -0.32496293980352 3.93862479892939
14 | 3.86136971466121 3.63433632847127 -0.03176956464030
15 |
16 |
--------------------------------------------------------------------------------
/tests/outputs/Al_socket_volchange.sparc/single-points/sp_image07/SPARC.static:
--------------------------------------------------------------------------------
1 | ***************************************************************************
2 | Atom positions
3 | ***************************************************************************
4 | Fractional coordinates of Al:
5 | 0.0417413754 0.9884953736 0.0008103744
6 | 0.0100621304 0.4805204190 0.5000510018
7 | 0.4999780152 0.9566734739 0.5251273582
8 | 0.5148271238 0.4845573093 0.9957642405
9 | Total free energy (Ha): -9.034213680048802E+00
10 | Atomic forces (Ha/Bohr):
11 | -1.0180268410E-02 -1.3545411899E-03 3.7172707548E-03
12 | -8.8847081615E-04 -2.3416680362E-03 -4.5091589004E-04
13 | 7.7536505809E-03 7.7803685287E-03 -8.4374529685E-03
14 | 3.3150886455E-03 -4.0841593026E-03 5.1710981038E-03
15 | Stress (GPa):
16 | -1.7027746650E+01 -2.2828391408E-01 5.4052045902E-01
17 | -2.2828391408E-01 -1.5863178018E+01 5.1374020884E-01
18 | 5.4052045902E-01 5.1374020884E-01 -1.6615330738E+01
19 |
--------------------------------------------------------------------------------
/tests/outputs/Al_socket_volchange.sparc/single-points/sp_image08/SPARC.inpt:
--------------------------------------------------------------------------------
1 | # Input File Generated By SPARC ASE Calculator
2 |
3 | LATVEC:
4 | 7.42378908535037 0.00000000000000 0.00000000000000
5 | 0.00000000000000 7.42378908535037 0.00000000000000
6 | 0.00000000000000 0.00000000000000 7.42378908535037
7 | LATVEC_SCALE: 1.00000000000000 1.00000000000000 1.00000000000000
8 | BC: P P P
9 | EXCHANGE_CORRELATION: GGA_PBE
10 | FD_GRID: 15 15 15
11 | KPOINT_GRID: 1 1 1
12 | PRECOND_KERKER_THRESH: 0.00000000000000
13 | ELEC_TEMP_TYPE: Fermi-Dirac
14 | ELEC_TEMP: 300.00000000000000
15 | MIXING_PARAMETER: 1.00000000000000
16 | TOL_SCF: 0.00100000000000
17 | RELAX_FLAG: 0
18 | CALC_STRESS: 1
19 | PRINT_ATOMS: 1
20 | PRINT_FORCES: 1
21 |
--------------------------------------------------------------------------------
/tests/outputs/Al_socket_volchange.sparc/single-points/sp_image08/SPARC.ion:
--------------------------------------------------------------------------------
1 | # Ion File Generated by SPARC ASE Calculator
2 | #
3 | # ASE-SORT:
4 | # 0 1 2 3
5 | # END ASE-SORT
6 |
7 | ATOM_TYPE: Al
8 | N_TYPE_ATOM: 4
9 | PSEUDO_POT: 13_Al_3_1.9_1.9_pbe_n_v1.0.psp8
10 | COORD:
11 | 0.01671813777221 0.20003587269869 -0.35688634394130
12 | -0.25412263026917 3.29093975049837 4.15362544634555
13 | 4.02861284612154 0.40410273785996 3.85758917856974
14 | 3.89087588287684 3.49496828243622 0.35127603099891
15 |
16 |
--------------------------------------------------------------------------------
/tests/outputs/Al_socket_volchange.sparc/single-points/sp_image08/SPARC.static:
--------------------------------------------------------------------------------
1 | ***************************************************************************
2 | Atom positions
3 | ***************************************************************************
4 | Fractional coordinates of Al:
5 | 0.0022519683 0.0269452527 0.9519266590
6 | 0.9657691474 0.4432965043 0.5595020816
7 | 0.5426626214 0.0544334885 0.5196253738
8 | 0.5241091629 0.4707795766 0.0473176200
9 | Total free energy (Ha): -8.984190762502326E+00
10 | Atomic forces (Ha/Bohr):
11 | 1.3917785591E-02 -4.4169443843E-02 3.8341549666E-02
12 | 4.3295731608E-02 6.6870036035E-02 -2.6412225841E-02
13 | -4.4462499659E-02 -4.9668713085E-02 -9.5925769433E-03
14 | -1.2751017540E-02 2.6968120893E-02 -2.3367468818E-03
15 | Stress (GPa):
16 | 3.7152930067E+00 -5.3592154346E+00 -1.9862739090E+00
17 | -5.3592154346E+00 -4.5853884151E+01 7.4079969226E+00
18 | -1.9862739090E+00 7.4079969226E+00 -4.9712135261E+01
19 |
--------------------------------------------------------------------------------
/tests/outputs/Al_socket_volchange.sparc/single-points/sp_image09/SPARC.inpt:
--------------------------------------------------------------------------------
1 | # Input File Generated By SPARC ASE Calculator
2 |
3 | LATVEC:
4 | 7.34725517725398 0.00000000000000 0.00000000000000
5 | 0.00000000000000 7.34725517725398 0.00000000000000
6 | 0.00000000000000 0.00000000000000 7.34725517725398
7 | LATVEC_SCALE: 1.00000000000000 1.00000000000000 1.00000000000000
8 | BC: P P P
9 | EXCHANGE_CORRELATION: GGA_PBE
10 | FD_GRID: 14 14 14
11 | KPOINT_GRID: 1 1 1
12 | PRECOND_KERKER_THRESH: 0.00000000000000
13 | ELEC_TEMP_TYPE: Fermi-Dirac
14 | ELEC_TEMP: 300.00000000000000
15 | MIXING_PARAMETER: 1.00000000000000
16 | TOL_SCF: 0.00100000000000
17 | RELAX_FLAG: 0
18 | CALC_STRESS: 1
19 | PRINT_ATOMS: 1
20 | PRINT_FORCES: 1
21 |
--------------------------------------------------------------------------------
/tests/outputs/Al_socket_volchange.sparc/single-points/sp_image09/SPARC.ion:
--------------------------------------------------------------------------------
1 | # Ion File Generated by SPARC ASE Calculator
2 | #
3 | # ASE-SORT:
4 | # 0 1 2 3
5 | # END ASE-SORT
6 |
7 | ATOM_TYPE: Al
8 | N_TYPE_ATOM: 4
9 | PSEUDO_POT: 13_Al_3_1.9_1.9_pbe_n_v1.0.psp8
10 | COORD:
11 | 0.00020110702095 -0.05252726325535 -0.20246972650244
12 | -0.00233710867155 3.60498763241032 3.58634303835891
13 | 3.39836291309574 -0.08905090630618 3.62996483241790
14 | 3.55608103722695 3.78898694742978 0.31568113284656
15 |
16 |
--------------------------------------------------------------------------------
/tests/outputs/Al_socket_volchange.sparc/single-points/sp_image09/SPARC.static:
--------------------------------------------------------------------------------
1 | ***************************************************************************
2 | Atom positions
3 | ***************************************************************************
4 | Fractional coordinates of Al:
5 | 0.0000273717 0.9928507637 0.9724428073
6 | 0.9996819072 0.4906577416 0.4881201145
7 | 0.4625350326 0.9878797042 0.4940572697
8 | 0.4840012973 0.5157010143 0.0429658594
9 | Total free energy (Ha): -9.012237977721181E+00
10 | Atomic forces (Ha/Bohr):
11 | -1.0381291894E-02 4.3429562926E-03 5.0100029696E-03
12 | -1.1850630022E-02 4.5099581043E-04 6.7121333898E-03
13 | 1.5313668564E-02 7.5517479856E-03 5.0398871647E-03
14 | 6.9182533525E-03 -1.2345700089E-02 -1.6762023524E-02
15 | Stress (GPa):
16 | -1.4265348869E+01 2.2353336466E-01 1.1804155850E+00
17 | 2.2353336466E-01 -1.5050365360E+01 -9.7665280730E-01
18 | 1.1804155850E+00 -9.7665280730E-01 -4.6322393542E+01
19 |
--------------------------------------------------------------------------------
/tests/outputs/Al_socket_volchange.sparc/sparc.log:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SPARC-X/SPARC-X-API/12422228c142965d7decf5b64db57d07e98a6a8c/tests/outputs/Al_socket_volchange.sparc/sparc.log
--------------------------------------------------------------------------------
/tests/outputs/Alloy_geopt_ppd_bc.sparc/SPARC.geopt:
--------------------------------------------------------------------------------
1 | :RELAXSTEP: 1
2 | :CELL: 1.4934716981E+01 1.2194150943E+01 4.3212600000E+01
3 | :VOLUME: 7.8697142088E+03
4 | :LATVEC:
5 | 1.5830800000E+01 0.0000000000E+00 0.0000000000E+00
6 | 0.0000000000E+00 1.2925800000E+01 0.0000000000E+00
7 | 0.0000000000E+00 0.0000000000E+00 4.3212600000E+01
8 | :STRESS:
9 | -3.5037591424E-02 -1.1032579647E-04
10 | -1.1032579647E-04 -2.1767437682E-02
11 | :RELAXSTEP: 2
12 | :CELL: 1.6780648000E+01 1.3701348000E+01 4.3212600000E+01
13 | :VOLUME: 9.9353328703E+03
14 | :LATVEC:
15 | 1.5830800000E+01 0.0000000000E+00 0.0000000000E+00
16 | 0.0000000000E+00 1.2925800000E+01 0.0000000000E+00
17 | 0.0000000000E+00 0.0000000000E+00 4.3212600000E+01
18 | :STRESS:
19 | 6.9350778815E-03 -2.3878906427E-04
20 | -2.3878906427E-04 1.1825868115E-02
21 | :RELAXSTEP: 3
22 | :CELL: 1.6341823477E+01 1.3343049113E+01 4.3212600000E+01
23 | :VOLUME: 9.4224967678E+03
24 | :LATVEC:
25 | 1.5830800000E+01 0.0000000000E+00 0.0000000000E+00
26 | 0.0000000000E+00 1.2925800000E+01 0.0000000000E+00
27 | 0.0000000000E+00 0.0000000000E+00 4.3212600000E+01
28 | :STRESS:
29 | 2.3038837271E-03 -2.3552520596E-04
30 | -2.3552520596E-04 8.2044246296E-03
31 | :RELAXSTEP: 4
32 | :CELL: 1.5856755490E+01 1.2946992579E+01 4.3212600000E+01
33 | :VOLUME: 8.8714299185E+03
34 | :LATVEC:
35 | 1.5830800000E+01 0.0000000000E+00 0.0000000000E+00
36 | 0.0000000000E+00 1.2925800000E+01 0.0000000000E+00
37 | 0.0000000000E+00 0.0000000000E+00 4.3212600000E+01
38 | :STRESS:
39 | -5.8391744555E-03 -1.9199532298E-04
40 | -1.9199532298E-04 1.6852012741E-03
41 | :RELAXSTEP: 5
42 | :CELL: 1.5995673610E+01 1.3060418800E+01 4.3212600000E+01
43 | :VOLUME: 9.0275527502E+03
44 | :LATVEC:
45 | 1.5830800000E+01 0.0000000000E+00 0.0000000000E+00
46 | 0.0000000000E+00 1.2925800000E+01 0.0000000000E+00
47 | 0.0000000000E+00 0.0000000000E+00 4.3212600000E+01
48 | :STRESS:
49 | -3.0766423916E-03 -2.0678413497E-04
50 | -2.0678413497E-04 3.8969679010E-03
51 | :RELAXSTEP: 6
52 | :CELL: 1.5972847428E+01 1.3041781293E+01 4.3212600000E+01
53 | :VOLUME: 9.0018060974E+03
54 | :LATVEC:
55 | 1.5830800000E+01 0.0000000000E+00 0.0000000000E+00
56 | 0.0000000000E+00 1.2925800000E+01 0.0000000000E+00
57 | 0.0000000000E+00 0.0000000000E+00 4.3212600000E+01
58 | :STRESS:
59 | -3.5463716456E-03 -2.1944699830E-04
60 | -2.1944699830E-04 3.5360081998E-03
61 | :RELAXSTEP: 7
62 | :CELL: 1.5973132402E+01 1.3042013973E+01 4.3212600000E+01
63 | :VOLUME: 9.0021273055E+03
64 | :LATVEC:
65 | 1.5830800000E+01 0.0000000000E+00 0.0000000000E+00
66 | 0.0000000000E+00 1.2925800000E+01 0.0000000000E+00
67 | 0.0000000000E+00 0.0000000000E+00 4.3212600000E+01
68 | :STRESS:
69 | -3.5276721460E-03 -2.1266090360E-04
70 | -2.1266090360E-04 3.5218752746E-03
71 |
--------------------------------------------------------------------------------
/tests/outputs/Alloy_geopt_ppd_bc.sparc/SPARC.inpt:
--------------------------------------------------------------------------------
1 | # Input File Generated By SPARC ASE Calculator
2 |
3 | LATVEC:
4 | 15.8308 0 0
5 | 0 12.9258 0
6 | 0 0 43.2126
7 | LATVEC_SCALE: 1 1 1
8 | KPOINT_GRID: 1 1 1
9 | MESH_SPACING: 0.3
10 | BC: P P D
11 | EXCHANGE_CORRELATION: GGA_PBE
12 | D3_FLAG: 1
13 | TOL_SCF: 0.0001
14 | CALC_STRESS: 0
15 | MAXIT_SCF: 150
16 | RESTART_FLAG: 0
17 | MD_FLAG: 0
18 | SPIN_TYP: 0
19 | RELAX_FLAG: 2
20 | TOL_RELAX_CELL: 0.01
21 | ELEC_TEMP: 500
22 |
--------------------------------------------------------------------------------
/tests/outputs/Alloy_geopt_ppd_bc.sparc/SPARC.ion:
--------------------------------------------------------------------------------
1 | # Ion File Generated by SPARC ASE Calculator
2 | #
3 | # ASE-SORT:
4 | # 6 7 32 30 26 17 16 9 28 33 3 4 10 11 5 24 18 25 2 1 27 13 0 29 23 35 12 31 22 21
5 | # 20 8 19 34 14 15
6 | # END ASE-SORT
7 |
8 | ATOM_TYPE: Ag
9 | N_TYPE_ATOM: 6
10 | PSEUDO_POT: Ag.pot
11 | COORD:
12 | 6.62298 10.8319 23.9625
13 | 9.24421 6.47877 22.5729
14 | 4.02062 6.55283 22.4382
15 | 6.59615 6.46288 17.798
16 | 11.8731 6.46288 17.798
17 | 14.5115 10.7715 19.3213
18 | RELAX:
19 | 1 1 1
20 | 1 1 1
21 | 1 1 1
22 | 0 0 0
23 | 0 0 0
24 | 0 0 0
25 |
26 | ATOM_TYPE: Au
27 | N_TYPE_ATOM: 6
28 | PSEUDO_POT: Au.pot
29 | COORD:
30 | 3.95769 6.46288 13.2281
31 | 9.23461 6.46288 13.2281
32 | 9.2714 10.5307 28.6615
33 | 9.23461 2.15429 16.2747
34 | 3.95769 10.7715 19.3213
35 | 9.23461 10.7715 19.3213
36 | RELAX:
37 | 0 0 0
38 | 0 0 0
39 | 1 1 1
40 | 0 0 0
41 | 0 0 0
42 | 0 0 0
43 |
44 | ATOM_TYPE: Ir
45 | N_TYPE_ATOM: 6
46 | PSEUDO_POT: Ir.pot
47 | COORD:
48 | 14.4226 2.05199 25.1452
49 | 1.22066 10.8112 23.9916
50 | 6.74081 1.97517 29.0663
51 | 11.8827 1.92864 29.2973
52 | 3.95769 2.15429 16.2747
53 | 11.8731 10.7715 14.7514
54 | RELAX:
55 | 1 1 1
56 | 1 1 1
57 | 1 1 1
58 | 1 1 1
59 | 0 0 0
60 | 0 0 0
61 |
62 | ATOM_TYPE: Pd
63 | N_TYPE_ATOM: 6
64 | PSEUDO_POT: Pd.pot
65 | COORD:
66 | 6.59615 2.15429 20.8447
67 | 14.6108 10.7083 28.307
68 | 3.87347 10.8007 28.3182
69 | 11.9389 6.37768 27.1754
70 | 6.49618 6.45233 27.3903
71 | 3.87485 2.21716 25.1879
72 | RELAX:
73 | 0 0 0
74 | 1 1 1
75 | 1 1 1
76 | 1 1 1
77 | 1 1 1
78 | 1 1 1
79 |
80 | ATOM_TYPE: Pt
81 | N_TYPE_ATOM: 6
82 | PSEUDO_POT: Pt.pot
83 | COORD:
84 | 1.31923 2.15429 20.8447
85 | 11.8731 2.15429 20.8447
86 | 6.59615 10.7715 14.7514
87 | 14.6105 6.40821 22.4748
88 | 14.5115 2.15429 16.2747
89 | 11.9304 10.7623 23.7826
90 | RELAX:
91 | 0 0 0
92 | 0 0 0
93 | 0 0 0
94 | 1 1 1
95 | 0 0 0
96 | 1 1 1
97 |
98 | ATOM_TYPE: Rh
99 | N_TYPE_ATOM: 6
100 | PSEUDO_POT: Rh.pot
101 | COORD:
102 | 1.31923 10.7715 14.7514
103 | 1.30085 6.43695 26.8384
104 | 14.5115 6.46288 13.2281
105 | 1.31923 6.46288 17.798
106 | 1.22472 2.09656 29.1675
107 | 9.52773 2.07456 25.2209
108 | RELAX:
109 | 0 0 0
110 | 1 1 1
111 | 0 0 0
112 | 0 0 0
113 | 1 1 1
114 | 1 1 1
115 |
116 |
--------------------------------------------------------------------------------
/tests/outputs/Cu_FCC.sparc/Cu_FCC.inpt:
--------------------------------------------------------------------------------
1 |
2 | LATVEC_SCALE: 5.416914 5.416914 5.416914
3 | LATVEC:
4 | 1.00 0.00 0.00
5 | 0.00 1.00 0.00
6 | 0.00 0.00 1.00
7 | BC: P P P
8 |
9 |
10 | EXCHANGE_CORRELATION: GGA_PBE
11 |
12 |
13 | ELEC_TEMP_TYPE: Fermi-Dirac
14 | ELEC_TEMP: 300
15 |
16 |
17 | MESH_SPACING: 0.22
18 |
19 | KPOINT_GRID: 1 1 1
20 |
21 |
22 |
23 | PRECOND_KERKER_THRESH: 0.0
24 | MIXING_PARAMETER: 1.0
25 | TOL_SCF: 1e-4
26 |
27 |
28 |
29 | CALC_STRESS: 0
30 | PRINT_ATOMS: 1
31 | PRINT_VELS: 0
32 | PRINT_FORCES: 0
33 | PRINT_EIGEN: 0
34 | PRINT_DENSITY: 0
35 |
--------------------------------------------------------------------------------
/tests/outputs/Cu_FCC.sparc/Cu_FCC.ion:
--------------------------------------------------------------------------------
1 | #=========================
2 | # format of ion file
3 | #=========================
4 | # ATOM_TYPE:
5 | # N_TYPE_ATOM:
6 | # COORD:
7 | #
8 | # ...
9 | # RELAX:
10 | #
11 | # ...
12 | # ASE-SORT:
13 | # 3 2
14 | # 1 0
15 | # END ASE-SORT
16 |
17 | ATOM_TYPE: Cu # atom type
18 | ATOMIC_MASS: 63.546 # atomic mass (amu)
19 | PSEUDO_POT: ../../../psps/29_Cu_19_1.7_1.9_pbe_n_v1.0.psp8 # pseudopotential file
20 | N_TYPE_ATOM: 4 # number of atoms of this type
21 | # COORD: # Cartesian coordinates (au)
22 | COORD_FRAC: # fractional coordinates (in lattice vector basis)
23 | 0.0 0.0 0.0
24 | 0.0 0.5 0.5
25 | 0.5 0.0 0.5
26 | 0.5 0.5 0.0
27 | RELAX:
28 | 0 0 0
29 | 1 1 1
30 | 1 1 1
31 | 1 1 1
--------------------------------------------------------------------------------
/tests/outputs/Cu_FCC.sparc/Cu_FCC.static:
--------------------------------------------------------------------------------
1 | ***************************************************************************
2 | Atom positions
3 | ***************************************************************************
4 | Fractional coordinates of Cu:
5 | 0.0000000000 0.0000000000 0.0000000000
6 | 0.0000000000 0.5000000000 0.5000000000
7 | 0.5000000000 0.0000000000 0.5000000000
8 | 0.5000000000 0.5000000000 0.0000000000
9 | Total free energy (Ha): -7.287745795466985E+02
10 |
--------------------------------------------------------------------------------
/tests/outputs/Fe2_spin_scan_gamma.sparc/Fe2_spin_scan_gamma.inpt:
--------------------------------------------------------------------------------
1 | # nprocs: 24
2 |
3 | SPIN_TYP: 1
4 | LATVEC:
5 | 1.00 0.10 0.00
6 | 0.10 1.00 0.00
7 | 0.00 0.00 1.00
8 | LATVEC_SCALE: 2.840052 2.840052 2.840052
9 |
10 | MESH_SPACING: 0.10
11 | FD_ORDER: 12
12 | BC: P P P
13 | EXCHANGE_CORRELATION: SCAN
14 | ELEC_TEMP_TYPE: fermi-dirac
15 | ELEC_TEMP: 315.775131
16 | TOL_SCF: 1e-5
17 | TOL_POISSON: 1e-8
18 | TOL_PSEUDOCHARGE: 1e-8
19 | # NSTATES: 10
20 | KPOINT_GRID: 1 1 1
21 | # KPOINT_SHIFT: 0 0 0.5
22 | MIXING_VARIABLE: potential
23 | MIXING_PRECOND: kerker
24 | PRINT_FORCES: 1
25 | PRINT_ATOMS: 1
26 | CALC_STRESS: 1
27 |
--------------------------------------------------------------------------------
/tests/outputs/Fe2_spin_scan_gamma.sparc/Fe2_spin_scan_gamma.ion:
--------------------------------------------------------------------------------
1 | #=========================
2 | # format of ion file
3 | #=========================
4 | # ATOM_TYPE:
5 | # N_TYPE_ATOM:
6 | # COORD:
7 | #
8 | # ...
9 | # RELAX:
10 | #
11 | # ...
12 |
13 |
14 | # Reminder: when changing number of atoms, change the RELAX flags accordingly
15 | # as well.
16 |
17 | ATOM_TYPE: Fe # atom type followed with valence charge
18 | N_TYPE_ATOM: 2 # number of atoms of this type
19 | PSEUDO_POT: ../Fe_LDA.psp8
20 | #ATOMIC_MASS:
21 | COORD_FRAC: # coordinates follows
22 | 0.000000 0.000000 0.000000
23 | 0.520000 0.510000 0.490000
24 | SPIN:
25 | 1.0
26 | 1.0
27 |
--------------------------------------------------------------------------------
/tests/outputs/Fe2_spin_scan_gamma.sparc/Fe2_spin_scan_gamma.static:
--------------------------------------------------------------------------------
1 | ***************************************************************************
2 | Atom positions
3 | ***************************************************************************
4 | Fractional coordinates of Fe:
5 | 0.0000000000 0.0000000000 0.0000000000
6 | 0.5200000000 0.5100000000 0.4900000000
7 | Total free energy (Ha): -2.283157353113279E+02
8 | Atomic forces (Ha/Bohr):
9 | 8.0738249305E-01 3.7399117306E-01 -3.5796157735E-01
10 | -8.0738249305E-01 -3.7399117306E-01 3.5796157735E-01
11 | Stress (GPa):
12 | -2.1918863425E+04 1.3932450782E+03 -5.1023512490E+01
13 | 1.3932450782E+03 -2.1975897437E+04 -1.2676410947E+02
14 | -5.1023512490E+01 -1.2676410947E+02 -2.2380745784E+04
15 |
--------------------------------------------------------------------------------
/tests/outputs/H2O_sheet_yz.sparc/H2O_sheet.inpt:
--------------------------------------------------------------------------------
1 | # nprocs: 1
2 | # Test: H2O sheet in x,y plane #
3 | LATVEC_SCALE: 24 5.67 5.67
4 | LATVEC:
5 | 1 0 0
6 | 0 1 0
7 | 0 0 1
8 | MESH_SPACING: 0.2
9 | FD_ORDER: 12
10 | BC: D P P
11 | EXCHANGE_CORRELATION: GGA_PBE
12 | ELEC_TEMP_TYPE: fd
13 | SMEARING: 0.003674932
14 | TOL_SCF: 1e-6
15 | MIXING_VARIABLE: potential
16 | MIXING_PRECOND: none
17 | NSTATES: 8
18 | PRINT_FORCES: 1
19 | PRINT_ATOMS: 1
20 |
21 | CALC_STRESS: 1
22 |
--------------------------------------------------------------------------------
/tests/outputs/H2O_sheet_yz.sparc/H2O_sheet.ion:
--------------------------------------------------------------------------------
1 | #=========================
2 | # format of ion file
3 | #=========================
4 | # ATOM_TYPE:
5 | # PSEUDO_POT:
6 | # N_TYPE_ATOM:
7 | # COORD:
8 | #
9 | # ...
10 | # RELAX:
11 | #
12 | # ...
13 |
14 | # Reminder: when changing number of atoms, change the RELAX flags accordingly
15 | # as well.
16 |
17 | ATOM_TYPE: H # atom type
18 | PSEUDO_POT: ../../../psps/01_H_1_1.0_1.0_pbe_v1.0.psp8
19 | N_TYPE_ATOM: 2 # number of atoms of this type
20 | COORD: # coordinates follows
21 | 12.556010134214192 4.265111864110533 2.834589187490385
22 | 12.556010134214192 1.404066510870237 2.834589187490385
23 |
24 | ATOM_TYPE: O # atom type
25 | PSEUDO_POT: ../../../psps/08_O_6_1.2_1.4_pbe_n_v1.0.psp8
26 | N_TYPE_ATOM: 1 # number of atoms of this type
27 | COORD: # coordinates follows
28 | 11.448630624967949 2.834589187490385 2.834589187490385
29 |
30 |
--------------------------------------------------------------------------------
/tests/outputs/H2O_sheet_yz.sparc/H2O_sheet.static:
--------------------------------------------------------------------------------
1 | ***************************************************************************
2 | Atom positions
3 | ***************************************************************************
4 | Fractional coordinates of H:
5 | 0.5231670889 0.7522243147 0.4999275463
6 | 0.5231670889 0.2476307779 0.4999275463
7 | Fractional coordinates of O:
8 | 0.4770262760 0.4999275463 0.4999275463
9 | Total free energy (Ha): -1.762271099378250E+01
10 | Atomic forces (Ha/Bohr):
11 | -7.0091512819E-03 -2.8155137475E-02 4.7625587321E-08
12 | -7.0083540340E-03 2.8155728229E-02 4.1091979535E-08
13 | 1.4017505316E-02 -5.9075452258E-07 -8.8717566856E-08
14 | Stress (Ha/Bohr**2):
15 | -5.9325459799E-03 3.7871815297E-11
16 | 3.7871815297E-11 -5.4929931315E-03
17 | Stress equiv. to all periodic (GPa):
18 | -7.2725636831E+00 4.6426136346E-08
19 | 4.6426136346E-08 -6.7337265476E+00
20 |
--------------------------------------------------------------------------------
/tests/outputs/H2O_sheet_yz.sparc/output.sparc:
--------------------------------------------------------------------------------
1 | ---------------------------------------
2 | Begin PBS Prologue Wed Oct 27 17:53:39 EDT 2021
3 | Job ID: 7040483.sched-hive.pace.gatech.edu
4 | User ID: skumar416
5 | Job name: testing_suite
6 | Queue: hive-interact
7 | End PBS Prologue Wed Oct 27 17:53:39 EDT 2021
8 | ---------------------------------------
9 | /storage/hive/scratch/5/skumar416/00merge_dev_sparc_10272021/sparc_public/tests_LHQ/H2O_sheet/temp_run3
10 | ---------------------------------------
11 | Begin PBS Epilogue Wed Oct 27 17:54:05 EDT 2021
12 | Job ID: 7040483.sched-hive.pace.gatech.edu
13 | User ID: skumar416
14 | Job name: testing_suite
15 | Resources: nodes=1:ppn=1,mem=10gb,walltime=01:00:00,neednodes=1:ppn=1
16 | Rsrc Used: cput=00:00:26,vmem=0kb,walltime=00:00:26,mem=0kb,energy_used=0
17 | Queue: hive-interact
18 | Nodes:
19 | atl1-1-01-017-3-l.pace.gatech.edu
20 | End PBS Epilogue Wed Oct 27 17:54:05 EDT 2021
21 | ---------------------------------------
22 |
--------------------------------------------------------------------------------
/tests/outputs/H2O_socket_incomplete.sparc/SPARC.inpt:
--------------------------------------------------------------------------------
1 | # Input File Generated By SPARC ASE Calculator
2 |
3 | LATVEC:
4 | 22.67671351004314 0.00000000000000 0.00000000000000
5 | 0.00000000000000 25.56133886715844 0.00000000000000
6 | 0.00000000000000 0.00000000000000 23.80357420641483
7 | LATVEC_SCALE: 1.00000000000000 1.00000000000000 1.00000000000000
8 | BC: P P P
9 | EXCHANGE_CORRELATION: GGA_PBE
10 | FD_GRID: 43 49 45
11 | KPOINT_GRID: 1 1 1
12 | PRECOND_KERKER_THRESH: 0.00000000000000
13 | ELEC_TEMP_TYPE: Fermi-Dirac
14 | ELEC_TEMP: 300.00000000000000
15 | MIXING_PARAMETER: 1.00000000000000
16 | TOL_SCF: 0.00100000000000
17 | RELAX_FLAG: 1
18 | CALC_STRESS: 1
19 | PRINT_ATOMS: 1
20 | PRINT_FORCES: 1
21 |
--------------------------------------------------------------------------------
/tests/outputs/H2O_socket_incomplete.sparc/SPARC.ion:
--------------------------------------------------------------------------------
1 | # Ion File Generated by SPARC ASE Calculator
2 | #
3 | # ASE-SORT:
4 | # 2 0 1
5 | # END ASE-SORT
6 |
7 | ATOM_TYPE: H
8 | N_TYPE_ATOM: 2
9 | PSEUDO_POT: 01_H_1_1.0_1.0_pbe_v1.0.psp8
10 | COORD:
11 | 11.33835675502157 14.22298211213687 11.33835675502157
12 | 11.33835675502157 11.33835675502157 11.33835675502157
13 |
14 | ATOM_TYPE: O
15 | N_TYPE_ATOM: 1
16 | PSEUDO_POT: 08_O_6_1.2_1.4_pbe_n_v1.0.psp8
17 | COORD:
18 | 11.33835675502157 12.78066943357922 12.46521745139326
19 |
20 |
--------------------------------------------------------------------------------
/tests/outputs/H2O_socket_incomplete.sparc/SPARC.static:
--------------------------------------------------------------------------------
1 | ***************************************************************************
2 | Atom positions (socket step 1)
3 | ***************************************************************************
4 | Fractional coordinates of H:
5 | 0.5000000000 0.5000000000 0.5236699894
6 | 0.5000000000 0.5564255529 0.4763300106
7 | Fractional coordinates of O:
8 | 0.5000000000 0.4435744471 0.4763300106
9 | Lattice (Bohr):
10 | 2.2676713510E+01 0.0000000000E+00 0.0000000000E+00
11 | 0.0000000000E+00 2.5561338867E+01 0.0000000000E+00
12 | 0.0000000000E+00 0.0000000000E+00 2.3803574206E+01
13 | Total free energy (Ha): -1.809197416636433E+01
14 | Atomic forces (Ha/Bohr):
15 | -8.6777704136E-07 1.1527629608E-02 -3.5795923825E-02
16 | -6.5073941539E-07 -6.2354126553E-03 -7.6030620070E-02
17 | 1.5185164568E-06 -5.2922169523E-03 1.1182654390E-01
18 | Stress (GPa):
19 | 5.1281197310E+00 -7.1825837052E-06 -5.5671926432E-07
20 | -7.1825837052E-06 1.3873103987E+00 7.7353336700E-02
21 | -5.5671926432E-07 7.7353336700E-02 4.0607092494E+00
22 | ***************************************************************************
23 | Atom positions (socket step 2)
24 | ***************************************************************************
25 | Fractional coordinates of H:
26 | 0.4999999563 0.5005155679 0.5219508112
27 | 0.4999999672 0.5561466769 0.4726784726
28 | Fractional coordinates of O:
29 | 0.5000000766 0.4433377551 0.4817007268
30 | Lattice (Bohr):
31 | 2.2676713510E+01 0.0000000000E+00 0.0000000000E+00
32 | 0.0000000000E+00 2.5561338867E+01 0.0000000000E+00
33 | 0.0000000000E+00 0.0000000000E+00 2.3803574206E+01
34 | Total free energy (Ha): -1.802814507208867E+01
35 | Atomic forces (Ha/Bohr):
36 | 5.1674838864E-06 -9.8544275964E-03 1.7809432997E-01
37 | 3.6498044305E-06 -3.9491135111E-03 6.2624074397E-02
38 | -8.8172883169E-06 1.3803541107E-02 -2.4071840436E-01
39 | Stress (GPa):
40 | 5.5346139689E+00 -5.0783418699E-06 -2.1047346943E-05
41 | -5.0783418699E-06 1.5865756909E+00 7.2529353262E-02
42 | -2.1047346943E-05 7.2529353262E-02 2.2277236868E+00
43 | ***************************************************************************
44 | Atom positions (socket step 3)
45 | ***************************************************************************
46 | Fractional coordinates of H:
47 | 0.5000000399 0.5004259418 0.5246645375
48 | 0.5000000261 0.5560536750 0.4732744366
49 | Fractional coordinates of O:
50 | 0.4999999340 0.4435203833 0.4783910366
51 | Lattice (Bohr):
52 | 2.2676713510E+01 0.0000000000E+00 0.0000000000E+00
53 | 0.0000000000E+00 2.5561338867E+01 0.0000000000E+00
54 | 0.0000000000E+00 0.0000000000E+00 2.3803574206E+01
55 | Total free energy (Ha): -1.807552915316842E+01
56 | Atomic forces (Ha/Bohr):
57 | -2.5268751391E-06 2.2707737699E-02 7.2727514813E-02
58 | -3.6382858541E-06 -8.3257331752E-03 1.9519856383E-02
59 | 6.1651609931E-06 -1.4382004524E-02 -9.2247371196E-02
60 | Stress (GPa):
61 | 5.0251692445E+00 3.2211893630E-06 1.6859330449E-07
62 | 3.2211893630E-06 1.3920726609E+00 2.0740747762E-02
63 | 1.6859330449E-07 2.0740747762E-02 4.3580851448E+00
64 | ***************************************************************************
65 | Atom positions (socket step 4)
66 | ***************************************************************************
67 | Fractional coordinates of H:
68 | 0.4999997345 0.5023022347 0.5271021340
69 | 0.4999996579 0.5554741671 0.4732689984
70 | Fractional coordinates of O:
71 | 0.5000006076 0.4422235982 0.4759588783
72 | Lattice (Bohr):
73 | 2.2676713510E+01 0.0000000000E+00 0.0000000000E+00
74 | 0.0000000000E+00 2.5561338867E+01 0.0000000000E+00
75 | 0.0000000000E+00 0.0000000000E+00 2.3803574206E+01
76 |
--------------------------------------------------------------------------------
/tests/outputs/H2O_socket_incomplete.sparc/sparc.log:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SPARC-X/SPARC-X-API/12422228c142965d7decf5b64db57d07e98a6a8c/tests/outputs/H2O_socket_incomplete.sparc/sparc.log
--------------------------------------------------------------------------------
/tests/outputs/H2O_wire_z.sparc/H2O_wire.inpt:
--------------------------------------------------------------------------------
1 | # nprocs: 1
2 | # Test: H2O wire in z direction #
3 | LATVEC_SCALE: 14.00 14.00 6.00
4 | LATVEC:
5 | 1 0 0
6 | 0 1 0
7 | 0 0 1
8 | MESH_SPACING: 0.1
9 | FD_ORDER: 12
10 | BC: D D P
11 | #BOUNDARY_CONDITION: 4
12 | EXCHANGE_CORRELATION: GGA_PBE
13 | ELEC_TEMP_TYPE: fd
14 | SMEARING: 0.003674932
15 | TOL_SCF: 1e-6
16 |
17 | #MIXING_VARIABLE: density
18 | PRINT_FORCES: 1
19 | PRINT_ATOMS: 1
20 | CALC_STRESS: 1
21 |
22 |
--------------------------------------------------------------------------------
/tests/outputs/H2O_wire_z.sparc/H2O_wire.ion:
--------------------------------------------------------------------------------
1 | #=========================
2 | # format of ion file
3 | #=========================
4 | # ATOM_TYPE:
5 | # PSEUDO_POT:
6 | # N_TYPE_ATOM:
7 | # COORD:
8 | #
9 | # ...
10 | # RELAX:
11 | #
12 | # ...
13 |
14 | # Reminder: when changing number of atoms, change the RELAX flags accordingly
15 | # as well.
16 |
17 | ATOM_TYPE: H # atom type
18 | PSEUDO_POT: ../../../psps/01_H_1_1.0_1.0_pbe_v1.0.psp8
19 | N_TYPE_ATOM: 2 # number of atoms of this type
20 | COORD: # coordinates follows
21 | 7.369126503082081 7.000000000000000 4.430522676620148
22 | 7.369126503082081 7.000000000000000 1.569477323379852
23 |
24 | ATOM_TYPE: O # atom type
25 | PSEUDO_POT: ../../../psps/08_O_6_1.2_1.4_pbe_n_v1.0.psp8
26 | N_TYPE_ATOM: 1 # number of atoms of this type
27 | COORD: # coordinates follows
28 | 6.261746993835837 7.000000000000000 3.000000000000000
29 |
30 |
--------------------------------------------------------------------------------
/tests/outputs/H2O_wire_z.sparc/H2O_wire.static:
--------------------------------------------------------------------------------
1 | ***************************************************************************
2 | Atom positions
3 | ***************************************************************************
4 | Fractional coordinates of H:
5 | 0.5263661788 0.5000000000 0.7384204461
6 | 0.5263661788 0.5000000000 0.2615795539
7 | Fractional coordinates of O:
8 | 0.4472676424 0.5000000000 0.5000000000
9 | Total free energy (Ha): -1.768512003719815E+01
10 | Atomic forces (Ha/Bohr):
11 | -6.0667427045E-03 3.2520689190E-08 -2.2838126515E-02
12 | -6.0667226226E-03 4.7399932144E-08 2.2838125847E-02
13 | 1.2133465327E-02 -7.9920621334E-08 6.6746163366E-10
14 | Stress (Ha/Bohr):
15 | -1.9995447051E-02
16 | Stress equiv. to all periodic (GPa):
17 | -3.0014610284E+00
18 |
--------------------------------------------------------------------------------
/tests/outputs/H2O_wire_z.sparc/output.sparc:
--------------------------------------------------------------------------------
1 | ---------------------------------------
2 | Begin PBS Prologue Wed Oct 27 17:54:10 EDT 2021
3 | Job ID: 7040484.sched-hive.pace.gatech.edu
4 | User ID: skumar416
5 | Job name: testing_suite
6 | Queue: hive-interact
7 | End PBS Prologue Wed Oct 27 17:54:10 EDT 2021
8 | ---------------------------------------
9 | /storage/hive/scratch/5/skumar416/00merge_dev_sparc_10272021/sparc_public/tests_LHQ/H2O_wire/temp_run1
10 | ---------------------------------------
11 | Begin PBS Epilogue Wed Oct 27 17:55:00 EDT 2021
12 | Job ID: 7040484.sched-hive.pace.gatech.edu
13 | User ID: skumar416
14 | Job name: testing_suite
15 | Resources: nodes=1:ppn=1,mem=10gb,walltime=01:00:00,neednodes=1:ppn=1
16 | Rsrc Used: cput=00:00:50,vmem=645340kb,walltime=00:00:50,mem=98232kb,energy_used=0
17 | Queue: hive-interact
18 | Nodes:
19 | atl1-1-01-017-3-l.pace.gatech.edu
20 | End PBS Epilogue Wed Oct 27 17:55:00 EDT 2021
21 | ---------------------------------------
22 |
--------------------------------------------------------------------------------
/tests/outputs/MoO3_hubbard.sparc/MoO3_hubbard.inpt:
--------------------------------------------------------------------------------
1 | # nprocs: 1
2 | # Test: MoO3 #
3 | LATVEC:
4 | 6.954192 0 0
5 | 0 7.407726 0
6 | 0 0 26.890803
7 | LATVEC_SCALE: 1 1 1
8 | MESH_SPACING: 0.2
9 | KPOINT_GRID: 1 1 1
10 | BC: P P P
11 | EXCHANGE_CORRELATION: GGA_PBE
12 | HUBBARD_FLAG: 1
13 | TOL_SCF: 1e-6
14 | PRINT_FORCES: 1
15 | PRINT_ATOMS: 1
16 | CALC_STRESS: 1
--------------------------------------------------------------------------------
/tests/outputs/MoO3_hubbard.sparc/MoO3_hubbard.ion:
--------------------------------------------------------------------------------
1 |
2 | #=========================
3 | # format of ion file
4 | #=========================
5 | # ATOM_TYPE:
6 | # PSEUDO_POT:
7 | # N_TYPE_ATOM:
8 | # COORD:
9 | #
10 | # ...
11 | # RELAX:
12 | #
13 | # ...
14 |
15 | # Reminder: when changing number of atoms, change the RELAX flags accordingly
16 | # as well.
17 |
18 | ATOM_TYPE: Mo # atom type
19 | PSEUDO_POT: ../../../psps/42_Mo_14_2.0_2.6_pbe_n_v1.0.psp8
20 | N_TYPE_ATOM: 1 # number of atoms of this type
21 | COORD_FRAC: # coordinates follows
22 | 0.25 0.42301 0.602057
23 |
24 |
25 | ATOM_TYPE: O # atom type
26 | PSEUDO_POT: ../../../psps/08_O_6_1.2_1.4_pbe_n_v1.0.psp8
27 | N_TYPE_ATOM: 3 # number of atoms of this type
28 | COORD_FRAC: # coordinates follows
29 | 0.25 0.466327 0.718344
30 | 0.25 0.498536 0.435585
31 | 0.25 0.982682 0.587091
32 |
33 | HUBBARD:
34 | U_ATOM_TYPE: Mo
35 | U_VAL: 0 0 0.05 0 # U values in hartrees for s p d f orbitals (valence only)
36 |
--------------------------------------------------------------------------------
/tests/outputs/MoO3_hubbard.sparc/MoO3_hubbard.static:
--------------------------------------------------------------------------------
1 | ***************************************************************************
2 | Atom positions
3 | ***************************************************************************
4 | Fractional coordinates of Mo:
5 | 0.2500000000 0.4230100000 0.6020570000
6 | Fractional coordinates of O:
7 | 0.2500000000 0.4663270000 0.7183440000
8 | 0.2500000000 0.4985360000 0.4355850000
9 | 0.2500000000 0.9826820000 0.5870910000
10 | Total free energy (Ha): -1.193017119895254E+02
11 | Atomic forces (Ha/Bohr):
12 | -3.0115166041E-05 -1.0388563139E-01 6.4656600822E-02
13 | 6.5627841409E-06 1.6887899866E-02 -1.8666310086E-02
14 | 4.0006244503E-05 4.7528526782E-03 3.8420463088E-02
15 | -1.6453862604E-05 8.2244878848E-02 -8.4410753824E-02
16 | Stress (GPa):
17 | 5.8170874325E-01 4.8668100165E-04 -7.7274428237E-04
18 | 4.8668100165E-04 -7.5937303823E+00 3.1138748238E-02
19 | -7.7274428237E-04 3.1138748238E-02 4.1635623448E+00
20 |
--------------------------------------------------------------------------------
/tests/outputs/NH3_sort_lbfgs_opt.sparc/SPARC.inpt:
--------------------------------------------------------------------------------
1 | # Input File Generated By SPARC ASE Calculator
2 |
3 | LATVEC:
4 | 11.3384 0 0
5 | 0 11.3384 0
6 | 0 0 11.3384
7 | LATVEC_SCALE: 1 1 1
8 | EXCHANGE_CORRELATION: GGA_PBE
9 | FD_GRID: 24 24 24
10 | KPOINT_GRID: 1 1 1
11 | TOL_RELAX: 0.000388938
12 | RELAX_FLAG: 1
13 | PRINT_RELAXOUT: 1
14 | RELAX_METHOD: LBFGS
15 |
--------------------------------------------------------------------------------
/tests/outputs/NH3_sort_lbfgs_opt.sparc/SPARC.ion:
--------------------------------------------------------------------------------
1 | # Ion File Generated by SPARC ASE Calculator
2 | # This example is a real calculation by sparc-dft-api interface
3 | # Things to test are the sorting / constraints / result parsing
4 | #
5 | # ASE-SORT:
6 | # 3 0 1 2
7 | # END ASE-SORT
8 |
9 | ATOM_TYPE: H
10 | N_TYPE_ATOM: 3
11 | PSEUDO_POT: 01_H_1_1.0_1.0_pbe_v1.0.psp8
12 | COORD:
13 | 0.00287811 1.77539 -0.514085
14 | 1.5409 -0.886466 -0.51453
15 | -1.53689 -0.888792 -0.514523
16 | RELAX:
17 | 1 1 1
18 | 1 1 1
19 | 1 1 1
20 |
21 | ATOM_TYPE: N
22 | N_TYPE_ATOM: 1
23 | PSEUDO_POT: 07_N_5_1.2_1.4_pbe_n_v1.0.psp8
24 | COORD:
25 | 0 0 0.220132
26 | RELAX:
27 | 0 0 0
28 |
29 |
--------------------------------------------------------------------------------
/tests/outputs/NH3_sort_lbfgs_opt.sparc/sparc.log:
--------------------------------------------------------------------------------
1 |
2 | ********************************************************************************
3 | SPARC program started by sparc-python-api at 2023-05-22T17:15:36.477200
4 | command: /home/pink/miniforge3/envs/sparc/bin/mpirun -n 1 /home/pink/miniforge3/envs/sparc/bin/sparc -name SPARC
5 |
6 |
7 | fchrg = 4.00000000 > 0.0 (icmod != 0)
8 | This pseudopotential contains non-linear core correction.
9 |
10 | fchrg = 4.000000, READING MODEL CORE CHARGE!
11 |
12 | WARNING: The density after mixing has negative components!
13 | WARNING: The density after mixing has negative components!
14 | WARNING: The density after mixing has negative components!
15 | WARNING: The density after mixing has negative components!
16 | WARNING: The density after mixing has negative components!
17 | WARNING: The density after mixing has negative components!
18 | WARNING: The density after mixing has negative components!
19 | WARNING: The density after mixing has negative components!
20 | WARNING: The density after mixing has negative components!
21 | WARNING: The density after mixing has negative components!
22 | WARNING: The density after mixing has negative components!
23 | WARNING: The density after mixing has negative components!
24 | WARNING: The density after mixing has negative components!
25 | WARNING: The density after mixing has negative components!
26 | WARNING: The density after mixing has negative components!
27 | WARNING: The density after mixing has negative components!
28 | WARNING: The density after mixing has negative components!
29 | WARNING: The density after mixing has negative components!
30 | WARNING: The density after mixing has negative components!
31 | WARNING: The density after mixing has negative components!
32 | WARNING: The density after mixing has negative components!
33 | WARNING: The density after mixing has negative components!
34 | WARNING: The density after mixing has negative components!
35 | WARNING: The density after mixing has negative components!
36 | WARNING: The density after mixing has negative components!
37 | WARNING: The density after mixing has negative components!
38 | WARNING: The density after mixing has negative components!
39 | WARNING: The density after mixing has negative components!
40 | WARNING: The density after mixing has negative components!
41 | WARNING: The density after mixing has negative components!
42 | WARNING: The density after mixing has negative components!
43 | WARNING: The density after mixing has negative components!
44 | WARNING: The density after mixing has negative components!
45 | WARNING: The density after mixing has negative components!
46 | WARNING: The density after mixing has negative components!
47 | WARNING: The density after mixing has negative components!
48 | WARNING: The density after mixing has negative components!
49 | WARNING: The density after mixing has negative components!
50 | The program took 10.071 s.
51 |
--------------------------------------------------------------------------------
/tests/outputs/Si8_cell_geopt_relax2.sparc/Si8_cell_geopt.geopt:
--------------------------------------------------------------------------------
1 | :RELAXSTEP: 1
2 | :CELL: 9.3272727273E+00 9.3272727273E+00 9.3272727273E+00
3 | :VOLUME: 8.1145422690E+02
4 | :LATVEC:
5 | 1.0000000000E+00 0.0000000000E+00 0.0000000000E+00
6 | 0.0000000000E+00 1.0000000000E+00 0.0000000000E+00
7 | 0.0000000000E+00 0.0000000000E+00 1.0000000000E+00
8 | :STRESS:
9 | -5.6292942161E+01 8.8196137948E-04 -3.6637837366E-04
10 | 8.8196137948E-04 -5.6292757276E+01 3.2138320412E-04
11 | -3.6637837366E-04 3.2138320412E-04 -5.6292624801E+01
12 | :RELAXSTEP: 2
13 | :CELL: 1.1286000000E+01 1.1286000000E+01 1.1286000000E+01
14 | :VOLUME: 1.4375406617E+03
15 | :LATVEC:
16 | 1.0000000000E+00 0.0000000000E+00 0.0000000000E+00
17 | 0.0000000000E+00 1.0000000000E+00 0.0000000000E+00
18 | 0.0000000000E+00 0.0000000000E+00 1.0000000000E+00
19 | :STRESS:
20 | 1.0020626895E+01 -5.9541735443E-10 4.2704367421E-09
21 | -5.9541735443E-10 1.0020626902E+01 -5.7918792773E-10
22 | 4.2704367421E-09 -5.7918792773E-10 1.0020626897E+01
23 | :RELAXSTEP: 3
24 | :CELL: 1.1032774586E+01 1.1032774586E+01 1.1032774586E+01
25 | :VOLUME: 1.3429326576E+03
26 | :LATVEC:
27 | 1.0000000000E+00 0.0000000000E+00 0.0000000000E+00
28 | 0.0000000000E+00 1.0000000000E+00 0.0000000000E+00
29 | 0.0000000000E+00 0.0000000000E+00 1.0000000000E+00
30 | :STRESS:
31 | 7.1033863815E+00 -1.5545092313E-11 -6.8196461183E-10
32 | -1.5545092313E-11 7.1033863823E+00 -2.8989733148E-11
33 | -6.8196461183E-10 -2.8989733148E-11 7.1033863808E+00
34 | :RELAXSTEP: 4
35 | :CELL: 1.0441480472E+01 1.0441480472E+01 1.0441480472E+01
36 | :VOLUME: 1.1383773384E+03
37 | :LATVEC:
38 | 1.0000000000E+00 0.0000000000E+00 0.0000000000E+00
39 | 0.0000000000E+00 1.0000000000E+00 0.0000000000E+00
40 | 0.0000000000E+00 0.0000000000E+00 1.0000000000E+00
41 | :STRESS:
42 | -5.1546636018E+00 4.1523866475E-13 -4.1382550152E-11
43 | 4.1523866475E-13 -5.1546636025E+00 6.6904849258E-12
44 | -4.1382550152E-11 6.6904849258E-12 -5.1546636022E+00
45 | :RELAXSTEP: 5
46 | :CELL: 1.0698114243E+01 1.0698114243E+01 1.0698114243E+01
47 | :VOLUME: 1.2243954131E+03
48 | :LATVEC:
49 | 1.0000000000E+00 0.0000000000E+00 0.0000000000E+00
50 | 0.0000000000E+00 1.0000000000E+00 0.0000000000E+00
51 | 0.0000000000E+00 0.0000000000E+00 1.0000000000E+00
52 | :STRESS:
53 | 1.3144091941E+00 -8.5788897523E-10 1.3579211628E-08
54 | -8.5788897523E-10 1.3144092015E+00 -5.5324285731E-10
55 | 1.3579211628E-08 -5.5324285731E-10 1.3144091977E+00
56 | :RELAXSTEP: 6
57 | :CELL: 1.0646967198E+01 1.0646967198E+01 1.0646967198E+01
58 | :VOLUME: 1.2069179550E+03
59 | :LATVEC:
60 | 1.0000000000E+00 0.0000000000E+00 0.0000000000E+00
61 | 0.0000000000E+00 1.0000000000E+00 0.0000000000E+00
62 | 0.0000000000E+00 0.0000000000E+00 1.0000000000E+00
63 | :STRESS:
64 | 1.8255733527E-01 1.1690610590E-10 -1.8251209346E-09
65 | 1.1690610590E-10 1.8255733453E-01 7.5006354546E-11
66 | -1.8251209346E-09 7.5006354546E-11 1.8255733497E-01
67 | :RELAXSTEP: 7
68 | :CELL: 1.0638955458E+01 1.0638955458E+01 1.0638955458E+01
69 | :VOLUME: 1.2041954223E+03
70 | :LATVEC:
71 | 1.0000000000E+00 0.0000000000E+00 0.0000000000E+00
72 | 0.0000000000E+00 1.0000000000E+00 0.0000000000E+00
73 | 0.0000000000E+00 0.0000000000E+00 1.0000000000E+00
74 | :STRESS:
75 | -1.4216711673E-03 1.0292458134E-10 -1.8760770611E-09
76 | 1.0292458134E-10 -1.4216727292E-03 7.2696789785E-11
77 | -1.8760770611E-09 7.2696789785E-11 -1.4216721414E-03
78 | :RELAXSTEP: 8
79 | :CELL: 1.0639017414E+01 1.0639017414E+01 1.0639017414E+01
80 | :VOLUME: 1.2042164603E+03
81 | :LATVEC:
82 | 1.0000000000E+00 0.0000000000E+00 0.0000000000E+00
83 | 0.0000000000E+00 1.0000000000E+00 0.0000000000E+00
84 | 0.0000000000E+00 0.0000000000E+00 1.0000000000E+00
85 | :STRESS:
86 | -5.6848955674E-06 4.1602791230E-12 -2.9734568924E-11
87 | 4.1602791230E-12 -5.6848342716E-06 1.2355227433E-12
88 | -2.9734568924E-11 1.2355227433E-12 -5.6848234006E-06
89 |
--------------------------------------------------------------------------------
/tests/outputs/Si8_cell_geopt_relax2.sparc/Si8_cell_geopt.inpt:
--------------------------------------------------------------------------------
1 | # nprocs: 24
2 | # Test: Si8 #
3 | LATVEC:
4 | 1 0 0
5 | 0 1 0
6 | 0 0 1
7 | LATVEC_SCALE: 10.26 10.26 10.26
8 | FD_GRID: 26 26 26 # FD grid
9 | FD_ORDER: 12
10 | BC: P P P
11 | EXCHANGE_CORRELATION: GGA_PBE
12 | TOL_SCF: 1e-6
13 | TOL_POISSON: 1e-8
14 | TOL_PSEUDOCHARGE: 1e-8
15 | ELEC_TEMP: 315.775131
16 | ELEC_TEMP_TYPE: fd
17 |
18 | RELAX_FLAG: 2
19 | RELAX_NITER: 50
20 |
21 | RELAX_MAXDILAT: 1.1
22 | TOL_RELAX_CELL: 1e-4
23 | CALC_STRESS: 1
24 | MAXIT_SCF: 30
--------------------------------------------------------------------------------
/tests/outputs/Si8_cell_geopt_relax2.sparc/Si8_cell_geopt.ion:
--------------------------------------------------------------------------------
1 | #=========================
2 | # format of ion file
3 | #=========================
4 | # ATOM_TYPE:
5 | # N_TYPE_ATOM:
6 | # COORD:
7 | #
8 | # ...
9 | # RELAX:
10 | #
11 | # ...
12 |
13 |
14 | # Reminder: when changing number of atoms, change the RELAX flags accordingly
15 | # as well.
16 |
17 | ATOM_TYPE: Si # atom type followed with valence charge
18 | N_TYPE_ATOM: 8 # number of atoms of this type
19 | PSEUDO_POT: ../../../psps/14_Si_4_1.9_1.9_pbe_n_v1.0.psp8
20 | ATOMIC_MASS: 28.0855
21 | COORD_FRAC: # coordinates follows
22 | 0 0 0
23 | 0.250000000000000 0.250000000000000 0.250000000000000
24 | 0 0.500000000000000 0.500000000000000
25 | 0.250000000000000 0.750000000000000 0.750000000000000
26 | 0.500000000000000 0 0.500000000000000
27 | 0.750000000000000 0.250000000000000 0.750000000000000
28 | 0.500000000000000 0.500000000000000 0
29 | 0.750000000000000 0.750000000000000 0.250000000000000
30 |
31 | #COORD: # coordinates follows
32 | # 0 0 0
33 | # 2.565000000000000 2.565000000000000 2.565000000000000
34 | # 0 5.130000000000000 5.130000000000000
35 | # 2.565000000000000 7.695000000000000 7.695000000000000
36 | # 5.130000000000000 0 5.130000000000000
37 | # 7.695000000000000 2.565000000000000 7.695000000000000
38 | # 5.130000000000000 5.130000000000000 0
39 | # 7.695000000000000 7.695000000000000 2.565000000000000
40 |
--------------------------------------------------------------------------------
/tests/outputs/SiH4_quick.sparc/SiH4_quick.inpt:
--------------------------------------------------------------------------------
1 | # nprocs: 1
2 | # Test: SiH4 #
3 | LATVEC:
4 | 1 0 0
5 | 0 1 0
6 | 0 0 1
7 | LATVEC_SCALE: 13 13 13
8 | FD_GRID: 26 26 26
9 | BOUNDARY_CONDITION: 1
10 | RHO_TRIGGER: 4
11 | EXCHANGE_CORRELATION: GGA_PBE
12 | MAXIT_SCF: 30
13 | TOL_SCF: 1e-5
14 | TOL_PSEUDOCHARGE: 1e-5
15 | NSTATES: 10
16 | PRINT_FORCES: 1
17 | PRINT_ATOMS: 1
18 |
19 |
20 |
--------------------------------------------------------------------------------
/tests/outputs/SiH4_quick.sparc/SiH4_quick.ion:
--------------------------------------------------------------------------------
1 | #=========================
2 | # format of ion file
3 | #=========================
4 | # ATOM_TYPE:
5 | # N_TYPE_ATOM:
6 | # COORD:
7 | #
8 | # ...
9 | # RELAX:
10 | #
11 | # ...
12 |
13 |
14 | # Reminder: when changing number of atoms, change the RELAX flags accordingly
15 | # as well.
16 |
17 | ATOM_TYPE: Si # atom type followed with valence charge
18 | PSEUDO_POT: ../../../psps/14_Si_4_1.9_1.9_pbe_n_v1.0.psp8
19 | N_TYPE_ATOM: 1 # number of atoms of this type
20 | COORD: # coordinates follows
21 | 6.5 6.5 6.5
22 |
23 |
24 | ATOM_TYPE: H # atom type followed with valence charge
25 | PSEUDO_POT: ../../../psps/01_H_1_1.0_1.0_pbe_v1.0.psp8 # pseudopotential
26 | N_TYPE_ATOM: 4 # number of atoms of this type
27 | COORD: # coordinates follows
28 | 8.127432021000001 8.127432021000001 8.127432021000001
29 | 4.872567978999999 4.872567978999999 8.127432021000001
30 | 4.872567978999999 8.127432021000001 4.872567978999999
31 | 8.127432021000001 4.872567978999999 4.872567978999999
32 |
33 |
--------------------------------------------------------------------------------
/tests/outputs/SiH4_quick.sparc/SiH4_quick.static:
--------------------------------------------------------------------------------
1 | ***************************************************************************
2 | Atom positions
3 | ***************************************************************************
4 | Fractional coordinates of Si:
5 | 0.5000000000 0.5000000000 0.5000000000
6 | Fractional coordinates of H:
7 | 0.6251870785 0.6251870785 0.6251870785
8 | 0.3748129215 0.3748129215 0.6251870785
9 | 0.3748129215 0.6251870785 0.3748129215
10 | 0.6251870785 0.3748129215 0.3748129215
11 | Total free energy (Ha): -6.551906787524707E+00
12 | Atomic forces (Ha/Bohr):
13 | 2.7841214148E-07 2.4232519093E-07 8.2437137313E-08
14 | -4.2951392225E-03 -4.2950974246E-03 -4.2950641764E-03
15 | 4.2949302306E-03 4.2949736382E-03 -4.2950197241E-03
16 | 4.2950028584E-03 -4.2950525571E-03 4.2950108370E-03
17 | -4.2950722786E-03 4.2949340183E-03 4.2949906265E-03
18 |
--------------------------------------------------------------------------------
/tests/outputs/TiO2_orthogonal_quick_md.sparc/TiO2_orthogonal_quick_md.inpt:
--------------------------------------------------------------------------------
1 | # nprocs: 8
2 |
3 | # Test: CuSi7 #
4 | LATVEC_SCALE: 8.79468 8.79468 8.79468
5 | LATVEC:
6 | 1 0 0
7 | 0 1 0
8 | 0 0 1
9 | MESH_SPACING: 0.35
10 | FD_ORDER: 12
11 | BC: P P P
12 | EXCHANGE_CORRELATION: GGA_PBE
13 | TOL_SCF: 1e-6
14 |
15 |
16 | PRINT_FORCES: 1
17 | PRINT_ATOMS: 1
18 | CALC_STRESS: 1
19 |
20 | MD_FLAG: 1 # 1= MD, 0= no MD (default)
21 | ION_TEMP: 800
22 | MD_METHOD: NVE
23 | MD_TIMESTEP: 0.6
24 | MD_NSTEP: 5
25 |
--------------------------------------------------------------------------------
/tests/outputs/TiO2_orthogonal_quick_md.sparc/TiO2_orthogonal_quick_md.ion:
--------------------------------------------------------------------------------
1 | #=========================
2 | # format of ion file
3 | #=========================
4 | # ATOM_TYPE:
5 | # PSEUDO_POT:
6 | # N_TYPE_ATOM:
7 | # ATOMIC_MASS: #(optional, for MD only)
8 | # COORD:
9 | #
10 | # ...
11 | # RELAX: #(optional)
12 | #
13 | # ...
14 |
15 | # this is a comment
16 |
17 | ATOM_TYPE: Ti # atom type
18 | N_TYPE_ATOM: 2 # number of atoms of this type
19 | PSEUDO_POT: ../../../psps/22_Ti_12_2.0_2.8_pbe_n_v1.0.psp8 # pseudopotential
20 | COORD_FRAC: # coordinates follows
21 | 0.5000000000000000 0.5000000000000000 0.5000000000000000
22 | 0.0000000000000000 0.0000000000000000 0.0000000000000000
23 |
24 | ATOM_TYPE: O # atom type
25 | N_TYPE_ATOM: 4 # number of atoms of this type
26 | PSEUDO_POT: ../../../psps/08_O_6_1.2_1.4_pbe_n_v1.0.psp8 # pseudopotential
27 | COORD_FRAC: # coordinates follows
28 | 0.1954200000000000 0.8045800000000000 0.5000000000000000
29 | 0.8045800000000000 0.1954200000000000 0.5000000000000000
30 | 0.3045800000000001 0.3045800000000000 0.0000000000000000
31 | 0.6954200000000000 0.6954200000000000 0.0000000000000000
32 |
33 |
--------------------------------------------------------------------------------
/tests/outputs/WSe2_helix_static.sparc/WSe2_cyclix.inpt:
--------------------------------------------------------------------------------
1 | # nprocs: 24
2 | CELL: 30.349896582200003 0.299199300341885 3.135906672400000
3 | TWIST_ANGLE: 0.047705389796071
4 | FD_GRID: 120 42 25
5 | KPOINT_GRID: 1 3 4
6 | KPOINT_SHIFT: 0 0 0
7 | CHEB_DEGREE: 100
8 | BC: D C H
9 | EXCHANGE_CORRELATION: GGA_PBE
10 | TOL_SCF: 1e-6
11 | SMEARING: 0.001
12 | ELEC_TEMP_TYPE: fd
13 | CALC_STRESS: 1
14 | PRINT_FORCES: 1
15 | MIXING_VARIABLE: potential
16 | MIXING_PRECOND: none
--------------------------------------------------------------------------------
/tests/outputs/WSe2_helix_static.sparc/WSe2_cyclix.ion:
--------------------------------------------------------------------------------
1 | ATOM_TYPE: W
2 | N_TYPE_ATOM: 1
3 | PSEUDO_POT: ../../../psps/74_W_14_2.3_2.5_pbe_n_v1.0.psp8
4 | COORD:
5 | 35.932050040279556 5.415857727989695 3.135799543546264
6 | ATOM_TYPE: Se
7 | N_TYPE_ATOM: 2
8 | PSEUDO_POT: ../../../psps/34_Se_16_1.9_2.1_pbe_n_v1.0.psp8
9 | COORD:
10 | 32.959304779880675 3.357462537482735 0.000032907355847
11 | 39.278965212349100 3.880850013508314 0.000074221497889
--------------------------------------------------------------------------------
/tests/outputs/WSe2_helix_static.sparc/WSe2_cyclix.static:
--------------------------------------------------------------------------------
1 | ***************************************************************************
2 | Atom positions
3 | ***************************************************************************
4 | Fractional coordinates of W:
5 | 1.1972993167 0.0000145889 0.9999658380
6 | Fractional coordinates of Se:
7 | 1.0915974792 0.3392894457 0.0000104937
8 | 1.3005058466 0.3291420709 0.0000236683
9 | Total free energy (Ha): -3.055065628300148E+02
10 | Atomic forces (Ha/Bohr):
11 | -1.9631231365E-04 2.0197957296E-03 -9.3342235956E-04
12 | -1.4864255791E-03 -8.3883915724E-04 5.1817786556E-04
13 | -1.5069571202E-02 -2.7428580192E-03 4.1524449400E-04
14 | Stress (Ha/Bohr):
15 | 5.9636521405E-01
16 | Stress equiv. to all periodic (GPa):
17 | 2.5346951054E+00
18 |
--------------------------------------------------------------------------------
/tests/sparc-latex-doc-202302/Manual.tex:
--------------------------------------------------------------------------------
1 | \documentclass[xcolor=dvipsnames,t]{beamer}
2 | % \usepackage[utf8]{inputenc}
3 | \usepackage{verbatim} % for comment
4 | \usetheme{Madrid}
5 | \usecolortheme{seahorse}
6 | \usepackage{beamerouterthemesplit}
7 | \usepackage{array}
8 | \usepackage{algorithm}
9 | \usepackage{algpseudocode}
10 | \usepackage[T1]{fontenc}
11 |
12 |
13 | \setbeamerfont{institute}{size=\normalsize}
14 |
15 | \title[] {SPARC \\ {\normalsize Simulation Package for Ab-initio Real-space Calculations} \\ {\small User guide}}
16 | %\author{}
17 | %\author{Qimen Xu, Abhiraj Sharma, Phanish Suryanarayana, }
18 |
19 | \institute[]
20 | {
21 | Material Physics \& Mechanics Group \\
22 | PI: Phanish Suryanarayana \\
23 | Main Developers: Qimen Xu, Abhiraj Sharma \\
24 | Collaborators: J.E. Pask (LLNL), A.J. Medford (GT), E. Chow (GT) \\
25 | Georgia Institute of Technology
26 | }
27 |
28 | \date{}
29 | \setbeamertemplate{frametitle continuation}{}
30 | \setbeamertemplate{navigation symbols}{}
31 | \setbeamercolor{block title}{bg=Apricot!50,fg=black}
32 | %\addtobeamertemplate{block begin}{\vskip -\smallskipamount}{}
33 | %\addtobeamertemplate{block end}{}{\vskip -\smallskipamount}
34 | \addtobeamertemplate{block begin}{\vspace*{-0.6pt}}{}
35 | \addtobeamertemplate{block end}{}{\vspace*{-0.6pt}}
36 | \hypersetup{colorlinks,
37 | citecolor=violet,
38 | linkcolor=blue,
39 | menucolor=white,
40 | anchorcolor=yellow
41 | filecolor=pink,
42 | }
43 |
44 |
45 | \setbeamertemplate{footline}{
46 | \hbox{%
47 | \begin{beamercolorbox}[wd=\paperwidth,ht=1ex,dp=1.5ex,leftskip=2ex,rightskip=2ex]{page footer}%
48 | \usebeamerfont{title in head/foot}%
49 | \insertshorttitle \hfill
50 | \insertsection \hfill
51 | \insertframenumber{} / \inserttotalframenumber
52 | \end{beamercolorbox}}%
53 | }
54 |
55 | % \setbeamertemplate{headline} [split theme]
56 | % {%
57 | % \begin{beamercolorbox}{section in head/foot}
58 | % \vskip2pt\insertnavigation{\paperwidth}\vskip2pt
59 | % \end{beamercolorbox}%
60 | % }
61 |
62 | % \defbeamertemplate*{footline}{split theme}
63 | % {%
64 | % \leavevmode%
65 | % \hbox{\begin{beamercolorbox}[wd=.5\paperwidth,ht=2.5ex,dp=1.125ex,leftskip=.3cm plus1fill,rightskip=.3cm]{section in head/foot}%
66 | % \usebeamerfont{author in head/foot}\insertshortauthor
67 | % \end{beamercolorbox}%
68 | % \begin{beamercolorbox}[wd=.5\paperwidth,ht=2.5ex,dp=1.125ex,leftskip=.3cm,rightskip=.3cm plus1fil]{title in head/foot}%
69 | % \usebeamerfont{title in head/foot}\insertshorttitle
70 | % \end{beamercolorbox}}%
71 | % \vskip0pt%
72 | % }
73 |
74 |
75 |
76 | \let\otp\titlepage
77 | \renewcommand{\titlepage}{\otp\addtocounter{framenumber}{-1}}
78 |
79 |
80 | %\includeonly{Introduction,Stress,MD,Optimization,Print}
81 | %\includeonly{Introduction}
82 |
83 | \begin{document}
84 |
85 | %\frame{\titlepage}
86 |
87 | \begin{frame}[plain]
88 | \titlepage
89 | \end{frame}
90 |
91 | \include{Introduction}
92 | \include{System}
93 | \include{SCF}
94 | \include{Electrostatics}
95 | \include{Stress}
96 | \include{MD}
97 | \include{Optimization}
98 | \include{Print}
99 | \include{Paral}
100 | \include{SQ}
101 |
102 | \end{document}
103 |
--------------------------------------------------------------------------------
/tests/sparc-latex-doc-202302/Stress.tex:
--------------------------------------------------------------------------------
1 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2 |
3 |
4 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5 | \begin{frame}[allowframebreaks,c]{} \label{Stress calculation}
6 |
7 | \begin{center}
8 | \Huge \textbf{Stress calculation}
9 | \end{center}
10 |
11 | \end{frame}
12 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
13 |
14 |
15 |
16 |
17 |
18 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
19 | \begin{frame}[allowframebreaks]{\texttt{CALC\_STRESS}} \label{CALC_STRESS}
20 | \vspace*{-12pt}
21 | \begin{columns}
22 | \column{0.4\linewidth}
23 | \begin{block}{Type}
24 | Integer
25 | \end{block}
26 |
27 | \begin{block}{Default}
28 | 0
29 | \end{block}
30 |
31 | \column{0.4\linewidth}
32 | \begin{block}{Unit}
33 | No unit
34 | \end{block}
35 |
36 | \begin{block}{Example}
37 | \texttt{CALC\_STRESS}: 1
38 | \end{block}
39 | \end{columns}
40 |
41 | \begin{block}{Description}
42 | Flag for calculation of the Hellmann-Feynman stress tensor (in cartesian coordinates).
43 | \end{block}
44 |
45 | %\begin{block}{Remark}
46 | %\end{block}
47 |
48 | \end{frame}
49 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
50 |
51 |
52 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
53 | \begin{frame}[allowframebreaks]{\texttt{CALC\_PRES}} \label{CALC_PRES}
54 | \vspace*{-12pt}
55 | \begin{columns}
56 | \column{0.4\linewidth}
57 | \begin{block}{Type}
58 | Integer
59 | \end{block}
60 |
61 | \begin{block}{Default}
62 | 0
63 | \end{block}
64 |
65 | \column{0.4\linewidth}
66 | \begin{block}{Unit}
67 | No unit
68 | \end{block}
69 |
70 | \begin{block}{Example}
71 | \texttt{CALC\_PRES}: 1
72 | \end{block}
73 | \end{columns}
74 |
75 | \begin{block}{Description}
76 | Flag for calculation of the pressure.
77 | \end{block}
78 |
79 | \begin{block}{Remark}
80 | Pressure is directly calculated, without calculation of the stress tensor.
81 | \end{block}
82 |
83 | \end{frame}
84 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
85 |
--------------------------------------------------------------------------------
/tests/sparc-latex-doc-202302/highT/Introduction.tex:
--------------------------------------------------------------------------------
1 |
2 | \begin{frame}[allowframebreaks]{\textbf{Comments}} \label{Introduction}
3 | The code will fail with the following options and the related input options are listed.
4 | \begin{itemize}
5 | \item Polarized calculation: \texttt{SPIN\_TYP}.
6 | \item K-point calculation: \texttt{KPOINT\_GRID}, \texttt{KPOINT\_SHIFT}.
7 | \item Dirichlet boundary condition in any direction: \texttt{BC}
8 | \item Define number of states/orbitals: \texttt{NSTATES}
9 | \item Hybrid functionals: \texttt{EXCHANGE\_CORRELATION}
10 | \item Print eigenvalues into file: \texttt{PRINT\_EIGEN}
11 | \end{itemize}
12 |
13 | \end{frame}
14 |
15 | \begin{frame}[allowframebreaks]{\textbf{Input file options}} \label{Index}
16 | \vspace{-2mm}
17 | \begin{block}{Spectral Quadrature}
18 | \hyperlink{SQ_FLAG}{\texttt{SQ\_FLAG}} $\vert$
19 | \hyperlink{SQ_RCUT}{\texttt{SQ\_RCUT}} $\vert$
20 | \hyperlink{SQ_NPL_G}{\texttt{SQ\_NPL\_G}} $\vert$
21 | \hyperlink{SQ_GAUSS_MEM}{\texttt{SQ\_GAUSS\_MEM}} $\vert$
22 | \hyperlink{SQ_TOL_OCC}{\texttt{SQ\_TOL\_OCC}} $\vert$
23 | \hyperlink{NP_DOMAIN_SQ_PARAL}{\texttt{NP\_DOMAIN\_SQ\_PARAL}}
24 | \end{block}
25 |
26 | \end{frame}
27 |
--------------------------------------------------------------------------------
/tests/sparc-latex-doc-202302/highT/Manual_highT.tex:
--------------------------------------------------------------------------------
1 | \documentclass[xcolor=dvipsnames,t]{beamer}
2 | %\usepackage[utf8]{inputenc}
3 | \usepackage{verbatim} % for comment
4 | \usetheme{Madrid}
5 | \usecolortheme{seahorse}
6 | \usepackage{beamerouterthemesplit}
7 | \usepackage[T1]{fontenc}
8 |
9 | \setbeamerfont{institute}{size=\normalsize}
10 |
11 | \title[] {SPARC - SQ \\ {\normalsize Spectral Quadrature method} \\ {\small User guide}}
12 | %\author{}
13 | %\author{Qimen Xu, Abhiraj Sharma, Phanish Suryanarayana, }
14 |
15 | \institute[]
16 | {
17 | Material Physics \& Mechanics Group \\
18 | PI: Phanish Suryanarayana \\
19 | Main Developers: Xin Jing, Abhiraj Sharma, Phanisri P. Pratapa\\
20 | Collaborators: J.E. Pask (LLNL)\\
21 | Georgia Institute of Technology
22 | }
23 |
24 | \date{}
25 | \setbeamertemplate{frametitle continuation}{}
26 | \setbeamertemplate{navigation symbols}{}
27 | \setbeamercolor{block title}{bg=Apricot!50,fg=black}
28 | %\addtobeamertemplate{block begin}{\vskip -\smallskipamount}{}
29 | %\addtobeamertemplate{block end}{}{\vskip -\smallskipamount}
30 | \addtobeamertemplate{block begin}{\vspace*{-0.6pt}}{}
31 | \addtobeamertemplate{block end}{}{\vspace*{-0.6pt}}
32 | \hypersetup{colorlinks,
33 | citecolor=violet,
34 | linkcolor=blue,
35 | menucolor=white,
36 | anchorcolor=yellow
37 | filecolor=pink,
38 | }
39 |
40 |
41 | \setbeamertemplate{footline}{
42 | \hbox{%
43 | \begin{beamercolorbox}[wd=\paperwidth,ht=1ex,dp=1.5ex,leftskip=2ex,rightskip=2ex]{page footer}%
44 | \usebeamerfont{title in head/foot}%
45 | \insertshorttitle \hfill
46 | \insertsection \hfill
47 | \insertframenumber{} / \inserttotalframenumber
48 | \end{beamercolorbox}}%
49 | }
50 |
51 | \let\otp\titlepage
52 | \renewcommand{\titlepage}{\otp\addtocounter{framenumber}{-1}}
53 |
54 |
55 | %\includeonly{Introduction,Stress,MD,Optimization,Print}
56 | %\includeonly{Introduction}
57 |
58 | \begin{document}
59 |
60 | %\frame{\titlepage}
61 |
62 | \begin{frame}[plain]
63 | \titlepage
64 | \end{frame}
65 |
66 | \include{Introduction}
67 | \include{SQ}
68 |
69 |
70 | \end{document}
71 |
--------------------------------------------------------------------------------
/tests/sparc-latex-socket-202401/Manual.tex:
--------------------------------------------------------------------------------
1 | \documentclass[xcolor=dvipsnames,t]{beamer}
2 | % \usepackage[utf8]{inputenc}
3 | \usepackage{verbatim} % for comment
4 | \usetheme{Madrid}
5 | \usecolortheme{seahorse}
6 | \usepackage{beamerouterthemesplit}
7 | \usepackage{array}
8 | \usepackage{algorithm}
9 | \usepackage{algpseudocode}
10 | \usepackage[T1]{fontenc}
11 |
12 |
13 | \setbeamerfont{institute}{size=\normalsize}
14 |
15 | \title[] {SPARC \\ {\normalsize Simulation Package for Ab-initio Real-space Calculations} \\ {\small User guide}}
16 | %\author{}
17 | %\author{Qimen Xu, Abhiraj Sharma, Phanish Suryanarayana, }
18 |
19 | \institute[]
20 | {
21 | Material Physics \& Mechanics Group, Georgia Tech \\
22 | PI: Phanish Suryanarayana \\
23 | \hyperlink{Contributors}{\texttt{Contributors}} \\
24 | \hyperlink{Citation}{\texttt{Citation}}\\
25 | \hyperlink{Acknowledgments}{\texttt{Acknowledgements}}\\
26 | %Collaborators: J.E. Pask (LLNL), A.J. Medford (GT), E. Chow (GT) \\
27 | %Georgia Institute of Technology
28 | }
29 |
30 | \date{}
31 | \setbeamertemplate{frametitle continuation}{}
32 | \setbeamertemplate{navigation symbols}{}
33 | \setbeamercolor{block title}{bg=Apricot!50,fg=black}
34 | %\addtobeamertemplate{block begin}{\vskip -\smallskipamount}{}
35 | %\addtobeamertemplate{block end}{}{\vskip -\smallskipamount}
36 | \addtobeamertemplate{block begin}{\vspace*{-0.6pt}}{}
37 | \addtobeamertemplate{block end}{}{\vspace*{-0.6pt}}
38 | \hypersetup{colorlinks,
39 | citecolor=violet,
40 | linkcolor=blue,
41 | menucolor=white,
42 | anchorcolor=yellow
43 | filecolor=pink,
44 | }
45 |
46 |
47 | \setbeamertemplate{footline}{
48 | \hbox{%
49 | \begin{beamercolorbox}[wd=\paperwidth,ht=1ex,dp=1.5ex,leftskip=2ex,rightskip=2ex]{page footer}%
50 | \usebeamerfont{title in head/foot}%
51 | \insertshorttitle \hfill
52 | \insertsection \hfill
53 | \insertframenumber{} / \inserttotalframenumber
54 | \end{beamercolorbox}}%
55 | }
56 |
57 | % \setbeamertemplate{headline} [split theme]
58 | % {%
59 | % \begin{beamercolorbox}{section in head/foot}
60 | % \vskip2pt\insertnavigation{\paperwidth}\vskip2pt
61 | % \end{beamercolorbox}%
62 | % }
63 |
64 | % \defbeamertemplate*{footline}{split theme}
65 | % {%
66 | % \leavevmode%
67 | % \hbox{\begin{beamercolorbox}[wd=.5\paperwidth,ht=2.5ex,dp=1.125ex,leftskip=.3cm plus1fill,rightskip=.3cm]{section in head/foot}%
68 | % \usebeamerfont{author in head/foot}\insertshortauthor
69 | % \end{beamercolorbox}%
70 | % \begin{beamercolorbox}[wd=.5\paperwidth,ht=2.5ex,dp=1.125ex,leftskip=.3cm,rightskip=.3cm plus1fil]{title in head/foot}%
71 | % \usebeamerfont{title in head/foot}\insertshorttitle
72 | % \end{beamercolorbox}}%
73 | % \vskip0pt%
74 | % }
75 |
76 |
77 |
78 | \let\otp\titlepage
79 | \renewcommand{\titlepage}{\otp\addtocounter{framenumber}{-1}}
80 |
81 |
82 | %\includeonly{Introduction,Stress,MD,Optimization,Print}
83 | %\includeonly{Introduction}
84 |
85 | \begin{document}
86 |
87 | %\frame{\titlepage}
88 |
89 | \begin{frame}[plain]
90 | \titlepage
91 | \end{frame}
92 |
93 | \include{Introduction}
94 | \include{System}
95 | \include{SCF}
96 | \include{Electrostatics}
97 | \include{Stress}
98 | \include{MD}
99 | \include{Optimization}
100 | \include{BandStructure}
101 | \include{Print}
102 | \include{Paral}
103 | \include{SQ}
104 | \include{Socket}
105 |
106 | \end{document}
107 |
--------------------------------------------------------------------------------
/tests/sparc-latex-socket-202401/Stress.tex:
--------------------------------------------------------------------------------
1 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2 |
3 |
4 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5 | \begin{frame}[allowframebreaks,c]{} \label{Stress calculation}
6 |
7 | \begin{center}
8 | \Huge \textbf{Stress calculation}
9 | \end{center}
10 |
11 | \end{frame}
12 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
13 |
14 |
15 |
16 |
17 |
18 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
19 | \begin{frame}[allowframebreaks]{\texttt{CALC\_STRESS}} \label{CALC_STRESS}
20 | \vspace*{-12pt}
21 | \begin{columns}
22 | \column{0.4\linewidth}
23 | \begin{block}{Type}
24 | Integer
25 | \end{block}
26 |
27 | \begin{block}{Default}
28 | 0
29 | \end{block}
30 |
31 | \column{0.4\linewidth}
32 | \begin{block}{Unit}
33 | No unit
34 | \end{block}
35 |
36 | \begin{block}{Example}
37 | \texttt{CALC\_STRESS}: 1
38 | \end{block}
39 | \end{columns}
40 |
41 | \begin{block}{Description}
42 | Flag for calculation of the Hellmann-Feynman stress tensor (in cartesian coordinates).
43 | \end{block}
44 |
45 | %\begin{block}{Remark}
46 | %\end{block}
47 |
48 | \end{frame}
49 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
50 |
51 |
52 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
53 | \begin{frame}[allowframebreaks]{\texttt{CALC\_PRES}} \label{CALC_PRES}
54 | \vspace*{-12pt}
55 | \begin{columns}
56 | \column{0.4\linewidth}
57 | \begin{block}{Type}
58 | Integer
59 | \end{block}
60 |
61 | \begin{block}{Default}
62 | 0
63 | \end{block}
64 |
65 | \column{0.4\linewidth}
66 | \begin{block}{Unit}
67 | No unit
68 | \end{block}
69 |
70 | \begin{block}{Example}
71 | \texttt{CALC\_PRES}: 1
72 | \end{block}
73 | \end{columns}
74 |
75 | \begin{block}{Description}
76 | Flag for calculation of the pressure.
77 | \end{block}
78 |
79 | \begin{block}{Remark}
80 | Pressure is directly calculated, without calculation of the stress tensor.
81 | \end{block}
82 |
83 | \end{frame}
84 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
85 |
--------------------------------------------------------------------------------
/tests/sparc-latex-socket-202401/cyclix/FAQs.tex:
--------------------------------------------------------------------------------
1 | \begin{frame}[allowframebreaks]{\textbf{FAQs}} \label{FAQs}
2 | %\begin{itemize}
3 | % \item Q : U.S. National Science Foundation: 1553212
4 | %\end{itemize}
5 |
6 | \noindent
7 | {\bf Q:} How can SCF convergence be made better in SPARC-cyclix calculations?
8 | \\
9 | {\color{blue} {\bf A:} In cases of smaller radius and finer mesh, we need to use higher Chebyshev Degree. Increasing the option CHEB\_DEGREE should help with the SCF convergence. }\\
10 |
11 | \vspace{3mm}
12 |
13 |
14 | {\bf Q:} Are pseudopotentials with non-linear core corrections and relativistic effect supported by SPARC-cyclix?
15 | \\
16 | {\color{blue} {\bf A:} Yes.}\\
17 |
18 | \vspace{3mm}
19 |
20 | {\bf Q:} Is non-collinear spin calculation supported by SPARC-cyclix?
21 | \\
22 | {\color{blue} {\bf A:} No, currently we only have the collinear spin calculations available in SPARC-cyclix.}\\
23 |
24 |
25 | \end{frame}
26 |
--------------------------------------------------------------------------------
/tests/sparc-latex-socket-202401/cyclix/Introduction.tex:
--------------------------------------------------------------------------------
1 |
2 | %\begin{frame}[allowframebreaks]{\textbf{Comments}} \label{Introduction}
3 | %The code will fail with the following options and the related input options are listed.
4 | %\begin{itemize}
5 | % \item Polarized calculation: \texttt{SPIN\_TYP}.
6 | % \item K-point calculation: \texttt{KPOINT\_GRID}, \texttt{KPOINT\_SHIFT}.
7 | % \item Dirichlet boundary condition in any direction: \texttt{BC}
8 | % \item Define number of states/orbitals: \texttt{NSTATES}
9 | % \item Hybrid functionals: \texttt{EXCHANGE\_CORRELATION}
10 | % \item Print eigenvalues into file: \texttt{PRINT\_EIGEN}
11 | %\end{itemize}
12 | %
13 | %\end{frame}
14 |
15 |
16 | \begin{frame}[allowframebreaks]{\textbf{Contributors}} \label{Contributors}
17 | %\begin{itemize}
18 | %\item U.S. Department of Energy, Office of Science: DE-SC0019410
19 | %\item U.S. National Science Foundation: 1333500 and 1553212
20 | %\end{itemize}
21 |
22 | \begin{itemize}
23 | \item \textbf{Phanish Suryanarayana} (PI)
24 | \begin{itemize}
25 | \item \textbf{Abhiraj Sharma}: Code infrastructure, CheFSI, PBE, Energy, Force, Stress, atomic \& cell relaxation \\
26 | \item \textbf{Qimen Xu}: Code infrastructure \\
27 | \item \textbf{Xin Jing}: Code infrastructure, Spin, SOC \\
28 | \item \textbf{Arpit Bhardwaj}: Spin, SOC \\
29 | % \item \textbf{Boqin Zhang}: vdW-DF, DFT-D3, meta-GGA (SCAN) \\
30 | % \item \textbf{Shashikant Kumar}: Testing framework, NLCC \\
31 | % \item \textbf{Mostafa Faghih Shojaei}: SPMS table of pseudopotentials \\
32 | \end{itemize}
33 | % \item \textbf{John E. Pask} (co-PI)
34 | % \item \textbf{Edmond Chow} (co-PI)
35 | % \begin{itemize}
36 | % \item \textbf{Hua Huang}: Subspace eigensolver, DP
37 | % \item \textbf{Lucas Erlandson}: Subspace eigensolver, DP
38 | % \end{itemize}
39 | % \item \textbf{Andrew J. Medford} (co-PI)
40 | % \begin{itemize}
41 | % \item \textbf{Benjamin Comer}: Code testing, Initial testing framework
42 | % \item \textbf{Sushree Jagriti Sahoo}: Code testing
43 | % \end{itemize}
44 | \end{itemize}
45 |
46 | \end{frame}
47 |
48 |
49 | \begin{frame}[allowframebreaks]{\textbf{Citation}} \label{Citation}
50 | If you publish work using/regarding SPARC-cyclix, please cite the following article, in addition to SPARC citations:
51 | \begin{itemize}
52 | \item \url{https://doi.org/10.1103/PhysRevB.103.035101}
53 | \item Additional references for initial developments: \url{https://doi.org/10.1016/j.jmps.2016.08.007}, \url{https://doi.org/10.1103/PhysRevB.100.125143}
54 | % \item Non-orthogonal systems: \url{https://doi.org/10.1016/j.cplett.2018.04.018}
55 | % \item Linear solvers: \url{https://doi.org/10.1016/j.cpc.2018.07.007}, \url{https://doi.org/10.1016/j.jcp.2015.11.018}
56 | % \item Stress tensor/pressure: \url{https://doi.org/10.1063/1.5057355}
57 | % \item Atomic forces: \url{https://doi.org/10.1016/j.cpc.2016.09.020}, \url{https://doi.org/10.1016/j.cpc.2017.02.019}
58 | % \item Mixing: \url{https://doi.org/10.1016/j.cplett.2016.01.033}, \url{https://doi.org/10.1016/j.cplett.2015.06.029}, \url{https://doi.org/10.1016/j.cplett.2019.136983}
59 | % \item SPMS pseudopotentials: \url{https://doi.org/10.1016/j.cpc.2022.108594}
60 | \end{itemize}
61 | \end{frame}
62 |
63 |
64 | \begin{frame}[allowframebreaks]{\textbf{Acknowledgements}} \label{Acknowledgements}
65 | \begin{itemize}
66 | \item \textbf{U.S. National Science Foundation (NSF): 1553212
67 | } \\
68 | \end{itemize}
69 | \end{frame}
70 |
71 |
72 | \begin{frame}[allowframebreaks]{\textbf{Input file options}} \label{Index}
73 | \vspace{-2mm}
74 | Input file options for SPARC-cyclix, in addition to SPARC:
75 | \begin{block}{Cyclix}
76 | \hyperlink{TWIST_ANGLE}{\texttt{TWIST\_ANGLE}} $\vert$
77 | \hyperlink{BC}{\texttt{BC}} $\vert$
78 | \hyperlink{CELL}{\texttt{CELL}} $\vert$
79 | \hyperlink{COORD}{\texttt{COORD}} $\vert$
80 | \hyperlink{COORD_FRAC}{\texttt{COORD\_FRAC}} $\vert$
81 | \hyperlink{EXCHANGE_CORRELATION}{\texttt{EXCHANGE\_CORRELATION}} $\vert$
82 | \hyperlink{KPOINT_GRID}{\texttt{KPOINT\_GRID}} $\vert$
83 |
84 | %\hyperlink{SPIN_TYP}{\texttt{SPIN\_TYP}} $\vert$
85 | %\hyperlink{SPIN}{\texttt{SPIN}} $\vert$
86 | \end{block}
87 | \end{frame}
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
--------------------------------------------------------------------------------
/tests/sparc-latex-socket-202401/cyclix/Manual_cyclix.tex:
--------------------------------------------------------------------------------
1 | \documentclass[xcolor=dvipsnames,t]{beamer}
2 | %\usepackage[utf8]{inputenc}
3 | \usepackage{verbatim} % for comment
4 | \usetheme{Madrid}
5 | \usecolortheme{seahorse}
6 | \usepackage{beamerouterthemesplit}
7 | \usepackage[T1]{fontenc}
8 |
9 | \setbeamerfont{institute}{size=\normalsize}
10 |
11 | \title[] {SPARC-cyclix \\ {\small User guide}}
12 | %\author{}
13 | %\author{Qimen Xu, Abhiraj Sharma, Phanish Suryanarayana, }
14 |
15 | \institute[]
16 | {
17 | Material Physics \& Mechanics Group, Georgia Tech \\
18 | PI: Phanish Suryanarayana \\
19 | %Main Developers: Abhiraj Sharma, Qimen Xu, Xin Jing \\
20 | %Collaborators: J.E. Pask (LLNL)\\
21 | \hyperlink{Contributors}{Contributors}\\
22 | \hyperlink{Citation}{Citation} \\
23 | \hyperlink{Acknowledgements}{Acknowledgements}
24 |
25 | }
26 |
27 | \date{}
28 | \setbeamertemplate{frametitle continuation}{}
29 | \setbeamertemplate{navigation symbols}{}
30 | \setbeamercolor{block title}{bg=Apricot!50,fg=black}
31 | %\addtobeamertemplate{block begin}{\vskip -\smallskipamount}{}
32 | %\addtobeamertemplate{block end}{}{\vskip -\smallskipamount}
33 | \addtobeamertemplate{block begin}{\vspace*{-0.6pt}}{}
34 | \addtobeamertemplate{block end}{}{\vspace*{-0.6pt}}
35 | \hypersetup{colorlinks,
36 | citecolor=violet,
37 | linkcolor=blue,
38 | menucolor=white,
39 | anchorcolor=yellow
40 | filecolor=pink,
41 | }
42 |
43 |
44 | \setbeamertemplate{footline}{
45 | \hbox{%
46 | \begin{beamercolorbox}[wd=\paperwidth,ht=1ex,dp=1.5ex,leftskip=2ex,rightskip=2ex]{page footer}%
47 | \usebeamerfont{title in head/foot}%
48 | \insertshorttitle \hfill
49 | \insertsection \hfill
50 | \insertframenumber{} / \inserttotalframenumber
51 | \end{beamercolorbox}}%
52 | }
53 |
54 | \let\otp\titlepage
55 | \renewcommand{\titlepage}{\otp\addtocounter{framenumber}{-1}}
56 |
57 |
58 | %\includeonly{Introduction,Stress,MD,Optimization,Print}
59 | %\includeonly{Introduction}
60 |
61 | \begin{document}
62 |
63 | %\frame{\titlepage}
64 |
65 | \begin{frame}[plain]
66 | \titlepage
67 | \end{frame}
68 |
69 | \include{Introduction}
70 | \include{cyclix}
71 | \include{FAQs}
72 |
73 |
74 | \end{document}
75 |
76 |
--------------------------------------------------------------------------------
/tests/sparc-latex-socket-202401/highT/Introduction.tex:
--------------------------------------------------------------------------------
1 | \begin{frame}[allowframebreaks]{\textbf{Contributors}} \label{Contributors}
2 | %\begin{itemize}
3 | %\item U.S. Department of Energy, Office of Science: DE-SC0019410
4 | %\item U.S. National Science Foundation: 1333500 and 1553212
5 | %\end{itemize}
6 |
7 | \begin{itemize}
8 | \item \textbf{Phanish Suryanarayana} (PI)
9 | \begin{itemize}
10 | \item \textbf{Xin Jing}: Code infrastructure \\
11 | \item \textbf{Abhiraj Sharma}: Initial development \\
12 | \item \textbf{Phanisri P. Pratapa}: Initial development \\
13 | % \item \textbf{Boqin Zhang}: vdW-DF, DFT-D3, meta-GGA (SCAN) \\
14 | % \item \textbf{Shashikant Kumar}: Testing framework, NLCC \\
15 | % \item \textbf{Mostafa Faghih Shojaei}: SPMS table of pseudopotentials \\
16 | \end{itemize}
17 | \item \textbf{John E. Pask} (co-PI)
18 | % \item \textbf{Edmond Chow} (co-PI)
19 | % \begin{itemize}
20 | % \item \textbf{Hua Huang}: Subspace eigensolver, DP
21 | % \item \textbf{Lucas Erlandson}: Subspace eigensolver, DP
22 | % \end{itemize}
23 | % \item \textbf{Andrew J. Medford} (co-PI)
24 | % \begin{itemize}
25 | % \item \textbf{Benjamin Comer}: Code testing, Initial testing framework
26 | % \item \textbf{Sushree Jagriti Sahoo}: Code testing
27 | % \end{itemize}
28 | \end{itemize}
29 |
30 | \end{frame}
31 |
32 |
33 | \begin{frame}[allowframebreaks]{\textbf{Citation}} \label{Citation}
34 | If you publish work using/regarding SPARC-SQ, please cite the following articles, in addition to SPARC citations:
35 | \begin{itemize}
36 | \item \url{https://doi.org/10.1016/j.cpc.2015.11.005},
37 | \url{https://doi.org/10.1016/j.cplett.2013.08.035},
38 | \url{https://doi.org/10.1007/978-3-031-22340-2_12}
39 | % \item Non-orthogonal systems: \url{https://doi.org/10.1016/j.cplett.2018.04.018}
40 | % \item Linear solvers: \url{https://doi.org/10.1016/j.cpc.2018.07.007}, \url{https://doi.org/10.1016/j.jcp.2015.11.018}
41 | % \item Stress tensor/pressure: \url{https://doi.org/10.1063/1.5057355}
42 | % \item Atomic forces: \url{https://doi.org/10.1016/j.cpc.2016.09.020}, \url{https://doi.org/10.1016/j.cpc.2017.02.019}
43 | % \item Mixing: \url{https://doi.org/10.1016/j.cplett.2016.01.033}, \url{https://doi.org/10.1016/j.cplett.2015.06.029}, \url{https://doi.org/10.1016/j.cplett.2019.136983}
44 | % \item SPMS pseudopotentials: \url{https://doi.org/10.1016/j.cpc.2022.108594}
45 | \end{itemize}
46 | \end{frame}
47 |
48 | \begin{frame}[allowframebreaks]{\textbf{Acknowledgements}} \label{Acknowledgements}
49 | \begin{itemize}
50 | \item \textbf{U.S. Department of Energy (DOE), National Nuclear Security Administration (NNSA): DE-NA0004128
51 | } \\
52 | \end{itemize}
53 | \end{frame}
54 |
55 |
56 | \begin{frame}[allowframebreaks]{\textbf{Comments}} \label{Introduction}
57 | The code will fail with the following options and the related input options are listed.
58 | \begin{itemize}
59 | \item Polarized calculation: \texttt{SPIN\_TYP}.
60 | \item K-point calculation: \texttt{KPOINT\_GRID}, \texttt{KPOINT\_SHIFT}.
61 | \item Dirichlet boundary condition in any direction: \texttt{BC}
62 | \item Define number of states/orbitals: \texttt{NSTATES}
63 | \item Hybrid functionals: \texttt{EXCHANGE\_CORRELATION}
64 | \item Print eigenvalues into file: \texttt{PRINT\_EIGEN}
65 | \end{itemize}
66 |
67 | \end{frame}
68 |
69 | \begin{frame}[allowframebreaks]{\textbf{Input file options}} \label{Index}
70 | \vspace{-2mm}
71 | \begin{block}{Spectral Quadrature}
72 | \hyperlink{SQ_FLAG}{\texttt{SQ\_FLAG}} $\vert$
73 | \hyperlink{SQ_RCUT}{\texttt{SQ\_RCUT}} $\vert$
74 | \hyperlink{SQ_NPL_G}{\texttt{SQ\_NPL\_G}} $\vert$
75 | \hyperlink{SQ_GAUSS_MEM}{\texttt{SQ\_GAUSS\_MEM}} $\vert$
76 | \hyperlink{SQ_TOL_OCC}{\texttt{SQ\_TOL\_OCC}} $\vert$
77 | \hyperlink{NP_DOMAIN_SQ_PARAL}{\texttt{NP\_DOMAIN\_SQ\_PARAL}}
78 | \end{block}
79 |
80 | \end{frame}
81 |
82 |
--------------------------------------------------------------------------------
/tests/sparc-latex-socket-202401/highT/Manual_highT.tex:
--------------------------------------------------------------------------------
1 | \documentclass[xcolor=dvipsnames,t]{beamer}
2 | % \usepackage[utf8]{inputenc}
3 | \usepackage{verbatim} % for comment
4 | \usetheme{Madrid}
5 | \usecolortheme{seahorse}
6 | \usepackage{beamerouterthemesplit}
7 | \usepackage{array}
8 | \usepackage{algorithm}
9 | \usepackage{algpseudocode}
10 | \usepackage[T1]{fontenc}
11 |
12 |
13 | \setbeamerfont{institute}{size=\normalsize}
14 |
15 | \title[] {SPARC - SQ \\ {\normalsize Spectral Quadrature method} \\ {\small User guide}}
16 | %\author{}
17 | %\author{Qimen Xu, Abhiraj Sharma, Phanish Suryanarayana, }
18 |
19 | \institute[]
20 | {
21 | Material Physics \& Mechanics Group, Georgia Tech \\
22 | PI: Phanish Suryanarayana \\
23 | \hyperlink{Contributors}{\texttt{Contributors}} \\
24 | \hyperlink{Citation}{\texttt{Citation}}\\
25 | \hyperlink{Acknowledgments}{\texttt{Acknowledgements}}\\
26 | %Collaborators: J.E. Pask (LLNL), A.J. Medford (GT), E. Chow (GT) \\
27 | %Georgia Institute of Technology
28 | }
29 |
30 | \date{}
31 | \setbeamertemplate{frametitle continuation}{}
32 | \setbeamertemplate{navigation symbols}{}
33 | \setbeamercolor{block title}{bg=Apricot!50,fg=black}
34 | %\addtobeamertemplate{block begin}{\vskip -\smallskipamount}{}
35 | %\addtobeamertemplate{block end}{}{\vskip -\smallskipamount}
36 | \addtobeamertemplate{block begin}{\vspace*{-0.6pt}}{}
37 | \addtobeamertemplate{block end}{}{\vspace*{-0.6pt}}
38 | \hypersetup{colorlinks,
39 | citecolor=violet,
40 | linkcolor=blue,
41 | menucolor=white,
42 | anchorcolor=yellow
43 | filecolor=pink,
44 | }
45 |
46 |
47 | \setbeamertemplate{footline}{
48 | \hbox{%
49 | \begin{beamercolorbox}[wd=\paperwidth,ht=1ex,dp=1.5ex,leftskip=2ex,rightskip=2ex]{page footer}%
50 | \usebeamerfont{title in head/foot}%
51 | \insertshorttitle \hfill
52 | \insertsection \hfill
53 | \insertframenumber{} / \inserttotalframenumber
54 | \end{beamercolorbox}}%
55 | }
56 |
57 | % \setbeamertemplate{headline} [split theme]
58 | % {%
59 | % \begin{beamercolorbox}{section in head/foot}
60 | % \vskip2pt\insertnavigation{\paperwidth}\vskip2pt
61 | % \end{beamercolorbox}%
62 | % }
63 |
64 | % \defbeamertemplate*{footline}{split theme}
65 | % {%
66 | % \leavevmode%
67 | % \hbox{\begin{beamercolorbox}[wd=.5\paperwidth,ht=2.5ex,dp=1.125ex,leftskip=.3cm plus1fill,rightskip=.3cm]{section in head/foot}%
68 | % \usebeamerfont{author in head/foot}\insertshortauthor
69 | % \end{beamercolorbox}%
70 | % \begin{beamercolorbox}[wd=.5\paperwidth,ht=2.5ex,dp=1.125ex,leftskip=.3cm,rightskip=.3cm plus1fil]{title in head/foot}%
71 | % \usebeamerfont{title in head/foot}\insertshorttitle
72 | % \end{beamercolorbox}}%
73 | % \vskip0pt%
74 | % }
75 |
76 |
77 |
78 | \let\otp\titlepage
79 | \renewcommand{\titlepage}{\otp\addtocounter{framenumber}{-1}}
80 |
81 |
82 | \begin{document}
83 |
84 | %\frame{\titlepage}
85 |
86 | \begin{frame}[plain]
87 | \titlepage
88 | \end{frame}
89 |
90 | \include{Introduction}
91 | \include{SQ}
92 |
93 |
94 | \end{document}
95 |
96 |
--------------------------------------------------------------------------------
/tests/test_aimd_parser.py:
--------------------------------------------------------------------------------
1 | import os
2 | from pathlib import Path
3 |
4 | import numpy as np
5 | import pytest
6 | from ase.units import Bohr, Hartree, eV, kB
7 |
8 | curdir = Path(__file__).parent
9 | test_output_dir = curdir / "outputs"
10 |
11 |
12 | def test_aimd_parser():
13 | from sparc.common import repo_dir
14 | from sparc.sparc_parsers.aimd import _read_aimd
15 |
16 | data_dict = _read_aimd(
17 | test_output_dir
18 | / "TiO2_orthogonal_quick_md.sparc"
19 | / "TiO2_orthogonal_quick_md.aimd"
20 | )
21 | assert "aimd" in data_dict
22 | md_steps = data_dict["aimd"]
23 | assert len(md_steps) == 5
24 | for i, step in enumerate(md_steps):
25 | assert i == step.get("step", -1)
26 | for key in [
27 | "positions",
28 | "velocities",
29 | "forces",
30 | "electron temp",
31 | "ion temp",
32 | "total energy per atom",
33 | "kinetic energy per atom",
34 | "kinetic energy (ideal gas) per atom",
35 | "free energy per atom",
36 | "stress",
37 | "pressure",
38 | ]:
39 | assert key in step
40 | assert step["positions"].shape == (6, 3)
41 | assert step["forces"].shape == (6, 3)
42 | assert step["velocities"].shape == (6, 3)
43 | # TODO: may subject to changes
44 | assert step["stress"].shape == (3, 3)
45 |
46 | # A simple test to see if we're using the correct types
47 | T0 = md_steps[0]["electron temp"]
48 | ek_ig0 = md_steps[0]["kinetic energy (ideal gas) per atom"]
49 | assert np.isclose(T0, 800)
50 | assert np.isclose(T0, ek_ig0 * eV / kB / (1.5), 1.0e-2)
51 |
--------------------------------------------------------------------------------
/tests/test_api_version.py:
--------------------------------------------------------------------------------
1 | import os
2 | from pathlib import Path
3 |
4 | import pytest
5 | from packaging import version
6 |
7 | curdir = Path(__file__).parent
8 |
9 |
10 | def test_sparc_api(monkeypatch):
11 | from sparc.api import SparcAPI
12 | from sparc.utils import locate_api
13 |
14 | monkeypatch.delenv("SPARC_DOC_PATH", raising=False)
15 | default_ver = SparcAPI().sparc_version
16 | # No location provided, use default version
17 | assert default_ver == locate_api().sparc_version
18 | # Directly load from another doc.
19 | # Version not detected since src not presented
20 | older_ver = locate_api(doc_path=curdir / "sparc-latex-doc-202302").sparc_version
21 | assert older_ver is None
22 | # Specify SPARC_DOC_PATH
23 | monkeypatch.setenv(
24 | "SPARC_DOC_PATH", (curdir / "sparc-latex-doc-202302").resolve().as_posix()
25 | )
26 | older_version = locate_api().sparc_version
27 | assert older_version is None
28 |
29 |
30 | def test_sparc_params():
31 | if "SPARC_DOC_PATH" not in os.environ:
32 | pytest.skip("No $SPARC_DOC_PATH set. Skip")
33 |
34 | from sparc.utils import locate_api
35 |
36 | # Use the default api with SPARC_DOC_PATH
37 | api = locate_api()
38 | if api.sparc_version is None:
39 | pytest.skip("SPARC version not known. skip")
40 |
41 | if version.parse(api.sparc_version) > version.parse("2023.09.01"):
42 | assert "NPT_SCALE_VECS" in api.parameters
43 | assert "NPT_SCALE_CONSTRAINTS" in api.parameters
44 | assert "TWIST_ANGLE" in api.parameters
45 |
--------------------------------------------------------------------------------
/tests/test_bundle_to_calc.py:
--------------------------------------------------------------------------------
1 | import os
2 | import re
3 | import tempfile
4 | from pathlib import Path
5 |
6 | import numpy as np
7 | import pytest
8 | from ase.units import Hartree
9 |
10 | curdir = Path(__file__).parent
11 | test_psp_dir = curdir / "psps"
12 | test_output_dir = curdir / "outputs"
13 |
14 |
15 | def test_files_glob():
16 | """Only match the re part"""
17 | pattern = r"^\.out(?:_\d+)?$"
18 | assert re.fullmatch(pattern, ".out")
19 | assert re.fullmatch(pattern, ".out_0")
20 | assert re.fullmatch(pattern, ".out_01")
21 | assert re.fullmatch(pattern, ".out_009")
22 | assert re.fullmatch(pattern, ".out_") is None
23 | assert re.fullmatch(pattern, ".out_00_") is None
24 | assert re.fullmatch(pattern, ".out#") is None
25 | assert re.fullmatch(pattern, ".out~") is None
26 | assert re.fullmatch(pattern, ".out_01~") is None
27 |
28 |
29 | def test_bundle_convert():
30 | from sparc.io import SparcBundle
31 |
32 | for bundle in test_output_dir.glob("*.sparc"):
33 | if bundle.name not in ("Al_multi_geopt.sparc",):
34 | sp = SparcBundle(directory=bundle)
35 | sp.convert_to_ase()
36 | else:
37 | sp = SparcBundle(directory=bundle)
38 | sp.convert_to_ase(include_all_files=True)
39 |
40 | return
41 |
42 |
43 | def test_bundle_read():
44 | from sparc.io import read_sparc
45 |
46 | for bundle in test_output_dir.glob("*.sparc"):
47 | if bundle.name not in ("Al_multi_geopt.sparc",):
48 | print(bundle)
49 | images = read_sparc(bundle)
50 | else:
51 | images = read_sparc(bundle, include_all_files=True)
52 | return
53 |
54 |
55 | def test_multi_file_geopt_read():
56 | from sparc.io import read_sparc
57 |
58 | bundle = test_output_dir / "Al_multi_geopt.sparc"
59 |
60 | # Last image is empty, must use include_all_files=True
61 | with pytest.raises(Exception):
62 | images = read_sparc(bundle, include_all_files=False)
63 |
64 | # default
65 | with pytest.raises(Exception):
66 | images = read_sparc(bundle, include_all_files)
67 |
68 | images = read_sparc(bundle, index=":", include_all_files=True)
69 | assert len(images) == 7
70 |
71 | last = read_sparc(bundle, index=-1, include_all_files=True)
72 | assert np.isclose(last.get_potential_energy(), -9.057488887961474 * Hartree, 1e-4)
73 | return
74 |
--------------------------------------------------------------------------------
/tests/test_downloader.py:
--------------------------------------------------------------------------------
1 | import pytest
2 |
3 |
4 | def test_download(fs, monkeypatch):
5 | from sparc import download_data
6 | from sparc.download_data import download_psp
7 |
8 | fs.create_dir("fake")
9 | download_psp(psp_dir="fake")
10 |
--------------------------------------------------------------------------------
/tests/test_geopt_parser.py:
--------------------------------------------------------------------------------
1 | import os
2 | from pathlib import Path
3 |
4 | import numpy as np
5 | import pytest
6 | from ase.units import Bohr, Hartree
7 |
8 | curdir = Path(__file__).parent
9 | test_output_dir = curdir / "outputs"
10 |
11 |
12 | def test_geopt_parser():
13 | from sparc.common import repo_dir
14 | from sparc.sparc_parsers.geopt import _read_geopt
15 |
16 | data_dict = _read_geopt(
17 | test_output_dir
18 | / "AlSi_primitive_quick_relax.sparc"
19 | / "AlSi_primitive_quick_relax.geopt"
20 | )
21 | assert "geopt" in data_dict
22 | geopt_steps = data_dict["geopt"]
23 | for i, step in enumerate(geopt_steps):
24 | assert i == step.get("step", -1)
25 | assert "positions" in step
26 | assert "forces" in step
27 | assert "energy" in step
28 | assert "cell" in step
29 | assert "volume" in step
30 | assert "latvec" in step
31 | assert "stress" in step
32 | assert "ase_cell" in step
33 |
34 | # Value assertions
35 | ase_cell = step["ase_cell"]
36 | vol_ase = np.linalg.det(ase_cell)
37 | assert np.isclose(vol_ase, step["volume"])
38 |
39 | max_final_f = np.max(np.abs(step["forces"]))
40 | assert max_final_f < 1.0e-3 * Hartree / Bohr
41 |
42 |
43 | def test_geopt_parser_relax2():
44 | from sparc.common import repo_dir
45 | from sparc.sparc_parsers.geopt import _read_geopt
46 |
47 | data_dict = _read_geopt(
48 | test_output_dir / "Si8_cell_geopt_relax2.sparc" / "Si8_cell_geopt.geopt"
49 | )
50 | geopt_steps = data_dict["geopt"]
51 | for i, step in enumerate(geopt_steps):
52 | assert i == step.get("step", -1)
53 | # RELAX=2 no position information
54 | assert "positions" not in step
55 | assert "stress" in step
56 | assert "cell" in step
57 | assert "latvec" in step
58 |
59 |
60 | def test_geopt_low_dim_stress():
61 | from sparc.sparc_parsers.geopt import _read_geopt
62 |
63 | data_dict = _read_geopt(
64 | test_output_dir / "Alloy_geopt_ppd_bc.sparc" / "SPARC.geopt"
65 | )
66 | geopt_steps = data_dict["geopt"]
67 | for i, step in enumerate(geopt_steps):
68 | assert i == step.get("step", -1)
69 | assert "stress_2d" in step
70 | assert "stress" not in step
71 | assert "cell" in step
72 |
--------------------------------------------------------------------------------
/tests/test_gui.py:
--------------------------------------------------------------------------------
1 | import os
2 | from pathlib import Path
3 | from subprocess import run
4 |
5 | import numpy as np
6 | import pytest
7 | from ase.units import Bohr, Hartree, eV, kB
8 |
9 | curdir = Path(__file__).parent
10 | test_output_dir = curdir / "outputs"
11 |
12 |
13 | def test_cli():
14 | """Simply call the sparc-ase methods"""
15 | proc = run(["sparc-ase"])
16 | assert proc.returncode == 0
17 |
18 |
19 | def test_info():
20 | """Call the sparc-ase info on sparc file. Be aware of the API changes in 3.22->3.23"""
21 | import ase
22 | from packaging import version
23 |
24 | bundle = test_output_dir / "Cu_FCC.sparc"
25 | if version.parse(ase.__version__) < version.parse("3.23"):
26 | proc = run(["sparc-ase", "info", f"{bundle}"], capture_output=True)
27 | else:
28 | proc = run(["sparc-ase", "info", "--files", f"{bundle}"], capture_output=True)
29 | assert proc.returncode == 0
30 | assert "SPARC" in proc.stdout.decode("utf8")
31 |
32 |
33 | def test_gui_single():
34 | """Call the sparc-ase gui on a static calculation"""
35 | bundle = test_output_dir / "Cu_FCC.sparc"
36 | proc = run(["sparc-ase", "gui", "-t", f"{bundle}"], capture_output=True)
37 | assert proc.returncode == 0
38 |
39 |
40 | def test_gui_geopt():
41 | """Call the sparc-ase info on a geopt calculation"""
42 | bundle = test_output_dir / "AlSi_primitive_quick_relax.sparc"
43 | proc = run(["sparc-ase", "gui", "-t", f"{bundle}"], capture_output=True)
44 | assert proc.returncode == 0
45 |
46 |
47 | def test_gui_md():
48 | """Call the sparc-ase info on an AIMD calculation"""
49 | bundle = test_output_dir / "TiO2_orthogonal_quick_md.sparc"
50 | proc = run(["sparc-ase", "gui", "-t", f"{bundle}"], capture_output=True)
51 | assert proc.returncode == 0
52 |
--------------------------------------------------------------------------------
/tests/test_import.py:
--------------------------------------------------------------------------------
1 | """Unit test for order of importing.
2 | Submodules like `docparser` `api` and `download_data` should be independent of ase / numpy,
3 | should such modules are not yet available during processes like conda-forge build
4 | """
5 | import sys
6 |
7 | import ase
8 | import pytest
9 |
10 |
11 | def test_download_data(monkeypatch):
12 | monkeypatch.setitem(sys.modules, "ase", None)
13 | with pytest.raises(ImportError):
14 | import ase
15 | from sparc.download_data import download_psp
16 |
17 |
18 | def test_api(monkeypatch):
19 | monkeypatch.setitem(sys.modules, "ase", None)
20 | with pytest.raises(ImportError):
21 | import ase
22 | from sparc.api import SparcAPI
23 |
24 |
25 | def test_docparser(monkeypatch):
26 | monkeypatch.setitem(sys.modules, "ase", None)
27 | with pytest.raises(ImportError):
28 | import ase
29 | from sparc.docparser import SparcDocParser
30 |
--------------------------------------------------------------------------------
/tests/test_quicktest.py:
--------------------------------------------------------------------------------
1 | import os
2 | from pathlib import Path
3 |
4 | import pytest
5 |
6 |
7 | def test_run_quicktest():
8 | """Just import and run quicktest"""
9 | from sparc.quicktest import main
10 |
11 | main()
12 |
--------------------------------------------------------------------------------
/tests/test_read_sparc.py:
--------------------------------------------------------------------------------
1 | import os
2 | from pathlib import Path
3 |
4 | import numpy as np
5 | import pytest
6 |
7 | curdir = Path(__file__).parent
8 | test_output_dir = curdir / "outputs"
9 |
10 |
11 | def test_read_sparc_all():
12 | from sparc.common import repo_dir
13 | from sparc.io import read_sparc
14 |
15 | for bundle in test_output_dir.glob("*.sparc/"):
16 | if bundle.name not in ("Al_multi_geopt.sparc",):
17 | results = read_sparc(bundle)
18 | else:
19 | results = read_sparc(bundle, include_all_files=True)
20 |
21 |
22 | def test_atoms_read_pbc():
23 | from sparc.io import read_sparc
24 | from sparc.sparc_parsers.atoms import atoms_to_dict
25 |
26 | # Case 1: H2O sheet
27 | water_sheet = read_sparc(test_output_dir / "H2O_sheet_yz.sparc")
28 | assert all(water_sheet.pbc == [False, True, True])
29 |
30 | # Case 2: H2O wire
31 | water_wire = read_sparc(test_output_dir / "H2O_wire_z.sparc")
32 | assert all(water_wire.pbc == [False, False, True])
33 |
--------------------------------------------------------------------------------