-
Notifications
You must be signed in to change notification settings - Fork 3
Feature/GitHub actions ci #21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
6168bce
a4fe215
0f0c71f
95d8ccc
f596e48
cec7369
459ac49
af2e9da
5ccffd4
98f3f18
9190891
012d3ed
1caa309
9daf926
56d33bf
22e8da5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,106 @@ | ||
| name: CI Python 3.9+ | ||
|
|
||
| on: | ||
| push: | ||
| branches: [ main, develop ] | ||
| pull_request: | ||
| branches: [ main, develop ] | ||
|
|
||
| jobs: | ||
| test: | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| matrix: | ||
| python-version: ["3.9", "3.10", "3.11", "3.12"] | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Python ${{ matrix.python-version }} | ||
| uses: actions/setup-python@v4 | ||
| with: | ||
| python-version: ${{ matrix.python-version }} | ||
|
|
||
| - name: Verify Python version | ||
| run: | | ||
| python --version | ||
| python -c "import sys; assert sys.version_info >= (3, 9), f'Python 3.9+ required, got {sys.version}'" | ||
|
|
||
| - name: Install Poetry | ||
| uses: snok/install-poetry@v1 | ||
| with: | ||
| version: latest | ||
| virtualenvs-create: true | ||
| virtualenvs-in-project: true | ||
|
|
||
| - name: Load cached venv | ||
| id: cached-poetry-dependencies | ||
| uses: actions/cache@v3 | ||
| with: | ||
| path: .venv | ||
| key: venv-v3-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('**/poetry.lock') }} | ||
|
|
||
| - name: Install dependencies | ||
| if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' | ||
| run: poetry install --no-interaction --no-root | ||
|
|
||
| - name: Install project and dependencies | ||
| run: poetry install --no-interaction --with dev | ||
|
|
||
| - name: Verify installation | ||
| run: | | ||
| poetry run python -c "import numpy; print('numpy version:', numpy.__version__)" | ||
| poetry run python -c "import scipy; print('scipy version:', scipy.__version__)" | ||
| poetry run python -c "import hwave; print('hwave imported successfully')" | ||
|
|
||
| - name: Run tests with unittest | ||
| run: | | ||
| poetry run python -m unittest discover tests/ -v | ||
|
|
||
| - name: Run tests with pytest and coverage | ||
| run: | | ||
| poetry add pytest pytest-cov coverage | ||
| poetry run pytest tests/ -v --cov=src/hwave --cov-report=term-missing --cov-report=xml | ||
| continue-on-error: true | ||
|
|
||
| - name: Upload coverage to Codecov | ||
| uses: codecov/codecov-action@v3 | ||
| with: | ||
| file: ./coverage.xml | ||
| flags: unittests | ||
| name: codecov-umbrella | ||
| fail_ci_if_error: false | ||
|
|
||
| lint: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Python | ||
| uses: actions/setup-python@v4 | ||
| with: | ||
| python-version: "3.11" | ||
|
|
||
| - name: Install Poetry | ||
| uses: snok/install-poetry@v1 | ||
| with: | ||
| version: latest | ||
| virtualenvs-create: true | ||
| virtualenvs-in-project: true | ||
|
|
||
| - name: Install dependencies | ||
| run: poetry install --no-interaction --with dev | ||
|
|
||
| - name: Run flake8 | ||
| run: poetry run flake8 src/ tests/ --count --select=E9,F63,F7,F82 --show-source --statistics | ||
|
|
||
| - name: Run black format | ||
| run: poetry run black src/ tests/ | ||
|
|
||
| - name: Run isort format | ||
| run: poetry run isort src/ tests/ | ||
|
|
||
| - name: Run mypy | ||
| run: poetry run mypy src/ --ignore-missing-imports | ||
| continue-on-error: true |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,39 +1,168 @@ | ||||||
| # H-wave | ||||||
|
|
||||||
| H-wave is a program for performing unrestricted Hartree-Fock (UHF) approximation and random phase approximation (RPA) for itinerant electron systems. UHF and RPA correspond to simple approximations that deal with fluctuations up to first order and enable analyses of electron correlation effects in materials at a low computational cost. The input files describing the one-body and two-body interactions are based on the Wannier90 format[1]. This allows smooth connection for the software packages that derive the effective models from first principles calculations, such as RESPACK[2], to the analyses of the effective model with H-wave. | ||||||
| <div align="center"> | ||||||
| <img src="docs/figs/Hwave_logo.png" alt="H-wave Logo" width="200"> | ||||||
| </div> | ||||||
|
|
||||||
| [1] G. Pizzi et al, J. Phys.: Condens. Matter 32 165902 (2020). | ||||||
| [](https://github.com/issp-center-dev/H-wave/actions) | ||||||
| [](https://www.python.org/downloads/) | ||||||
| [](https://www.gnu.org/licenses/gpl-3.0) | ||||||
|
|
||||||
| H-wave is a Python package for performing unrestricted Hartree-Fock (UHF) approximation and random phase approximation (RPA) for itinerant electron systems. UHF and RPA correspond to simple approximations that deal with fluctuations up to first order and enable analyses of electron correlation effects in materials at a low computational cost. The input files describing the one-body and two-body interactions are based on the Wannier90 format[1]. This allows smooth connection for the software packages that derive the effective models from first principles calculations, such as RESPACK[2], to the analyses of the effective model with H-wave. | ||||||
|
|
||||||
| [1] G. Pizzi et al, J. Phys.: Condens. Matter 32 165902 (2020). | ||||||
| [2] K. Nakmura, Y. Yoshimoto, Y. Nomura et al., Comp. Phys. Commun. 261, 107781 (2021). | ||||||
|
|
||||||
| ## Features | ||||||
|
|
||||||
| - **Unrestricted Hartree-Fock (UHF) approximation** for itinerant electron systems | ||||||
| - **Random Phase Approximation (RPA)** for correlation effects analysis | ||||||
| - **Support for various interaction types**: Coulomb intra/inter, Exchange, Hund, Ising, PairHop, PairLift | ||||||
| - **Wannier90 format compatibility** for seamless integration with first-principles calculations | ||||||
| - **Comprehensive test suite** with automated CI/CD pipeline | ||||||
| - **Multi-orbital Hubbard model support** | ||||||
|
|
||||||
| ## Methods | ||||||
|
|
||||||
| Hartree-Fock and Random Phase approximation | ||||||
| - **Hartree-Fock approximation**: Ground state energy calculation | ||||||
| - **Random Phase approximation**: Susceptibility and correlation analysis | ||||||
|
|
||||||
| ## Target Models | ||||||
|
|
||||||
| - Hubbard model | ||||||
| - Multi-orbital Hubbard model | ||||||
| - Extended Hubbard models with various interaction types | ||||||
|
|
||||||
| ## Available Physical Quantities | ||||||
|
|
||||||
| - Ground-state energy | ||||||
| - Free energy | ||||||
| - Charge and spin susceptibilities | ||||||
| - Green's functions | ||||||
| - Eigenvalues and eigenvectors | ||||||
|
|
||||||
| ## Requirements | ||||||
|
|
||||||
| - Python 3.9 or higher | ||||||
| - NumPy (^1.14) | ||||||
| - SciPy (^1.7) | ||||||
| - Requests (^2.28.1) | ||||||
| - Tomli (^2.0.1) | ||||||
|
|
||||||
| ## Installation | ||||||
|
|
||||||
| ### From PyPI (Recommended) | ||||||
|
|
||||||
| ```bash | ||||||
| pip install hwave | ||||||
| ``` | ||||||
|
|
||||||
| ### From Source | ||||||
|
|
||||||
| For development or if you need to modify the program: | ||||||
|
|
||||||
| ```bash | ||||||
| git clone https://github.com/issp-center-dev/H-wave.git | ||||||
| cd H-wave | ||||||
| pip install -e . | ||||||
| ``` | ||||||
|
|
||||||
| ### Using Poetry (Development) | ||||||
|
|
||||||
| ```bash | ||||||
| git clone https://github.com/issp-center-dev/H-wave.git | ||||||
| cd H-wave | ||||||
| poetry install | ||||||
| ``` | ||||||
|
|
||||||
| ## Quick Start | ||||||
|
|
||||||
| ### Basic Usage | ||||||
|
|
||||||
| ```python | ||||||
| import hwave.qlms | ||||||
|
|
||||||
| # Run UHF calculation | ||||||
| hwave.qlms.run(input_dict=params) | ||||||
| ``` | ||||||
|
|
||||||
| ### Command Line Interface | ||||||
|
|
||||||
| ## Target models | ||||||
| ```bash | ||||||
| # Run UHF calculation | ||||||
| hwave input.toml | ||||||
|
|
||||||
| Hubbard model, multi-orbital Hubbard model | ||||||
| # Calculate DOS | ||||||
| hwave_dos input.toml | ||||||
| ``` | ||||||
|
|
||||||
| ## Available physical quantities | ||||||
| ## Testing | ||||||
|
|
||||||
| ground-state energy, free energy, charge and spin susceptibilities, etc. | ||||||
| The project includes a comprehensive test suite that covers: | ||||||
|
|
||||||
| ## Requirement | ||||||
| - **UHF calculations** (UHFr and UHFk solvers) | ||||||
| - **RPA calculations** with various interaction types | ||||||
| - **Multi-orbital systems** | ||||||
| - **Spin-orbital coupling** | ||||||
|
|
||||||
| Python3 with numpy, scipy, and other library packages | ||||||
| ### Running Tests | ||||||
|
|
||||||
| ## Install | ||||||
| ```bash | ||||||
| # Run all tests | ||||||
| python -m unittest discover tests/ -v | ||||||
|
|
||||||
| - From PyPI | ||||||
| # Run specific test modules | ||||||
| python -m unittest tests.test_uhf -v | ||||||
| python -m unittest tests.test_rpa_1orb -v | ||||||
|
|
||||||
| ``` bash | ||||||
| python3 -m pip install hwave | ||||||
| # Using pytest (if installed) | ||||||
| pytest tests/ -v | ||||||
| ``` | ||||||
|
|
||||||
| - From source (if you modify the program) | ||||||
| ### Continuous Integration | ||||||
|
|
||||||
| The project uses GitHub Actions for automated testing: | ||||||
|
|
||||||
| - **Multi-version testing**: Python 3.9, 3.10, 3.11, 3.12 | ||||||
| - **Code quality checks**: flake8, black, isort, mypy | ||||||
| - **Automated testing**: Runs on every push and pull request to main/develop branches | ||||||
|
|
||||||
| ## Documentation | ||||||
|
|
||||||
| - [User Manual](https://www.pasums.issp.u-tokyo.ac.jp/h-wave/en/doc/manual) | ||||||
| - [API Documentation](https://www.pasums.issp.u-tokyo.ac.jp/h-wave/en/doc/manual) | ||||||
| - [Tutorial Examples](https://github.com/issp-center-dev/H-wave/tree/main/docs/tutorial) | ||||||
|
|
||||||
| ## Contributing | ||||||
|
|
||||||
| We welcome contributions! Please see our [Contributing Guidelines](CONTRIBUTING.md) for details. | ||||||
|
||||||
| We welcome contributions! Please see our [Contributing Guidelines](CONTRIBUTING.md) for details. | |
| We welcome contributions! Please see our Contributing Guidelines for details. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] The version constraints use caret notation (^) which is Poetry-specific syntax. For general documentation clarity, consider using standard version notation like '>=1.14' or specifying that these are Poetry version constraints.