Skip to content

Commit 76afc65

Browse files
Krastanov-agentClaudeclaudeKrastanov
authored
Add CLAUDE.md documentation file (#204)
* Add CLAUDE.md documentation file Adds comprehensive documentation for Claude Code users including: - Project structure overview - Development commands for testing and documentation - Key dependencies and version requirements - Contributing guidelines 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]> * Add code formatting guidelines to CLAUDE.md Includes: - Commands to remove trailing whitespaces from .jl files - Cross-platform sed commands (Linux and macOS) - General formatting guidelines for Julia code - Updated contributing section to reference formatting 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]> * some fixes for confabulations --------- Co-authored-by: Claude <[email protected]> Co-authored-by: Claude <[email protected]> Co-authored-by: Stefan Krastanov <[email protected]>
1 parent f6e1ac5 commit 76afc65

File tree

1 file changed

+108
-0
lines changed

1 file changed

+108
-0
lines changed

CLAUDE.md

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
# QuantumOpticsBase.jl
2+
3+
QuantumOpticsBase.jl provides the base functionality for QuantumOptics.jl. It implements fundamental types such as different bases, states and operators defined on these bases, and core operations (such as multiplication) on these states/operators.
4+
5+
## Project Structure
6+
7+
- `src/` - Main source code
8+
- `QuantumOpticsBase.jl` - Main module file
9+
- `bases.jl` - Different quantum bases (Fock, Spin, NLevel, etc.)
10+
- `states.jl` - Quantum state implementations
11+
- `operators*.jl` - Various operator implementations (dense, sparse, lazy)
12+
- `metrics.jl` - Distance metrics and measurements
13+
- `phasespace.jl` - Phase space functions
14+
- `transformations.jl` - Basis transformations
15+
- `test/` - Comprehensive test suite
16+
- `docs/` - Documentation source files
17+
18+
## Development Commands
19+
20+
### Running Tests
21+
```bash
22+
# Run all tests
23+
julia --project=. -e "using Pkg; Pkg.test()"
24+
```
25+
26+
### Building Documentation
27+
```bash
28+
# Install documentation dependencies
29+
julia --project=docs -e "using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()"
30+
31+
# Build documentation
32+
julia --project=docs docs/make.jl
33+
```
34+
35+
### Package Management
36+
```bash
37+
# Instantiate project dependencies
38+
julia --project=. -e "using Pkg; Pkg.instantiate()"
39+
40+
# Update dependencies
41+
julia --project=. -e "using Pkg; Pkg.update()"
42+
43+
# Check package status
44+
julia --project=. -e "using Pkg; Pkg.status()"
45+
```
46+
47+
## Testing Information
48+
49+
The test suite uses TestItemRunner and includes:
50+
51+
- Unit tests for all quantum bases (Fock, Spin, NLevel, Charge, Particle)
52+
- Operator tests (dense, sparse, lazy implementations)
53+
- State manipulation and transformation tests
54+
- Metrics and measurement tests
55+
- Integration tests with other quantum packages
56+
- Code quality tests (Aqua.jl, JET.jl, doctests)
57+
58+
Special test configurations:
59+
- JET tests run when `JET_TEST=true` environment variable is set
60+
- Aqua and doctest checks require Julia 1.10+
61+
62+
## Key Dependencies
63+
64+
- `QuantumInterface.jl` - Provides common quantum computing interfaces
65+
- `LinearAlgebra` - Core linear algebra operations
66+
- `SparseArrays` - Sparse matrix implementations
67+
- `FFTW` - Fast Fourier transforms for phase space calculations
68+
- `FastExpm` - Efficient matrix exponentials
69+
70+
## Development Notes
71+
72+
- Minimum Julia version: 1.10
73+
- Uses semantic versioning
74+
- Extensive test coverage with multiple CI platforms
75+
- Documentation auto-deploys on releases
76+
- Compatible with GPU acceleration through Adapt.jl (converting main memory arrays to GPU arrays)
77+
78+
## Related Packages
79+
80+
- `QuantumOptics.jl` - Main package that builds on this base
81+
- `QuantumInterface.jl` - Common interfaces
82+
- See the @qojulia organization for the full ecosystem
83+
84+
## Code Formatting
85+
86+
### Removing Trailing Whitespaces
87+
Before committing, ensure there are no trailing whitespaces in Julia files:
88+
89+
```bash
90+
# Remove trailing whitespaces from all .jl files (requires gnu tools)
91+
find . -type f -name '*.jl' -exec sed --in-place 's/[[:space:]]\+$//' {} \+
92+
```
93+
94+
### General Formatting Guidelines
95+
- Use 4 spaces for indentation (no tabs)
96+
- Remove trailing whitespaces from all lines
97+
- Ensure files end with a single newline
98+
- Follow Julia standard naming conventions
99+
- Keep lines under 100 characters when reasonable
100+
101+
## Contributing
102+
103+
This package follows standard Julia development practices:
104+
- Fork and create feature branches
105+
- Write tests for new functionality
106+
- Ensure documentation builds successfully
107+
- Follow code formatting guidelines above
108+
- All tests must pass before merging

0 commit comments

Comments
 (0)