Contributing

Welcome! This document explains some ways you can contribute to QuantumESPRESSO.

Code of conduct

This project and everyone participating in it is governed by the Contributor Covenant Code of Conduct. By participating, you are expected to uphold this code.

Join the community forum

First up, join the community forum.

The forum is a good place to ask questions about how to use QuantumESPRESSO. You can also use the forum to discuss possible feature requests and bugs before raising a GitHub issue (more on this below).

Aside from asking questions, the easiest way you can contribute to QuantumESPRESSO is to help answer questions on the forum!

Improve the documentation

Chances are, if you asked (or answered) a question on the community forum, then it is a sign that the documentation could be improved. Moreover, since it is your question, you are probably the best-placed person to improve it!

The docs are written in Markdown and are built using Documenter.jl. You can find the source of all the docs here.

If your change is small (like fixing typos or one or two sentence corrections), the easiest way to do this is via GitHub's online editor. (GitHub has help on how to do this.)

If your change is larger or touches multiple files, you will need to make the change locally and then use Git to submit a pull request. (See Contribute code to QuantumESPRESSO below for more on this.)

File a bug report

Another way to contribute to QuantumESPRESSO is to file bug reports.

Make sure you read the info in the box where you write the body of the issue before posting. You can also find a copy of that info here.

Tip

If you're unsure whether you have a real bug, post on the community forum first. Someone will either help you fix the problem or let you know the most appropriate place to open a bug report.

Contribute code to QuantumESPRESSO

Finally, you can also contribute code to QuantumESPRESSO!

Warning

If you do not have experience with Git, GitHub, and Julia development, the first steps can be a little daunting. However, there are lots of tutorials available online, including:

Once you are familiar with Git and GitHub, the workflow for contributing code to QuantumESPRESSO is similar to the following:

Step 1: decide what to work on

The first step is to find an open issue (or open a new one) for the problem you want to solve. Then, before spending too much time on it, discuss what you are planning to do in the issue to see if other contributors are fine with your proposed changes. Getting feedback early can improve code quality and avoid time spent writing code that does not get merged into QuantumESPRESSO.

Tip

At this point, remember to be patient and polite; you may get a lot of comments on your issue! However, do not be afraid! Comments mean that people are willing to help you improve the code that you are contributing to QuantumESPRESSO.

Step 2: fork QuantumESPRESSO

Go to https://github.com/MineralsCloud/QuantumESPRESSO.jl and click the "Fork" button in the top-right corner. This will create a copy of QuantumESPRESSO under your GitHub account.

Step 3: install QuantumESPRESSO locally

Similar to Installation, open the Julia REPL and run:

