Contributing to LeeQ¶
Thank you for your interest in contributing to LeeQ! This document provides guidelines and instructions for contributing to the project.
Getting Started¶
Development Setup¶
- Fork the repository on GitHub
-
Clone your fork locally:
git clone https://github.com/your-username/LeeQ.git cd LeeQ -
Create a virtual environment:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate -
Install in development mode:
pip install -e . pip install -r requirements-dev.txt
Development Workflow¶
Creating a Feature Branch¶
git checkout -b feature/your-feature-name
Making Changes¶
- Write your code following the project style guide
- Add tests for new functionality
- Update documentation as needed
- Run tests locally before committing
Testing Your Changes¶
# Run all tests
pytest
# Run specific test file
pytest tests/path/to/test_file.py
# Run with coverage
pytest --cov=leeq
Code Style¶
We use the following tools to maintain code quality:
- flake8 for linting
- black for formatting (optional)
- mypy for type checking (where applicable)
Run linting checks:
bash ./ci_scripts/lint.sh
Submitting Changes¶
Commit Messages¶
Follow conventional commit format:
- feat: New feature
- fix: Bug fix
- docs: Documentation changes
- test: Test additions or changes
- refactor: Code refactoring
- style: Code style changes
Example:
git commit -m "feat: add new calibration experiment for XY gate"
Pull Request Process¶
- Push your branch to your fork
- Create a pull request against the main repository
- Fill out the PR template with:
- Description of changes
- Related issues
- Testing performed
- Wait for review and address feedback
Code Guidelines¶
Python Style¶
- Follow PEP 8
- Use descriptive variable names
- Add type hints where beneficial
- Document all public functions with numpy-style docstrings
Documentation¶
- Update relevant documentation for any API changes
- Add docstrings to new classes and functions
- Include usage examples where appropriate
Testing¶
- Write unit tests for new functionality
- Ensure all tests pass before submitting PR
- Aim for good test coverage
- Include integration tests for complex features
Project Structure¶
leeq/
├── core/ # Core functionality
├── experiments/ # Experiment implementations
├── theory/ # Theoretical simulations
├── compiler/ # Hardware compilation
├── setups/ # Hardware setups
└── utils/ # Utility functions
tests/
├── unit/ # Unit tests
└── integration/ # Integration tests
docs/ # Documentation source
Getting Help¶
- Open an issue for bugs or feature requests
- Join discussions in existing issues
- Reach out to maintainers for guidance
License¶
By contributing, you agree that your contributions will be licensed under the project's MIT License.