|
| 1 | +# CLAUDE.md |
| 2 | + |
| 3 | +This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. |
| 4 | + |
| 5 | +## Commands |
| 6 | + |
| 7 | +### Testing and Development |
| 8 | +- `make test` - Run the complete test suite in a subprocess with coverage |
| 9 | +- `julia --project=test --banner=no --startup-file=yes -e 'include("devrepl.jl"); test()'` - Run tests directly |
| 10 | +- `include("test/runtests.jl")` - Run tests from within Julia REPL |
| 11 | + |
| 12 | +### Code Quality and Formatting |
| 13 | +- `make codestyle` - Apply JuliaFormatter to the entire project |
| 14 | + |
| 15 | +### Documentation |
| 16 | +- `make docs` - Build the documentation using Documenter.jl |
| 17 | +- `include("docs/make.jl")` - Build docs from within Julia REPL |
| 18 | + |
| 19 | +### Maintenance |
| 20 | +- `make clean` - Clean up build/doc/testing artifacts |
| 21 | +- `make distclean` - Restore to a clean checkout state |
| 22 | + |
| 23 | +## Package Architecture |
| 24 | + |
| 25 | +### Core Framework Structure |
| 26 | +QuantumControl.jl is a high-level interface package that provides a coherent API for quantum dynamics and control. It re-exports functionality from QuantumPropagators.jl and organizes quantum control workflows. |
| 27 | + |
| 28 | +### Key Components |
| 29 | + |
| 30 | +**Main Module Structure:** |
| 31 | +- `src/QuantumControl.jl` - Main module with submodules for Generators, Controls, Shapes, Storage, Amplitudes, and Interfaces |
| 32 | +- Re-exports QuantumPropagators functionality through organized submodules |
| 33 | +- Each submodule uses `@reexport_members` macro to expose underlying functionality |
| 34 | + |
| 35 | +**Core Abstractions:** |
| 36 | +- `ControlProblem` (`src/control_problem.jl`) - Defines multi-trajectory optimization problems |
| 37 | +- `Trajectory` (`src/trajectories.jl`) - Describes time evolution of quantum states under generators |
| 38 | +- `optimize` (`src/optimize.jl`) - Main optimization interface that delegates to specific methods (Krotov, GRAPE, etc.) |
| 39 | + |
| 40 | +**Supporting Infrastructure:** |
| 41 | +- `src/functionals.jl` - Optimization functionals submodule |
| 42 | +- `src/pulse_parameterizations.jl` - Pulse parameterization utilities |
| 43 | +- `src/workflows.jl` - High-level workflow utilities (run_or_load, save/load optimization) |
| 44 | +- `src/callbacks.jl` - Optimization callback system |
| 45 | +- `src/interfaces/` - Interface validation for amplitudes and generators |
| 46 | + |
| 47 | +### Development Environment |
| 48 | +- Uses `devrepl.jl` for development setup with automatic package installation |
| 49 | +- Test environment in `test/` with comprehensive suite covering all major functionality |
| 50 | +- Documentation system uses Documenter.jl with custom themes and API generation |
| 51 | + |
| 52 | +### Dependencies and Extensions |
| 53 | +- Core dependency: QuantumPropagators.jl for propagation functionality |
| 54 | +- Optional extensions for FiniteDifferences.jl and Zygote.jl for automatic differentiation |
| 55 | +- Integration with optimization packages (Krotov.jl, GRAPE.jl) via method dispatch |
| 56 | + |
| 57 | +### Testing Strategy |
| 58 | +- Comprehensive test suite with SafeTestsets for isolation |
| 59 | +- Tests for interfaces, propagation, optimization, parameterization, and workflows |
| 60 | +- Coverage reporting and CI integration |
| 61 | +- Downstream testing of Krotov and GRAPE packages |
0 commit comments