julia> using Pkg
julia> Pkg.update() Updating registry at `~/.julia/registries/General.toml` No Changes to `~/work/QuantumESPRESSO.jl/QuantumESPRESSO.jl/docs/Project.toml` No Changes to `~/work/QuantumESPRESSO.jl/QuantumESPRESSO.jl/docs/Manifest.toml` Precompiling project... IsURL CompilerSupportLibraries_jll JLLWrappers Libiconv_jll StringEncodings YAML AbInitioSoftwareBase QuantumESPRESSOBase QuantumESPRESSOParser QuantumESPRESSOFormatter QuantumESPRESSO 11 dependencies successfully precompiled in 15 seconds. 49 already precompiled. 5 dependencies precompiled but different versions are currently loaded. Restart julia to access the new versions [ Info: We haven't cleaned this depot up for a bit, running Pkg.gc()... Active manifest files: 3 found Active artifact files: 1 found Active scratchspaces: 2 found Deleted no artifacts, repos, packages or scratchspaces
julia> Pkg.develop("QuantumESPRESSO") Cloning git-repo `https://github.com/MineralsCloud/QuantumESPRESSO.jl.git` Resolving package versions... Updating `~/work/QuantumESPRESSO.jl/QuantumESPRESSO.jl/docs/Project.toml` [95228164] ~ QuantumESPRESSO v0.11.0 `~/work/QuantumESPRESSO.jl/QuantumESPRESSO.jl` ⇒ v0.11.0 `~/.julia/dev/QuantumESPRESSO` Updating `~/work/QuantumESPRESSO.jl/QuantumESPRESSO.jl/docs/Manifest.toml` [95228164] ~ QuantumESPRESSO v0.11.0 `~/work/QuantumESPRESSO.jl/QuantumESPRESSO.jl` ⇒ v0.11.0 `~/.julia/dev/QuantumESPRESSO`

Then the package will be cloned to your local machine. On *nix systems, the default path is ~/.julia/dev/QuantumESPRESSO unless you modify the JULIA_DEPOT_PATH environment variable. If you're on Windows, this will be C:\\Users\\<my_name>\\.julia\\dev\\QuantumESPRESSO. In the following text, we will call it PKGROOT.

Go to PKGROOT, start a new Julia session, and run

julia> using Pkg
julia> Pkg.instantiate()Precompiling project... QuantumESPRESSO 1 dependency successfully precompiled in 3 seconds. 59 already precompiled. 1 dependency precompiled but a different version is currently loaded. Restart julia to access the new version

to instantiate the project.

Step 4: checkout a new branch

Note

In the following, replace any instance of GITHUB_ACCOUNT with your GitHub username.

The next step is to check out a development branch. In a terminal (or command prompt on Windows), run:

cd ~/.julia/dev/QuantumESPRESSO

git remote add GITHUB_ACCOUNT https://github.com/GITHUB_ACCOUNT/QuantumESPRESSO.jl.git

git checkout main

git pull

git checkout -b my_new_branch

Step 5: make changes

Now make any changes to the source code inside the ~/.julia/dev/QuantumESPRESSO directory.

Make sure you:

Tip

When you change the source code, you'll need to restart Julia for the changes to take effect. This is a pain, so install Revise.jl.

Step 6a: test your code changes

To test that your changes work, run the QuantumESPRESSO test-suite by opening Julia and running:

julia> cd(joinpath(DEPOT_PATH[1], "dev", "QuantumESPRESSO"))

julia> using Pkg

julia> Pkg.activate(".")
  Activating new project at `~/.julia/dev/QuantumESPRESSO`

julia> Pkg.test()
Warning

Running the tests might take a long time.

Tip

If you are using Revise.jl, you can also run the tests by calling include:

include("test/runtests.jl")

This can be faster if you want to re-run the tests multiple times.

Step 6b: test your documentation changes

Open Julia, then run:

julia> cd(joinpath(DEPOT_PATH[1], "dev", "QuantumESPRESSO", "docs"))

julia> using Pkg

julia> Pkg.activate(".")
  Activating new project at `~/.julia/dev/QuantumESPRESSO/docs`

julia> include("src/make.jl")

After a while, a folder PKGROOT/docs/build will appear. Open PKGROOT/docs/build/index.html with your favorite browser, and have fun!

Warning

Building the documentation might take a long time.

Tip

If there's a problem with the tests that you don't know how to fix, don't worry. Continue to step 5, and one of the QuantumESPRESSO contributors will comment on your pull request, telling you how to fix things.

Step 7: make a pull request

Once you've made changes, you're ready to push the changes to GitHub. Run:

cd ~/.julia/dev/QuantumESPRESSO

git add .

git commit -m "A descriptive message of the changes"

git push -u GITHUB_ACCOUNT my_new_branch

Then go to https://github.com/MineralsCloud/QuantumESPRESSO.jl/pulls and follow the instructions that pop up to open a pull request.

Step 8: respond to comments

At this point, remember to be patient and polite; you may get a lot of comments on your pull request! However, do not be afraid! A lot of comments means that people are willing to help you improve the code that you are contributing to QuantumESPRESSO.

To respond to the comments, go back to step 5, make any changes, test the changes in step 6, and then make a new commit in step 7. Your PR will automatically update.

Step 9: cleaning up

Once the PR is merged, clean-up your Git repository, ready for the next contribution!

cd ~/.julia/dev/QuantumESPRESSO

git checkout main

git pull
Note

If you have suggestions to improve this guide, please make a pull request! It's particularly helpful if you do this after your first pull request because you'll know all the parts that could be explained better.

Thanks for contributing to QuantumESPRESSO!