We'd love to accept your patches and contributions to this project. We do have some guidelines to follow, covered in this document, but don't be concerned about getting everything right the first time! Create a pull request (discussed below) and we'll nudge you in the right direction.
Contributions to this project must be accompanied by a Contributor License Agreement (CLA). You (or your employer) retain the copyright to your contribution; the CLA simply gives us permission to use and redistribute your contributions as part of the project. Please visit https://cla.developers.google.com/ to see your current agreements on file or to sign a new one. You generally only need to submit a Google CLA once, so if you've already submitted one (even if it was for a different project), you probably don't need to do it again.
Warning
Please note carefully clauses #5 and #7 in the CLA. Any code that you contribute to this project must be your original creation. Code generated by artificial intelligence tools does not qualify as your original creation.
We have a code of conduct to make the Stim project an open and welcoming community environment. Please make sure to read and abide by the code of conduct.
All submissions, including submissions by project members, require review. We use the tools provided by GitHub for pull requests for this purpose. The preferred manner for submitting pull requests is to fork the Stim repository, create a git branch in this fork to do your work, and when ready, create a pull request from this branch to the main Stim repository.
-
Fork the Stim repository (you can use the Fork button in upper right corner of the repository page). Forking creates a new GitHub repo at the location
https://github.com/USERNAME/Stim, whereUSERNAMEis your GitHub user name. -
Clone (using
git clone) or otherwise download your forked repository to your local computer, so that you have a local copy where you can do your development work using your preferred editor and development tools. -
Check out the
mainbranch and create a new git branch frommain:git checkout main -b YOUR_BRANCH_NAME
where
YOUR_BRANCH_NAMEis the name of your new branch.
Please follow the detailed instructions in
doc/developer_documentation.md for
developing and testing Stim.
-
If your local copy has drifted out of sync with the
mainbranch of the main Stim repository, you may need to merge the latest changes into your branch. To do this, first update your localmainand then merge your localmaininto your branch:# Track the upstream repo (if your local repo hasn't): git remote add upstream https://github.com/quantumlib/Stim.git # Update your local main. git fetch upstream git checkout main git merge upstream/main # Merge local main into your branch. git checkout YOUR_BRANCH_NAME git merge main
If git reports conflicts during one or both of these merge processes, you may need to resolve the merge conflicts before continuing.
-
Finally, push your changes to your fork of the Stim repo on GitHub:
git push origin YOUR_BRANCH_NAME
-
Now when you navigate to the Stim repository on GitHub (https://github.com/quantumlib/Stim), you should see the option to create a new pull request from your forked repository. Alternatively, you can create the pull request by navigating to the "Pull requests" tab near the top of the page, and selecting the appropriate branches.
-
A reviewer from the Stim team will comment on your code and may ask for changes. You can perform the necessary changes locally, commit them to your branch as usual, and then push changes to your fork on GitHub following the same process as above. When you do that, GitHub will update the code in the pull request automatically.